From ed9ae094cec080ab123e056f37dd89528819aaa1 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 12 Oct 2023 04:22:06 +0000 Subject: [PATCH] CodeGen from PR 25896 in Azure/azure-rest-api-specs Merge e4c03b5aefeac9c2f21f862b3209f3538a2b9dea into 43c5786b7d90124e46fe068894694ac899965948 --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../CHANGELOG.md | 5 + .../README.md | 107 + .../SAMPLE.md | 4564 +++++++++++++++++ .../pom.xml | 62 + .../WorkloadsManager.java | 365 ++ .../fluent/OperationsClient.java | 38 + .../fluent/ResourceProvidersClient.java | 133 + .../SapApplicationServerInstancesClient.java | 402 ++ .../fluent/SapCentralInstancesClient.java | 426 ++ .../fluent/SapDatabaseInstancesClient.java | 417 ++ .../fluent/SapVirtualInstancesClient.java | 393 ++ .../fluent/WorkloadsClient.java | 88 + .../fluent/models/OperationInner.java | 127 + .../models/OperationStatusResultInner.java | 247 + .../SapApplicationServerInstanceInner.java | 226 + .../SapApplicationServerProperties.java | 281 + ...SapAvailabilityZoneDetailsResultInner.java | 56 + .../models/SapCentralServerInstanceInner.java | 269 + .../models/SapCentralServerProperties.java | 312 ++ .../models/SapDatabaseInstanceInner.java | 163 + .../fluent/models/SapDatabaseProperties.java | 176 + .../SapDiskConfigurationsResultInner.java | 68 + .../SapSizingRecommendationResultInner.java | 38 + .../SapSupportedResourceSkusResultInner.java | 55 + .../models/SapVirtualInstanceInner.java | 296 ++ .../models/SapVirtualInstanceProperties.java | 287 ++ .../fluent/models/package-info.java | 9 + .../fluent/package-info.java | 9 + .../implementation/OperationImpl.java | 53 + .../OperationStatusResultImpl.java | 77 + .../implementation/OperationsClientImpl.java | 276 + .../implementation/OperationsImpl.java | 47 + .../ResourceProvidersClientImpl.java | 696 +++ .../implementation/ResourceProvidersImpl.java | 144 + .../SapApplicationServerInstanceImpl.java | 303 ++ ...pApplicationServerInstancesClientImpl.java | 2232 ++++++++ .../SapApplicationServerInstancesImpl.java | 279 + .../SapAvailabilityZoneDetailsResultImpl.java | 42 + .../SapCentralInstancesClientImpl.java | 2274 ++++++++ .../SapCentralInstancesImpl.java | 275 + .../SapCentralServerInstanceImpl.java | 313 ++ .../SapDatabaseInstanceImpl.java | 268 + .../SapDatabaseInstancesClientImpl.java | 2250 ++++++++ .../SapDatabaseInstancesImpl.java | 275 + .../SapDiskConfigurationsResultImpl.java | 42 + .../SapSizingRecommendationResultImpl.java | 30 + .../SapSupportedResourceSkusResultImpl.java | 42 + .../SapVirtualInstanceImpl.java | 301 ++ .../SapVirtualInstancesClientImpl.java | 2345 +++++++++ .../SapVirtualInstancesImpl.java | 225 + .../implementation/Utils.java | 204 + .../WorkloadsClientBuilder.java | 144 + .../implementation/WorkloadsClientImpl.java | 360 ++ .../implementation/package-info.java | 9 + .../models/ActionType.java | 44 + .../ApplicationServerConfiguration.java | 121 + .../ApplicationServerFullResourceNames.java | 85 + .../ApplicationServerVirtualMachineType.java | 51 + .../models/ApplicationServerVmDetails.java | 75 + .../models/CentralServerConfiguration.java | 120 + .../CentralServerFullResourceNames.java | 117 + .../CentralServerVirtualMachineType.java | 62 + .../models/CentralServerVmDetails.java | 75 + .../models/ConfigurationType.java | 50 + .../CreateAndMountFileShareConfiguration.java | 91 + .../models/DatabaseConfiguration.java | 174 + .../DatabaseServerFullResourceNames.java | 114 + .../models/DatabaseVmDetails.java | 75 + .../models/DeployerVmPackages.java | 76 + .../models/DeploymentConfiguration.java | 115 + .../models/DeploymentWithOSConfiguration.java | 144 + .../models/DiscoveryConfiguration.java | 108 + .../models/DiskConfiguration.java | 67 + .../models/DiskDetails.java | 209 + .../models/DiskSku.java | 50 + .../models/DiskSkuName.java | 62 + .../models/DiskVolumeConfiguration.java | 105 + .../EnqueueReplicationServerProperties.java | 129 + .../models/EnqueueReplicationServerType.java | 47 + .../models/EnqueueServerProperties.java | 84 + .../models/ErrorDefinition.java | 73 + ...rnalInstallationSoftwareConfiguration.java | 58 + .../models/FileShareConfiguration.java | 40 + .../models/GatewayServerProperties.java | 54 + .../models/HighAvailabilityConfiguration.java | 59 + ...HighAvailabilitySoftwareConfiguration.java | 95 + .../models/ImageReference.java | 176 + .../models/InfrastructureConfiguration.java | 72 + .../models/LinuxConfiguration.java | 121 + .../models/LoadBalancerDetails.java | 39 + .../models/LoadBalancerResourceNames.java | 141 + .../models/ManagedRGConfiguration.java | 50 + .../ManagedResourcesNetworkAccessType.java | 47 + .../models/ManagedServiceIdentityType.java | 47 + .../models/MessageServerProperties.java | 129 + .../models/MountFileShareConfiguration.java | 99 + .../models/NamingPatternType.java | 44 + .../models/NetworkConfiguration.java | 53 + .../models/NetworkInterfaceResourceNames.java | 62 + .../models/OSConfiguration.java | 36 + .../models/OSProfile.java | 155 + .../models/OSType.java | 47 + .../models/Operation.java | 57 + .../models/OperationDisplay.java | 91 + .../models/OperationListResult.java | 62 + .../models/OperationStatusResult.java | 78 + .../models/Operations.java | 33 + .../models/Origin.java | 53 + .../models/OsSapConfiguration.java | 79 + .../models/ResourceProviders.java | 115 + .../models/SapApplicationServerInstance.java | 374 ++ .../SapApplicationServerInstanceList.java | 81 + .../models/SapApplicationServerInstances.java | 222 + .../SapAvailabilityZoneDetailsRequest.java | 123 + .../SapAvailabilityZoneDetailsResult.java | 27 + .../models/SapAvailabilityZonePair.java | 76 + .../models/SapCentralInstanceList.java | 81 + .../models/SapCentralInstances.java | 229 + .../models/SapCentralServerInstance.java | 414 ++ .../models/SapConfiguration.java | 37 + .../models/SapConfigurationType.java | 50 + .../models/SapDatabaseInstance.java | 326 ++ .../models/SapDatabaseInstanceList.java | 81 + .../models/SapDatabaseInstances.java | 222 + .../models/SapDatabaseScaleMethod.java | 44 + .../models/SapDatabaseType.java | 47 + .../models/SapDeploymentType.java | 47 + .../models/SapDiskConfiguration.java | 85 + .../models/SapDiskConfigurationsRequest.java | 219 + .../models/SapDiskConfigurationsResult.java | 28 + .../models/SapEnvironmentType.java | 47 + .../models/SapHealthState.java | 53 + .../models/SapHighAvailabilityType.java | 47 + ...lWithoutOSConfigSoftwareConfiguration.java | 161 + .../models/SapProductType.java | 50 + .../SapSizingRecommendationRequest.java | 291 ++ .../models/SapSizingRecommendationResult.java | 19 + .../models/SapSoftwareInstallationType.java | 51 + .../SapSupportedResourceSkusResult.java | 27 + .../models/SapSupportedSku.java | 102 + .../models/SapSupportedSkusRequest.java | 213 + .../models/SapVirtualInstance.java | 450 ++ .../models/SapVirtualInstanceError.java | 53 + .../models/SapVirtualInstanceList.java | 81 + .../SapVirtualInstanceProvisioningState.java | 60 + .../models/SapVirtualInstanceState.java | 86 + .../models/SapVirtualInstanceStatus.java | 62 + .../models/SapVirtualInstances.java | 218 + ...ServiceInitiatedSoftwareConfiguration.java | 224 + .../models/SharedStorageResourceNames.java | 83 + .../models/SingleServerConfiguration.java | 225 + .../SingleServerCustomResourceNames.java | 36 + .../models/SingleServerFullResourceNames.java | 62 + .../SingleServerRecommendationResult.java | 57 + .../models/SkipFileShareConfiguration.java | 32 + .../models/SoftwareConfiguration.java | 39 + .../models/SshConfiguration.java | 54 + .../models/SshKeyPair.java | 80 + .../models/SshPublicKey.java | 60 + .../models/StartRequest.java | 52 + .../models/StopRequest.java | 84 + .../models/StorageConfiguration.java | 57 + .../models/StorageInformation.java | 39 + .../models/ThreeTierConfiguration.java | 263 + .../models/ThreeTierCustomResourceNames.java | 36 + .../models/ThreeTierFullResourceNames.java | 155 + .../models/ThreeTierRecommendationResult.java | 187 + .../UpdateSapApplicationInstanceRequest.java | 53 + .../UpdateSapCentralInstanceRequest.java | 53 + .../UpdateSapDatabaseInstanceRequest.java | 53 + .../UpdateSapVirtualInstanceProperties.java | 65 + .../UpdateSapVirtualInstanceRequest.java | 111 + .../models/UserAssignedIdentity.java | 55 + .../models/UserAssignedServiceIdentity.java | 99 + .../models/VirtualMachineConfiguration.java | 127 + .../models/VirtualMachineResourceNames.java | 194 + .../models/WindowsConfiguration.java | 29 + .../models/package-info.java | 9 + .../package-info.java | 8 + .../src/main/java/module-info.java | 19 + .../generated/OperationsListSamples.java | 21 + ...iderSapAvailabilityZoneDetailsSamples.java | 54 + ...eProviderSapDiskConfigurationsSamples.java | 62 + ...oviderSapSizingRecommendationsSamples.java | 122 + ...esourceProviderSapSupportedSkuSamples.java | 109 + ...plicationServerInstancesCreateSamples.java | 61 + ...plicationServerInstancesDeleteSamples.java | 21 + ...pApplicationServerInstancesGetSamples.java | 23 + ...ApplicationServerInstancesListSamples.java | 21 + ...onServerInstancesStartInstanceSamples.java | 41 + ...ionServerInstancesStopInstanceSamples.java | 50 + ...plicationServerInstancesUpdateSamples.java | 42 + .../SapCentralInstancesCreateSamples.java | 61 + .../SapCentralInstancesDeleteSamples.java | 21 + .../SapCentralInstancesGetSamples.java | 23 + .../SapCentralInstancesListSamples.java | 21 + ...pCentralInstancesStartInstanceSamples.java | 45 + ...apCentralInstancesStopInstanceSamples.java | 50 + .../SapCentralInstancesUpdateSamples.java | 42 + .../SapDatabaseInstancesCreateSamples.java | 61 + .../SapDatabaseInstancesDeleteSamples.java | 21 + .../SapDatabaseInstancesGetSamples.java | 23 + .../SapDatabaseInstancesListSamples.java | 21 + ...DatabaseInstancesStartInstanceSamples.java | 39 + ...pDatabaseInstancesStopInstanceSamples.java | 50 + .../SapDatabaseInstancesUpdateSamples.java | 42 + .../SapVirtualInstancesCreateSamples.java | 3139 ++++++++++++ .../SapVirtualInstancesDeleteSamples.java | 21 + ...ualInstancesGetByResourceGroupSamples.java | 38 + ...alInstancesListByResourceGroupSamples.java | 21 + .../SapVirtualInstancesListSamples.java | 21 + .../SapVirtualInstancesStartSamples.java | 38 + .../SapVirtualInstancesStopSamples.java | 44 + .../SapVirtualInstancesUpdateSamples.java | 75 + .../ci.yml | 47 + .../pom.xml | 15 + 218 files changed, 40032 insertions(+) create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/CHANGELOG.md create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/README.md create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/SAMPLE.md create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/pom.xml create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/WorkloadsManager.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/OperationsClient.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/ResourceProvidersClient.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/SapApplicationServerInstancesClient.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/SapCentralInstancesClient.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/SapDatabaseInstancesClient.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/SapVirtualInstancesClient.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/WorkloadsClient.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/OperationInner.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/OperationStatusResultInner.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/SapApplicationServerInstanceInner.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/SapApplicationServerProperties.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/SapAvailabilityZoneDetailsResultInner.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/SapCentralServerInstanceInner.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/SapCentralServerProperties.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/SapDatabaseInstanceInner.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/SapDatabaseProperties.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/SapDiskConfigurationsResultInner.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/SapSizingRecommendationResultInner.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/SapSupportedResourceSkusResultInner.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/SapVirtualInstanceInner.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/SapVirtualInstanceProperties.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/package-info.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/package-info.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/OperationImpl.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/OperationStatusResultImpl.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/OperationsClientImpl.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/OperationsImpl.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/ResourceProvidersClientImpl.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/ResourceProvidersImpl.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapApplicationServerInstanceImpl.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapApplicationServerInstancesClientImpl.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapApplicationServerInstancesImpl.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapAvailabilityZoneDetailsResultImpl.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapCentralInstancesClientImpl.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapCentralInstancesImpl.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapCentralServerInstanceImpl.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapDatabaseInstanceImpl.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapDatabaseInstancesClientImpl.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapDatabaseInstancesImpl.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapDiskConfigurationsResultImpl.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapSizingRecommendationResultImpl.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapSupportedResourceSkusResultImpl.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapVirtualInstanceImpl.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapVirtualInstancesClientImpl.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapVirtualInstancesImpl.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/Utils.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/WorkloadsClientBuilder.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/WorkloadsClientImpl.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/package-info.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ActionType.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ApplicationServerConfiguration.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ApplicationServerFullResourceNames.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ApplicationServerVirtualMachineType.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ApplicationServerVmDetails.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/CentralServerConfiguration.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/CentralServerFullResourceNames.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/CentralServerVirtualMachineType.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/CentralServerVmDetails.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ConfigurationType.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/CreateAndMountFileShareConfiguration.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/DatabaseConfiguration.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/DatabaseServerFullResourceNames.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/DatabaseVmDetails.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/DeployerVmPackages.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/DeploymentConfiguration.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/DeploymentWithOSConfiguration.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/DiscoveryConfiguration.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/DiskConfiguration.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/DiskDetails.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/DiskSku.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/DiskSkuName.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/DiskVolumeConfiguration.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/EnqueueReplicationServerProperties.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/EnqueueReplicationServerType.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/EnqueueServerProperties.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ErrorDefinition.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ExternalInstallationSoftwareConfiguration.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/FileShareConfiguration.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/GatewayServerProperties.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/HighAvailabilityConfiguration.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/HighAvailabilitySoftwareConfiguration.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ImageReference.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/InfrastructureConfiguration.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/LinuxConfiguration.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/LoadBalancerDetails.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/LoadBalancerResourceNames.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ManagedRGConfiguration.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ManagedResourcesNetworkAccessType.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ManagedServiceIdentityType.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/MessageServerProperties.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/MountFileShareConfiguration.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/NamingPatternType.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/NetworkConfiguration.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/NetworkInterfaceResourceNames.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/OSConfiguration.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/OSProfile.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/OSType.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/Operation.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/OperationDisplay.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/OperationListResult.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/OperationStatusResult.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/Operations.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/Origin.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/OsSapConfiguration.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ResourceProviders.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapApplicationServerInstance.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapApplicationServerInstanceList.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapApplicationServerInstances.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapAvailabilityZoneDetailsRequest.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapAvailabilityZoneDetailsResult.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapAvailabilityZonePair.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapCentralInstanceList.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapCentralInstances.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapCentralServerInstance.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapConfiguration.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapConfigurationType.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapDatabaseInstance.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapDatabaseInstanceList.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapDatabaseInstances.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapDatabaseScaleMethod.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapDatabaseType.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapDeploymentType.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapDiskConfiguration.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapDiskConfigurationsRequest.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapDiskConfigurationsResult.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapEnvironmentType.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapHealthState.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapHighAvailabilityType.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapInstallWithoutOSConfigSoftwareConfiguration.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapProductType.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapSizingRecommendationRequest.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapSizingRecommendationResult.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapSoftwareInstallationType.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapSupportedResourceSkusResult.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapSupportedSku.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapSupportedSkusRequest.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapVirtualInstance.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapVirtualInstanceError.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapVirtualInstanceList.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapVirtualInstanceProvisioningState.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapVirtualInstanceState.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapVirtualInstanceStatus.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapVirtualInstances.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ServiceInitiatedSoftwareConfiguration.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SharedStorageResourceNames.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SingleServerConfiguration.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SingleServerCustomResourceNames.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SingleServerFullResourceNames.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SingleServerRecommendationResult.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SkipFileShareConfiguration.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SoftwareConfiguration.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SshConfiguration.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SshKeyPair.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SshPublicKey.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/StartRequest.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/StopRequest.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/StorageConfiguration.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/StorageInformation.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ThreeTierConfiguration.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ThreeTierCustomResourceNames.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ThreeTierFullResourceNames.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ThreeTierRecommendationResult.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/UpdateSapApplicationInstanceRequest.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/UpdateSapCentralInstanceRequest.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/UpdateSapDatabaseInstanceRequest.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/UpdateSapVirtualInstanceProperties.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/UpdateSapVirtualInstanceRequest.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/UserAssignedIdentity.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/UserAssignedServiceIdentity.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/VirtualMachineConfiguration.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/VirtualMachineResourceNames.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/WindowsConfiguration.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/package-info.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/package-info.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/module-info.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/OperationsListSamples.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/ResourceProviderSapAvailabilityZoneDetailsSamples.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/ResourceProviderSapDiskConfigurationsSamples.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/ResourceProviderSapSizingRecommendationsSamples.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/ResourceProviderSapSupportedSkuSamples.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapApplicationServerInstancesCreateSamples.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapApplicationServerInstancesDeleteSamples.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapApplicationServerInstancesGetSamples.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapApplicationServerInstancesListSamples.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapApplicationServerInstancesStartInstanceSamples.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapApplicationServerInstancesStopInstanceSamples.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapApplicationServerInstancesUpdateSamples.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapCentralInstancesCreateSamples.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapCentralInstancesDeleteSamples.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapCentralInstancesGetSamples.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapCentralInstancesListSamples.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapCentralInstancesStartInstanceSamples.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapCentralInstancesStopInstanceSamples.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapCentralInstancesUpdateSamples.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapDatabaseInstancesCreateSamples.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapDatabaseInstancesDeleteSamples.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapDatabaseInstancesGetSamples.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapDatabaseInstancesListSamples.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapDatabaseInstancesStartInstanceSamples.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapDatabaseInstancesStopInstanceSamples.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapDatabaseInstancesUpdateSamples.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapVirtualInstancesCreateSamples.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapVirtualInstancesDeleteSamples.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapVirtualInstancesGetByResourceGroupSamples.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapVirtualInstancesListByResourceGroupSamples.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapVirtualInstancesListSamples.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapVirtualInstancesStartSamples.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapVirtualInstancesStopSamples.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapVirtualInstancesUpdateSamples.java create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/ci.yml create mode 100644 sdk/workloadsmicrosoftworkloadssapvirtualinstance/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 53f44d9cf2ca0..e344a6bfa4952 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -431,6 +431,7 @@ com.azure.resourcemanager:azure-resourcemanager-hdinsight-containers;1.0.0-beta. com.azure.resourcemanager:azure-resourcemanager-apicenter;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-hybridconnectivity;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-playwrighttesting;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1 com.azure.tools:azure-sdk-build-tool;1.0.0;1.1.0-beta.1 diff --git a/pom.xml b/pom.xml index 2933b7b5264a6..3713046530f25 100644 --- a/pom.xml +++ b/pom.xml @@ -201,5 +201,6 @@ sdk/voiceservices sdk/webpubsub sdk/workloads + sdk/workloadsmicrosoftworkloadssapvirtualinstance diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/CHANGELOG.md b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/CHANGELOG.md new file mode 100644 index 0000000000000..dfa634fb3b944 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2023-10-12) + +- Azure Resource Manager Workloads client library for Java. This package contains Microsoft Azure SDK for Workloads Management SDK. Workloads client provides access to various workload operations. Package tag package-preview-2023-10. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/README.md b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/README.md new file mode 100644 index 0000000000000..70d953da177e4 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/README.md @@ -0,0 +1,107 @@ +# Azure Resource Manager Workloads client library for Java + +Azure Resource Manager Workloads client library for Java. + +This package contains Microsoft Azure SDK for Workloads Management SDK. Workloads client provides access to various workload operations. Package tag package-preview-2023-10. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configuration of the following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. + +With above configuration, `azure` client can be authenticated using the following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +WorkloadsManager manager = WorkloadsManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide][cg]. + +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fworkloadsmicrosoftworkloadssapvirtualinstance%2Fazure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance%2FREADME.png) diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/SAMPLE.md b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/SAMPLE.md new file mode 100644 index 0000000000000..3330556761777 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/SAMPLE.md @@ -0,0 +1,4564 @@ +# Code snippets and samples + + +## Operations + +- [List](#operations_list) + +## ResourceProvider + +- [SapAvailabilityZoneDetails](#resourceprovider_sapavailabilityzonedetails) +- [SapDiskConfigurations](#resourceprovider_sapdiskconfigurations) +- [SapSizingRecommendations](#resourceprovider_sapsizingrecommendations) +- [SapSupportedSku](#resourceprovider_sapsupportedsku) + +## SapApplicationServerInstances + +- [Create](#sapapplicationserverinstances_create) +- [Delete](#sapapplicationserverinstances_delete) +- [Get](#sapapplicationserverinstances_get) +- [List](#sapapplicationserverinstances_list) +- [StartInstance](#sapapplicationserverinstances_startinstance) +- [StopInstance](#sapapplicationserverinstances_stopinstance) +- [Update](#sapapplicationserverinstances_update) + +## SapCentralInstances + +- [Create](#sapcentralinstances_create) +- [Delete](#sapcentralinstances_delete) +- [Get](#sapcentralinstances_get) +- [List](#sapcentralinstances_list) +- [StartInstance](#sapcentralinstances_startinstance) +- [StopInstance](#sapcentralinstances_stopinstance) +- [Update](#sapcentralinstances_update) + +## SapDatabaseInstances + +- [Create](#sapdatabaseinstances_create) +- [Delete](#sapdatabaseinstances_delete) +- [Get](#sapdatabaseinstances_get) +- [List](#sapdatabaseinstances_list) +- [StartInstance](#sapdatabaseinstances_startinstance) +- [StopInstance](#sapdatabaseinstances_stopinstance) +- [Update](#sapdatabaseinstances_update) + +## SapVirtualInstances + +- [Create](#sapvirtualinstances_create) +- [Delete](#sapvirtualinstances_delete) +- [GetByResourceGroup](#sapvirtualinstances_getbyresourcegroup) +- [List](#sapvirtualinstances_list) +- [ListByResourceGroup](#sapvirtualinstances_listbyresourcegroup) +- [Start](#sapvirtualinstances_start) +- [Stop](#sapvirtualinstances_stop) +- [Update](#sapvirtualinstances_update) +### Operations_List + +```java +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/operations/preview/2023-10-01-preview/examples/Operations_List.json + */ + /** + * Sample code: Operations. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void operations( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### ResourceProvider_SapAvailabilityZoneDetails + +```java +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapAvailabilityZoneDetailsRequest; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapDatabaseType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapProductType; + +/** Samples for ResourceProvider SapAvailabilityZoneDetails. */ +public final class ResourceProviderSapAvailabilityZoneDetailsSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPAvailabilityZoneDetails_northeurope.json + */ + /** + * Sample code: SAPAvailabilityZoneDetails_northeurope. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPAvailabilityZoneDetailsNortheurope( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .resourceProviders() + .sapAvailabilityZoneDetailsWithResponse( + "centralus", + new SapAvailabilityZoneDetailsRequest() + .withAppLocation("northeurope") + .withSapProduct(SapProductType.S4HANA) + .withDatabaseType(SapDatabaseType.HANA), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPAvailabilityZoneDetails_eastus.json + */ + /** + * Sample code: SAPAvailabilityZoneDetails_eastus. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPAvailabilityZoneDetailsEastus( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .resourceProviders() + .sapAvailabilityZoneDetailsWithResponse( + "centralus", + new SapAvailabilityZoneDetailsRequest() + .withAppLocation("eastus") + .withSapProduct(SapProductType.S4HANA) + .withDatabaseType(SapDatabaseType.HANA), + com.azure.core.util.Context.NONE); + } +} +``` + +### ResourceProvider_SapDiskConfigurations + +```java +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapDatabaseType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapDeploymentType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapDiskConfigurationsRequest; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapEnvironmentType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapProductType; + +/** Samples for ResourceProvider SapDiskConfigurations. */ +public final class ResourceProviderSapDiskConfigurationsSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPDiskConfigurations_NonProd.json + */ + /** + * Sample code: SAPDiskConfigurations_NonProd. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPDiskConfigurationsNonProd( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .resourceProviders() + .sapDiskConfigurationsWithResponse( + "centralus", + new SapDiskConfigurationsRequest() + .withAppLocation("eastus") + .withEnvironment(SapEnvironmentType.NON_PROD) + .withSapProduct(SapProductType.S4HANA) + .withDatabaseType(SapDatabaseType.HANA) + .withDeploymentType(SapDeploymentType.THREE_TIER) + .withDbVmSku("Standard_M32ts"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPDiskConfigurations_Prod.json + */ + /** + * Sample code: SAPDiskConfigurations_Prod. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPDiskConfigurationsProd( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .resourceProviders() + .sapDiskConfigurationsWithResponse( + "centralus", + new SapDiskConfigurationsRequest() + .withAppLocation("eastus") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withDatabaseType(SapDatabaseType.HANA) + .withDeploymentType(SapDeploymentType.THREE_TIER) + .withDbVmSku("Standard_M32ts"), + com.azure.core.util.Context.NONE); + } +} +``` + +### ResourceProvider_SapSizingRecommendations + +```java +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapDatabaseScaleMethod; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapDatabaseType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapDeploymentType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapEnvironmentType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapHighAvailabilityType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapProductType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapSizingRecommendationRequest; + +/** Samples for ResourceProvider SapSizingRecommendations. */ +public final class ResourceProviderSapSizingRecommendationsSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPSizingRecommendations_S4HANA_Distributed.json + */ + /** + * Sample code: SAPSizingRecommendations_S4HANA_Distributed. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPSizingRecommendationsS4HANADistributed( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .resourceProviders() + .sapSizingRecommendationsWithResponse( + "centralus", + new SapSizingRecommendationRequest() + .withAppLocation("eastus") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withDeploymentType(SapDeploymentType.THREE_TIER) + .withSaps(20000L) + .withDbMemory(1024L) + .withDatabaseType(SapDatabaseType.HANA) + .withDbScaleMethod(SapDatabaseScaleMethod.SCALE_UP), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPSizingRecommendations_S4HANA_SingleServer.json + */ + /** + * Sample code: SAPSizingRecommendations_S4HANA_SingleServer. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPSizingRecommendationsS4HANASingleServer( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .resourceProviders() + .sapSizingRecommendationsWithResponse( + "centralus", + new SapSizingRecommendationRequest() + .withAppLocation("eastus") + .withEnvironment(SapEnvironmentType.NON_PROD) + .withSapProduct(SapProductType.S4HANA) + .withDeploymentType(SapDeploymentType.SINGLE_SERVER) + .withSaps(60000L) + .withDbMemory(2000L) + .withDatabaseType(SapDatabaseType.HANA) + .withDbScaleMethod(SapDatabaseScaleMethod.SCALE_UP), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPSizingRecommendations_S4HANA_HA_AvZone.json + */ + /** + * Sample code: SAPSizingRecommendations_S4HANA_DistributedHA_AvZone. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPSizingRecommendationsS4HANADistributedHAAvZone( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .resourceProviders() + .sapSizingRecommendationsWithResponse( + "centralus", + new SapSizingRecommendationRequest() + .withAppLocation("eastus") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withDeploymentType(SapDeploymentType.THREE_TIER) + .withSaps(75000L) + .withDbMemory(1024L) + .withDatabaseType(SapDatabaseType.HANA) + .withDbScaleMethod(SapDatabaseScaleMethod.SCALE_UP) + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_ZONE), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPSizingRecommendations_S4HANA_HA_AvSet.json + */ + /** + * Sample code: SAPSizingRecommendations_S4HANA_DistributedHA_AvSet. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPSizingRecommendationsS4HANADistributedHAAvSet( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .resourceProviders() + .sapSizingRecommendationsWithResponse( + "centralus", + new SapSizingRecommendationRequest() + .withAppLocation("eastus") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withDeploymentType(SapDeploymentType.THREE_TIER) + .withSaps(75000L) + .withDbMemory(1024L) + .withDatabaseType(SapDatabaseType.HANA) + .withDbScaleMethod(SapDatabaseScaleMethod.SCALE_UP) + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_SET), + com.azure.core.util.Context.NONE); + } +} +``` + +### ResourceProvider_SapSupportedSku + +```java +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapDatabaseType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapDeploymentType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapEnvironmentType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapHighAvailabilityType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapProductType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapSupportedSkusRequest; + +/** Samples for ResourceProvider SapSupportedSku. */ +public final class ResourceProviderSapSupportedSkuSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPSupportedSkus_SingleServer.json + */ + /** + * Sample code: SAPSupportedSkus_SingleServer. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPSupportedSkusSingleServer( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .resourceProviders() + .sapSupportedSkuWithResponse( + "centralus", + new SapSupportedSkusRequest() + .withAppLocation("eastus") + .withEnvironment(SapEnvironmentType.NON_PROD) + .withSapProduct(SapProductType.S4HANA) + .withDeploymentType(SapDeploymentType.SINGLE_SERVER) + .withDatabaseType(SapDatabaseType.HANA), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPSupportedSkus_Distributed.json + */ + /** + * Sample code: SAPSupportedSkus_Distributed. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPSupportedSkusDistributed( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .resourceProviders() + .sapSupportedSkuWithResponse( + "centralus", + new SapSupportedSkusRequest() + .withAppLocation("eastus") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withDeploymentType(SapDeploymentType.THREE_TIER) + .withDatabaseType(SapDatabaseType.HANA), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPSupportedSkus_DistributedHA_AvZone.json + */ + /** + * Sample code: SAPSupportedSkus_DistributedHA_AvZone. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPSupportedSkusDistributedHAAvZone( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .resourceProviders() + .sapSupportedSkuWithResponse( + "centralus", + new SapSupportedSkusRequest() + .withAppLocation("eastus") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withDeploymentType(SapDeploymentType.THREE_TIER) + .withDatabaseType(SapDatabaseType.HANA) + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_ZONE), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPSupportedSkus_DistributedHA_AvSet.json + */ + /** + * Sample code: SAPSupportedSkus_DistributedHA_AvSet. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPSupportedSkusDistributedHAAvSet( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .resourceProviders() + .sapSupportedSkuWithResponse( + "centralus", + new SapSupportedSkusRequest() + .withAppLocation("eastus") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withDeploymentType(SapDeploymentType.THREE_TIER) + .withDatabaseType(SapDatabaseType.HANA) + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_SET), + com.azure.core.util.Context.NONE); + } +} +``` + +### SapApplicationServerInstances_Create + +```java +import java.util.HashMap; +import java.util.Map; + +/** Samples for SapApplicationServerInstances Create. */ +public final class SapApplicationServerInstancesCreateSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapapplicationinstances/SAPApplicationServerInstances_Create.json + */ + /** + * Sample code: SAPApplicationServerInstances_Create. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPApplicationServerInstancesCreate( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapApplicationServerInstances() + .define("app01") + .withRegion("eastus") + .withExistingSapVirtualInstance("test-rg", "X00") + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapapplicationinstances/SAPApplicationServerInstances_Create_HA_AvSet.json + */ + /** + * Sample code: Create SAP Application Server Instances for HA System with Availability Set. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createSAPApplicationServerInstancesForHASystemWithAvailabilitySet( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapApplicationServerInstances() + .define("app01") + .withRegion("eastus") + .withExistingSapVirtualInstance("test-rg", "X00") + .withTags(mapOf()) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### SapApplicationServerInstances_Delete + +```java +/** Samples for SapApplicationServerInstances Delete. */ +public final class SapApplicationServerInstancesDeleteSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapapplicationinstances/SAPApplicationServerInstances_Delete.json + */ + /** + * Sample code: SAPApplicationServerInstances_Delete. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPApplicationServerInstancesDelete( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager.sapApplicationServerInstances().delete("test-rg", "X00", "app01", com.azure.core.util.Context.NONE); + } +} +``` + +### SapApplicationServerInstances_Get + +```java +/** Samples for SapApplicationServerInstances Get. */ +public final class SapApplicationServerInstancesGetSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapapplicationinstances/SAPApplicationServerInstances_Get.json + */ + /** + * Sample code: SAPApplicationServerInstances_Get. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPApplicationServerInstancesGet( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapApplicationServerInstances() + .getWithResponse("test-rg", "X00", "app01", com.azure.core.util.Context.NONE); + } +} +``` + +### SapApplicationServerInstances_List + +```java +/** Samples for SapApplicationServerInstances List. */ +public final class SapApplicationServerInstancesListSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapapplicationinstances/SAPApplicationServerInstances_List.json + */ + /** + * Sample code: SAPApplicationServerInstances_List. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPApplicationServerInstancesList( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager.sapApplicationServerInstances().list("test-rg", "X00", com.azure.core.util.Context.NONE); + } +} +``` + +### SapApplicationServerInstances_StartInstance + +```java +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StartRequest; + +/** Samples for SapApplicationServerInstances StartInstance. */ +public final class SapApplicationServerInstancesStartInstanceSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapapplicationinstances/SAPApplicationServerInstances_StartInstance_WithInfraOperations.json + */ + /** + * Sample code: Start Virtual Machine and the SAP Application Server Instance on it. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void startVirtualMachineAndTheSAPApplicationServerInstanceOnIt( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapApplicationServerInstances() + .startInstance( + "test-rg", "X00", "app01", new StartRequest().withStartVm(true), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapapplicationinstances/SAPApplicationServerInstances_StartInstance.json + */ + /** + * Sample code: Start the SAP Application Server Instance. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void startTheSAPApplicationServerInstance( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapApplicationServerInstances() + .startInstance("test-rg", "X00", "app01", null, com.azure.core.util.Context.NONE); + } +} +``` + +### SapApplicationServerInstances_StopInstance + +```java +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StopRequest; + +/** Samples for SapApplicationServerInstances StopInstance. */ +public final class SapApplicationServerInstancesStopInstanceSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapapplicationinstances/SAPApplicationServerInstances_StopInstance_WithInfraOperations.json + */ + /** + * Sample code: Stop the SAP Application Server Instance and the Virtual machine. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void stopTheSAPApplicationServerInstanceAndTheVirtualMachine( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapApplicationServerInstances() + .stopInstance( + "test-rg", + "X00", + "app01", + new StopRequest().withSoftStopTimeoutSeconds(0L).withDeallocateVm(true), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapapplicationinstances/SAPApplicationServerInstances_StopInstance.json + */ + /** + * Sample code: Stop the SAP Application Server Instance. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void stopTheSAPApplicationServerInstance( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapApplicationServerInstances() + .stopInstance( + "test-rg", + "X00", + "app01", + new StopRequest().withSoftStopTimeoutSeconds(0L), + com.azure.core.util.Context.NONE); + } +} +``` + +### SapApplicationServerInstances_Update + +```java +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapApplicationServerInstance; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SapApplicationServerInstances Update. */ +public final class SapApplicationServerInstancesUpdateSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapapplicationinstances/SAPApplicationServerInstances_Update.json + */ + /** + * Sample code: SAPApplicationServerInstances_Update. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPApplicationServerInstancesUpdate( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + SapApplicationServerInstance resource = + manager + .sapApplicationServerInstances() + .getWithResponse("test-rg", "X00", "app01", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### SapCentralInstances_Create + +```java +import java.util.HashMap; +import java.util.Map; + +/** Samples for SapCentralInstances Create. */ +public final class SapCentralInstancesCreateSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapcentralinstances/SAPCentralInstances_Create_HA_AvSet.json + */ + /** + * Sample code: Create SAP Central Instances for HA System with Availability Set. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createSAPCentralInstancesForHASystemWithAvailabilitySet( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapCentralInstances() + .define("centralServer") + .withRegion("eastus") + .withExistingSapVirtualInstance("test-rg", "X00") + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapcentralinstances/SAPCentralInstances_Create.json + */ + /** + * Sample code: SAPCentralInstances_Create. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPCentralInstancesCreate( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapCentralInstances() + .define("centralServer") + .withRegion("eastus") + .withExistingSapVirtualInstance("test-rg", "X00") + .withTags(mapOf()) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### SapCentralInstances_Delete + +```java +/** Samples for SapCentralInstances Delete. */ +public final class SapCentralInstancesDeleteSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapcentralinstances/SAPCentralInstances_Delete.json + */ + /** + * Sample code: SAPCentralInstances_Delete. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPCentralInstancesDelete( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager.sapCentralInstances().delete("test-rg", "X00", "centralServer", com.azure.core.util.Context.NONE); + } +} +``` + +### SapCentralInstances_Get + +```java +/** Samples for SapCentralInstances Get. */ +public final class SapCentralInstancesGetSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapcentralinstances/SAPCentralInstances_Get.json + */ + /** + * Sample code: SAPCentralInstances_Get. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPCentralInstancesGet( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapCentralInstances() + .getWithResponse("test-rg", "X00", "centralServer", com.azure.core.util.Context.NONE); + } +} +``` + +### SapCentralInstances_List + +```java +/** Samples for SapCentralInstances List. */ +public final class SapCentralInstancesListSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapcentralinstances/SAPCentralInstances_List.json + */ + /** + * Sample code: SAPCentralInstances_List. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPCentralInstancesList( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager.sapCentralInstances().list("test-rg", "X00", com.azure.core.util.Context.NONE); + } +} +``` + +### SapCentralInstances_StartInstance + +```java +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StartRequest; + +/** Samples for SapCentralInstances StartInstance. */ +public final class SapCentralInstancesStartInstanceSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapcentralinstances/SAPCentralInstances_StartInstance_WithInfraOperations.json + */ + /** + * Sample code: Start the virtual machine(s) and the SAP central services instance on it. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void startTheVirtualMachineSAndTheSAPCentralServicesInstanceOnIt( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapCentralInstances() + .startInstance( + "test-rg", + "X00", + "centralServer", + new StartRequest().withStartVm(true), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapcentralinstances/SAPCentralInstances_StartInstance.json + */ + /** + * Sample code: Start the SAP Central Services Instance. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void startTheSAPCentralServicesInstance( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapCentralInstances() + .startInstance("test-rg", "X00", "centralServer", null, com.azure.core.util.Context.NONE); + } +} +``` + +### SapCentralInstances_StopInstance + +```java +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StopRequest; + +/** Samples for SapCentralInstances StopInstance. */ +public final class SapCentralInstancesStopInstanceSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapcentralinstances/SAPCentralInstances_StopInstance.json + */ + /** + * Sample code: Stop the SAP Central Services Instance. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void stopTheSAPCentralServicesInstance( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapCentralInstances() + .stopInstance( + "test-rg", + "X00", + "centralServer", + new StopRequest().withSoftStopTimeoutSeconds(1200L), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapcentralinstances/SAPCentralInstances_StopInstance_WithInfraOperations.json + */ + /** + * Sample code: Stop the SAP Central Services Instance and its underlying Virtual Machine(s). + * + * @param manager Entry point to WorkloadsManager. + */ + public static void stopTheSAPCentralServicesInstanceAndItsUnderlyingVirtualMachineS( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapCentralInstances() + .stopInstance( + "test-rg", + "X00", + "centralServer", + new StopRequest().withDeallocateVm(true), + com.azure.core.util.Context.NONE); + } +} +``` + +### SapCentralInstances_Update + +```java +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapCentralServerInstance; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SapCentralInstances Update. */ +public final class SapCentralInstancesUpdateSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapcentralinstances/SAPCentralInstances_Update.json + */ + /** + * Sample code: SAPCentralInstances_Update. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPCentralInstancesUpdate( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + SapCentralServerInstance resource = + manager + .sapCentralInstances() + .getWithResponse("test-rg", "X00", "centralServer", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### SapDatabaseInstances_Create + +```java +import java.util.HashMap; +import java.util.Map; + +/** Samples for SapDatabaseInstances Create. */ +public final class SapDatabaseInstancesCreateSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapdatabaseinstances/SAPDatabaseInstances_Create_HA_AvSet.json + */ + /** + * Sample code: Create SAP Database Instances for HA System with Availability Set. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createSAPDatabaseInstancesForHASystemWithAvailabilitySet( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapDatabaseInstances() + .define("databaseServer") + .withRegion("eastus") + .withExistingSapVirtualInstance("test-rg", "X00") + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapdatabaseinstances/SAPDatabaseInstances_Create.json + */ + /** + * Sample code: SAPDatabaseInstances_Create. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPDatabaseInstancesCreate( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapDatabaseInstances() + .define("databaseServer") + .withRegion("eastus") + .withExistingSapVirtualInstance("test-rg", "X00") + .withTags(mapOf()) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### SapDatabaseInstances_Delete + +```java +/** Samples for SapDatabaseInstances Delete. */ +public final class SapDatabaseInstancesDeleteSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapdatabaseinstances/SAPDatabaseInstances_Delete.json + */ + /** + * Sample code: SAPDatabaseInstances_Delete. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPDatabaseInstancesDelete( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager.sapDatabaseInstances().delete("test-rg", "X00", "databaseServer", com.azure.core.util.Context.NONE); + } +} +``` + +### SapDatabaseInstances_Get + +```java +/** Samples for SapDatabaseInstances Get. */ +public final class SapDatabaseInstancesGetSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapdatabaseinstances/SAPDatabaseInstances_Get.json + */ + /** + * Sample code: SAPDatabaseInstances_Get. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPDatabaseInstancesGet( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapDatabaseInstances() + .getWithResponse("test-rg", "X00", "databaseServer", com.azure.core.util.Context.NONE); + } +} +``` + +### SapDatabaseInstances_List + +```java +/** Samples for SapDatabaseInstances List. */ +public final class SapDatabaseInstancesListSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapdatabaseinstances/SAPDatabaseInstances_List.json + */ + /** + * Sample code: SAPDatabaseInstances_List. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPDatabaseInstancesList( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager.sapDatabaseInstances().list("test-rg", "X00", com.azure.core.util.Context.NONE); + } +} +``` + +### SapDatabaseInstances_StartInstance + +```java +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StartRequest; + +/** Samples for SapDatabaseInstances StartInstance. */ +public final class SapDatabaseInstancesStartInstanceSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapdatabaseinstances/SAPDatabaseInstances_StartInstance.json + */ + /** + * Sample code: Start the database instance of the SAP system. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void startTheDatabaseInstanceOfTheSAPSystem( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager.sapDatabaseInstances().startInstance("test-rg", "X00", "db0", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapdatabaseinstances/SAPDatabaseInstances_StartInstance_WithInfraOperations.json + */ + /** + * Sample code: Start Virtual Machine and the database instance of the SAP system on it. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void startVirtualMachineAndTheDatabaseInstanceOfTheSAPSystemOnIt( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapDatabaseInstances() + .startInstance( + "test-rg", "X00", "db0", new StartRequest().withStartVm(true), com.azure.core.util.Context.NONE); + } +} +``` + +### SapDatabaseInstances_StopInstance + +```java +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StopRequest; + +/** Samples for SapDatabaseInstances StopInstance. */ +public final class SapDatabaseInstancesStopInstanceSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapdatabaseinstances/SAPDatabaseInstances_StopInstance.json + */ + /** + * Sample code: Stop the database instance of the SAP system. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void stopTheDatabaseInstanceOfTheSAPSystem( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapDatabaseInstances() + .stopInstance( + "test-rg", + "X00", + "db0", + new StopRequest().withSoftStopTimeoutSeconds(0L), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapdatabaseinstances/SAPDatabaseInstances_StopInstance_WithInfraOperations.json + */ + /** + * Sample code: Stop the database instance of the SAP system and the underlying Virtual Machine(s). + * + * @param manager Entry point to WorkloadsManager. + */ + public static void stopTheDatabaseInstanceOfTheSAPSystemAndTheUnderlyingVirtualMachineS( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapDatabaseInstances() + .stopInstance( + "test-rg", + "X00", + "db0", + new StopRequest().withSoftStopTimeoutSeconds(0L).withDeallocateVm(true), + com.azure.core.util.Context.NONE); + } +} +``` + +### SapDatabaseInstances_Update + +```java +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapDatabaseInstance; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SapDatabaseInstances Update. */ +public final class SapDatabaseInstancesUpdateSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapdatabaseinstances/SAPDatabaseInstances_Update.json + */ + /** + * Sample code: SAPDatabaseInstances_Update. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPDatabaseInstancesUpdate( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + SapDatabaseInstance resource = + manager + .sapDatabaseInstances() + .getWithResponse("test-rg", "X00", "databaseServer", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### SapVirtualInstances_Create + +```java +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.ApplicationServerConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.ApplicationServerFullResourceNames; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.CentralServerConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.CentralServerFullResourceNames; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.CreateAndMountFileShareConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.DatabaseConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.DatabaseServerFullResourceNames; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.DeploymentConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.DeploymentWithOSConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.DiscoveryConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.DiskConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.DiskSku; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.DiskSkuName; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.DiskVolumeConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.ExternalInstallationSoftwareConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.HighAvailabilityConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.ImageReference; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.LinuxConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.LoadBalancerResourceNames; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.ManagedResourcesNetworkAccessType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.MountFileShareConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.NetworkConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.NetworkInterfaceResourceNames; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.OSProfile; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.OsSapConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapDatabaseType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapEnvironmentType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapHighAvailabilityType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapInstallWithoutOSConfigSoftwareConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapProductType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SharedStorageResourceNames; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SingleServerConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SkipFileShareConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SshConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SshKeyPair; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SshPublicKey; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StorageConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.ThreeTierConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.ThreeTierFullResourceNames; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.VirtualMachineConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.VirtualMachineResourceNames; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SapVirtualInstances Create. */ +public final class SapVirtualInstancesCreateSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Install_Distributed.json + */ + /** + * Sample code: Install SAP Software on Distributed System. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void installSAPSoftwareOnDistributedSystem( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus2") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentWithOSConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new ThreeTierConfiguration() + .withAppResourceGroup("{{resourcegrp}}") + .withNetworkConfiguration(new NetworkConfiguration().withIsSecondaryIpEnabled(true)) + .withCentralServer( + new CentralServerConfiguration() + .withSubnetId( + "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E4ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("8.2") + .withVersion("8.2.2021091201")) + .withOsProfile( + new OSProfile() + .withAdminUsername("azureuser") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withApplicationServer( + new ApplicationServerConfiguration() + .withSubnetId( + "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E4ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("8.2") + .withVersion("8.2.2021091201")) + .withOsProfile( + new OSProfile() + .withAdminUsername("azureuser") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withDatabaseServer( + new DatabaseConfiguration() + .withSubnetId( + "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_M32ts") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("8.2") + .withVersion("8.2.2021091201")) + .withOsProfile( + new OSProfile() + .withAdminUsername("azureuser") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L))) + .withSoftwareConfiguration( + new SapInstallWithoutOSConfigSoftwareConfiguration() + .withBomUrl( + "https://teststorageaccount.blob.core.windows.net/sapbits/sapfiles/boms/S41909SPS03_v0011ms/S41909SPS03_v0011ms.yaml") + .withSapBitsStorageAccountId( + "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Storage/storageAccounts/teststorageaccount") + .withSoftwareVersion("SAP S/4HANA 1909 SPS 03")) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("sap.bpaas.com"))) + .withTags(mapOf("created by", "azureuser")) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_HA_AvZone.json + */ + /** + * Sample code: Create Infrastructure only for HA System with Availability Zone. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createInfrastructureOnlyForHASystemWithAvailabilityZone( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new ThreeTierConfiguration() + .withAppResourceGroup("X00-RG") + .withCentralServer( + new CentralServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withKeyData( + "fakeTokenPlaceholder"))))))) + .withInstanceCount(2L)) + .withApplicationServer( + new ApplicationServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withKeyData( + "fakeTokenPlaceholder"))))))) + .withInstanceCount(6L)) + .withDatabaseServer( + new DatabaseConfiguration() + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_M32ts") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withKeyData( + "fakeTokenPlaceholder"))))))) + .withInstanceCount(2L)) + .withHighAvailabilityConfig( + new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_ZONE)))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_Distributed.json + */ + /** + * Sample code: Create Infrastructure with OS configuration for Distributed System (Recommended). + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createInfrastructureWithOSConfigurationForDistributedSystemRecommended( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentWithOSConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new ThreeTierConfiguration() + .withAppResourceGroup("X00-RG") + .withCentralServer( + new CentralServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withApplicationServer( + new ApplicationServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer( + new DatabaseConfiguration() + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_M32ts") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_DetectInstallation_SingleServer.json + */ + /** + * Sample code: Detect SAP Software Installation on a Single Server System. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void detectSAPSoftwareInstallationOnASingleServerSystem( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.NON_PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentWithOSConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new SingleServerConfiguration() + .withAppResourceGroup("X00-RG") + .withNetworkConfiguration(new NetworkConfiguration().withIsSecondaryIpEnabled(true)) + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder")))))) + .withSoftwareConfiguration( + new ExternalInstallationSoftwareConfiguration() + .withCentralServerVmId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0")) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_WithTrustedAccess.json + */ + /** + * Sample code: Create Infrastructure (with OS configuration) with trusted access enabled. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createInfrastructureWithOSConfigurationWithTrustedAccessEnabled( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentWithOSConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new ThreeTierConfiguration() + .withAppResourceGroup("X00-RG") + .withCentralServer( + new CentralServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withApplicationServer( + new ApplicationServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer( + new DatabaseConfiguration() + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_M32ts") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withTags(mapOf()) + .withManagedResourcesNetworkAccessType(ManagedResourcesNetworkAccessType.PRIVATE) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_DiskDetails_HA_AvSet.json + */ + /** + * Sample code: Create Infrastructure with Disk and OS configuration for HA System with Availability Set + * (Recommended). + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createInfrastructureWithDiskAndOSConfigurationForHASystemWithAvailabilitySetRecommended( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentWithOSConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new ThreeTierConfiguration() + .withAppResourceGroup("X00-RG") + .withCentralServer( + new CentralServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withApplicationServer( + new ApplicationServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer( + new DatabaseConfiguration() + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_M32ts") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L) + .withDiskConfiguration( + new DiskConfiguration() + .withDiskVolumeConfigurations( + mapOf( + "backup", + new DiskVolumeConfiguration() + .withCount(2L) + .withSizeGB(256L) + .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), + "hana/data", + new DiskVolumeConfiguration() + .withCount(4L) + .withSizeGB(128L) + .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), + "hana/log", + new DiskVolumeConfiguration() + .withCount(3L) + .withSizeGB(128L) + .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), + "hana/shared", + new DiskVolumeConfiguration() + .withCount(1L) + .withSizeGB(256L) + .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), + "os", + new DiskVolumeConfiguration() + .withCount(1L) + .withSizeGB(64L) + .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), + "usr/sap", + new DiskVolumeConfiguration() + .withCount(1L) + .withSizeGB(128L) + .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)))))) + .withHighAvailabilityConfig( + new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_SET))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_Discover_TrustedAccessEnable.json + */ + /** + * Sample code: Register with trusted access enabled. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void registerWithTrustedAccessEnabled( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("northeurope") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.NON_PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DiscoveryConfiguration() + .withCentralServerVmId( + "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0")) + .withTags(mapOf("createdby", "abc@microsoft.com", "test", "abc")) + .withManagedResourcesNetworkAccessType(ManagedResourcesNetworkAccessType.PRIVATE) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_Custom_Image.json + */ + /** + * Sample code: Create Infrastructure (with OS configuration) with Azure Compute Gallery Image. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createInfrastructureWithOSConfigurationWithAzureComputeGalleryImage( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new ThreeTierConfiguration() + .withAppResourceGroup("X00-RG") + .withCentralServer( + new CentralServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference( + new ImageReference() + .withId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/galleries/testgallery/images/rhelimagetest/versions/0.0.1")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withKeyData( + "fakeTokenPlaceholder"))))))) + .withInstanceCount(2L)) + .withApplicationServer( + new ApplicationServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/galleries/testgallery/images/rhelimagetest/versions/0.0.1")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withKeyData( + "fakeTokenPlaceholder"))))))) + .withInstanceCount(6L)) + .withDatabaseServer( + new DatabaseConfiguration() + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_M32ts") + .withImageReference( + new ImageReference() + .withId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/galleries/testgallery/images/rhelimagetest/versions/0.0.1")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withKeyData( + "fakeTokenPlaceholder"))))))) + .withInstanceCount(2L)) + .withHighAvailabilityConfig( + new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_ZONE)))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_HA_AvSet.json + */ + /** + * Sample code: Create Infrastructure only for HA System with Availability Set. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createInfrastructureOnlyForHASystemWithAvailabilitySet( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new ThreeTierConfiguration() + .withAppResourceGroup("X00-RG") + .withCentralServer( + new CentralServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withKeyData( + "fakeTokenPlaceholder"))))))) + .withInstanceCount(2L)) + .withApplicationServer( + new ApplicationServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withKeyData( + "fakeTokenPlaceholder"))))))) + .withInstanceCount(5L)) + .withDatabaseServer( + new DatabaseConfiguration() + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_M32ts") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withKeyData( + "fakeTokenPlaceholder"))))))) + .withInstanceCount(2L)) + .withHighAvailabilityConfig( + new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_SET)))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_DetectInstallation_HA_AvZone.json + */ + /** + * Sample code: Detect SAP Software Installation on an HA System with Availability Zone. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void detectSAPSoftwareInstallationOnAnHASystemWithAvailabilityZone( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentWithOSConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new ThreeTierConfiguration() + .withAppResourceGroup("X00-RG") + .withCentralServer( + new CentralServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withApplicationServer( + new ApplicationServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer( + new DatabaseConfiguration() + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_M32ts") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withHighAvailabilityConfig( + new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_ZONE))) + .withSoftwareConfiguration( + new ExternalInstallationSoftwareConfiguration() + .withCentralServerVmId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0")) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_SingleServer.json + */ + /** + * Sample code: Create Infrastructure only for Single Server System. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createInfrastructureOnlyForSingleServerSystem( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.NON_PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new SingleServerConfiguration() + .withAppResourceGroup("X00-RG") + .withNetworkConfiguration(new NetworkConfiguration().withIsSecondaryIpEnabled(true)) + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withKeyData("fakeTokenPlaceholder"))))))))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_Distributed_CreateTransport.json + */ + /** + * Sample code: Create Infrastructure with a new SAP Transport Directory Fileshare. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createInfrastructureWithANewSAPTransportDirectoryFileshare( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentWithOSConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new ThreeTierConfiguration() + .withAppResourceGroup("X00-RG") + .withCentralServer( + new CentralServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withApplicationServer( + new ApplicationServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer( + new DatabaseConfiguration() + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_M32ts") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withStorageConfiguration( + new StorageConfiguration() + .withTransportFileShareConfiguration( + new CreateAndMountFileShareConfiguration() + .withResourceGroup("rgName") + .withStorageAccountName("storageName")))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_Discover.json + */ + /** + * Sample code: Register existing SAP system as Virtual Instance for SAP solutions. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void registerExistingSAPSystemAsVirtualInstanceForSAPSolutions( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("northeurope") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.NON_PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DiscoveryConfiguration() + .withCentralServerVmId( + "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0")) + .withTags(mapOf("createdby", "abc@microsoft.com", "test", "abc")) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_CustomFullResourceNames_Distributed.json + */ + /** + * Sample code: Create Infrastructure (with OS configuration) with custom resource names for Distributed System. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createInfrastructureWithOSConfigurationWithCustomResourceNamesForDistributedSystem( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentWithOSConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new ThreeTierConfiguration() + .withAppResourceGroup("X00-RG") + .withCentralServer( + new CentralServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withApplicationServer( + new ApplicationServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer( + new DatabaseConfiguration() + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_M32ts") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withCustomResourceNames( + new ThreeTierFullResourceNames() + .withCentralServer( + new CentralServerFullResourceNames() + .withVirtualMachines( + Arrays + .asList( + new VirtualMachineResourceNames() + .withVmName("ascsvm") + .withHostname("ascshostName") + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("ascsnic"))) + .withOsDiskName("ascsosdisk") + .withDataDiskNames( + mapOf("default", Arrays.asList("ascsdisk0")))))) + .withApplicationServer( + new ApplicationServerFullResourceNames() + .withVirtualMachines( + Arrays + .asList( + new VirtualMachineResourceNames() + .withVmName("appvm0") + .withHostname("apphostName0") + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("appnic0"))) + .withOsDiskName("app0osdisk") + .withDataDiskNames( + mapOf("default", Arrays.asList("app0disk0"))), + new VirtualMachineResourceNames() + .withVmName("appvm1") + .withHostname("apphostName1") + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("appnic1"))) + .withOsDiskName("app1osdisk") + .withDataDiskNames( + mapOf("default", Arrays.asList("app1disk0"))))) + .withAvailabilitySetName("appAvSet")) + .withDatabaseServer( + new DatabaseServerFullResourceNames() + .withVirtualMachines( + Arrays + .asList( + new VirtualMachineResourceNames() + .withVmName("dbvm") + .withHostname("dbhostName") + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("dbnic"))) + .withOsDiskName("dbosdisk") + .withDataDiskNames( + mapOf( + "hanaData", + Arrays.asList("hanadata0", "hanadata1"), + "hanaLog", + Arrays.asList("hanalog0", "hanalog1", "hanalog2"), + "hanaShared", + Arrays.asList("hanashared0", "hanashared1"), + "usrSap", + Arrays.asList("usrsap0")))))) + .withSharedStorage( + new SharedStorageResourceNames() + .withSharedStorageAccountName("storageacc") + .withSharedStorageAccountPrivateEndPointName("peForxNFS")))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_CustomFullResourceNames_SingleServer.json + */ + /** + * Sample code: Create Infrastructure (with OS configuration) with custom resource names for Single Server System. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createInfrastructureWithOSConfigurationWithCustomResourceNamesForSingleServerSystem( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.NON_PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentWithOSConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new SingleServerConfiguration() + .withAppResourceGroup("X00-RG") + .withNetworkConfiguration(new NetworkConfiguration().withIsSecondaryIpEnabled(true)) + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder")))))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_CustomFullResourceNames_HA_AvZone.json + */ + /** + * Sample code: Create Infrastructure (with OS configuration) with custom resource names for HA system with + * Availability Zone. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createInfrastructureWithOSConfigurationWithCustomResourceNamesForHASystemWithAvailabilityZone( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentWithOSConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new ThreeTierConfiguration() + .withAppResourceGroup("X00-RG") + .withCentralServer( + new CentralServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withApplicationServer( + new ApplicationServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer( + new DatabaseConfiguration() + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_M32ts") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withHighAvailabilityConfig( + new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_ZONE)) + .withCustomResourceNames( + new ThreeTierFullResourceNames() + .withCentralServer( + new CentralServerFullResourceNames() + .withVirtualMachines( + Arrays + .asList( + new VirtualMachineResourceNames() + .withVmName("ascsvm") + .withHostname("ascshostName") + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("ascsnic"))) + .withOsDiskName("ascsosdisk"), + new VirtualMachineResourceNames() + .withVmName("ersvm") + .withHostname("ershostName") + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("ersnic"))) + .withOsDiskName("ersosdisk"))) + .withLoadBalancer( + new LoadBalancerResourceNames() + .withLoadBalancerName("ascslb") + .withFrontendIpConfigurationNames( + Arrays.asList("ascsip0", "ersip0")) + .withBackendPoolNames(Arrays.asList("ascsBackendPool")) + .withHealthProbeNames( + Arrays.asList("ascsHealthProbe", "ersHealthProbe")))) + .withApplicationServer( + new ApplicationServerFullResourceNames() + .withVirtualMachines( + Arrays + .asList( + new VirtualMachineResourceNames() + .withVmName("appvm0") + .withHostname("apphostName0") + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("appnic0"))) + .withOsDiskName("app0osdisk") + .withDataDiskNames( + mapOf("default", Arrays.asList("app0disk0"))), + new VirtualMachineResourceNames() + .withVmName("appvm1") + .withHostname("apphostName1") + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("appnic1"))) + .withOsDiskName("app1osdisk") + .withDataDiskNames( + mapOf("default", Arrays.asList("app1disk0")))))) + .withDatabaseServer( + new DatabaseServerFullResourceNames() + .withVirtualMachines( + Arrays + .asList( + new VirtualMachineResourceNames() + .withVmName("dbvmpr") + .withHostname("dbprhostName") + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("dbprnic"))) + .withOsDiskName("dbprosdisk") + .withDataDiskNames( + mapOf( + "hanaData", + Arrays.asList("hanadatapr0", "hanadatapr1"), + "hanaLog", + Arrays + .asList( + "hanalogpr0", "hanalogpr1", "hanalogpr2"), + "hanaShared", + Arrays.asList("hanasharedpr0", "hanasharedpr1"), + "usrSap", + Arrays.asList("usrsappr0"))), + new VirtualMachineResourceNames() + .withVmName("dbvmsr") + .withHostname("dbsrhostName") + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("dbsrnic"))) + .withOsDiskName("dbsrosdisk") + .withDataDiskNames( + mapOf( + "hanaData", + Arrays.asList("hanadatasr0", "hanadatasr1"), + "hanaLog", + Arrays + .asList( + "hanalogsr0", "hanalogsr1", "hanalogsr2"), + "hanaShared", + Arrays.asList("hanasharedsr0", "hanasharedsr1"), + "usrSap", + Arrays.asList("usrsapsr0"))))) + .withLoadBalancer( + new LoadBalancerResourceNames() + .withLoadBalancerName("dblb") + .withFrontendIpConfigurationNames(Arrays.asList("dbip")) + .withBackendPoolNames(Arrays.asList("dbBackendPool")) + .withHealthProbeNames(Arrays.asList("dbHealthProbe")))) + .withSharedStorage( + new SharedStorageResourceNames() + .withSharedStorageAccountName("storageacc") + .withSharedStorageAccountPrivateEndPointName("peForxNFS")))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_Distributed_MountTransport.json + */ + /** + * Sample code: Create Infrastructure with an existing SAP Transport Directory Fileshare. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createInfrastructureWithAnExistingSAPTransportDirectoryFileshare( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentWithOSConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new ThreeTierConfiguration() + .withAppResourceGroup("X00-RG") + .withCentralServer( + new CentralServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withApplicationServer( + new ApplicationServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer( + new DatabaseConfiguration() + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_M32ts") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withStorageConfiguration( + new StorageConfiguration() + .withTransportFileShareConfiguration( + new MountFileShareConfiguration() + .withId( + "/subscriptions/49d64d54-e888-4c46-a868-1936802b762c/resourceGroups/testrg/providers/Microsoft.Network/privateEndpoints/endpoint") + .withPrivateEndpointId( + "/subscriptions/49d64d54-e888-4c46-a868-1936802b762c/resourceGroups/testrg/providers/Microsoft.Network/privateEndpoints/endpoint")))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_CustomFullResourceNames_HA_AvSet.json + */ + /** + * Sample code: Create Infrastructure (with OS configuration) with custom resource names for HA System with + * Availability Set. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createInfrastructureWithOSConfigurationWithCustomResourceNamesForHASystemWithAvailabilitySet( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentWithOSConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new ThreeTierConfiguration() + .withAppResourceGroup("X00-RG") + .withCentralServer( + new CentralServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withApplicationServer( + new ApplicationServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer( + new DatabaseConfiguration() + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_M32ts") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withHighAvailabilityConfig( + new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_SET)) + .withCustomResourceNames( + new ThreeTierFullResourceNames() + .withCentralServer( + new CentralServerFullResourceNames() + .withVirtualMachines( + Arrays + .asList( + new VirtualMachineResourceNames() + .withVmName("ascsvm") + .withHostname("ascshostName") + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("ascsnic"))) + .withOsDiskName("ascsosdisk"), + new VirtualMachineResourceNames() + .withVmName("ersvm") + .withHostname("ershostName") + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("ersnic"))) + .withOsDiskName("ersosdisk"))) + .withAvailabilitySetName("csAvSet") + .withLoadBalancer( + new LoadBalancerResourceNames() + .withLoadBalancerName("ascslb") + .withFrontendIpConfigurationNames( + Arrays.asList("ascsip0", "ersip0")) + .withBackendPoolNames(Arrays.asList("ascsBackendPool")) + .withHealthProbeNames( + Arrays.asList("ascsHealthProbe", "ersHealthProbe")))) + .withApplicationServer( + new ApplicationServerFullResourceNames() + .withVirtualMachines( + Arrays + .asList( + new VirtualMachineResourceNames() + .withVmName("appvm0") + .withHostname("apphostName0") + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("appnic0"))) + .withOsDiskName("app0osdisk") + .withDataDiskNames( + mapOf("default", Arrays.asList("app0disk0"))), + new VirtualMachineResourceNames() + .withVmName("appvm1") + .withHostname("apphostName1") + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("appnic1"))) + .withOsDiskName("app1osdisk") + .withDataDiskNames( + mapOf("default", Arrays.asList("app1disk0"))))) + .withAvailabilitySetName("appAvSet")) + .withDatabaseServer( + new DatabaseServerFullResourceNames() + .withVirtualMachines( + Arrays + .asList( + new VirtualMachineResourceNames() + .withVmName("dbvmpr") + .withHostname("dbprhostName") + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("dbprnic"))) + .withOsDiskName("dbprosdisk") + .withDataDiskNames( + mapOf( + "hanaData", + Arrays.asList("hanadatapr0", "hanadatapr1"), + "hanaLog", + Arrays + .asList( + "hanalogpr0", "hanalogpr1", "hanalogpr2"), + "hanaShared", + Arrays.asList("hanasharedpr0", "hanasharedpr1"), + "usrSap", + Arrays.asList("usrsappr0"))), + new VirtualMachineResourceNames() + .withVmName("dbvmsr") + .withHostname("dbsrhostName") + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("dbsrnic"))) + .withOsDiskName("dbsrosdisk") + .withDataDiskNames( + mapOf( + "hanaData", + Arrays.asList("hanadatasr0", "hanadatasr1"), + "hanaLog", + Arrays + .asList( + "hanalogsr0", "hanalogsr1", "hanalogsr2"), + "hanaShared", + Arrays.asList("hanasharedsr0", "hanasharedsr1"), + "usrSap", + Arrays.asList("usrsapsr0"))))) + .withAvailabilitySetName("dbAvSet") + .withLoadBalancer( + new LoadBalancerResourceNames() + .withLoadBalancerName("dblb") + .withFrontendIpConfigurationNames(Arrays.asList("dbip")) + .withBackendPoolNames(Arrays.asList("dbBackendPool")) + .withHealthProbeNames(Arrays.asList("dbHealthProbe")))) + .withSharedStorage( + new SharedStorageResourceNames() + .withSharedStorageAccountName("storageacc") + .withSharedStorageAccountPrivateEndPointName("peForxNFS")))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_HA_AvSet.json + */ + /** + * Sample code: Create Infrastructure with OS configuration for HA System with Availability Set (Recommended). + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createInfrastructureWithOSConfigurationForHASystemWithAvailabilitySetRecommended( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentWithOSConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new ThreeTierConfiguration() + .withAppResourceGroup("X00-RG") + .withCentralServer( + new CentralServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withApplicationServer( + new ApplicationServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer( + new DatabaseConfiguration() + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_M32ts") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withHighAvailabilityConfig( + new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_SET))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_DiskDetails_Distributed.json + */ + /** + * Sample code: Create Infrastructure with Disk and OS configuration for Distributed System (Recommended). + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createInfrastructureWithDiskAndOSConfigurationForDistributedSystemRecommended( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentWithOSConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new ThreeTierConfiguration() + .withAppResourceGroup("X00-RG") + .withCentralServer( + new CentralServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withApplicationServer( + new ApplicationServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer( + new DatabaseConfiguration() + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_M32ts") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L) + .withDiskConfiguration( + new DiskConfiguration() + .withDiskVolumeConfigurations( + mapOf( + "backup", + new DiskVolumeConfiguration() + .withCount(2L) + .withSizeGB(256L) + .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), + "hana/data", + new DiskVolumeConfiguration() + .withCount(4L) + .withSizeGB(128L) + .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), + "hana/log", + new DiskVolumeConfiguration() + .withCount(3L) + .withSizeGB(128L) + .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), + "hana/shared", + new DiskVolumeConfiguration() + .withCount(1L) + .withSizeGB(256L) + .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), + "os", + new DiskVolumeConfiguration() + .withCount(1L) + .withSizeGB(64L) + .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), + "usr/sap", + new DiskVolumeConfiguration() + .withCount(1L) + .withSizeGB(128L) + .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS))))))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_DetectInstallation_Distributed.json + */ + /** + * Sample code: Detect SAP Software Installation on a Distributed System. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void detectSAPSoftwareInstallationOnADistributedSystem( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus2") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentWithOSConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new ThreeTierConfiguration() + .withAppResourceGroup("{{resourcegrp}}") + .withNetworkConfiguration(new NetworkConfiguration().withIsSecondaryIpEnabled(true)) + .withCentralServer( + new CentralServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E4ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("azureuser") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withApplicationServer( + new ApplicationServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E4ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("azureuser") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withDatabaseServer( + new DatabaseConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_M32ts") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("azureuser") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L))) + .withSoftwareConfiguration( + new ExternalInstallationSoftwareConfiguration() + .withCentralServerVmId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0")) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("sap.bpaas.com"))) + .withTags(mapOf("created by", "azureuser")) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_DetectInstallation_HA_AvSet.json + */ + /** + * Sample code: Detect SAP Software Installation on an HA System with Availability Set. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void detectSAPSoftwareInstallationOnAnHASystemWithAvailabilitySet( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentWithOSConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new ThreeTierConfiguration() + .withAppResourceGroup("X00-RG") + .withCentralServer( + new CentralServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withApplicationServer( + new ApplicationServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer( + new DatabaseConfiguration() + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_M32ts") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withHighAvailabilityConfig( + new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_SET))) + .withSoftwareConfiguration( + new ExternalInstallationSoftwareConfiguration() + .withCentralServerVmId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0")) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Install_SingleServer.json + */ + /** + * Sample code: Install SAP Software on Single Server System. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void installSAPSoftwareOnSingleServerSystem( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus2") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.NON_PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentWithOSConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new SingleServerConfiguration() + .withAppResourceGroup("test-rg") + .withSubnetId( + "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/testsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("SUSE") + .withOffer("SLES-SAP") + .withSku("12-sp4-gen2") + .withVersion("2022.02.01")) + .withOsProfile( + new OSProfile() + .withAdminUsername("azureappadmin") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder")))))) + .withSoftwareConfiguration( + new SapInstallWithoutOSConfigSoftwareConfiguration() + .withBomUrl( + "https://teststorageaccount.blob.core.windows.net/sapbits/sapfiles/boms/S41909SPS03_v0011ms/S41909SPS03_v0011ms.yaml") + .withSapBitsStorageAccountId( + "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Storage/storageAccounts/teststorageaccount") + .withSoftwareVersion("SAP S/4HANA 1909 SPS 03")) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("sap.bpaas.com"))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_Distributed.json + */ + /** + * Sample code: Create Infrastructure only for Distributed System. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createInfrastructureOnlyForDistributedSystem( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new ThreeTierConfiguration() + .withAppResourceGroup("X00-RG") + .withCentralServer( + new CentralServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withKeyData( + "fakeTokenPlaceholder"))))))) + .withInstanceCount(1L)) + .withApplicationServer( + new ApplicationServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withKeyData( + "fakeTokenPlaceholder"))))))) + .withInstanceCount(6L)) + .withDatabaseServer( + new DatabaseConfiguration() + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_M32ts") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withKeyData( + "fakeTokenPlaceholder"))))))) + .withInstanceCount(1L)))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_Discover_CustomMrgStorageAccountName.json + */ + /** + * Sample code: Register existing SAP system as Virtual Instance for SAP solutions with optional customizations. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void registerExistingSAPSystemAsVirtualInstanceForSAPSolutionsWithOptionalCustomizations( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("northeurope") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.NON_PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DiscoveryConfiguration() + .withCentralServerVmId( + "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0") + .withManagedRgStorageAccountName("q20saacssgrs")) + .withTags(mapOf("createdby", "abc@microsoft.com", "test", "abc")) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_Distributed_SkipTransport.json + */ + /** + * Sample code: Create Infrastructure without a SAP Transport Directory Fileshare. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createInfrastructureWithoutASAPTransportDirectoryFileshare( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentWithOSConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new ThreeTierConfiguration() + .withAppResourceGroup("X00-RG") + .withCentralServer( + new CentralServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withApplicationServer( + new ApplicationServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer( + new DatabaseConfiguration() + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_M32ts") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withStorageConfiguration( + new StorageConfiguration() + .withTransportFileShareConfiguration(new SkipFileShareConfiguration()))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_SingleServer.json + */ + /** + * Sample code: Create Infrastructure with OS configuration for Single Server System (Recommended). + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createInfrastructureWithOSConfigurationForSingleServerSystemRecommended( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.NON_PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentWithOSConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new SingleServerConfiguration() + .withAppResourceGroup("X00-RG") + .withNetworkConfiguration(new NetworkConfiguration().withIsSecondaryIpEnabled(true)) + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder")))))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_DiskDetails_HA_AvZone.json + */ + /** + * Sample code: Create Infrastructure with Disk and OS configuration for HA System with Availability Zone + * (Recommended). + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createInfrastructureWithDiskAndOSConfigurationForHASystemWithAvailabilityZoneRecommended( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentWithOSConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new ThreeTierConfiguration() + .withAppResourceGroup("X00-RG") + .withCentralServer( + new CentralServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withApplicationServer( + new ApplicationServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer( + new DatabaseConfiguration() + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_M32ts") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L) + .withDiskConfiguration( + new DiskConfiguration() + .withDiskVolumeConfigurations( + mapOf( + "backup", + new DiskVolumeConfiguration() + .withCount(2L) + .withSizeGB(256L) + .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), + "hana/data", + new DiskVolumeConfiguration() + .withCount(4L) + .withSizeGB(128L) + .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), + "hana/log", + new DiskVolumeConfiguration() + .withCount(3L) + .withSizeGB(128L) + .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), + "hana/shared", + new DiskVolumeConfiguration() + .withCount(1L) + .withSizeGB(256L) + .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), + "os", + new DiskVolumeConfiguration() + .withCount(1L) + .withSizeGB(64L) + .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), + "usr/sap", + new DiskVolumeConfiguration() + .withCount(1L) + .withSizeGB(128L) + .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)))))) + .withHighAvailabilityConfig( + new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_ZONE))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_HA_AvZone.json + */ + /** + * Sample code: Create Infrastructure with OS configuration for HA System with Availability Zone (Recommended). + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createInfrastructureWithOSConfigurationForHASystemWithAvailabilityZoneRecommended( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentWithOSConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new ThreeTierConfiguration() + .withAppResourceGroup("X00-RG") + .withCentralServer( + new CentralServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withApplicationServer( + new ApplicationServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer( + new DatabaseConfiguration() + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_M32ts") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withHighAvailabilityConfig( + new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_ZONE))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_DiskDetails_SingleServer.json + */ + /** + * Sample code: Create Infrastructure with Disk and OS configurations for Single Server System (Recommended). + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createInfrastructureWithDiskAndOSConfigurationsForSingleServerSystemRecommended( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.NON_PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentWithOSConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new SingleServerConfiguration() + .withAppResourceGroup("X00-RG") + .withNetworkConfiguration(new NetworkConfiguration().withIsSecondaryIpEnabled(true)) + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withDbDiskConfiguration( + new DiskConfiguration() + .withDiskVolumeConfigurations( + mapOf( + "backup", + new DiskVolumeConfiguration() + .withCount(2L) + .withSizeGB(256L) + .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), + "hana/data", + new DiskVolumeConfiguration() + .withCount(4L) + .withSizeGB(128L) + .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), + "hana/log", + new DiskVolumeConfiguration() + .withCount(3L) + .withSizeGB(128L) + .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), + "hana/shared", + new DiskVolumeConfiguration() + .withCount(1L) + .withSizeGB(256L) + .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), + "os", + new DiskVolumeConfiguration() + .withCount(1L) + .withSizeGB(64L) + .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), + "usr/sap", + new DiskVolumeConfiguration() + .withCount(1L) + .withSizeGB(128L) + .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)))))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withTags(mapOf()) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### SapVirtualInstances_Delete + +```java +/** Samples for SapVirtualInstances Delete. */ +public final class SapVirtualInstancesDeleteSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Delete.json + */ + /** + * Sample code: SAPVirtualInstances_Delete. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPVirtualInstancesDelete( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager.sapVirtualInstances().delete("test-rg", "X00", com.azure.core.util.Context.NONE); + } +} +``` + +### SapVirtualInstances_GetByResourceGroup + +```java +/** Samples for SapVirtualInstances GetByResourceGroup. */ +public final class SapVirtualInstancesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Get.json + */ + /** + * Sample code: SAPVirtualInstances_Get. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPVirtualInstancesGet( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .getByResourceGroupWithResponse("test-rg", "X00", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Get_ACSSInstallationBlocked.json + */ + /** + * Sample code: SAPVirtualInstances Get With ACSS Installation Blocked. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPVirtualInstancesGetWithACSSInstallationBlocked( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .getByResourceGroupWithResponse("test-rg", "X00", com.azure.core.util.Context.NONE); + } +} +``` + +### SapVirtualInstances_List + +```java +/** Samples for SapVirtualInstances List. */ +public final class SapVirtualInstancesListSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_ListBySubscription.json + */ + /** + * Sample code: SAPVirtualInstances_ListBySubscription. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPVirtualInstancesListBySubscription( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager.sapVirtualInstances().list(com.azure.core.util.Context.NONE); + } +} +``` + +### SapVirtualInstances_ListByResourceGroup + +```java +/** Samples for SapVirtualInstances ListByResourceGroup. */ +public final class SapVirtualInstancesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_ListByResourceGroup.json + */ + /** + * Sample code: SAPVirtualInstances_ListByResourceGroup. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPVirtualInstancesListByResourceGroup( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager.sapVirtualInstances().listByResourceGroup("test-rg", com.azure.core.util.Context.NONE); + } +} +``` + +### SapVirtualInstances_Start + +```java +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StartRequest; + +/** Samples for SapVirtualInstances Start. */ +public final class SapVirtualInstancesStartSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Start_WithInfraOperations.json + */ + /** + * Sample code: Start the virtual machines and the SAP system. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void startTheVirtualMachinesAndTheSAPSystem( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .start("test-rg", "X00", new StartRequest().withStartVm(true), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Start.json + */ + /** + * Sample code: Start the SAP system. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void startTheSAPSystem( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager.sapVirtualInstances().start("test-rg", "X00", null, com.azure.core.util.Context.NONE); + } +} +``` + +### SapVirtualInstances_Stop + +```java +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StopRequest; + +/** Samples for SapVirtualInstances Stop. */ +public final class SapVirtualInstancesStopSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Stop_WithInfraOperations.json + */ + /** + * Sample code: Stop the virtual machine(s) and the SAP system on it. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void stopTheVirtualMachineSAndTheSAPSystemOnIt( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .stop( + "test-rg", + "X00", + new StopRequest().withSoftStopTimeoutSeconds(0L).withDeallocateVm(true), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Stop.json + */ + /** + * Sample code: SAPVirtualInstances_Stop. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPVirtualInstancesStop( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .stop("test-rg", "X00", new StopRequest().withSoftStopTimeoutSeconds(0L), com.azure.core.util.Context.NONE); + } +} +``` + +### SapVirtualInstances_Update + +```java +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.ManagedResourcesNetworkAccessType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapVirtualInstance; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.UpdateSapVirtualInstanceProperties; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.UserAssignedServiceIdentity; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SapVirtualInstances Update. */ +public final class SapVirtualInstancesUpdateSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Update.json + */ + /** + * Sample code: SAPVirtualInstances_Update. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPVirtualInstancesUpdate( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + SapVirtualInstance resource = + manager + .sapVirtualInstances() + .getByResourceGroupWithResponse("test-rg", "X00", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withIdentity(new UserAssignedServiceIdentity().withType(ManagedServiceIdentityType.NONE)) + .apply(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_TrustedAccessEnable_Update.json + */ + /** + * Sample code: SAPVirtualInstances_TrustedAccessEnable_Update. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPVirtualInstancesTrustedAccessEnableUpdate( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + SapVirtualInstance resource = + manager + .sapVirtualInstances() + .getByResourceGroupWithResponse("test-rg", "X00", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withIdentity(new UserAssignedServiceIdentity().withType(ManagedServiceIdentityType.NONE)) + .withProperties( + new UpdateSapVirtualInstanceProperties() + .withManagedResourcesNetworkAccessType(ManagedResourcesNetworkAccessType.PRIVATE)) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/pom.xml b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/pom.xml new file mode 100644 index 0000000000000..60269a418d54e --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/pom.xml @@ -0,0 +1,62 @@ + + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for Workloads Management + This package contains Microsoft Azure SDK for Workloads Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Workloads client provides access to various workload operations. Package tag package-preview-2023-10. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + 0 + 0 + true + + + + com.azure + azure-core + 1.44.0 + + + com.azure + azure-core-management + 1.11.6 + + + diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/WorkloadsManager.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/WorkloadsManager.java new file mode 100644 index 0000000000000..dc187613094b4 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/WorkloadsManager.java @@ -0,0 +1,365 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.WorkloadsClient; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.implementation.OperationsImpl; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.implementation.ResourceProvidersImpl; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.implementation.SapApplicationServerInstancesImpl; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.implementation.SapCentralInstancesImpl; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.implementation.SapDatabaseInstancesImpl; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.implementation.SapVirtualInstancesImpl; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.implementation.WorkloadsClientBuilder; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.Operations; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.ResourceProviders; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapApplicationServerInstances; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapCentralInstances; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapDatabaseInstances; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapVirtualInstances; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +/** Entry point to WorkloadsManager. Workloads client provides access to various workload operations. */ +public final class WorkloadsManager { + private ResourceProviders resourceProviders; + + private SapVirtualInstances sapVirtualInstances; + + private SapCentralInstances sapCentralInstances; + + private SapDatabaseInstances sapDatabaseInstances; + + private SapApplicationServerInstances sapApplicationServerInstances; + + private Operations operations; + + private final WorkloadsClient clientObject; + + private WorkloadsManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new WorkloadsClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of Workloads service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Workloads service API instance. + */ + public static WorkloadsManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Creates an instance of Workloads service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the Workloads service API instance. + */ + public static WorkloadsManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new WorkloadsManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create WorkloadsManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new WorkloadsManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private RetryOptions retryOptions; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the retry options for the HTTP pipeline retry policy. + * + *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = + Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of Workloads service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Workloads service API instance. + */ + public WorkloadsManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder + .append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance") + .append("/") + .append("1.0.0-beta.1"); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder + .append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); + policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new WorkloadsManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of ResourceProviders. + * + * @return Resource collection API of ResourceProviders. + */ + public ResourceProviders resourceProviders() { + if (this.resourceProviders == null) { + this.resourceProviders = new ResourceProvidersImpl(clientObject.getResourceProviders(), this); + } + return resourceProviders; + } + + /** + * Gets the resource collection API of SapVirtualInstances. It manages SapVirtualInstance. + * + * @return Resource collection API of SapVirtualInstances. + */ + public SapVirtualInstances sapVirtualInstances() { + if (this.sapVirtualInstances == null) { + this.sapVirtualInstances = new SapVirtualInstancesImpl(clientObject.getSapVirtualInstances(), this); + } + return sapVirtualInstances; + } + + /** + * Gets the resource collection API of SapCentralInstances. It manages SapCentralServerInstance. + * + * @return Resource collection API of SapCentralInstances. + */ + public SapCentralInstances sapCentralInstances() { + if (this.sapCentralInstances == null) { + this.sapCentralInstances = new SapCentralInstancesImpl(clientObject.getSapCentralInstances(), this); + } + return sapCentralInstances; + } + + /** + * Gets the resource collection API of SapDatabaseInstances. It manages SapDatabaseInstance. + * + * @return Resource collection API of SapDatabaseInstances. + */ + public SapDatabaseInstances sapDatabaseInstances() { + if (this.sapDatabaseInstances == null) { + this.sapDatabaseInstances = new SapDatabaseInstancesImpl(clientObject.getSapDatabaseInstances(), this); + } + return sapDatabaseInstances; + } + + /** + * Gets the resource collection API of SapApplicationServerInstances. It manages SapApplicationServerInstance. + * + * @return Resource collection API of SapApplicationServerInstances. + */ + public SapApplicationServerInstances sapApplicationServerInstances() { + if (this.sapApplicationServerInstances == null) { + this.sapApplicationServerInstances = + new SapApplicationServerInstancesImpl(clientObject.getSapApplicationServerInstances(), this); + } + return sapApplicationServerInstances; + } + + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** + * Gets wrapped service client WorkloadsClient providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + * + * @return Wrapped service client WorkloadsClient. + */ + public WorkloadsClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/OperationsClient.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/OperationsClient.java new file mode 100644 index 0000000000000..3d3c4ec3fb4bf --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/OperationsClient.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.OperationInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Lists all the available API operations under this PR. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all the available API operations under this PR. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/ResourceProvidersClient.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/ResourceProvidersClient.java new file mode 100644 index 0000000000000..6945ea5758a9e --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/ResourceProvidersClient.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapAvailabilityZoneDetailsResultInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapDiskConfigurationsResultInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapSizingRecommendationResultInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapSupportedResourceSkusResultInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapAvailabilityZoneDetailsRequest; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapDiskConfigurationsRequest; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapSizingRecommendationRequest; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapSupportedSkusRequest; + +/** An instance of this class provides access to all the operations defined in ResourceProvidersClient. */ +public interface ResourceProvidersClient { + /** + * Get SAP sizing recommendations by providing input SAPS for application tier and memory required for database + * tier. + * + * @param location The name of Azure region. + * @param sapSizingRecommendation SAP Sizing Recommendation Request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sAP sizing recommendations by providing input SAPS for application tier and memory required for database + * tier along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response sapSizingRecommendationsWithResponse( + String location, SapSizingRecommendationRequest sapSizingRecommendation, Context context); + + /** + * Get SAP sizing recommendations by providing input SAPS for application tier and memory required for database + * tier. + * + * @param location The name of Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sAP sizing recommendations by providing input SAPS for application tier and memory required for database + * tier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapSizingRecommendationResultInner sapSizingRecommendations(String location); + + /** + * Get a list of SAP supported SKUs for ASCS, Application and Database tier. + * + * @param location The name of Azure region. + * @param sapSupportedSku SAP Supported SKU Request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SAP supported SKUs for ASCS, Application and Database tier along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response sapSupportedSkuWithResponse( + String location, SapSupportedSkusRequest sapSupportedSku, Context context); + + /** + * Get a list of SAP supported SKUs for ASCS, Application and Database tier. + * + * @param location The name of Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SAP supported SKUs for ASCS, Application and Database tier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapSupportedResourceSkusResultInner sapSupportedSku(String location); + + /** + * Get the SAP Disk Configuration Layout prod/non-prod SAP System. + * + * @param location The name of Azure region. + * @param sapDiskConfigurations SAP Disk Configurations Request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAP Disk Configuration Layout prod/non-prod SAP System along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response sapDiskConfigurationsWithResponse( + String location, SapDiskConfigurationsRequest sapDiskConfigurations, Context context); + + /** + * Get the SAP Disk Configuration Layout prod/non-prod SAP System. + * + * @param location The name of Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAP Disk Configuration Layout prod/non-prod SAP System. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapDiskConfigurationsResultInner sapDiskConfigurations(String location); + + /** + * Get the recommended SAP Availability Zone Pair Details for your region. + * + * @param location The name of Azure region. + * @param sapAvailabilityZoneDetails SAP Availability Zone Details Request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the recommended SAP Availability Zone Pair Details for your region along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response sapAvailabilityZoneDetailsWithResponse( + String location, SapAvailabilityZoneDetailsRequest sapAvailabilityZoneDetails, Context context); + + /** + * Get the recommended SAP Availability Zone Pair Details for your region. + * + * @param location The name of Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the recommended SAP Availability Zone Pair Details for your region. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapAvailabilityZoneDetailsResultInner sapAvailabilityZoneDetails(String location); +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/SapApplicationServerInstancesClient.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/SapApplicationServerInstancesClient.java new file mode 100644 index 0000000000000..a73e2d82f7a7b --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/SapApplicationServerInstancesClient.java @@ -0,0 +1,402 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapApplicationServerInstanceInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StartRequest; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StopRequest; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.UpdateSapApplicationInstanceRequest; + +/** An instance of this class provides access to all the operations defined in SapApplicationServerInstancesClient. */ +public interface SapApplicationServerInstancesClient { + /** + * Gets the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource + * along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, Context context); + + /** + * Gets the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapApplicationServerInstanceInner get( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName); + + /** + * Puts the SAP Application Server Instance resource. <br><br>This will be used by service only. PUT by + * end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of define the SAP Application Server Instance resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SapApplicationServerInstanceInner> beginCreate( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName); + + /** + * Puts the SAP Application Server Instance resource. <br><br>This will be used by service only. PUT by + * end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @param body The SAP Application Server Instance resource request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of define the SAP Application Server Instance resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SapApplicationServerInstanceInner> beginCreate( + String resourceGroupName, + String sapVirtualInstanceName, + String applicationInstanceName, + SapApplicationServerInstanceInner body, + Context context); + + /** + * Puts the SAP Application Server Instance resource. <br><br>This will be used by service only. PUT by + * end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the SAP Application Server Instance resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapApplicationServerInstanceInner create( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName); + + /** + * Puts the SAP Application Server Instance resource. <br><br>This will be used by service only. PUT by + * end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @param body The SAP Application Server Instance resource request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the SAP Application Server Instance resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapApplicationServerInstanceInner create( + String resourceGroupName, + String sapVirtualInstanceName, + String applicationInstanceName, + SapApplicationServerInstanceInner body, + Context context); + + /** + * Updates the SAP Application server instance resource. This can be used to update tags on the resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @param body The SAP Application Server Instance resource request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the SAP Application Server Instance resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String sapVirtualInstanceName, + String applicationInstanceName, + UpdateSapApplicationInstanceRequest body, + Context context); + + /** + * Updates the SAP Application server instance resource. This can be used to update tags on the resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the SAP Application Server Instance resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapApplicationServerInstanceInner update( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName); + + /** + * Deletes the SAP Application Server Instance resource. <br><br>This operation will be used by service + * only. Delete by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName); + + /** + * Deletes the SAP Application Server Instance resource. <br><br>This operation will be used by service + * only. Delete by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, Context context); + + /** + * Deletes the SAP Application Server Instance resource. <br><br>This operation will be used by service + * only. Delete by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName); + + /** + * Deletes the SAP Application Server Instance resource. <br><br>This operation will be used by service + * only. Delete by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, Context context); + + /** + * Lists the SAP Application Server Instance resources for a given Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of SAP Application Server Instance resources as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String sapVirtualInstanceName); + + /** + * Lists the SAP Application Server Instance resources for a given Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of SAP Application Server Instance resources as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String sapVirtualInstanceName, Context context); + + /** + * Starts the SAP Application Server Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationStatusResultInner> beginStartInstance( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName); + + /** + * Starts the SAP Application Server Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @param body SAP Application server instance start request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationStatusResultInner> beginStartInstance( + String resourceGroupName, + String sapVirtualInstanceName, + String applicationInstanceName, + StartRequest body, + Context context); + + /** + * Starts the SAP Application Server Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusResultInner startInstance( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName); + + /** + * Starts the SAP Application Server Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @param body SAP Application server instance start request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusResultInner startInstance( + String resourceGroupName, + String sapVirtualInstanceName, + String applicationInstanceName, + StartRequest body, + Context context); + + /** + * Stops the SAP Application Server Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationStatusResultInner> beginStopInstance( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName); + + /** + * Stops the SAP Application Server Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @param body SAP Application server instance stop request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationStatusResultInner> beginStopInstance( + String resourceGroupName, + String sapVirtualInstanceName, + String applicationInstanceName, + StopRequest body, + Context context); + + /** + * Stops the SAP Application Server Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusResultInner stopInstance( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName); + + /** + * Stops the SAP Application Server Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @param body SAP Application server instance stop request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusResultInner stopInstance( + String resourceGroupName, + String sapVirtualInstanceName, + String applicationInstanceName, + StopRequest body, + Context context); +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/SapCentralInstancesClient.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/SapCentralInstancesClient.java new file mode 100644 index 0000000000000..57b5cf3f828df --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/SapCentralInstancesClient.java @@ -0,0 +1,426 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapCentralServerInstanceInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StartRequest; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StopRequest; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.UpdateSapCentralInstanceRequest; + +/** An instance of this class provides access to all the operations defined in SapCentralInstancesClient. */ +public interface SapCentralInstancesClient { + /** + * Gets the SAP Central Services Instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAP Central Services Instance resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, Context context); + + /** + * Gets the SAP Central Services Instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAP Central Services Instance resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapCentralServerInstanceInner get( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName); + + /** + * Creates the SAP Central Services Instance resource. <br><br>This will be used by service only. PUT + * operation on this resource by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of define the SAP Central Services Instance resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SapCentralServerInstanceInner> beginCreate( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName); + + /** + * Creates the SAP Central Services Instance resource. <br><br>This will be used by service only. PUT + * operation on this resource by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @param body The SAP Central Services Instance request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of define the SAP Central Services Instance resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SapCentralServerInstanceInner> beginCreate( + String resourceGroupName, + String sapVirtualInstanceName, + String centralInstanceName, + SapCentralServerInstanceInner body, + Context context); + + /** + * Creates the SAP Central Services Instance resource. <br><br>This will be used by service only. PUT + * operation on this resource by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the SAP Central Services Instance resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapCentralServerInstanceInner create( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName); + + /** + * Creates the SAP Central Services Instance resource. <br><br>This will be used by service only. PUT + * operation on this resource by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @param body The SAP Central Services Instance request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the SAP Central Services Instance resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapCentralServerInstanceInner create( + String resourceGroupName, + String sapVirtualInstanceName, + String centralInstanceName, + SapCentralServerInstanceInner body, + Context context); + + /** + * Updates the SAP Central Services Instance resource. <br><br>This can be used to update tags on the + * resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @param body The SAP Central Services Instance resource request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the SAP Central Services Instance resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String sapVirtualInstanceName, + String centralInstanceName, + UpdateSapCentralInstanceRequest body, + Context context); + + /** + * Updates the SAP Central Services Instance resource. <br><br>This can be used to update tags on the + * resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the SAP Central Services Instance resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapCentralServerInstanceInner update( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName); + + /** + * Deletes the SAP Central Services Instance resource. <br><br>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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName); + + /** + * Deletes the SAP Central Services Instance resource. <br><br>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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, Context context); + + /** + * Deletes the SAP Central Services Instance resource. <br><br>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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName); + + /** + * Deletes the SAP Central Services Instance resource. <br><br>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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, Context context); + + /** + * Lists the SAP Central Services Instance resource for the given Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of SAP Central Services Instance resources as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String sapVirtualInstanceName); + + /** + * Lists the SAP Central Services Instance resource for the given Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of SAP Central Services Instance resources as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String sapVirtualInstanceName, Context context); + + /** + * Starts the SAP Central Services Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationStatusResultInner> beginStartInstance( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName); + + /** + * Starts the SAP Central Services Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @param body SAP Central Services instance start request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationStatusResultInner> beginStartInstance( + String resourceGroupName, + String sapVirtualInstanceName, + String centralInstanceName, + StartRequest body, + Context context); + + /** + * Starts the SAP Central Services Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusResultInner startInstance( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName); + + /** + * Starts the SAP Central Services Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @param body SAP Central Services instance start request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusResultInner startInstance( + String resourceGroupName, + String sapVirtualInstanceName, + String centralInstanceName, + StartRequest body, + Context context); + + /** + * Stops the SAP Central Services Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationStatusResultInner> beginStopInstance( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName); + + /** + * Stops the SAP Central Services Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @param body SAP Central Services instance stop request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationStatusResultInner> beginStopInstance( + String resourceGroupName, + String sapVirtualInstanceName, + String centralInstanceName, + StopRequest body, + Context context); + + /** + * Stops the SAP Central Services Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusResultInner stopInstance( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName); + + /** + * Stops the SAP Central Services Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @param body SAP Central Services instance stop request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusResultInner stopInstance( + String resourceGroupName, + String sapVirtualInstanceName, + String centralInstanceName, + StopRequest body, + Context context); +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/SapDatabaseInstancesClient.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/SapDatabaseInstancesClient.java new file mode 100644 index 0000000000000..36030f11b25db --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/SapDatabaseInstancesClient.java @@ -0,0 +1,417 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapDatabaseInstanceInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StartRequest; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StopRequest; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.UpdateSapDatabaseInstanceRequest; + +/** An instance of this class provides access to all the operations defined in SapDatabaseInstancesClient. */ +public interface SapDatabaseInstancesClient { + /** + * Gets the SAP Database Instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAP Database Instance resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, Context context); + + /** + * Gets the SAP Database Instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAP Database Instance resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapDatabaseInstanceInner get(String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName); + + /** + * Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource. + * <br><br>This will be used by service only. PUT by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of define the Database resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SapDatabaseInstanceInner> beginCreate( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName); + + /** + * Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource. + * <br><br>This will be used by service only. PUT by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @param body Request body of Database resource of a SAP system. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of define the Database resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SapDatabaseInstanceInner> beginCreate( + String resourceGroupName, + String sapVirtualInstanceName, + String databaseInstanceName, + SapDatabaseInstanceInner body, + Context context); + + /** + * Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource. + * <br><br>This will be used by service only. PUT by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the Database resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapDatabaseInstanceInner create( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName); + + /** + * Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource. + * <br><br>This will be used by service only. PUT by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @param body Request body of Database resource of a SAP system. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the Database resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapDatabaseInstanceInner create( + String resourceGroupName, + String sapVirtualInstanceName, + String databaseInstanceName, + SapDatabaseInstanceInner body, + Context context); + + /** + * Updates the Database instance resource. This can be used to update tags on the resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @param body Database resource update request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the Database resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String sapVirtualInstanceName, + String databaseInstanceName, + UpdateSapDatabaseInstanceRequest body, + Context context); + + /** + * Updates the Database instance resource. This can be used to update tags on the resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the Database resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapDatabaseInstanceInner update( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName); + + /** + * Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource. + * <br><br>This will be used by service only. Delete by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName); + + /** + * Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource. + * <br><br>This will be used by service only. Delete by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, Context context); + + /** + * Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource. + * <br><br>This will be used by service only. Delete by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName); + + /** + * Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource. + * <br><br>This will be used by service only. Delete by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, Context context); + + /** + * Lists the Database resources associated with a Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of SAP Database Instances as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String sapVirtualInstanceName); + + /** + * Lists the Database resources associated with a Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of SAP Database Instances as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String sapVirtualInstanceName, Context context); + + /** + * Starts the database instance of the SAP system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationStatusResultInner> beginStartInstance( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName); + + /** + * Starts the database instance of the SAP system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @param body SAP Database server instance start request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationStatusResultInner> beginStartInstance( + String resourceGroupName, + String sapVirtualInstanceName, + String databaseInstanceName, + StartRequest body, + Context context); + + /** + * Starts the database instance of the SAP system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusResultInner startInstance( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName); + + /** + * Starts the database instance of the SAP system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @param body SAP Database server instance start request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusResultInner startInstance( + String resourceGroupName, + String sapVirtualInstanceName, + String databaseInstanceName, + StartRequest body, + Context context); + + /** + * Stops the database instance of the SAP system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationStatusResultInner> beginStopInstance( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName); + + /** + * Stops the database instance of the SAP system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @param body Stop request for the database instance of the SAP system. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationStatusResultInner> beginStopInstance( + String resourceGroupName, + String sapVirtualInstanceName, + String databaseInstanceName, + StopRequest body, + Context context); + + /** + * Stops the database instance of the SAP system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusResultInner stopInstance( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName); + + /** + * Stops the database instance of the SAP system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @param body Stop request for the database instance of the SAP system. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusResultInner stopInstance( + String resourceGroupName, + String sapVirtualInstanceName, + String databaseInstanceName, + StopRequest body, + Context context); +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/SapVirtualInstancesClient.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/SapVirtualInstancesClient.java new file mode 100644 index 0000000000000..3bd338ab012dd --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/SapVirtualInstancesClient.java @@ -0,0 +1,393 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapVirtualInstanceInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StartRequest; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StopRequest; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.UpdateSapVirtualInstanceRequest; + +/** An instance of this class provides access to all the operations defined in SapVirtualInstancesClient. */ +public interface SapVirtualInstancesClient { + /** + * Creates a Virtual Instance for SAP solutions (VIS) resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of define the Virtual Instance for SAP solutions resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SapVirtualInstanceInner> beginCreate( + String resourceGroupName, String sapVirtualInstanceName); + + /** + * Creates a Virtual Instance for SAP solutions (VIS) resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param body Virtual Instance for SAP solutions resource request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of define the Virtual Instance for SAP solutions resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SapVirtualInstanceInner> beginCreate( + String resourceGroupName, String sapVirtualInstanceName, SapVirtualInstanceInner body, Context context); + + /** + * Creates a Virtual Instance for SAP solutions (VIS) resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the Virtual Instance for SAP solutions resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapVirtualInstanceInner create(String resourceGroupName, String sapVirtualInstanceName); + + /** + * Creates a Virtual Instance for SAP solutions (VIS) resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param body Virtual Instance for SAP solutions resource request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the Virtual Instance for SAP solutions resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapVirtualInstanceInner create( + String resourceGroupName, String sapVirtualInstanceName, SapVirtualInstanceInner body, Context context); + + /** + * Gets a Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Virtual Instance for SAP solutions resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String sapVirtualInstanceName, Context context); + + /** + * Gets a Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Virtual Instance for SAP solutions resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapVirtualInstanceInner getByResourceGroup(String resourceGroupName, String sapVirtualInstanceName); + + /** + * Updates a Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of define the Virtual Instance for SAP solutions resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SapVirtualInstanceInner> beginUpdate( + String resourceGroupName, String sapVirtualInstanceName); + + /** + * Updates a Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param body Request body to update a Virtual Instance for SAP solutions resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of define the Virtual Instance for SAP solutions resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SapVirtualInstanceInner> beginUpdate( + String resourceGroupName, String sapVirtualInstanceName, UpdateSapVirtualInstanceRequest body, Context context); + + /** + * Updates a Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the Virtual Instance for SAP solutions resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapVirtualInstanceInner update(String resourceGroupName, String sapVirtualInstanceName); + + /** + * Updates a Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param body Request body to update a Virtual Instance for SAP solutions resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the Virtual Instance for SAP solutions resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SapVirtualInstanceInner update( + String resourceGroupName, String sapVirtualInstanceName, UpdateSapVirtualInstanceRequest body, Context context); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String sapVirtualInstanceName); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String sapVirtualInstanceName, Context context); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String sapVirtualInstanceName); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String sapVirtualInstanceName, Context context); + + /** + * Gets all Virtual Instances for SAP solutions resources in a Resource Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Virtual Instances for SAP solutions resources in a Resource Group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all Virtual Instances for SAP solutions resources in a Resource Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Virtual Instances for SAP solutions resources in a Resource Group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all Virtual Instances for SAP solutions resources in a Subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Virtual Instances for SAP solutions resources in a Subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets all Virtual Instances for SAP solutions resources in a Subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Virtual Instances for SAP solutions resources in a Subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Starts the SAP application, that is the Central Services instance and Application server instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationStatusResultInner> beginStart( + String resourceGroupName, String sapVirtualInstanceName); + + /** + * Starts the SAP application, that is the Central Services instance and Application server instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param body The Virtual Instance for SAP solutions resource start request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationStatusResultInner> beginStart( + String resourceGroupName, String sapVirtualInstanceName, StartRequest body, Context context); + + /** + * Starts the SAP application, that is the Central Services instance and Application server instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusResultInner start(String resourceGroupName, String sapVirtualInstanceName); + + /** + * Starts the SAP application, that is the Central Services instance and Application server instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param body The Virtual Instance for SAP solutions resource start request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusResultInner start( + String resourceGroupName, String sapVirtualInstanceName, StartRequest body, Context context); + + /** + * Stops the SAP Application, that is the Application server instances and Central Services instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationStatusResultInner> beginStop( + String resourceGroupName, String sapVirtualInstanceName); + + /** + * Stops the SAP Application, that is the Application server instances and Central Services instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param body The Virtual Instance for SAP solutions resource stop request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationStatusResultInner> beginStop( + String resourceGroupName, String sapVirtualInstanceName, StopRequest body, Context context); + + /** + * Stops the SAP Application, that is the Application server instances and Central Services instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusResultInner stop(String resourceGroupName, String sapVirtualInstanceName); + + /** + * Stops the SAP Application, that is the Application server instances and Central Services instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param body The Virtual Instance for SAP solutions resource stop request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusResultInner stop( + String resourceGroupName, String sapVirtualInstanceName, StopRequest body, Context context); +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/WorkloadsClient.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/WorkloadsClient.java new file mode 100644 index 0000000000000..deec6496976b9 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/WorkloadsClient.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for WorkloadsClient class. */ +public interface WorkloadsClient { + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the ResourceProvidersClient object to access its operations. + * + * @return the ResourceProvidersClient object. + */ + ResourceProvidersClient getResourceProviders(); + + /** + * Gets the SapVirtualInstancesClient object to access its operations. + * + * @return the SapVirtualInstancesClient object. + */ + SapVirtualInstancesClient getSapVirtualInstances(); + + /** + * Gets the SapCentralInstancesClient object to access its operations. + * + * @return the SapCentralInstancesClient object. + */ + SapCentralInstancesClient getSapCentralInstances(); + + /** + * Gets the SapDatabaseInstancesClient object to access its operations. + * + * @return the SapDatabaseInstancesClient object. + */ + SapDatabaseInstancesClient getSapDatabaseInstances(); + + /** + * Gets the SapApplicationServerInstancesClient object to access its operations. + * + * @return the SapApplicationServerInstancesClient object. + */ + SapApplicationServerInstancesClient getSapApplicationServerInstances(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/OperationInner.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/OperationInner.java new file mode 100644 index 0000000000000..c5c1bfa03d9f7 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/OperationInner.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.ActionType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.OperationDisplay; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.Origin; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * REST API Operation + * + *

Details of a REST API operation, returned from the Resource Provider Operations API. + */ +@Fluent +public final class OperationInner { + /* + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for + * ARM/control-plane operations. + */ + @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isDataAction; + + /* + * Localized display information for this particular operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /* + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default + * value is "user,system" + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private Origin origin; + + /* + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ + @JsonProperty(value = "actionType", access = JsonProperty.Access.WRITE_ONLY) + private ActionType actionType; + + /** Creates an instance of OperationInner class. */ + public OperationInner() { + } + + /** + * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for ARM/control-plane operations. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Get the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: Localized display information for this particular operation. + * + * @param display the display value to set. + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + public Origin origin() { + return this.origin; + } + + /** + * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal + * only APIs. + * + * @return the actionType value. + */ + public ActionType actionType() { + return this.actionType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/OperationStatusResultInner.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/OperationStatusResultInner.java new file mode 100644 index 0000000000000..e624c704384ac --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/OperationStatusResultInner.java @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The current status of an async operation. */ +@Fluent +public final class OperationStatusResultInner { + /* + * Fully qualified ID for the async operation. + */ + @JsonProperty(value = "id") + private String id; + + /* + * Name of the async operation. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Operation status. + */ + @JsonProperty(value = "status", required = true) + private String status; + + /* + * Percent of the operation that is complete. + */ + @JsonProperty(value = "percentComplete") + private Float percentComplete; + + /* + * The start time of the operation. + */ + @JsonProperty(value = "startTime") + private OffsetDateTime startTime; + + /* + * The end time of the operation. + */ + @JsonProperty(value = "endTime") + private OffsetDateTime endTime; + + /* + * The operations list. + */ + @JsonProperty(value = "operations") + private List operations; + + /* + * If present, details of the operation error. + */ + @JsonProperty(value = "error") + private ManagementError error; + + /** Creates an instance of OperationStatusResultInner class. */ + public OperationStatusResultInner() { + } + + /** + * Get the id property: Fully qualified ID for the async operation. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Fully qualified ID for the async operation. + * + * @param id the id value to set. + * @return the OperationStatusResultInner object itself. + */ + public OperationStatusResultInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: Name of the async operation. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the async operation. + * + * @param name the name value to set. + * @return the OperationStatusResultInner object itself. + */ + public OperationStatusResultInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the status property: Operation status. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: Operation status. + * + * @param status the status value to set. + * @return the OperationStatusResultInner object itself. + */ + public OperationStatusResultInner withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the percentComplete property: Percent of the operation that is complete. + * + * @return the percentComplete value. + */ + public Float percentComplete() { + return this.percentComplete; + } + + /** + * Set the percentComplete property: Percent of the operation that is complete. + * + * @param percentComplete the percentComplete value to set. + * @return the OperationStatusResultInner object itself. + */ + public OperationStatusResultInner withPercentComplete(Float percentComplete) { + this.percentComplete = percentComplete; + return this; + } + + /** + * Get the startTime property: The start time of the operation. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: The start time of the operation. + * + * @param startTime the startTime value to set. + * @return the OperationStatusResultInner object itself. + */ + public OperationStatusResultInner withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: The end time of the operation. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: The end time of the operation. + * + * @param endTime the endTime value to set. + * @return the OperationStatusResultInner object itself. + */ + public OperationStatusResultInner withEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the operations property: The operations list. + * + * @return the operations value. + */ + public List operations() { + return this.operations; + } + + /** + * Set the operations property: The operations list. + * + * @param operations the operations value to set. + * @return the OperationStatusResultInner object itself. + */ + public OperationStatusResultInner withOperations(List operations) { + this.operations = operations; + return this; + } + + /** + * Get the error property: If present, details of the operation error. + * + * @return the error value. + */ + public ManagementError error() { + return this.error; + } + + /** + * Set the error property: If present, details of the operation error. + * + * @param error the error value to set. + * @return the OperationStatusResultInner object itself. + */ + public OperationStatusResultInner withError(ManagementError error) { + this.error = error; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (status() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property status in model OperationStatusResultInner")); + } + if (operations() != null) { + operations().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OperationStatusResultInner.class); +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/SapApplicationServerInstanceInner.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/SapApplicationServerInstanceInner.java new file mode 100644 index 0000000000000..aa4678f692168 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/SapApplicationServerInstanceInner.java @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.ApplicationServerVmDetails; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.LoadBalancerDetails; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapHealthState; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapVirtualInstanceError; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapVirtualInstanceProvisioningState; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapVirtualInstanceStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Define the SAP Application Server Instance resource. */ +@Fluent +public final class SapApplicationServerInstanceInner extends Resource { + /* + * Defines the SAP Application Server instance properties. + */ + @JsonProperty(value = "properties") + private SapApplicationServerProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of SapApplicationServerInstanceInner class. */ + public SapApplicationServerInstanceInner() { + } + + /** + * Get the innerProperties property: Defines the SAP Application Server instance properties. + * + * @return the innerProperties value. + */ + private SapApplicationServerProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public SapApplicationServerInstanceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public SapApplicationServerInstanceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the instanceNo property: Application server Instance Number. + * + * @return the instanceNo value. + */ + public String instanceNo() { + return this.innerProperties() == null ? null : this.innerProperties().instanceNo(); + } + + /** + * Get the subnet property: Application server Subnet. + * + * @return the subnet value. + */ + public String subnet() { + return this.innerProperties() == null ? null : this.innerProperties().subnet(); + } + + /** + * Get the hostname property: Application server instance SAP hostname. + * + * @return the hostname value. + */ + public String hostname() { + return this.innerProperties() == null ? null : this.innerProperties().hostname(); + } + + /** + * Get the kernelVersion property: Application server instance SAP Kernel Version. + * + * @return the kernelVersion value. + */ + public String kernelVersion() { + return this.innerProperties() == null ? null : this.innerProperties().kernelVersion(); + } + + /** + * Get the kernelPatch property: Application server instance SAP Kernel Patch level. + * + * @return the kernelPatch value. + */ + public String kernelPatch() { + return this.innerProperties() == null ? null : this.innerProperties().kernelPatch(); + } + + /** + * Get the ipAddress property: Application server instance SAP IP Address. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.innerProperties() == null ? null : this.innerProperties().ipAddress(); + } + + /** + * Get the gatewayPort property: Application server instance gateway Port. + * + * @return the gatewayPort value. + */ + public Long gatewayPort() { + return this.innerProperties() == null ? null : this.innerProperties().gatewayPort(); + } + + /** + * Get the icmHttpPort property: Application server instance ICM HTTP Port. + * + * @return the icmHttpPort value. + */ + public Long icmHttpPort() { + return this.innerProperties() == null ? null : this.innerProperties().icmHttpPort(); + } + + /** + * Get the icmHttpsPort property: Application server instance ICM HTTPS Port. + * + * @return the icmHttpsPort value. + */ + public Long icmHttpsPort() { + return this.innerProperties() == null ? null : this.innerProperties().icmHttpsPort(); + } + + /** + * Get the dispatcherStatus property: Application server instance dispatcher status. + * + * @return the dispatcherStatus value. + */ + public String dispatcherStatus() { + return this.innerProperties() == null ? null : this.innerProperties().dispatcherStatus(); + } + + /** + * Get the loadBalancerDetails property: The Load Balancer details such as LoadBalancer ID attached to Application + * Server Virtual Machines. + * + * @return the loadBalancerDetails value. + */ + public LoadBalancerDetails loadBalancerDetails() { + return this.innerProperties() == null ? null : this.innerProperties().loadBalancerDetails(); + } + + /** + * Get the vmDetails property: The list of virtual machines. + * + * @return the vmDetails value. + */ + public List vmDetails() { + return this.innerProperties() == null ? null : this.innerProperties().vmDetails(); + } + + /** + * Get the status property: Defines the SAP Instance status. + * + * @return the status value. + */ + public SapVirtualInstanceStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Get the health property: Defines the health of SAP Instances. + * + * @return the health value. + */ + public SapHealthState health() { + return this.innerProperties() == null ? null : this.innerProperties().health(); + } + + /** + * Get the provisioningState property: Defines the provisioning states. + * + * @return the provisioningState value. + */ + public SapVirtualInstanceProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the errors property: Defines the Application Instance errors. + * + * @return the errors value. + */ + public SapVirtualInstanceError errors() { + return this.innerProperties() == null ? null : this.innerProperties().errors(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/SapApplicationServerProperties.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/SapApplicationServerProperties.java new file mode 100644 index 0000000000000..c4dd45855112d --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/SapApplicationServerProperties.java @@ -0,0 +1,281 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.ApplicationServerVmDetails; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.LoadBalancerDetails; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapHealthState; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapVirtualInstanceError; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapVirtualInstanceProvisioningState; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapVirtualInstanceStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the SAP Application Server instance properties. */ +@Immutable +public final class SapApplicationServerProperties { + /* + * Application server Instance Number. + */ + @JsonProperty(value = "instanceNo", access = JsonProperty.Access.WRITE_ONLY) + private String instanceNo; + + /* + * Application server Subnet. + */ + @JsonProperty(value = "subnet", access = JsonProperty.Access.WRITE_ONLY) + private String subnet; + + /* + * Application server instance SAP hostname. + */ + @JsonProperty(value = "hostname", access = JsonProperty.Access.WRITE_ONLY) + private String hostname; + + /* + * Application server instance SAP Kernel Version. + */ + @JsonProperty(value = "kernelVersion", access = JsonProperty.Access.WRITE_ONLY) + private String kernelVersion; + + /* + * Application server instance SAP Kernel Patch level. + */ + @JsonProperty(value = "kernelPatch", access = JsonProperty.Access.WRITE_ONLY) + private String kernelPatch; + + /* + * Application server instance SAP IP Address. + */ + @JsonProperty(value = "ipAddress", access = JsonProperty.Access.WRITE_ONLY) + private String ipAddress; + + /* + * Application server instance gateway Port. + */ + @JsonProperty(value = "gatewayPort", access = JsonProperty.Access.WRITE_ONLY) + private Long gatewayPort; + + /* + * Application server instance ICM HTTP Port. + */ + @JsonProperty(value = "icmHttpPort", access = JsonProperty.Access.WRITE_ONLY) + private Long icmHttpPort; + + /* + * Application server instance ICM HTTPS Port. + */ + @JsonProperty(value = "icmHttpsPort", access = JsonProperty.Access.WRITE_ONLY) + private Long icmHttpsPort; + + /* + * Application server instance dispatcher status. + */ + @JsonProperty(value = "dispatcherStatus", access = JsonProperty.Access.WRITE_ONLY) + private String dispatcherStatus; + + /* + * The Load Balancer details such as LoadBalancer ID attached to Application Server Virtual Machines + */ + @JsonProperty(value = "loadBalancerDetails", access = JsonProperty.Access.WRITE_ONLY) + private LoadBalancerDetails loadBalancerDetails; + + /* + * The list of virtual machines. + */ + @JsonProperty(value = "vmDetails", access = JsonProperty.Access.WRITE_ONLY) + private List vmDetails; + + /* + * Defines the SAP Instance status. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private SapVirtualInstanceStatus status; + + /* + * Defines the health of SAP Instances. + */ + @JsonProperty(value = "health", access = JsonProperty.Access.WRITE_ONLY) + private SapHealthState health; + + /* + * Defines the provisioning states. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private SapVirtualInstanceProvisioningState provisioningState; + + /* + * Defines the Application Instance errors. + */ + @JsonProperty(value = "errors", access = JsonProperty.Access.WRITE_ONLY) + private SapVirtualInstanceError errors; + + /** Creates an instance of SapApplicationServerProperties class. */ + public SapApplicationServerProperties() { + } + + /** + * Get the instanceNo property: Application server Instance Number. + * + * @return the instanceNo value. + */ + public String instanceNo() { + return this.instanceNo; + } + + /** + * Get the subnet property: Application server Subnet. + * + * @return the subnet value. + */ + public String subnet() { + return this.subnet; + } + + /** + * Get the hostname property: Application server instance SAP hostname. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Get the kernelVersion property: Application server instance SAP Kernel Version. + * + * @return the kernelVersion value. + */ + public String kernelVersion() { + return this.kernelVersion; + } + + /** + * Get the kernelPatch property: Application server instance SAP Kernel Patch level. + * + * @return the kernelPatch value. + */ + public String kernelPatch() { + return this.kernelPatch; + } + + /** + * Get the ipAddress property: Application server instance SAP IP Address. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Get the gatewayPort property: Application server instance gateway Port. + * + * @return the gatewayPort value. + */ + public Long gatewayPort() { + return this.gatewayPort; + } + + /** + * Get the icmHttpPort property: Application server instance ICM HTTP Port. + * + * @return the icmHttpPort value. + */ + public Long icmHttpPort() { + return this.icmHttpPort; + } + + /** + * Get the icmHttpsPort property: Application server instance ICM HTTPS Port. + * + * @return the icmHttpsPort value. + */ + public Long icmHttpsPort() { + return this.icmHttpsPort; + } + + /** + * Get the dispatcherStatus property: Application server instance dispatcher status. + * + * @return the dispatcherStatus value. + */ + public String dispatcherStatus() { + return this.dispatcherStatus; + } + + /** + * Get the loadBalancerDetails property: The Load Balancer details such as LoadBalancer ID attached to Application + * Server Virtual Machines. + * + * @return the loadBalancerDetails value. + */ + public LoadBalancerDetails loadBalancerDetails() { + return this.loadBalancerDetails; + } + + /** + * Get the vmDetails property: The list of virtual machines. + * + * @return the vmDetails value. + */ + public List vmDetails() { + return this.vmDetails; + } + + /** + * Get the status property: Defines the SAP Instance status. + * + * @return the status value. + */ + public SapVirtualInstanceStatus status() { + return this.status; + } + + /** + * Get the health property: Defines the health of SAP Instances. + * + * @return the health value. + */ + public SapHealthState health() { + return this.health; + } + + /** + * Get the provisioningState property: Defines the provisioning states. + * + * @return the provisioningState value. + */ + public SapVirtualInstanceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the errors property: Defines the Application Instance errors. + * + * @return the errors value. + */ + public SapVirtualInstanceError errors() { + return this.errors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (loadBalancerDetails() != null) { + loadBalancerDetails().validate(); + } + if (vmDetails() != null) { + vmDetails().forEach(e -> e.validate()); + } + if (errors() != null) { + errors().validate(); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/SapAvailabilityZoneDetailsResultInner.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/SapAvailabilityZoneDetailsResultInner.java new file mode 100644 index 0000000000000..7e6d3b6e6387a --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/SapAvailabilityZoneDetailsResultInner.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapAvailabilityZonePair; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list of supported availability zone pairs which are part of SAP HA deployment. */ +@Fluent +public final class SapAvailabilityZoneDetailsResultInner { + /* + * Gets the list of availability zone pairs. + */ + @JsonProperty(value = "availabilityZonePairs") + private List availabilityZonePairs; + + /** Creates an instance of SapAvailabilityZoneDetailsResultInner class. */ + public SapAvailabilityZoneDetailsResultInner() { + } + + /** + * Get the availabilityZonePairs property: Gets the list of availability zone pairs. + * + * @return the availabilityZonePairs value. + */ + public List availabilityZonePairs() { + return this.availabilityZonePairs; + } + + /** + * Set the availabilityZonePairs property: Gets the list of availability zone pairs. + * + * @param availabilityZonePairs the availabilityZonePairs value to set. + * @return the SapAvailabilityZoneDetailsResultInner object itself. + */ + public SapAvailabilityZoneDetailsResultInner withAvailabilityZonePairs( + List availabilityZonePairs) { + this.availabilityZonePairs = availabilityZonePairs; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (availabilityZonePairs() != null) { + availabilityZonePairs().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/SapCentralServerInstanceInner.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/SapCentralServerInstanceInner.java new file mode 100644 index 0000000000000..39c6bb446498d --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/SapCentralServerInstanceInner.java @@ -0,0 +1,269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.CentralServerVmDetails; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.EnqueueReplicationServerProperties; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.EnqueueServerProperties; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.GatewayServerProperties; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.LoadBalancerDetails; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.MessageServerProperties; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapHealthState; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapVirtualInstanceError; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapVirtualInstanceProvisioningState; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapVirtualInstanceStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Define the SAP Central Services Instance resource. */ +@Fluent +public final class SapCentralServerInstanceInner extends Resource { + /* + * Defines the SAP Central Services Instance properties. + */ + @JsonProperty(value = "properties") + private SapCentralServerProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of SapCentralServerInstanceInner class. */ + public SapCentralServerInstanceInner() { + } + + /** + * Get the innerProperties property: Defines the SAP Central Services Instance properties. + * + * @return the innerProperties value. + */ + private SapCentralServerProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public SapCentralServerInstanceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public SapCentralServerInstanceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the instanceNo property: The central services instance number. + * + * @return the instanceNo value. + */ + public String instanceNo() { + return this.innerProperties() == null ? null : this.innerProperties().instanceNo(); + } + + /** + * Get the subnet property: The central services instance subnet. + * + * @return the subnet value. + */ + public String subnet() { + return this.innerProperties() == null ? null : this.innerProperties().subnet(); + } + + /** + * Get the messageServerProperties property: Defines the SAP message server properties. + * + * @return the messageServerProperties value. + */ + public MessageServerProperties messageServerProperties() { + return this.innerProperties() == null ? null : this.innerProperties().messageServerProperties(); + } + + /** + * Set the messageServerProperties property: Defines the SAP message server properties. + * + * @param messageServerProperties the messageServerProperties value to set. + * @return the SapCentralServerInstanceInner object itself. + */ + public SapCentralServerInstanceInner withMessageServerProperties(MessageServerProperties messageServerProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new SapCentralServerProperties(); + } + this.innerProperties().withMessageServerProperties(messageServerProperties); + return this; + } + + /** + * Get the enqueueServerProperties property: Defines the SAP Enqueue Server properties. + * + * @return the enqueueServerProperties value. + */ + public EnqueueServerProperties enqueueServerProperties() { + return this.innerProperties() == null ? null : this.innerProperties().enqueueServerProperties(); + } + + /** + * Set the enqueueServerProperties property: Defines the SAP Enqueue Server properties. + * + * @param enqueueServerProperties the enqueueServerProperties value to set. + * @return the SapCentralServerInstanceInner object itself. + */ + public SapCentralServerInstanceInner withEnqueueServerProperties(EnqueueServerProperties enqueueServerProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new SapCentralServerProperties(); + } + this.innerProperties().withEnqueueServerProperties(enqueueServerProperties); + return this; + } + + /** + * Get the gatewayServerProperties property: Defines the SAP Gateway Server properties. + * + * @return the gatewayServerProperties value. + */ + public GatewayServerProperties gatewayServerProperties() { + return this.innerProperties() == null ? null : this.innerProperties().gatewayServerProperties(); + } + + /** + * Set the gatewayServerProperties property: Defines the SAP Gateway Server properties. + * + * @param gatewayServerProperties the gatewayServerProperties value to set. + * @return the SapCentralServerInstanceInner object itself. + */ + public SapCentralServerInstanceInner withGatewayServerProperties(GatewayServerProperties gatewayServerProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new SapCentralServerProperties(); + } + this.innerProperties().withGatewayServerProperties(gatewayServerProperties); + return this; + } + + /** + * Get the enqueueReplicationServerProperties property: Defines the SAP Enqueue Replication Server (ERS) properties. + * + * @return the enqueueReplicationServerProperties value. + */ + public EnqueueReplicationServerProperties enqueueReplicationServerProperties() { + return this.innerProperties() == null ? null : this.innerProperties().enqueueReplicationServerProperties(); + } + + /** + * Set the enqueueReplicationServerProperties property: Defines the SAP Enqueue Replication Server (ERS) properties. + * + * @param enqueueReplicationServerProperties the enqueueReplicationServerProperties value to set. + * @return the SapCentralServerInstanceInner object itself. + */ + public SapCentralServerInstanceInner withEnqueueReplicationServerProperties( + EnqueueReplicationServerProperties enqueueReplicationServerProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new SapCentralServerProperties(); + } + this.innerProperties().withEnqueueReplicationServerProperties(enqueueReplicationServerProperties); + return this; + } + + /** + * Get the kernelVersion property: The central services instance Kernel Version. + * + * @return the kernelVersion value. + */ + public String kernelVersion() { + return this.innerProperties() == null ? null : this.innerProperties().kernelVersion(); + } + + /** + * Get the kernelPatch property: The central services instance Kernel Patch level. + * + * @return the kernelPatch value. + */ + public String kernelPatch() { + return this.innerProperties() == null ? null : this.innerProperties().kernelPatch(); + } + + /** + * Get the loadBalancerDetails property: The Load Balancer details such as LoadBalancer ID attached to ASCS Virtual + * Machines. + * + * @return the loadBalancerDetails value. + */ + public LoadBalancerDetails loadBalancerDetails() { + return this.innerProperties() == null ? null : this.innerProperties().loadBalancerDetails(); + } + + /** + * Get the vmDetails property: The list of virtual machines corresponding to the Central Services instance. + * + * @return the vmDetails value. + */ + public List vmDetails() { + return this.innerProperties() == null ? null : this.innerProperties().vmDetails(); + } + + /** + * Get the status property: Defines the SAP Instance status. + * + * @return the status value. + */ + public SapVirtualInstanceStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Get the health property: Defines the health of SAP Instances. + * + * @return the health value. + */ + public SapHealthState health() { + return this.innerProperties() == null ? null : this.innerProperties().health(); + } + + /** + * Get the provisioningState property: Defines the provisioning states. + * + * @return the provisioningState value. + */ + public SapVirtualInstanceProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the errors property: Defines the errors related to SAP Central Services Instance resource. + * + * @return the errors value. + */ + public SapVirtualInstanceError errors() { + return this.innerProperties() == null ? null : this.innerProperties().errors(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/SapCentralServerProperties.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/SapCentralServerProperties.java new file mode 100644 index 0000000000000..8270a1b5f9804 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/SapCentralServerProperties.java @@ -0,0 +1,312 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.CentralServerVmDetails; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.EnqueueReplicationServerProperties; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.EnqueueServerProperties; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.GatewayServerProperties; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.LoadBalancerDetails; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.MessageServerProperties; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapHealthState; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapVirtualInstanceError; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapVirtualInstanceProvisioningState; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapVirtualInstanceStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the SAP Central Services Instance properties. */ +@Fluent +public final class SapCentralServerProperties { + /* + * The central services instance number. + */ + @JsonProperty(value = "instanceNo", access = JsonProperty.Access.WRITE_ONLY) + private String instanceNo; + + /* + * The central services instance subnet. + */ + @JsonProperty(value = "subnet", access = JsonProperty.Access.WRITE_ONLY) + private String subnet; + + /* + * Defines the SAP message server properties. + */ + @JsonProperty(value = "messageServerProperties") + private MessageServerProperties messageServerProperties; + + /* + * Defines the SAP Enqueue Server properties. + */ + @JsonProperty(value = "enqueueServerProperties") + private EnqueueServerProperties enqueueServerProperties; + + /* + * Defines the SAP Gateway Server properties. + */ + @JsonProperty(value = "gatewayServerProperties") + private GatewayServerProperties gatewayServerProperties; + + /* + * Defines the SAP Enqueue Replication Server (ERS) properties. + */ + @JsonProperty(value = "enqueueReplicationServerProperties") + private EnqueueReplicationServerProperties enqueueReplicationServerProperties; + + /* + * The central services instance Kernel Version. + */ + @JsonProperty(value = "kernelVersion", access = JsonProperty.Access.WRITE_ONLY) + private String kernelVersion; + + /* + * The central services instance Kernel Patch level. + */ + @JsonProperty(value = "kernelPatch", access = JsonProperty.Access.WRITE_ONLY) + private String kernelPatch; + + /* + * The Load Balancer details such as LoadBalancer ID attached to ASCS Virtual Machines + */ + @JsonProperty(value = "loadBalancerDetails", access = JsonProperty.Access.WRITE_ONLY) + private LoadBalancerDetails loadBalancerDetails; + + /* + * The list of virtual machines corresponding to the Central Services instance. + */ + @JsonProperty(value = "vmDetails", access = JsonProperty.Access.WRITE_ONLY) + private List vmDetails; + + /* + * Defines the SAP Instance status. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private SapVirtualInstanceStatus status; + + /* + * Defines the health of SAP Instances. + */ + @JsonProperty(value = "health", access = JsonProperty.Access.WRITE_ONLY) + private SapHealthState health; + + /* + * Defines the provisioning states. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private SapVirtualInstanceProvisioningState provisioningState; + + /* + * Defines the errors related to SAP Central Services Instance resource. + */ + @JsonProperty(value = "errors", access = JsonProperty.Access.WRITE_ONLY) + private SapVirtualInstanceError errors; + + /** Creates an instance of SapCentralServerProperties class. */ + public SapCentralServerProperties() { + } + + /** + * Get the instanceNo property: The central services instance number. + * + * @return the instanceNo value. + */ + public String instanceNo() { + return this.instanceNo; + } + + /** + * Get the subnet property: The central services instance subnet. + * + * @return the subnet value. + */ + public String subnet() { + return this.subnet; + } + + /** + * Get the messageServerProperties property: Defines the SAP message server properties. + * + * @return the messageServerProperties value. + */ + public MessageServerProperties messageServerProperties() { + return this.messageServerProperties; + } + + /** + * Set the messageServerProperties property: Defines the SAP message server properties. + * + * @param messageServerProperties the messageServerProperties value to set. + * @return the SapCentralServerProperties object itself. + */ + public SapCentralServerProperties withMessageServerProperties(MessageServerProperties messageServerProperties) { + this.messageServerProperties = messageServerProperties; + return this; + } + + /** + * Get the enqueueServerProperties property: Defines the SAP Enqueue Server properties. + * + * @return the enqueueServerProperties value. + */ + public EnqueueServerProperties enqueueServerProperties() { + return this.enqueueServerProperties; + } + + /** + * Set the enqueueServerProperties property: Defines the SAP Enqueue Server properties. + * + * @param enqueueServerProperties the enqueueServerProperties value to set. + * @return the SapCentralServerProperties object itself. + */ + public SapCentralServerProperties withEnqueueServerProperties(EnqueueServerProperties enqueueServerProperties) { + this.enqueueServerProperties = enqueueServerProperties; + return this; + } + + /** + * Get the gatewayServerProperties property: Defines the SAP Gateway Server properties. + * + * @return the gatewayServerProperties value. + */ + public GatewayServerProperties gatewayServerProperties() { + return this.gatewayServerProperties; + } + + /** + * Set the gatewayServerProperties property: Defines the SAP Gateway Server properties. + * + * @param gatewayServerProperties the gatewayServerProperties value to set. + * @return the SapCentralServerProperties object itself. + */ + public SapCentralServerProperties withGatewayServerProperties(GatewayServerProperties gatewayServerProperties) { + this.gatewayServerProperties = gatewayServerProperties; + return this; + } + + /** + * Get the enqueueReplicationServerProperties property: Defines the SAP Enqueue Replication Server (ERS) properties. + * + * @return the enqueueReplicationServerProperties value. + */ + public EnqueueReplicationServerProperties enqueueReplicationServerProperties() { + return this.enqueueReplicationServerProperties; + } + + /** + * Set the enqueueReplicationServerProperties property: Defines the SAP Enqueue Replication Server (ERS) properties. + * + * @param enqueueReplicationServerProperties the enqueueReplicationServerProperties value to set. + * @return the SapCentralServerProperties object itself. + */ + public SapCentralServerProperties withEnqueueReplicationServerProperties( + EnqueueReplicationServerProperties enqueueReplicationServerProperties) { + this.enqueueReplicationServerProperties = enqueueReplicationServerProperties; + return this; + } + + /** + * Get the kernelVersion property: The central services instance Kernel Version. + * + * @return the kernelVersion value. + */ + public String kernelVersion() { + return this.kernelVersion; + } + + /** + * Get the kernelPatch property: The central services instance Kernel Patch level. + * + * @return the kernelPatch value. + */ + public String kernelPatch() { + return this.kernelPatch; + } + + /** + * Get the loadBalancerDetails property: The Load Balancer details such as LoadBalancer ID attached to ASCS Virtual + * Machines. + * + * @return the loadBalancerDetails value. + */ + public LoadBalancerDetails loadBalancerDetails() { + return this.loadBalancerDetails; + } + + /** + * Get the vmDetails property: The list of virtual machines corresponding to the Central Services instance. + * + * @return the vmDetails value. + */ + public List vmDetails() { + return this.vmDetails; + } + + /** + * Get the status property: Defines the SAP Instance status. + * + * @return the status value. + */ + public SapVirtualInstanceStatus status() { + return this.status; + } + + /** + * Get the health property: Defines the health of SAP Instances. + * + * @return the health value. + */ + public SapHealthState health() { + return this.health; + } + + /** + * Get the provisioningState property: Defines the provisioning states. + * + * @return the provisioningState value. + */ + public SapVirtualInstanceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the errors property: Defines the errors related to SAP Central Services Instance resource. + * + * @return the errors value. + */ + public SapVirtualInstanceError errors() { + return this.errors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (messageServerProperties() != null) { + messageServerProperties().validate(); + } + if (enqueueServerProperties() != null) { + enqueueServerProperties().validate(); + } + if (gatewayServerProperties() != null) { + gatewayServerProperties().validate(); + } + if (enqueueReplicationServerProperties() != null) { + enqueueReplicationServerProperties().validate(); + } + if (loadBalancerDetails() != null) { + loadBalancerDetails().validate(); + } + if (vmDetails() != null) { + vmDetails().forEach(e -> e.validate()); + } + if (errors() != null) { + errors().validate(); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/SapDatabaseInstanceInner.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/SapDatabaseInstanceInner.java new file mode 100644 index 0000000000000..2ef94dd74f5fe --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/SapDatabaseInstanceInner.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.DatabaseVmDetails; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.LoadBalancerDetails; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapVirtualInstanceError; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapVirtualInstanceProvisioningState; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapVirtualInstanceStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Define the Database resource. */ +@Fluent +public final class SapDatabaseInstanceInner extends Resource { + /* + * Defines the Database properties. + */ + @JsonProperty(value = "properties") + private SapDatabaseProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of SapDatabaseInstanceInner class. */ + public SapDatabaseInstanceInner() { + } + + /** + * Get the innerProperties property: Defines the Database properties. + * + * @return the innerProperties value. + */ + private SapDatabaseProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public SapDatabaseInstanceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public SapDatabaseInstanceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the subnet property: Database subnet. + * + * @return the subnet value. + */ + public String subnet() { + return this.innerProperties() == null ? null : this.innerProperties().subnet(); + } + + /** + * Get the databaseSid property: Database SID name. + * + * @return the databaseSid value. + */ + public String databaseSid() { + return this.innerProperties() == null ? null : this.innerProperties().databaseSid(); + } + + /** + * Get the databaseType property: Database type, that is if the DB is HANA, DB2, Oracle, SAP ASE, Max DB or MS SQL + * Server. + * + * @return the databaseType value. + */ + public String databaseType() { + return this.innerProperties() == null ? null : this.innerProperties().databaseType(); + } + + /** + * Get the ipAddress property: Database IP Address. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.innerProperties() == null ? null : this.innerProperties().ipAddress(); + } + + /** + * Get the loadBalancerDetails property: The Load Balancer details such as LoadBalancer ID attached to Database + * Virtual Machines. + * + * @return the loadBalancerDetails value. + */ + public LoadBalancerDetails loadBalancerDetails() { + return this.innerProperties() == null ? null : this.innerProperties().loadBalancerDetails(); + } + + /** + * Get the vmDetails property: The list of virtual machines corresponding to the Database resource. + * + * @return the vmDetails value. + */ + public List vmDetails() { + return this.innerProperties() == null ? null : this.innerProperties().vmDetails(); + } + + /** + * Get the status property: Defines the SAP Instance status. + * + * @return the status value. + */ + public SapVirtualInstanceStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Get the provisioningState property: Defines the provisioning states. + * + * @return the provisioningState value. + */ + public SapVirtualInstanceProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the errors property: Defines the errors related to Database resource. + * + * @return the errors value. + */ + public SapVirtualInstanceError errors() { + return this.innerProperties() == null ? null : this.innerProperties().errors(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/SapDatabaseProperties.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/SapDatabaseProperties.java new file mode 100644 index 0000000000000..846f53f8f8483 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/SapDatabaseProperties.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.DatabaseVmDetails; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.LoadBalancerDetails; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapVirtualInstanceError; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapVirtualInstanceProvisioningState; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapVirtualInstanceStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the Database properties. */ +@Immutable +public final class SapDatabaseProperties { + /* + * Database subnet. + */ + @JsonProperty(value = "subnet", access = JsonProperty.Access.WRITE_ONLY) + private String subnet; + + /* + * Database SID name. + */ + @JsonProperty(value = "databaseSid", access = JsonProperty.Access.WRITE_ONLY) + private String databaseSid; + + /* + * Database type, that is if the DB is HANA, DB2, Oracle, SAP ASE, Max DB or MS SQL Server. + */ + @JsonProperty(value = "databaseType", access = JsonProperty.Access.WRITE_ONLY) + private String databaseType; + + /* + * Database IP Address. + */ + @JsonProperty(value = "ipAddress", access = JsonProperty.Access.WRITE_ONLY) + private String ipAddress; + + /* + * The Load Balancer details such as LoadBalancer ID attached to Database Virtual Machines + */ + @JsonProperty(value = "loadBalancerDetails", access = JsonProperty.Access.WRITE_ONLY) + private LoadBalancerDetails loadBalancerDetails; + + /* + * The list of virtual machines corresponding to the Database resource. + */ + @JsonProperty(value = "vmDetails", access = JsonProperty.Access.WRITE_ONLY) + private List vmDetails; + + /* + * Defines the SAP Instance status. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private SapVirtualInstanceStatus status; + + /* + * Defines the provisioning states. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private SapVirtualInstanceProvisioningState provisioningState; + + /* + * Defines the errors related to Database resource. + */ + @JsonProperty(value = "errors", access = JsonProperty.Access.WRITE_ONLY) + private SapVirtualInstanceError errors; + + /** Creates an instance of SapDatabaseProperties class. */ + public SapDatabaseProperties() { + } + + /** + * Get the subnet property: Database subnet. + * + * @return the subnet value. + */ + public String subnet() { + return this.subnet; + } + + /** + * Get the databaseSid property: Database SID name. + * + * @return the databaseSid value. + */ + public String databaseSid() { + return this.databaseSid; + } + + /** + * Get the databaseType property: Database type, that is if the DB is HANA, DB2, Oracle, SAP ASE, Max DB or MS SQL + * Server. + * + * @return the databaseType value. + */ + public String databaseType() { + return this.databaseType; + } + + /** + * Get the ipAddress property: Database IP Address. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Get the loadBalancerDetails property: The Load Balancer details such as LoadBalancer ID attached to Database + * Virtual Machines. + * + * @return the loadBalancerDetails value. + */ + public LoadBalancerDetails loadBalancerDetails() { + return this.loadBalancerDetails; + } + + /** + * Get the vmDetails property: The list of virtual machines corresponding to the Database resource. + * + * @return the vmDetails value. + */ + public List vmDetails() { + return this.vmDetails; + } + + /** + * Get the status property: Defines the SAP Instance status. + * + * @return the status value. + */ + public SapVirtualInstanceStatus status() { + return this.status; + } + + /** + * Get the provisioningState property: Defines the provisioning states. + * + * @return the provisioningState value. + */ + public SapVirtualInstanceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the errors property: Defines the errors related to Database resource. + * + * @return the errors value. + */ + public SapVirtualInstanceError errors() { + return this.errors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (loadBalancerDetails() != null) { + loadBalancerDetails().validate(); + } + if (vmDetails() != null) { + vmDetails().forEach(e -> e.validate()); + } + if (errors() != null) { + errors().validate(); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/SapDiskConfigurationsResultInner.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/SapDiskConfigurationsResultInner.java new file mode 100644 index 0000000000000..bdfa8c9e94167 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/SapDiskConfigurationsResultInner.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapDiskConfiguration; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The list of disk configuration for vmSku which are part of SAP deployment. */ +@Fluent +public final class SapDiskConfigurationsResultInner { + /* + * The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', 'hana/log', + * hana/shared', 'usr/sap', 'os'], Optional volume : ['backup']. + */ + @JsonProperty(value = "volumeConfigurations") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map volumeConfigurations; + + /** Creates an instance of SapDiskConfigurationsResultInner class. */ + public SapDiskConfigurationsResultInner() { + } + + /** + * Get the volumeConfigurations property: The disk configuration for the db volume. For HANA, Required volumes are: + * ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os'], Optional volume : ['backup']. + * + * @return the volumeConfigurations value. + */ + public Map volumeConfigurations() { + return this.volumeConfigurations; + } + + /** + * Set the volumeConfigurations property: The disk configuration for the db volume. For HANA, Required volumes are: + * ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os'], Optional volume : ['backup']. + * + * @param volumeConfigurations the volumeConfigurations value to set. + * @return the SapDiskConfigurationsResultInner object itself. + */ + public SapDiskConfigurationsResultInner withVolumeConfigurations( + Map volumeConfigurations) { + this.volumeConfigurations = volumeConfigurations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (volumeConfigurations() != null) { + volumeConfigurations() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/SapSizingRecommendationResultInner.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/SapSizingRecommendationResultInner.java new file mode 100644 index 0000000000000..5febac615f0e9 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/SapSizingRecommendationResultInner.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SingleServerRecommendationResult; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.ThreeTierRecommendationResult; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The SAP sizing recommendation result. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "deploymentType", + defaultImpl = SapSizingRecommendationResultInner.class) +@JsonTypeName("SapSizingRecommendationResult") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "SingleServer", value = SingleServerRecommendationResult.class), + @JsonSubTypes.Type(name = "ThreeTier", value = ThreeTierRecommendationResult.class) +}) +@Immutable +public class SapSizingRecommendationResultInner { + /** Creates an instance of SapSizingRecommendationResultInner class. */ + public SapSizingRecommendationResultInner() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/SapSupportedResourceSkusResultInner.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/SapSupportedResourceSkusResultInner.java new file mode 100644 index 0000000000000..32788fa7e77eb --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/SapSupportedResourceSkusResultInner.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapSupportedSku; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list of supported SKUs for different resources which are part of SAP deployment. */ +@Fluent +public final class SapSupportedResourceSkusResultInner { + /* + * Gets the list of SAP supported SKUs. + */ + @JsonProperty(value = "supportedSkus") + private List supportedSkus; + + /** Creates an instance of SapSupportedResourceSkusResultInner class. */ + public SapSupportedResourceSkusResultInner() { + } + + /** + * Get the supportedSkus property: Gets the list of SAP supported SKUs. + * + * @return the supportedSkus value. + */ + public List supportedSkus() { + return this.supportedSkus; + } + + /** + * Set the supportedSkus property: Gets the list of SAP supported SKUs. + * + * @param supportedSkus the supportedSkus value to set. + * @return the SapSupportedResourceSkusResultInner object itself. + */ + public SapSupportedResourceSkusResultInner withSupportedSkus(List supportedSkus) { + this.supportedSkus = supportedSkus; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (supportedSkus() != null) { + supportedSkus().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/SapVirtualInstanceInner.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/SapVirtualInstanceInner.java new file mode 100644 index 0000000000000..92ab09926d8d6 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/SapVirtualInstanceInner.java @@ -0,0 +1,296 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.ManagedRGConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.ManagedResourcesNetworkAccessType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapEnvironmentType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapHealthState; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapProductType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapVirtualInstanceError; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapVirtualInstanceProvisioningState; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapVirtualInstanceState; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapVirtualInstanceStatus; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.UserAssignedServiceIdentity; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Define the Virtual Instance for SAP solutions resource. */ +@Fluent +public final class SapVirtualInstanceInner extends Resource { + /* + * Managed service identity (user assigned identities) + */ + @JsonProperty(value = "identity") + private UserAssignedServiceIdentity identity; + + /* + * Defines the Virtual Instance for SAP solutions resource properties. + */ + @JsonProperty(value = "properties", required = true) + private SapVirtualInstanceProperties innerProperties = new SapVirtualInstanceProperties(); + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of SapVirtualInstanceInner class. */ + public SapVirtualInstanceInner() { + } + + /** + * Get the identity property: Managed service identity (user assigned identities). + * + * @return the identity value. + */ + public UserAssignedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Managed service identity (user assigned identities). + * + * @param identity the identity value to set. + * @return the SapVirtualInstanceInner object itself. + */ + public SapVirtualInstanceInner withIdentity(UserAssignedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the innerProperties property: Defines the Virtual Instance for SAP solutions resource properties. + * + * @return the innerProperties value. + */ + private SapVirtualInstanceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** {@inheritDoc} */ + @Override + public SapVirtualInstanceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public SapVirtualInstanceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the environment property: Defines the environment type - Production/Non Production. + * + * @return the environment value. + */ + public SapEnvironmentType environment() { + return this.innerProperties() == null ? null : this.innerProperties().environment(); + } + + /** + * Set the environment property: Defines the environment type - Production/Non Production. + * + * @param environment the environment value to set. + * @return the SapVirtualInstanceInner object itself. + */ + public SapVirtualInstanceInner withEnvironment(SapEnvironmentType environment) { + if (this.innerProperties() == null) { + this.innerProperties = new SapVirtualInstanceProperties(); + } + this.innerProperties().withEnvironment(environment); + return this; + } + + /** + * Get the sapProduct property: Defines the SAP Product type. + * + * @return the sapProduct value. + */ + public SapProductType sapProduct() { + return this.innerProperties() == null ? null : this.innerProperties().sapProduct(); + } + + /** + * Set the sapProduct property: Defines the SAP Product type. + * + * @param sapProduct the sapProduct value to set. + * @return the SapVirtualInstanceInner object itself. + */ + public SapVirtualInstanceInner withSapProduct(SapProductType sapProduct) { + if (this.innerProperties() == null) { + this.innerProperties = new SapVirtualInstanceProperties(); + } + this.innerProperties().withSapProduct(sapProduct); + return this; + } + + /** + * Get the managedResourcesNetworkAccessType property: Specifies the network access configuration for the resources + * that will be deployed in the Managed Resource Group. The options to choose from are Public and Private. If + * 'Private' is chosen, the Storage Account service tag should be enabled on the subnets in which the SAP VMs exist. + * This is required for establishing connectivity between VM extensions and the managed resource group storage + * account. This setting is currently applicable only to Storage Account. Learn more here + * https://go.microsoft.com/fwlink/?linkid=2247228. + * + * @return the managedResourcesNetworkAccessType value. + */ + public ManagedResourcesNetworkAccessType managedResourcesNetworkAccessType() { + return this.innerProperties() == null ? null : this.innerProperties().managedResourcesNetworkAccessType(); + } + + /** + * Set the managedResourcesNetworkAccessType property: Specifies the network access configuration for the resources + * that will be deployed in the Managed Resource Group. The options to choose from are Public and Private. If + * 'Private' is chosen, the Storage Account service tag should be enabled on the subnets in which the SAP VMs exist. + * This is required for establishing connectivity between VM extensions and the managed resource group storage + * account. This setting is currently applicable only to Storage Account. Learn more here + * https://go.microsoft.com/fwlink/?linkid=2247228. + * + * @param managedResourcesNetworkAccessType the managedResourcesNetworkAccessType value to set. + * @return the SapVirtualInstanceInner object itself. + */ + public SapVirtualInstanceInner withManagedResourcesNetworkAccessType( + ManagedResourcesNetworkAccessType managedResourcesNetworkAccessType) { + if (this.innerProperties() == null) { + this.innerProperties = new SapVirtualInstanceProperties(); + } + this.innerProperties().withManagedResourcesNetworkAccessType(managedResourcesNetworkAccessType); + return this; + } + + /** + * Get the configuration property: 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. + * + * @return the configuration value. + */ + public SapConfiguration configuration() { + return this.innerProperties() == null ? null : this.innerProperties().configuration(); + } + + /** + * Set the configuration property: 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. + * + * @param configuration the configuration value to set. + * @return the SapVirtualInstanceInner object itself. + */ + public SapVirtualInstanceInner withConfiguration(SapConfiguration configuration) { + if (this.innerProperties() == null) { + this.innerProperties = new SapVirtualInstanceProperties(); + } + this.innerProperties().withConfiguration(configuration); + return this; + } + + /** + * Get the managedResourceGroupConfiguration property: Managed resource group configuration. + * + * @return the managedResourceGroupConfiguration value. + */ + public ManagedRGConfiguration managedResourceGroupConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().managedResourceGroupConfiguration(); + } + + /** + * Set the managedResourceGroupConfiguration property: Managed resource group configuration. + * + * @param managedResourceGroupConfiguration the managedResourceGroupConfiguration value to set. + * @return the SapVirtualInstanceInner object itself. + */ + public SapVirtualInstanceInner withManagedResourceGroupConfiguration( + ManagedRGConfiguration managedResourceGroupConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new SapVirtualInstanceProperties(); + } + this.innerProperties().withManagedResourceGroupConfiguration(managedResourceGroupConfiguration); + return this; + } + + /** + * Get the status property: Defines the SAP Instance status. + * + * @return the status value. + */ + public SapVirtualInstanceStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Get the health property: Defines the health of SAP Instances. + * + * @return the health value. + */ + public SapHealthState health() { + return this.innerProperties() == null ? null : this.innerProperties().health(); + } + + /** + * Get the state property: Defines the Virtual Instance for SAP state. + * + * @return the state value. + */ + public SapVirtualInstanceState state() { + return this.innerProperties() == null ? null : this.innerProperties().state(); + } + + /** + * Get the provisioningState property: Defines the provisioning states. + * + * @return the provisioningState value. + */ + public SapVirtualInstanceProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the errors property: Indicates any errors on the Virtual Instance for SAP solutions resource. + * + * @return the errors value. + */ + public SapVirtualInstanceError errors() { + return this.innerProperties() == null ? null : this.innerProperties().errors(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (innerProperties() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model SapVirtualInstanceInner")); + } else { + innerProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SapVirtualInstanceInner.class); +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/SapVirtualInstanceProperties.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/SapVirtualInstanceProperties.java new file mode 100644 index 0000000000000..170af2007abc8 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/SapVirtualInstanceProperties.java @@ -0,0 +1,287 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.ManagedRGConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.ManagedResourcesNetworkAccessType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapEnvironmentType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapHealthState; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapProductType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapVirtualInstanceError; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapVirtualInstanceProvisioningState; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapVirtualInstanceState; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapVirtualInstanceStatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the Virtual Instance for SAP solutions resource properties. */ +@Fluent +public final class SapVirtualInstanceProperties { + /* + * Defines the environment type - Production/Non Production. + */ + @JsonProperty(value = "environment", required = true) + private SapEnvironmentType environment; + + /* + * Defines the SAP Product type. + */ + @JsonProperty(value = "sapProduct", required = true) + private SapProductType sapProduct; + + /* + * Specifies the network access configuration for the resources that will be deployed in the Managed Resource + * Group. The options to choose from are Public and Private. If 'Private' is chosen, the Storage Account service + * tag should be enabled on the subnets in which the SAP VMs exist. This is required for establishing connectivity + * between VM extensions and the managed resource group storage account. This setting is currently applicable only + * to Storage Account. Learn more here https://go.microsoft.com/fwlink/?linkid=2247228 + */ + @JsonProperty(value = "managedResourcesNetworkAccessType") + private ManagedResourcesNetworkAccessType managedResourcesNetworkAccessType; + + /* + * 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 + */ + @JsonProperty(value = "configuration", required = true) + private SapConfiguration configuration; + + /* + * Managed resource group configuration + */ + @JsonProperty(value = "managedResourceGroupConfiguration") + private ManagedRGConfiguration managedResourceGroupConfiguration; + + /* + * Defines the SAP Instance status. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private SapVirtualInstanceStatus status; + + /* + * Defines the health of SAP Instances. + */ + @JsonProperty(value = "health", access = JsonProperty.Access.WRITE_ONLY) + private SapHealthState health; + + /* + * Defines the Virtual Instance for SAP state. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private SapVirtualInstanceState state; + + /* + * Defines the provisioning states. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private SapVirtualInstanceProvisioningState provisioningState; + + /* + * Indicates any errors on the Virtual Instance for SAP solutions resource. + */ + @JsonProperty(value = "errors", access = JsonProperty.Access.WRITE_ONLY) + private SapVirtualInstanceError errors; + + /** Creates an instance of SapVirtualInstanceProperties class. */ + public SapVirtualInstanceProperties() { + } + + /** + * Get the environment property: Defines the environment type - Production/Non Production. + * + * @return the environment value. + */ + public SapEnvironmentType environment() { + return this.environment; + } + + /** + * Set the environment property: Defines the environment type - Production/Non Production. + * + * @param environment the environment value to set. + * @return the SapVirtualInstanceProperties object itself. + */ + public SapVirtualInstanceProperties withEnvironment(SapEnvironmentType environment) { + this.environment = environment; + return this; + } + + /** + * Get the sapProduct property: Defines the SAP Product type. + * + * @return the sapProduct value. + */ + public SapProductType sapProduct() { + return this.sapProduct; + } + + /** + * Set the sapProduct property: Defines the SAP Product type. + * + * @param sapProduct the sapProduct value to set. + * @return the SapVirtualInstanceProperties object itself. + */ + public SapVirtualInstanceProperties withSapProduct(SapProductType sapProduct) { + this.sapProduct = sapProduct; + return this; + } + + /** + * Get the managedResourcesNetworkAccessType property: Specifies the network access configuration for the resources + * that will be deployed in the Managed Resource Group. The options to choose from are Public and Private. If + * 'Private' is chosen, the Storage Account service tag should be enabled on the subnets in which the SAP VMs exist. + * This is required for establishing connectivity between VM extensions and the managed resource group storage + * account. This setting is currently applicable only to Storage Account. Learn more here + * https://go.microsoft.com/fwlink/?linkid=2247228. + * + * @return the managedResourcesNetworkAccessType value. + */ + public ManagedResourcesNetworkAccessType managedResourcesNetworkAccessType() { + return this.managedResourcesNetworkAccessType; + } + + /** + * Set the managedResourcesNetworkAccessType property: Specifies the network access configuration for the resources + * that will be deployed in the Managed Resource Group. The options to choose from are Public and Private. If + * 'Private' is chosen, the Storage Account service tag should be enabled on the subnets in which the SAP VMs exist. + * This is required for establishing connectivity between VM extensions and the managed resource group storage + * account. This setting is currently applicable only to Storage Account. Learn more here + * https://go.microsoft.com/fwlink/?linkid=2247228. + * + * @param managedResourcesNetworkAccessType the managedResourcesNetworkAccessType value to set. + * @return the SapVirtualInstanceProperties object itself. + */ + public SapVirtualInstanceProperties withManagedResourcesNetworkAccessType( + ManagedResourcesNetworkAccessType managedResourcesNetworkAccessType) { + this.managedResourcesNetworkAccessType = managedResourcesNetworkAccessType; + return this; + } + + /** + * Get the configuration property: 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. + * + * @return the configuration value. + */ + public SapConfiguration configuration() { + return this.configuration; + } + + /** + * Set the configuration property: 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. + * + * @param configuration the configuration value to set. + * @return the SapVirtualInstanceProperties object itself. + */ + public SapVirtualInstanceProperties withConfiguration(SapConfiguration configuration) { + this.configuration = configuration; + return this; + } + + /** + * Get the managedResourceGroupConfiguration property: Managed resource group configuration. + * + * @return the managedResourceGroupConfiguration value. + */ + public ManagedRGConfiguration managedResourceGroupConfiguration() { + return this.managedResourceGroupConfiguration; + } + + /** + * Set the managedResourceGroupConfiguration property: Managed resource group configuration. + * + * @param managedResourceGroupConfiguration the managedResourceGroupConfiguration value to set. + * @return the SapVirtualInstanceProperties object itself. + */ + public SapVirtualInstanceProperties withManagedResourceGroupConfiguration( + ManagedRGConfiguration managedResourceGroupConfiguration) { + this.managedResourceGroupConfiguration = managedResourceGroupConfiguration; + return this; + } + + /** + * Get the status property: Defines the SAP Instance status. + * + * @return the status value. + */ + public SapVirtualInstanceStatus status() { + return this.status; + } + + /** + * Get the health property: Defines the health of SAP Instances. + * + * @return the health value. + */ + public SapHealthState health() { + return this.health; + } + + /** + * Get the state property: Defines the Virtual Instance for SAP state. + * + * @return the state value. + */ + public SapVirtualInstanceState state() { + return this.state; + } + + /** + * Get the provisioningState property: Defines the provisioning states. + * + * @return the provisioningState value. + */ + public SapVirtualInstanceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the errors property: Indicates any errors on the Virtual Instance for SAP solutions resource. + * + * @return the errors value. + */ + public SapVirtualInstanceError errors() { + return this.errors; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (environment() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property environment in model SapVirtualInstanceProperties")); + } + if (sapProduct() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sapProduct in model SapVirtualInstanceProperties")); + } + if (configuration() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property configuration in model SapVirtualInstanceProperties")); + } else { + configuration().validate(); + } + if (managedResourceGroupConfiguration() != null) { + managedResourceGroupConfiguration().validate(); + } + if (errors() != null) { + errors().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SapVirtualInstanceProperties.class); +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/package-info.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/package-info.java new file mode 100644 index 0000000000000..873b5281c5aea --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the inner data models for WorkloadsClient. Workloads client provides access to various workload + * operations. + */ +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models; diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/package-info.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/package-info.java new file mode 100644 index 0000000000000..d819a0110309e --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/fluent/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the service clients for WorkloadsClient. Workloads client provides access to various workload + * operations. + */ +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent; diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/OperationImpl.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/OperationImpl.java new file mode 100644 index 0000000000000..d500c9e952c4b --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/OperationImpl.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.implementation; + +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.OperationInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.ActionType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.Operation; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.OperationDisplay; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.Origin; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager + serviceManager; + + OperationImpl( + OperationInner innerObject, + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public Origin origin() { + return this.innerModel().origin(); + } + + public ActionType actionType() { + return this.innerModel().actionType(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/OperationStatusResultImpl.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/OperationStatusResultImpl.java new file mode 100644 index 0000000000000..9d8b873f19428 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/OperationStatusResultImpl.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.implementation; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.OperationStatusResult; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class OperationStatusResultImpl implements OperationStatusResult { + private OperationStatusResultInner innerObject; + + private final com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager + serviceManager; + + OperationStatusResultImpl( + OperationStatusResultInner innerObject, + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String status() { + return this.innerModel().status(); + } + + public Float percentComplete() { + return this.innerModel().percentComplete(); + } + + public OffsetDateTime startTime() { + return this.innerModel().startTime(); + } + + public OffsetDateTime endTime() { + return this.innerModel().endTime(); + } + + public List operations() { + List inner = this.innerModel().operations(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new OperationStatusResultImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public ManagementError error() { + return this.innerModel().error(); + } + + public OperationStatusResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/OperationsClientImpl.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/OperationsClientImpl.java new file mode 100644 index 0000000000000..9cae1a1906ac2 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/OperationsClientImpl.java @@ -0,0 +1,276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.OperationsClient; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.OperationInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.OperationListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public final class OperationsClientImpl implements OperationsClient { + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final WorkloadsClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(WorkloadsClientImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for WorkloadsClientOperations to be used by the proxy service to perform + * REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "WorkloadsClientOpera") + public interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Workloads/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all the available API operations under this PR. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the available API operations under this PR. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all the available API operations under this PR. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the available API operations under this PR. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the available API operations under this PR. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all the available API operations under this PR. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/OperationsImpl.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..7bf9b8d56efb6 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/OperationsImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.OperationsClient; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.OperationInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.Operation; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.Operations; + +public final class OperationsImpl implements Operations { + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager + serviceManager; + + public OperationsImpl( + OperationsClient innerClient, + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/ResourceProvidersClientImpl.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/ResourceProvidersClientImpl.java new file mode 100644 index 0000000000000..0aa42aa6e2081 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/ResourceProvidersClientImpl.java @@ -0,0 +1,696 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapAvailabilityZoneDetailsResultInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapDiskConfigurationsResultInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapSizingRecommendationResultInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapSupportedResourceSkusResultInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapAvailabilityZoneDetailsRequest; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapDiskConfigurationsRequest; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapSizingRecommendationRequest; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapSupportedSkusRequest; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ResourceProvidersClient. */ +public final class ResourceProvidersClientImpl implements ResourceProvidersClient { + /** The proxy service used to perform REST calls. */ + private final ResourceProvidersService service; + + /** The service client containing this operation class. */ + private final WorkloadsClientImpl client; + + /** + * Initializes an instance of ResourceProvidersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ResourceProvidersClientImpl(WorkloadsClientImpl client) { + this.service = + RestProxy.create(ResourceProvidersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for WorkloadsClientResourceProviders to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "WorkloadsClientResou") + public interface ResourceProvidersService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getSizingRecommendations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> sapSizingRecommendations( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SapSizingRecommendationRequest sapSizingRecommendation, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getSapSupportedSku") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> sapSupportedSku( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SapSupportedSkusRequest sapSupportedSku, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getDiskConfigurations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> sapDiskConfigurations( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SapDiskConfigurationsRequest sapDiskConfigurations, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getAvailabilityZoneDetails") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> sapAvailabilityZoneDetails( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SapAvailabilityZoneDetailsRequest sapAvailabilityZoneDetails, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get SAP sizing recommendations by providing input SAPS for application tier and memory required for database + * tier. + * + * @param location The name of Azure region. + * @param sapSizingRecommendation SAP Sizing Recommendation Request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sAP sizing recommendations by providing input SAPS for application tier and memory required for database + * tier along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> sapSizingRecommendationsWithResponseAsync( + String location, SapSizingRecommendationRequest sapSizingRecommendation) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (sapSizingRecommendation != null) { + sapSizingRecommendation.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .sapSizingRecommendations( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + this.client.getApiVersion(), + sapSizingRecommendation, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get SAP sizing recommendations by providing input SAPS for application tier and memory required for database + * tier. + * + * @param location The name of Azure region. + * @param sapSizingRecommendation SAP Sizing Recommendation Request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sAP sizing recommendations by providing input SAPS for application tier and memory required for database + * tier along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> sapSizingRecommendationsWithResponseAsync( + String location, SapSizingRecommendationRequest sapSizingRecommendation, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (sapSizingRecommendation != null) { + sapSizingRecommendation.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .sapSizingRecommendations( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + this.client.getApiVersion(), + sapSizingRecommendation, + accept, + context); + } + + /** + * Get SAP sizing recommendations by providing input SAPS for application tier and memory required for database + * tier. + * + * @param location The name of Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sAP sizing recommendations by providing input SAPS for application tier and memory required for database + * tier on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono sapSizingRecommendationsAsync(String location) { + final SapSizingRecommendationRequest sapSizingRecommendation = null; + return sapSizingRecommendationsWithResponseAsync(location, sapSizingRecommendation) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get SAP sizing recommendations by providing input SAPS for application tier and memory required for database + * tier. + * + * @param location The name of Azure region. + * @param sapSizingRecommendation SAP Sizing Recommendation Request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sAP sizing recommendations by providing input SAPS for application tier and memory required for database + * tier along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response sapSizingRecommendationsWithResponse( + String location, SapSizingRecommendationRequest sapSizingRecommendation, Context context) { + return sapSizingRecommendationsWithResponseAsync(location, sapSizingRecommendation, context).block(); + } + + /** + * Get SAP sizing recommendations by providing input SAPS for application tier and memory required for database + * tier. + * + * @param location The name of Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sAP sizing recommendations by providing input SAPS for application tier and memory required for database + * tier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapSizingRecommendationResultInner sapSizingRecommendations(String location) { + final SapSizingRecommendationRequest sapSizingRecommendation = null; + return sapSizingRecommendationsWithResponse(location, sapSizingRecommendation, Context.NONE).getValue(); + } + + /** + * Get a list of SAP supported SKUs for ASCS, Application and Database tier. + * + * @param location The name of Azure region. + * @param sapSupportedSku SAP Supported SKU Request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SAP supported SKUs for ASCS, Application and Database tier along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> sapSupportedSkuWithResponseAsync( + String location, SapSupportedSkusRequest sapSupportedSku) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (sapSupportedSku != null) { + sapSupportedSku.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .sapSupportedSku( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + this.client.getApiVersion(), + sapSupportedSku, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a list of SAP supported SKUs for ASCS, Application and Database tier. + * + * @param location The name of Azure region. + * @param sapSupportedSku SAP Supported SKU Request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SAP supported SKUs for ASCS, Application and Database tier along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> sapSupportedSkuWithResponseAsync( + String location, SapSupportedSkusRequest sapSupportedSku, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (sapSupportedSku != null) { + sapSupportedSku.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .sapSupportedSku( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + this.client.getApiVersion(), + sapSupportedSku, + accept, + context); + } + + /** + * Get a list of SAP supported SKUs for ASCS, Application and Database tier. + * + * @param location The name of Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SAP supported SKUs for ASCS, Application and Database tier on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono sapSupportedSkuAsync(String location) { + final SapSupportedSkusRequest sapSupportedSku = null; + return sapSupportedSkuWithResponseAsync(location, sapSupportedSku) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a list of SAP supported SKUs for ASCS, Application and Database tier. + * + * @param location The name of Azure region. + * @param sapSupportedSku SAP Supported SKU Request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SAP supported SKUs for ASCS, Application and Database tier along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response sapSupportedSkuWithResponse( + String location, SapSupportedSkusRequest sapSupportedSku, Context context) { + return sapSupportedSkuWithResponseAsync(location, sapSupportedSku, context).block(); + } + + /** + * Get a list of SAP supported SKUs for ASCS, Application and Database tier. + * + * @param location The name of Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SAP supported SKUs for ASCS, Application and Database tier. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapSupportedResourceSkusResultInner sapSupportedSku(String location) { + final SapSupportedSkusRequest sapSupportedSku = null; + return sapSupportedSkuWithResponse(location, sapSupportedSku, Context.NONE).getValue(); + } + + /** + * Get the SAP Disk Configuration Layout prod/non-prod SAP System. + * + * @param location The name of Azure region. + * @param sapDiskConfigurations SAP Disk Configurations Request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAP Disk Configuration Layout prod/non-prod SAP System along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> sapDiskConfigurationsWithResponseAsync( + String location, SapDiskConfigurationsRequest sapDiskConfigurations) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (sapDiskConfigurations != null) { + sapDiskConfigurations.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .sapDiskConfigurations( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + this.client.getApiVersion(), + sapDiskConfigurations, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the SAP Disk Configuration Layout prod/non-prod SAP System. + * + * @param location The name of Azure region. + * @param sapDiskConfigurations SAP Disk Configurations Request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAP Disk Configuration Layout prod/non-prod SAP System along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> sapDiskConfigurationsWithResponseAsync( + String location, SapDiskConfigurationsRequest sapDiskConfigurations, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (sapDiskConfigurations != null) { + sapDiskConfigurations.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .sapDiskConfigurations( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + this.client.getApiVersion(), + sapDiskConfigurations, + accept, + context); + } + + /** + * Get the SAP Disk Configuration Layout prod/non-prod SAP System. + * + * @param location The name of Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAP Disk Configuration Layout prod/non-prod SAP System on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono sapDiskConfigurationsAsync(String location) { + final SapDiskConfigurationsRequest sapDiskConfigurations = null; + return sapDiskConfigurationsWithResponseAsync(location, sapDiskConfigurations) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the SAP Disk Configuration Layout prod/non-prod SAP System. + * + * @param location The name of Azure region. + * @param sapDiskConfigurations SAP Disk Configurations Request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAP Disk Configuration Layout prod/non-prod SAP System along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response sapDiskConfigurationsWithResponse( + String location, SapDiskConfigurationsRequest sapDiskConfigurations, Context context) { + return sapDiskConfigurationsWithResponseAsync(location, sapDiskConfigurations, context).block(); + } + + /** + * Get the SAP Disk Configuration Layout prod/non-prod SAP System. + * + * @param location The name of Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAP Disk Configuration Layout prod/non-prod SAP System. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapDiskConfigurationsResultInner sapDiskConfigurations(String location) { + final SapDiskConfigurationsRequest sapDiskConfigurations = null; + return sapDiskConfigurationsWithResponse(location, sapDiskConfigurations, Context.NONE).getValue(); + } + + /** + * Get the recommended SAP Availability Zone Pair Details for your region. + * + * @param location The name of Azure region. + * @param sapAvailabilityZoneDetails SAP Availability Zone Details Request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the recommended SAP Availability Zone Pair Details for your region along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> sapAvailabilityZoneDetailsWithResponseAsync( + String location, SapAvailabilityZoneDetailsRequest sapAvailabilityZoneDetails) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (sapAvailabilityZoneDetails != null) { + sapAvailabilityZoneDetails.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .sapAvailabilityZoneDetails( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + this.client.getApiVersion(), + sapAvailabilityZoneDetails, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the recommended SAP Availability Zone Pair Details for your region. + * + * @param location The name of Azure region. + * @param sapAvailabilityZoneDetails SAP Availability Zone Details Request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the recommended SAP Availability Zone Pair Details for your region along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> sapAvailabilityZoneDetailsWithResponseAsync( + String location, SapAvailabilityZoneDetailsRequest sapAvailabilityZoneDetails, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (sapAvailabilityZoneDetails != null) { + sapAvailabilityZoneDetails.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .sapAvailabilityZoneDetails( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + location, + this.client.getApiVersion(), + sapAvailabilityZoneDetails, + accept, + context); + } + + /** + * Get the recommended SAP Availability Zone Pair Details for your region. + * + * @param location The name of Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the recommended SAP Availability Zone Pair Details for your region on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono sapAvailabilityZoneDetailsAsync(String location) { + final SapAvailabilityZoneDetailsRequest sapAvailabilityZoneDetails = null; + return sapAvailabilityZoneDetailsWithResponseAsync(location, sapAvailabilityZoneDetails) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the recommended SAP Availability Zone Pair Details for your region. + * + * @param location The name of Azure region. + * @param sapAvailabilityZoneDetails SAP Availability Zone Details Request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the recommended SAP Availability Zone Pair Details for your region along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response sapAvailabilityZoneDetailsWithResponse( + String location, SapAvailabilityZoneDetailsRequest sapAvailabilityZoneDetails, Context context) { + return sapAvailabilityZoneDetailsWithResponseAsync(location, sapAvailabilityZoneDetails, context).block(); + } + + /** + * Get the recommended SAP Availability Zone Pair Details for your region. + * + * @param location The name of Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the recommended SAP Availability Zone Pair Details for your region. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapAvailabilityZoneDetailsResultInner sapAvailabilityZoneDetails(String location) { + final SapAvailabilityZoneDetailsRequest sapAvailabilityZoneDetails = null; + return sapAvailabilityZoneDetailsWithResponse(location, sapAvailabilityZoneDetails, Context.NONE).getValue(); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/ResourceProvidersImpl.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/ResourceProvidersImpl.java new file mode 100644 index 0000000000000..3410acfe48d58 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/ResourceProvidersImpl.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapAvailabilityZoneDetailsResultInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapDiskConfigurationsResultInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapSizingRecommendationResultInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapSupportedResourceSkusResultInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.ResourceProviders; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapAvailabilityZoneDetailsRequest; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapAvailabilityZoneDetailsResult; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapDiskConfigurationsRequest; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapDiskConfigurationsResult; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapSizingRecommendationRequest; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapSizingRecommendationResult; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapSupportedResourceSkusResult; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapSupportedSkusRequest; + +public final class ResourceProvidersImpl implements ResourceProviders { + private static final ClientLogger LOGGER = new ClientLogger(ResourceProvidersImpl.class); + + private final ResourceProvidersClient innerClient; + + private final com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager + serviceManager; + + public ResourceProvidersImpl( + ResourceProvidersClient innerClient, + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response sapSizingRecommendationsWithResponse( + String location, SapSizingRecommendationRequest sapSizingRecommendation, Context context) { + Response inner = + this.serviceClient().sapSizingRecommendationsWithResponse(location, sapSizingRecommendation, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SapSizingRecommendationResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SapSizingRecommendationResult sapSizingRecommendations(String location) { + SapSizingRecommendationResultInner inner = this.serviceClient().sapSizingRecommendations(location); + if (inner != null) { + return new SapSizingRecommendationResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response sapSupportedSkuWithResponse( + String location, SapSupportedSkusRequest sapSupportedSku, Context context) { + Response inner = + this.serviceClient().sapSupportedSkuWithResponse(location, sapSupportedSku, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SapSupportedResourceSkusResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SapSupportedResourceSkusResult sapSupportedSku(String location) { + SapSupportedResourceSkusResultInner inner = this.serviceClient().sapSupportedSku(location); + if (inner != null) { + return new SapSupportedResourceSkusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response sapDiskConfigurationsWithResponse( + String location, SapDiskConfigurationsRequest sapDiskConfigurations, Context context) { + Response inner = + this.serviceClient().sapDiskConfigurationsWithResponse(location, sapDiskConfigurations, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SapDiskConfigurationsResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SapDiskConfigurationsResult sapDiskConfigurations(String location) { + SapDiskConfigurationsResultInner inner = this.serviceClient().sapDiskConfigurations(location); + if (inner != null) { + return new SapDiskConfigurationsResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response sapAvailabilityZoneDetailsWithResponse( + String location, SapAvailabilityZoneDetailsRequest sapAvailabilityZoneDetails, Context context) { + Response inner = + this.serviceClient().sapAvailabilityZoneDetailsWithResponse(location, sapAvailabilityZoneDetails, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SapAvailabilityZoneDetailsResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SapAvailabilityZoneDetailsResult sapAvailabilityZoneDetails(String location) { + SapAvailabilityZoneDetailsResultInner inner = this.serviceClient().sapAvailabilityZoneDetails(location); + if (inner != null) { + return new SapAvailabilityZoneDetailsResultImpl(inner, this.manager()); + } else { + return null; + } + } + + private ResourceProvidersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapApplicationServerInstanceImpl.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapApplicationServerInstanceImpl.java new file mode 100644 index 0000000000000..5d6ba2d94c899 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapApplicationServerInstanceImpl.java @@ -0,0 +1,303 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapApplicationServerInstanceInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.ApplicationServerVmDetails; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.LoadBalancerDetails; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.OperationStatusResult; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapApplicationServerInstance; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapHealthState; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapVirtualInstanceError; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapVirtualInstanceProvisioningState; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapVirtualInstanceStatus; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StartRequest; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StopRequest; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.UpdateSapApplicationInstanceRequest; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class SapApplicationServerInstanceImpl + implements SapApplicationServerInstance, + SapApplicationServerInstance.Definition, + SapApplicationServerInstance.Update { + private SapApplicationServerInstanceInner innerObject; + + private final com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager + serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String instanceNo() { + return this.innerModel().instanceNo(); + } + + public String subnet() { + return this.innerModel().subnet(); + } + + public String hostname() { + return this.innerModel().hostname(); + } + + public String kernelVersion() { + return this.innerModel().kernelVersion(); + } + + public String kernelPatch() { + return this.innerModel().kernelPatch(); + } + + public String ipAddress() { + return this.innerModel().ipAddress(); + } + + public Long gatewayPort() { + return this.innerModel().gatewayPort(); + } + + public Long icmHttpPort() { + return this.innerModel().icmHttpPort(); + } + + public Long icmHttpsPort() { + return this.innerModel().icmHttpsPort(); + } + + public String dispatcherStatus() { + return this.innerModel().dispatcherStatus(); + } + + public LoadBalancerDetails loadBalancerDetails() { + return this.innerModel().loadBalancerDetails(); + } + + public List vmDetails() { + List inner = this.innerModel().vmDetails(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SapVirtualInstanceStatus status() { + return this.innerModel().status(); + } + + public SapHealthState health() { + return this.innerModel().health(); + } + + public SapVirtualInstanceProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public SapVirtualInstanceError errors() { + return this.innerModel().errors(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public SapApplicationServerInstanceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String sapVirtualInstanceName; + + private String applicationInstanceName; + + private UpdateSapApplicationInstanceRequest updateBody; + + public SapApplicationServerInstanceImpl withExistingSapVirtualInstance( + String resourceGroupName, String sapVirtualInstanceName) { + this.resourceGroupName = resourceGroupName; + this.sapVirtualInstanceName = sapVirtualInstanceName; + return this; + } + + public SapApplicationServerInstance create() { + this.innerObject = + serviceManager + .serviceClient() + .getSapApplicationServerInstances() + .create( + resourceGroupName, + sapVirtualInstanceName, + applicationInstanceName, + this.innerModel(), + Context.NONE); + return this; + } + + public SapApplicationServerInstance create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSapApplicationServerInstances() + .create(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, this.innerModel(), context); + return this; + } + + SapApplicationServerInstanceImpl( + String name, + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager serviceManager) { + this.innerObject = new SapApplicationServerInstanceInner(); + this.serviceManager = serviceManager; + this.applicationInstanceName = name; + } + + public SapApplicationServerInstanceImpl update() { + this.updateBody = new UpdateSapApplicationInstanceRequest(); + return this; + } + + public SapApplicationServerInstance apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSapApplicationServerInstances() + .updateWithResponse( + resourceGroupName, sapVirtualInstanceName, applicationInstanceName, updateBody, Context.NONE) + .getValue(); + return this; + } + + public SapApplicationServerInstance apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSapApplicationServerInstances() + .updateWithResponse( + resourceGroupName, sapVirtualInstanceName, applicationInstanceName, updateBody, context) + .getValue(); + return this; + } + + SapApplicationServerInstanceImpl( + SapApplicationServerInstanceInner innerObject, + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.sapVirtualInstanceName = Utils.getValueFromIdByName(innerObject.id(), "sapVirtualInstances"); + this.applicationInstanceName = Utils.getValueFromIdByName(innerObject.id(), "applicationInstances"); + } + + public SapApplicationServerInstance refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSapApplicationServerInstances() + .getWithResponse(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, Context.NONE) + .getValue(); + return this; + } + + public SapApplicationServerInstance refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSapApplicationServerInstances() + .getWithResponse(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, context) + .getValue(); + return this; + } + + public OperationStatusResult startInstance() { + return serviceManager + .sapApplicationServerInstances() + .startInstance(resourceGroupName, sapVirtualInstanceName, applicationInstanceName); + } + + public OperationStatusResult startInstance(StartRequest body, Context context) { + return serviceManager + .sapApplicationServerInstances() + .startInstance(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body, context); + } + + public OperationStatusResult stopInstance() { + return serviceManager + .sapApplicationServerInstances() + .stopInstance(resourceGroupName, sapVirtualInstanceName, applicationInstanceName); + } + + public OperationStatusResult stopInstance(StopRequest body, Context context) { + return serviceManager + .sapApplicationServerInstances() + .stopInstance(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body, context); + } + + public SapApplicationServerInstanceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SapApplicationServerInstanceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SapApplicationServerInstanceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateBody.withTags(tags); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapApplicationServerInstancesClientImpl.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapApplicationServerInstancesClientImpl.java new file mode 100644 index 0000000000000..74b7c94d34554 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapApplicationServerInstancesClientImpl.java @@ -0,0 +1,2232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.SapApplicationServerInstancesClient; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapApplicationServerInstanceInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapApplicationServerInstanceList; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StartRequest; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StopRequest; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.UpdateSapApplicationInstanceRequest; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SapApplicationServerInstancesClient. */ +public final class SapApplicationServerInstancesClientImpl implements SapApplicationServerInstancesClient { + /** The proxy service used to perform REST calls. */ + private final SapApplicationServerInstancesService service; + + /** The service client containing this operation class. */ + private final WorkloadsClientImpl client; + + /** + * Initializes an instance of SapApplicationServerInstancesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SapApplicationServerInstancesClientImpl(WorkloadsClientImpl client) { + this.service = + RestProxy + .create( + SapApplicationServerInstancesService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for WorkloadsClientSapApplicationServerInstances to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "WorkloadsClientSapAp") + public interface SapApplicationServerInstancesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, + @PathParam("applicationInstanceName") String applicationInstanceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, + @PathParam("applicationInstanceName") String applicationInstanceName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SapApplicationServerInstanceInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, + @PathParam("applicationInstanceName") String applicationInstanceName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") UpdateSapApplicationInstanceRequest body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, + @PathParam("applicationInstanceName") String applicationInstanceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName}/start") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> startInstance( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, + @PathParam("applicationInstanceName") String applicationInstanceName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") StartRequest body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName}/stop") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> stopInstance( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, + @PathParam("applicationInstanceName") String applicationInstanceName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") StopRequest body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource + * along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + if (applicationInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + applicationInstanceName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource + * along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + if (applicationInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + applicationInstanceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + return getWithResponseAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource + * along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, Context context) { + return getWithResponseAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, context) + .block(); + } + + /** + * Gets the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapApplicationServerInstanceInner get( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + return getWithResponse(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, Context.NONE) + .getValue(); + } + + /** + * Puts the SAP Application Server Instance resource. <br><br>This will be used by service only. PUT by + * end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @param body The SAP Application Server Instance resource request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the SAP Application Server Instance resource along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String sapVirtualInstanceName, + String applicationInstanceName, + SapApplicationServerInstanceInner body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + if (applicationInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationInstanceName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + applicationInstanceName, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Puts the SAP Application Server Instance resource. <br><br>This will be used by service only. PUT by + * end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @param body The SAP Application Server Instance resource request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the SAP Application Server Instance resource along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String sapVirtualInstanceName, + String applicationInstanceName, + SapApplicationServerInstanceInner body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + if (applicationInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationInstanceName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + applicationInstanceName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Puts the SAP Application Server Instance resource. <br><br>This will be used by service only. PUT by + * end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @param body The SAP Application Server Instance resource request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of define the SAP Application Server Instance resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SapApplicationServerInstanceInner> + beginCreateAsync( + String resourceGroupName, + String sapVirtualInstanceName, + String applicationInstanceName, + SapApplicationServerInstanceInner body) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SapApplicationServerInstanceInner.class, + SapApplicationServerInstanceInner.class, + this.client.getContext()); + } + + /** + * Puts the SAP Application Server Instance resource. <br><br>This will be used by service only. PUT by + * end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of define the SAP Application Server Instance resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SapApplicationServerInstanceInner> + beginCreateAsync(String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + final SapApplicationServerInstanceInner body = null; + Mono>> mono = + createWithResponseAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SapApplicationServerInstanceInner.class, + SapApplicationServerInstanceInner.class, + this.client.getContext()); + } + + /** + * Puts the SAP Application Server Instance resource. <br><br>This will be used by service only. PUT by + * end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @param body The SAP Application Server Instance resource request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of define the SAP Application Server Instance resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SapApplicationServerInstanceInner> + beginCreateAsync( + String resourceGroupName, + String sapVirtualInstanceName, + String applicationInstanceName, + SapApplicationServerInstanceInner body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SapApplicationServerInstanceInner.class, + SapApplicationServerInstanceInner.class, + context); + } + + /** + * Puts the SAP Application Server Instance resource. <br><br>This will be used by service only. PUT by + * end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of define the SAP Application Server Instance resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SapApplicationServerInstanceInner> beginCreate( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + final SapApplicationServerInstanceInner body = null; + return this + .beginCreateAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body) + .getSyncPoller(); + } + + /** + * Puts the SAP Application Server Instance resource. <br><br>This will be used by service only. PUT by + * end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @param body The SAP Application Server Instance resource request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of define the SAP Application Server Instance resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SapApplicationServerInstanceInner> beginCreate( + String resourceGroupName, + String sapVirtualInstanceName, + String applicationInstanceName, + SapApplicationServerInstanceInner body, + Context context) { + return this + .beginCreateAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body, context) + .getSyncPoller(); + } + + /** + * Puts the SAP Application Server Instance resource. <br><br>This will be used by service only. PUT by + * end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @param body The SAP Application Server Instance resource request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the SAP Application Server Instance resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String sapVirtualInstanceName, + String applicationInstanceName, + SapApplicationServerInstanceInner body) { + return beginCreateAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Puts the SAP Application Server Instance resource. <br><br>This will be used by service only. PUT by + * end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the SAP Application Server Instance resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + final SapApplicationServerInstanceInner body = null; + return beginCreateAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Puts the SAP Application Server Instance resource. <br><br>This will be used by service only. PUT by + * end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @param body The SAP Application Server Instance resource request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the SAP Application Server Instance resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String sapVirtualInstanceName, + String applicationInstanceName, + SapApplicationServerInstanceInner body, + Context context) { + return beginCreateAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Puts the SAP Application Server Instance resource. <br><br>This will be used by service only. PUT by + * end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the SAP Application Server Instance resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapApplicationServerInstanceInner create( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + final SapApplicationServerInstanceInner body = null; + return createAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body).block(); + } + + /** + * Puts the SAP Application Server Instance resource. <br><br>This will be used by service only. PUT by + * end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @param body The SAP Application Server Instance resource request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the SAP Application Server Instance resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapApplicationServerInstanceInner create( + String resourceGroupName, + String sapVirtualInstanceName, + String applicationInstanceName, + SapApplicationServerInstanceInner body, + Context context) { + return createAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body, context).block(); + } + + /** + * Updates the SAP Application server instance resource. This can be used to update tags on the resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @param body The SAP Application Server Instance resource request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the SAP Application Server Instance resource along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String sapVirtualInstanceName, + String applicationInstanceName, + UpdateSapApplicationInstanceRequest body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + if (applicationInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationInstanceName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + applicationInstanceName, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates the SAP Application server instance resource. This can be used to update tags on the resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @param body The SAP Application Server Instance resource request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the SAP Application Server Instance resource along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String sapVirtualInstanceName, + String applicationInstanceName, + UpdateSapApplicationInstanceRequest body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + if (applicationInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationInstanceName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + applicationInstanceName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Updates the SAP Application server instance resource. This can be used to update tags on the resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the SAP Application Server Instance resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + final UpdateSapApplicationInstanceRequest body = null; + return updateWithResponseAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Updates the SAP Application server instance resource. This can be used to update tags on the resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @param body The SAP Application Server Instance resource request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the SAP Application Server Instance resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String sapVirtualInstanceName, + String applicationInstanceName, + UpdateSapApplicationInstanceRequest body, + Context context) { + return updateWithResponseAsync( + resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body, context) + .block(); + } + + /** + * Updates the SAP Application server instance resource. This can be used to update tags on the resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the SAP Application Server Instance resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapApplicationServerInstanceInner update( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + final UpdateSapApplicationInstanceRequest body = null; + return updateWithResponse( + resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body, Context.NONE) + .getValue(); + } + + /** + * Deletes the SAP Application Server Instance resource. <br><br>This operation will be used by service + * only. Delete by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + if (applicationInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + applicationInstanceName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the SAP Application Server Instance resource. <br><br>This operation will be used by service + * only. Delete by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + if (applicationInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + applicationInstanceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes the SAP Application Server Instance resource. <br><br>This operation will be used by service + * only. Delete by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes the SAP Application Server Instance resource. <br><br>This operation will be used by service + * only. Delete by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the SAP Application Server Instance resource. <br><br>This operation will be used by service + * only. Delete by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + return this + .beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName) + .getSyncPoller(); + } + + /** + * Deletes the SAP Application Server Instance resource. <br><br>This operation will be used by service + * only. Delete by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, Context context) { + return this + .beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, context) + .getSyncPoller(); + } + + /** + * Deletes the SAP Application Server Instance resource. <br><br>This operation will be used by service + * only. Delete by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + return beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the SAP Application Server Instance resource. <br><br>This operation will be used by service + * only. Delete by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, Context context) { + return beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the SAP Application Server Instance resource. <br><br>This operation will be used by service + * only. Delete by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + deleteAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName).block(); + } + + /** + * Deletes the SAP Application Server Instance resource. <br><br>This operation will be used by service + * only. Delete by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, Context context) { + deleteAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, context).block(); + } + + /** + * Lists the SAP Application Server Instance resources for a given Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of SAP Application Server Instance resources along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String sapVirtualInstanceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the SAP Application Server Instance resources for a given Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of SAP Application Server Instance resources along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String sapVirtualInstanceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the SAP Application Server Instance resources for a given Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of SAP Application Server Instance resources as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String sapVirtualInstanceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, sapVirtualInstanceName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the SAP Application Server Instance resources for a given Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of SAP Application Server Instance resources as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String sapVirtualInstanceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, sapVirtualInstanceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the SAP Application Server Instance resources for a given Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of SAP Application Server Instance resources as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String sapVirtualInstanceName) { + return new PagedIterable<>(listAsync(resourceGroupName, sapVirtualInstanceName)); + } + + /** + * Lists the SAP Application Server Instance resources for a given Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of SAP Application Server Instance resources as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String sapVirtualInstanceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, sapVirtualInstanceName, context)); + } + + /** + * Starts the SAP Application Server Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @param body SAP Application server instance start request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startInstanceWithResponseAsync( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, StartRequest body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + if (applicationInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationInstanceName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .startInstance( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + applicationInstanceName, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Starts the SAP Application Server Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @param body SAP Application server instance start request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startInstanceWithResponseAsync( + String resourceGroupName, + String sapVirtualInstanceName, + String applicationInstanceName, + StartRequest body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + if (applicationInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationInstanceName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .startInstance( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + applicationInstanceName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Starts the SAP Application Server Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @param body SAP Application server instance start request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusResultInner> beginStartInstanceAsync( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, StartRequest body) { + Mono>> mono = + startInstanceWithResponseAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationStatusResultInner.class, + OperationStatusResultInner.class, + this.client.getContext()); + } + + /** + * Starts the SAP Application Server Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusResultInner> beginStartInstanceAsync( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + final StartRequest body = null; + Mono>> mono = + startInstanceWithResponseAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationStatusResultInner.class, + OperationStatusResultInner.class, + this.client.getContext()); + } + + /** + * Starts the SAP Application Server Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @param body SAP Application server instance start request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusResultInner> beginStartInstanceAsync( + String resourceGroupName, + String sapVirtualInstanceName, + String applicationInstanceName, + StartRequest body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + startInstanceWithResponseAsync( + resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationStatusResultInner.class, + OperationStatusResultInner.class, + context); + } + + /** + * Starts the SAP Application Server Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationStatusResultInner> beginStartInstance( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + final StartRequest body = null; + return this + .beginStartInstanceAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body) + .getSyncPoller(); + } + + /** + * Starts the SAP Application Server Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @param body SAP Application server instance start request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationStatusResultInner> beginStartInstance( + String resourceGroupName, + String sapVirtualInstanceName, + String applicationInstanceName, + StartRequest body, + Context context) { + return this + .beginStartInstanceAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body, context) + .getSyncPoller(); + } + + /** + * Starts the SAP Application Server Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @param body SAP Application server instance start request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startInstanceAsync( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, StartRequest body) { + return beginStartInstanceAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts the SAP Application Server Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startInstanceAsync( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + final StartRequest body = null; + return beginStartInstanceAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts the SAP Application Server Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @param body SAP Application server instance start request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startInstanceAsync( + String resourceGroupName, + String sapVirtualInstanceName, + String applicationInstanceName, + StartRequest body, + Context context) { + return beginStartInstanceAsync( + resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts the SAP Application Server Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusResultInner startInstance( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + final StartRequest body = null; + return startInstanceAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body).block(); + } + + /** + * Starts the SAP Application Server Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @param body SAP Application server instance start request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusResultInner startInstance( + String resourceGroupName, + String sapVirtualInstanceName, + String applicationInstanceName, + StartRequest body, + Context context) { + return startInstanceAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body, context) + .block(); + } + + /** + * Stops the SAP Application Server Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @param body SAP Application server instance stop request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> stopInstanceWithResponseAsync( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, StopRequest body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + if (applicationInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationInstanceName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .stopInstance( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + applicationInstanceName, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Stops the SAP Application Server Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @param body SAP Application server instance stop request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> stopInstanceWithResponseAsync( + String resourceGroupName, + String sapVirtualInstanceName, + String applicationInstanceName, + StopRequest body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + if (applicationInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter applicationInstanceName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .stopInstance( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + applicationInstanceName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Stops the SAP Application Server Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @param body SAP Application server instance stop request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusResultInner> beginStopInstanceAsync( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, StopRequest body) { + Mono>> mono = + stopInstanceWithResponseAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationStatusResultInner.class, + OperationStatusResultInner.class, + this.client.getContext()); + } + + /** + * Stops the SAP Application Server Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusResultInner> beginStopInstanceAsync( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + final StopRequest body = null; + Mono>> mono = + stopInstanceWithResponseAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationStatusResultInner.class, + OperationStatusResultInner.class, + this.client.getContext()); + } + + /** + * Stops the SAP Application Server Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @param body SAP Application server instance stop request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusResultInner> beginStopInstanceAsync( + String resourceGroupName, + String sapVirtualInstanceName, + String applicationInstanceName, + StopRequest body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + stopInstanceWithResponseAsync( + resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationStatusResultInner.class, + OperationStatusResultInner.class, + context); + } + + /** + * Stops the SAP Application Server Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationStatusResultInner> beginStopInstance( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + final StopRequest body = null; + return this + .beginStopInstanceAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body) + .getSyncPoller(); + } + + /** + * Stops the SAP Application Server Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @param body SAP Application server instance stop request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationStatusResultInner> beginStopInstance( + String resourceGroupName, + String sapVirtualInstanceName, + String applicationInstanceName, + StopRequest body, + Context context) { + return this + .beginStopInstanceAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body, context) + .getSyncPoller(); + } + + /** + * Stops the SAP Application Server Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @param body SAP Application server instance stop request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopInstanceAsync( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, StopRequest body) { + return beginStopInstanceAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stops the SAP Application Server Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopInstanceAsync( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + final StopRequest body = null; + return beginStopInstanceAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stops the SAP Application Server Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @param body SAP Application server instance stop request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopInstanceAsync( + String resourceGroupName, + String sapVirtualInstanceName, + String applicationInstanceName, + StopRequest body, + Context context) { + return beginStopInstanceAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stops the SAP Application Server Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusResultInner stopInstance( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + final StopRequest body = null; + return stopInstanceAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body).block(); + } + + /** + * Stops the SAP Application Server Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @param body SAP Application server instance stop request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusResultInner stopInstance( + String resourceGroupName, + String sapVirtualInstanceName, + String applicationInstanceName, + StopRequest body, + Context context) { + return stopInstanceAsync(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of SAP Application Server Instance resources along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of SAP Application Server Instance resources along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapApplicationServerInstancesImpl.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapApplicationServerInstancesImpl.java new file mode 100644 index 0000000000000..2c0318a9d5a41 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapApplicationServerInstancesImpl.java @@ -0,0 +1,279 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.SapApplicationServerInstancesClient; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapApplicationServerInstanceInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.OperationStatusResult; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapApplicationServerInstance; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapApplicationServerInstances; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StartRequest; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StopRequest; + +public final class SapApplicationServerInstancesImpl implements SapApplicationServerInstances { + private static final ClientLogger LOGGER = new ClientLogger(SapApplicationServerInstancesImpl.class); + + private final SapApplicationServerInstancesClient innerClient; + + private final com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager + serviceManager; + + public SapApplicationServerInstancesImpl( + SapApplicationServerInstancesClient innerClient, + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SapApplicationServerInstanceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SapApplicationServerInstance get( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + SapApplicationServerInstanceInner inner = + this.serviceClient().get(resourceGroupName, sapVirtualInstanceName, applicationInstanceName); + if (inner != null) { + return new SapApplicationServerInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + this.serviceClient().delete(resourceGroupName, sapVirtualInstanceName, applicationInstanceName); + } + + public void delete( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, Context context) { + this.serviceClient().delete(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, context); + } + + public PagedIterable list(String resourceGroupName, String sapVirtualInstanceName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, sapVirtualInstanceName); + return Utils.mapPage(inner, inner1 -> new SapApplicationServerInstanceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String sapVirtualInstanceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, sapVirtualInstanceName, context); + return Utils.mapPage(inner, inner1 -> new SapApplicationServerInstanceImpl(inner1, this.manager())); + } + + public OperationStatusResult startInstance( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + OperationStatusResultInner inner = + this.serviceClient().startInstance(resourceGroupName, sapVirtualInstanceName, applicationInstanceName); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatusResult startInstance( + String resourceGroupName, + String sapVirtualInstanceName, + String applicationInstanceName, + StartRequest body, + Context context) { + OperationStatusResultInner inner = + this + .serviceClient() + .startInstance(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body, context); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatusResult stopInstance( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName) { + OperationStatusResultInner inner = + this.serviceClient().stopInstance(resourceGroupName, sapVirtualInstanceName, applicationInstanceName); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatusResult stopInstance( + String resourceGroupName, + String sapVirtualInstanceName, + String applicationInstanceName, + StopRequest body, + Context context) { + OperationStatusResultInner inner = + this + .serviceClient() + .stopInstance(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body, context); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public SapApplicationServerInstance getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sapVirtualInstanceName = Utils.getValueFromIdByName(id, "sapVirtualInstances"); + if (sapVirtualInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'sapVirtualInstances'.", id))); + } + String applicationInstanceName = Utils.getValueFromIdByName(id, "applicationInstances"); + if (applicationInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'applicationInstances'.", + id))); + } + return this + .getWithResponse(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sapVirtualInstanceName = Utils.getValueFromIdByName(id, "sapVirtualInstances"); + if (sapVirtualInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'sapVirtualInstances'.", id))); + } + String applicationInstanceName = Utils.getValueFromIdByName(id, "applicationInstances"); + if (applicationInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'applicationInstances'.", + id))); + } + return this.getWithResponse(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sapVirtualInstanceName = Utils.getValueFromIdByName(id, "sapVirtualInstances"); + if (sapVirtualInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'sapVirtualInstances'.", id))); + } + String applicationInstanceName = Utils.getValueFromIdByName(id, "applicationInstances"); + if (applicationInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'applicationInstances'.", + id))); + } + this.delete(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sapVirtualInstanceName = Utils.getValueFromIdByName(id, "sapVirtualInstances"); + if (sapVirtualInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'sapVirtualInstances'.", id))); + } + String applicationInstanceName = Utils.getValueFromIdByName(id, "applicationInstances"); + if (applicationInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'applicationInstances'.", + id))); + } + this.delete(resourceGroupName, sapVirtualInstanceName, applicationInstanceName, context); + } + + private SapApplicationServerInstancesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager() { + return this.serviceManager; + } + + public SapApplicationServerInstanceImpl define(String name) { + return new SapApplicationServerInstanceImpl(name, this.manager()); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapAvailabilityZoneDetailsResultImpl.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapAvailabilityZoneDetailsResultImpl.java new file mode 100644 index 0000000000000..08ae0ed5117a8 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapAvailabilityZoneDetailsResultImpl.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.implementation; + +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapAvailabilityZoneDetailsResultInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapAvailabilityZoneDetailsResult; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapAvailabilityZonePair; +import java.util.Collections; +import java.util.List; + +public final class SapAvailabilityZoneDetailsResultImpl implements SapAvailabilityZoneDetailsResult { + private SapAvailabilityZoneDetailsResultInner innerObject; + + private final com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager + serviceManager; + + SapAvailabilityZoneDetailsResultImpl( + SapAvailabilityZoneDetailsResultInner innerObject, + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List availabilityZonePairs() { + List inner = this.innerModel().availabilityZonePairs(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SapAvailabilityZoneDetailsResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapCentralInstancesClientImpl.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapCentralInstancesClientImpl.java new file mode 100644 index 0000000000000..0cc0f923dec89 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapCentralInstancesClientImpl.java @@ -0,0 +1,2274 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.SapCentralInstancesClient; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapCentralServerInstanceInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapCentralInstanceList; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StartRequest; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StopRequest; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.UpdateSapCentralInstanceRequest; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SapCentralInstancesClient. */ +public final class SapCentralInstancesClientImpl implements SapCentralInstancesClient { + /** The proxy service used to perform REST calls. */ + private final SapCentralInstancesService service; + + /** The service client containing this operation class. */ + private final WorkloadsClientImpl client; + + /** + * Initializes an instance of SapCentralInstancesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SapCentralInstancesClientImpl(WorkloadsClientImpl client) { + this.service = + RestProxy.create(SapCentralInstancesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for WorkloadsClientSapCentralInstances to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "WorkloadsClientSapCe") + public interface SapCentralInstancesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, + @PathParam("centralInstanceName") String centralInstanceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, + @PathParam("centralInstanceName") String centralInstanceName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SapCentralServerInstanceInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, + @PathParam("centralInstanceName") String centralInstanceName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") UpdateSapCentralInstanceRequest body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, + @PathParam("centralInstanceName") String centralInstanceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName}/start") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> startInstance( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, + @PathParam("centralInstanceName") String centralInstanceName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") StartRequest body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName}/stop") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> stopInstance( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, + @PathParam("centralInstanceName") String centralInstanceName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") StopRequest body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the SAP Central Services Instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAP Central Services Instance resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + if (centralInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter centralInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + centralInstanceName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the SAP Central Services Instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAP Central Services Instance resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + if (centralInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter centralInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + centralInstanceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the SAP Central Services Instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAP Central Services Instance resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + return getWithResponseAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the SAP Central Services Instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAP Central Services Instance resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, Context context) { + return getWithResponseAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, context).block(); + } + + /** + * Gets the SAP Central Services Instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAP Central Services Instance resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapCentralServerInstanceInner get( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + return getWithResponse(resourceGroupName, sapVirtualInstanceName, centralInstanceName, Context.NONE).getValue(); + } + + /** + * Creates the SAP Central Services Instance resource. <br><br>This will be used by service only. PUT + * operation on this resource by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @param body The SAP Central Services Instance request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the SAP Central Services Instance resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String sapVirtualInstanceName, + String centralInstanceName, + SapCentralServerInstanceInner body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + if (centralInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter centralInstanceName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + centralInstanceName, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates the SAP Central Services Instance resource. <br><br>This will be used by service only. PUT + * operation on this resource by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @param body The SAP Central Services Instance request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the SAP Central Services Instance resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String sapVirtualInstanceName, + String centralInstanceName, + SapCentralServerInstanceInner body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + if (centralInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter centralInstanceName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + centralInstanceName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Creates the SAP Central Services Instance resource. <br><br>This will be used by service only. PUT + * operation on this resource by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @param body The SAP Central Services Instance request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of define the SAP Central Services Instance resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SapCentralServerInstanceInner> beginCreateAsync( + String resourceGroupName, + String sapVirtualInstanceName, + String centralInstanceName, + SapCentralServerInstanceInner body) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SapCentralServerInstanceInner.class, + SapCentralServerInstanceInner.class, + this.client.getContext()); + } + + /** + * Creates the SAP Central Services Instance resource. <br><br>This will be used by service only. PUT + * operation on this resource by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of define the SAP Central Services Instance resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SapCentralServerInstanceInner> beginCreateAsync( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + final SapCentralServerInstanceInner body = null; + Mono>> mono = + createWithResponseAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SapCentralServerInstanceInner.class, + SapCentralServerInstanceInner.class, + this.client.getContext()); + } + + /** + * Creates the SAP Central Services Instance resource. <br><br>This will be used by service only. PUT + * operation on this resource by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @param body The SAP Central Services Instance request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of define the SAP Central Services Instance resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SapCentralServerInstanceInner> beginCreateAsync( + String resourceGroupName, + String sapVirtualInstanceName, + String centralInstanceName, + SapCentralServerInstanceInner body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SapCentralServerInstanceInner.class, + SapCentralServerInstanceInner.class, + context); + } + + /** + * Creates the SAP Central Services Instance resource. <br><br>This will be used by service only. PUT + * operation on this resource by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of define the SAP Central Services Instance resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SapCentralServerInstanceInner> beginCreate( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + final SapCentralServerInstanceInner body = null; + return this + .beginCreateAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body) + .getSyncPoller(); + } + + /** + * Creates the SAP Central Services Instance resource. <br><br>This will be used by service only. PUT + * operation on this resource by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @param body The SAP Central Services Instance request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of define the SAP Central Services Instance resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SapCentralServerInstanceInner> beginCreate( + String resourceGroupName, + String sapVirtualInstanceName, + String centralInstanceName, + SapCentralServerInstanceInner body, + Context context) { + return this + .beginCreateAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, context) + .getSyncPoller(); + } + + /** + * Creates the SAP Central Services Instance resource. <br><br>This will be used by service only. PUT + * operation on this resource by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @param body The SAP Central Services Instance request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the SAP Central Services Instance resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String sapVirtualInstanceName, + String centralInstanceName, + SapCentralServerInstanceInner body) { + return beginCreateAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates the SAP Central Services Instance resource. <br><br>This will be used by service only. PUT + * operation on this resource by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the SAP Central Services Instance resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + final SapCentralServerInstanceInner body = null; + return beginCreateAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates the SAP Central Services Instance resource. <br><br>This will be used by service only. PUT + * operation on this resource by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @param body The SAP Central Services Instance request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the SAP Central Services Instance resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String sapVirtualInstanceName, + String centralInstanceName, + SapCentralServerInstanceInner body, + Context context) { + return beginCreateAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates the SAP Central Services Instance resource. <br><br>This will be used by service only. PUT + * operation on this resource by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the SAP Central Services Instance resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapCentralServerInstanceInner create( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + final SapCentralServerInstanceInner body = null; + return createAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body).block(); + } + + /** + * Creates the SAP Central Services Instance resource. <br><br>This will be used by service only. PUT + * operation on this resource by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @param body The SAP Central Services Instance request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the SAP Central Services Instance resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapCentralServerInstanceInner create( + String resourceGroupName, + String sapVirtualInstanceName, + String centralInstanceName, + SapCentralServerInstanceInner body, + Context context) { + return createAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, context).block(); + } + + /** + * Updates the SAP Central Services Instance resource. <br><br>This can be used to update tags on the + * resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @param body The SAP Central Services Instance resource request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the SAP Central Services Instance resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String sapVirtualInstanceName, + String centralInstanceName, + UpdateSapCentralInstanceRequest body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + if (centralInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter centralInstanceName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + centralInstanceName, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates the SAP Central Services Instance resource. <br><br>This can be used to update tags on the + * resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @param body The SAP Central Services Instance resource request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the SAP Central Services Instance resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String sapVirtualInstanceName, + String centralInstanceName, + UpdateSapCentralInstanceRequest body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + if (centralInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter centralInstanceName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + centralInstanceName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Updates the SAP Central Services Instance resource. <br><br>This can be used to update tags on the + * resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the SAP Central Services Instance resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + final UpdateSapCentralInstanceRequest body = null; + return updateWithResponseAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Updates the SAP Central Services Instance resource. <br><br>This can be used to update tags on the + * resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @param body The SAP Central Services Instance resource request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the SAP Central Services Instance resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String sapVirtualInstanceName, + String centralInstanceName, + UpdateSapCentralInstanceRequest body, + Context context) { + return updateWithResponseAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, context) + .block(); + } + + /** + * Updates the SAP Central Services Instance resource. <br><br>This can be used to update tags on the + * resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the SAP Central Services Instance resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapCentralServerInstanceInner update( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + final UpdateSapCentralInstanceRequest body = null; + return updateWithResponse(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, Context.NONE) + .getValue(); + } + + /** + * Deletes the SAP Central Services Instance resource. <br><br>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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + if (centralInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter centralInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + centralInstanceName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the SAP Central Services Instance resource. <br><br>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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + if (centralInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter centralInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + centralInstanceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes the SAP Central Services Instance resource. <br><br>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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes the SAP Central Services Instance resource. <br><br>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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the SAP Central Services Instance resource. <br><br>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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + return this.beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName).getSyncPoller(); + } + + /** + * Deletes the SAP Central Services Instance resource. <br><br>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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, Context context) { + return this + .beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, context) + .getSyncPoller(); + } + + /** + * Deletes the SAP Central Services Instance resource. <br><br>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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + return beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the SAP Central Services Instance resource. <br><br>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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, Context context) { + return beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the SAP Central Services Instance resource. <br><br>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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + deleteAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName).block(); + } + + /** + * Deletes the SAP Central Services Instance resource. <br><br>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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, Context context) { + deleteAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, context).block(); + } + + /** + * Lists the SAP Central Services Instance resource for the given Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of SAP Central Services Instance resources along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String sapVirtualInstanceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the SAP Central Services Instance resource for the given Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of SAP Central Services Instance resources along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String sapVirtualInstanceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the SAP Central Services Instance resource for the given Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of SAP Central Services Instance resources as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String sapVirtualInstanceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, sapVirtualInstanceName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the SAP Central Services Instance resource for the given Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of SAP Central Services Instance resources as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String sapVirtualInstanceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, sapVirtualInstanceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the SAP Central Services Instance resource for the given Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of SAP Central Services Instance resources as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String sapVirtualInstanceName) { + return new PagedIterable<>(listAsync(resourceGroupName, sapVirtualInstanceName)); + } + + /** + * Lists the SAP Central Services Instance resource for the given Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of SAP Central Services Instance resources as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String sapVirtualInstanceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, sapVirtualInstanceName, context)); + } + + /** + * Starts the SAP Central Services Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @param body SAP Central Services instance start request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startInstanceWithResponseAsync( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, StartRequest body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + if (centralInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter centralInstanceName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .startInstance( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + centralInstanceName, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Starts the SAP Central Services Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @param body SAP Central Services instance start request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startInstanceWithResponseAsync( + String resourceGroupName, + String sapVirtualInstanceName, + String centralInstanceName, + StartRequest body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + if (centralInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter centralInstanceName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .startInstance( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + centralInstanceName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Starts the SAP Central Services Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @param body SAP Central Services instance start request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusResultInner> beginStartInstanceAsync( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, StartRequest body) { + Mono>> mono = + startInstanceWithResponseAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationStatusResultInner.class, + OperationStatusResultInner.class, + this.client.getContext()); + } + + /** + * Starts the SAP Central Services Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusResultInner> beginStartInstanceAsync( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + final StartRequest body = null; + Mono>> mono = + startInstanceWithResponseAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationStatusResultInner.class, + OperationStatusResultInner.class, + this.client.getContext()); + } + + /** + * Starts the SAP Central Services Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @param body SAP Central Services instance start request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusResultInner> beginStartInstanceAsync( + String resourceGroupName, + String sapVirtualInstanceName, + String centralInstanceName, + StartRequest body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + startInstanceWithResponseAsync( + resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationStatusResultInner.class, + OperationStatusResultInner.class, + context); + } + + /** + * Starts the SAP Central Services Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationStatusResultInner> beginStartInstance( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + final StartRequest body = null; + return this + .beginStartInstanceAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body) + .getSyncPoller(); + } + + /** + * Starts the SAP Central Services Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @param body SAP Central Services instance start request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationStatusResultInner> beginStartInstance( + String resourceGroupName, + String sapVirtualInstanceName, + String centralInstanceName, + StartRequest body, + Context context) { + return this + .beginStartInstanceAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, context) + .getSyncPoller(); + } + + /** + * Starts the SAP Central Services Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @param body SAP Central Services instance start request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startInstanceAsync( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, StartRequest body) { + return beginStartInstanceAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts the SAP Central Services Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startInstanceAsync( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + final StartRequest body = null; + return beginStartInstanceAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts the SAP Central Services Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @param body SAP Central Services instance start request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startInstanceAsync( + String resourceGroupName, + String sapVirtualInstanceName, + String centralInstanceName, + StartRequest body, + Context context) { + return beginStartInstanceAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts the SAP Central Services Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusResultInner startInstance( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + final StartRequest body = null; + return startInstanceAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body).block(); + } + + /** + * Starts the SAP Central Services Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @param body SAP Central Services instance start request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusResultInner startInstance( + String resourceGroupName, + String sapVirtualInstanceName, + String centralInstanceName, + StartRequest body, + Context context) { + return startInstanceAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, context) + .block(); + } + + /** + * Stops the SAP Central Services Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @param body SAP Central Services instance stop request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> stopInstanceWithResponseAsync( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, StopRequest body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + if (centralInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter centralInstanceName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .stopInstance( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + centralInstanceName, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Stops the SAP Central Services Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @param body SAP Central Services instance stop request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> stopInstanceWithResponseAsync( + String resourceGroupName, + String sapVirtualInstanceName, + String centralInstanceName, + StopRequest body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + if (centralInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter centralInstanceName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .stopInstance( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + centralInstanceName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Stops the SAP Central Services Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @param body SAP Central Services instance stop request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusResultInner> beginStopInstanceAsync( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, StopRequest body) { + Mono>> mono = + stopInstanceWithResponseAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationStatusResultInner.class, + OperationStatusResultInner.class, + this.client.getContext()); + } + + /** + * Stops the SAP Central Services Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusResultInner> beginStopInstanceAsync( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + final StopRequest body = null; + Mono>> mono = + stopInstanceWithResponseAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationStatusResultInner.class, + OperationStatusResultInner.class, + this.client.getContext()); + } + + /** + * Stops the SAP Central Services Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @param body SAP Central Services instance stop request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusResultInner> beginStopInstanceAsync( + String resourceGroupName, + String sapVirtualInstanceName, + String centralInstanceName, + StopRequest body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + stopInstanceWithResponseAsync( + resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationStatusResultInner.class, + OperationStatusResultInner.class, + context); + } + + /** + * Stops the SAP Central Services Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationStatusResultInner> beginStopInstance( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + final StopRequest body = null; + return this + .beginStopInstanceAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body) + .getSyncPoller(); + } + + /** + * Stops the SAP Central Services Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @param body SAP Central Services instance stop request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationStatusResultInner> beginStopInstance( + String resourceGroupName, + String sapVirtualInstanceName, + String centralInstanceName, + StopRequest body, + Context context) { + return this + .beginStopInstanceAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, context) + .getSyncPoller(); + } + + /** + * Stops the SAP Central Services Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @param body SAP Central Services instance stop request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopInstanceAsync( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, StopRequest body) { + return beginStopInstanceAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stops the SAP Central Services Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopInstanceAsync( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + final StopRequest body = null; + return beginStopInstanceAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stops the SAP Central Services Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @param body SAP Central Services instance stop request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopInstanceAsync( + String resourceGroupName, + String sapVirtualInstanceName, + String centralInstanceName, + StopRequest body, + Context context) { + return beginStopInstanceAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stops the SAP Central Services Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusResultInner stopInstance( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + final StopRequest body = null; + return stopInstanceAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body).block(); + } + + /** + * Stops the SAP Central Services Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @param body SAP Central Services instance stop request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusResultInner stopInstance( + String resourceGroupName, + String sapVirtualInstanceName, + String centralInstanceName, + StopRequest body, + Context context) { + return stopInstanceAsync(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of SAP Central Services Instance resources along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of SAP Central Services Instance resources along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapCentralInstancesImpl.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapCentralInstancesImpl.java new file mode 100644 index 0000000000000..d5374162aed51 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapCentralInstancesImpl.java @@ -0,0 +1,275 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.SapCentralInstancesClient; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapCentralServerInstanceInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.OperationStatusResult; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapCentralInstances; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapCentralServerInstance; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StartRequest; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StopRequest; + +public final class SapCentralInstancesImpl implements SapCentralInstances { + private static final ClientLogger LOGGER = new ClientLogger(SapCentralInstancesImpl.class); + + private final SapCentralInstancesClient innerClient; + + private final com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager + serviceManager; + + public SapCentralInstancesImpl( + SapCentralInstancesClient innerClient, + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, sapVirtualInstanceName, centralInstanceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SapCentralServerInstanceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SapCentralServerInstance get( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + SapCentralServerInstanceInner inner = + this.serviceClient().get(resourceGroupName, sapVirtualInstanceName, centralInstanceName); + if (inner != null) { + return new SapCentralServerInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + this.serviceClient().delete(resourceGroupName, sapVirtualInstanceName, centralInstanceName); + } + + public void delete( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, Context context) { + this.serviceClient().delete(resourceGroupName, sapVirtualInstanceName, centralInstanceName, context); + } + + public PagedIterable list(String resourceGroupName, String sapVirtualInstanceName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, sapVirtualInstanceName); + return Utils.mapPage(inner, inner1 -> new SapCentralServerInstanceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String sapVirtualInstanceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, sapVirtualInstanceName, context); + return Utils.mapPage(inner, inner1 -> new SapCentralServerInstanceImpl(inner1, this.manager())); + } + + public OperationStatusResult startInstance( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + OperationStatusResultInner inner = + this.serviceClient().startInstance(resourceGroupName, sapVirtualInstanceName, centralInstanceName); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatusResult startInstance( + String resourceGroupName, + String sapVirtualInstanceName, + String centralInstanceName, + StartRequest body, + Context context) { + OperationStatusResultInner inner = + this + .serviceClient() + .startInstance(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, context); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatusResult stopInstance( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName) { + OperationStatusResultInner inner = + this.serviceClient().stopInstance(resourceGroupName, sapVirtualInstanceName, centralInstanceName); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatusResult stopInstance( + String resourceGroupName, + String sapVirtualInstanceName, + String centralInstanceName, + StopRequest body, + Context context) { + OperationStatusResultInner inner = + this + .serviceClient() + .stopInstance(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, context); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public SapCentralServerInstance getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sapVirtualInstanceName = Utils.getValueFromIdByName(id, "sapVirtualInstances"); + if (sapVirtualInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'sapVirtualInstances'.", id))); + } + String centralInstanceName = Utils.getValueFromIdByName(id, "centralInstances"); + if (centralInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'centralInstances'.", id))); + } + return this + .getWithResponse(resourceGroupName, sapVirtualInstanceName, centralInstanceName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sapVirtualInstanceName = Utils.getValueFromIdByName(id, "sapVirtualInstances"); + if (sapVirtualInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'sapVirtualInstances'.", id))); + } + String centralInstanceName = Utils.getValueFromIdByName(id, "centralInstances"); + if (centralInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'centralInstances'.", id))); + } + return this.getWithResponse(resourceGroupName, sapVirtualInstanceName, centralInstanceName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sapVirtualInstanceName = Utils.getValueFromIdByName(id, "sapVirtualInstances"); + if (sapVirtualInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'sapVirtualInstances'.", id))); + } + String centralInstanceName = Utils.getValueFromIdByName(id, "centralInstances"); + if (centralInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'centralInstances'.", id))); + } + this.delete(resourceGroupName, sapVirtualInstanceName, centralInstanceName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sapVirtualInstanceName = Utils.getValueFromIdByName(id, "sapVirtualInstances"); + if (sapVirtualInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'sapVirtualInstances'.", id))); + } + String centralInstanceName = Utils.getValueFromIdByName(id, "centralInstances"); + if (centralInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'centralInstances'.", id))); + } + this.delete(resourceGroupName, sapVirtualInstanceName, centralInstanceName, context); + } + + private SapCentralInstancesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager() { + return this.serviceManager; + } + + public SapCentralServerInstanceImpl define(String name) { + return new SapCentralServerInstanceImpl(name, this.manager()); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapCentralServerInstanceImpl.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapCentralServerInstanceImpl.java new file mode 100644 index 0000000000000..b5552ab3e303f --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapCentralServerInstanceImpl.java @@ -0,0 +1,313 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapCentralServerInstanceInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.CentralServerVmDetails; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.EnqueueReplicationServerProperties; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.EnqueueServerProperties; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.GatewayServerProperties; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.LoadBalancerDetails; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.MessageServerProperties; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.OperationStatusResult; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapCentralServerInstance; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapHealthState; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapVirtualInstanceError; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapVirtualInstanceProvisioningState; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapVirtualInstanceStatus; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StartRequest; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StopRequest; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.UpdateSapCentralInstanceRequest; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class SapCentralServerInstanceImpl + implements SapCentralServerInstance, SapCentralServerInstance.Definition, SapCentralServerInstance.Update { + private SapCentralServerInstanceInner innerObject; + + private final com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager + serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String instanceNo() { + return this.innerModel().instanceNo(); + } + + public String subnet() { + return this.innerModel().subnet(); + } + + public MessageServerProperties messageServerProperties() { + return this.innerModel().messageServerProperties(); + } + + public EnqueueServerProperties enqueueServerProperties() { + return this.innerModel().enqueueServerProperties(); + } + + public GatewayServerProperties gatewayServerProperties() { + return this.innerModel().gatewayServerProperties(); + } + + public EnqueueReplicationServerProperties enqueueReplicationServerProperties() { + return this.innerModel().enqueueReplicationServerProperties(); + } + + public String kernelVersion() { + return this.innerModel().kernelVersion(); + } + + public String kernelPatch() { + return this.innerModel().kernelPatch(); + } + + public LoadBalancerDetails loadBalancerDetails() { + return this.innerModel().loadBalancerDetails(); + } + + public List vmDetails() { + List inner = this.innerModel().vmDetails(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SapVirtualInstanceStatus status() { + return this.innerModel().status(); + } + + public SapHealthState health() { + return this.innerModel().health(); + } + + public SapVirtualInstanceProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public SapVirtualInstanceError errors() { + return this.innerModel().errors(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public SapCentralServerInstanceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String sapVirtualInstanceName; + + private String centralInstanceName; + + private UpdateSapCentralInstanceRequest updateBody; + + public SapCentralServerInstanceImpl withExistingSapVirtualInstance( + String resourceGroupName, String sapVirtualInstanceName) { + this.resourceGroupName = resourceGroupName; + this.sapVirtualInstanceName = sapVirtualInstanceName; + return this; + } + + public SapCentralServerInstance create() { + this.innerObject = + serviceManager + .serviceClient() + .getSapCentralInstances() + .create( + resourceGroupName, sapVirtualInstanceName, centralInstanceName, this.innerModel(), Context.NONE); + return this; + } + + public SapCentralServerInstance create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSapCentralInstances() + .create(resourceGroupName, sapVirtualInstanceName, centralInstanceName, this.innerModel(), context); + return this; + } + + SapCentralServerInstanceImpl( + String name, + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager serviceManager) { + this.innerObject = new SapCentralServerInstanceInner(); + this.serviceManager = serviceManager; + this.centralInstanceName = name; + } + + public SapCentralServerInstanceImpl update() { + this.updateBody = new UpdateSapCentralInstanceRequest(); + return this; + } + + public SapCentralServerInstance apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSapCentralInstances() + .updateWithResponse( + resourceGroupName, sapVirtualInstanceName, centralInstanceName, updateBody, Context.NONE) + .getValue(); + return this; + } + + public SapCentralServerInstance apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSapCentralInstances() + .updateWithResponse(resourceGroupName, sapVirtualInstanceName, centralInstanceName, updateBody, context) + .getValue(); + return this; + } + + SapCentralServerInstanceImpl( + SapCentralServerInstanceInner innerObject, + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.sapVirtualInstanceName = Utils.getValueFromIdByName(innerObject.id(), "sapVirtualInstances"); + this.centralInstanceName = Utils.getValueFromIdByName(innerObject.id(), "centralInstances"); + } + + public SapCentralServerInstance refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSapCentralInstances() + .getWithResponse(resourceGroupName, sapVirtualInstanceName, centralInstanceName, Context.NONE) + .getValue(); + return this; + } + + public SapCentralServerInstance refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSapCentralInstances() + .getWithResponse(resourceGroupName, sapVirtualInstanceName, centralInstanceName, context) + .getValue(); + return this; + } + + public OperationStatusResult startInstance() { + return serviceManager + .sapCentralInstances() + .startInstance(resourceGroupName, sapVirtualInstanceName, centralInstanceName); + } + + public OperationStatusResult startInstance(StartRequest body, Context context) { + return serviceManager + .sapCentralInstances() + .startInstance(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, context); + } + + public OperationStatusResult stopInstance() { + return serviceManager + .sapCentralInstances() + .stopInstance(resourceGroupName, sapVirtualInstanceName, centralInstanceName); + } + + public OperationStatusResult stopInstance(StopRequest body, Context context) { + return serviceManager + .sapCentralInstances() + .stopInstance(resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, context); + } + + public SapCentralServerInstanceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SapCentralServerInstanceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SapCentralServerInstanceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateBody.withTags(tags); + return this; + } + } + + public SapCentralServerInstanceImpl withMessageServerProperties(MessageServerProperties messageServerProperties) { + this.innerModel().withMessageServerProperties(messageServerProperties); + return this; + } + + public SapCentralServerInstanceImpl withEnqueueServerProperties(EnqueueServerProperties enqueueServerProperties) { + this.innerModel().withEnqueueServerProperties(enqueueServerProperties); + return this; + } + + public SapCentralServerInstanceImpl withGatewayServerProperties(GatewayServerProperties gatewayServerProperties) { + this.innerModel().withGatewayServerProperties(gatewayServerProperties); + return this; + } + + public SapCentralServerInstanceImpl withEnqueueReplicationServerProperties( + EnqueueReplicationServerProperties enqueueReplicationServerProperties) { + this.innerModel().withEnqueueReplicationServerProperties(enqueueReplicationServerProperties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapDatabaseInstanceImpl.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapDatabaseInstanceImpl.java new file mode 100644 index 0000000000000..c92a7209b869e --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapDatabaseInstanceImpl.java @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapDatabaseInstanceInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.DatabaseVmDetails; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.LoadBalancerDetails; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.OperationStatusResult; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapDatabaseInstance; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapVirtualInstanceError; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapVirtualInstanceProvisioningState; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapVirtualInstanceStatus; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StartRequest; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StopRequest; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.UpdateSapDatabaseInstanceRequest; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class SapDatabaseInstanceImpl + implements SapDatabaseInstance, SapDatabaseInstance.Definition, SapDatabaseInstance.Update { + private SapDatabaseInstanceInner innerObject; + + private final com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager + serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String subnet() { + return this.innerModel().subnet(); + } + + public String databaseSid() { + return this.innerModel().databaseSid(); + } + + public String databaseType() { + return this.innerModel().databaseType(); + } + + public String ipAddress() { + return this.innerModel().ipAddress(); + } + + public LoadBalancerDetails loadBalancerDetails() { + return this.innerModel().loadBalancerDetails(); + } + + public List vmDetails() { + List inner = this.innerModel().vmDetails(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SapVirtualInstanceStatus status() { + return this.innerModel().status(); + } + + public SapVirtualInstanceProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public SapVirtualInstanceError errors() { + return this.innerModel().errors(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public SapDatabaseInstanceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String sapVirtualInstanceName; + + private String databaseInstanceName; + + private UpdateSapDatabaseInstanceRequest updateBody; + + public SapDatabaseInstanceImpl withExistingSapVirtualInstance( + String resourceGroupName, String sapVirtualInstanceName) { + this.resourceGroupName = resourceGroupName; + this.sapVirtualInstanceName = sapVirtualInstanceName; + return this; + } + + public SapDatabaseInstance create() { + this.innerObject = + serviceManager + .serviceClient() + .getSapDatabaseInstances() + .create( + resourceGroupName, sapVirtualInstanceName, databaseInstanceName, this.innerModel(), Context.NONE); + return this; + } + + public SapDatabaseInstance create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSapDatabaseInstances() + .create(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, this.innerModel(), context); + return this; + } + + SapDatabaseInstanceImpl( + String name, + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager serviceManager) { + this.innerObject = new SapDatabaseInstanceInner(); + this.serviceManager = serviceManager; + this.databaseInstanceName = name; + } + + public SapDatabaseInstanceImpl update() { + this.updateBody = new UpdateSapDatabaseInstanceRequest(); + return this; + } + + public SapDatabaseInstance apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSapDatabaseInstances() + .updateWithResponse( + resourceGroupName, sapVirtualInstanceName, databaseInstanceName, updateBody, Context.NONE) + .getValue(); + return this; + } + + public SapDatabaseInstance apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSapDatabaseInstances() + .updateWithResponse( + resourceGroupName, sapVirtualInstanceName, databaseInstanceName, updateBody, context) + .getValue(); + return this; + } + + SapDatabaseInstanceImpl( + SapDatabaseInstanceInner innerObject, + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.sapVirtualInstanceName = Utils.getValueFromIdByName(innerObject.id(), "sapVirtualInstances"); + this.databaseInstanceName = Utils.getValueFromIdByName(innerObject.id(), "databaseInstances"); + } + + public SapDatabaseInstance refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSapDatabaseInstances() + .getWithResponse(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, Context.NONE) + .getValue(); + return this; + } + + public SapDatabaseInstance refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSapDatabaseInstances() + .getWithResponse(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, context) + .getValue(); + return this; + } + + public OperationStatusResult startInstance() { + return serviceManager + .sapDatabaseInstances() + .startInstance(resourceGroupName, sapVirtualInstanceName, databaseInstanceName); + } + + public OperationStatusResult startInstance(StartRequest body, Context context) { + return serviceManager + .sapDatabaseInstances() + .startInstance(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, context); + } + + public OperationStatusResult stopInstance() { + return serviceManager + .sapDatabaseInstances() + .stopInstance(resourceGroupName, sapVirtualInstanceName, databaseInstanceName); + } + + public OperationStatusResult stopInstance(StopRequest body, Context context) { + return serviceManager + .sapDatabaseInstances() + .stopInstance(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, context); + } + + public SapDatabaseInstanceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SapDatabaseInstanceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SapDatabaseInstanceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateBody.withTags(tags); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapDatabaseInstancesClientImpl.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapDatabaseInstancesClientImpl.java new file mode 100644 index 0000000000000..61f19fb7880f7 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapDatabaseInstancesClientImpl.java @@ -0,0 +1,2250 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.SapDatabaseInstancesClient; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapDatabaseInstanceInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapDatabaseInstanceList; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StartRequest; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StopRequest; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.UpdateSapDatabaseInstanceRequest; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SapDatabaseInstancesClient. */ +public final class SapDatabaseInstancesClientImpl implements SapDatabaseInstancesClient { + /** The proxy service used to perform REST calls. */ + private final SapDatabaseInstancesService service; + + /** The service client containing this operation class. */ + private final WorkloadsClientImpl client; + + /** + * Initializes an instance of SapDatabaseInstancesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SapDatabaseInstancesClientImpl(WorkloadsClientImpl client) { + this.service = + RestProxy + .create(SapDatabaseInstancesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for WorkloadsClientSapDatabaseInstances to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "WorkloadsClientSapDa") + public interface SapDatabaseInstancesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, + @PathParam("databaseInstanceName") String databaseInstanceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, + @PathParam("databaseInstanceName") String databaseInstanceName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SapDatabaseInstanceInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, + @PathParam("databaseInstanceName") String databaseInstanceName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") UpdateSapDatabaseInstanceRequest body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, + @PathParam("databaseInstanceName") String databaseInstanceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName}/start") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> startInstance( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, + @PathParam("databaseInstanceName") String databaseInstanceName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") StartRequest body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName}/stop") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> stopInstance( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, + @PathParam("databaseInstanceName") String databaseInstanceName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") StopRequest body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the SAP Database Instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAP Database Instance resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + if (databaseInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter databaseInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + databaseInstanceName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the SAP Database Instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAP Database Instance resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + if (databaseInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter databaseInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + databaseInstanceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the SAP Database Instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAP Database Instance resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + return getWithResponseAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the SAP Database Instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAP Database Instance resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, Context context) { + return getWithResponseAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, context).block(); + } + + /** + * Gets the SAP Database Instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAP Database Instance resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapDatabaseInstanceInner get( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + return getWithResponse(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, Context.NONE) + .getValue(); + } + + /** + * Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource. + * <br><br>This will be used by service only. PUT by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @param body Request body of Database resource of a SAP system. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the Database resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String sapVirtualInstanceName, + String databaseInstanceName, + SapDatabaseInstanceInner body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + if (databaseInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter databaseInstanceName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + databaseInstanceName, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource. + * <br><br>This will be used by service only. PUT by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @param body Request body of Database resource of a SAP system. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the Database resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String sapVirtualInstanceName, + String databaseInstanceName, + SapDatabaseInstanceInner body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + if (databaseInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter databaseInstanceName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + databaseInstanceName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource. + * <br><br>This will be used by service only. PUT by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @param body Request body of Database resource of a SAP system. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of define the Database resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SapDatabaseInstanceInner> beginCreateAsync( + String resourceGroupName, + String sapVirtualInstanceName, + String databaseInstanceName, + SapDatabaseInstanceInner body) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SapDatabaseInstanceInner.class, + SapDatabaseInstanceInner.class, + this.client.getContext()); + } + + /** + * Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource. + * <br><br>This will be used by service only. PUT by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of define the Database resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SapDatabaseInstanceInner> beginCreateAsync( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + final SapDatabaseInstanceInner body = null; + Mono>> mono = + createWithResponseAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SapDatabaseInstanceInner.class, + SapDatabaseInstanceInner.class, + this.client.getContext()); + } + + /** + * Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource. + * <br><br>This will be used by service only. PUT by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @param body Request body of Database resource of a SAP system. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of define the Database resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SapDatabaseInstanceInner> beginCreateAsync( + String resourceGroupName, + String sapVirtualInstanceName, + String databaseInstanceName, + SapDatabaseInstanceInner body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SapDatabaseInstanceInner.class, + SapDatabaseInstanceInner.class, + context); + } + + /** + * Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource. + * <br><br>This will be used by service only. PUT by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of define the Database resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SapDatabaseInstanceInner> beginCreate( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + final SapDatabaseInstanceInner body = null; + return this + .beginCreateAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body) + .getSyncPoller(); + } + + /** + * Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource. + * <br><br>This will be used by service only. PUT by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @param body Request body of Database resource of a SAP system. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of define the Database resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SapDatabaseInstanceInner> beginCreate( + String resourceGroupName, + String sapVirtualInstanceName, + String databaseInstanceName, + SapDatabaseInstanceInner body, + Context context) { + return this + .beginCreateAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, context) + .getSyncPoller(); + } + + /** + * Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource. + * <br><br>This will be used by service only. PUT by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @param body Request body of Database resource of a SAP system. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the Database resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String sapVirtualInstanceName, + String databaseInstanceName, + SapDatabaseInstanceInner body) { + return beginCreateAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource. + * <br><br>This will be used by service only. PUT by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the Database resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + final SapDatabaseInstanceInner body = null; + return beginCreateAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource. + * <br><br>This will be used by service only. PUT by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @param body Request body of Database resource of a SAP system. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the Database resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String sapVirtualInstanceName, + String databaseInstanceName, + SapDatabaseInstanceInner body, + Context context) { + return beginCreateAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource. + * <br><br>This will be used by service only. PUT by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the Database resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapDatabaseInstanceInner create( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + final SapDatabaseInstanceInner body = null; + return createAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body).block(); + } + + /** + * Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource. + * <br><br>This will be used by service only. PUT by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @param body Request body of Database resource of a SAP system. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the Database resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapDatabaseInstanceInner create( + String resourceGroupName, + String sapVirtualInstanceName, + String databaseInstanceName, + SapDatabaseInstanceInner body, + Context context) { + return createAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, context).block(); + } + + /** + * Updates the Database instance resource. This can be used to update tags on the resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @param body Database resource update request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the Database resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String sapVirtualInstanceName, + String databaseInstanceName, + UpdateSapDatabaseInstanceRequest body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + if (databaseInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter databaseInstanceName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + databaseInstanceName, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates the Database instance resource. This can be used to update tags on the resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @param body Database resource update request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the Database resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String sapVirtualInstanceName, + String databaseInstanceName, + UpdateSapDatabaseInstanceRequest body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + if (databaseInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter databaseInstanceName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + databaseInstanceName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Updates the Database instance resource. This can be used to update tags on the resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the Database resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + final UpdateSapDatabaseInstanceRequest body = null; + return updateWithResponseAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Updates the Database instance resource. This can be used to update tags on the resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @param body Database resource update request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the Database resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String sapVirtualInstanceName, + String databaseInstanceName, + UpdateSapDatabaseInstanceRequest body, + Context context) { + return updateWithResponseAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, context) + .block(); + } + + /** + * Updates the Database instance resource. This can be used to update tags on the resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the Database resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapDatabaseInstanceInner update( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + final UpdateSapDatabaseInstanceRequest body = null; + return updateWithResponse(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, Context.NONE) + .getValue(); + } + + /** + * Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource. + * <br><br>This will be used by service only. Delete by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + if (databaseInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter databaseInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + databaseInstanceName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource. + * <br><br>This will be used by service only. Delete by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + if (databaseInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter databaseInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + databaseInstanceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource. + * <br><br>This will be used by service only. Delete by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource. + * <br><br>This will be used by service only. Delete by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource. + * <br><br>This will be used by service only. Delete by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + return this.beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName).getSyncPoller(); + } + + /** + * Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource. + * <br><br>This will be used by service only. Delete by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, Context context) { + return this + .beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, context) + .getSyncPoller(); + } + + /** + * Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource. + * <br><br>This will be used by service only. Delete by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + return beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource. + * <br><br>This will be used by service only. Delete by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, Context context) { + return beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource. + * <br><br>This will be used by service only. Delete by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + deleteAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName).block(); + } + + /** + * Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource. + * <br><br>This will be used by service only. Delete by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, Context context) { + deleteAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, context).block(); + } + + /** + * Lists the Database resources associated with a Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of SAP Database Instances along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String sapVirtualInstanceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the Database resources associated with a Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of SAP Database Instances along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String sapVirtualInstanceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the Database resources associated with a Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of SAP Database Instances as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String sapVirtualInstanceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, sapVirtualInstanceName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the Database resources associated with a Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of SAP Database Instances as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String sapVirtualInstanceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, sapVirtualInstanceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the Database resources associated with a Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of SAP Database Instances as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String sapVirtualInstanceName) { + return new PagedIterable<>(listAsync(resourceGroupName, sapVirtualInstanceName)); + } + + /** + * Lists the Database resources associated with a Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of SAP Database Instances as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String sapVirtualInstanceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, sapVirtualInstanceName, context)); + } + + /** + * Starts the database instance of the SAP system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @param body SAP Database server instance start request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startInstanceWithResponseAsync( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, StartRequest body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + if (databaseInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter databaseInstanceName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .startInstance( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + databaseInstanceName, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Starts the database instance of the SAP system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @param body SAP Database server instance start request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startInstanceWithResponseAsync( + String resourceGroupName, + String sapVirtualInstanceName, + String databaseInstanceName, + StartRequest body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + if (databaseInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter databaseInstanceName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .startInstance( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + databaseInstanceName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Starts the database instance of the SAP system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @param body SAP Database server instance start request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusResultInner> beginStartInstanceAsync( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, StartRequest body) { + Mono>> mono = + startInstanceWithResponseAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationStatusResultInner.class, + OperationStatusResultInner.class, + this.client.getContext()); + } + + /** + * Starts the database instance of the SAP system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusResultInner> beginStartInstanceAsync( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + final StartRequest body = null; + Mono>> mono = + startInstanceWithResponseAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationStatusResultInner.class, + OperationStatusResultInner.class, + this.client.getContext()); + } + + /** + * Starts the database instance of the SAP system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @param body SAP Database server instance start request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusResultInner> beginStartInstanceAsync( + String resourceGroupName, + String sapVirtualInstanceName, + String databaseInstanceName, + StartRequest body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + startInstanceWithResponseAsync( + resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationStatusResultInner.class, + OperationStatusResultInner.class, + context); + } + + /** + * Starts the database instance of the SAP system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationStatusResultInner> beginStartInstance( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + final StartRequest body = null; + return this + .beginStartInstanceAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body) + .getSyncPoller(); + } + + /** + * Starts the database instance of the SAP system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @param body SAP Database server instance start request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationStatusResultInner> beginStartInstance( + String resourceGroupName, + String sapVirtualInstanceName, + String databaseInstanceName, + StartRequest body, + Context context) { + return this + .beginStartInstanceAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, context) + .getSyncPoller(); + } + + /** + * Starts the database instance of the SAP system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @param body SAP Database server instance start request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startInstanceAsync( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, StartRequest body) { + return beginStartInstanceAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts the database instance of the SAP system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startInstanceAsync( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + final StartRequest body = null; + return beginStartInstanceAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts the database instance of the SAP system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @param body SAP Database server instance start request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startInstanceAsync( + String resourceGroupName, + String sapVirtualInstanceName, + String databaseInstanceName, + StartRequest body, + Context context) { + return beginStartInstanceAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts the database instance of the SAP system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusResultInner startInstance( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + final StartRequest body = null; + return startInstanceAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body).block(); + } + + /** + * Starts the database instance of the SAP system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @param body SAP Database server instance start request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusResultInner startInstance( + String resourceGroupName, + String sapVirtualInstanceName, + String databaseInstanceName, + StartRequest body, + Context context) { + return startInstanceAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, context) + .block(); + } + + /** + * Stops the database instance of the SAP system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @param body Stop request for the database instance of the SAP system. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> stopInstanceWithResponseAsync( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, StopRequest body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + if (databaseInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter databaseInstanceName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .stopInstance( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + databaseInstanceName, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Stops the database instance of the SAP system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @param body Stop request for the database instance of the SAP system. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> stopInstanceWithResponseAsync( + String resourceGroupName, + String sapVirtualInstanceName, + String databaseInstanceName, + StopRequest body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + if (databaseInstanceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter databaseInstanceName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .stopInstance( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + databaseInstanceName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Stops the database instance of the SAP system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @param body Stop request for the database instance of the SAP system. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusResultInner> beginStopInstanceAsync( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, StopRequest body) { + Mono>> mono = + stopInstanceWithResponseAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationStatusResultInner.class, + OperationStatusResultInner.class, + this.client.getContext()); + } + + /** + * Stops the database instance of the SAP system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusResultInner> beginStopInstanceAsync( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + final StopRequest body = null; + Mono>> mono = + stopInstanceWithResponseAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationStatusResultInner.class, + OperationStatusResultInner.class, + this.client.getContext()); + } + + /** + * Stops the database instance of the SAP system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @param body Stop request for the database instance of the SAP system. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusResultInner> beginStopInstanceAsync( + String resourceGroupName, + String sapVirtualInstanceName, + String databaseInstanceName, + StopRequest body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + stopInstanceWithResponseAsync( + resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationStatusResultInner.class, + OperationStatusResultInner.class, + context); + } + + /** + * Stops the database instance of the SAP system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationStatusResultInner> beginStopInstance( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + final StopRequest body = null; + return this + .beginStopInstanceAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body) + .getSyncPoller(); + } + + /** + * Stops the database instance of the SAP system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @param body Stop request for the database instance of the SAP system. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationStatusResultInner> beginStopInstance( + String resourceGroupName, + String sapVirtualInstanceName, + String databaseInstanceName, + StopRequest body, + Context context) { + return this + .beginStopInstanceAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, context) + .getSyncPoller(); + } + + /** + * Stops the database instance of the SAP system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @param body Stop request for the database instance of the SAP system. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopInstanceAsync( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, StopRequest body) { + return beginStopInstanceAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stops the database instance of the SAP system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopInstanceAsync( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + final StopRequest body = null; + return beginStopInstanceAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stops the database instance of the SAP system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @param body Stop request for the database instance of the SAP system. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopInstanceAsync( + String resourceGroupName, + String sapVirtualInstanceName, + String databaseInstanceName, + StopRequest body, + Context context) { + return beginStopInstanceAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stops the database instance of the SAP system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusResultInner stopInstance( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + final StopRequest body = null; + return stopInstanceAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body).block(); + } + + /** + * Stops the database instance of the SAP system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @param body Stop request for the database instance of the SAP system. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusResultInner stopInstance( + String resourceGroupName, + String sapVirtualInstanceName, + String databaseInstanceName, + StopRequest body, + Context context) { + return stopInstanceAsync(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of SAP Database Instances along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of SAP Database Instances along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapDatabaseInstancesImpl.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapDatabaseInstancesImpl.java new file mode 100644 index 0000000000000..4f9759f4b0980 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapDatabaseInstancesImpl.java @@ -0,0 +1,275 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.SapDatabaseInstancesClient; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapDatabaseInstanceInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.OperationStatusResult; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapDatabaseInstance; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapDatabaseInstances; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StartRequest; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StopRequest; + +public final class SapDatabaseInstancesImpl implements SapDatabaseInstances { + private static final ClientLogger LOGGER = new ClientLogger(SapDatabaseInstancesImpl.class); + + private final SapDatabaseInstancesClient innerClient; + + private final com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager + serviceManager; + + public SapDatabaseInstancesImpl( + SapDatabaseInstancesClient innerClient, + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SapDatabaseInstanceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SapDatabaseInstance get( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + SapDatabaseInstanceInner inner = + this.serviceClient().get(resourceGroupName, sapVirtualInstanceName, databaseInstanceName); + if (inner != null) { + return new SapDatabaseInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + this.serviceClient().delete(resourceGroupName, sapVirtualInstanceName, databaseInstanceName); + } + + public void delete( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, Context context) { + this.serviceClient().delete(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, context); + } + + public PagedIterable list(String resourceGroupName, String sapVirtualInstanceName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, sapVirtualInstanceName); + return Utils.mapPage(inner, inner1 -> new SapDatabaseInstanceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String sapVirtualInstanceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, sapVirtualInstanceName, context); + return Utils.mapPage(inner, inner1 -> new SapDatabaseInstanceImpl(inner1, this.manager())); + } + + public OperationStatusResult startInstance( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + OperationStatusResultInner inner = + this.serviceClient().startInstance(resourceGroupName, sapVirtualInstanceName, databaseInstanceName); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatusResult startInstance( + String resourceGroupName, + String sapVirtualInstanceName, + String databaseInstanceName, + StartRequest body, + Context context) { + OperationStatusResultInner inner = + this + .serviceClient() + .startInstance(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, context); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatusResult stopInstance( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName) { + OperationStatusResultInner inner = + this.serviceClient().stopInstance(resourceGroupName, sapVirtualInstanceName, databaseInstanceName); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatusResult stopInstance( + String resourceGroupName, + String sapVirtualInstanceName, + String databaseInstanceName, + StopRequest body, + Context context) { + OperationStatusResultInner inner = + this + .serviceClient() + .stopInstance(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, context); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public SapDatabaseInstance getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sapVirtualInstanceName = Utils.getValueFromIdByName(id, "sapVirtualInstances"); + if (sapVirtualInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'sapVirtualInstances'.", id))); + } + String databaseInstanceName = Utils.getValueFromIdByName(id, "databaseInstances"); + if (databaseInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'databaseInstances'.", id))); + } + return this + .getWithResponse(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sapVirtualInstanceName = Utils.getValueFromIdByName(id, "sapVirtualInstances"); + if (sapVirtualInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'sapVirtualInstances'.", id))); + } + String databaseInstanceName = Utils.getValueFromIdByName(id, "databaseInstances"); + if (databaseInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'databaseInstances'.", id))); + } + return this.getWithResponse(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sapVirtualInstanceName = Utils.getValueFromIdByName(id, "sapVirtualInstances"); + if (sapVirtualInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'sapVirtualInstances'.", id))); + } + String databaseInstanceName = Utils.getValueFromIdByName(id, "databaseInstances"); + if (databaseInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'databaseInstances'.", id))); + } + this.delete(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sapVirtualInstanceName = Utils.getValueFromIdByName(id, "sapVirtualInstances"); + if (sapVirtualInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'sapVirtualInstances'.", id))); + } + String databaseInstanceName = Utils.getValueFromIdByName(id, "databaseInstances"); + if (databaseInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'databaseInstances'.", id))); + } + this.delete(resourceGroupName, sapVirtualInstanceName, databaseInstanceName, context); + } + + private SapDatabaseInstancesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager() { + return this.serviceManager; + } + + public SapDatabaseInstanceImpl define(String name) { + return new SapDatabaseInstanceImpl(name, this.manager()); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapDiskConfigurationsResultImpl.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapDiskConfigurationsResultImpl.java new file mode 100644 index 0000000000000..38fa50dad8c55 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapDiskConfigurationsResultImpl.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.implementation; + +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapDiskConfigurationsResultInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapDiskConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapDiskConfigurationsResult; +import java.util.Collections; +import java.util.Map; + +public final class SapDiskConfigurationsResultImpl implements SapDiskConfigurationsResult { + private SapDiskConfigurationsResultInner innerObject; + + private final com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager + serviceManager; + + SapDiskConfigurationsResultImpl( + SapDiskConfigurationsResultInner innerObject, + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Map volumeConfigurations() { + Map inner = this.innerModel().volumeConfigurations(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SapDiskConfigurationsResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapSizingRecommendationResultImpl.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapSizingRecommendationResultImpl.java new file mode 100644 index 0000000000000..8e6b875207f3d --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapSizingRecommendationResultImpl.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.implementation; + +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapSizingRecommendationResultInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapSizingRecommendationResult; + +public final class SapSizingRecommendationResultImpl implements SapSizingRecommendationResult { + private SapSizingRecommendationResultInner innerObject; + + private final com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager + serviceManager; + + SapSizingRecommendationResultImpl( + SapSizingRecommendationResultInner innerObject, + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public SapSizingRecommendationResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapSupportedResourceSkusResultImpl.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapSupportedResourceSkusResultImpl.java new file mode 100644 index 0000000000000..a4e834a5b481c --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapSupportedResourceSkusResultImpl.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.implementation; + +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapSupportedResourceSkusResultInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapSupportedResourceSkusResult; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapSupportedSku; +import java.util.Collections; +import java.util.List; + +public final class SapSupportedResourceSkusResultImpl implements SapSupportedResourceSkusResult { + private SapSupportedResourceSkusResultInner innerObject; + + private final com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager + serviceManager; + + SapSupportedResourceSkusResultImpl( + SapSupportedResourceSkusResultInner innerObject, + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List supportedSkus() { + List inner = this.innerModel().supportedSkus(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SapSupportedResourceSkusResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapVirtualInstanceImpl.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapVirtualInstanceImpl.java new file mode 100644 index 0000000000000..d6158ae09a53b --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapVirtualInstanceImpl.java @@ -0,0 +1,301 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapVirtualInstanceInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.ManagedRGConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.ManagedResourcesNetworkAccessType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.OperationStatusResult; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapEnvironmentType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapHealthState; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapProductType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapVirtualInstance; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapVirtualInstanceError; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapVirtualInstanceProvisioningState; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapVirtualInstanceState; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapVirtualInstanceStatus; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StartRequest; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StopRequest; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.UpdateSapVirtualInstanceProperties; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.UpdateSapVirtualInstanceRequest; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.UserAssignedServiceIdentity; +import java.util.Collections; +import java.util.Map; + +public final class SapVirtualInstanceImpl + implements SapVirtualInstance, SapVirtualInstance.Definition, SapVirtualInstance.Update { + private SapVirtualInstanceInner innerObject; + + private final com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager + serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public UserAssignedServiceIdentity identity() { + return this.innerModel().identity(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public SapEnvironmentType environment() { + return this.innerModel().environment(); + } + + public SapProductType sapProduct() { + return this.innerModel().sapProduct(); + } + + public ManagedResourcesNetworkAccessType managedResourcesNetworkAccessType() { + return this.innerModel().managedResourcesNetworkAccessType(); + } + + public SapConfiguration configuration() { + return this.innerModel().configuration(); + } + + public ManagedRGConfiguration managedResourceGroupConfiguration() { + return this.innerModel().managedResourceGroupConfiguration(); + } + + public SapVirtualInstanceStatus status() { + return this.innerModel().status(); + } + + public SapHealthState health() { + return this.innerModel().health(); + } + + public SapVirtualInstanceState state() { + return this.innerModel().state(); + } + + public SapVirtualInstanceProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public SapVirtualInstanceError errors() { + return this.innerModel().errors(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public SapVirtualInstanceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String sapVirtualInstanceName; + + private UpdateSapVirtualInstanceRequest updateBody; + + public SapVirtualInstanceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public SapVirtualInstance create() { + this.innerObject = + serviceManager + .serviceClient() + .getSapVirtualInstances() + .create(resourceGroupName, sapVirtualInstanceName, this.innerModel(), Context.NONE); + return this; + } + + public SapVirtualInstance create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSapVirtualInstances() + .create(resourceGroupName, sapVirtualInstanceName, this.innerModel(), context); + return this; + } + + SapVirtualInstanceImpl( + String name, + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager serviceManager) { + this.innerObject = new SapVirtualInstanceInner(); + this.serviceManager = serviceManager; + this.sapVirtualInstanceName = name; + } + + public SapVirtualInstanceImpl update() { + this.updateBody = new UpdateSapVirtualInstanceRequest(); + return this; + } + + public SapVirtualInstance apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSapVirtualInstances() + .update(resourceGroupName, sapVirtualInstanceName, updateBody, Context.NONE); + return this; + } + + public SapVirtualInstance apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSapVirtualInstances() + .update(resourceGroupName, sapVirtualInstanceName, updateBody, context); + return this; + } + + SapVirtualInstanceImpl( + SapVirtualInstanceInner innerObject, + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.sapVirtualInstanceName = Utils.getValueFromIdByName(innerObject.id(), "sapVirtualInstances"); + } + + public SapVirtualInstance refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSapVirtualInstances() + .getByResourceGroupWithResponse(resourceGroupName, sapVirtualInstanceName, Context.NONE) + .getValue(); + return this; + } + + public SapVirtualInstance refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSapVirtualInstances() + .getByResourceGroupWithResponse(resourceGroupName, sapVirtualInstanceName, context) + .getValue(); + return this; + } + + public OperationStatusResult start() { + return serviceManager.sapVirtualInstances().start(resourceGroupName, sapVirtualInstanceName); + } + + public OperationStatusResult start(StartRequest body, Context context) { + return serviceManager.sapVirtualInstances().start(resourceGroupName, sapVirtualInstanceName, body, context); + } + + public OperationStatusResult stop() { + return serviceManager.sapVirtualInstances().stop(resourceGroupName, sapVirtualInstanceName); + } + + public OperationStatusResult stop(StopRequest body, Context context) { + return serviceManager.sapVirtualInstances().stop(resourceGroupName, sapVirtualInstanceName, body, context); + } + + public SapVirtualInstanceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SapVirtualInstanceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SapVirtualInstanceImpl withEnvironment(SapEnvironmentType environment) { + this.innerModel().withEnvironment(environment); + return this; + } + + public SapVirtualInstanceImpl withSapProduct(SapProductType sapProduct) { + this.innerModel().withSapProduct(sapProduct); + return this; + } + + public SapVirtualInstanceImpl withConfiguration(SapConfiguration configuration) { + this.innerModel().withConfiguration(configuration); + return this; + } + + public SapVirtualInstanceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateBody.withTags(tags); + return this; + } + } + + public SapVirtualInstanceImpl withIdentity(UserAssignedServiceIdentity identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateBody.withIdentity(identity); + return this; + } + } + + public SapVirtualInstanceImpl withManagedResourcesNetworkAccessType( + ManagedResourcesNetworkAccessType managedResourcesNetworkAccessType) { + this.innerModel().withManagedResourcesNetworkAccessType(managedResourcesNetworkAccessType); + return this; + } + + public SapVirtualInstanceImpl withManagedResourceGroupConfiguration( + ManagedRGConfiguration managedResourceGroupConfiguration) { + this.innerModel().withManagedResourceGroupConfiguration(managedResourceGroupConfiguration); + return this; + } + + public SapVirtualInstanceImpl withProperties(UpdateSapVirtualInstanceProperties properties) { + this.updateBody.withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapVirtualInstancesClientImpl.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapVirtualInstancesClientImpl.java new file mode 100644 index 0000000000000..834367a03879f --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapVirtualInstancesClientImpl.java @@ -0,0 +1,2345 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.SapVirtualInstancesClient; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapVirtualInstanceInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapVirtualInstanceList; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StartRequest; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StopRequest; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.UpdateSapVirtualInstanceRequest; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SapVirtualInstancesClient. */ +public final class SapVirtualInstancesClientImpl implements SapVirtualInstancesClient { + /** The proxy service used to perform REST calls. */ + private final SapVirtualInstancesService service; + + /** The service client containing this operation class. */ + private final WorkloadsClientImpl client; + + /** + * Initializes an instance of SapVirtualInstancesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SapVirtualInstancesClientImpl(WorkloadsClientImpl client) { + this.service = + RestProxy.create(SapVirtualInstancesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for WorkloadsClientSapVirtualInstances to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "WorkloadsClientSapVi") + public interface SapVirtualInstancesService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SapVirtualInstanceInner body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") UpdateSapVirtualInstanceRequest body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Workloads/sapVirtualInstances") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/start") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> start( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") StartRequest body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/stop") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> stop( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("sapVirtualInstanceName") String sapVirtualInstanceName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") StopRequest body, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Creates a Virtual Instance for SAP solutions (VIS) resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param body Virtual Instance for SAP solutions resource request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the Virtual Instance for SAP solutions resource along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String sapVirtualInstanceName, SapVirtualInstanceInner body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a Virtual Instance for SAP solutions (VIS) resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param body Virtual Instance for SAP solutions resource request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the Virtual Instance for SAP solutions resource along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String sapVirtualInstanceName, SapVirtualInstanceInner body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Creates a Virtual Instance for SAP solutions (VIS) resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param body Virtual Instance for SAP solutions resource request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of define the Virtual Instance for SAP solutions resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SapVirtualInstanceInner> beginCreateAsync( + String resourceGroupName, String sapVirtualInstanceName, SapVirtualInstanceInner body) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, sapVirtualInstanceName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SapVirtualInstanceInner.class, + SapVirtualInstanceInner.class, + this.client.getContext()); + } + + /** + * Creates a Virtual Instance for SAP solutions (VIS) resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of define the Virtual Instance for SAP solutions resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SapVirtualInstanceInner> beginCreateAsync( + String resourceGroupName, String sapVirtualInstanceName) { + final SapVirtualInstanceInner body = null; + Mono>> mono = + createWithResponseAsync(resourceGroupName, sapVirtualInstanceName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SapVirtualInstanceInner.class, + SapVirtualInstanceInner.class, + this.client.getContext()); + } + + /** + * Creates a Virtual Instance for SAP solutions (VIS) resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param body Virtual Instance for SAP solutions resource request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of define the Virtual Instance for SAP solutions resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SapVirtualInstanceInner> beginCreateAsync( + String resourceGroupName, String sapVirtualInstanceName, SapVirtualInstanceInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, sapVirtualInstanceName, body, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SapVirtualInstanceInner.class, + SapVirtualInstanceInner.class, + context); + } + + /** + * Creates a Virtual Instance for SAP solutions (VIS) resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of define the Virtual Instance for SAP solutions resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SapVirtualInstanceInner> beginCreate( + String resourceGroupName, String sapVirtualInstanceName) { + final SapVirtualInstanceInner body = null; + return this.beginCreateAsync(resourceGroupName, sapVirtualInstanceName, body).getSyncPoller(); + } + + /** + * Creates a Virtual Instance for SAP solutions (VIS) resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param body Virtual Instance for SAP solutions resource request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of define the Virtual Instance for SAP solutions resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SapVirtualInstanceInner> beginCreate( + String resourceGroupName, String sapVirtualInstanceName, SapVirtualInstanceInner body, Context context) { + return this.beginCreateAsync(resourceGroupName, sapVirtualInstanceName, body, context).getSyncPoller(); + } + + /** + * Creates a Virtual Instance for SAP solutions (VIS) resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param body Virtual Instance for SAP solutions resource request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the Virtual Instance for SAP solutions resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String sapVirtualInstanceName, SapVirtualInstanceInner body) { + return beginCreateAsync(resourceGroupName, sapVirtualInstanceName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a Virtual Instance for SAP solutions (VIS) resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the Virtual Instance for SAP solutions resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String sapVirtualInstanceName) { + final SapVirtualInstanceInner body = null; + return beginCreateAsync(resourceGroupName, sapVirtualInstanceName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a Virtual Instance for SAP solutions (VIS) resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param body Virtual Instance for SAP solutions resource request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the Virtual Instance for SAP solutions resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String sapVirtualInstanceName, SapVirtualInstanceInner body, Context context) { + return beginCreateAsync(resourceGroupName, sapVirtualInstanceName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a Virtual Instance for SAP solutions (VIS) resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the Virtual Instance for SAP solutions resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapVirtualInstanceInner create(String resourceGroupName, String sapVirtualInstanceName) { + final SapVirtualInstanceInner body = null; + return createAsync(resourceGroupName, sapVirtualInstanceName, body).block(); + } + + /** + * Creates a Virtual Instance for SAP solutions (VIS) resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param body Virtual Instance for SAP solutions resource request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the Virtual Instance for SAP solutions resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapVirtualInstanceInner create( + String resourceGroupName, String sapVirtualInstanceName, SapVirtualInstanceInner body, Context context) { + return createAsync(resourceGroupName, sapVirtualInstanceName, body, context).block(); + } + + /** + * Gets a Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Virtual Instance for SAP solutions resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String sapVirtualInstanceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Virtual Instance for SAP solutions resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String sapVirtualInstanceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets a Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Virtual Instance for SAP solutions resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String sapVirtualInstanceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, sapVirtualInstanceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Virtual Instance for SAP solutions resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String sapVirtualInstanceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, sapVirtualInstanceName, context).block(); + } + + /** + * Gets a Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Virtual Instance for SAP solutions resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapVirtualInstanceInner getByResourceGroup(String resourceGroupName, String sapVirtualInstanceName) { + return getByResourceGroupWithResponse(resourceGroupName, sapVirtualInstanceName, Context.NONE).getValue(); + } + + /** + * Updates a Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param body Request body to update a Virtual Instance for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the Virtual Instance for SAP solutions resource along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String sapVirtualInstanceName, UpdateSapVirtualInstanceRequest body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates a Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param body Request body to update a Virtual Instance for SAP solutions resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the Virtual Instance for SAP solutions resource along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, + String sapVirtualInstanceName, + UpdateSapVirtualInstanceRequest body, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Updates a Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param body Request body to update a Virtual Instance for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of define the Virtual Instance for SAP solutions resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SapVirtualInstanceInner> beginUpdateAsync( + String resourceGroupName, String sapVirtualInstanceName, UpdateSapVirtualInstanceRequest body) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, sapVirtualInstanceName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SapVirtualInstanceInner.class, + SapVirtualInstanceInner.class, + this.client.getContext()); + } + + /** + * Updates a Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of define the Virtual Instance for SAP solutions resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SapVirtualInstanceInner> beginUpdateAsync( + String resourceGroupName, String sapVirtualInstanceName) { + final UpdateSapVirtualInstanceRequest body = null; + Mono>> mono = + updateWithResponseAsync(resourceGroupName, sapVirtualInstanceName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SapVirtualInstanceInner.class, + SapVirtualInstanceInner.class, + this.client.getContext()); + } + + /** + * Updates a Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param body Request body to update a Virtual Instance for SAP solutions resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of define the Virtual Instance for SAP solutions resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SapVirtualInstanceInner> beginUpdateAsync( + String resourceGroupName, + String sapVirtualInstanceName, + UpdateSapVirtualInstanceRequest body, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, sapVirtualInstanceName, body, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SapVirtualInstanceInner.class, + SapVirtualInstanceInner.class, + context); + } + + /** + * Updates a Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of define the Virtual Instance for SAP solutions resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SapVirtualInstanceInner> beginUpdate( + String resourceGroupName, String sapVirtualInstanceName) { + final UpdateSapVirtualInstanceRequest body = null; + return this.beginUpdateAsync(resourceGroupName, sapVirtualInstanceName, body).getSyncPoller(); + } + + /** + * Updates a Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param body Request body to update a Virtual Instance for SAP solutions resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of define the Virtual Instance for SAP solutions resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SapVirtualInstanceInner> beginUpdate( + String resourceGroupName, + String sapVirtualInstanceName, + UpdateSapVirtualInstanceRequest body, + Context context) { + return this.beginUpdateAsync(resourceGroupName, sapVirtualInstanceName, body, context).getSyncPoller(); + } + + /** + * Updates a Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param body Request body to update a Virtual Instance for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the Virtual Instance for SAP solutions resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String sapVirtualInstanceName, UpdateSapVirtualInstanceRequest body) { + return beginUpdateAsync(resourceGroupName, sapVirtualInstanceName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the Virtual Instance for SAP solutions resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String sapVirtualInstanceName) { + final UpdateSapVirtualInstanceRequest body = null; + return beginUpdateAsync(resourceGroupName, sapVirtualInstanceName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param body Request body to update a Virtual Instance for SAP solutions resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the Virtual Instance for SAP solutions resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String sapVirtualInstanceName, + UpdateSapVirtualInstanceRequest body, + Context context) { + return beginUpdateAsync(resourceGroupName, sapVirtualInstanceName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the Virtual Instance for SAP solutions resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapVirtualInstanceInner update(String resourceGroupName, String sapVirtualInstanceName) { + final UpdateSapVirtualInstanceRequest body = null; + return updateAsync(resourceGroupName, sapVirtualInstanceName, body).block(); + } + + /** + * Updates a Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param body Request body to update a Virtual Instance for SAP solutions resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return define the Virtual Instance for SAP solutions resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SapVirtualInstanceInner update( + String resourceGroupName, + String sapVirtualInstanceName, + UpdateSapVirtualInstanceRequest body, + Context context) { + return updateAsync(resourceGroupName, sapVirtualInstanceName, body, context).block(); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String sapVirtualInstanceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String sapVirtualInstanceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String sapVirtualInstanceName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, sapVirtualInstanceName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String sapVirtualInstanceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, sapVirtualInstanceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String sapVirtualInstanceName) { + return this.beginDeleteAsync(resourceGroupName, sapVirtualInstanceName).getSyncPoller(); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String sapVirtualInstanceName, Context context) { + return this.beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, context).getSyncPoller(); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String sapVirtualInstanceName) { + return beginDeleteAsync(resourceGroupName, sapVirtualInstanceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String sapVirtualInstanceName, Context context) { + return beginDeleteAsync(resourceGroupName, sapVirtualInstanceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String sapVirtualInstanceName) { + deleteAsync(resourceGroupName, sapVirtualInstanceName).block(); + } + + /** + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String sapVirtualInstanceName, Context context) { + deleteAsync(resourceGroupName, sapVirtualInstanceName, context).block(); + } + + /** + * Gets all Virtual Instances for SAP solutions resources in a Resource Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Virtual Instances for SAP solutions resources in a Resource Group along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all Virtual Instances for SAP solutions resources in a Resource Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Virtual Instances for SAP solutions resources in a Resource Group along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all Virtual Instances for SAP solutions resources in a Resource Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Virtual Instances for SAP solutions resources in a Resource Group as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets all Virtual Instances for SAP solutions resources in a Resource Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Virtual Instances for SAP solutions resources in a Resource Group as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all Virtual Instances for SAP solutions resources in a Resource Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Virtual Instances for SAP solutions resources in a Resource Group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets all Virtual Instances for SAP solutions resources in a Resource Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Virtual Instances for SAP solutions resources in a Resource Group as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets all Virtual Instances for SAP solutions resources in a Subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Virtual Instances for SAP solutions resources in a Subscription along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all Virtual Instances for SAP solutions resources in a Subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Virtual Instances for SAP solutions resources in a Subscription along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets all Virtual Instances for SAP solutions resources in a Subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Virtual Instances for SAP solutions resources in a Subscription as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Gets all Virtual Instances for SAP solutions resources in a Subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Virtual Instances for SAP solutions resources in a Subscription as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets all Virtual Instances for SAP solutions resources in a Subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Virtual Instances for SAP solutions resources in a Subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets all Virtual Instances for SAP solutions resources in a Subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Virtual Instances for SAP solutions resources in a Subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Starts the SAP application, that is the Central Services instance and Application server instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param body The Virtual Instance for SAP solutions resource start request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync( + String resourceGroupName, String sapVirtualInstanceName, StartRequest body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .start( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Starts the SAP application, that is the Central Services instance and Application server instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param body The Virtual Instance for SAP solutions resource start request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync( + String resourceGroupName, String sapVirtualInstanceName, StartRequest body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .start( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Starts the SAP application, that is the Central Services instance and Application server instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param body The Virtual Instance for SAP solutions resource start request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusResultInner> beginStartAsync( + String resourceGroupName, String sapVirtualInstanceName, StartRequest body) { + Mono>> mono = startWithResponseAsync(resourceGroupName, sapVirtualInstanceName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationStatusResultInner.class, + OperationStatusResultInner.class, + this.client.getContext()); + } + + /** + * Starts the SAP application, that is the Central Services instance and Application server instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusResultInner> beginStartAsync( + String resourceGroupName, String sapVirtualInstanceName) { + final StartRequest body = null; + Mono>> mono = startWithResponseAsync(resourceGroupName, sapVirtualInstanceName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationStatusResultInner.class, + OperationStatusResultInner.class, + this.client.getContext()); + } + + /** + * Starts the SAP application, that is the Central Services instance and Application server instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param body The Virtual Instance for SAP solutions resource start request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusResultInner> beginStartAsync( + String resourceGroupName, String sapVirtualInstanceName, StartRequest body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + startWithResponseAsync(resourceGroupName, sapVirtualInstanceName, body, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationStatusResultInner.class, + OperationStatusResultInner.class, + context); + } + + /** + * Starts the SAP application, that is the Central Services instance and Application server instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationStatusResultInner> beginStart( + String resourceGroupName, String sapVirtualInstanceName) { + final StartRequest body = null; + return this.beginStartAsync(resourceGroupName, sapVirtualInstanceName, body).getSyncPoller(); + } + + /** + * Starts the SAP application, that is the Central Services instance and Application server instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param body The Virtual Instance for SAP solutions resource start request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationStatusResultInner> beginStart( + String resourceGroupName, String sapVirtualInstanceName, StartRequest body, Context context) { + return this.beginStartAsync(resourceGroupName, sapVirtualInstanceName, body, context).getSyncPoller(); + } + + /** + * Starts the SAP application, that is the Central Services instance and Application server instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param body The Virtual Instance for SAP solutions resource start request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync( + String resourceGroupName, String sapVirtualInstanceName, StartRequest body) { + return beginStartAsync(resourceGroupName, sapVirtualInstanceName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts the SAP application, that is the Central Services instance and Application server instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync(String resourceGroupName, String sapVirtualInstanceName) { + final StartRequest body = null; + return beginStartAsync(resourceGroupName, sapVirtualInstanceName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts the SAP application, that is the Central Services instance and Application server instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param body The Virtual Instance for SAP solutions resource start request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync( + String resourceGroupName, String sapVirtualInstanceName, StartRequest body, Context context) { + return beginStartAsync(resourceGroupName, sapVirtualInstanceName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts the SAP application, that is the Central Services instance and Application server instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusResultInner start(String resourceGroupName, String sapVirtualInstanceName) { + final StartRequest body = null; + return startAsync(resourceGroupName, sapVirtualInstanceName, body).block(); + } + + /** + * Starts the SAP application, that is the Central Services instance and Application server instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param body The Virtual Instance for SAP solutions resource start request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusResultInner start( + String resourceGroupName, String sapVirtualInstanceName, StartRequest body, Context context) { + return startAsync(resourceGroupName, sapVirtualInstanceName, body, context).block(); + } + + /** + * Stops the SAP Application, that is the Application server instances and Central Services instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param body The Virtual Instance for SAP solutions resource stop request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> stopWithResponseAsync( + String resourceGroupName, String sapVirtualInstanceName, StopRequest body) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .stop( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + this.client.getApiVersion(), + body, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Stops the SAP Application, that is the Application server instances and Central Services instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param body The Virtual Instance for SAP solutions resource stop request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> stopWithResponseAsync( + String resourceGroupName, String sapVirtualInstanceName, StopRequest body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (sapVirtualInstanceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sapVirtualInstanceName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .stop( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + sapVirtualInstanceName, + this.client.getApiVersion(), + body, + accept, + context); + } + + /** + * Stops the SAP Application, that is the Application server instances and Central Services instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param body The Virtual Instance for SAP solutions resource stop request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusResultInner> beginStopAsync( + String resourceGroupName, String sapVirtualInstanceName, StopRequest body) { + Mono>> mono = stopWithResponseAsync(resourceGroupName, sapVirtualInstanceName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationStatusResultInner.class, + OperationStatusResultInner.class, + this.client.getContext()); + } + + /** + * Stops the SAP Application, that is the Application server instances and Central Services instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusResultInner> beginStopAsync( + String resourceGroupName, String sapVirtualInstanceName) { + final StopRequest body = null; + Mono>> mono = stopWithResponseAsync(resourceGroupName, sapVirtualInstanceName, body); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationStatusResultInner.class, + OperationStatusResultInner.class, + this.client.getContext()); + } + + /** + * Stops the SAP Application, that is the Application server instances and Central Services instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param body The Virtual Instance for SAP solutions resource stop request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusResultInner> beginStopAsync( + String resourceGroupName, String sapVirtualInstanceName, StopRequest body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + stopWithResponseAsync(resourceGroupName, sapVirtualInstanceName, body, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationStatusResultInner.class, + OperationStatusResultInner.class, + context); + } + + /** + * Stops the SAP Application, that is the Application server instances and Central Services instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationStatusResultInner> beginStop( + String resourceGroupName, String sapVirtualInstanceName) { + final StopRequest body = null; + return this.beginStopAsync(resourceGroupName, sapVirtualInstanceName, body).getSyncPoller(); + } + + /** + * Stops the SAP Application, that is the Application server instances and Central Services instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param body The Virtual Instance for SAP solutions resource stop request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationStatusResultInner> beginStop( + String resourceGroupName, String sapVirtualInstanceName, StopRequest body, Context context) { + return this.beginStopAsync(resourceGroupName, sapVirtualInstanceName, body, context).getSyncPoller(); + } + + /** + * Stops the SAP Application, that is the Application server instances and Central Services instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param body The Virtual Instance for SAP solutions resource stop request body. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopAsync( + String resourceGroupName, String sapVirtualInstanceName, StopRequest body) { + return beginStopAsync(resourceGroupName, sapVirtualInstanceName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stops the SAP Application, that is the Application server instances and Central Services instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopAsync(String resourceGroupName, String sapVirtualInstanceName) { + final StopRequest body = null; + return beginStopAsync(resourceGroupName, sapVirtualInstanceName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stops the SAP Application, that is the Application server instances and Central Services instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param body The Virtual Instance for SAP solutions resource stop request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopAsync( + String resourceGroupName, String sapVirtualInstanceName, StopRequest body, Context context) { + return beginStopAsync(resourceGroupName, sapVirtualInstanceName, body, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Stops the SAP Application, that is the Application server instances and Central Services instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusResultInner stop(String resourceGroupName, String sapVirtualInstanceName) { + final StopRequest body = null; + return stopAsync(resourceGroupName, sapVirtualInstanceName, body).block(); + } + + /** + * Stops the SAP Application, that is the Application server instances and Central Services instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param body The Virtual Instance for SAP solutions resource stop request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusResultInner stop( + String resourceGroupName, String sapVirtualInstanceName, StopRequest body, Context context) { + return stopAsync(resourceGroupName, sapVirtualInstanceName, body, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of Virtual Instance for SAP solutions resources along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of Virtual Instance for SAP solutions resources along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of Virtual Instance for SAP solutions resources along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of Virtual Instance for SAP solutions resources along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapVirtualInstancesImpl.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapVirtualInstancesImpl.java new file mode 100644 index 0000000000000..774b98d5815dc --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/SapVirtualInstancesImpl.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.SapVirtualInstancesClient; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapVirtualInstanceInner; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.OperationStatusResult; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapVirtualInstance; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapVirtualInstances; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StartRequest; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StopRequest; + +public final class SapVirtualInstancesImpl implements SapVirtualInstances { + private static final ClientLogger LOGGER = new ClientLogger(SapVirtualInstancesImpl.class); + + private final SapVirtualInstancesClient innerClient; + + private final com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager + serviceManager; + + public SapVirtualInstancesImpl( + SapVirtualInstancesClient innerClient, + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String sapVirtualInstanceName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, sapVirtualInstanceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SapVirtualInstanceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SapVirtualInstance getByResourceGroup(String resourceGroupName, String sapVirtualInstanceName) { + SapVirtualInstanceInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, sapVirtualInstanceName); + if (inner != null) { + return new SapVirtualInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String sapVirtualInstanceName) { + this.serviceClient().delete(resourceGroupName, sapVirtualInstanceName); + } + + public void delete(String resourceGroupName, String sapVirtualInstanceName, Context context) { + this.serviceClient().delete(resourceGroupName, sapVirtualInstanceName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new SapVirtualInstanceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new SapVirtualInstanceImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new SapVirtualInstanceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new SapVirtualInstanceImpl(inner1, this.manager())); + } + + public OperationStatusResult start(String resourceGroupName, String sapVirtualInstanceName) { + OperationStatusResultInner inner = this.serviceClient().start(resourceGroupName, sapVirtualInstanceName); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatusResult start( + String resourceGroupName, String sapVirtualInstanceName, StartRequest body, Context context) { + OperationStatusResultInner inner = + this.serviceClient().start(resourceGroupName, sapVirtualInstanceName, body, context); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatusResult stop(String resourceGroupName, String sapVirtualInstanceName) { + OperationStatusResultInner inner = this.serviceClient().stop(resourceGroupName, sapVirtualInstanceName); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatusResult stop( + String resourceGroupName, String sapVirtualInstanceName, StopRequest body, Context context) { + OperationStatusResultInner inner = + this.serviceClient().stop(resourceGroupName, sapVirtualInstanceName, body, context); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public SapVirtualInstance getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sapVirtualInstanceName = Utils.getValueFromIdByName(id, "sapVirtualInstances"); + if (sapVirtualInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'sapVirtualInstances'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, sapVirtualInstanceName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sapVirtualInstanceName = Utils.getValueFromIdByName(id, "sapVirtualInstances"); + if (sapVirtualInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'sapVirtualInstances'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, sapVirtualInstanceName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sapVirtualInstanceName = Utils.getValueFromIdByName(id, "sapVirtualInstances"); + if (sapVirtualInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'sapVirtualInstances'.", id))); + } + this.delete(resourceGroupName, sapVirtualInstanceName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String sapVirtualInstanceName = Utils.getValueFromIdByName(id, "sapVirtualInstances"); + if (sapVirtualInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'sapVirtualInstances'.", id))); + } + this.delete(resourceGroupName, sapVirtualInstanceName, context); + } + + private SapVirtualInstancesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager() { + return this.serviceManager; + } + + public SapVirtualInstanceImpl define(String name) { + return new SapVirtualInstanceImpl(name, this.manager()); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/Utils.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/Utils.java new file mode 100644 index 0000000000000..fa7ed8f620c9c --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/Utils.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class Utils { + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (segments.size() > 0 && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super( + PagedFlux + .create( + () -> + (continuationToken, pageSize) -> + Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> + new PagedResponseBase( + page.getRequest(), + page.getStatusCode(), + page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), + page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/WorkloadsClientBuilder.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/WorkloadsClientBuilder.java new file mode 100644 index 0000000000000..4d4bc97e48fa3 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/WorkloadsClientBuilder.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** A builder for creating a new instance of the WorkloadsClientImpl type. */ +@ServiceClientBuilder(serviceClients = {WorkloadsClientImpl.class}) +public final class WorkloadsClientBuilder { + /* + * The ID of the target subscription. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the WorkloadsClientBuilder. + */ + public WorkloadsClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the WorkloadsClientBuilder. + */ + public WorkloadsClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the WorkloadsClientBuilder. + */ + public WorkloadsClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the WorkloadsClientBuilder. + */ + public WorkloadsClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the WorkloadsClientBuilder. + */ + public WorkloadsClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the WorkloadsClientBuilder. + */ + public WorkloadsClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of WorkloadsClientImpl with the provided parameters. + * + * @return an instance of WorkloadsClientImpl. + */ + public WorkloadsClientImpl buildClient() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = + (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval = + (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = + (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + WorkloadsClientImpl client = + new WorkloadsClientImpl( + localPipeline, + localSerializerAdapter, + localDefaultPollInterval, + localEnvironment, + this.subscriptionId, + localEndpoint); + return client; + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/WorkloadsClientImpl.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/WorkloadsClientImpl.java new file mode 100644 index 0000000000000..a1cb2fb3ac0c2 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/WorkloadsClientImpl.java @@ -0,0 +1,360 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.OperationsClient; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.SapApplicationServerInstancesClient; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.SapCentralInstancesClient; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.SapDatabaseInstancesClient; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.SapVirtualInstancesClient; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.WorkloadsClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the WorkloadsClientImpl type. */ +@ServiceClient(builder = WorkloadsClientBuilder.class) +public final class WorkloadsClientImpl implements WorkloadsClient { + /** The ID of the target subscription. */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** server parameter. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The default poll interval for long-running operation. */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** The ResourceProvidersClient object to access its operations. */ + private final ResourceProvidersClient resourceProviders; + + /** + * Gets the ResourceProvidersClient object to access its operations. + * + * @return the ResourceProvidersClient object. + */ + public ResourceProvidersClient getResourceProviders() { + return this.resourceProviders; + } + + /** The SapVirtualInstancesClient object to access its operations. */ + private final SapVirtualInstancesClient sapVirtualInstances; + + /** + * Gets the SapVirtualInstancesClient object to access its operations. + * + * @return the SapVirtualInstancesClient object. + */ + public SapVirtualInstancesClient getSapVirtualInstances() { + return this.sapVirtualInstances; + } + + /** The SapCentralInstancesClient object to access its operations. */ + private final SapCentralInstancesClient sapCentralInstances; + + /** + * Gets the SapCentralInstancesClient object to access its operations. + * + * @return the SapCentralInstancesClient object. + */ + public SapCentralInstancesClient getSapCentralInstances() { + return this.sapCentralInstances; + } + + /** The SapDatabaseInstancesClient object to access its operations. */ + private final SapDatabaseInstancesClient sapDatabaseInstances; + + /** + * Gets the SapDatabaseInstancesClient object to access its operations. + * + * @return the SapDatabaseInstancesClient object. + */ + public SapDatabaseInstancesClient getSapDatabaseInstances() { + return this.sapDatabaseInstances; + } + + /** The SapApplicationServerInstancesClient object to access its operations. */ + private final SapApplicationServerInstancesClient sapApplicationServerInstances; + + /** + * Gets the SapApplicationServerInstancesClient object to access its operations. + * + * @return the SapApplicationServerInstancesClient object. + */ + public SapApplicationServerInstancesClient getSapApplicationServerInstances() { + return this.sapApplicationServerInstances; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** + * Initializes an instance of WorkloadsClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId The ID of the target subscription. + * @param endpoint server parameter. + */ + WorkloadsClientImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + Duration defaultPollInterval, + AzureEnvironment environment, + String subscriptionId, + String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2023-10-01-preview"; + this.resourceProviders = new ResourceProvidersClientImpl(this); + this.sapVirtualInstances = new SapVirtualInstancesClientImpl(this); + this.sapCentralInstances = new SapCentralInstancesClientImpl(this); + this.sapDatabaseInstances = new SapDatabaseInstancesClientImpl(this); + this.sapApplicationServerInstances = new SapApplicationServerInstancesClientImpl(this); + this.operations = new OperationsClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + return CoreUtils.mergeContexts(this.getContext(), context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + LOGGER.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WorkloadsClientImpl.class); +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/package-info.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/package-info.java new file mode 100644 index 0000000000000..731b3138d0aed --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/implementation/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the implementations for WorkloadsClient. Workloads client provides access to various workload + * operations. + */ +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.implementation; diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ActionType.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ActionType.java new file mode 100644 index 0000000000000..3c44d0458e485 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ActionType.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ +public final class ActionType extends ExpandableStringEnum { + /** Static value Internal for ActionType. */ + public static final ActionType INTERNAL = fromString("Internal"); + + /** + * Creates a new instance of ActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ActionType() { + } + + /** + * Creates or finds a ActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionType. + */ + @JsonCreator + public static ActionType fromString(String name) { + return fromString(name, ActionType.class); + } + + /** + * Gets known ActionType values. + * + * @return known ActionType values. + */ + public static Collection values() { + return values(ActionType.class); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ApplicationServerConfiguration.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ApplicationServerConfiguration.java new file mode 100644 index 0000000000000..49248bf48f444 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ApplicationServerConfiguration.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Gets or sets the application server configuration. */ +@Fluent +public final class ApplicationServerConfiguration { + /* + * The subnet id. + */ + @JsonProperty(value = "subnetId", required = true) + private String subnetId; + + /* + * Gets or sets the virtual machine configuration. + */ + @JsonProperty(value = "virtualMachineConfiguration", required = true) + private VirtualMachineConfiguration virtualMachineConfiguration; + + /* + * The number of app server instances. + */ + @JsonProperty(value = "instanceCount", required = true) + private long instanceCount; + + /** Creates an instance of ApplicationServerConfiguration class. */ + public ApplicationServerConfiguration() { + } + + /** + * Get the subnetId property: The subnet id. + * + * @return the subnetId value. + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set the subnetId property: The subnet id. + * + * @param subnetId the subnetId value to set. + * @return the ApplicationServerConfiguration object itself. + */ + public ApplicationServerConfiguration withSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + + /** + * Get the virtualMachineConfiguration property: Gets or sets the virtual machine configuration. + * + * @return the virtualMachineConfiguration value. + */ + public VirtualMachineConfiguration virtualMachineConfiguration() { + return this.virtualMachineConfiguration; + } + + /** + * Set the virtualMachineConfiguration property: Gets or sets the virtual machine configuration. + * + * @param virtualMachineConfiguration the virtualMachineConfiguration value to set. + * @return the ApplicationServerConfiguration object itself. + */ + public ApplicationServerConfiguration withVirtualMachineConfiguration( + VirtualMachineConfiguration virtualMachineConfiguration) { + this.virtualMachineConfiguration = virtualMachineConfiguration; + return this; + } + + /** + * Get the instanceCount property: The number of app server instances. + * + * @return the instanceCount value. + */ + public long instanceCount() { + return this.instanceCount; + } + + /** + * Set the instanceCount property: The number of app server instances. + * + * @param instanceCount the instanceCount value to set. + * @return the ApplicationServerConfiguration object itself. + */ + public ApplicationServerConfiguration withInstanceCount(long instanceCount) { + this.instanceCount = instanceCount; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subnetId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property subnetId in model ApplicationServerConfiguration")); + } + if (virtualMachineConfiguration() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property virtualMachineConfiguration in model" + + " ApplicationServerConfiguration")); + } else { + virtualMachineConfiguration().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ApplicationServerConfiguration.class); +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ApplicationServerFullResourceNames.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ApplicationServerFullResourceNames.java new file mode 100644 index 0000000000000..a6eed7ab864a7 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ApplicationServerFullResourceNames.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The full resource names object for application layer resources. The number of entries in this list should be equal to + * the number VMs to be created for application layer. + */ +@Fluent +public final class ApplicationServerFullResourceNames { + /* + * The list of virtual machine naming details. + */ + @JsonProperty(value = "virtualMachines") + private List virtualMachines; + + /* + * The full name for availability set. In case name is not provided, it will be defaulted to {SID}-App-AvSet. + */ + @JsonProperty(value = "availabilitySetName") + private String availabilitySetName; + + /** Creates an instance of ApplicationServerFullResourceNames class. */ + public ApplicationServerFullResourceNames() { + } + + /** + * Get the virtualMachines property: The list of virtual machine naming details. + * + * @return the virtualMachines value. + */ + public List virtualMachines() { + return this.virtualMachines; + } + + /** + * Set the virtualMachines property: The list of virtual machine naming details. + * + * @param virtualMachines the virtualMachines value to set. + * @return the ApplicationServerFullResourceNames object itself. + */ + public ApplicationServerFullResourceNames withVirtualMachines(List virtualMachines) { + this.virtualMachines = virtualMachines; + return this; + } + + /** + * Get the availabilitySetName property: The full name for availability set. In case name is not provided, it will + * be defaulted to {SID}-App-AvSet. + * + * @return the availabilitySetName value. + */ + public String availabilitySetName() { + return this.availabilitySetName; + } + + /** + * Set the availabilitySetName property: The full name for availability set. In case name is not provided, it will + * be defaulted to {SID}-App-AvSet. + * + * @param availabilitySetName the availabilitySetName value to set. + * @return the ApplicationServerFullResourceNames object itself. + */ + public ApplicationServerFullResourceNames withAvailabilitySetName(String availabilitySetName) { + this.availabilitySetName = availabilitySetName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (virtualMachines() != null) { + virtualMachines().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ApplicationServerVirtualMachineType.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ApplicationServerVirtualMachineType.java new file mode 100644 index 0000000000000..64df9b1a80f0c --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ApplicationServerVirtualMachineType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines the type of application server VM. */ +public final class ApplicationServerVirtualMachineType + extends ExpandableStringEnum { + /** Static value Active for ApplicationServerVirtualMachineType. */ + public static final ApplicationServerVirtualMachineType ACTIVE = fromString("Active"); + + /** Static value Standby for ApplicationServerVirtualMachineType. */ + public static final ApplicationServerVirtualMachineType STANDBY = fromString("Standby"); + + /** Static value Unknown for ApplicationServerVirtualMachineType. */ + public static final ApplicationServerVirtualMachineType UNKNOWN = fromString("Unknown"); + + /** + * Creates a new instance of ApplicationServerVirtualMachineType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ApplicationServerVirtualMachineType() { + } + + /** + * Creates or finds a ApplicationServerVirtualMachineType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ApplicationServerVirtualMachineType. + */ + @JsonCreator + public static ApplicationServerVirtualMachineType fromString(String name) { + return fromString(name, ApplicationServerVirtualMachineType.class); + } + + /** + * Gets known ApplicationServerVirtualMachineType values. + * + * @return known ApplicationServerVirtualMachineType values. + */ + public static Collection values() { + return values(ApplicationServerVirtualMachineType.class); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ApplicationServerVmDetails.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ApplicationServerVmDetails.java new file mode 100644 index 0000000000000..449ab62bca8b7 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ApplicationServerVmDetails.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The Application Server VM Details. */ +@Immutable +public final class ApplicationServerVmDetails { + /* + * Defines the type of application server VM. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private ApplicationServerVirtualMachineType type; + + /* + * The virtualMachineId property. + */ + @JsonProperty(value = "virtualMachineId", access = JsonProperty.Access.WRITE_ONLY) + private String virtualMachineId; + + /* + * Storage details of all the Storage Accounts attached to the App Virtual Machine. For e.g. NFS on AFS Shared + * Storage. + */ + @JsonProperty(value = "storageDetails", access = JsonProperty.Access.WRITE_ONLY) + private List storageDetails; + + /** Creates an instance of ApplicationServerVmDetails class. */ + public ApplicationServerVmDetails() { + } + + /** + * Get the type property: Defines the type of application server VM. + * + * @return the type value. + */ + public ApplicationServerVirtualMachineType type() { + return this.type; + } + + /** + * Get the virtualMachineId property: The virtualMachineId property. + * + * @return the virtualMachineId value. + */ + public String virtualMachineId() { + return this.virtualMachineId; + } + + /** + * Get the storageDetails property: Storage details of all the Storage Accounts attached to the App Virtual Machine. + * For e.g. NFS on AFS Shared Storage. + * + * @return the storageDetails value. + */ + public List storageDetails() { + return this.storageDetails; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (storageDetails() != null) { + storageDetails().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/CentralServerConfiguration.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/CentralServerConfiguration.java new file mode 100644 index 0000000000000..b2cf3a1732a5e --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/CentralServerConfiguration.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Gets or sets the central server configuration. */ +@Fluent +public final class CentralServerConfiguration { + /* + * The subnet id. + */ + @JsonProperty(value = "subnetId", required = true) + private String subnetId; + + /* + * Gets or sets the virtual machine configuration. + */ + @JsonProperty(value = "virtualMachineConfiguration", required = true) + private VirtualMachineConfiguration virtualMachineConfiguration; + + /* + * The number of central server VMs. + */ + @JsonProperty(value = "instanceCount", required = true) + private long instanceCount; + + /** Creates an instance of CentralServerConfiguration class. */ + public CentralServerConfiguration() { + } + + /** + * Get the subnetId property: The subnet id. + * + * @return the subnetId value. + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set the subnetId property: The subnet id. + * + * @param subnetId the subnetId value to set. + * @return the CentralServerConfiguration object itself. + */ + public CentralServerConfiguration withSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + + /** + * Get the virtualMachineConfiguration property: Gets or sets the virtual machine configuration. + * + * @return the virtualMachineConfiguration value. + */ + public VirtualMachineConfiguration virtualMachineConfiguration() { + return this.virtualMachineConfiguration; + } + + /** + * Set the virtualMachineConfiguration property: Gets or sets the virtual machine configuration. + * + * @param virtualMachineConfiguration the virtualMachineConfiguration value to set. + * @return the CentralServerConfiguration object itself. + */ + public CentralServerConfiguration withVirtualMachineConfiguration( + VirtualMachineConfiguration virtualMachineConfiguration) { + this.virtualMachineConfiguration = virtualMachineConfiguration; + return this; + } + + /** + * Get the instanceCount property: The number of central server VMs. + * + * @return the instanceCount value. + */ + public long instanceCount() { + return this.instanceCount; + } + + /** + * Set the instanceCount property: The number of central server VMs. + * + * @param instanceCount the instanceCount value to set. + * @return the CentralServerConfiguration object itself. + */ + public CentralServerConfiguration withInstanceCount(long instanceCount) { + this.instanceCount = instanceCount; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subnetId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property subnetId in model CentralServerConfiguration")); + } + if (virtualMachineConfiguration() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property virtualMachineConfiguration in model CentralServerConfiguration")); + } else { + virtualMachineConfiguration().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CentralServerConfiguration.class); +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/CentralServerFullResourceNames.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/CentralServerFullResourceNames.java new file mode 100644 index 0000000000000..0c313acbbdf96 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/CentralServerFullResourceNames.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The full resource names object for central server layer resources. */ +@Fluent +public final class CentralServerFullResourceNames { + /* + * The list of names for all ASCS virtual machines to be deployed. The number of entries in this list should be + * equal to the number VMs to be created for ASCS layer. At maximum, there can be two virtual machines at this + * layer: ASCS and ERS. + */ + @JsonProperty(value = "virtualMachines") + private List virtualMachines; + + /* + * The full name for availability set. In case name is not provided, it will be defaulted to {SID}-ASCS-AvSet. + */ + @JsonProperty(value = "availabilitySetName") + private String availabilitySetName; + + /* + * The resource names object for load balancer and related resources. + */ + @JsonProperty(value = "loadBalancer") + private LoadBalancerResourceNames loadBalancer; + + /** Creates an instance of CentralServerFullResourceNames class. */ + public CentralServerFullResourceNames() { + } + + /** + * Get the virtualMachines property: The list of names for all ASCS virtual machines to be deployed. The number of + * entries in this list should be equal to the number VMs to be created for ASCS layer. At maximum, there can be two + * virtual machines at this layer: ASCS and ERS. + * + * @return the virtualMachines value. + */ + public List virtualMachines() { + return this.virtualMachines; + } + + /** + * Set the virtualMachines property: The list of names for all ASCS virtual machines to be deployed. The number of + * entries in this list should be equal to the number VMs to be created for ASCS layer. At maximum, there can be two + * virtual machines at this layer: ASCS and ERS. + * + * @param virtualMachines the virtualMachines value to set. + * @return the CentralServerFullResourceNames object itself. + */ + public CentralServerFullResourceNames withVirtualMachines(List virtualMachines) { + this.virtualMachines = virtualMachines; + return this; + } + + /** + * Get the availabilitySetName property: The full name for availability set. In case name is not provided, it will + * be defaulted to {SID}-ASCS-AvSet. + * + * @return the availabilitySetName value. + */ + public String availabilitySetName() { + return this.availabilitySetName; + } + + /** + * Set the availabilitySetName property: The full name for availability set. In case name is not provided, it will + * be defaulted to {SID}-ASCS-AvSet. + * + * @param availabilitySetName the availabilitySetName value to set. + * @return the CentralServerFullResourceNames object itself. + */ + public CentralServerFullResourceNames withAvailabilitySetName(String availabilitySetName) { + this.availabilitySetName = availabilitySetName; + return this; + } + + /** + * Get the loadBalancer property: The resource names object for load balancer and related resources. + * + * @return the loadBalancer value. + */ + public LoadBalancerResourceNames loadBalancer() { + return this.loadBalancer; + } + + /** + * Set the loadBalancer property: The resource names object for load balancer and related resources. + * + * @param loadBalancer the loadBalancer value to set. + * @return the CentralServerFullResourceNames object itself. + */ + public CentralServerFullResourceNames withLoadBalancer(LoadBalancerResourceNames loadBalancer) { + this.loadBalancer = loadBalancer; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (virtualMachines() != null) { + virtualMachines().forEach(e -> e.validate()); + } + if (loadBalancer() != null) { + loadBalancer().validate(); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/CentralServerVirtualMachineType.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/CentralServerVirtualMachineType.java new file mode 100644 index 0000000000000..9aaff62b8c770 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/CentralServerVirtualMachineType.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines the type of central server VM. */ +public final class CentralServerVirtualMachineType extends ExpandableStringEnum { + /** Static value Primary for CentralServerVirtualMachineType. */ + public static final CentralServerVirtualMachineType PRIMARY = fromString("Primary"); + + /** Static value Secondary for CentralServerVirtualMachineType. */ + public static final CentralServerVirtualMachineType SECONDARY = fromString("Secondary"); + + /** Static value Unknown for CentralServerVirtualMachineType. */ + public static final CentralServerVirtualMachineType UNKNOWN = fromString("Unknown"); + + /** Static value ASCS for CentralServerVirtualMachineType. */ + public static final CentralServerVirtualMachineType ASCS = fromString("ASCS"); + + /** Static value ERSInactive for CentralServerVirtualMachineType. */ + public static final CentralServerVirtualMachineType ERSINACTIVE = fromString("ERSInactive"); + + /** Static value ERS for CentralServerVirtualMachineType. */ + public static final CentralServerVirtualMachineType ERS = fromString("ERS"); + + /** Static value Standby for CentralServerVirtualMachineType. */ + public static final CentralServerVirtualMachineType STANDBY = fromString("Standby"); + + /** + * Creates a new instance of CentralServerVirtualMachineType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CentralServerVirtualMachineType() { + } + + /** + * Creates or finds a CentralServerVirtualMachineType from its string representation. + * + * @param name a name to look for. + * @return the corresponding CentralServerVirtualMachineType. + */ + @JsonCreator + public static CentralServerVirtualMachineType fromString(String name) { + return fromString(name, CentralServerVirtualMachineType.class); + } + + /** + * Gets known CentralServerVirtualMachineType values. + * + * @return known CentralServerVirtualMachineType values. + */ + public static Collection values() { + return values(CentralServerVirtualMachineType.class); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/CentralServerVmDetails.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/CentralServerVmDetails.java new file mode 100644 index 0000000000000..529a89f6a1614 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/CentralServerVmDetails.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The SAP Central Services Instance VM details. */ +@Immutable +public final class CentralServerVmDetails { + /* + * Defines the type of central server VM. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private CentralServerVirtualMachineType type; + + /* + * The virtualMachineId property. + */ + @JsonProperty(value = "virtualMachineId", access = JsonProperty.Access.WRITE_ONLY) + private String virtualMachineId; + + /* + * Storage details of all the Storage Accounts attached to the ASCS Virtual Machine. For e.g. NFS on AFS Shared + * Storage. + */ + @JsonProperty(value = "storageDetails", access = JsonProperty.Access.WRITE_ONLY) + private List storageDetails; + + /** Creates an instance of CentralServerVmDetails class. */ + public CentralServerVmDetails() { + } + + /** + * Get the type property: Defines the type of central server VM. + * + * @return the type value. + */ + public CentralServerVirtualMachineType type() { + return this.type; + } + + /** + * Get the virtualMachineId property: The virtualMachineId property. + * + * @return the virtualMachineId value. + */ + public String virtualMachineId() { + return this.virtualMachineId; + } + + /** + * Get the storageDetails property: Storage details of all the Storage Accounts attached to the ASCS Virtual + * Machine. For e.g. NFS on AFS Shared Storage. + * + * @return the storageDetails value. + */ + public List storageDetails() { + return this.storageDetails; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (storageDetails() != null) { + storageDetails().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ConfigurationType.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ConfigurationType.java new file mode 100644 index 0000000000000..8ee6eb606452f --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ConfigurationType.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The type of file share config. */ +public final class ConfigurationType extends ExpandableStringEnum { + /** Static value Skip for ConfigurationType. */ + public static final ConfigurationType SKIP = fromString("Skip"); + + /** Static value CreateAndMount for ConfigurationType. */ + public static final ConfigurationType CREATE_AND_MOUNT = fromString("CreateAndMount"); + + /** Static value Mount for ConfigurationType. */ + public static final ConfigurationType MOUNT = fromString("Mount"); + + /** + * Creates a new instance of ConfigurationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ConfigurationType() { + } + + /** + * Creates or finds a ConfigurationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConfigurationType. + */ + @JsonCreator + public static ConfigurationType fromString(String name) { + return fromString(name, ConfigurationType.class); + } + + /** + * Gets known ConfigurationType values. + * + * @return known ConfigurationType values. + */ + public static Collection values() { + return values(ConfigurationType.class); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/CreateAndMountFileShareConfiguration.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/CreateAndMountFileShareConfiguration.java new file mode 100644 index 0000000000000..adcb10db1a16f --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/CreateAndMountFileShareConfiguration.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Gets or sets the file share configuration where the transport directory fileshare is created and mounted as a part of + * the create infra flow. Please pre-create the resource group you intend to place the transport directory in. The + * storage account and fileshare will be auto-created by the ACSS and doesn't need to be pre-created. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "configurationType") +@JsonTypeName("CreateAndMount") +@Fluent +public final class CreateAndMountFileShareConfiguration extends FileShareConfiguration { + /* + * The name of transport file share resource group. This should be pre created by the customer. The app rg is used + * in case of missing input. + */ + @JsonProperty(value = "resourceGroup") + private String resourceGroup; + + /* + * The name of file share storage account name . A custom name is used in case of missing input. + */ + @JsonProperty(value = "storageAccountName") + private String storageAccountName; + + /** Creates an instance of CreateAndMountFileShareConfiguration class. */ + public CreateAndMountFileShareConfiguration() { + } + + /** + * Get the resourceGroup property: The name of transport file share resource group. This should be pre created by + * the customer. The app rg is used in case of missing input. + * + * @return the resourceGroup value. + */ + public String resourceGroup() { + return this.resourceGroup; + } + + /** + * Set the resourceGroup property: The name of transport file share resource group. This should be pre created by + * the customer. The app rg is used in case of missing input. + * + * @param resourceGroup the resourceGroup value to set. + * @return the CreateAndMountFileShareConfiguration object itself. + */ + public CreateAndMountFileShareConfiguration withResourceGroup(String resourceGroup) { + this.resourceGroup = resourceGroup; + return this; + } + + /** + * Get the storageAccountName property: The name of file share storage account name . A custom name is used in case + * of missing input. + * + * @return the storageAccountName value. + */ + public String storageAccountName() { + return this.storageAccountName; + } + + /** + * Set the storageAccountName property: The name of file share storage account name . A custom name is used in case + * of missing input. + * + * @param storageAccountName the storageAccountName value to set. + * @return the CreateAndMountFileShareConfiguration object itself. + */ + public CreateAndMountFileShareConfiguration withStorageAccountName(String storageAccountName) { + this.storageAccountName = storageAccountName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/DatabaseConfiguration.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/DatabaseConfiguration.java new file mode 100644 index 0000000000000..e38440c82fa41 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/DatabaseConfiguration.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Gets or sets the database configuration. */ +@Fluent +public final class DatabaseConfiguration { + /* + * The database type. + */ + @JsonProperty(value = "databaseType") + private SapDatabaseType databaseType; + + /* + * The subnet id. + */ + @JsonProperty(value = "subnetId", required = true) + private String subnetId; + + /* + * Gets or sets the virtual machine configuration. + */ + @JsonProperty(value = "virtualMachineConfiguration", required = true) + private VirtualMachineConfiguration virtualMachineConfiguration; + + /* + * The number of database VMs. + */ + @JsonProperty(value = "instanceCount", required = true) + private long instanceCount; + + /* + * Gets or sets the disk configuration. + */ + @JsonProperty(value = "diskConfiguration") + private DiskConfiguration diskConfiguration; + + /** Creates an instance of DatabaseConfiguration class. */ + public DatabaseConfiguration() { + } + + /** + * Get the databaseType property: The database type. + * + * @return the databaseType value. + */ + public SapDatabaseType databaseType() { + return this.databaseType; + } + + /** + * Set the databaseType property: The database type. + * + * @param databaseType the databaseType value to set. + * @return the DatabaseConfiguration object itself. + */ + public DatabaseConfiguration withDatabaseType(SapDatabaseType databaseType) { + this.databaseType = databaseType; + return this; + } + + /** + * Get the subnetId property: The subnet id. + * + * @return the subnetId value. + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set the subnetId property: The subnet id. + * + * @param subnetId the subnetId value to set. + * @return the DatabaseConfiguration object itself. + */ + public DatabaseConfiguration withSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + + /** + * Get the virtualMachineConfiguration property: Gets or sets the virtual machine configuration. + * + * @return the virtualMachineConfiguration value. + */ + public VirtualMachineConfiguration virtualMachineConfiguration() { + return this.virtualMachineConfiguration; + } + + /** + * Set the virtualMachineConfiguration property: Gets or sets the virtual machine configuration. + * + * @param virtualMachineConfiguration the virtualMachineConfiguration value to set. + * @return the DatabaseConfiguration object itself. + */ + public DatabaseConfiguration withVirtualMachineConfiguration( + VirtualMachineConfiguration virtualMachineConfiguration) { + this.virtualMachineConfiguration = virtualMachineConfiguration; + return this; + } + + /** + * Get the instanceCount property: The number of database VMs. + * + * @return the instanceCount value. + */ + public long instanceCount() { + return this.instanceCount; + } + + /** + * Set the instanceCount property: The number of database VMs. + * + * @param instanceCount the instanceCount value to set. + * @return the DatabaseConfiguration object itself. + */ + public DatabaseConfiguration withInstanceCount(long instanceCount) { + this.instanceCount = instanceCount; + return this; + } + + /** + * Get the diskConfiguration property: Gets or sets the disk configuration. + * + * @return the diskConfiguration value. + */ + public DiskConfiguration diskConfiguration() { + return this.diskConfiguration; + } + + /** + * Set the diskConfiguration property: Gets or sets the disk configuration. + * + * @param diskConfiguration the diskConfiguration value to set. + * @return the DatabaseConfiguration object itself. + */ + public DatabaseConfiguration withDiskConfiguration(DiskConfiguration diskConfiguration) { + this.diskConfiguration = diskConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subnetId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property subnetId in model DatabaseConfiguration")); + } + if (virtualMachineConfiguration() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property virtualMachineConfiguration in model DatabaseConfiguration")); + } else { + virtualMachineConfiguration().validate(); + } + if (diskConfiguration() != null) { + diskConfiguration().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DatabaseConfiguration.class); +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/DatabaseServerFullResourceNames.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/DatabaseServerFullResourceNames.java new file mode 100644 index 0000000000000..fff9b504d1209 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/DatabaseServerFullResourceNames.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The full resource names object for database layer resources. The number of entries in this list should be equal to + * the number VMs to be created for database layer. + */ +@Fluent +public final class DatabaseServerFullResourceNames { + /* + * The list of virtual machine naming details. + */ + @JsonProperty(value = "virtualMachines") + private List virtualMachines; + + /* + * The full name for availability set. In case name is not provided, it will be defaulted to {SID}-DB-AvSet. + */ + @JsonProperty(value = "availabilitySetName") + private String availabilitySetName; + + /* + * The resource names object for load balancer and related resources. + */ + @JsonProperty(value = "loadBalancer") + private LoadBalancerResourceNames loadBalancer; + + /** Creates an instance of DatabaseServerFullResourceNames class. */ + public DatabaseServerFullResourceNames() { + } + + /** + * Get the virtualMachines property: The list of virtual machine naming details. + * + * @return the virtualMachines value. + */ + public List virtualMachines() { + return this.virtualMachines; + } + + /** + * Set the virtualMachines property: The list of virtual machine naming details. + * + * @param virtualMachines the virtualMachines value to set. + * @return the DatabaseServerFullResourceNames object itself. + */ + public DatabaseServerFullResourceNames withVirtualMachines(List virtualMachines) { + this.virtualMachines = virtualMachines; + return this; + } + + /** + * Get the availabilitySetName property: The full name for availability set. In case name is not provided, it will + * be defaulted to {SID}-DB-AvSet. + * + * @return the availabilitySetName value. + */ + public String availabilitySetName() { + return this.availabilitySetName; + } + + /** + * Set the availabilitySetName property: The full name for availability set. In case name is not provided, it will + * be defaulted to {SID}-DB-AvSet. + * + * @param availabilitySetName the availabilitySetName value to set. + * @return the DatabaseServerFullResourceNames object itself. + */ + public DatabaseServerFullResourceNames withAvailabilitySetName(String availabilitySetName) { + this.availabilitySetName = availabilitySetName; + return this; + } + + /** + * Get the loadBalancer property: The resource names object for load balancer and related resources. + * + * @return the loadBalancer value. + */ + public LoadBalancerResourceNames loadBalancer() { + return this.loadBalancer; + } + + /** + * Set the loadBalancer property: The resource names object for load balancer and related resources. + * + * @param loadBalancer the loadBalancer value to set. + * @return the DatabaseServerFullResourceNames object itself. + */ + public DatabaseServerFullResourceNames withLoadBalancer(LoadBalancerResourceNames loadBalancer) { + this.loadBalancer = loadBalancer; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (virtualMachines() != null) { + virtualMachines().forEach(e -> e.validate()); + } + if (loadBalancer() != null) { + loadBalancer().validate(); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/DatabaseVmDetails.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/DatabaseVmDetails.java new file mode 100644 index 0000000000000..735e9f81aa8a1 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/DatabaseVmDetails.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Database VM details. */ +@Immutable +public final class DatabaseVmDetails { + /* + * The virtualMachineId property. + */ + @JsonProperty(value = "virtualMachineId", access = JsonProperty.Access.WRITE_ONLY) + private String virtualMachineId; + + /* + * Defines the SAP Instance status. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private SapVirtualInstanceStatus status; + + /* + * Storage details of all the Storage Accounts attached to the Database Virtual Machine. For e.g. NFS on AFS Shared + * Storage. + */ + @JsonProperty(value = "storageDetails", access = JsonProperty.Access.WRITE_ONLY) + private List storageDetails; + + /** Creates an instance of DatabaseVmDetails class. */ + public DatabaseVmDetails() { + } + + /** + * Get the virtualMachineId property: The virtualMachineId property. + * + * @return the virtualMachineId value. + */ + public String virtualMachineId() { + return this.virtualMachineId; + } + + /** + * Get the status property: Defines the SAP Instance status. + * + * @return the status value. + */ + public SapVirtualInstanceStatus status() { + return this.status; + } + + /** + * Get the storageDetails property: Storage details of all the Storage Accounts attached to the Database Virtual + * Machine. For e.g. NFS on AFS Shared Storage. + * + * @return the storageDetails value. + */ + public List storageDetails() { + return this.storageDetails; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (storageDetails() != null) { + storageDetails().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/DeployerVmPackages.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/DeployerVmPackages.java new file mode 100644 index 0000000000000..c7d51c6f957eb --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/DeployerVmPackages.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the url and storage account ID where deployer VM packages are uploaded. */ +@Fluent +public final class DeployerVmPackages { + /* + * The URL to the deployer VM packages file. + */ + @JsonProperty(value = "url") + private String url; + + /* + * The deployer VM packages storage account id + */ + @JsonProperty(value = "storageAccountId") + private String storageAccountId; + + /** Creates an instance of DeployerVmPackages class. */ + public DeployerVmPackages() { + } + + /** + * Get the url property: The URL to the deployer VM packages file. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Set the url property: The URL to the deployer VM packages file. + * + * @param url the url value to set. + * @return the DeployerVmPackages object itself. + */ + public DeployerVmPackages withUrl(String url) { + this.url = url; + return this; + } + + /** + * Get the storageAccountId property: The deployer VM packages storage account id. + * + * @return the storageAccountId value. + */ + public String storageAccountId() { + return this.storageAccountId; + } + + /** + * Set the storageAccountId property: The deployer VM packages storage account id. + * + * @param storageAccountId the storageAccountId value to set. + * @return the DeployerVmPackages object itself. + */ + public DeployerVmPackages withStorageAccountId(String storageAccountId) { + this.storageAccountId = storageAccountId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/DeploymentConfiguration.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/DeploymentConfiguration.java new file mode 100644 index 0000000000000..5715a341bb4c2 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/DeploymentConfiguration.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Deployment Configuration. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "configurationType") +@JsonTypeName("Deployment") +@Fluent +public final class DeploymentConfiguration extends SapConfiguration { + /* + * The geo-location where the SAP system is to be created. + */ + @JsonProperty(value = "appLocation") + private String appLocation; + + /* + * The infrastructure configuration. + */ + @JsonProperty(value = "infrastructureConfiguration") + private InfrastructureConfiguration infrastructureConfiguration; + + /* + * The software configuration. + */ + @JsonProperty(value = "softwareConfiguration") + private SoftwareConfiguration softwareConfiguration; + + /** Creates an instance of DeploymentConfiguration class. */ + public DeploymentConfiguration() { + } + + /** + * Get the appLocation property: The geo-location where the SAP system is to be created. + * + * @return the appLocation value. + */ + public String appLocation() { + return this.appLocation; + } + + /** + * Set the appLocation property: The geo-location where the SAP system is to be created. + * + * @param appLocation the appLocation value to set. + * @return the DeploymentConfiguration object itself. + */ + public DeploymentConfiguration withAppLocation(String appLocation) { + this.appLocation = appLocation; + return this; + } + + /** + * Get the infrastructureConfiguration property: The infrastructure configuration. + * + * @return the infrastructureConfiguration value. + */ + public InfrastructureConfiguration infrastructureConfiguration() { + return this.infrastructureConfiguration; + } + + /** + * Set the infrastructureConfiguration property: The infrastructure configuration. + * + * @param infrastructureConfiguration the infrastructureConfiguration value to set. + * @return the DeploymentConfiguration object itself. + */ + public DeploymentConfiguration withInfrastructureConfiguration( + InfrastructureConfiguration infrastructureConfiguration) { + this.infrastructureConfiguration = infrastructureConfiguration; + return this; + } + + /** + * Get the softwareConfiguration property: The software configuration. + * + * @return the softwareConfiguration value. + */ + public SoftwareConfiguration softwareConfiguration() { + return this.softwareConfiguration; + } + + /** + * Set the softwareConfiguration property: The software configuration. + * + * @param softwareConfiguration the softwareConfiguration value to set. + * @return the DeploymentConfiguration object itself. + */ + public DeploymentConfiguration withSoftwareConfiguration(SoftwareConfiguration softwareConfiguration) { + this.softwareConfiguration = softwareConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (infrastructureConfiguration() != null) { + infrastructureConfiguration().validate(); + } + if (softwareConfiguration() != null) { + softwareConfiguration().validate(); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/DeploymentWithOSConfiguration.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/DeploymentWithOSConfiguration.java new file mode 100644 index 0000000000000..111300a764592 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/DeploymentWithOSConfiguration.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Deployment along with OS Configuration. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "configurationType") +@JsonTypeName("DeploymentWithOSConfig") +@Fluent +public final class DeploymentWithOSConfiguration extends SapConfiguration { + /* + * The geo-location where the SAP system is to be created. + */ + @JsonProperty(value = "appLocation") + private String appLocation; + + /* + * The infrastructure configuration. + */ + @JsonProperty(value = "infrastructureConfiguration") + private InfrastructureConfiguration infrastructureConfiguration; + + /* + * The software configuration. + */ + @JsonProperty(value = "softwareConfiguration") + private SoftwareConfiguration softwareConfiguration; + + /* + * The OS and SAP configuration. + */ + @JsonProperty(value = "osSapConfiguration") + private OsSapConfiguration osSapConfiguration; + + /** Creates an instance of DeploymentWithOSConfiguration class. */ + public DeploymentWithOSConfiguration() { + } + + /** + * Get the appLocation property: The geo-location where the SAP system is to be created. + * + * @return the appLocation value. + */ + public String appLocation() { + return this.appLocation; + } + + /** + * Set the appLocation property: The geo-location where the SAP system is to be created. + * + * @param appLocation the appLocation value to set. + * @return the DeploymentWithOSConfiguration object itself. + */ + public DeploymentWithOSConfiguration withAppLocation(String appLocation) { + this.appLocation = appLocation; + return this; + } + + /** + * Get the infrastructureConfiguration property: The infrastructure configuration. + * + * @return the infrastructureConfiguration value. + */ + public InfrastructureConfiguration infrastructureConfiguration() { + return this.infrastructureConfiguration; + } + + /** + * Set the infrastructureConfiguration property: The infrastructure configuration. + * + * @param infrastructureConfiguration the infrastructureConfiguration value to set. + * @return the DeploymentWithOSConfiguration object itself. + */ + public DeploymentWithOSConfiguration withInfrastructureConfiguration( + InfrastructureConfiguration infrastructureConfiguration) { + this.infrastructureConfiguration = infrastructureConfiguration; + return this; + } + + /** + * Get the softwareConfiguration property: The software configuration. + * + * @return the softwareConfiguration value. + */ + public SoftwareConfiguration softwareConfiguration() { + return this.softwareConfiguration; + } + + /** + * Set the softwareConfiguration property: The software configuration. + * + * @param softwareConfiguration the softwareConfiguration value to set. + * @return the DeploymentWithOSConfiguration object itself. + */ + public DeploymentWithOSConfiguration withSoftwareConfiguration(SoftwareConfiguration softwareConfiguration) { + this.softwareConfiguration = softwareConfiguration; + return this; + } + + /** + * Get the osSapConfiguration property: The OS and SAP configuration. + * + * @return the osSapConfiguration value. + */ + public OsSapConfiguration osSapConfiguration() { + return this.osSapConfiguration; + } + + /** + * Set the osSapConfiguration property: The OS and SAP configuration. + * + * @param osSapConfiguration the osSapConfiguration value to set. + * @return the DeploymentWithOSConfiguration object itself. + */ + public DeploymentWithOSConfiguration withOsSapConfiguration(OsSapConfiguration osSapConfiguration) { + this.osSapConfiguration = osSapConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (infrastructureConfiguration() != null) { + infrastructureConfiguration().validate(); + } + if (softwareConfiguration() != null) { + softwareConfiguration().validate(); + } + if (osSapConfiguration() != null) { + osSapConfiguration().validate(); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/DiscoveryConfiguration.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/DiscoveryConfiguration.java new file mode 100644 index 0000000000000..d9c96a3d28fd2 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/DiscoveryConfiguration.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Discovery Details. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "configurationType") +@JsonTypeName("Discovery") +@Fluent +public final class DiscoveryConfiguration extends SapConfiguration { + /* + * The virtual machine ID of the Central Server. + */ + @JsonProperty(value = "centralServerVmId") + private String centralServerVmId; + + /* + * The custom storage account name for the storage account created by the service in the managed resource group + * created as part of VIS deployment.

Refer to the storage account naming rules + * [here](https://learn.microsoft.com/azure/azure-resource-manager/management/resource-name-rules#microsoftstorage).

If + * not provided, the service will create the storage account with a random name. + */ + @JsonProperty(value = "managedRgStorageAccountName") + private String managedRgStorageAccountName; + + /* + * The geo-location where the SAP system exists. + */ + @JsonProperty(value = "appLocation", access = JsonProperty.Access.WRITE_ONLY) + private String appLocation; + + /** Creates an instance of DiscoveryConfiguration class. */ + public DiscoveryConfiguration() { + } + + /** + * Get the centralServerVmId property: The virtual machine ID of the Central Server. + * + * @return the centralServerVmId value. + */ + public String centralServerVmId() { + return this.centralServerVmId; + } + + /** + * Set the centralServerVmId property: The virtual machine ID of the Central Server. + * + * @param centralServerVmId the centralServerVmId value to set. + * @return the DiscoveryConfiguration object itself. + */ + public DiscoveryConfiguration withCentralServerVmId(String centralServerVmId) { + this.centralServerVmId = centralServerVmId; + return this; + } + + /** + * Get the managedRgStorageAccountName property: The custom storage account name for the storage account created by + * the service in the managed resource group created as part of VIS deployment.<br><br>Refer to the + * storage account naming rules + * [here](https://learn.microsoft.com/azure/azure-resource-manager/management/resource-name-rules#microsoftstorage).<br><br>If + * not provided, the service will create the storage account with a random name. + * + * @return the managedRgStorageAccountName value. + */ + public String managedRgStorageAccountName() { + return this.managedRgStorageAccountName; + } + + /** + * Set the managedRgStorageAccountName property: The custom storage account name for the storage account created by + * the service in the managed resource group created as part of VIS deployment.<br><br>Refer to the + * storage account naming rules + * [here](https://learn.microsoft.com/azure/azure-resource-manager/management/resource-name-rules#microsoftstorage).<br><br>If + * not provided, the service will create the storage account with a random name. + * + * @param managedRgStorageAccountName the managedRgStorageAccountName value to set. + * @return the DiscoveryConfiguration object itself. + */ + public DiscoveryConfiguration withManagedRgStorageAccountName(String managedRgStorageAccountName) { + this.managedRgStorageAccountName = managedRgStorageAccountName; + return this; + } + + /** + * Get the appLocation property: The geo-location where the SAP system exists. + * + * @return the appLocation value. + */ + public String appLocation() { + return this.appLocation; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/DiskConfiguration.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/DiskConfiguration.java new file mode 100644 index 0000000000000..36d022729f1fa --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/DiskConfiguration.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** The Disk Configuration Details. */ +@Fluent +public final class DiskConfiguration { + /* + * The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', 'hana/log', + * hana/shared', 'usr/sap', 'os'], Optional volume : ['backup']. + */ + @JsonProperty(value = "diskVolumeConfigurations") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map diskVolumeConfigurations; + + /** Creates an instance of DiskConfiguration class. */ + public DiskConfiguration() { + } + + /** + * Get the diskVolumeConfigurations property: The disk configuration for the db volume. For HANA, Required volumes + * are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os'], Optional volume : ['backup']. + * + * @return the diskVolumeConfigurations value. + */ + public Map diskVolumeConfigurations() { + return this.diskVolumeConfigurations; + } + + /** + * Set the diskVolumeConfigurations property: The disk configuration for the db volume. For HANA, Required volumes + * are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os'], Optional volume : ['backup']. + * + * @param diskVolumeConfigurations the diskVolumeConfigurations value to set. + * @return the DiskConfiguration object itself. + */ + public DiskConfiguration withDiskVolumeConfigurations( + Map diskVolumeConfigurations) { + this.diskVolumeConfigurations = diskVolumeConfigurations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (diskVolumeConfigurations() != null) { + diskVolumeConfigurations() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/DiskDetails.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/DiskDetails.java new file mode 100644 index 0000000000000..9b71bedc8746f --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/DiskDetails.java @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The supported disk size details for a disk type. */ +@Fluent +public final class DiskDetails { + /* + * The type of disk sku. For example, Standard_LRS, Standard_ZRS, Premium_LRS, Premium_ZRS. + */ + @JsonProperty(value = "sku") + private DiskSku sku; + + /* + * The disk size in GB. + */ + @JsonProperty(value = "sizeGB") + private Long sizeGB; + + /* + * The minimum supported disk count. + */ + @JsonProperty(value = "minimumSupportedDiskCount") + private Long minimumSupportedDiskCount; + + /* + * The maximum supported disk count. + */ + @JsonProperty(value = "maximumSupportedDiskCount") + private Long maximumSupportedDiskCount; + + /* + * The disk Iops. + */ + @JsonProperty(value = "iopsReadWrite") + private Long iopsReadWrite; + + /* + * The disk provisioned throughput in MBps. + */ + @JsonProperty(value = "mbpsReadWrite") + private Long mbpsReadWrite; + + /* + * The disk tier, e.g. P10, E10. + */ + @JsonProperty(value = "diskTier") + private String diskTier; + + /** Creates an instance of DiskDetails class. */ + public DiskDetails() { + } + + /** + * Get the sku property: The type of disk sku. For example, Standard_LRS, Standard_ZRS, Premium_LRS, Premium_ZRS. + * + * @return the sku value. + */ + public DiskSku sku() { + return this.sku; + } + + /** + * Set the sku property: The type of disk sku. For example, Standard_LRS, Standard_ZRS, Premium_LRS, Premium_ZRS. + * + * @param sku the sku value to set. + * @return the DiskDetails object itself. + */ + public DiskDetails withSku(DiskSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the sizeGB property: The disk size in GB. + * + * @return the sizeGB value. + */ + public Long sizeGB() { + return this.sizeGB; + } + + /** + * Set the sizeGB property: The disk size in GB. + * + * @param sizeGB the sizeGB value to set. + * @return the DiskDetails object itself. + */ + public DiskDetails withSizeGB(Long sizeGB) { + this.sizeGB = sizeGB; + return this; + } + + /** + * Get the minimumSupportedDiskCount property: The minimum supported disk count. + * + * @return the minimumSupportedDiskCount value. + */ + public Long minimumSupportedDiskCount() { + return this.minimumSupportedDiskCount; + } + + /** + * Set the minimumSupportedDiskCount property: The minimum supported disk count. + * + * @param minimumSupportedDiskCount the minimumSupportedDiskCount value to set. + * @return the DiskDetails object itself. + */ + public DiskDetails withMinimumSupportedDiskCount(Long minimumSupportedDiskCount) { + this.minimumSupportedDiskCount = minimumSupportedDiskCount; + return this; + } + + /** + * Get the maximumSupportedDiskCount property: The maximum supported disk count. + * + * @return the maximumSupportedDiskCount value. + */ + public Long maximumSupportedDiskCount() { + return this.maximumSupportedDiskCount; + } + + /** + * Set the maximumSupportedDiskCount property: The maximum supported disk count. + * + * @param maximumSupportedDiskCount the maximumSupportedDiskCount value to set. + * @return the DiskDetails object itself. + */ + public DiskDetails withMaximumSupportedDiskCount(Long maximumSupportedDiskCount) { + this.maximumSupportedDiskCount = maximumSupportedDiskCount; + return this; + } + + /** + * Get the iopsReadWrite property: The disk Iops. + * + * @return the iopsReadWrite value. + */ + public Long iopsReadWrite() { + return this.iopsReadWrite; + } + + /** + * Set the iopsReadWrite property: The disk Iops. + * + * @param iopsReadWrite the iopsReadWrite value to set. + * @return the DiskDetails object itself. + */ + public DiskDetails withIopsReadWrite(Long iopsReadWrite) { + this.iopsReadWrite = iopsReadWrite; + return this; + } + + /** + * Get the mbpsReadWrite property: The disk provisioned throughput in MBps. + * + * @return the mbpsReadWrite value. + */ + public Long mbpsReadWrite() { + return this.mbpsReadWrite; + } + + /** + * Set the mbpsReadWrite property: The disk provisioned throughput in MBps. + * + * @param mbpsReadWrite the mbpsReadWrite value to set. + * @return the DiskDetails object itself. + */ + public DiskDetails withMbpsReadWrite(Long mbpsReadWrite) { + this.mbpsReadWrite = mbpsReadWrite; + return this; + } + + /** + * Get the diskTier property: The disk tier, e.g. P10, E10. + * + * @return the diskTier value. + */ + public String diskTier() { + return this.diskTier; + } + + /** + * Set the diskTier property: The disk tier, e.g. P10, E10. + * + * @param diskTier the diskTier value to set. + * @return the DiskDetails object itself. + */ + public DiskDetails withDiskTier(String diskTier) { + this.diskTier = diskTier; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/DiskSku.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/DiskSku.java new file mode 100644 index 0000000000000..99c8b2aa4220c --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/DiskSku.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The type of disk sku. For example, Standard_LRS, Standard_ZRS, Premium_LRS, Premium_ZRS. */ +@Fluent +public final class DiskSku { + /* + * Defines the disk sku name. + */ + @JsonProperty(value = "name") + private DiskSkuName name; + + /** Creates an instance of DiskSku class. */ + public DiskSku() { + } + + /** + * Get the name property: Defines the disk sku name. + * + * @return the name value. + */ + public DiskSkuName name() { + return this.name; + } + + /** + * Set the name property: Defines the disk sku name. + * + * @param name the name value to set. + * @return the DiskSku object itself. + */ + public DiskSku withName(DiskSkuName name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/DiskSkuName.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/DiskSkuName.java new file mode 100644 index 0000000000000..16aa953fbf24c --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/DiskSkuName.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines the disk sku name. */ +public final class DiskSkuName extends ExpandableStringEnum { + /** Static value Standard_LRS for DiskSkuName. */ + public static final DiskSkuName STANDARD_LRS = fromString("Standard_LRS"); + + /** Static value Premium_LRS for DiskSkuName. */ + public static final DiskSkuName PREMIUM_LRS = fromString("Premium_LRS"); + + /** Static value StandardSSD_LRS for DiskSkuName. */ + public static final DiskSkuName STANDARD_SSD_LRS = fromString("StandardSSD_LRS"); + + /** Static value UltraSSD_LRS for DiskSkuName. */ + public static final DiskSkuName ULTRA_SSD_LRS = fromString("UltraSSD_LRS"); + + /** Static value Premium_ZRS for DiskSkuName. */ + public static final DiskSkuName PREMIUM_ZRS = fromString("Premium_ZRS"); + + /** Static value StandardSSD_ZRS for DiskSkuName. */ + public static final DiskSkuName STANDARD_SSD_ZRS = fromString("StandardSSD_ZRS"); + + /** Static value PremiumV2_LRS for DiskSkuName. */ + public static final DiskSkuName PREMIUM_V2_LRS = fromString("PremiumV2_LRS"); + + /** + * Creates a new instance of DiskSkuName value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DiskSkuName() { + } + + /** + * Creates or finds a DiskSkuName from its string representation. + * + * @param name a name to look for. + * @return the corresponding DiskSkuName. + */ + @JsonCreator + public static DiskSkuName fromString(String name) { + return fromString(name, DiskSkuName.class); + } + + /** + * Gets known DiskSkuName values. + * + * @return known DiskSkuName values. + */ + public static Collection values() { + return values(DiskSkuName.class); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/DiskVolumeConfiguration.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/DiskVolumeConfiguration.java new file mode 100644 index 0000000000000..89c816650589b --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/DiskVolumeConfiguration.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The disk configuration required for the selected volume. */ +@Fluent +public final class DiskVolumeConfiguration { + /* + * The total number of disks required for the concerned volume. + */ + @JsonProperty(value = "count") + private Long count; + + /* + * The disk size in GB. + */ + @JsonProperty(value = "sizeGB") + private Long sizeGB; + + /* + * The disk SKU details. + */ + @JsonProperty(value = "sku") + private DiskSku sku; + + /** Creates an instance of DiskVolumeConfiguration class. */ + public DiskVolumeConfiguration() { + } + + /** + * Get the count property: The total number of disks required for the concerned volume. + * + * @return the count value. + */ + public Long count() { + return this.count; + } + + /** + * Set the count property: The total number of disks required for the concerned volume. + * + * @param count the count value to set. + * @return the DiskVolumeConfiguration object itself. + */ + public DiskVolumeConfiguration withCount(Long count) { + this.count = count; + return this; + } + + /** + * Get the sizeGB property: The disk size in GB. + * + * @return the sizeGB value. + */ + public Long sizeGB() { + return this.sizeGB; + } + + /** + * Set the sizeGB property: The disk size in GB. + * + * @param sizeGB the sizeGB value to set. + * @return the DiskVolumeConfiguration object itself. + */ + public DiskVolumeConfiguration withSizeGB(Long sizeGB) { + this.sizeGB = sizeGB; + return this; + } + + /** + * Get the sku property: The disk SKU details. + * + * @return the sku value. + */ + public DiskSku sku() { + return this.sku; + } + + /** + * Set the sku property: The disk SKU details. + * + * @param sku the sku value to set. + * @return the DiskVolumeConfiguration object itself. + */ + public DiskVolumeConfiguration withSku(DiskSku sku) { + this.sku = sku; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/EnqueueReplicationServerProperties.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/EnqueueReplicationServerProperties.java new file mode 100644 index 0000000000000..d7f22b7926c87 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/EnqueueReplicationServerProperties.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the SAP Enqueue Replication Server (ERS) properties. */ +@Immutable +public final class EnqueueReplicationServerProperties { + /* + * Defines the type of Enqueue Replication Server. + */ + @JsonProperty(value = "ersVersion", access = JsonProperty.Access.WRITE_ONLY) + private EnqueueReplicationServerType ersVersion; + + /* + * ERS Instance Number. + */ + @JsonProperty(value = "instanceNo", access = JsonProperty.Access.WRITE_ONLY) + private String instanceNo; + + /* + * ERS SAP Hostname. + */ + @JsonProperty(value = "hostname", access = JsonProperty.Access.WRITE_ONLY) + private String hostname; + + /* + * ERS SAP Kernel Version. + */ + @JsonProperty(value = "kernelVersion", access = JsonProperty.Access.WRITE_ONLY) + private String kernelVersion; + + /* + * ERS SAP Kernel Patch level. + */ + @JsonProperty(value = "kernelPatch", access = JsonProperty.Access.WRITE_ONLY) + private String kernelPatch; + + /* + * ERS SAP IP Address. + */ + @JsonProperty(value = "ipAddress", access = JsonProperty.Access.WRITE_ONLY) + private String ipAddress; + + /* + * Defines the health of SAP Instances. + */ + @JsonProperty(value = "health", access = JsonProperty.Access.WRITE_ONLY) + private SapHealthState health; + + /** Creates an instance of EnqueueReplicationServerProperties class. */ + public EnqueueReplicationServerProperties() { + } + + /** + * Get the ersVersion property: Defines the type of Enqueue Replication Server. + * + * @return the ersVersion value. + */ + public EnqueueReplicationServerType ersVersion() { + return this.ersVersion; + } + + /** + * Get the instanceNo property: ERS Instance Number. + * + * @return the instanceNo value. + */ + public String instanceNo() { + return this.instanceNo; + } + + /** + * Get the hostname property: ERS SAP Hostname. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Get the kernelVersion property: ERS SAP Kernel Version. + * + * @return the kernelVersion value. + */ + public String kernelVersion() { + return this.kernelVersion; + } + + /** + * Get the kernelPatch property: ERS SAP Kernel Patch level. + * + * @return the kernelPatch value. + */ + public String kernelPatch() { + return this.kernelPatch; + } + + /** + * Get the ipAddress property: ERS SAP IP Address. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Get the health property: Defines the health of SAP Instances. + * + * @return the health value. + */ + public SapHealthState health() { + return this.health; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/EnqueueReplicationServerType.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/EnqueueReplicationServerType.java new file mode 100644 index 0000000000000..f2f4dee715a0b --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/EnqueueReplicationServerType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines the type of Enqueue Replication Server. */ +public final class EnqueueReplicationServerType extends ExpandableStringEnum { + /** Static value EnqueueReplicator1 for EnqueueReplicationServerType. */ + public static final EnqueueReplicationServerType ENQUEUE_REPLICATOR1 = fromString("EnqueueReplicator1"); + + /** Static value EnqueueReplicator2 for EnqueueReplicationServerType. */ + public static final EnqueueReplicationServerType ENQUEUE_REPLICATOR2 = fromString("EnqueueReplicator2"); + + /** + * Creates a new instance of EnqueueReplicationServerType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EnqueueReplicationServerType() { + } + + /** + * Creates or finds a EnqueueReplicationServerType from its string representation. + * + * @param name a name to look for. + * @return the corresponding EnqueueReplicationServerType. + */ + @JsonCreator + public static EnqueueReplicationServerType fromString(String name) { + return fromString(name, EnqueueReplicationServerType.class); + } + + /** + * Gets known EnqueueReplicationServerType values. + * + * @return known EnqueueReplicationServerType values. + */ + public static Collection values() { + return values(EnqueueReplicationServerType.class); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/EnqueueServerProperties.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/EnqueueServerProperties.java new file mode 100644 index 0000000000000..11dee7d580f0b --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/EnqueueServerProperties.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the SAP Enqueue Server properties. */ +@Immutable +public final class EnqueueServerProperties { + /* + * Enqueue Server SAP Hostname. + */ + @JsonProperty(value = "hostname", access = JsonProperty.Access.WRITE_ONLY) + private String hostname; + + /* + * Enqueue Server SAP IP Address. + */ + @JsonProperty(value = "ipAddress", access = JsonProperty.Access.WRITE_ONLY) + private String ipAddress; + + /* + * Enqueue Server Port. + */ + @JsonProperty(value = "port", access = JsonProperty.Access.WRITE_ONLY) + private Long port; + + /* + * Defines the health of SAP Instances. + */ + @JsonProperty(value = "health", access = JsonProperty.Access.WRITE_ONLY) + private SapHealthState health; + + /** Creates an instance of EnqueueServerProperties class. */ + public EnqueueServerProperties() { + } + + /** + * Get the hostname property: Enqueue Server SAP Hostname. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Get the ipAddress property: Enqueue Server SAP IP Address. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Get the port property: Enqueue Server Port. + * + * @return the port value. + */ + public Long port() { + return this.port; + } + + /** + * Get the health property: Defines the health of SAP Instances. + * + * @return the health value. + */ + public SapHealthState health() { + return this.health; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ErrorDefinition.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ErrorDefinition.java new file mode 100644 index 0000000000000..d6f449ed1e9e0 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ErrorDefinition.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Error definition. */ +@Immutable +public final class ErrorDefinition { + /* + * Service specific error code which serves as the substatus for the HTTP error code. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /* + * Description of the error. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /* + * Internal error details. + */ + @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) + private List details; + + /** Creates an instance of ErrorDefinition class. */ + public ErrorDefinition() { + } + + /** + * Get the code property: Service specific error code which serves as the substatus for the HTTP error code. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Get the message property: Description of the error. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the details property: Internal error details. + * + * @return the details value. + */ + public List details() { + return this.details; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (details() != null) { + details().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ExternalInstallationSoftwareConfiguration.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ExternalInstallationSoftwareConfiguration.java new file mode 100644 index 0000000000000..f5e53044533ec --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ExternalInstallationSoftwareConfiguration.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The SAP Software configuration Input when the software is installed externally outside the service. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "softwareInstallationType") +@JsonTypeName("External") +@Fluent +public final class ExternalInstallationSoftwareConfiguration extends SoftwareConfiguration { + /* + * The resource ID of the virtual machine containing the central server instance. + */ + @JsonProperty(value = "centralServerVmId") + private String centralServerVmId; + + /** Creates an instance of ExternalInstallationSoftwareConfiguration class. */ + public ExternalInstallationSoftwareConfiguration() { + } + + /** + * Get the centralServerVmId property: The resource ID of the virtual machine containing the central server + * instance. + * + * @return the centralServerVmId value. + */ + public String centralServerVmId() { + return this.centralServerVmId; + } + + /** + * Set the centralServerVmId property: The resource ID of the virtual machine containing the central server + * instance. + * + * @param centralServerVmId the centralServerVmId value to set. + * @return the ExternalInstallationSoftwareConfiguration object itself. + */ + public ExternalInstallationSoftwareConfiguration withCentralServerVmId(String centralServerVmId) { + this.centralServerVmId = centralServerVmId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/FileShareConfiguration.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/FileShareConfiguration.java new file mode 100644 index 0000000000000..2ea2153288326 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/FileShareConfiguration.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * File Share configuration details, populated with information on storage configuration mounted on the VIS. The + * createAndMount option is selected in case of missing input. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "configurationType", + defaultImpl = FileShareConfiguration.class) +@JsonTypeName("FileShareConfiguration") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Skip", value = SkipFileShareConfiguration.class), + @JsonSubTypes.Type(name = "CreateAndMount", value = CreateAndMountFileShareConfiguration.class), + @JsonSubTypes.Type(name = "Mount", value = MountFileShareConfiguration.class) +}) +@Immutable +public class FileShareConfiguration { + /** Creates an instance of FileShareConfiguration class. */ + public FileShareConfiguration() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/GatewayServerProperties.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/GatewayServerProperties.java new file mode 100644 index 0000000000000..ea96bc4f12209 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/GatewayServerProperties.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the SAP Gateway Server properties. */ +@Immutable +public final class GatewayServerProperties { + /* + * Gateway Port. + */ + @JsonProperty(value = "port", access = JsonProperty.Access.WRITE_ONLY) + private Long port; + + /* + * Defines the health of SAP Instances. + */ + @JsonProperty(value = "health", access = JsonProperty.Access.WRITE_ONLY) + private SapHealthState health; + + /** Creates an instance of GatewayServerProperties class. */ + public GatewayServerProperties() { + } + + /** + * Get the port property: Gateway Port. + * + * @return the port value. + */ + public Long port() { + return this.port; + } + + /** + * Get the health property: Defines the health of SAP Instances. + * + * @return the health value. + */ + public SapHealthState health() { + return this.health; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/HighAvailabilityConfiguration.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/HighAvailabilityConfiguration.java new file mode 100644 index 0000000000000..9ae95b356cd1a --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/HighAvailabilityConfiguration.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Gets or sets the high availability configuration. */ +@Fluent +public final class HighAvailabilityConfiguration { + /* + * The high availability type. + */ + @JsonProperty(value = "highAvailabilityType", required = true) + private SapHighAvailabilityType highAvailabilityType; + + /** Creates an instance of HighAvailabilityConfiguration class. */ + public HighAvailabilityConfiguration() { + } + + /** + * Get the highAvailabilityType property: The high availability type. + * + * @return the highAvailabilityType value. + */ + public SapHighAvailabilityType highAvailabilityType() { + return this.highAvailabilityType; + } + + /** + * Set the highAvailabilityType property: The high availability type. + * + * @param highAvailabilityType the highAvailabilityType value to set. + * @return the HighAvailabilityConfiguration object itself. + */ + public HighAvailabilityConfiguration withHighAvailabilityType(SapHighAvailabilityType highAvailabilityType) { + this.highAvailabilityType = highAvailabilityType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (highAvailabilityType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property highAvailabilityType in model HighAvailabilityConfiguration")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HighAvailabilityConfiguration.class); +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/HighAvailabilitySoftwareConfiguration.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/HighAvailabilitySoftwareConfiguration.java new file mode 100644 index 0000000000000..e0f2b5d4f398e --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/HighAvailabilitySoftwareConfiguration.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Gets or sets the HA software configuration. */ +@Fluent +public final class HighAvailabilitySoftwareConfiguration { + /* + * The fencing client id. + */ + @JsonProperty(value = "fencingClientId", required = true) + private String fencingClientId; + + /* + * The fencing client id secret/password. The secret should never expire. This will be used pacemaker to start/stop + * the cluster VMs. + */ + @JsonProperty(value = "fencingClientPassword") + private String fencingClientPassword; + + /** Creates an instance of HighAvailabilitySoftwareConfiguration class. */ + public HighAvailabilitySoftwareConfiguration() { + } + + /** + * Get the fencingClientId property: The fencing client id. + * + * @return the fencingClientId value. + */ + public String fencingClientId() { + return this.fencingClientId; + } + + /** + * Set the fencingClientId property: The fencing client id. + * + * @param fencingClientId the fencingClientId value to set. + * @return the HighAvailabilitySoftwareConfiguration object itself. + */ + public HighAvailabilitySoftwareConfiguration withFencingClientId(String fencingClientId) { + this.fencingClientId = fencingClientId; + return this; + } + + /** + * Get the fencingClientPassword property: The fencing client id secret/password. The secret should never expire. + * This will be used pacemaker to start/stop the cluster VMs. + * + * @return the fencingClientPassword value. + */ + public String fencingClientPassword() { + return this.fencingClientPassword; + } + + /** + * Set the fencingClientPassword property: The fencing client id secret/password. The secret should never expire. + * This will be used pacemaker to start/stop the cluster VMs. + * + * @param fencingClientPassword the fencingClientPassword value to set. + * @return the HighAvailabilitySoftwareConfiguration object itself. + */ + public HighAvailabilitySoftwareConfiguration withFencingClientPassword(String fencingClientPassword) { + this.fencingClientPassword = fencingClientPassword; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (fencingClientId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property fencingClientId in model HighAvailabilitySoftwareConfiguration")); + } + if (fencingClientPassword() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property fencingClientPassword in model" + + " HighAvailabilitySoftwareConfiguration")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(HighAvailabilitySoftwareConfiguration.class); +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ImageReference.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ImageReference.java new file mode 100644 index 0000000000000..11b469a004233 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ImageReference.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies information about the image to use. You can specify information about platform images, marketplace images, + * or virtual machine images. This element is required when you want to use a platform image, marketplace image, or + * virtual machine image, but is not used in other creation operations. NOTE: Image reference publisher and offer can + * only be set when you create the scale set. + */ +@Fluent +public final class ImageReference { + /* + * The image publisher. + */ + @JsonProperty(value = "publisher") + private String publisher; + + /* + * Specifies the offer of the platform image or marketplace image used to create the virtual machine. + */ + @JsonProperty(value = "offer") + private String offer; + + /* + * The image SKU. + */ + @JsonProperty(value = "sku") + private String sku; + + /* + * Specifies the version of the platform image or marketplace image used to create the virtual machine. The allowed + * formats are Major.Minor.Build or 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' to use + * the latest version of an image available at deploy time. Even if you use 'latest', the VM image will not + * automatically update after deploy time even if a new version becomes available. + */ + @JsonProperty(value = "version") + private String version; + + /* + * Specifies the ARM resource ID of the Azure Compute Gallery image version used for creating ACSS VMs. You will + * need to provide this input when you choose to deploy virtual machines in ACSS with OS image from the Azure + * Compute gallery. + */ + @JsonProperty(value = "id") + private String id; + + /** Creates an instance of ImageReference class. */ + public ImageReference() { + } + + /** + * Get the publisher property: The image publisher. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: The image publisher. + * + * @param publisher the publisher value to set. + * @return the ImageReference object itself. + */ + public ImageReference withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the offer property: Specifies the offer of the platform image or marketplace image used to create the virtual + * machine. + * + * @return the offer value. + */ + public String offer() { + return this.offer; + } + + /** + * Set the offer property: Specifies the offer of the platform image or marketplace image used to create the virtual + * machine. + * + * @param offer the offer value to set. + * @return the ImageReference object itself. + */ + public ImageReference withOffer(String offer) { + this.offer = offer; + return this; + } + + /** + * Get the sku property: The image SKU. + * + * @return the sku value. + */ + public String sku() { + return this.sku; + } + + /** + * Set the sku property: The image SKU. + * + * @param sku the sku value to set. + * @return the ImageReference object itself. + */ + public ImageReference withSku(String sku) { + this.sku = sku; + return this; + } + + /** + * Get the version property: Specifies the version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. Major, Minor, and Build are decimal + * numbers. Specify 'latest' to use the latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even if a new version becomes available. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: Specifies the version of the platform image or marketplace image used to create the + * virtual machine. The allowed formats are Major.Minor.Build or 'latest'. Major, Minor, and Build are decimal + * numbers. Specify 'latest' to use the latest version of an image available at deploy time. Even if you use + * 'latest', the VM image will not automatically update after deploy time even if a new version becomes available. + * + * @param version the version value to set. + * @return the ImageReference object itself. + */ + public ImageReference withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the id property: Specifies the ARM resource ID of the Azure Compute Gallery image version used for creating + * ACSS VMs. You will need to provide this input when you choose to deploy virtual machines in ACSS with OS image + * from the Azure Compute gallery. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Specifies the ARM resource ID of the Azure Compute Gallery image version used for creating + * ACSS VMs. You will need to provide this input when you choose to deploy virtual machines in ACSS with OS image + * from the Azure Compute gallery. + * + * @param id the id value to set. + * @return the ImageReference object itself. + */ + public ImageReference withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/InfrastructureConfiguration.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/InfrastructureConfiguration.java new file mode 100644 index 0000000000000..92ca7fc5aae3f --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/InfrastructureConfiguration.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Deploy SAP Infrastructure Details. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "deploymentType", + defaultImpl = InfrastructureConfiguration.class) +@JsonTypeName("InfrastructureConfiguration") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "SingleServer", value = SingleServerConfiguration.class), + @JsonSubTypes.Type(name = "ThreeTier", value = ThreeTierConfiguration.class) +}) +@Fluent +public class InfrastructureConfiguration { + /* + * The application resource group where SAP system resources will be deployed. + */ + @JsonProperty(value = "appResourceGroup", required = true) + private String appResourceGroup; + + /** Creates an instance of InfrastructureConfiguration class. */ + public InfrastructureConfiguration() { + } + + /** + * Get the appResourceGroup property: The application resource group where SAP system resources will be deployed. + * + * @return the appResourceGroup value. + */ + public String appResourceGroup() { + return this.appResourceGroup; + } + + /** + * Set the appResourceGroup property: The application resource group where SAP system resources will be deployed. + * + * @param appResourceGroup the appResourceGroup value to set. + * @return the InfrastructureConfiguration object itself. + */ + public InfrastructureConfiguration withAppResourceGroup(String appResourceGroup) { + this.appResourceGroup = appResourceGroup; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (appResourceGroup() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property appResourceGroup in model InfrastructureConfiguration")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(InfrastructureConfiguration.class); +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/LinuxConfiguration.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/LinuxConfiguration.java new file mode 100644 index 0000000000000..f063a062f7b13 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/LinuxConfiguration.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Specifies the Linux operating system settings on the virtual machine. <br><br>For a list of supported + * Linux distributions, see [Linux on Azure-Endorsed + * Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros). + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "osType") +@JsonTypeName("Linux") +@Fluent +public final class LinuxConfiguration extends OSConfiguration { + /* + * Specifies whether password authentication should be disabled. + */ + @JsonProperty(value = "disablePasswordAuthentication") + private Boolean disablePasswordAuthentication; + + /* + * Specifies the ssh key configuration for a Linux OS. (This property is deprecated, please use 'sshKeyPair' + * instead) + */ + @JsonProperty(value = "ssh") + private SshConfiguration ssh; + + /* + * The SSH Key-pair used to authenticate with the VM's. + */ + @JsonProperty(value = "sshKeyPair") + private SshKeyPair sshKeyPair; + + /** Creates an instance of LinuxConfiguration class. */ + public LinuxConfiguration() { + } + + /** + * Get the disablePasswordAuthentication property: Specifies whether password authentication should be disabled. + * + * @return the disablePasswordAuthentication value. + */ + public Boolean disablePasswordAuthentication() { + return this.disablePasswordAuthentication; + } + + /** + * Set the disablePasswordAuthentication property: Specifies whether password authentication should be disabled. + * + * @param disablePasswordAuthentication the disablePasswordAuthentication value to set. + * @return the LinuxConfiguration object itself. + */ + public LinuxConfiguration withDisablePasswordAuthentication(Boolean disablePasswordAuthentication) { + this.disablePasswordAuthentication = disablePasswordAuthentication; + return this; + } + + /** + * Get the ssh property: Specifies the ssh key configuration for a Linux OS. (This property is deprecated, please + * use 'sshKeyPair' instead). + * + * @return the ssh value. + */ + public SshConfiguration ssh() { + return this.ssh; + } + + /** + * Set the ssh property: Specifies the ssh key configuration for a Linux OS. (This property is deprecated, please + * use 'sshKeyPair' instead). + * + * @param ssh the ssh value to set. + * @return the LinuxConfiguration object itself. + */ + public LinuxConfiguration withSsh(SshConfiguration ssh) { + this.ssh = ssh; + return this; + } + + /** + * Get the sshKeyPair property: The SSH Key-pair used to authenticate with the VM's. + * + * @return the sshKeyPair value. + */ + public SshKeyPair sshKeyPair() { + return this.sshKeyPair; + } + + /** + * Set the sshKeyPair property: The SSH Key-pair used to authenticate with the VM's. + * + * @param sshKeyPair the sshKeyPair value to set. + * @return the LinuxConfiguration object itself. + */ + public LinuxConfiguration withSshKeyPair(SshKeyPair sshKeyPair) { + this.sshKeyPair = sshKeyPair; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (ssh() != null) { + ssh().validate(); + } + if (sshKeyPair() != null) { + sshKeyPair().validate(); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/LoadBalancerDetails.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/LoadBalancerDetails.java new file mode 100644 index 0000000000000..cb971696ab096 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/LoadBalancerDetails.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Load Balancer details such as Load Balancer ID. */ +@Immutable +public final class LoadBalancerDetails { + /* + * The id property. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** Creates an instance of LoadBalancerDetails class. */ + public LoadBalancerDetails() { + } + + /** + * Get the id property: The id property. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/LoadBalancerResourceNames.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/LoadBalancerResourceNames.java new file mode 100644 index 0000000000000..9072a9e75620d --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/LoadBalancerResourceNames.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The resource names object for load balancer and related resources. */ +@Fluent +public final class LoadBalancerResourceNames { + /* + * The full resource name for load balancer. If this value is not provided, load balancer will be name as + * {ASCS/DB}-loadBalancer. + */ + @JsonProperty(value = "loadBalancerName") + private String loadBalancerName; + + /* + * The list of frontend IP configuration names. If provided as input, size of this list should be 2 for cs layer + * and should be 1 for database layer. + */ + @JsonProperty(value = "frontendIpConfigurationNames") + private List frontendIpConfigurationNames; + + /* + * The list of backend pool names. Currently, ACSS deploys only one backend pool and hence, size of this list + * should be 1 + */ + @JsonProperty(value = "backendPoolNames") + private List backendPoolNames; + + /* + * The list of health probe names. If provided as input, size of this list should be 2 for cs layer and should be 1 + * for database layer. + */ + @JsonProperty(value = "healthProbeNames") + private List healthProbeNames; + + /** Creates an instance of LoadBalancerResourceNames class. */ + public LoadBalancerResourceNames() { + } + + /** + * Get the loadBalancerName property: The full resource name for load balancer. If this value is not provided, load + * balancer will be name as {ASCS/DB}-loadBalancer. + * + * @return the loadBalancerName value. + */ + public String loadBalancerName() { + return this.loadBalancerName; + } + + /** + * Set the loadBalancerName property: The full resource name for load balancer. If this value is not provided, load + * balancer will be name as {ASCS/DB}-loadBalancer. + * + * @param loadBalancerName the loadBalancerName value to set. + * @return the LoadBalancerResourceNames object itself. + */ + public LoadBalancerResourceNames withLoadBalancerName(String loadBalancerName) { + this.loadBalancerName = loadBalancerName; + return this; + } + + /** + * Get the frontendIpConfigurationNames property: The list of frontend IP configuration names. If provided as input, + * size of this list should be 2 for cs layer and should be 1 for database layer. + * + * @return the frontendIpConfigurationNames value. + */ + public List frontendIpConfigurationNames() { + return this.frontendIpConfigurationNames; + } + + /** + * Set the frontendIpConfigurationNames property: The list of frontend IP configuration names. If provided as input, + * size of this list should be 2 for cs layer and should be 1 for database layer. + * + * @param frontendIpConfigurationNames the frontendIpConfigurationNames value to set. + * @return the LoadBalancerResourceNames object itself. + */ + public LoadBalancerResourceNames withFrontendIpConfigurationNames(List frontendIpConfigurationNames) { + this.frontendIpConfigurationNames = frontendIpConfigurationNames; + return this; + } + + /** + * Get the backendPoolNames property: The list of backend pool names. Currently, ACSS deploys only one backend pool + * and hence, size of this list should be 1. + * + * @return the backendPoolNames value. + */ + public List backendPoolNames() { + return this.backendPoolNames; + } + + /** + * Set the backendPoolNames property: The list of backend pool names. Currently, ACSS deploys only one backend pool + * and hence, size of this list should be 1. + * + * @param backendPoolNames the backendPoolNames value to set. + * @return the LoadBalancerResourceNames object itself. + */ + public LoadBalancerResourceNames withBackendPoolNames(List backendPoolNames) { + this.backendPoolNames = backendPoolNames; + return this; + } + + /** + * Get the healthProbeNames property: The list of health probe names. If provided as input, size of this list should + * be 2 for cs layer and should be 1 for database layer. + * + * @return the healthProbeNames value. + */ + public List healthProbeNames() { + return this.healthProbeNames; + } + + /** + * Set the healthProbeNames property: The list of health probe names. If provided as input, size of this list should + * be 2 for cs layer and should be 1 for database layer. + * + * @param healthProbeNames the healthProbeNames value to set. + * @return the LoadBalancerResourceNames object itself. + */ + public LoadBalancerResourceNames withHealthProbeNames(List healthProbeNames) { + this.healthProbeNames = healthProbeNames; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ManagedRGConfiguration.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ManagedRGConfiguration.java new file mode 100644 index 0000000000000..9f967c1678ba5 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ManagedRGConfiguration.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Managed resource group configuration. */ +@Fluent +public final class ManagedRGConfiguration { + /* + * Managed resource group name + */ + @JsonProperty(value = "name") + private String name; + + /** Creates an instance of ManagedRGConfiguration class. */ + public ManagedRGConfiguration() { + } + + /** + * Get the name property: Managed resource group name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Managed resource group name. + * + * @param name the name value to set. + * @return the ManagedRGConfiguration object itself. + */ + public ManagedRGConfiguration withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ManagedResourcesNetworkAccessType.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ManagedResourcesNetworkAccessType.java new file mode 100644 index 0000000000000..3fbf9074207c2 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ManagedResourcesNetworkAccessType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines the network access type for managed resources. */ +public final class ManagedResourcesNetworkAccessType extends ExpandableStringEnum { + /** Static value Public for ManagedResourcesNetworkAccessType. */ + public static final ManagedResourcesNetworkAccessType PUBLIC = fromString("Public"); + + /** Static value Private for ManagedResourcesNetworkAccessType. */ + public static final ManagedResourcesNetworkAccessType PRIVATE = fromString("Private"); + + /** + * Creates a new instance of ManagedResourcesNetworkAccessType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagedResourcesNetworkAccessType() { + } + + /** + * Creates or finds a ManagedResourcesNetworkAccessType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedResourcesNetworkAccessType. + */ + @JsonCreator + public static ManagedResourcesNetworkAccessType fromString(String name) { + return fromString(name, ManagedResourcesNetworkAccessType.class); + } + + /** + * Gets known ManagedResourcesNetworkAccessType values. + * + * @return known ManagedResourcesNetworkAccessType values. + */ + public static Collection values() { + return values(ManagedResourcesNetworkAccessType.class); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ManagedServiceIdentityType.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ManagedServiceIdentityType.java new file mode 100644 index 0000000000000..dcabc452f31dc --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ManagedServiceIdentityType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Type of managed service identity (only None, UserAssigned types are allowed). */ +public final class ManagedServiceIdentityType extends ExpandableStringEnum { + /** Static value None for ManagedServiceIdentityType. */ + public static final ManagedServiceIdentityType NONE = fromString("None"); + + /** Static value UserAssigned for ManagedServiceIdentityType. */ + public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** + * Creates a new instance of ManagedServiceIdentityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagedServiceIdentityType() { + } + + /** + * Creates or finds a ManagedServiceIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedServiceIdentityType. + */ + @JsonCreator + public static ManagedServiceIdentityType fromString(String name) { + return fromString(name, ManagedServiceIdentityType.class); + } + + /** + * Gets known ManagedServiceIdentityType values. + * + * @return known ManagedServiceIdentityType values. + */ + public static Collection values() { + return values(ManagedServiceIdentityType.class); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/MessageServerProperties.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/MessageServerProperties.java new file mode 100644 index 0000000000000..e75f885f85a8e --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/MessageServerProperties.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the SAP message server properties. */ +@Immutable +public final class MessageServerProperties { + /* + * message server port. + */ + @JsonProperty(value = "msPort", access = JsonProperty.Access.WRITE_ONLY) + private Long msPort; + + /* + * message server internal MS port. + */ + @JsonProperty(value = "internalMsPort", access = JsonProperty.Access.WRITE_ONLY) + private Long internalMsPort; + + /* + * message server HTTP Port. + */ + @JsonProperty(value = "httpPort", access = JsonProperty.Access.WRITE_ONLY) + private Long httpPort; + + /* + * message server HTTPS Port. + */ + @JsonProperty(value = "httpsPort", access = JsonProperty.Access.WRITE_ONLY) + private Long httpsPort; + + /* + * message server SAP Hostname. + */ + @JsonProperty(value = "hostname", access = JsonProperty.Access.WRITE_ONLY) + private String hostname; + + /* + * message server IP Address. + */ + @JsonProperty(value = "ipAddress", access = JsonProperty.Access.WRITE_ONLY) + private String ipAddress; + + /* + * Defines the health of SAP Instances. + */ + @JsonProperty(value = "health", access = JsonProperty.Access.WRITE_ONLY) + private SapHealthState health; + + /** Creates an instance of MessageServerProperties class. */ + public MessageServerProperties() { + } + + /** + * Get the msPort property: message server port. + * + * @return the msPort value. + */ + public Long msPort() { + return this.msPort; + } + + /** + * Get the internalMsPort property: message server internal MS port. + * + * @return the internalMsPort value. + */ + public Long internalMsPort() { + return this.internalMsPort; + } + + /** + * Get the httpPort property: message server HTTP Port. + * + * @return the httpPort value. + */ + public Long httpPort() { + return this.httpPort; + } + + /** + * Get the httpsPort property: message server HTTPS Port. + * + * @return the httpsPort value. + */ + public Long httpsPort() { + return this.httpsPort; + } + + /** + * Get the hostname property: message server SAP Hostname. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Get the ipAddress property: message server IP Address. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Get the health property: Defines the health of SAP Instances. + * + * @return the health value. + */ + public SapHealthState health() { + return this.health; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/MountFileShareConfiguration.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/MountFileShareConfiguration.java new file mode 100644 index 0000000000000..c4cae8fec2924 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/MountFileShareConfiguration.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Gets or sets the file share configuration where the transport directory fileshare already exists, and user wishes to + * mount the fileshare as a part of the create infra flow. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "configurationType") +@JsonTypeName("Mount") +@Fluent +public final class MountFileShareConfiguration extends FileShareConfiguration { + /* + * The fileshare resource ID + */ + @JsonProperty(value = "id", required = true) + private String id; + + /* + * The private endpoint resource ID + */ + @JsonProperty(value = "privateEndpointId", required = true) + private String privateEndpointId; + + /** Creates an instance of MountFileShareConfiguration class. */ + public MountFileShareConfiguration() { + } + + /** + * Get the id property: The fileshare resource ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The fileshare resource ID. + * + * @param id the id value to set. + * @return the MountFileShareConfiguration object itself. + */ + public MountFileShareConfiguration withId(String id) { + this.id = id; + return this; + } + + /** + * Get the privateEndpointId property: The private endpoint resource ID. + * + * @return the privateEndpointId value. + */ + public String privateEndpointId() { + return this.privateEndpointId; + } + + /** + * Set the privateEndpointId property: The private endpoint resource ID. + * + * @param privateEndpointId the privateEndpointId value to set. + * @return the MountFileShareConfiguration object itself. + */ + public MountFileShareConfiguration withPrivateEndpointId(String privateEndpointId) { + this.privateEndpointId = privateEndpointId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (id() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException("Missing required property id in model MountFileShareConfiguration")); + } + if (privateEndpointId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property privateEndpointId in model MountFileShareConfiguration")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MountFileShareConfiguration.class); +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/NamingPatternType.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/NamingPatternType.java new file mode 100644 index 0000000000000..d67a52a1f0003 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/NamingPatternType.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The pattern type to be used for resource naming. */ +public final class NamingPatternType extends ExpandableStringEnum { + /** Static value FullResourceName for NamingPatternType. */ + public static final NamingPatternType FULL_RESOURCE_NAME = fromString("FullResourceName"); + + /** + * Creates a new instance of NamingPatternType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NamingPatternType() { + } + + /** + * Creates or finds a NamingPatternType from its string representation. + * + * @param name a name to look for. + * @return the corresponding NamingPatternType. + */ + @JsonCreator + public static NamingPatternType fromString(String name) { + return fromString(name, NamingPatternType.class); + } + + /** + * Gets known NamingPatternType values. + * + * @return known NamingPatternType values. + */ + public static Collection values() { + return values(NamingPatternType.class); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/NetworkConfiguration.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/NetworkConfiguration.java new file mode 100644 index 0000000000000..128ccfc6a75b5 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/NetworkConfiguration.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the network configuration type for SAP system infrastructure that is being deployed. */ +@Fluent +public final class NetworkConfiguration { + /* + * Specifies whether a secondary IP address should be added to the network interface on all VMs of the SAP system + * being deployed + */ + @JsonProperty(value = "isSecondaryIpEnabled") + private Boolean isSecondaryIpEnabled; + + /** Creates an instance of NetworkConfiguration class. */ + public NetworkConfiguration() { + } + + /** + * Get the isSecondaryIpEnabled property: Specifies whether a secondary IP address should be added to the network + * interface on all VMs of the SAP system being deployed. + * + * @return the isSecondaryIpEnabled value. + */ + public Boolean isSecondaryIpEnabled() { + return this.isSecondaryIpEnabled; + } + + /** + * Set the isSecondaryIpEnabled property: Specifies whether a secondary IP address should be added to the network + * interface on all VMs of the SAP system being deployed. + * + * @param isSecondaryIpEnabled the isSecondaryIpEnabled value to set. + * @return the NetworkConfiguration object itself. + */ + public NetworkConfiguration withIsSecondaryIpEnabled(Boolean isSecondaryIpEnabled) { + this.isSecondaryIpEnabled = isSecondaryIpEnabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/NetworkInterfaceResourceNames.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/NetworkInterfaceResourceNames.java new file mode 100644 index 0000000000000..33f2e4f4b5fff --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/NetworkInterfaceResourceNames.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The resource names object for network interface and related resources. */ +@Fluent +public final class NetworkInterfaceResourceNames { + /* + * The full name for network interface. If name is not provided, service uses a default name based on the + * deployment type. For SingleServer, default name is {SID}-Nic. In case of HA-AvZone systems, default name will be + * {SID}-{App/ASCS/DB}-Zone{A/B}-Nic with an incrementor at the end in case of more than 1 instance per layer. For + * distributed and HA-AvSet systems, default name will be {SID}-{App/ASCS/DB}-Nic with an incrementor at the end in + * case of more than 1 instance per layer. + */ + @JsonProperty(value = "networkInterfaceName") + private String networkInterfaceName; + + /** Creates an instance of NetworkInterfaceResourceNames class. */ + public NetworkInterfaceResourceNames() { + } + + /** + * Get the networkInterfaceName property: The full name for network interface. If name is not provided, service uses + * a default name based on the deployment type. For SingleServer, default name is {SID}-Nic. In case of HA-AvZone + * systems, default name will be {SID}-{App/ASCS/DB}-Zone{A/B}-Nic with an incrementor at the end in case of more + * than 1 instance per layer. For distributed and HA-AvSet systems, default name will be {SID}-{App/ASCS/DB}-Nic + * with an incrementor at the end in case of more than 1 instance per layer. + * + * @return the networkInterfaceName value. + */ + public String networkInterfaceName() { + return this.networkInterfaceName; + } + + /** + * Set the networkInterfaceName property: The full name for network interface. If name is not provided, service uses + * a default name based on the deployment type. For SingleServer, default name is {SID}-Nic. In case of HA-AvZone + * systems, default name will be {SID}-{App/ASCS/DB}-Zone{A/B}-Nic with an incrementor at the end in case of more + * than 1 instance per layer. For distributed and HA-AvSet systems, default name will be {SID}-{App/ASCS/DB}-Nic + * with an incrementor at the end in case of more than 1 instance per layer. + * + * @param networkInterfaceName the networkInterfaceName value to set. + * @return the NetworkInterfaceResourceNames object itself. + */ + public NetworkInterfaceResourceNames withNetworkInterfaceName(String networkInterfaceName) { + this.networkInterfaceName = networkInterfaceName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/OSConfiguration.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/OSConfiguration.java new file mode 100644 index 0000000000000..ae1d8f52c447d --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/OSConfiguration.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Defines the OS configuration. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "osType", + defaultImpl = OSConfiguration.class) +@JsonTypeName("OSConfiguration") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Windows", value = WindowsConfiguration.class), + @JsonSubTypes.Type(name = "Linux", value = LinuxConfiguration.class) +}) +@Immutable +public class OSConfiguration { + /** Creates an instance of OSConfiguration class. */ + public OSConfiguration() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/OSProfile.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/OSProfile.java new file mode 100644 index 0000000000000..4a8b8c0714db2 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/OSProfile.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies the operating system settings for the virtual machine. Some of the settings cannot be changed once VM is + * provisioned. + */ +@Fluent +public final class OSProfile { + /* + * Specifies the name of the administrator account.

This property cannot be updated after the VM is + * created.

**Windows-only restriction:** Cannot end in "."

**Disallowed values:** + * "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", + * "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", + * "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5".

**Minimum-length + * (Linux):** 1 character

**Max-length (Linux):** 64 characters

**Max-length (Windows):** 20 + * characters. + */ + @JsonProperty(value = "adminUsername") + private String adminUsername; + + /* + * Specifies the password of the administrator account.

**Minimum-length (Windows):** 8 characters + *

**Minimum-length (Linux):** 6 characters

**Max-length (Windows):** 123 characters

+ * **Max-length (Linux):** 72 characters

**Complexity requirements:** 3 out of 4 conditions below need to + * be fulfilled
Has lower characters
Has upper characters
Has a digit
Has a special character + * (Regex match [\W_])

**Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", + * "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!"

For resetting the + * password, see [How to reset the Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp)

For resetting root + * password, see [Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection) + */ + @JsonProperty(value = "adminPassword") + private String adminPassword; + + /* + * Specifies Windows operating system settings on the virtual machine. + */ + @JsonProperty(value = "osConfiguration") + private OSConfiguration osConfiguration; + + /** Creates an instance of OSProfile class. */ + public OSProfile() { + } + + /** + * Get the adminUsername property: Specifies the name of the administrator account. <br><br> This + * property cannot be updated after the VM is created. <br><br> **Windows-only restriction:** Cannot end + * in "." <br><br> **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", + * "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", + * "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", + * "user4", "user5". <br><br> **Minimum-length (Linux):** 1 character <br><br> **Max-length + * (Linux):** 64 characters <br><br> **Max-length (Windows):** 20 characters. + * + * @return the adminUsername value. + */ + public String adminUsername() { + return this.adminUsername; + } + + /** + * Set the adminUsername property: Specifies the name of the administrator account. <br><br> This + * property cannot be updated after the VM is created. <br><br> **Windows-only restriction:** Cannot end + * in "." <br><br> **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", + * "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", + * "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", + * "user4", "user5". <br><br> **Minimum-length (Linux):** 1 character <br><br> **Max-length + * (Linux):** 64 characters <br><br> **Max-length (Windows):** 20 characters. + * + * @param adminUsername the adminUsername value to set. + * @return the OSProfile object itself. + */ + public OSProfile withAdminUsername(String adminUsername) { + this.adminUsername = adminUsername; + return this; + } + + /** + * Get the adminPassword property: Specifies the password of the administrator account. <br><br> + * **Minimum-length (Windows):** 8 characters <br><br> **Minimum-length (Linux):** 6 characters + * <br><br> **Max-length (Windows):** 123 characters <br><br> **Max-length (Linux):** 72 + * characters <br><br> **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled + * <br> Has lower characters <br>Has upper characters <br> Has a digit <br> Has a special + * character (Regex match [\W_]) <br><br> **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + * "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" <br><br> + * For resetting the password, see [How to reset the Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp) <br><br> For resetting + * root password, see [Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection). + * + * @return the adminPassword value. + */ + public String adminPassword() { + return this.adminPassword; + } + + /** + * Set the adminPassword property: Specifies the password of the administrator account. <br><br> + * **Minimum-length (Windows):** 8 characters <br><br> **Minimum-length (Linux):** 6 characters + * <br><br> **Max-length (Windows):** 123 characters <br><br> **Max-length (Linux):** 72 + * characters <br><br> **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled + * <br> Has lower characters <br>Has upper characters <br> Has a digit <br> Has a special + * character (Regex match [\W_]) <br><br> **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + * "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" <br><br> + * For resetting the password, see [How to reset the Remote Desktop service or its login password in a Windows + * VM](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp) <br><br> For resetting + * root password, see [Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess + * Extension](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection). + * + * @param adminPassword the adminPassword value to set. + * @return the OSProfile object itself. + */ + public OSProfile withAdminPassword(String adminPassword) { + this.adminPassword = adminPassword; + return this; + } + + /** + * Get the osConfiguration property: Specifies Windows operating system settings on the virtual machine. + * + * @return the osConfiguration value. + */ + public OSConfiguration osConfiguration() { + return this.osConfiguration; + } + + /** + * Set the osConfiguration property: Specifies Windows operating system settings on the virtual machine. + * + * @param osConfiguration the osConfiguration value to set. + * @return the OSProfile object itself. + */ + public OSProfile withOsConfiguration(OSConfiguration osConfiguration) { + this.osConfiguration = osConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (osConfiguration() != null) { + osConfiguration().validate(); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/OSType.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/OSType.java new file mode 100644 index 0000000000000..f63d4dfc9a01e --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/OSType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The OS Type. */ +public final class OSType extends ExpandableStringEnum { + /** Static value Linux for OSType. */ + public static final OSType LINUX = fromString("Linux"); + + /** Static value Windows for OSType. */ + public static final OSType WINDOWS = fromString("Windows"); + + /** + * Creates a new instance of OSType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OSType() { + } + + /** + * Creates or finds a OSType from its string representation. + * + * @param name a name to look for. + * @return the corresponding OSType. + */ + @JsonCreator + public static OSType fromString(String name) { + return fromString(name, OSType.class); + } + + /** + * Gets known OSType values. + * + * @return known OSType values. + */ + public static Collection values() { + return values(OSType.class); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/Operation.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/Operation.java new file mode 100644 index 0000000000000..6b83179118ac8 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/Operation.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.OperationInner; + +/** An immutable client-side representation of Operation. */ +public interface Operation { + /** + * Gets the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + String name(); + + /** + * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for ARM/control-plane operations. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + Origin origin(); + + /** + * Gets the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal + * only APIs. + * + * @return the actionType value. + */ + ActionType actionType(); + + /** + * Gets the inner + * com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/OperationDisplay.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/OperationDisplay.java new file mode 100644 index 0000000000000..fff1f51d0043e --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/OperationDisplay.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Localized display information for this particular operation. */ +@Immutable +public final class OperationDisplay { + /* + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft + * Compute". + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /* + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job + * Schedule Collections". + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /* + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual + * Machine", "Restart Virtual Machine". + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /* + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** Creates an instance of OperationDisplay class. */ + public OperationDisplay() { + } + + /** + * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring + * Insights" or "Microsoft Compute". + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. + * "Virtual Machines" or "Job Schedule Collections". + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the description property: The short, localized friendly description of the operation; suitable for tool tips + * and detailed views. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/OperationListResult.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/OperationListResult.java new file mode 100644 index 0000000000000..0842a743ee3db --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/OperationListResult.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.OperationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + * results. + */ +@Immutable +public final class OperationListResult { + /* + * List of operations supported by the resource provider + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of operation list results (if there are any). + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of OperationListResult class. */ + public OperationListResult() { + } + + /** + * Get the value property: List of operations supported by the resource provider. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results (if there are any). + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/OperationStatusResult.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/OperationStatusResult.java new file mode 100644 index 0000000000000..4a77ce285a6d0 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/OperationStatusResult.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.OperationStatusResultInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of OperationStatusResult. */ +public interface OperationStatusResult { + /** + * Gets the id property: Fully qualified ID for the async operation. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Name of the async operation. + * + * @return the name value. + */ + String name(); + + /** + * Gets the status property: Operation status. + * + * @return the status value. + */ + String status(); + + /** + * Gets the percentComplete property: Percent of the operation that is complete. + * + * @return the percentComplete value. + */ + Float percentComplete(); + + /** + * Gets the startTime property: The start time of the operation. + * + * @return the startTime value. + */ + OffsetDateTime startTime(); + + /** + * Gets the endTime property: The end time of the operation. + * + * @return the endTime value. + */ + OffsetDateTime endTime(); + + /** + * Gets the operations property: The operations list. + * + * @return the operations value. + */ + List operations(); + + /** + * Gets the error property: If present, details of the operation error. + * + * @return the error value. + */ + ManagementError error(); + + /** + * Gets the inner + * com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.OperationStatusResultInner + * object. + * + * @return the inner object. + */ + OperationStatusResultInner innerModel(); +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/Operations.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/Operations.java new file mode 100644 index 0000000000000..16ea0502109e8 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/Operations.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Lists all the available API operations under this PR. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists all the available API operations under this PR. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/Origin.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/Origin.java new file mode 100644 index 0000000000000..3b7100667915e --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/Origin.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value + * is "user,system". + */ +public final class Origin extends ExpandableStringEnum { + /** Static value user for Origin. */ + public static final Origin USER = fromString("user"); + + /** Static value system for Origin. */ + public static final Origin SYSTEM = fromString("system"); + + /** Static value user,system for Origin. */ + public static final Origin USER_SYSTEM = fromString("user,system"); + + /** + * Creates a new instance of Origin value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Origin() { + } + + /** + * Creates or finds a Origin from its string representation. + * + * @param name a name to look for. + * @return the corresponding Origin. + */ + @JsonCreator + public static Origin fromString(String name) { + return fromString(name, Origin.class); + } + + /** + * Gets known Origin values. + * + * @return known Origin values. + */ + public static Collection values() { + return values(Origin.class); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/OsSapConfiguration.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/OsSapConfiguration.java new file mode 100644 index 0000000000000..7b1ef02662bd2 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/OsSapConfiguration.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the OS and SAP Configurations for Deployment. */ +@Fluent +public final class OsSapConfiguration { + /* + * The url and storage account ID where deployer VM packages are uploaded + */ + @JsonProperty(value = "deployerVmPackages") + private DeployerVmPackages deployerVmPackages; + + /* + * The FQDN to set for the SAP system + */ + @JsonProperty(value = "sapFqdn") + private String sapFqdn; + + /** Creates an instance of OsSapConfiguration class. */ + public OsSapConfiguration() { + } + + /** + * Get the deployerVmPackages property: The url and storage account ID where deployer VM packages are uploaded. + * + * @return the deployerVmPackages value. + */ + public DeployerVmPackages deployerVmPackages() { + return this.deployerVmPackages; + } + + /** + * Set the deployerVmPackages property: The url and storage account ID where deployer VM packages are uploaded. + * + * @param deployerVmPackages the deployerVmPackages value to set. + * @return the OsSapConfiguration object itself. + */ + public OsSapConfiguration withDeployerVmPackages(DeployerVmPackages deployerVmPackages) { + this.deployerVmPackages = deployerVmPackages; + return this; + } + + /** + * Get the sapFqdn property: The FQDN to set for the SAP system. + * + * @return the sapFqdn value. + */ + public String sapFqdn() { + return this.sapFqdn; + } + + /** + * Set the sapFqdn property: The FQDN to set for the SAP system. + * + * @param sapFqdn the sapFqdn value to set. + * @return the OsSapConfiguration object itself. + */ + public OsSapConfiguration withSapFqdn(String sapFqdn) { + this.sapFqdn = sapFqdn; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (deployerVmPackages() != null) { + deployerVmPackages().validate(); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ResourceProviders.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ResourceProviders.java new file mode 100644 index 0000000000000..e6acdfd56d134 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ResourceProviders.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ResourceProviders. */ +public interface ResourceProviders { + /** + * Get SAP sizing recommendations by providing input SAPS for application tier and memory required for database + * tier. + * + * @param location The name of Azure region. + * @param sapSizingRecommendation SAP Sizing Recommendation Request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sAP sizing recommendations by providing input SAPS for application tier and memory required for database + * tier along with {@link Response}. + */ + Response sapSizingRecommendationsWithResponse( + String location, SapSizingRecommendationRequest sapSizingRecommendation, Context context); + + /** + * Get SAP sizing recommendations by providing input SAPS for application tier and memory required for database + * tier. + * + * @param location The name of Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sAP sizing recommendations by providing input SAPS for application tier and memory required for database + * tier. + */ + SapSizingRecommendationResult sapSizingRecommendations(String location); + + /** + * Get a list of SAP supported SKUs for ASCS, Application and Database tier. + * + * @param location The name of Azure region. + * @param sapSupportedSku SAP Supported SKU Request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SAP supported SKUs for ASCS, Application and Database tier along with {@link Response}. + */ + Response sapSupportedSkuWithResponse( + String location, SapSupportedSkusRequest sapSupportedSku, Context context); + + /** + * Get a list of SAP supported SKUs for ASCS, Application and Database tier. + * + * @param location The name of Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SAP supported SKUs for ASCS, Application and Database tier. + */ + SapSupportedResourceSkusResult sapSupportedSku(String location); + + /** + * Get the SAP Disk Configuration Layout prod/non-prod SAP System. + * + * @param location The name of Azure region. + * @param sapDiskConfigurations SAP Disk Configurations Request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAP Disk Configuration Layout prod/non-prod SAP System along with {@link Response}. + */ + Response sapDiskConfigurationsWithResponse( + String location, SapDiskConfigurationsRequest sapDiskConfigurations, Context context); + + /** + * Get the SAP Disk Configuration Layout prod/non-prod SAP System. + * + * @param location The name of Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAP Disk Configuration Layout prod/non-prod SAP System. + */ + SapDiskConfigurationsResult sapDiskConfigurations(String location); + + /** + * Get the recommended SAP Availability Zone Pair Details for your region. + * + * @param location The name of Azure region. + * @param sapAvailabilityZoneDetails SAP Availability Zone Details Request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the recommended SAP Availability Zone Pair Details for your region along with {@link Response}. + */ + Response sapAvailabilityZoneDetailsWithResponse( + String location, SapAvailabilityZoneDetailsRequest sapAvailabilityZoneDetails, Context context); + + /** + * Get the recommended SAP Availability Zone Pair Details for your region. + * + * @param location The name of Azure region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the recommended SAP Availability Zone Pair Details for your region. + */ + SapAvailabilityZoneDetailsResult sapAvailabilityZoneDetails(String location); +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapApplicationServerInstance.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapApplicationServerInstance.java new file mode 100644 index 0000000000000..1bafa341027d7 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapApplicationServerInstance.java @@ -0,0 +1,374 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapApplicationServerInstanceInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of SapApplicationServerInstance. */ +public interface SapApplicationServerInstance { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the instanceNo property: Application server Instance Number. + * + * @return the instanceNo value. + */ + String instanceNo(); + + /** + * Gets the subnet property: Application server Subnet. + * + * @return the subnet value. + */ + String subnet(); + + /** + * Gets the hostname property: Application server instance SAP hostname. + * + * @return the hostname value. + */ + String hostname(); + + /** + * Gets the kernelVersion property: Application server instance SAP Kernel Version. + * + * @return the kernelVersion value. + */ + String kernelVersion(); + + /** + * Gets the kernelPatch property: Application server instance SAP Kernel Patch level. + * + * @return the kernelPatch value. + */ + String kernelPatch(); + + /** + * Gets the ipAddress property: Application server instance SAP IP Address. + * + * @return the ipAddress value. + */ + String ipAddress(); + + /** + * Gets the gatewayPort property: Application server instance gateway Port. + * + * @return the gatewayPort value. + */ + Long gatewayPort(); + + /** + * Gets the icmHttpPort property: Application server instance ICM HTTP Port. + * + * @return the icmHttpPort value. + */ + Long icmHttpPort(); + + /** + * Gets the icmHttpsPort property: Application server instance ICM HTTPS Port. + * + * @return the icmHttpsPort value. + */ + Long icmHttpsPort(); + + /** + * Gets the dispatcherStatus property: Application server instance dispatcher status. + * + * @return the dispatcherStatus value. + */ + String dispatcherStatus(); + + /** + * Gets the loadBalancerDetails property: The Load Balancer details such as LoadBalancer ID attached to Application + * Server Virtual Machines. + * + * @return the loadBalancerDetails value. + */ + LoadBalancerDetails loadBalancerDetails(); + + /** + * Gets the vmDetails property: The list of virtual machines. + * + * @return the vmDetails value. + */ + List vmDetails(); + + /** + * Gets the status property: Defines the SAP Instance status. + * + * @return the status value. + */ + SapVirtualInstanceStatus status(); + + /** + * Gets the health property: Defines the health of SAP Instances. + * + * @return the health value. + */ + SapHealthState health(); + + /** + * Gets the provisioningState property: Defines the provisioning states. + * + * @return the provisioningState value. + */ + SapVirtualInstanceProvisioningState provisioningState(); + + /** + * Gets the errors property: Defines the Application Instance errors. + * + * @return the errors value. + */ + SapVirtualInstanceError errors(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner + * com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapApplicationServerInstanceInner + * object. + * + * @return the inner object. + */ + SapApplicationServerInstanceInner innerModel(); + + /** The entirety of the SapApplicationServerInstance definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + + /** The SapApplicationServerInstance definition stages. */ + interface DefinitionStages { + /** The first stage of the SapApplicationServerInstance definition. */ + interface Blank extends WithLocation { + } + + /** The stage of the SapApplicationServerInstance definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + + /** The stage of the SapApplicationServerInstance definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, sapVirtualInstanceName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @return the next definition stage. + */ + WithCreate withExistingSapVirtualInstance(String resourceGroupName, String sapVirtualInstanceName); + } + + /** + * The stage of the SapApplicationServerInstance definition which contains all the minimum required properties + * for the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags { + /** + * Executes the create request. + * + * @return the created resource. + */ + SapApplicationServerInstance create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SapApplicationServerInstance create(Context context); + } + + /** The stage of the SapApplicationServerInstance definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + } + + /** + * Begins update for the SapApplicationServerInstance resource. + * + * @return the stage of resource update. + */ + SapApplicationServerInstance.Update update(); + + /** The template for SapApplicationServerInstance update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SapApplicationServerInstance apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SapApplicationServerInstance apply(Context context); + } + + /** The SapApplicationServerInstance update stages. */ + interface UpdateStages { + /** The stage of the SapApplicationServerInstance update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Gets or sets the Resource tags.. + * + * @param tags Gets or sets the Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SapApplicationServerInstance refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SapApplicationServerInstance refresh(Context context); + + /** + * Starts the SAP Application Server Instance. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + OperationStatusResult startInstance(); + + /** + * Starts the SAP Application Server Instance. + * + * @param body SAP Application server instance start request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + OperationStatusResult startInstance(StartRequest body, Context context); + + /** + * Stops the SAP Application Server Instance. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + OperationStatusResult stopInstance(); + + /** + * Stops the SAP Application Server Instance. + * + * @param body SAP Application server instance stop request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + OperationStatusResult stopInstance(StopRequest body, Context context); +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapApplicationServerInstanceList.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapApplicationServerInstanceList.java new file mode 100644 index 0000000000000..125e3a9502268 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapApplicationServerInstanceList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapApplicationServerInstanceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the collection of SAP Application Server Instance resources. */ +@Fluent +public final class SapApplicationServerInstanceList { + /* + * Gets the list of SAP Application Server instance resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Gets the value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of SapApplicationServerInstanceList class. */ + public SapApplicationServerInstanceList() { + } + + /** + * Get the value property: Gets the list of SAP Application Server instance resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets the list of SAP Application Server instance resources. + * + * @param value the value value to set. + * @return the SapApplicationServerInstanceList object itself. + */ + public SapApplicationServerInstanceList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets the value of next link. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets the value of next link. + * + * @param nextLink the nextLink value to set. + * @return the SapApplicationServerInstanceList object itself. + */ + public SapApplicationServerInstanceList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapApplicationServerInstances.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapApplicationServerInstances.java new file mode 100644 index 0000000000000..d71ea7767c34d --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapApplicationServerInstances.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of SapApplicationServerInstances. */ +public interface SapApplicationServerInstances { + /** + * Gets the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource + * along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, Context context); + + /** + * Gets the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. + */ + SapApplicationServerInstance get( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName); + + /** + * Deletes the SAP Application Server Instance resource. <br><br>This operation will be used by service + * only. Delete by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName); + + /** + * Deletes the SAP Application Server Instance resource. <br><br>This operation will be used by service + * only. Delete by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName, Context context); + + /** + * Lists the SAP Application Server Instance resources for a given Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of SAP Application Server Instance resources as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String sapVirtualInstanceName); + + /** + * Lists the SAP Application Server Instance resources for a given Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of SAP Application Server Instance resources as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String sapVirtualInstanceName, Context context); + + /** + * Starts the SAP Application Server Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + OperationStatusResult startInstance( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName); + + /** + * Starts the SAP Application Server Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @param body SAP Application server instance start request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + OperationStatusResult startInstance( + String resourceGroupName, + String sapVirtualInstanceName, + String applicationInstanceName, + StartRequest body, + Context context); + + /** + * Stops the SAP Application Server Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + OperationStatusResult stopInstance( + String resourceGroupName, String sapVirtualInstanceName, String applicationInstanceName); + + /** + * Stops the SAP Application Server Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param applicationInstanceName The name of SAP Application Server instance resource. + * @param body SAP Application server instance stop request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + OperationStatusResult stopInstance( + String resourceGroupName, + String sapVirtualInstanceName, + String applicationInstanceName, + StopRequest body, + Context context); + + /** + * Gets the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource + * along with {@link Response}. + */ + SapApplicationServerInstance getById(String id); + + /** + * Gets the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource + * along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the SAP Application Server Instance resource. <br><br>This operation will be used by service + * only. Delete by end user will return a Bad Request error. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the SAP Application Server Instance resource. <br><br>This operation will be used by service + * only. Delete by end user will return a Bad Request error. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SapApplicationServerInstance resource. + * + * @param name resource name. + * @return the first stage of the new SapApplicationServerInstance definition. + */ + SapApplicationServerInstance.DefinitionStages.Blank define(String name); +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapAvailabilityZoneDetailsRequest.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapAvailabilityZoneDetailsRequest.java new file mode 100644 index 0000000000000..ae3e13a0c9045 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapAvailabilityZoneDetailsRequest.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SAP request to get list of availability zones. */ +@Fluent +public final class SapAvailabilityZoneDetailsRequest { + /* + * The geo-location where the SAP resources will be created. + */ + @JsonProperty(value = "appLocation", required = true) + private String appLocation; + + /* + * Defines the SAP Product type. + */ + @JsonProperty(value = "sapProduct", required = true) + private SapProductType sapProduct; + + /* + * The database type. Eg: HANA, DB2, etc + */ + @JsonProperty(value = "databaseType", required = true) + private SapDatabaseType databaseType; + + /** Creates an instance of SapAvailabilityZoneDetailsRequest class. */ + public SapAvailabilityZoneDetailsRequest() { + } + + /** + * Get the appLocation property: The geo-location where the SAP resources will be created. + * + * @return the appLocation value. + */ + public String appLocation() { + return this.appLocation; + } + + /** + * Set the appLocation property: The geo-location where the SAP resources will be created. + * + * @param appLocation the appLocation value to set. + * @return the SapAvailabilityZoneDetailsRequest object itself. + */ + public SapAvailabilityZoneDetailsRequest withAppLocation(String appLocation) { + this.appLocation = appLocation; + return this; + } + + /** + * Get the sapProduct property: Defines the SAP Product type. + * + * @return the sapProduct value. + */ + public SapProductType sapProduct() { + return this.sapProduct; + } + + /** + * Set the sapProduct property: Defines the SAP Product type. + * + * @param sapProduct the sapProduct value to set. + * @return the SapAvailabilityZoneDetailsRequest object itself. + */ + public SapAvailabilityZoneDetailsRequest withSapProduct(SapProductType sapProduct) { + this.sapProduct = sapProduct; + return this; + } + + /** + * Get the databaseType property: The database type. Eg: HANA, DB2, etc. + * + * @return the databaseType value. + */ + public SapDatabaseType databaseType() { + return this.databaseType; + } + + /** + * Set the databaseType property: The database type. Eg: HANA, DB2, etc. + * + * @param databaseType the databaseType value to set. + * @return the SapAvailabilityZoneDetailsRequest object itself. + */ + public SapAvailabilityZoneDetailsRequest withDatabaseType(SapDatabaseType databaseType) { + this.databaseType = databaseType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (appLocation() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property appLocation in model SapAvailabilityZoneDetailsRequest")); + } + if (sapProduct() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sapProduct in model SapAvailabilityZoneDetailsRequest")); + } + if (databaseType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property databaseType in model SapAvailabilityZoneDetailsRequest")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SapAvailabilityZoneDetailsRequest.class); +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapAvailabilityZoneDetailsResult.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapAvailabilityZoneDetailsResult.java new file mode 100644 index 0000000000000..c8be0d86e389b --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapAvailabilityZoneDetailsResult.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapAvailabilityZoneDetailsResultInner; +import java.util.List; + +/** An immutable client-side representation of SapAvailabilityZoneDetailsResult. */ +public interface SapAvailabilityZoneDetailsResult { + /** + * Gets the availabilityZonePairs property: Gets the list of availability zone pairs. + * + * @return the availabilityZonePairs value. + */ + List availabilityZonePairs(); + + /** + * Gets the inner + * com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapAvailabilityZoneDetailsResultInner + * object. + * + * @return the inner object. + */ + SapAvailabilityZoneDetailsResultInner innerModel(); +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapAvailabilityZonePair.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapAvailabilityZonePair.java new file mode 100644 index 0000000000000..be79442d6f740 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapAvailabilityZonePair.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SAP Availability Zone Pair. */ +@Fluent +public final class SapAvailabilityZonePair { + /* + * The zone A. + */ + @JsonProperty(value = "zoneA") + private Long zoneA; + + /* + * The zone B. + */ + @JsonProperty(value = "zoneB") + private Long zoneB; + + /** Creates an instance of SapAvailabilityZonePair class. */ + public SapAvailabilityZonePair() { + } + + /** + * Get the zoneA property: The zone A. + * + * @return the zoneA value. + */ + public Long zoneA() { + return this.zoneA; + } + + /** + * Set the zoneA property: The zone A. + * + * @param zoneA the zoneA value to set. + * @return the SapAvailabilityZonePair object itself. + */ + public SapAvailabilityZonePair withZoneA(Long zoneA) { + this.zoneA = zoneA; + return this; + } + + /** + * Get the zoneB property: The zone B. + * + * @return the zoneB value. + */ + public Long zoneB() { + return this.zoneB; + } + + /** + * Set the zoneB property: The zone B. + * + * @param zoneB the zoneB value to set. + * @return the SapAvailabilityZonePair object itself. + */ + public SapAvailabilityZonePair withZoneB(Long zoneB) { + this.zoneB = zoneB; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapCentralInstanceList.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapCentralInstanceList.java new file mode 100644 index 0000000000000..ad717744061c4 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapCentralInstanceList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapCentralServerInstanceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the collection of SAP Central Services Instance resources. */ +@Fluent +public final class SapCentralInstanceList { + /* + * Gets the list of SAP central services instance resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Gets the value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of SapCentralInstanceList class. */ + public SapCentralInstanceList() { + } + + /** + * Get the value property: Gets the list of SAP central services instance resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets the list of SAP central services instance resources. + * + * @param value the value value to set. + * @return the SapCentralInstanceList object itself. + */ + public SapCentralInstanceList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets the value of next link. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets the value of next link. + * + * @param nextLink the nextLink value to set. + * @return the SapCentralInstanceList object itself. + */ + public SapCentralInstanceList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapCentralInstances.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapCentralInstances.java new file mode 100644 index 0000000000000..48e6ccf4c613b --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapCentralInstances.java @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of SapCentralInstances. */ +public interface SapCentralInstances { + /** + * Gets the SAP Central Services Instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAP Central Services Instance resource along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, Context context); + + /** + * Gets the SAP Central Services Instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAP Central Services Instance resource. + */ + SapCentralServerInstance get(String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName); + + /** + * Deletes the SAP Central Services Instance resource. <br><br>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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName); + + /** + * Deletes the SAP Central Services Instance resource. <br><br>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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName, Context context); + + /** + * Lists the SAP Central Services Instance resource for the given Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of SAP Central Services Instance resources as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String sapVirtualInstanceName); + + /** + * Lists the SAP Central Services Instance resource for the given Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of SAP Central Services Instance resources as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list( + String resourceGroupName, String sapVirtualInstanceName, Context context); + + /** + * Starts the SAP Central Services Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + OperationStatusResult startInstance( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName); + + /** + * Starts the SAP Central Services Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @param body SAP Central Services instance start request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + OperationStatusResult startInstance( + String resourceGroupName, + String sapVirtualInstanceName, + String centralInstanceName, + StartRequest body, + Context context); + + /** + * Stops the SAP Central Services Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + OperationStatusResult stopInstance( + String resourceGroupName, String sapVirtualInstanceName, String centralInstanceName); + + /** + * Stops the SAP Central Services Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param centralInstanceName Central Services Instance resource name string modeled as parameter for auto + * generation to work correctly. + * @param body SAP Central Services instance stop request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + OperationStatusResult stopInstance( + String resourceGroupName, + String sapVirtualInstanceName, + String centralInstanceName, + StopRequest body, + Context context); + + /** + * Gets the SAP Central Services Instance resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAP Central Services Instance resource along with {@link Response}. + */ + SapCentralServerInstance getById(String id); + + /** + * Gets the SAP Central Services Instance resource. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAP Central Services Instance resource along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the SAP Central Services Instance resource. <br><br>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. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the SAP Central Services Instance resource. <br><br>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. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SapCentralServerInstance resource. + * + * @param name resource name. + * @return the first stage of the new SapCentralServerInstance definition. + */ + SapCentralServerInstance.DefinitionStages.Blank define(String name); +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapCentralServerInstance.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapCentralServerInstance.java new file mode 100644 index 0000000000000..d52044c80ceaf --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapCentralServerInstance.java @@ -0,0 +1,414 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapCentralServerInstanceInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of SapCentralServerInstance. */ +public interface SapCentralServerInstance { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the instanceNo property: The central services instance number. + * + * @return the instanceNo value. + */ + String instanceNo(); + + /** + * Gets the subnet property: The central services instance subnet. + * + * @return the subnet value. + */ + String subnet(); + + /** + * Gets the messageServerProperties property: Defines the SAP message server properties. + * + * @return the messageServerProperties value. + */ + MessageServerProperties messageServerProperties(); + + /** + * Gets the enqueueServerProperties property: Defines the SAP Enqueue Server properties. + * + * @return the enqueueServerProperties value. + */ + EnqueueServerProperties enqueueServerProperties(); + + /** + * Gets the gatewayServerProperties property: Defines the SAP Gateway Server properties. + * + * @return the gatewayServerProperties value. + */ + GatewayServerProperties gatewayServerProperties(); + + /** + * Gets the enqueueReplicationServerProperties property: Defines the SAP Enqueue Replication Server (ERS) + * properties. + * + * @return the enqueueReplicationServerProperties value. + */ + EnqueueReplicationServerProperties enqueueReplicationServerProperties(); + + /** + * Gets the kernelVersion property: The central services instance Kernel Version. + * + * @return the kernelVersion value. + */ + String kernelVersion(); + + /** + * Gets the kernelPatch property: The central services instance Kernel Patch level. + * + * @return the kernelPatch value. + */ + String kernelPatch(); + + /** + * Gets the loadBalancerDetails property: The Load Balancer details such as LoadBalancer ID attached to ASCS Virtual + * Machines. + * + * @return the loadBalancerDetails value. + */ + LoadBalancerDetails loadBalancerDetails(); + + /** + * Gets the vmDetails property: The list of virtual machines corresponding to the Central Services instance. + * + * @return the vmDetails value. + */ + List vmDetails(); + + /** + * Gets the status property: Defines the SAP Instance status. + * + * @return the status value. + */ + SapVirtualInstanceStatus status(); + + /** + * Gets the health property: Defines the health of SAP Instances. + * + * @return the health value. + */ + SapHealthState health(); + + /** + * Gets the provisioningState property: Defines the provisioning states. + * + * @return the provisioningState value. + */ + SapVirtualInstanceProvisioningState provisioningState(); + + /** + * Gets the errors property: Defines the errors related to SAP Central Services Instance resource. + * + * @return the errors value. + */ + SapVirtualInstanceError errors(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner + * com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapCentralServerInstanceInner + * object. + * + * @return the inner object. + */ + SapCentralServerInstanceInner innerModel(); + + /** The entirety of the SapCentralServerInstance definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + + /** The SapCentralServerInstance definition stages. */ + interface DefinitionStages { + /** The first stage of the SapCentralServerInstance definition. */ + interface Blank extends WithLocation { + } + + /** The stage of the SapCentralServerInstance definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + + /** The stage of the SapCentralServerInstance definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, sapVirtualInstanceName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @return the next definition stage. + */ + WithCreate withExistingSapVirtualInstance(String resourceGroupName, String sapVirtualInstanceName); + } + + /** + * The stage of the SapCentralServerInstance definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithMessageServerProperties, + DefinitionStages.WithEnqueueServerProperties, + DefinitionStages.WithGatewayServerProperties, + DefinitionStages.WithEnqueueReplicationServerProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + SapCentralServerInstance create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SapCentralServerInstance create(Context context); + } + + /** The stage of the SapCentralServerInstance definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** The stage of the SapCentralServerInstance definition allowing to specify messageServerProperties. */ + interface WithMessageServerProperties { + /** + * Specifies the messageServerProperties property: Defines the SAP message server properties.. + * + * @param messageServerProperties Defines the SAP message server properties. + * @return the next definition stage. + */ + WithCreate withMessageServerProperties(MessageServerProperties messageServerProperties); + } + + /** The stage of the SapCentralServerInstance definition allowing to specify enqueueServerProperties. */ + interface WithEnqueueServerProperties { + /** + * Specifies the enqueueServerProperties property: Defines the SAP Enqueue Server properties.. + * + * @param enqueueServerProperties Defines the SAP Enqueue Server properties. + * @return the next definition stage. + */ + WithCreate withEnqueueServerProperties(EnqueueServerProperties enqueueServerProperties); + } + + /** The stage of the SapCentralServerInstance definition allowing to specify gatewayServerProperties. */ + interface WithGatewayServerProperties { + /** + * Specifies the gatewayServerProperties property: Defines the SAP Gateway Server properties.. + * + * @param gatewayServerProperties Defines the SAP Gateway Server properties. + * @return the next definition stage. + */ + WithCreate withGatewayServerProperties(GatewayServerProperties gatewayServerProperties); + } + + /** + * The stage of the SapCentralServerInstance definition allowing to specify enqueueReplicationServerProperties. + */ + interface WithEnqueueReplicationServerProperties { + /** + * Specifies the enqueueReplicationServerProperties property: Defines the SAP Enqueue Replication Server + * (ERS) properties.. + * + * @param enqueueReplicationServerProperties Defines the SAP Enqueue Replication Server (ERS) properties. + * @return the next definition stage. + */ + WithCreate withEnqueueReplicationServerProperties( + EnqueueReplicationServerProperties enqueueReplicationServerProperties); + } + } + + /** + * Begins update for the SapCentralServerInstance resource. + * + * @return the stage of resource update. + */ + SapCentralServerInstance.Update update(); + + /** The template for SapCentralServerInstance update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SapCentralServerInstance apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SapCentralServerInstance apply(Context context); + } + + /** The SapCentralServerInstance update stages. */ + interface UpdateStages { + /** The stage of the SapCentralServerInstance update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Gets or sets the Resource tags.. + * + * @param tags Gets or sets the Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SapCentralServerInstance refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SapCentralServerInstance refresh(Context context); + + /** + * Starts the SAP Central Services Instance. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + OperationStatusResult startInstance(); + + /** + * Starts the SAP Central Services Instance. + * + * @param body SAP Central Services instance start request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + OperationStatusResult startInstance(StartRequest body, Context context); + + /** + * Stops the SAP Central Services Instance. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + OperationStatusResult stopInstance(); + + /** + * Stops the SAP Central Services Instance. + * + * @param body SAP Central Services instance stop request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + OperationStatusResult stopInstance(StopRequest body, Context context); +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapConfiguration.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapConfiguration.java new file mode 100644 index 0000000000000..0ed0ce8952815 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapConfiguration.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The SAP Configuration. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "configurationType", + defaultImpl = SapConfiguration.class) +@JsonTypeName("SapConfiguration") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Discovery", value = DiscoveryConfiguration.class), + @JsonSubTypes.Type(name = "Deployment", value = DeploymentConfiguration.class), + @JsonSubTypes.Type(name = "DeploymentWithOSConfig", value = DeploymentWithOSConfiguration.class) +}) +@Immutable +public class SapConfiguration { + /** Creates an instance of SapConfiguration class. */ + public SapConfiguration() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapConfigurationType.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapConfigurationType.java new file mode 100644 index 0000000000000..7fa5824fddc61 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapConfigurationType.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The configuration Type. */ +public final class SapConfigurationType extends ExpandableStringEnum { + /** Static value Deployment for SapConfigurationType. */ + public static final SapConfigurationType DEPLOYMENT = fromString("Deployment"); + + /** Static value Discovery for SapConfigurationType. */ + public static final SapConfigurationType DISCOVERY = fromString("Discovery"); + + /** Static value DeploymentWithOSConfig for SapConfigurationType. */ + public static final SapConfigurationType DEPLOYMENT_WITH_OSCONFIG = fromString("DeploymentWithOSConfig"); + + /** + * Creates a new instance of SapConfigurationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SapConfigurationType() { + } + + /** + * Creates or finds a SapConfigurationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SapConfigurationType. + */ + @JsonCreator + public static SapConfigurationType fromString(String name) { + return fromString(name, SapConfigurationType.class); + } + + /** + * Gets known SapConfigurationType values. + * + * @return known SapConfigurationType values. + */ + public static Collection values() { + return values(SapConfigurationType.class); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapDatabaseInstance.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapDatabaseInstance.java new file mode 100644 index 0000000000000..1f15710186ab2 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapDatabaseInstance.java @@ -0,0 +1,326 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapDatabaseInstanceInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of SapDatabaseInstance. */ +public interface SapDatabaseInstance { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the subnet property: Database subnet. + * + * @return the subnet value. + */ + String subnet(); + + /** + * Gets the databaseSid property: Database SID name. + * + * @return the databaseSid value. + */ + String databaseSid(); + + /** + * Gets the databaseType property: Database type, that is if the DB is HANA, DB2, Oracle, SAP ASE, Max DB or MS SQL + * Server. + * + * @return the databaseType value. + */ + String databaseType(); + + /** + * Gets the ipAddress property: Database IP Address. + * + * @return the ipAddress value. + */ + String ipAddress(); + + /** + * Gets the loadBalancerDetails property: The Load Balancer details such as LoadBalancer ID attached to Database + * Virtual Machines. + * + * @return the loadBalancerDetails value. + */ + LoadBalancerDetails loadBalancerDetails(); + + /** + * Gets the vmDetails property: The list of virtual machines corresponding to the Database resource. + * + * @return the vmDetails value. + */ + List vmDetails(); + + /** + * Gets the status property: Defines the SAP Instance status. + * + * @return the status value. + */ + SapVirtualInstanceStatus status(); + + /** + * Gets the provisioningState property: Defines the provisioning states. + * + * @return the provisioningState value. + */ + SapVirtualInstanceProvisioningState provisioningState(); + + /** + * Gets the errors property: Defines the errors related to Database resource. + * + * @return the errors value. + */ + SapVirtualInstanceError errors(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner + * com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapDatabaseInstanceInner + * object. + * + * @return the inner object. + */ + SapDatabaseInstanceInner innerModel(); + + /** The entirety of the SapDatabaseInstance definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + + /** The SapDatabaseInstance definition stages. */ + interface DefinitionStages { + /** The first stage of the SapDatabaseInstance definition. */ + interface Blank extends WithLocation { + } + + /** The stage of the SapDatabaseInstance definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + + /** The stage of the SapDatabaseInstance definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, sapVirtualInstanceName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @return the next definition stage. + */ + WithCreate withExistingSapVirtualInstance(String resourceGroupName, String sapVirtualInstanceName); + } + + /** + * The stage of the SapDatabaseInstance definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags { + /** + * Executes the create request. + * + * @return the created resource. + */ + SapDatabaseInstance create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SapDatabaseInstance create(Context context); + } + + /** The stage of the SapDatabaseInstance definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + } + + /** + * Begins update for the SapDatabaseInstance resource. + * + * @return the stage of resource update. + */ + SapDatabaseInstance.Update update(); + + /** The template for SapDatabaseInstance update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SapDatabaseInstance apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SapDatabaseInstance apply(Context context); + } + + /** The SapDatabaseInstance update stages. */ + interface UpdateStages { + /** The stage of the SapDatabaseInstance update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Gets or sets the Resource tags.. + * + * @param tags Gets or sets the Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SapDatabaseInstance refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SapDatabaseInstance refresh(Context context); + + /** + * Starts the database instance of the SAP system. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + OperationStatusResult startInstance(); + + /** + * Starts the database instance of the SAP system. + * + * @param body SAP Database server instance start request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + OperationStatusResult startInstance(StartRequest body, Context context); + + /** + * Stops the database instance of the SAP system. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + OperationStatusResult stopInstance(); + + /** + * Stops the database instance of the SAP system. + * + * @param body Stop request for the database instance of the SAP system. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + OperationStatusResult stopInstance(StopRequest body, Context context); +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapDatabaseInstanceList.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapDatabaseInstanceList.java new file mode 100644 index 0000000000000..35293b7f05f34 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapDatabaseInstanceList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapDatabaseInstanceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the collection of SAP Database Instances. */ +@Fluent +public final class SapDatabaseInstanceList { + /* + * Gets the list of SAP Database instances. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Gets the value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of SapDatabaseInstanceList class. */ + public SapDatabaseInstanceList() { + } + + /** + * Get the value property: Gets the list of SAP Database instances. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets the list of SAP Database instances. + * + * @param value the value value to set. + * @return the SapDatabaseInstanceList object itself. + */ + public SapDatabaseInstanceList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets the value of next link. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets the value of next link. + * + * @param nextLink the nextLink value to set. + * @return the SapDatabaseInstanceList object itself. + */ + public SapDatabaseInstanceList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapDatabaseInstances.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapDatabaseInstances.java new file mode 100644 index 0000000000000..a99cf28b556d0 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapDatabaseInstances.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of SapDatabaseInstances. */ +public interface SapDatabaseInstances { + /** + * Gets the SAP Database Instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAP Database Instance resource along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, Context context); + + /** + * Gets the SAP Database Instance resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAP Database Instance resource. + */ + SapDatabaseInstance get(String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName); + + /** + * Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource. + * <br><br>This will be used by service only. Delete by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName); + + /** + * Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource. + * <br><br>This will be used by service only. Delete by end user will return a Bad Request error. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName, Context context); + + /** + * Lists the Database resources associated with a Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of SAP Database Instances as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String sapVirtualInstanceName); + + /** + * Lists the Database resources associated with a Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return defines the collection of SAP Database Instances as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String sapVirtualInstanceName, Context context); + + /** + * Starts the database instance of the SAP system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + OperationStatusResult startInstance( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName); + + /** + * Starts the database instance of the SAP system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @param body SAP Database server instance start request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + OperationStatusResult startInstance( + String resourceGroupName, + String sapVirtualInstanceName, + String databaseInstanceName, + StartRequest body, + Context context); + + /** + * Stops the database instance of the SAP system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + OperationStatusResult stopInstance( + String resourceGroupName, String sapVirtualInstanceName, String databaseInstanceName); + + /** + * Stops the database instance of the SAP system. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param databaseInstanceName Database resource name string modeled as parameter for auto generation to work + * correctly. + * @param body Stop request for the database instance of the SAP system. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + OperationStatusResult stopInstance( + String resourceGroupName, + String sapVirtualInstanceName, + String databaseInstanceName, + StopRequest body, + Context context); + + /** + * Gets the SAP Database Instance resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAP Database Instance resource along with {@link Response}. + */ + SapDatabaseInstance getById(String id); + + /** + * Gets the SAP Database Instance resource. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAP Database Instance resource along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource. + * <br><br>This will be used by service only. Delete by end user will return a Bad Request error. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource. + * <br><br>This will be used by service only. Delete by end user will return a Bad Request error. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SapDatabaseInstance resource. + * + * @param name resource name. + * @return the first stage of the new SapDatabaseInstance definition. + */ + SapDatabaseInstance.DefinitionStages.Blank define(String name); +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapDatabaseScaleMethod.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapDatabaseScaleMethod.java new file mode 100644 index 0000000000000..86c35e6982e28 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapDatabaseScaleMethod.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The database scale method. */ +public final class SapDatabaseScaleMethod extends ExpandableStringEnum { + /** Static value ScaleUp for SapDatabaseScaleMethod. */ + public static final SapDatabaseScaleMethod SCALE_UP = fromString("ScaleUp"); + + /** + * Creates a new instance of SapDatabaseScaleMethod value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SapDatabaseScaleMethod() { + } + + /** + * Creates or finds a SapDatabaseScaleMethod from its string representation. + * + * @param name a name to look for. + * @return the corresponding SapDatabaseScaleMethod. + */ + @JsonCreator + public static SapDatabaseScaleMethod fromString(String name) { + return fromString(name, SapDatabaseScaleMethod.class); + } + + /** + * Gets known SapDatabaseScaleMethod values. + * + * @return known SapDatabaseScaleMethod values. + */ + public static Collection values() { + return values(SapDatabaseScaleMethod.class); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapDatabaseType.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapDatabaseType.java new file mode 100644 index 0000000000000..2a67bad778544 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapDatabaseType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines the supported SAP Database types. */ +public final class SapDatabaseType extends ExpandableStringEnum { + /** Static value HANA for SapDatabaseType. */ + public static final SapDatabaseType HANA = fromString("HANA"); + + /** Static value DB2 for SapDatabaseType. */ + public static final SapDatabaseType DB2 = fromString("DB2"); + + /** + * Creates a new instance of SapDatabaseType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SapDatabaseType() { + } + + /** + * Creates or finds a SapDatabaseType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SapDatabaseType. + */ + @JsonCreator + public static SapDatabaseType fromString(String name) { + return fromString(name, SapDatabaseType.class); + } + + /** + * Gets known SapDatabaseType values. + * + * @return known SapDatabaseType values. + */ + public static Collection values() { + return values(SapDatabaseType.class); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapDeploymentType.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapDeploymentType.java new file mode 100644 index 0000000000000..cd1c62bfef09c --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapDeploymentType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The type of SAP deployment, single server or Three tier. */ +public final class SapDeploymentType extends ExpandableStringEnum { + /** Static value SingleServer for SapDeploymentType. */ + public static final SapDeploymentType SINGLE_SERVER = fromString("SingleServer"); + + /** Static value ThreeTier for SapDeploymentType. */ + public static final SapDeploymentType THREE_TIER = fromString("ThreeTier"); + + /** + * Creates a new instance of SapDeploymentType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SapDeploymentType() { + } + + /** + * Creates or finds a SapDeploymentType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SapDeploymentType. + */ + @JsonCreator + public static SapDeploymentType fromString(String name) { + return fromString(name, SapDeploymentType.class); + } + + /** + * Gets known SapDeploymentType values. + * + * @return known SapDeploymentType values. + */ + public static Collection values() { + return values(SapDeploymentType.class); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapDiskConfiguration.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapDiskConfiguration.java new file mode 100644 index 0000000000000..cddc97e052ddc --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapDiskConfiguration.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The SAP Disk Configuration contains 'recommended disk' details and list of supported disks detail for a volume type. + */ +@Fluent +public final class SapDiskConfiguration { + /* + * The recommended disk details for a given VM Sku. + */ + @JsonProperty(value = "recommendedConfiguration") + private DiskVolumeConfiguration recommendedConfiguration; + + /* + * The list of supported disks for a given VM Sku. + */ + @JsonProperty(value = "supportedConfigurations") + private List supportedConfigurations; + + /** Creates an instance of SapDiskConfiguration class. */ + public SapDiskConfiguration() { + } + + /** + * Get the recommendedConfiguration property: The recommended disk details for a given VM Sku. + * + * @return the recommendedConfiguration value. + */ + public DiskVolumeConfiguration recommendedConfiguration() { + return this.recommendedConfiguration; + } + + /** + * Set the recommendedConfiguration property: The recommended disk details for a given VM Sku. + * + * @param recommendedConfiguration the recommendedConfiguration value to set. + * @return the SapDiskConfiguration object itself. + */ + public SapDiskConfiguration withRecommendedConfiguration(DiskVolumeConfiguration recommendedConfiguration) { + this.recommendedConfiguration = recommendedConfiguration; + return this; + } + + /** + * Get the supportedConfigurations property: The list of supported disks for a given VM Sku. + * + * @return the supportedConfigurations value. + */ + public List supportedConfigurations() { + return this.supportedConfigurations; + } + + /** + * Set the supportedConfigurations property: The list of supported disks for a given VM Sku. + * + * @param supportedConfigurations the supportedConfigurations value to set. + * @return the SapDiskConfiguration object itself. + */ + public SapDiskConfiguration withSupportedConfigurations(List supportedConfigurations) { + this.supportedConfigurations = supportedConfigurations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (recommendedConfiguration() != null) { + recommendedConfiguration().validate(); + } + if (supportedConfigurations() != null) { + supportedConfigurations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapDiskConfigurationsRequest.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapDiskConfigurationsRequest.java new file mode 100644 index 0000000000000..45a0a2e90ad6e --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapDiskConfigurationsRequest.java @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SAP request to get list of disk configurations. */ +@Fluent +public final class SapDiskConfigurationsRequest { + /* + * The geo-location where the SAP resources will be created. + */ + @JsonProperty(value = "appLocation", required = true) + private String appLocation; + + /* + * Defines the environment type - Production/Non Production. + */ + @JsonProperty(value = "environment", required = true) + private SapEnvironmentType environment; + + /* + * Defines the SAP Product type. + */ + @JsonProperty(value = "sapProduct", required = true) + private SapProductType sapProduct; + + /* + * The database type. Eg: HANA, DB2, etc + */ + @JsonProperty(value = "databaseType", required = true) + private SapDatabaseType databaseType; + + /* + * The deployment type. Eg: SingleServer/ThreeTier + */ + @JsonProperty(value = "deploymentType", required = true) + private SapDeploymentType deploymentType; + + /* + * The VM SKU for database instance. + */ + @JsonProperty(value = "dbVmSku", required = true) + private String dbVmSku; + + /** Creates an instance of SapDiskConfigurationsRequest class. */ + public SapDiskConfigurationsRequest() { + } + + /** + * Get the appLocation property: The geo-location where the SAP resources will be created. + * + * @return the appLocation value. + */ + public String appLocation() { + return this.appLocation; + } + + /** + * Set the appLocation property: The geo-location where the SAP resources will be created. + * + * @param appLocation the appLocation value to set. + * @return the SapDiskConfigurationsRequest object itself. + */ + public SapDiskConfigurationsRequest withAppLocation(String appLocation) { + this.appLocation = appLocation; + return this; + } + + /** + * Get the environment property: Defines the environment type - Production/Non Production. + * + * @return the environment value. + */ + public SapEnvironmentType environment() { + return this.environment; + } + + /** + * Set the environment property: Defines the environment type - Production/Non Production. + * + * @param environment the environment value to set. + * @return the SapDiskConfigurationsRequest object itself. + */ + public SapDiskConfigurationsRequest withEnvironment(SapEnvironmentType environment) { + this.environment = environment; + return this; + } + + /** + * Get the sapProduct property: Defines the SAP Product type. + * + * @return the sapProduct value. + */ + public SapProductType sapProduct() { + return this.sapProduct; + } + + /** + * Set the sapProduct property: Defines the SAP Product type. + * + * @param sapProduct the sapProduct value to set. + * @return the SapDiskConfigurationsRequest object itself. + */ + public SapDiskConfigurationsRequest withSapProduct(SapProductType sapProduct) { + this.sapProduct = sapProduct; + return this; + } + + /** + * Get the databaseType property: The database type. Eg: HANA, DB2, etc. + * + * @return the databaseType value. + */ + public SapDatabaseType databaseType() { + return this.databaseType; + } + + /** + * Set the databaseType property: The database type. Eg: HANA, DB2, etc. + * + * @param databaseType the databaseType value to set. + * @return the SapDiskConfigurationsRequest object itself. + */ + public SapDiskConfigurationsRequest withDatabaseType(SapDatabaseType databaseType) { + this.databaseType = databaseType; + return this; + } + + /** + * Get the deploymentType property: The deployment type. Eg: SingleServer/ThreeTier. + * + * @return the deploymentType value. + */ + public SapDeploymentType deploymentType() { + return this.deploymentType; + } + + /** + * Set the deploymentType property: The deployment type. Eg: SingleServer/ThreeTier. + * + * @param deploymentType the deploymentType value to set. + * @return the SapDiskConfigurationsRequest object itself. + */ + public SapDiskConfigurationsRequest withDeploymentType(SapDeploymentType deploymentType) { + this.deploymentType = deploymentType; + return this; + } + + /** + * Get the dbVmSku property: The VM SKU for database instance. + * + * @return the dbVmSku value. + */ + public String dbVmSku() { + return this.dbVmSku; + } + + /** + * Set the dbVmSku property: The VM SKU for database instance. + * + * @param dbVmSku the dbVmSku value to set. + * @return the SapDiskConfigurationsRequest object itself. + */ + public SapDiskConfigurationsRequest withDbVmSku(String dbVmSku) { + this.dbVmSku = dbVmSku; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (appLocation() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property appLocation in model SapDiskConfigurationsRequest")); + } + if (environment() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property environment in model SapDiskConfigurationsRequest")); + } + if (sapProduct() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sapProduct in model SapDiskConfigurationsRequest")); + } + if (databaseType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property databaseType in model SapDiskConfigurationsRequest")); + } + if (deploymentType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property deploymentType in model SapDiskConfigurationsRequest")); + } + if (dbVmSku() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property dbVmSku in model SapDiskConfigurationsRequest")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SapDiskConfigurationsRequest.class); +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapDiskConfigurationsResult.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapDiskConfigurationsResult.java new file mode 100644 index 0000000000000..9be4af8dc30cf --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapDiskConfigurationsResult.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapDiskConfigurationsResultInner; +import java.util.Map; + +/** An immutable client-side representation of SapDiskConfigurationsResult. */ +public interface SapDiskConfigurationsResult { + /** + * Gets the volumeConfigurations property: The disk configuration for the db volume. For HANA, Required volumes are: + * ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os'], Optional volume : ['backup']. + * + * @return the volumeConfigurations value. + */ + Map volumeConfigurations(); + + /** + * Gets the inner + * com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapDiskConfigurationsResultInner + * object. + * + * @return the inner object. + */ + SapDiskConfigurationsResultInner innerModel(); +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapEnvironmentType.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapEnvironmentType.java new file mode 100644 index 0000000000000..4043d49b9f213 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapEnvironmentType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines the environment type - Production/Non Production. */ +public final class SapEnvironmentType extends ExpandableStringEnum { + /** Static value NonProd for SapEnvironmentType. */ + public static final SapEnvironmentType NON_PROD = fromString("NonProd"); + + /** Static value Prod for SapEnvironmentType. */ + public static final SapEnvironmentType PROD = fromString("Prod"); + + /** + * Creates a new instance of SapEnvironmentType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SapEnvironmentType() { + } + + /** + * Creates or finds a SapEnvironmentType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SapEnvironmentType. + */ + @JsonCreator + public static SapEnvironmentType fromString(String name) { + return fromString(name, SapEnvironmentType.class); + } + + /** + * Gets known SapEnvironmentType values. + * + * @return known SapEnvironmentType values. + */ + public static Collection values() { + return values(SapEnvironmentType.class); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapHealthState.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapHealthState.java new file mode 100644 index 0000000000000..84993ca44028c --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapHealthState.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines the health of SAP Instances. */ +public final class SapHealthState extends ExpandableStringEnum { + /** Static value Unknown for SapHealthState. */ + public static final SapHealthState UNKNOWN = fromString("Unknown"); + + /** Static value Healthy for SapHealthState. */ + public static final SapHealthState HEALTHY = fromString("Healthy"); + + /** Static value Unhealthy for SapHealthState. */ + public static final SapHealthState UNHEALTHY = fromString("Unhealthy"); + + /** Static value Degraded for SapHealthState. */ + public static final SapHealthState DEGRADED = fromString("Degraded"); + + /** + * Creates a new instance of SapHealthState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SapHealthState() { + } + + /** + * Creates or finds a SapHealthState from its string representation. + * + * @param name a name to look for. + * @return the corresponding SapHealthState. + */ + @JsonCreator + public static SapHealthState fromString(String name) { + return fromString(name, SapHealthState.class); + } + + /** + * Gets known SapHealthState values. + * + * @return known SapHealthState values. + */ + public static Collection values() { + return values(SapHealthState.class); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapHighAvailabilityType.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapHighAvailabilityType.java new file mode 100644 index 0000000000000..a64d33ddbd8c7 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapHighAvailabilityType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The high availability type (AvailabilitySet or AvailabilityZone). */ +public final class SapHighAvailabilityType extends ExpandableStringEnum { + /** Static value AvailabilitySet for SapHighAvailabilityType. */ + public static final SapHighAvailabilityType AVAILABILITY_SET = fromString("AvailabilitySet"); + + /** Static value AvailabilityZone for SapHighAvailabilityType. */ + public static final SapHighAvailabilityType AVAILABILITY_ZONE = fromString("AvailabilityZone"); + + /** + * Creates a new instance of SapHighAvailabilityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SapHighAvailabilityType() { + } + + /** + * Creates or finds a SapHighAvailabilityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SapHighAvailabilityType. + */ + @JsonCreator + public static SapHighAvailabilityType fromString(String name) { + return fromString(name, SapHighAvailabilityType.class); + } + + /** + * Gets known SapHighAvailabilityType values. + * + * @return known SapHighAvailabilityType values. + */ + public static Collection values() { + return values(SapHighAvailabilityType.class); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapInstallWithoutOSConfigSoftwareConfiguration.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapInstallWithoutOSConfigSoftwareConfiguration.java new file mode 100644 index 0000000000000..6422db643d864 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapInstallWithoutOSConfigSoftwareConfiguration.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The SAP Software configuration Input when the software is to be installed by service without OS Configurations. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "softwareInstallationType") +@JsonTypeName("SAPInstallWithoutOSConfig") +@Fluent +public final class SapInstallWithoutOSConfigSoftwareConfiguration extends SoftwareConfiguration { + /* + * The URL to the SAP Build of Materials(BOM) file. + */ + @JsonProperty(value = "bomUrl", required = true) + private String bomUrl; + + /* + * The SAP bits storage account id. + */ + @JsonProperty(value = "sapBitsStorageAccountId", required = true) + private String sapBitsStorageAccountId; + + /* + * The software version to install. + */ + @JsonProperty(value = "softwareVersion", required = true) + private String softwareVersion; + + /* + * Gets or sets the HA software configuration. + */ + @JsonProperty(value = "highAvailabilitySoftwareConfiguration") + private HighAvailabilitySoftwareConfiguration highAvailabilitySoftwareConfiguration; + + /** Creates an instance of SapInstallWithoutOSConfigSoftwareConfiguration class. */ + public SapInstallWithoutOSConfigSoftwareConfiguration() { + } + + /** + * Get the bomUrl property: The URL to the SAP Build of Materials(BOM) file. + * + * @return the bomUrl value. + */ + public String bomUrl() { + return this.bomUrl; + } + + /** + * Set the bomUrl property: The URL to the SAP Build of Materials(BOM) file. + * + * @param bomUrl the bomUrl value to set. + * @return the SapInstallWithoutOSConfigSoftwareConfiguration object itself. + */ + public SapInstallWithoutOSConfigSoftwareConfiguration withBomUrl(String bomUrl) { + this.bomUrl = bomUrl; + return this; + } + + /** + * Get the sapBitsStorageAccountId property: The SAP bits storage account id. + * + * @return the sapBitsStorageAccountId value. + */ + public String sapBitsStorageAccountId() { + return this.sapBitsStorageAccountId; + } + + /** + * Set the sapBitsStorageAccountId property: The SAP bits storage account id. + * + * @param sapBitsStorageAccountId the sapBitsStorageAccountId value to set. + * @return the SapInstallWithoutOSConfigSoftwareConfiguration object itself. + */ + public SapInstallWithoutOSConfigSoftwareConfiguration withSapBitsStorageAccountId(String sapBitsStorageAccountId) { + this.sapBitsStorageAccountId = sapBitsStorageAccountId; + return this; + } + + /** + * Get the softwareVersion property: The software version to install. + * + * @return the softwareVersion value. + */ + public String softwareVersion() { + return this.softwareVersion; + } + + /** + * Set the softwareVersion property: The software version to install. + * + * @param softwareVersion the softwareVersion value to set. + * @return the SapInstallWithoutOSConfigSoftwareConfiguration object itself. + */ + public SapInstallWithoutOSConfigSoftwareConfiguration withSoftwareVersion(String softwareVersion) { + this.softwareVersion = softwareVersion; + return this; + } + + /** + * Get the highAvailabilitySoftwareConfiguration property: Gets or sets the HA software configuration. + * + * @return the highAvailabilitySoftwareConfiguration value. + */ + public HighAvailabilitySoftwareConfiguration highAvailabilitySoftwareConfiguration() { + return this.highAvailabilitySoftwareConfiguration; + } + + /** + * Set the highAvailabilitySoftwareConfiguration property: Gets or sets the HA software configuration. + * + * @param highAvailabilitySoftwareConfiguration the highAvailabilitySoftwareConfiguration value to set. + * @return the SapInstallWithoutOSConfigSoftwareConfiguration object itself. + */ + public SapInstallWithoutOSConfigSoftwareConfiguration withHighAvailabilitySoftwareConfiguration( + HighAvailabilitySoftwareConfiguration highAvailabilitySoftwareConfiguration) { + this.highAvailabilitySoftwareConfiguration = highAvailabilitySoftwareConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (bomUrl() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property bomUrl in model SapInstallWithoutOSConfigSoftwareConfiguration")); + } + if (sapBitsStorageAccountId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sapBitsStorageAccountId in model" + + " SapInstallWithoutOSConfigSoftwareConfiguration")); + } + if (softwareVersion() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property softwareVersion in model" + + " SapInstallWithoutOSConfigSoftwareConfiguration")); + } + if (highAvailabilitySoftwareConfiguration() != null) { + highAvailabilitySoftwareConfiguration().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SapInstallWithoutOSConfigSoftwareConfiguration.class); +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapProductType.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapProductType.java new file mode 100644 index 0000000000000..b58a1fa82930a --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapProductType.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines the SAP Product type. */ +public final class SapProductType extends ExpandableStringEnum { + /** Static value ECC for SapProductType. */ + public static final SapProductType ECC = fromString("ECC"); + + /** Static value S4HANA for SapProductType. */ + public static final SapProductType S4HANA = fromString("S4HANA"); + + /** Static value Other for SapProductType. */ + public static final SapProductType OTHER = fromString("Other"); + + /** + * Creates a new instance of SapProductType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SapProductType() { + } + + /** + * Creates or finds a SapProductType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SapProductType. + */ + @JsonCreator + public static SapProductType fromString(String name) { + return fromString(name, SapProductType.class); + } + + /** + * Gets known SapProductType values. + * + * @return known SapProductType values. + */ + public static Collection values() { + return values(SapProductType.class); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapSizingRecommendationRequest.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapSizingRecommendationRequest.java new file mode 100644 index 0000000000000..f327dc971fb1d --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapSizingRecommendationRequest.java @@ -0,0 +1,291 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SAP Sizing Recommendation request. */ +@Fluent +public final class SapSizingRecommendationRequest { + /* + * The geo-location where the resource is to be created. + */ + @JsonProperty(value = "appLocation", required = true) + private String appLocation; + + /* + * Defines the environment type - Production/Non Production. + */ + @JsonProperty(value = "environment", required = true) + private SapEnvironmentType environment; + + /* + * Defines the SAP Product type. + */ + @JsonProperty(value = "sapProduct", required = true) + private SapProductType sapProduct; + + /* + * The deployment type. Eg: SingleServer/ThreeTier + */ + @JsonProperty(value = "deploymentType", required = true) + private SapDeploymentType deploymentType; + + /* + * The SAP Application Performance Standard measurement. + */ + @JsonProperty(value = "saps", required = true) + private long saps; + + /* + * The database memory configuration. + */ + @JsonProperty(value = "dbMemory", required = true) + private long dbMemory; + + /* + * The database type. + */ + @JsonProperty(value = "databaseType", required = true) + private SapDatabaseType databaseType; + + /* + * The DB scale method. + */ + @JsonProperty(value = "dbScaleMethod") + private SapDatabaseScaleMethod dbScaleMethod; + + /* + * The high availability type. + */ + @JsonProperty(value = "highAvailabilityType") + private SapHighAvailabilityType highAvailabilityType; + + /** Creates an instance of SapSizingRecommendationRequest class. */ + public SapSizingRecommendationRequest() { + } + + /** + * Get the appLocation property: The geo-location where the resource is to be created. + * + * @return the appLocation value. + */ + public String appLocation() { + return this.appLocation; + } + + /** + * Set the appLocation property: The geo-location where the resource is to be created. + * + * @param appLocation the appLocation value to set. + * @return the SapSizingRecommendationRequest object itself. + */ + public SapSizingRecommendationRequest withAppLocation(String appLocation) { + this.appLocation = appLocation; + return this; + } + + /** + * Get the environment property: Defines the environment type - Production/Non Production. + * + * @return the environment value. + */ + public SapEnvironmentType environment() { + return this.environment; + } + + /** + * Set the environment property: Defines the environment type - Production/Non Production. + * + * @param environment the environment value to set. + * @return the SapSizingRecommendationRequest object itself. + */ + public SapSizingRecommendationRequest withEnvironment(SapEnvironmentType environment) { + this.environment = environment; + return this; + } + + /** + * Get the sapProduct property: Defines the SAP Product type. + * + * @return the sapProduct value. + */ + public SapProductType sapProduct() { + return this.sapProduct; + } + + /** + * Set the sapProduct property: Defines the SAP Product type. + * + * @param sapProduct the sapProduct value to set. + * @return the SapSizingRecommendationRequest object itself. + */ + public SapSizingRecommendationRequest withSapProduct(SapProductType sapProduct) { + this.sapProduct = sapProduct; + return this; + } + + /** + * Get the deploymentType property: The deployment type. Eg: SingleServer/ThreeTier. + * + * @return the deploymentType value. + */ + public SapDeploymentType deploymentType() { + return this.deploymentType; + } + + /** + * Set the deploymentType property: The deployment type. Eg: SingleServer/ThreeTier. + * + * @param deploymentType the deploymentType value to set. + * @return the SapSizingRecommendationRequest object itself. + */ + public SapSizingRecommendationRequest withDeploymentType(SapDeploymentType deploymentType) { + this.deploymentType = deploymentType; + return this; + } + + /** + * Get the saps property: The SAP Application Performance Standard measurement. + * + * @return the saps value. + */ + public long saps() { + return this.saps; + } + + /** + * Set the saps property: The SAP Application Performance Standard measurement. + * + * @param saps the saps value to set. + * @return the SapSizingRecommendationRequest object itself. + */ + public SapSizingRecommendationRequest withSaps(long saps) { + this.saps = saps; + return this; + } + + /** + * Get the dbMemory property: The database memory configuration. + * + * @return the dbMemory value. + */ + public long dbMemory() { + return this.dbMemory; + } + + /** + * Set the dbMemory property: The database memory configuration. + * + * @param dbMemory the dbMemory value to set. + * @return the SapSizingRecommendationRequest object itself. + */ + public SapSizingRecommendationRequest withDbMemory(long dbMemory) { + this.dbMemory = dbMemory; + return this; + } + + /** + * Get the databaseType property: The database type. + * + * @return the databaseType value. + */ + public SapDatabaseType databaseType() { + return this.databaseType; + } + + /** + * Set the databaseType property: The database type. + * + * @param databaseType the databaseType value to set. + * @return the SapSizingRecommendationRequest object itself. + */ + public SapSizingRecommendationRequest withDatabaseType(SapDatabaseType databaseType) { + this.databaseType = databaseType; + return this; + } + + /** + * Get the dbScaleMethod property: The DB scale method. + * + * @return the dbScaleMethod value. + */ + public SapDatabaseScaleMethod dbScaleMethod() { + return this.dbScaleMethod; + } + + /** + * Set the dbScaleMethod property: The DB scale method. + * + * @param dbScaleMethod the dbScaleMethod value to set. + * @return the SapSizingRecommendationRequest object itself. + */ + public SapSizingRecommendationRequest withDbScaleMethod(SapDatabaseScaleMethod dbScaleMethod) { + this.dbScaleMethod = dbScaleMethod; + return this; + } + + /** + * Get the highAvailabilityType property: The high availability type. + * + * @return the highAvailabilityType value. + */ + public SapHighAvailabilityType highAvailabilityType() { + return this.highAvailabilityType; + } + + /** + * Set the highAvailabilityType property: The high availability type. + * + * @param highAvailabilityType the highAvailabilityType value to set. + * @return the SapSizingRecommendationRequest object itself. + */ + public SapSizingRecommendationRequest withHighAvailabilityType(SapHighAvailabilityType highAvailabilityType) { + this.highAvailabilityType = highAvailabilityType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (appLocation() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property appLocation in model SapSizingRecommendationRequest")); + } + if (environment() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property environment in model SapSizingRecommendationRequest")); + } + if (sapProduct() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sapProduct in model SapSizingRecommendationRequest")); + } + if (deploymentType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property deploymentType in model SapSizingRecommendationRequest")); + } + if (databaseType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property databaseType in model SapSizingRecommendationRequest")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SapSizingRecommendationRequest.class); +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapSizingRecommendationResult.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapSizingRecommendationResult.java new file mode 100644 index 0000000000000..fb8a5f930c56b --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapSizingRecommendationResult.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapSizingRecommendationResultInner; + +/** An immutable client-side representation of SapSizingRecommendationResult. */ +public interface SapSizingRecommendationResult { + /** + * Gets the inner + * com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapSizingRecommendationResultInner + * object. + * + * @return the inner object. + */ + SapSizingRecommendationResultInner innerModel(); +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapSoftwareInstallationType.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapSoftwareInstallationType.java new file mode 100644 index 0000000000000..5773eaf2b6320 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapSoftwareInstallationType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The SAP software installation Type. */ +public final class SapSoftwareInstallationType extends ExpandableStringEnum { + /** Static value ServiceInitiated for SapSoftwareInstallationType. */ + public static final SapSoftwareInstallationType SERVICE_INITIATED = fromString("ServiceInitiated"); + + /** Static value SAPInstallWithoutOSConfig for SapSoftwareInstallationType. */ + public static final SapSoftwareInstallationType SAPINSTALL_WITHOUT_OSCONFIG = + fromString("SAPInstallWithoutOSConfig"); + + /** Static value External for SapSoftwareInstallationType. */ + public static final SapSoftwareInstallationType EXTERNAL = fromString("External"); + + /** + * Creates a new instance of SapSoftwareInstallationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SapSoftwareInstallationType() { + } + + /** + * Creates or finds a SapSoftwareInstallationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SapSoftwareInstallationType. + */ + @JsonCreator + public static SapSoftwareInstallationType fromString(String name) { + return fromString(name, SapSoftwareInstallationType.class); + } + + /** + * Gets known SapSoftwareInstallationType values. + * + * @return known SapSoftwareInstallationType values. + */ + public static Collection values() { + return values(SapSoftwareInstallationType.class); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapSupportedResourceSkusResult.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapSupportedResourceSkusResult.java new file mode 100644 index 0000000000000..9d9f1303b747a --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapSupportedResourceSkusResult.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapSupportedResourceSkusResultInner; +import java.util.List; + +/** An immutable client-side representation of SapSupportedResourceSkusResult. */ +public interface SapSupportedResourceSkusResult { + /** + * Gets the supportedSkus property: Gets the list of SAP supported SKUs. + * + * @return the supportedSkus value. + */ + List supportedSkus(); + + /** + * Gets the inner + * com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapSupportedResourceSkusResultInner + * object. + * + * @return the inner object. + */ + SapSupportedResourceSkusResultInner innerModel(); +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapSupportedSku.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapSupportedSku.java new file mode 100644 index 0000000000000..fe9976c6fe716 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapSupportedSku.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SAP supported SKU. */ +@Fluent +public final class SapSupportedSku { + /* + * The VM Sku. + */ + @JsonProperty(value = "vmSku") + private String vmSku; + + /* + * True if the Sku is certified for App server in the SAP system. + */ + @JsonProperty(value = "isAppServerCertified") + private Boolean isAppServerCertified; + + /* + * True if the Sku is certified for Database server in the SAP system. + */ + @JsonProperty(value = "isDatabaseCertified") + private Boolean isDatabaseCertified; + + /** Creates an instance of SapSupportedSku class. */ + public SapSupportedSku() { + } + + /** + * Get the vmSku property: The VM Sku. + * + * @return the vmSku value. + */ + public String vmSku() { + return this.vmSku; + } + + /** + * Set the vmSku property: The VM Sku. + * + * @param vmSku the vmSku value to set. + * @return the SapSupportedSku object itself. + */ + public SapSupportedSku withVmSku(String vmSku) { + this.vmSku = vmSku; + return this; + } + + /** + * Get the isAppServerCertified property: True if the Sku is certified for App server in the SAP system. + * + * @return the isAppServerCertified value. + */ + public Boolean isAppServerCertified() { + return this.isAppServerCertified; + } + + /** + * Set the isAppServerCertified property: True if the Sku is certified for App server in the SAP system. + * + * @param isAppServerCertified the isAppServerCertified value to set. + * @return the SapSupportedSku object itself. + */ + public SapSupportedSku withIsAppServerCertified(Boolean isAppServerCertified) { + this.isAppServerCertified = isAppServerCertified; + return this; + } + + /** + * Get the isDatabaseCertified property: True if the Sku is certified for Database server in the SAP system. + * + * @return the isDatabaseCertified value. + */ + public Boolean isDatabaseCertified() { + return this.isDatabaseCertified; + } + + /** + * Set the isDatabaseCertified property: True if the Sku is certified for Database server in the SAP system. + * + * @param isDatabaseCertified the isDatabaseCertified value to set. + * @return the SapSupportedSku object itself. + */ + public SapSupportedSku withIsDatabaseCertified(Boolean isDatabaseCertified) { + this.isDatabaseCertified = isDatabaseCertified; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapSupportedSkusRequest.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapSupportedSkusRequest.java new file mode 100644 index 0000000000000..6bae0eb338cef --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapSupportedSkusRequest.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The SAP request to get list of supported SKUs. */ +@Fluent +public final class SapSupportedSkusRequest { + /* + * The geo-location where the resource is to be created. + */ + @JsonProperty(value = "appLocation", required = true) + private String appLocation; + + /* + * Defines the environment type - Production/Non Production. + */ + @JsonProperty(value = "environment", required = true) + private SapEnvironmentType environment; + + /* + * Defines the SAP Product type. + */ + @JsonProperty(value = "sapProduct", required = true) + private SapProductType sapProduct; + + /* + * The deployment type. Eg: SingleServer/ThreeTier + */ + @JsonProperty(value = "deploymentType", required = true) + private SapDeploymentType deploymentType; + + /* + * The database type. Eg: HANA, DB2, etc + */ + @JsonProperty(value = "databaseType", required = true) + private SapDatabaseType databaseType; + + /* + * The high availability type. + */ + @JsonProperty(value = "highAvailabilityType") + private SapHighAvailabilityType highAvailabilityType; + + /** Creates an instance of SapSupportedSkusRequest class. */ + public SapSupportedSkusRequest() { + } + + /** + * Get the appLocation property: The geo-location where the resource is to be created. + * + * @return the appLocation value. + */ + public String appLocation() { + return this.appLocation; + } + + /** + * Set the appLocation property: The geo-location where the resource is to be created. + * + * @param appLocation the appLocation value to set. + * @return the SapSupportedSkusRequest object itself. + */ + public SapSupportedSkusRequest withAppLocation(String appLocation) { + this.appLocation = appLocation; + return this; + } + + /** + * Get the environment property: Defines the environment type - Production/Non Production. + * + * @return the environment value. + */ + public SapEnvironmentType environment() { + return this.environment; + } + + /** + * Set the environment property: Defines the environment type - Production/Non Production. + * + * @param environment the environment value to set. + * @return the SapSupportedSkusRequest object itself. + */ + public SapSupportedSkusRequest withEnvironment(SapEnvironmentType environment) { + this.environment = environment; + return this; + } + + /** + * Get the sapProduct property: Defines the SAP Product type. + * + * @return the sapProduct value. + */ + public SapProductType sapProduct() { + return this.sapProduct; + } + + /** + * Set the sapProduct property: Defines the SAP Product type. + * + * @param sapProduct the sapProduct value to set. + * @return the SapSupportedSkusRequest object itself. + */ + public SapSupportedSkusRequest withSapProduct(SapProductType sapProduct) { + this.sapProduct = sapProduct; + return this; + } + + /** + * Get the deploymentType property: The deployment type. Eg: SingleServer/ThreeTier. + * + * @return the deploymentType value. + */ + public SapDeploymentType deploymentType() { + return this.deploymentType; + } + + /** + * Set the deploymentType property: The deployment type. Eg: SingleServer/ThreeTier. + * + * @param deploymentType the deploymentType value to set. + * @return the SapSupportedSkusRequest object itself. + */ + public SapSupportedSkusRequest withDeploymentType(SapDeploymentType deploymentType) { + this.deploymentType = deploymentType; + return this; + } + + /** + * Get the databaseType property: The database type. Eg: HANA, DB2, etc. + * + * @return the databaseType value. + */ + public SapDatabaseType databaseType() { + return this.databaseType; + } + + /** + * Set the databaseType property: The database type. Eg: HANA, DB2, etc. + * + * @param databaseType the databaseType value to set. + * @return the SapSupportedSkusRequest object itself. + */ + public SapSupportedSkusRequest withDatabaseType(SapDatabaseType databaseType) { + this.databaseType = databaseType; + return this; + } + + /** + * Get the highAvailabilityType property: The high availability type. + * + * @return the highAvailabilityType value. + */ + public SapHighAvailabilityType highAvailabilityType() { + return this.highAvailabilityType; + } + + /** + * Set the highAvailabilityType property: The high availability type. + * + * @param highAvailabilityType the highAvailabilityType value to set. + * @return the SapSupportedSkusRequest object itself. + */ + public SapSupportedSkusRequest withHighAvailabilityType(SapHighAvailabilityType highAvailabilityType) { + this.highAvailabilityType = highAvailabilityType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (appLocation() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property appLocation in model SapSupportedSkusRequest")); + } + if (environment() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property environment in model SapSupportedSkusRequest")); + } + if (sapProduct() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sapProduct in model SapSupportedSkusRequest")); + } + if (deploymentType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property deploymentType in model SapSupportedSkusRequest")); + } + if (databaseType() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property databaseType in model SapSupportedSkusRequest")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SapSupportedSkusRequest.class); +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapVirtualInstance.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapVirtualInstance.java new file mode 100644 index 0000000000000..a8ef84213ba86 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapVirtualInstance.java @@ -0,0 +1,450 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapVirtualInstanceInner; +import java.util.Map; + +/** An immutable client-side representation of SapVirtualInstance. */ +public interface SapVirtualInstance { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the identity property: Managed service identity (user assigned identities). + * + * @return the identity value. + */ + UserAssignedServiceIdentity identity(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the environment property: Defines the environment type - Production/Non Production. + * + * @return the environment value. + */ + SapEnvironmentType environment(); + + /** + * Gets the sapProduct property: Defines the SAP Product type. + * + * @return the sapProduct value. + */ + SapProductType sapProduct(); + + /** + * Gets the managedResourcesNetworkAccessType property: Specifies the network access configuration for the resources + * that will be deployed in the Managed Resource Group. The options to choose from are Public and Private. If + * 'Private' is chosen, the Storage Account service tag should be enabled on the subnets in which the SAP VMs exist. + * This is required for establishing connectivity between VM extensions and the managed resource group storage + * account. This setting is currently applicable only to Storage Account. Learn more here + * https://go.microsoft.com/fwlink/?linkid=2247228. + * + * @return the managedResourcesNetworkAccessType value. + */ + ManagedResourcesNetworkAccessType managedResourcesNetworkAccessType(); + + /** + * Gets the configuration property: 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. + * + * @return the configuration value. + */ + SapConfiguration configuration(); + + /** + * Gets the managedResourceGroupConfiguration property: Managed resource group configuration. + * + * @return the managedResourceGroupConfiguration value. + */ + ManagedRGConfiguration managedResourceGroupConfiguration(); + + /** + * Gets the status property: Defines the SAP Instance status. + * + * @return the status value. + */ + SapVirtualInstanceStatus status(); + + /** + * Gets the health property: Defines the health of SAP Instances. + * + * @return the health value. + */ + SapHealthState health(); + + /** + * Gets the state property: Defines the Virtual Instance for SAP state. + * + * @return the state value. + */ + SapVirtualInstanceState state(); + + /** + * Gets the provisioningState property: Defines the provisioning states. + * + * @return the provisioningState value. + */ + SapVirtualInstanceProvisioningState provisioningState(); + + /** + * Gets the errors property: Indicates any errors on the Virtual Instance for SAP solutions resource. + * + * @return the errors value. + */ + SapVirtualInstanceError errors(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner + * com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapVirtualInstanceInner + * object. + * + * @return the inner object. + */ + SapVirtualInstanceInner innerModel(); + + /** The entirety of the SapVirtualInstance definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithEnvironment, + DefinitionStages.WithSapProduct, + DefinitionStages.WithConfiguration, + DefinitionStages.WithCreate { + } + + /** The SapVirtualInstance definition stages. */ + interface DefinitionStages { + /** The first stage of the SapVirtualInstance definition. */ + interface Blank extends WithLocation { + } + + /** The stage of the SapVirtualInstance definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** The stage of the SapVirtualInstance definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithEnvironment withExistingResourceGroup(String resourceGroupName); + } + + /** The stage of the SapVirtualInstance definition allowing to specify environment. */ + interface WithEnvironment { + /** + * Specifies the environment property: Defines the environment type - Production/Non Production.. + * + * @param environment Defines the environment type - Production/Non Production. + * @return the next definition stage. + */ + WithSapProduct withEnvironment(SapEnvironmentType environment); + } + + /** The stage of the SapVirtualInstance definition allowing to specify sapProduct. */ + interface WithSapProduct { + /** + * Specifies the sapProduct property: Defines the SAP Product type.. + * + * @param sapProduct Defines the SAP Product type. + * @return the next definition stage. + */ + WithConfiguration withSapProduct(SapProductType sapProduct); + } + + /** The stage of the SapVirtualInstance definition allowing to specify configuration. */ + interface WithConfiguration { + /** + * Specifies the configuration property: 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. + * + * @param configuration 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. + * @return the next definition stage. + */ + WithCreate withConfiguration(SapConfiguration configuration); + } + + /** + * The stage of the SapVirtualInstance definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithIdentity, + DefinitionStages.WithManagedResourcesNetworkAccessType, + DefinitionStages.WithManagedResourceGroupConfiguration { + /** + * Executes the create request. + * + * @return the created resource. + */ + SapVirtualInstance create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SapVirtualInstance create(Context context); + } + + /** The stage of the SapVirtualInstance definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** The stage of the SapVirtualInstance definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: Managed service identity (user assigned identities). + * + * @param identity Managed service identity (user assigned identities). + * @return the next definition stage. + */ + WithCreate withIdentity(UserAssignedServiceIdentity identity); + } + + /** The stage of the SapVirtualInstance definition allowing to specify managedResourcesNetworkAccessType. */ + interface WithManagedResourcesNetworkAccessType { + /** + * Specifies the managedResourcesNetworkAccessType property: Specifies the network access configuration for + * the resources that will be deployed in the Managed Resource Group. The options to choose from are Public + * and Private. If 'Private' is chosen, the Storage Account service tag should be enabled on the subnets in + * which the SAP VMs exist. This is required for establishing connectivity between VM extensions and the + * managed resource group storage account. This setting is currently applicable only to Storage Account. + * Learn more here https://go.microsoft.com/fwlink/?linkid=2247228. + * + * @param managedResourcesNetworkAccessType Specifies the network access configuration for the resources + * that will be deployed in the Managed Resource Group. The options to choose from are Public and + * Private. If 'Private' is chosen, the Storage Account service tag should be enabled on the subnets in + * which the SAP VMs exist. This is required for establishing connectivity between VM extensions and the + * managed resource group storage account. This setting is currently applicable only to Storage Account. + * Learn more here https://go.microsoft.com/fwlink/?linkid=2247228. + * @return the next definition stage. + */ + WithCreate withManagedResourcesNetworkAccessType( + ManagedResourcesNetworkAccessType managedResourcesNetworkAccessType); + } + + /** The stage of the SapVirtualInstance definition allowing to specify managedResourceGroupConfiguration. */ + interface WithManagedResourceGroupConfiguration { + /** + * Specifies the managedResourceGroupConfiguration property: Managed resource group configuration. + * + * @param managedResourceGroupConfiguration Managed resource group configuration. + * @return the next definition stage. + */ + WithCreate withManagedResourceGroupConfiguration(ManagedRGConfiguration managedResourceGroupConfiguration); + } + } + + /** + * Begins update for the SapVirtualInstance resource. + * + * @return the stage of resource update. + */ + SapVirtualInstance.Update update(); + + /** The template for SapVirtualInstance update. */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SapVirtualInstance apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SapVirtualInstance apply(Context context); + } + + /** The SapVirtualInstance update stages. */ + interface UpdateStages { + /** The stage of the SapVirtualInstance update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Gets or sets the Resource tags.. + * + * @param tags Gets or sets the Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + + /** The stage of the SapVirtualInstance update allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: Managed service identity (user assigned identities). + * + * @param identity Managed service identity (user assigned identities). + * @return the next definition stage. + */ + Update withIdentity(UserAssignedServiceIdentity identity); + } + + /** The stage of the SapVirtualInstance update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Defines the properties to be updated for Virtual Instance for SAP.. + * + * @param properties Defines the properties to be updated for Virtual Instance for SAP. + * @return the next definition stage. + */ + Update withProperties(UpdateSapVirtualInstanceProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SapVirtualInstance refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SapVirtualInstance refresh(Context context); + + /** + * Starts the SAP application, that is the Central Services instance and Application server instances. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + OperationStatusResult start(); + + /** + * Starts the SAP application, that is the Central Services instance and Application server instances. + * + * @param body The Virtual Instance for SAP solutions resource start request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + OperationStatusResult start(StartRequest body, Context context); + + /** + * Stops the SAP Application, that is the Application server instances and Central Services instance. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + OperationStatusResult stop(); + + /** + * Stops the SAP Application, that is the Application server instances and Central Services instance. + * + * @param body The Virtual Instance for SAP solutions resource stop request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + OperationStatusResult stop(StopRequest body, Context context); +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapVirtualInstanceError.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapVirtualInstanceError.java new file mode 100644 index 0000000000000..dd4bb6bd4031f --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapVirtualInstanceError.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An error response from the Virtual Instance for SAP Workload service. */ +@Fluent +public final class SapVirtualInstanceError { + /* + * The Virtual Instance for SAP error body. + */ + @JsonProperty(value = "properties") + private ErrorDefinition properties; + + /** Creates an instance of SapVirtualInstanceError class. */ + public SapVirtualInstanceError() { + } + + /** + * Get the properties property: The Virtual Instance for SAP error body. + * + * @return the properties value. + */ + public ErrorDefinition properties() { + return this.properties; + } + + /** + * Set the properties property: The Virtual Instance for SAP error body. + * + * @param properties the properties value to set. + * @return the SapVirtualInstanceError object itself. + */ + public SapVirtualInstanceError withProperties(ErrorDefinition properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapVirtualInstanceList.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapVirtualInstanceList.java new file mode 100644 index 0000000000000..3610fbbdfa3d7 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapVirtualInstanceList.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapVirtualInstanceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Defines the collection of Virtual Instance for SAP solutions resources. */ +@Fluent +public final class SapVirtualInstanceList { + /* + * Gets the list of Virtual Instances for SAP solutions resources. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Gets the value of next link. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of SapVirtualInstanceList class. */ + public SapVirtualInstanceList() { + } + + /** + * Get the value property: Gets the list of Virtual Instances for SAP solutions resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Gets the list of Virtual Instances for SAP solutions resources. + * + * @param value the value value to set. + * @return the SapVirtualInstanceList object itself. + */ + public SapVirtualInstanceList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Gets the value of next link. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Gets the value of next link. + * + * @param nextLink the nextLink value to set. + * @return the SapVirtualInstanceList object itself. + */ + public SapVirtualInstanceList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapVirtualInstanceProvisioningState.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapVirtualInstanceProvisioningState.java new file mode 100644 index 0000000000000..5dd6009cd300f --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapVirtualInstanceProvisioningState.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines the provisioning states. */ +public final class SapVirtualInstanceProvisioningState + extends ExpandableStringEnum { + /** Static value Succeeded for SapVirtualInstanceProvisioningState. */ + public static final SapVirtualInstanceProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Updating for SapVirtualInstanceProvisioningState. */ + public static final SapVirtualInstanceProvisioningState UPDATING = fromString("Updating"); + + /** Static value Creating for SapVirtualInstanceProvisioningState. */ + public static final SapVirtualInstanceProvisioningState CREATING = fromString("Creating"); + + /** Static value Failed for SapVirtualInstanceProvisioningState. */ + public static final SapVirtualInstanceProvisioningState FAILED = fromString("Failed"); + + /** Static value Deleting for SapVirtualInstanceProvisioningState. */ + public static final SapVirtualInstanceProvisioningState DELETING = fromString("Deleting"); + + /** Static value Canceled for SapVirtualInstanceProvisioningState. */ + public static final SapVirtualInstanceProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of SapVirtualInstanceProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SapVirtualInstanceProvisioningState() { + } + + /** + * Creates or finds a SapVirtualInstanceProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding SapVirtualInstanceProvisioningState. + */ + @JsonCreator + public static SapVirtualInstanceProvisioningState fromString(String name) { + return fromString(name, SapVirtualInstanceProvisioningState.class); + } + + /** + * Gets known SapVirtualInstanceProvisioningState values. + * + * @return known SapVirtualInstanceProvisioningState values. + */ + public static Collection values() { + return values(SapVirtualInstanceProvisioningState.class); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapVirtualInstanceState.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapVirtualInstanceState.java new file mode 100644 index 0000000000000..e8cd19a0e6712 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapVirtualInstanceState.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines the Virtual Instance for SAP state. */ +public final class SapVirtualInstanceState extends ExpandableStringEnum { + /** Static value InfrastructureDeploymentPending for SapVirtualInstanceState. */ + public static final SapVirtualInstanceState INFRASTRUCTURE_DEPLOYMENT_PENDING = + fromString("InfrastructureDeploymentPending"); + + /** Static value InfrastructureDeploymentInProgress for SapVirtualInstanceState. */ + public static final SapVirtualInstanceState INFRASTRUCTURE_DEPLOYMENT_IN_PROGRESS = + fromString("InfrastructureDeploymentInProgress"); + + /** Static value InfrastructureDeploymentFailed for SapVirtualInstanceState. */ + public static final SapVirtualInstanceState INFRASTRUCTURE_DEPLOYMENT_FAILED = + fromString("InfrastructureDeploymentFailed"); + + /** Static value SoftwareInstallationPending for SapVirtualInstanceState. */ + public static final SapVirtualInstanceState SOFTWARE_INSTALLATION_PENDING = + fromString("SoftwareInstallationPending"); + + /** Static value SoftwareInstallationInProgress for SapVirtualInstanceState. */ + public static final SapVirtualInstanceState SOFTWARE_INSTALLATION_IN_PROGRESS = + fromString("SoftwareInstallationInProgress"); + + /** Static value SoftwareInstallationFailed for SapVirtualInstanceState. */ + public static final SapVirtualInstanceState SOFTWARE_INSTALLATION_FAILED = fromString("SoftwareInstallationFailed"); + + /** Static value SoftwareDetectionInProgress for SapVirtualInstanceState. */ + public static final SapVirtualInstanceState SOFTWARE_DETECTION_IN_PROGRESS = + fromString("SoftwareDetectionInProgress"); + + /** Static value SoftwareDetectionFailed for SapVirtualInstanceState. */ + public static final SapVirtualInstanceState SOFTWARE_DETECTION_FAILED = fromString("SoftwareDetectionFailed"); + + /** Static value DiscoveryPending for SapVirtualInstanceState. */ + public static final SapVirtualInstanceState DISCOVERY_PENDING = fromString("DiscoveryPending"); + + /** Static value DiscoveryInProgress for SapVirtualInstanceState. */ + public static final SapVirtualInstanceState DISCOVERY_IN_PROGRESS = fromString("DiscoveryInProgress"); + + /** Static value DiscoveryFailed for SapVirtualInstanceState. */ + public static final SapVirtualInstanceState DISCOVERY_FAILED = fromString("DiscoveryFailed"); + + /** Static value RegistrationComplete for SapVirtualInstanceState. */ + public static final SapVirtualInstanceState REGISTRATION_COMPLETE = fromString("RegistrationComplete"); + + /** Static value ACSSInstallationBlocked for SapVirtualInstanceState. */ + public static final SapVirtualInstanceState ACSSINSTALLATION_BLOCKED = fromString("ACSSInstallationBlocked"); + + /** + * Creates a new instance of SapVirtualInstanceState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SapVirtualInstanceState() { + } + + /** + * Creates or finds a SapVirtualInstanceState from its string representation. + * + * @param name a name to look for. + * @return the corresponding SapVirtualInstanceState. + */ + @JsonCreator + public static SapVirtualInstanceState fromString(String name) { + return fromString(name, SapVirtualInstanceState.class); + } + + /** + * Gets known SapVirtualInstanceState values. + * + * @return known SapVirtualInstanceState values. + */ + public static Collection values() { + return values(SapVirtualInstanceState.class); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapVirtualInstanceStatus.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapVirtualInstanceStatus.java new file mode 100644 index 0000000000000..ba385a66400be --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapVirtualInstanceStatus.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines the SAP Instance status. */ +public final class SapVirtualInstanceStatus extends ExpandableStringEnum { + /** Static value Starting for SapVirtualInstanceStatus. */ + public static final SapVirtualInstanceStatus STARTING = fromString("Starting"); + + /** Static value Running for SapVirtualInstanceStatus. */ + public static final SapVirtualInstanceStatus RUNNING = fromString("Running"); + + /** Static value Stopping for SapVirtualInstanceStatus. */ + public static final SapVirtualInstanceStatus STOPPING = fromString("Stopping"); + + /** Static value Offline for SapVirtualInstanceStatus. */ + public static final SapVirtualInstanceStatus OFFLINE = fromString("Offline"); + + /** Static value PartiallyRunning for SapVirtualInstanceStatus. */ + public static final SapVirtualInstanceStatus PARTIALLY_RUNNING = fromString("PartiallyRunning"); + + /** Static value Unavailable for SapVirtualInstanceStatus. */ + public static final SapVirtualInstanceStatus UNAVAILABLE = fromString("Unavailable"); + + /** Static value SoftShutdown for SapVirtualInstanceStatus. */ + public static final SapVirtualInstanceStatus SOFT_SHUTDOWN = fromString("SoftShutdown"); + + /** + * Creates a new instance of SapVirtualInstanceStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SapVirtualInstanceStatus() { + } + + /** + * Creates or finds a SapVirtualInstanceStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding SapVirtualInstanceStatus. + */ + @JsonCreator + public static SapVirtualInstanceStatus fromString(String name) { + return fromString(name, SapVirtualInstanceStatus.class); + } + + /** + * Gets known SapVirtualInstanceStatus values. + * + * @return known SapVirtualInstanceStatus values. + */ + public static Collection values() { + return values(SapVirtualInstanceStatus.class); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapVirtualInstances.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapVirtualInstances.java new file mode 100644 index 0000000000000..40e8ae19f3da8 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SapVirtualInstances.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of SapVirtualInstances. */ +public interface SapVirtualInstances { + /** + * Gets a Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Virtual Instance for SAP solutions resource along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String sapVirtualInstanceName, Context context); + + /** + * Gets a Virtual Instance for SAP solutions resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Virtual Instance for SAP solutions resource. + */ + SapVirtualInstance getByResourceGroup(String resourceGroupName, String sapVirtualInstanceName); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String sapVirtualInstanceName); + + /** + * 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. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String sapVirtualInstanceName, Context context); + + /** + * Gets all Virtual Instances for SAP solutions resources in a Resource Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Virtual Instances for SAP solutions resources in a Resource Group as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets all Virtual Instances for SAP solutions resources in a Resource Group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Virtual Instances for SAP solutions resources in a Resource Group as paginated response with {@link + * PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets all Virtual Instances for SAP solutions resources in a Subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Virtual Instances for SAP solutions resources in a Subscription as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(); + + /** + * Gets all Virtual Instances for SAP solutions resources in a Subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all Virtual Instances for SAP solutions resources in a Subscription as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Starts the SAP application, that is the Central Services instance and Application server instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + OperationStatusResult start(String resourceGroupName, String sapVirtualInstanceName); + + /** + * Starts the SAP application, that is the Central Services instance and Application server instances. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param body The Virtual Instance for SAP solutions resource start request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + OperationStatusResult start( + String resourceGroupName, String sapVirtualInstanceName, StartRequest body, Context context); + + /** + * Stops the SAP Application, that is the Application server instances and Central Services instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + OperationStatusResult stop(String resourceGroupName, String sapVirtualInstanceName); + + /** + * Stops the SAP Application, that is the Application server instances and Central Services instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param sapVirtualInstanceName The name of the Virtual Instances for SAP solutions resource. + * @param body The Virtual Instance for SAP solutions resource stop request body. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + OperationStatusResult stop( + String resourceGroupName, String sapVirtualInstanceName, StopRequest body, Context context); + + /** + * Gets a Virtual Instance for SAP solutions resource. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Virtual Instance for SAP solutions resource along with {@link Response}. + */ + SapVirtualInstance getById(String id); + + /** + * Gets a Virtual Instance for SAP solutions resource. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Virtual Instance for SAP solutions resource along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * 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. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * 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. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SapVirtualInstance resource. + * + * @param name resource name. + * @return the first stage of the new SapVirtualInstance definition. + */ + SapVirtualInstance.DefinitionStages.Blank define(String name); +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ServiceInitiatedSoftwareConfiguration.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ServiceInitiatedSoftwareConfiguration.java new file mode 100644 index 0000000000000..2f86a3bb23b64 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ServiceInitiatedSoftwareConfiguration.java @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The SAP Software configuration Input when the software is to be installed by service. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "softwareInstallationType") +@JsonTypeName("ServiceInitiated") +@Fluent +public final class ServiceInitiatedSoftwareConfiguration extends SoftwareConfiguration { + /* + * The URL to the SAP Build of Materials(BOM) file. + */ + @JsonProperty(value = "bomUrl", required = true) + private String bomUrl; + + /* + * The software version to install. + */ + @JsonProperty(value = "softwareVersion", required = true) + private String softwareVersion; + + /* + * The SAP bits storage account id. + */ + @JsonProperty(value = "sapBitsStorageAccountId", required = true) + private String sapBitsStorageAccountId; + + /* + * The FQDN to set for the SAP system during install. + */ + @JsonProperty(value = "sapFqdn", required = true) + private String sapFqdn; + + /* + * The SSH private key. + */ + @JsonProperty(value = "sshPrivateKey") + private String sshPrivateKey; + + /* + * Gets or sets the HA software configuration. + */ + @JsonProperty(value = "highAvailabilitySoftwareConfiguration") + private HighAvailabilitySoftwareConfiguration highAvailabilitySoftwareConfiguration; + + /** Creates an instance of ServiceInitiatedSoftwareConfiguration class. */ + public ServiceInitiatedSoftwareConfiguration() { + } + + /** + * Get the bomUrl property: The URL to the SAP Build of Materials(BOM) file. + * + * @return the bomUrl value. + */ + public String bomUrl() { + return this.bomUrl; + } + + /** + * Set the bomUrl property: The URL to the SAP Build of Materials(BOM) file. + * + * @param bomUrl the bomUrl value to set. + * @return the ServiceInitiatedSoftwareConfiguration object itself. + */ + public ServiceInitiatedSoftwareConfiguration withBomUrl(String bomUrl) { + this.bomUrl = bomUrl; + return this; + } + + /** + * Get the softwareVersion property: The software version to install. + * + * @return the softwareVersion value. + */ + public String softwareVersion() { + return this.softwareVersion; + } + + /** + * Set the softwareVersion property: The software version to install. + * + * @param softwareVersion the softwareVersion value to set. + * @return the ServiceInitiatedSoftwareConfiguration object itself. + */ + public ServiceInitiatedSoftwareConfiguration withSoftwareVersion(String softwareVersion) { + this.softwareVersion = softwareVersion; + return this; + } + + /** + * Get the sapBitsStorageAccountId property: The SAP bits storage account id. + * + * @return the sapBitsStorageAccountId value. + */ + public String sapBitsStorageAccountId() { + return this.sapBitsStorageAccountId; + } + + /** + * Set the sapBitsStorageAccountId property: The SAP bits storage account id. + * + * @param sapBitsStorageAccountId the sapBitsStorageAccountId value to set. + * @return the ServiceInitiatedSoftwareConfiguration object itself. + */ + public ServiceInitiatedSoftwareConfiguration withSapBitsStorageAccountId(String sapBitsStorageAccountId) { + this.sapBitsStorageAccountId = sapBitsStorageAccountId; + return this; + } + + /** + * Get the sapFqdn property: The FQDN to set for the SAP system during install. + * + * @return the sapFqdn value. + */ + public String sapFqdn() { + return this.sapFqdn; + } + + /** + * Set the sapFqdn property: The FQDN to set for the SAP system during install. + * + * @param sapFqdn the sapFqdn value to set. + * @return the ServiceInitiatedSoftwareConfiguration object itself. + */ + public ServiceInitiatedSoftwareConfiguration withSapFqdn(String sapFqdn) { + this.sapFqdn = sapFqdn; + return this; + } + + /** + * Get the sshPrivateKey property: The SSH private key. + * + * @return the sshPrivateKey value. + */ + public String sshPrivateKey() { + return this.sshPrivateKey; + } + + /** + * Set the sshPrivateKey property: The SSH private key. + * + * @param sshPrivateKey the sshPrivateKey value to set. + * @return the ServiceInitiatedSoftwareConfiguration object itself. + */ + public ServiceInitiatedSoftwareConfiguration withSshPrivateKey(String sshPrivateKey) { + this.sshPrivateKey = sshPrivateKey; + return this; + } + + /** + * Get the highAvailabilitySoftwareConfiguration property: Gets or sets the HA software configuration. + * + * @return the highAvailabilitySoftwareConfiguration value. + */ + public HighAvailabilitySoftwareConfiguration highAvailabilitySoftwareConfiguration() { + return this.highAvailabilitySoftwareConfiguration; + } + + /** + * Set the highAvailabilitySoftwareConfiguration property: Gets or sets the HA software configuration. + * + * @param highAvailabilitySoftwareConfiguration the highAvailabilitySoftwareConfiguration value to set. + * @return the ServiceInitiatedSoftwareConfiguration object itself. + */ + public ServiceInitiatedSoftwareConfiguration withHighAvailabilitySoftwareConfiguration( + HighAvailabilitySoftwareConfiguration highAvailabilitySoftwareConfiguration) { + this.highAvailabilitySoftwareConfiguration = highAvailabilitySoftwareConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (bomUrl() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property bomUrl in model ServiceInitiatedSoftwareConfiguration")); + } + if (softwareVersion() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property softwareVersion in model ServiceInitiatedSoftwareConfiguration")); + } + if (sapBitsStorageAccountId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sapBitsStorageAccountId in model" + + " ServiceInitiatedSoftwareConfiguration")); + } + if (sapFqdn() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sapFqdn in model ServiceInitiatedSoftwareConfiguration")); + } + if (sshPrivateKey() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property sshPrivateKey in model ServiceInitiatedSoftwareConfiguration")); + } + if (highAvailabilitySoftwareConfiguration() != null) { + highAvailabilitySoftwareConfiguration().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ServiceInitiatedSoftwareConfiguration.class); +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SharedStorageResourceNames.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SharedStorageResourceNames.java new file mode 100644 index 0000000000000..ae8bbd9dd7a27 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SharedStorageResourceNames.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The resource names object for shared storage. */ +@Fluent +public final class SharedStorageResourceNames { + /* + * The full name of the shared storage account. If it is not provided, it will be defaulted to {SID}nfs{guid of 15 + * chars}. + */ + @JsonProperty(value = "sharedStorageAccountName") + private String sharedStorageAccountName; + + /* + * The full name of private end point for the shared storage account. If it is not provided, it will be defaulted + * to {storageAccountName}_pe + */ + @JsonProperty(value = "sharedStorageAccountPrivateEndPointName") + private String sharedStorageAccountPrivateEndPointName; + + /** Creates an instance of SharedStorageResourceNames class. */ + public SharedStorageResourceNames() { + } + + /** + * Get the sharedStorageAccountName property: The full name of the shared storage account. If it is not provided, it + * will be defaulted to {SID}nfs{guid of 15 chars}. + * + * @return the sharedStorageAccountName value. + */ + public String sharedStorageAccountName() { + return this.sharedStorageAccountName; + } + + /** + * Set the sharedStorageAccountName property: The full name of the shared storage account. If it is not provided, it + * will be defaulted to {SID}nfs{guid of 15 chars}. + * + * @param sharedStorageAccountName the sharedStorageAccountName value to set. + * @return the SharedStorageResourceNames object itself. + */ + public SharedStorageResourceNames withSharedStorageAccountName(String sharedStorageAccountName) { + this.sharedStorageAccountName = sharedStorageAccountName; + return this; + } + + /** + * Get the sharedStorageAccountPrivateEndPointName property: The full name of private end point for the shared + * storage account. If it is not provided, it will be defaulted to {storageAccountName}_pe. + * + * @return the sharedStorageAccountPrivateEndPointName value. + */ + public String sharedStorageAccountPrivateEndPointName() { + return this.sharedStorageAccountPrivateEndPointName; + } + + /** + * Set the sharedStorageAccountPrivateEndPointName property: The full name of private end point for the shared + * storage account. If it is not provided, it will be defaulted to {storageAccountName}_pe. + * + * @param sharedStorageAccountPrivateEndPointName the sharedStorageAccountPrivateEndPointName value to set. + * @return the SharedStorageResourceNames object itself. + */ + public SharedStorageResourceNames withSharedStorageAccountPrivateEndPointName( + String sharedStorageAccountPrivateEndPointName) { + this.sharedStorageAccountPrivateEndPointName = sharedStorageAccountPrivateEndPointName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SingleServerConfiguration.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SingleServerConfiguration.java new file mode 100644 index 0000000000000..fd8b25010ee56 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SingleServerConfiguration.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Gets or sets the single server configuration. For prerequisites for creating the infrastructure, please see + * [here](https://go.microsoft.com/fwlink/?linkid=2212611&clcid=0x409). + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "deploymentType") +@JsonTypeName("SingleServer") +@Fluent +public final class SingleServerConfiguration extends InfrastructureConfiguration { + /* + * Network configuration for the server + */ + @JsonProperty(value = "networkConfiguration") + private NetworkConfiguration networkConfiguration; + + /* + * The database type. + */ + @JsonProperty(value = "databaseType") + private SapDatabaseType databaseType; + + /* + * The subnet id. + */ + @JsonProperty(value = "subnetId", required = true) + private String subnetId; + + /* + * Gets or sets the virtual machine configuration. + */ + @JsonProperty(value = "virtualMachineConfiguration", required = true) + private VirtualMachineConfiguration virtualMachineConfiguration; + + /* + * Gets or sets the disk configuration. + */ + @JsonProperty(value = "dbDiskConfiguration") + private DiskConfiguration dbDiskConfiguration; + + /* + * The set of custom names to be used for underlying azure resources that are part of the SAP system. + */ + @JsonProperty(value = "customResourceNames") + private SingleServerCustomResourceNames customResourceNames; + + /** Creates an instance of SingleServerConfiguration class. */ + public SingleServerConfiguration() { + } + + /** + * Get the networkConfiguration property: Network configuration for the server. + * + * @return the networkConfiguration value. + */ + public NetworkConfiguration networkConfiguration() { + return this.networkConfiguration; + } + + /** + * Set the networkConfiguration property: Network configuration for the server. + * + * @param networkConfiguration the networkConfiguration value to set. + * @return the SingleServerConfiguration object itself. + */ + public SingleServerConfiguration withNetworkConfiguration(NetworkConfiguration networkConfiguration) { + this.networkConfiguration = networkConfiguration; + return this; + } + + /** + * Get the databaseType property: The database type. + * + * @return the databaseType value. + */ + public SapDatabaseType databaseType() { + return this.databaseType; + } + + /** + * Set the databaseType property: The database type. + * + * @param databaseType the databaseType value to set. + * @return the SingleServerConfiguration object itself. + */ + public SingleServerConfiguration withDatabaseType(SapDatabaseType databaseType) { + this.databaseType = databaseType; + return this; + } + + /** + * Get the subnetId property: The subnet id. + * + * @return the subnetId value. + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set the subnetId property: The subnet id. + * + * @param subnetId the subnetId value to set. + * @return the SingleServerConfiguration object itself. + */ + public SingleServerConfiguration withSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + + /** + * Get the virtualMachineConfiguration property: Gets or sets the virtual machine configuration. + * + * @return the virtualMachineConfiguration value. + */ + public VirtualMachineConfiguration virtualMachineConfiguration() { + return this.virtualMachineConfiguration; + } + + /** + * Set the virtualMachineConfiguration property: Gets or sets the virtual machine configuration. + * + * @param virtualMachineConfiguration the virtualMachineConfiguration value to set. + * @return the SingleServerConfiguration object itself. + */ + public SingleServerConfiguration withVirtualMachineConfiguration( + VirtualMachineConfiguration virtualMachineConfiguration) { + this.virtualMachineConfiguration = virtualMachineConfiguration; + return this; + } + + /** + * Get the dbDiskConfiguration property: Gets or sets the disk configuration. + * + * @return the dbDiskConfiguration value. + */ + public DiskConfiguration dbDiskConfiguration() { + return this.dbDiskConfiguration; + } + + /** + * Set the dbDiskConfiguration property: Gets or sets the disk configuration. + * + * @param dbDiskConfiguration the dbDiskConfiguration value to set. + * @return the SingleServerConfiguration object itself. + */ + public SingleServerConfiguration withDbDiskConfiguration(DiskConfiguration dbDiskConfiguration) { + this.dbDiskConfiguration = dbDiskConfiguration; + return this; + } + + /** + * Get the customResourceNames property: The set of custom names to be used for underlying azure resources that are + * part of the SAP system. + * + * @return the customResourceNames value. + */ + public SingleServerCustomResourceNames customResourceNames() { + return this.customResourceNames; + } + + /** + * Set the customResourceNames property: The set of custom names to be used for underlying azure resources that are + * part of the SAP system. + * + * @param customResourceNames the customResourceNames value to set. + * @return the SingleServerConfiguration object itself. + */ + public SingleServerConfiguration withCustomResourceNames(SingleServerCustomResourceNames customResourceNames) { + this.customResourceNames = customResourceNames; + return this; + } + + /** {@inheritDoc} */ + @Override + public SingleServerConfiguration withAppResourceGroup(String appResourceGroup) { + super.withAppResourceGroup(appResourceGroup); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (networkConfiguration() != null) { + networkConfiguration().validate(); + } + if (subnetId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property subnetId in model SingleServerConfiguration")); + } + if (virtualMachineConfiguration() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property virtualMachineConfiguration in model SingleServerConfiguration")); + } else { + virtualMachineConfiguration().validate(); + } + if (dbDiskConfiguration() != null) { + dbDiskConfiguration().validate(); + } + if (customResourceNames() != null) { + customResourceNames().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SingleServerConfiguration.class); +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SingleServerCustomResourceNames.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SingleServerCustomResourceNames.java new file mode 100644 index 0000000000000..32cf0bfec0119 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SingleServerCustomResourceNames.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The resource-names input to specify custom names for underlying azure resources that are part of a single server SAP + * system. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "namingPatternType", + defaultImpl = SingleServerCustomResourceNames.class) +@JsonTypeName("SingleServerCustomResourceNames") +@JsonSubTypes({@JsonSubTypes.Type(name = "FullResourceName", value = SingleServerFullResourceNames.class)}) +@Immutable +public class SingleServerCustomResourceNames { + /** Creates an instance of SingleServerCustomResourceNames class. */ + public SingleServerCustomResourceNames() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SingleServerFullResourceNames.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SingleServerFullResourceNames.java new file mode 100644 index 0000000000000..27d823ec612bb --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SingleServerFullResourceNames.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The resource name object where the specified values will be full resource names of the corresponding resources in a + * single server SAP system. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "namingPatternType") +@JsonTypeName("FullResourceName") +@Fluent +public final class SingleServerFullResourceNames extends SingleServerCustomResourceNames { + /* + * The resource names object for virtual machine and related resources. + */ + @JsonProperty(value = "virtualMachine") + private VirtualMachineResourceNames virtualMachine; + + /** Creates an instance of SingleServerFullResourceNames class. */ + public SingleServerFullResourceNames() { + } + + /** + * Get the virtualMachine property: The resource names object for virtual machine and related resources. + * + * @return the virtualMachine value. + */ + public VirtualMachineResourceNames virtualMachine() { + return this.virtualMachine; + } + + /** + * Set the virtualMachine property: The resource names object for virtual machine and related resources. + * + * @param virtualMachine the virtualMachine value to set. + * @return the SingleServerFullResourceNames object itself. + */ + public SingleServerFullResourceNames withVirtualMachine(VirtualMachineResourceNames virtualMachine) { + this.virtualMachine = virtualMachine; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (virtualMachine() != null) { + virtualMachine().validate(); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SingleServerRecommendationResult.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SingleServerRecommendationResult.java new file mode 100644 index 0000000000000..38a89595feb87 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SingleServerRecommendationResult.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapSizingRecommendationResultInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The recommended configuration for a single server SAP system. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "deploymentType") +@JsonTypeName("SingleServer") +@Fluent +public final class SingleServerRecommendationResult extends SapSizingRecommendationResultInner { + /* + * The recommended VM SKU for single server. + */ + @JsonProperty(value = "vmSku") + private String vmSku; + + /** Creates an instance of SingleServerRecommendationResult class. */ + public SingleServerRecommendationResult() { + } + + /** + * Get the vmSku property: The recommended VM SKU for single server. + * + * @return the vmSku value. + */ + public String vmSku() { + return this.vmSku; + } + + /** + * Set the vmSku property: The recommended VM SKU for single server. + * + * @param vmSku the vmSku value to set. + * @return the SingleServerRecommendationResult object itself. + */ + public SingleServerRecommendationResult withVmSku(String vmSku) { + this.vmSku = vmSku; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SkipFileShareConfiguration.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SkipFileShareConfiguration.java new file mode 100644 index 0000000000000..572798e7ff9d7 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SkipFileShareConfiguration.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Gets or sets the file share configuration for scenarios where transport directory fileshare is not created or + * required. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "configurationType") +@JsonTypeName("Skip") +@Immutable +public final class SkipFileShareConfiguration extends FileShareConfiguration { + /** Creates an instance of SkipFileShareConfiguration class. */ + public SkipFileShareConfiguration() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SoftwareConfiguration.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SoftwareConfiguration.java new file mode 100644 index 0000000000000..228f38a36e881 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SoftwareConfiguration.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The SAP Software configuration Input. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "softwareInstallationType", + defaultImpl = SoftwareConfiguration.class) +@JsonTypeName("SoftwareConfiguration") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "ServiceInitiated", value = ServiceInitiatedSoftwareConfiguration.class), + @JsonSubTypes.Type( + name = "SAPInstallWithoutOSConfig", + value = SapInstallWithoutOSConfigSoftwareConfiguration.class), + @JsonSubTypes.Type(name = "External", value = ExternalInstallationSoftwareConfiguration.class) +}) +@Immutable +public class SoftwareConfiguration { + /** Creates an instance of SoftwareConfiguration class. */ + public SoftwareConfiguration() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SshConfiguration.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SshConfiguration.java new file mode 100644 index 0000000000000..4d93a6f87e315 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SshConfiguration.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** SSH configuration for Linux based VMs running on Azure. */ +@Fluent +public final class SshConfiguration { + /* + * The list of SSH public keys used to authenticate with linux based VMs. + */ + @JsonProperty(value = "publicKeys") + private List publicKeys; + + /** Creates an instance of SshConfiguration class. */ + public SshConfiguration() { + } + + /** + * Get the publicKeys property: The list of SSH public keys used to authenticate with linux based VMs. + * + * @return the publicKeys value. + */ + public List publicKeys() { + return this.publicKeys; + } + + /** + * Set the publicKeys property: The list of SSH public keys used to authenticate with linux based VMs. + * + * @param publicKeys the publicKeys value to set. + * @return the SshConfiguration object itself. + */ + public SshConfiguration withPublicKeys(List publicKeys) { + this.publicKeys = publicKeys; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (publicKeys() != null) { + publicKeys().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SshKeyPair.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SshKeyPair.java new file mode 100644 index 0000000000000..9c4bd4d8a5d54 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SshKeyPair.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The SSH Key-pair used to authenticate with the VM. The key needs to be at least 2048-bit and in ssh-rsa format. + * <br><br> For creating ssh keys, see [Create SSH keys on Linux and Mac for Linux VMs in + * Azure](https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). + */ +@Fluent +public final class SshKeyPair { + /* + * SSH public key + */ + @JsonProperty(value = "publicKey") + private String publicKey; + + /* + * SSH private key. + */ + @JsonProperty(value = "privateKey") + private String privateKey; + + /** Creates an instance of SshKeyPair class. */ + public SshKeyPair() { + } + + /** + * Get the publicKey property: SSH public key. + * + * @return the publicKey value. + */ + public String publicKey() { + return this.publicKey; + } + + /** + * Set the publicKey property: SSH public key. + * + * @param publicKey the publicKey value to set. + * @return the SshKeyPair object itself. + */ + public SshKeyPair withPublicKey(String publicKey) { + this.publicKey = publicKey; + return this; + } + + /** + * Get the privateKey property: SSH private key. + * + * @return the privateKey value. + */ + public String privateKey() { + return this.privateKey; + } + + /** + * Set the privateKey property: SSH private key. + * + * @param privateKey the privateKey value to set. + * @return the SshKeyPair object itself. + */ + public SshKeyPair withPrivateKey(String privateKey) { + this.privateKey = privateKey; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SshPublicKey.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SshPublicKey.java new file mode 100644 index 0000000000000..aad8e74e35da1 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/SshPublicKey.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contains information about SSH certificate public key and the path on the Linux VM where the public key is placed. + */ +@Fluent +public final class SshPublicKey { + /* + * SSH public key certificate used to authenticate with the VM through ssh. The key needs to be at least 2048-bit + * and in ssh-rsa format.

For creating ssh keys, see [Create SSH keys on Linux and Mac for Linux VMs in + * Azure](https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). + */ + @JsonProperty(value = "keyData") + private String keyData; + + /** Creates an instance of SshPublicKey class. */ + public SshPublicKey() { + } + + /** + * Get the keyData property: SSH public key certificate used to authenticate with the VM through ssh. The key needs + * to be at least 2048-bit and in ssh-rsa format. <br><br> For creating ssh keys, see [Create SSH keys + * on Linux and Mac for Linux VMs in + * Azure](https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). + * + * @return the keyData value. + */ + public String keyData() { + return this.keyData; + } + + /** + * Set the keyData property: SSH public key certificate used to authenticate with the VM through ssh. The key needs + * to be at least 2048-bit and in ssh-rsa format. <br><br> For creating ssh keys, see [Create SSH keys + * on Linux and Mac for Linux VMs in + * Azure](https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). + * + * @param keyData the keyData value to set. + * @return the SshPublicKey object itself. + */ + public SshPublicKey withKeyData(String keyData) { + this.keyData = keyData; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/StartRequest.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/StartRequest.java new file mode 100644 index 0000000000000..c7937e8a3c2ce --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/StartRequest.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Start SAP instance(s) request body. */ +@Fluent +public final class StartRequest { + /* + * The boolean value indicates whether to start the virtual machines before starting the SAP instances. + */ + @JsonProperty(value = "startVm") + private Boolean startVm; + + /** Creates an instance of StartRequest class. */ + public StartRequest() { + } + + /** + * Get the startVm property: The boolean value indicates whether to start the virtual machines before starting the + * SAP instances. + * + * @return the startVm value. + */ + public Boolean startVm() { + return this.startVm; + } + + /** + * Set the startVm property: The boolean value indicates whether to start the virtual machines before starting the + * SAP instances. + * + * @param startVm the startVm value to set. + * @return the StartRequest object itself. + */ + public StartRequest withStartVm(Boolean startVm) { + this.startVm = startVm; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/StopRequest.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/StopRequest.java new file mode 100644 index 0000000000000..6f646ad28e1e5 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/StopRequest.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Stop SAP instance(s) request body. */ +@Fluent +public final class StopRequest { + /* + * This parameter defines how long (in seconds) the soft shutdown waits until the RFC/HTTP clients no longer + * consider the server for calls with load balancing. Value 0 means that the kernel does not wait, but goes + * directly into the next shutdown state, i.e. hard stop. + */ + @JsonProperty(value = "softStopTimeoutSeconds") + private Long softStopTimeoutSeconds; + + /* + * The boolean value indicates whether to Stop and deallocate the virtual machines along with the SAP instances. + */ + @JsonProperty(value = "deallocateVm") + private Boolean deallocateVm; + + /** Creates an instance of StopRequest class. */ + public StopRequest() { + } + + /** + * Get the softStopTimeoutSeconds property: This parameter defines how long (in seconds) the soft shutdown waits + * until the RFC/HTTP clients no longer consider the server for calls with load balancing. Value 0 means that the + * kernel does not wait, but goes directly into the next shutdown state, i.e. hard stop. + * + * @return the softStopTimeoutSeconds value. + */ + public Long softStopTimeoutSeconds() { + return this.softStopTimeoutSeconds; + } + + /** + * Set the softStopTimeoutSeconds property: This parameter defines how long (in seconds) the soft shutdown waits + * until the RFC/HTTP clients no longer consider the server for calls with load balancing. Value 0 means that the + * kernel does not wait, but goes directly into the next shutdown state, i.e. hard stop. + * + * @param softStopTimeoutSeconds the softStopTimeoutSeconds value to set. + * @return the StopRequest object itself. + */ + public StopRequest withSoftStopTimeoutSeconds(Long softStopTimeoutSeconds) { + this.softStopTimeoutSeconds = softStopTimeoutSeconds; + return this; + } + + /** + * Get the deallocateVm property: The boolean value indicates whether to Stop and deallocate the virtual machines + * along with the SAP instances. + * + * @return the deallocateVm value. + */ + public Boolean deallocateVm() { + return this.deallocateVm; + } + + /** + * Set the deallocateVm property: The boolean value indicates whether to Stop and deallocate the virtual machines + * along with the SAP instances. + * + * @param deallocateVm the deallocateVm value to set. + * @return the StopRequest object itself. + */ + public StopRequest withDeallocateVm(Boolean deallocateVm) { + this.deallocateVm = deallocateVm; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/StorageConfiguration.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/StorageConfiguration.java new file mode 100644 index 0000000000000..87c453bfd50cc --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/StorageConfiguration.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Gets or sets the storage configuration. */ +@Fluent +public final class StorageConfiguration { + /* + * The properties of the transport directory attached to the VIS. The default for transportFileShareConfiguration + * is the createAndMount flow if storage configuration is missing. + */ + @JsonProperty(value = "transportFileShareConfiguration") + private FileShareConfiguration transportFileShareConfiguration; + + /** Creates an instance of StorageConfiguration class. */ + public StorageConfiguration() { + } + + /** + * Get the transportFileShareConfiguration property: The properties of the transport directory attached to the VIS. + * The default for transportFileShareConfiguration is the createAndMount flow if storage configuration is missing. + * + * @return the transportFileShareConfiguration value. + */ + public FileShareConfiguration transportFileShareConfiguration() { + return this.transportFileShareConfiguration; + } + + /** + * Set the transportFileShareConfiguration property: The properties of the transport directory attached to the VIS. + * The default for transportFileShareConfiguration is the createAndMount flow if storage configuration is missing. + * + * @param transportFileShareConfiguration the transportFileShareConfiguration value to set. + * @return the StorageConfiguration object itself. + */ + public StorageConfiguration withTransportFileShareConfiguration( + FileShareConfiguration transportFileShareConfiguration) { + this.transportFileShareConfiguration = transportFileShareConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (transportFileShareConfiguration() != null) { + transportFileShareConfiguration().validate(); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/StorageInformation.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/StorageInformation.java new file mode 100644 index 0000000000000..9c00e74fde864 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/StorageInformation.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Storage details of all the Storage accounts attached to the VM. For e.g. NFS on AFS Shared Storage. */ +@Immutable +public final class StorageInformation { + /* + * The id property. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** Creates an instance of StorageInformation class. */ + public StorageInformation() { + } + + /** + * Get the id property: The id property. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ThreeTierConfiguration.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ThreeTierConfiguration.java new file mode 100644 index 0000000000000..6970814fe9031 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ThreeTierConfiguration.java @@ -0,0 +1,263 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Gets or sets the three tier SAP configuration. For prerequisites for creating the infrastructure, please see + * [here](https://go.microsoft.com/fwlink/?linkid=2212611&clcid=0x409). + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "deploymentType") +@JsonTypeName("ThreeTier") +@Fluent +public final class ThreeTierConfiguration extends InfrastructureConfiguration { + /* + * Network configuration common to all servers + */ + @JsonProperty(value = "networkConfiguration") + private NetworkConfiguration networkConfiguration; + + /* + * The central server configuration. + */ + @JsonProperty(value = "centralServer", required = true) + private CentralServerConfiguration centralServer; + + /* + * The application server configuration. + */ + @JsonProperty(value = "applicationServer", required = true) + private ApplicationServerConfiguration applicationServer; + + /* + * The database configuration. + */ + @JsonProperty(value = "databaseServer", required = true) + private DatabaseConfiguration databaseServer; + + /* + * The high availability configuration. + */ + @JsonProperty(value = "highAvailabilityConfig") + private HighAvailabilityConfiguration highAvailabilityConfig; + + /* + * The storage configuration. + */ + @JsonProperty(value = "storageConfiguration") + private StorageConfiguration storageConfiguration; + + /* + * The set of custom names to be used for underlying azure resources that are part of the SAP system. + */ + @JsonProperty(value = "customResourceNames") + private ThreeTierCustomResourceNames customResourceNames; + + /** Creates an instance of ThreeTierConfiguration class. */ + public ThreeTierConfiguration() { + } + + /** + * Get the networkConfiguration property: Network configuration common to all servers. + * + * @return the networkConfiguration value. + */ + public NetworkConfiguration networkConfiguration() { + return this.networkConfiguration; + } + + /** + * Set the networkConfiguration property: Network configuration common to all servers. + * + * @param networkConfiguration the networkConfiguration value to set. + * @return the ThreeTierConfiguration object itself. + */ + public ThreeTierConfiguration withNetworkConfiguration(NetworkConfiguration networkConfiguration) { + this.networkConfiguration = networkConfiguration; + return this; + } + + /** + * Get the centralServer property: The central server configuration. + * + * @return the centralServer value. + */ + public CentralServerConfiguration centralServer() { + return this.centralServer; + } + + /** + * Set the centralServer property: The central server configuration. + * + * @param centralServer the centralServer value to set. + * @return the ThreeTierConfiguration object itself. + */ + public ThreeTierConfiguration withCentralServer(CentralServerConfiguration centralServer) { + this.centralServer = centralServer; + return this; + } + + /** + * Get the applicationServer property: The application server configuration. + * + * @return the applicationServer value. + */ + public ApplicationServerConfiguration applicationServer() { + return this.applicationServer; + } + + /** + * Set the applicationServer property: The application server configuration. + * + * @param applicationServer the applicationServer value to set. + * @return the ThreeTierConfiguration object itself. + */ + public ThreeTierConfiguration withApplicationServer(ApplicationServerConfiguration applicationServer) { + this.applicationServer = applicationServer; + return this; + } + + /** + * Get the databaseServer property: The database configuration. + * + * @return the databaseServer value. + */ + public DatabaseConfiguration databaseServer() { + return this.databaseServer; + } + + /** + * Set the databaseServer property: The database configuration. + * + * @param databaseServer the databaseServer value to set. + * @return the ThreeTierConfiguration object itself. + */ + public ThreeTierConfiguration withDatabaseServer(DatabaseConfiguration databaseServer) { + this.databaseServer = databaseServer; + return this; + } + + /** + * Get the highAvailabilityConfig property: The high availability configuration. + * + * @return the highAvailabilityConfig value. + */ + public HighAvailabilityConfiguration highAvailabilityConfig() { + return this.highAvailabilityConfig; + } + + /** + * Set the highAvailabilityConfig property: The high availability configuration. + * + * @param highAvailabilityConfig the highAvailabilityConfig value to set. + * @return the ThreeTierConfiguration object itself. + */ + public ThreeTierConfiguration withHighAvailabilityConfig(HighAvailabilityConfiguration highAvailabilityConfig) { + this.highAvailabilityConfig = highAvailabilityConfig; + return this; + } + + /** + * Get the storageConfiguration property: The storage configuration. + * + * @return the storageConfiguration value. + */ + public StorageConfiguration storageConfiguration() { + return this.storageConfiguration; + } + + /** + * Set the storageConfiguration property: The storage configuration. + * + * @param storageConfiguration the storageConfiguration value to set. + * @return the ThreeTierConfiguration object itself. + */ + public ThreeTierConfiguration withStorageConfiguration(StorageConfiguration storageConfiguration) { + this.storageConfiguration = storageConfiguration; + return this; + } + + /** + * Get the customResourceNames property: The set of custom names to be used for underlying azure resources that are + * part of the SAP system. + * + * @return the customResourceNames value. + */ + public ThreeTierCustomResourceNames customResourceNames() { + return this.customResourceNames; + } + + /** + * Set the customResourceNames property: The set of custom names to be used for underlying azure resources that are + * part of the SAP system. + * + * @param customResourceNames the customResourceNames value to set. + * @return the ThreeTierConfiguration object itself. + */ + public ThreeTierConfiguration withCustomResourceNames(ThreeTierCustomResourceNames customResourceNames) { + this.customResourceNames = customResourceNames; + return this; + } + + /** {@inheritDoc} */ + @Override + public ThreeTierConfiguration withAppResourceGroup(String appResourceGroup) { + super.withAppResourceGroup(appResourceGroup); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (networkConfiguration() != null) { + networkConfiguration().validate(); + } + if (centralServer() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property centralServer in model ThreeTierConfiguration")); + } else { + centralServer().validate(); + } + if (applicationServer() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property applicationServer in model ThreeTierConfiguration")); + } else { + applicationServer().validate(); + } + if (databaseServer() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property databaseServer in model ThreeTierConfiguration")); + } else { + databaseServer().validate(); + } + if (highAvailabilityConfig() != null) { + highAvailabilityConfig().validate(); + } + if (storageConfiguration() != null) { + storageConfiguration().validate(); + } + if (customResourceNames() != null) { + customResourceNames().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ThreeTierConfiguration.class); +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ThreeTierCustomResourceNames.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ThreeTierCustomResourceNames.java new file mode 100644 index 0000000000000..8c6ab9e1187ea --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ThreeTierCustomResourceNames.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The resource-names input to specify custom names for underlying azure resources that are part of a three tier SAP + * system. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "namingPatternType", + defaultImpl = ThreeTierCustomResourceNames.class) +@JsonTypeName("ThreeTierCustomResourceNames") +@JsonSubTypes({@JsonSubTypes.Type(name = "FullResourceName", value = ThreeTierFullResourceNames.class)}) +@Immutable +public class ThreeTierCustomResourceNames { + /** Creates an instance of ThreeTierCustomResourceNames class. */ + public ThreeTierCustomResourceNames() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ThreeTierFullResourceNames.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ThreeTierFullResourceNames.java new file mode 100644 index 0000000000000..5e7d103a03242 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ThreeTierFullResourceNames.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The resource name object where the specified values will be full resource names of the corresponding resources in a + * three tier SAP system. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "namingPatternType") +@JsonTypeName("FullResourceName") +@Fluent +public final class ThreeTierFullResourceNames extends ThreeTierCustomResourceNames { + /* + * The full resource names object for central server layer resources. + */ + @JsonProperty(value = "centralServer") + private CentralServerFullResourceNames centralServer; + + /* + * The full resource names object for application layer resources. The number of entries in this list should be + * equal to the number VMs to be created for application layer. + */ + @JsonProperty(value = "applicationServer") + private ApplicationServerFullResourceNames applicationServer; + + /* + * The full resource names object for database layer resources. The number of entries in this list should be equal + * to the number VMs to be created for database layer. + */ + @JsonProperty(value = "databaseServer") + private DatabaseServerFullResourceNames databaseServer; + + /* + * The resource names object for shared storage. + */ + @JsonProperty(value = "sharedStorage") + private SharedStorageResourceNames sharedStorage; + + /** Creates an instance of ThreeTierFullResourceNames class. */ + public ThreeTierFullResourceNames() { + } + + /** + * Get the centralServer property: The full resource names object for central server layer resources. + * + * @return the centralServer value. + */ + public CentralServerFullResourceNames centralServer() { + return this.centralServer; + } + + /** + * Set the centralServer property: The full resource names object for central server layer resources. + * + * @param centralServer the centralServer value to set. + * @return the ThreeTierFullResourceNames object itself. + */ + public ThreeTierFullResourceNames withCentralServer(CentralServerFullResourceNames centralServer) { + this.centralServer = centralServer; + return this; + } + + /** + * Get the applicationServer property: The full resource names object for application layer resources. The number of + * entries in this list should be equal to the number VMs to be created for application layer. + * + * @return the applicationServer value. + */ + public ApplicationServerFullResourceNames applicationServer() { + return this.applicationServer; + } + + /** + * Set the applicationServer property: The full resource names object for application layer resources. The number of + * entries in this list should be equal to the number VMs to be created for application layer. + * + * @param applicationServer the applicationServer value to set. + * @return the ThreeTierFullResourceNames object itself. + */ + public ThreeTierFullResourceNames withApplicationServer(ApplicationServerFullResourceNames applicationServer) { + this.applicationServer = applicationServer; + return this; + } + + /** + * Get the databaseServer property: The full resource names object for database layer resources. The number of + * entries in this list should be equal to the number VMs to be created for database layer. + * + * @return the databaseServer value. + */ + public DatabaseServerFullResourceNames databaseServer() { + return this.databaseServer; + } + + /** + * Set the databaseServer property: The full resource names object for database layer resources. The number of + * entries in this list should be equal to the number VMs to be created for database layer. + * + * @param databaseServer the databaseServer value to set. + * @return the ThreeTierFullResourceNames object itself. + */ + public ThreeTierFullResourceNames withDatabaseServer(DatabaseServerFullResourceNames databaseServer) { + this.databaseServer = databaseServer; + return this; + } + + /** + * Get the sharedStorage property: The resource names object for shared storage. + * + * @return the sharedStorage value. + */ + public SharedStorageResourceNames sharedStorage() { + return this.sharedStorage; + } + + /** + * Set the sharedStorage property: The resource names object for shared storage. + * + * @param sharedStorage the sharedStorage value to set. + * @return the ThreeTierFullResourceNames object itself. + */ + public ThreeTierFullResourceNames withSharedStorage(SharedStorageResourceNames sharedStorage) { + this.sharedStorage = sharedStorage; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (centralServer() != null) { + centralServer().validate(); + } + if (applicationServer() != null) { + applicationServer().validate(); + } + if (databaseServer() != null) { + databaseServer().validate(); + } + if (sharedStorage() != null) { + sharedStorage().validate(); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ThreeTierRecommendationResult.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ThreeTierRecommendationResult.java new file mode 100644 index 0000000000000..93aa3210dc648 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/ThreeTierRecommendationResult.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models.SapSizingRecommendationResultInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The recommended configuration for a three tier SAP system. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "deploymentType") +@JsonTypeName("ThreeTier") +@Fluent +public final class ThreeTierRecommendationResult extends SapSizingRecommendationResultInner { + /* + * The database VM SKU. + */ + @JsonProperty(value = "dbVmSku") + private String dbVmSku; + + /* + * The database server instance count. + */ + @JsonProperty(value = "databaseInstanceCount") + private Long databaseInstanceCount; + + /* + * The central server VM SKU. + */ + @JsonProperty(value = "centralServerVmSku") + private String centralServerVmSku; + + /* + * The central server instance count. + */ + @JsonProperty(value = "centralServerInstanceCount") + private Long centralServerInstanceCount; + + /* + * The application server VM SKU. + */ + @JsonProperty(value = "applicationServerVmSku") + private String applicationServerVmSku; + + /* + * The application server instance count. + */ + @JsonProperty(value = "applicationServerInstanceCount") + private Long applicationServerInstanceCount; + + /** Creates an instance of ThreeTierRecommendationResult class. */ + public ThreeTierRecommendationResult() { + } + + /** + * Get the dbVmSku property: The database VM SKU. + * + * @return the dbVmSku value. + */ + public String dbVmSku() { + return this.dbVmSku; + } + + /** + * Set the dbVmSku property: The database VM SKU. + * + * @param dbVmSku the dbVmSku value to set. + * @return the ThreeTierRecommendationResult object itself. + */ + public ThreeTierRecommendationResult withDbVmSku(String dbVmSku) { + this.dbVmSku = dbVmSku; + return this; + } + + /** + * Get the databaseInstanceCount property: The database server instance count. + * + * @return the databaseInstanceCount value. + */ + public Long databaseInstanceCount() { + return this.databaseInstanceCount; + } + + /** + * Set the databaseInstanceCount property: The database server instance count. + * + * @param databaseInstanceCount the databaseInstanceCount value to set. + * @return the ThreeTierRecommendationResult object itself. + */ + public ThreeTierRecommendationResult withDatabaseInstanceCount(Long databaseInstanceCount) { + this.databaseInstanceCount = databaseInstanceCount; + return this; + } + + /** + * Get the centralServerVmSku property: The central server VM SKU. + * + * @return the centralServerVmSku value. + */ + public String centralServerVmSku() { + return this.centralServerVmSku; + } + + /** + * Set the centralServerVmSku property: The central server VM SKU. + * + * @param centralServerVmSku the centralServerVmSku value to set. + * @return the ThreeTierRecommendationResult object itself. + */ + public ThreeTierRecommendationResult withCentralServerVmSku(String centralServerVmSku) { + this.centralServerVmSku = centralServerVmSku; + return this; + } + + /** + * Get the centralServerInstanceCount property: The central server instance count. + * + * @return the centralServerInstanceCount value. + */ + public Long centralServerInstanceCount() { + return this.centralServerInstanceCount; + } + + /** + * Set the centralServerInstanceCount property: The central server instance count. + * + * @param centralServerInstanceCount the centralServerInstanceCount value to set. + * @return the ThreeTierRecommendationResult object itself. + */ + public ThreeTierRecommendationResult withCentralServerInstanceCount(Long centralServerInstanceCount) { + this.centralServerInstanceCount = centralServerInstanceCount; + return this; + } + + /** + * Get the applicationServerVmSku property: The application server VM SKU. + * + * @return the applicationServerVmSku value. + */ + public String applicationServerVmSku() { + return this.applicationServerVmSku; + } + + /** + * Set the applicationServerVmSku property: The application server VM SKU. + * + * @param applicationServerVmSku the applicationServerVmSku value to set. + * @return the ThreeTierRecommendationResult object itself. + */ + public ThreeTierRecommendationResult withApplicationServerVmSku(String applicationServerVmSku) { + this.applicationServerVmSku = applicationServerVmSku; + return this; + } + + /** + * Get the applicationServerInstanceCount property: The application server instance count. + * + * @return the applicationServerInstanceCount value. + */ + public Long applicationServerInstanceCount() { + return this.applicationServerInstanceCount; + } + + /** + * Set the applicationServerInstanceCount property: The application server instance count. + * + * @param applicationServerInstanceCount the applicationServerInstanceCount value to set. + * @return the ThreeTierRecommendationResult object itself. + */ + public ThreeTierRecommendationResult withApplicationServerInstanceCount(Long applicationServerInstanceCount) { + this.applicationServerInstanceCount = applicationServerInstanceCount; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/UpdateSapApplicationInstanceRequest.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/UpdateSapApplicationInstanceRequest.java new file mode 100644 index 0000000000000..fe28c7238e74d --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/UpdateSapApplicationInstanceRequest.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Defines the request body for updating SAP Application Instance. */ +@Fluent +public final class UpdateSapApplicationInstanceRequest { + /* + * Gets or sets the Resource tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of UpdateSapApplicationInstanceRequest class. */ + public UpdateSapApplicationInstanceRequest() { + } + + /** + * Get the tags property: Gets or sets the Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Gets or sets the Resource tags. + * + * @param tags the tags value to set. + * @return the UpdateSapApplicationInstanceRequest object itself. + */ + public UpdateSapApplicationInstanceRequest withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/UpdateSapCentralInstanceRequest.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/UpdateSapCentralInstanceRequest.java new file mode 100644 index 0000000000000..396d5142835f7 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/UpdateSapCentralInstanceRequest.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Defines the request body for updating SAP Central Instance. */ +@Fluent +public final class UpdateSapCentralInstanceRequest { + /* + * Gets or sets the Resource tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of UpdateSapCentralInstanceRequest class. */ + public UpdateSapCentralInstanceRequest() { + } + + /** + * Get the tags property: Gets or sets the Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Gets or sets the Resource tags. + * + * @param tags the tags value to set. + * @return the UpdateSapCentralInstanceRequest object itself. + */ + public UpdateSapCentralInstanceRequest withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/UpdateSapDatabaseInstanceRequest.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/UpdateSapDatabaseInstanceRequest.java new file mode 100644 index 0000000000000..393ce38ed369d --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/UpdateSapDatabaseInstanceRequest.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Defines the request body for updating SAP Database Instance. */ +@Fluent +public final class UpdateSapDatabaseInstanceRequest { + /* + * Gets or sets the Resource tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /** Creates an instance of UpdateSapDatabaseInstanceRequest class. */ + public UpdateSapDatabaseInstanceRequest() { + } + + /** + * Get the tags property: Gets or sets the Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Gets or sets the Resource tags. + * + * @param tags the tags value to set. + * @return the UpdateSapDatabaseInstanceRequest object itself. + */ + public UpdateSapDatabaseInstanceRequest withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/UpdateSapVirtualInstanceProperties.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/UpdateSapVirtualInstanceProperties.java new file mode 100644 index 0000000000000..6a790012d899a --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/UpdateSapVirtualInstanceProperties.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the properties to be updated for Virtual Instance for SAP. */ +@Fluent +public final class UpdateSapVirtualInstanceProperties { + /* + * Specifies the network access configuration for the resources that will be deployed in the Managed Resource + * Group. The options to choose from are Public and Private. If 'Private' is chosen, the Storage Account service + * tag should be enabled on the subnets in which the SAP VMs exist. This is required for establishing connectivity + * between VM extensions and the managed resource group storage account. This setting is currently applicable only + * to Storage Account. Learn more here https://go.microsoft.com/fwlink/?linkid=2247228 + */ + @JsonProperty(value = "managedResourcesNetworkAccessType") + private ManagedResourcesNetworkAccessType managedResourcesNetworkAccessType; + + /** Creates an instance of UpdateSapVirtualInstanceProperties class. */ + public UpdateSapVirtualInstanceProperties() { + } + + /** + * Get the managedResourcesNetworkAccessType property: Specifies the network access configuration for the resources + * that will be deployed in the Managed Resource Group. The options to choose from are Public and Private. If + * 'Private' is chosen, the Storage Account service tag should be enabled on the subnets in which the SAP VMs exist. + * This is required for establishing connectivity between VM extensions and the managed resource group storage + * account. This setting is currently applicable only to Storage Account. Learn more here + * https://go.microsoft.com/fwlink/?linkid=2247228. + * + * @return the managedResourcesNetworkAccessType value. + */ + public ManagedResourcesNetworkAccessType managedResourcesNetworkAccessType() { + return this.managedResourcesNetworkAccessType; + } + + /** + * Set the managedResourcesNetworkAccessType property: Specifies the network access configuration for the resources + * that will be deployed in the Managed Resource Group. The options to choose from are Public and Private. If + * 'Private' is chosen, the Storage Account service tag should be enabled on the subnets in which the SAP VMs exist. + * This is required for establishing connectivity between VM extensions and the managed resource group storage + * account. This setting is currently applicable only to Storage Account. Learn more here + * https://go.microsoft.com/fwlink/?linkid=2247228. + * + * @param managedResourcesNetworkAccessType the managedResourcesNetworkAccessType value to set. + * @return the UpdateSapVirtualInstanceProperties object itself. + */ + public UpdateSapVirtualInstanceProperties withManagedResourcesNetworkAccessType( + ManagedResourcesNetworkAccessType managedResourcesNetworkAccessType) { + this.managedResourcesNetworkAccessType = managedResourcesNetworkAccessType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/UpdateSapVirtualInstanceRequest.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/UpdateSapVirtualInstanceRequest.java new file mode 100644 index 0000000000000..c45de1b6dd162 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/UpdateSapVirtualInstanceRequest.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Defines the request body for updating Virtual Instance for SAP. */ +@Fluent +public final class UpdateSapVirtualInstanceRequest { + /* + * Gets or sets the Resource tags. + */ + @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; + + /* + * Managed service identity (user assigned identities) + */ + @JsonProperty(value = "identity") + private UserAssignedServiceIdentity identity; + + /* + * Defines the properties to be updated for Virtual Instance for SAP. + */ + @JsonProperty(value = "properties") + private UpdateSapVirtualInstanceProperties properties; + + /** Creates an instance of UpdateSapVirtualInstanceRequest class. */ + public UpdateSapVirtualInstanceRequest() { + } + + /** + * Get the tags property: Gets or sets the Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Gets or sets the Resource tags. + * + * @param tags the tags value to set. + * @return the UpdateSapVirtualInstanceRequest object itself. + */ + public UpdateSapVirtualInstanceRequest withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the identity property: Managed service identity (user assigned identities). + * + * @return the identity value. + */ + public UserAssignedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Managed service identity (user assigned identities). + * + * @param identity the identity value to set. + * @return the UpdateSapVirtualInstanceRequest object itself. + */ + public UpdateSapVirtualInstanceRequest withIdentity(UserAssignedServiceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the properties property: Defines the properties to be updated for Virtual Instance for SAP. + * + * @return the properties value. + */ + public UpdateSapVirtualInstanceProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Defines the properties to be updated for Virtual Instance for SAP. + * + * @param properties the properties value to set. + * @return the UpdateSapVirtualInstanceRequest object itself. + */ + public UpdateSapVirtualInstanceRequest withProperties(UpdateSapVirtualInstanceProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/UserAssignedIdentity.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/UserAssignedIdentity.java new file mode 100644 index 0000000000000..14bed7efb6ea5 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/UserAssignedIdentity.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.UUID; + +/** User assigned identity properties. */ +@Immutable +public final class UserAssignedIdentity { + /* + * The principal ID of the assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private UUID principalId; + + /* + * The client ID of the assigned identity. + */ + @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) + private UUID clientId; + + /** Creates an instance of UserAssignedIdentity class. */ + public UserAssignedIdentity() { + } + + /** + * Get the principalId property: The principal ID of the assigned identity. + * + * @return the principalId value. + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Get the clientId property: The client ID of the assigned identity. + * + * @return the clientId value. + */ + public UUID clientId() { + return this.clientId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/UserAssignedServiceIdentity.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/UserAssignedServiceIdentity.java new file mode 100644 index 0000000000000..9359507dd8097 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/UserAssignedServiceIdentity.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Managed service identity (user assigned identities). */ +@Fluent +public final class UserAssignedServiceIdentity { + /* + * Type of manage identity + */ + @JsonProperty(value = "type", required = true) + private ManagedServiceIdentityType type; + + /* + * User assigned identities dictionary + */ + @JsonProperty(value = "userAssignedIdentities") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map userAssignedIdentities; + + /** Creates an instance of UserAssignedServiceIdentity class. */ + public UserAssignedServiceIdentity() { + } + + /** + * Get the type property: Type of manage identity. + * + * @return the type value. + */ + public ManagedServiceIdentityType type() { + return this.type; + } + + /** + * Set the type property: Type of manage identity. + * + * @param type the type value to set. + * @return the UserAssignedServiceIdentity object itself. + */ + public UserAssignedServiceIdentity withType(ManagedServiceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: User assigned identities dictionary. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: User assigned identities dictionary. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the UserAssignedServiceIdentity object itself. + */ + public UserAssignedServiceIdentity withUserAssignedIdentities( + Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property type in model UserAssignedServiceIdentity")); + } + if (userAssignedIdentities() != null) { + userAssignedIdentities() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UserAssignedServiceIdentity.class); +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/VirtualMachineConfiguration.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/VirtualMachineConfiguration.java new file mode 100644 index 0000000000000..e1bc64ac6141b --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/VirtualMachineConfiguration.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Defines the virtual machine configuration. */ +@Fluent +public final class VirtualMachineConfiguration { + /* + * The virtual machine size. + */ + @JsonProperty(value = "vmSize", required = true) + private String vmSize; + + /* + * The image reference. + */ + @JsonProperty(value = "imageReference", required = true) + private ImageReference imageReference; + + /* + * The OS profile. + */ + @JsonProperty(value = "osProfile", required = true) + private OSProfile osProfile; + + /** Creates an instance of VirtualMachineConfiguration class. */ + public VirtualMachineConfiguration() { + } + + /** + * Get the vmSize property: The virtual machine size. + * + * @return the vmSize value. + */ + public String vmSize() { + return this.vmSize; + } + + /** + * Set the vmSize property: The virtual machine size. + * + * @param vmSize the vmSize value to set. + * @return the VirtualMachineConfiguration object itself. + */ + public VirtualMachineConfiguration withVmSize(String vmSize) { + this.vmSize = vmSize; + return this; + } + + /** + * Get the imageReference property: The image reference. + * + * @return the imageReference value. + */ + public ImageReference imageReference() { + return this.imageReference; + } + + /** + * Set the imageReference property: The image reference. + * + * @param imageReference the imageReference value to set. + * @return the VirtualMachineConfiguration object itself. + */ + public VirtualMachineConfiguration withImageReference(ImageReference imageReference) { + this.imageReference = imageReference; + return this; + } + + /** + * Get the osProfile property: The OS profile. + * + * @return the osProfile value. + */ + public OSProfile osProfile() { + return this.osProfile; + } + + /** + * Set the osProfile property: The OS profile. + * + * @param osProfile the osProfile value to set. + * @return the VirtualMachineConfiguration object itself. + */ + public VirtualMachineConfiguration withOsProfile(OSProfile osProfile) { + this.osProfile = osProfile; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (vmSize() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property vmSize in model VirtualMachineConfiguration")); + } + if (imageReference() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property imageReference in model VirtualMachineConfiguration")); + } else { + imageReference().validate(); + } + if (osProfile() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property osProfile in model VirtualMachineConfiguration")); + } else { + osProfile().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(VirtualMachineConfiguration.class); +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/VirtualMachineResourceNames.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/VirtualMachineResourceNames.java new file mode 100644 index 0000000000000..45b6a23290782 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/VirtualMachineResourceNames.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** The resource names object for virtual machine and related resources. */ +@Fluent +public final class VirtualMachineResourceNames { + /* + * The full name for virtual machine. The length of this field can be upto 64 characters. If name is not provided, + * service uses a default name based on the deployment type. For SingleServer, default name is {SID}vm. In case of + * HA-AvZone systems, default name will be {SID}{app/ascs/db}z{a/b}vm with an incrementor at the end in case of + * more than 1 vm per layer. For distributed and HA-AvSet systems, default name will be {SID}{app/ascs/db}vm with + * an incrementor at the end in case of more than 1 vm per layer. + */ + @JsonProperty(value = "vmName") + private String vmName; + + /* + * The full name for virtual-machine's host (computer name). Currently, ACSS only supports host names which are + * less than or equal to 13 characters long. If this value is not provided, vmName will be used as host name. + */ + @JsonProperty(value = "hostName") + private String hostname; + + /* + * The list of network interface name objects for the selected virtual machine. Currently, only one network + * interface is supported per virtual machine. + */ + @JsonProperty(value = "networkInterfaces") + private List networkInterfaces; + + /* + * The full name for OS disk attached to the VM. If this value is not provided, it will be named by ARM as per its + * default naming standards (prefixed with vm name). There is only one OS disk attached per Virtual Machine. + */ + @JsonProperty(value = "osDiskName") + private String osDiskName; + + /* + * The full resource names for virtual machine data disks. This is a dictionary containing list of names of data + * disks per volume. Currently supported volumes for database layer are ['hana/data', 'hana/log', hana/shared', + * 'usr/sap', 'os', 'backup']. For application and cs layers, only 'default' volume is supported + */ + @JsonProperty(value = "dataDiskNames") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map> dataDiskNames; + + /** Creates an instance of VirtualMachineResourceNames class. */ + public VirtualMachineResourceNames() { + } + + /** + * Get the vmName property: The full name for virtual machine. The length of this field can be upto 64 characters. + * If name is not provided, service uses a default name based on the deployment type. For SingleServer, default name + * is {SID}vm. In case of HA-AvZone systems, default name will be {SID}{app/ascs/db}z{a/b}vm with an incrementor at + * the end in case of more than 1 vm per layer. For distributed and HA-AvSet systems, default name will be + * {SID}{app/ascs/db}vm with an incrementor at the end in case of more than 1 vm per layer. + * + * @return the vmName value. + */ + public String vmName() { + return this.vmName; + } + + /** + * Set the vmName property: The full name for virtual machine. The length of this field can be upto 64 characters. + * If name is not provided, service uses a default name based on the deployment type. For SingleServer, default name + * is {SID}vm. In case of HA-AvZone systems, default name will be {SID}{app/ascs/db}z{a/b}vm with an incrementor at + * the end in case of more than 1 vm per layer. For distributed and HA-AvSet systems, default name will be + * {SID}{app/ascs/db}vm with an incrementor at the end in case of more than 1 vm per layer. + * + * @param vmName the vmName value to set. + * @return the VirtualMachineResourceNames object itself. + */ + public VirtualMachineResourceNames withVmName(String vmName) { + this.vmName = vmName; + return this; + } + + /** + * Get the hostname property: The full name for virtual-machine's host (computer name). Currently, ACSS only + * supports host names which are less than or equal to 13 characters long. If this value is not provided, vmName + * will be used as host name. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Set the hostname property: The full name for virtual-machine's host (computer name). Currently, ACSS only + * supports host names which are less than or equal to 13 characters long. If this value is not provided, vmName + * will be used as host name. + * + * @param hostname the hostname value to set. + * @return the VirtualMachineResourceNames object itself. + */ + public VirtualMachineResourceNames withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Get the networkInterfaces property: The list of network interface name objects for the selected virtual machine. + * Currently, only one network interface is supported per virtual machine. + * + * @return the networkInterfaces value. + */ + public List networkInterfaces() { + return this.networkInterfaces; + } + + /** + * Set the networkInterfaces property: The list of network interface name objects for the selected virtual machine. + * Currently, only one network interface is supported per virtual machine. + * + * @param networkInterfaces the networkInterfaces value to set. + * @return the VirtualMachineResourceNames object itself. + */ + public VirtualMachineResourceNames withNetworkInterfaces(List networkInterfaces) { + this.networkInterfaces = networkInterfaces; + return this; + } + + /** + * Get the osDiskName property: The full name for OS disk attached to the VM. If this value is not provided, it will + * be named by ARM as per its default naming standards (prefixed with vm name). There is only one OS disk attached + * per Virtual Machine. + * + * @return the osDiskName value. + */ + public String osDiskName() { + return this.osDiskName; + } + + /** + * Set the osDiskName property: The full name for OS disk attached to the VM. If this value is not provided, it will + * be named by ARM as per its default naming standards (prefixed with vm name). There is only one OS disk attached + * per Virtual Machine. + * + * @param osDiskName the osDiskName value to set. + * @return the VirtualMachineResourceNames object itself. + */ + public VirtualMachineResourceNames withOsDiskName(String osDiskName) { + this.osDiskName = osDiskName; + return this; + } + + /** + * Get the dataDiskNames property: The full resource names for virtual machine data disks. This is a dictionary + * containing list of names of data disks per volume. Currently supported volumes for database layer are + * ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os', 'backup']. For application and cs layers, only 'default' + * volume is supported. + * + * @return the dataDiskNames value. + */ + public Map> dataDiskNames() { + return this.dataDiskNames; + } + + /** + * Set the dataDiskNames property: The full resource names for virtual machine data disks. This is a dictionary + * containing list of names of data disks per volume. Currently supported volumes for database layer are + * ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os', 'backup']. For application and cs layers, only 'default' + * volume is supported. + * + * @param dataDiskNames the dataDiskNames value to set. + * @return the VirtualMachineResourceNames object itself. + */ + public VirtualMachineResourceNames withDataDiskNames(Map> dataDiskNames) { + this.dataDiskNames = dataDiskNames; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (networkInterfaces() != null) { + networkInterfaces().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/WindowsConfiguration.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/WindowsConfiguration.java new file mode 100644 index 0000000000000..0cfe52f5bb250 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/WindowsConfiguration.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Specifies Windows operating system settings on the virtual machine. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "osType") +@JsonTypeName("Windows") +@Immutable +public final class WindowsConfiguration extends OSConfiguration { + /** Creates an instance of WindowsConfiguration class. */ + public WindowsConfiguration() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/package-info.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/package-info.java new file mode 100644 index 0000000000000..a60abf921b20a --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the data models for WorkloadsClient. Workloads client provides access to various workload + * operations. + */ +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/package-info.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/package-info.java new file mode 100644 index 0000000000000..595c6e8c91042 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/package-info.java @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the classes for WorkloadsClient. Workloads client provides access to various workload operations. + */ +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance; diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/module-info.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/module-info.java new file mode 100644 index 0000000000000..c80d02f5cc153 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/main/java/module-info.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance; + exports com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent; + exports com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models; + exports com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models; + + opens com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/OperationsListSamples.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/OperationsListSamples.java new file mode 100644 index 0000000000000..2e4a9dfd97911 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/OperationsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.generated; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/operations/preview/2023-10-01-preview/examples/Operations_List.json + */ + /** + * Sample code: Operations. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void operations( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/ResourceProviderSapAvailabilityZoneDetailsSamples.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/ResourceProviderSapAvailabilityZoneDetailsSamples.java new file mode 100644 index 0000000000000..e82e7934c0860 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/ResourceProviderSapAvailabilityZoneDetailsSamples.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.generated; + +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapAvailabilityZoneDetailsRequest; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapDatabaseType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapProductType; + +/** Samples for ResourceProvider SapAvailabilityZoneDetails. */ +public final class ResourceProviderSapAvailabilityZoneDetailsSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPAvailabilityZoneDetails_northeurope.json + */ + /** + * Sample code: SAPAvailabilityZoneDetails_northeurope. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPAvailabilityZoneDetailsNortheurope( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .resourceProviders() + .sapAvailabilityZoneDetailsWithResponse( + "centralus", + new SapAvailabilityZoneDetailsRequest() + .withAppLocation("northeurope") + .withSapProduct(SapProductType.S4HANA) + .withDatabaseType(SapDatabaseType.HANA), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPAvailabilityZoneDetails_eastus.json + */ + /** + * Sample code: SAPAvailabilityZoneDetails_eastus. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPAvailabilityZoneDetailsEastus( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .resourceProviders() + .sapAvailabilityZoneDetailsWithResponse( + "centralus", + new SapAvailabilityZoneDetailsRequest() + .withAppLocation("eastus") + .withSapProduct(SapProductType.S4HANA) + .withDatabaseType(SapDatabaseType.HANA), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/ResourceProviderSapDiskConfigurationsSamples.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/ResourceProviderSapDiskConfigurationsSamples.java new file mode 100644 index 0000000000000..a20178339feec --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/ResourceProviderSapDiskConfigurationsSamples.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.generated; + +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapDatabaseType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapDeploymentType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapDiskConfigurationsRequest; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapEnvironmentType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapProductType; + +/** Samples for ResourceProvider SapDiskConfigurations. */ +public final class ResourceProviderSapDiskConfigurationsSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPDiskConfigurations_NonProd.json + */ + /** + * Sample code: SAPDiskConfigurations_NonProd. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPDiskConfigurationsNonProd( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .resourceProviders() + .sapDiskConfigurationsWithResponse( + "centralus", + new SapDiskConfigurationsRequest() + .withAppLocation("eastus") + .withEnvironment(SapEnvironmentType.NON_PROD) + .withSapProduct(SapProductType.S4HANA) + .withDatabaseType(SapDatabaseType.HANA) + .withDeploymentType(SapDeploymentType.THREE_TIER) + .withDbVmSku("Standard_M32ts"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPDiskConfigurations_Prod.json + */ + /** + * Sample code: SAPDiskConfigurations_Prod. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPDiskConfigurationsProd( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .resourceProviders() + .sapDiskConfigurationsWithResponse( + "centralus", + new SapDiskConfigurationsRequest() + .withAppLocation("eastus") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withDatabaseType(SapDatabaseType.HANA) + .withDeploymentType(SapDeploymentType.THREE_TIER) + .withDbVmSku("Standard_M32ts"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/ResourceProviderSapSizingRecommendationsSamples.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/ResourceProviderSapSizingRecommendationsSamples.java new file mode 100644 index 0000000000000..926e0a6205c18 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/ResourceProviderSapSizingRecommendationsSamples.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.generated; + +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapDatabaseScaleMethod; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapDatabaseType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapDeploymentType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapEnvironmentType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapHighAvailabilityType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapProductType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapSizingRecommendationRequest; + +/** Samples for ResourceProvider SapSizingRecommendations. */ +public final class ResourceProviderSapSizingRecommendationsSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPSizingRecommendations_S4HANA_Distributed.json + */ + /** + * Sample code: SAPSizingRecommendations_S4HANA_Distributed. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPSizingRecommendationsS4HANADistributed( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .resourceProviders() + .sapSizingRecommendationsWithResponse( + "centralus", + new SapSizingRecommendationRequest() + .withAppLocation("eastus") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withDeploymentType(SapDeploymentType.THREE_TIER) + .withSaps(20000L) + .withDbMemory(1024L) + .withDatabaseType(SapDatabaseType.HANA) + .withDbScaleMethod(SapDatabaseScaleMethod.SCALE_UP), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPSizingRecommendations_S4HANA_SingleServer.json + */ + /** + * Sample code: SAPSizingRecommendations_S4HANA_SingleServer. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPSizingRecommendationsS4HANASingleServer( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .resourceProviders() + .sapSizingRecommendationsWithResponse( + "centralus", + new SapSizingRecommendationRequest() + .withAppLocation("eastus") + .withEnvironment(SapEnvironmentType.NON_PROD) + .withSapProduct(SapProductType.S4HANA) + .withDeploymentType(SapDeploymentType.SINGLE_SERVER) + .withSaps(60000L) + .withDbMemory(2000L) + .withDatabaseType(SapDatabaseType.HANA) + .withDbScaleMethod(SapDatabaseScaleMethod.SCALE_UP), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPSizingRecommendations_S4HANA_HA_AvZone.json + */ + /** + * Sample code: SAPSizingRecommendations_S4HANA_DistributedHA_AvZone. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPSizingRecommendationsS4HANADistributedHAAvZone( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .resourceProviders() + .sapSizingRecommendationsWithResponse( + "centralus", + new SapSizingRecommendationRequest() + .withAppLocation("eastus") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withDeploymentType(SapDeploymentType.THREE_TIER) + .withSaps(75000L) + .withDbMemory(1024L) + .withDatabaseType(SapDatabaseType.HANA) + .withDbScaleMethod(SapDatabaseScaleMethod.SCALE_UP) + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_ZONE), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPSizingRecommendations_S4HANA_HA_AvSet.json + */ + /** + * Sample code: SAPSizingRecommendations_S4HANA_DistributedHA_AvSet. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPSizingRecommendationsS4HANADistributedHAAvSet( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .resourceProviders() + .sapSizingRecommendationsWithResponse( + "centralus", + new SapSizingRecommendationRequest() + .withAppLocation("eastus") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withDeploymentType(SapDeploymentType.THREE_TIER) + .withSaps(75000L) + .withDbMemory(1024L) + .withDatabaseType(SapDatabaseType.HANA) + .withDbScaleMethod(SapDatabaseScaleMethod.SCALE_UP) + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_SET), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/ResourceProviderSapSupportedSkuSamples.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/ResourceProviderSapSupportedSkuSamples.java new file mode 100644 index 0000000000000..e13035610256d --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/ResourceProviderSapSupportedSkuSamples.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.generated; + +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapDatabaseType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapDeploymentType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapEnvironmentType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapHighAvailabilityType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapProductType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapSupportedSkusRequest; + +/** Samples for ResourceProvider SapSupportedSku. */ +public final class ResourceProviderSapSupportedSkuSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPSupportedSkus_SingleServer.json + */ + /** + * Sample code: SAPSupportedSkus_SingleServer. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPSupportedSkusSingleServer( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .resourceProviders() + .sapSupportedSkuWithResponse( + "centralus", + new SapSupportedSkusRequest() + .withAppLocation("eastus") + .withEnvironment(SapEnvironmentType.NON_PROD) + .withSapProduct(SapProductType.S4HANA) + .withDeploymentType(SapDeploymentType.SINGLE_SERVER) + .withDatabaseType(SapDatabaseType.HANA), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPSupportedSkus_Distributed.json + */ + /** + * Sample code: SAPSupportedSkus_Distributed. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPSupportedSkusDistributed( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .resourceProviders() + .sapSupportedSkuWithResponse( + "centralus", + new SapSupportedSkusRequest() + .withAppLocation("eastus") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withDeploymentType(SapDeploymentType.THREE_TIER) + .withDatabaseType(SapDatabaseType.HANA), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPSupportedSkus_DistributedHA_AvZone.json + */ + /** + * Sample code: SAPSupportedSkus_DistributedHA_AvZone. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPSupportedSkusDistributedHAAvZone( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .resourceProviders() + .sapSupportedSkuWithResponse( + "centralus", + new SapSupportedSkusRequest() + .withAppLocation("eastus") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withDeploymentType(SapDeploymentType.THREE_TIER) + .withDatabaseType(SapDatabaseType.HANA) + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_ZONE), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPSupportedSkus_DistributedHA_AvSet.json + */ + /** + * Sample code: SAPSupportedSkus_DistributedHA_AvSet. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPSupportedSkusDistributedHAAvSet( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .resourceProviders() + .sapSupportedSkuWithResponse( + "centralus", + new SapSupportedSkusRequest() + .withAppLocation("eastus") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withDeploymentType(SapDeploymentType.THREE_TIER) + .withDatabaseType(SapDatabaseType.HANA) + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_SET), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapApplicationServerInstancesCreateSamples.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapApplicationServerInstancesCreateSamples.java new file mode 100644 index 0000000000000..58ff5dde0c7d5 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapApplicationServerInstancesCreateSamples.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.generated; + +import java.util.HashMap; +import java.util.Map; + +/** Samples for SapApplicationServerInstances Create. */ +public final class SapApplicationServerInstancesCreateSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapapplicationinstances/SAPApplicationServerInstances_Create.json + */ + /** + * Sample code: SAPApplicationServerInstances_Create. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPApplicationServerInstancesCreate( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapApplicationServerInstances() + .define("app01") + .withRegion("eastus") + .withExistingSapVirtualInstance("test-rg", "X00") + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapapplicationinstances/SAPApplicationServerInstances_Create_HA_AvSet.json + */ + /** + * Sample code: Create SAP Application Server Instances for HA System with Availability Set. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createSAPApplicationServerInstancesForHASystemWithAvailabilitySet( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapApplicationServerInstances() + .define("app01") + .withRegion("eastus") + .withExistingSapVirtualInstance("test-rg", "X00") + .withTags(mapOf()) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapApplicationServerInstancesDeleteSamples.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapApplicationServerInstancesDeleteSamples.java new file mode 100644 index 0000000000000..9ba161bdb505e --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapApplicationServerInstancesDeleteSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.generated; + +/** Samples for SapApplicationServerInstances Delete. */ +public final class SapApplicationServerInstancesDeleteSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapapplicationinstances/SAPApplicationServerInstances_Delete.json + */ + /** + * Sample code: SAPApplicationServerInstances_Delete. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPApplicationServerInstancesDelete( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager.sapApplicationServerInstances().delete("test-rg", "X00", "app01", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapApplicationServerInstancesGetSamples.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapApplicationServerInstancesGetSamples.java new file mode 100644 index 0000000000000..da228f503bc15 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapApplicationServerInstancesGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.generated; + +/** Samples for SapApplicationServerInstances Get. */ +public final class SapApplicationServerInstancesGetSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapapplicationinstances/SAPApplicationServerInstances_Get.json + */ + /** + * Sample code: SAPApplicationServerInstances_Get. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPApplicationServerInstancesGet( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapApplicationServerInstances() + .getWithResponse("test-rg", "X00", "app01", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapApplicationServerInstancesListSamples.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapApplicationServerInstancesListSamples.java new file mode 100644 index 0000000000000..31eeab1dffd28 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapApplicationServerInstancesListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.generated; + +/** Samples for SapApplicationServerInstances List. */ +public final class SapApplicationServerInstancesListSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapapplicationinstances/SAPApplicationServerInstances_List.json + */ + /** + * Sample code: SAPApplicationServerInstances_List. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPApplicationServerInstancesList( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager.sapApplicationServerInstances().list("test-rg", "X00", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapApplicationServerInstancesStartInstanceSamples.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapApplicationServerInstancesStartInstanceSamples.java new file mode 100644 index 0000000000000..cc585c3de86a3 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapApplicationServerInstancesStartInstanceSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.generated; + +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StartRequest; + +/** Samples for SapApplicationServerInstances StartInstance. */ +public final class SapApplicationServerInstancesStartInstanceSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapapplicationinstances/SAPApplicationServerInstances_StartInstance_WithInfraOperations.json + */ + /** + * Sample code: Start Virtual Machine and the SAP Application Server Instance on it. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void startVirtualMachineAndTheSAPApplicationServerInstanceOnIt( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapApplicationServerInstances() + .startInstance( + "test-rg", "X00", "app01", new StartRequest().withStartVm(true), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapapplicationinstances/SAPApplicationServerInstances_StartInstance.json + */ + /** + * Sample code: Start the SAP Application Server Instance. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void startTheSAPApplicationServerInstance( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapApplicationServerInstances() + .startInstance("test-rg", "X00", "app01", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapApplicationServerInstancesStopInstanceSamples.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapApplicationServerInstancesStopInstanceSamples.java new file mode 100644 index 0000000000000..5b494335234da --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapApplicationServerInstancesStopInstanceSamples.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.generated; + +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StopRequest; + +/** Samples for SapApplicationServerInstances StopInstance. */ +public final class SapApplicationServerInstancesStopInstanceSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapapplicationinstances/SAPApplicationServerInstances_StopInstance_WithInfraOperations.json + */ + /** + * Sample code: Stop the SAP Application Server Instance and the Virtual machine. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void stopTheSAPApplicationServerInstanceAndTheVirtualMachine( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapApplicationServerInstances() + .stopInstance( + "test-rg", + "X00", + "app01", + new StopRequest().withSoftStopTimeoutSeconds(0L).withDeallocateVm(true), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapapplicationinstances/SAPApplicationServerInstances_StopInstance.json + */ + /** + * Sample code: Stop the SAP Application Server Instance. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void stopTheSAPApplicationServerInstance( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapApplicationServerInstances() + .stopInstance( + "test-rg", + "X00", + "app01", + new StopRequest().withSoftStopTimeoutSeconds(0L), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapApplicationServerInstancesUpdateSamples.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapApplicationServerInstancesUpdateSamples.java new file mode 100644 index 0000000000000..61543872a12fd --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapApplicationServerInstancesUpdateSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.generated; + +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapApplicationServerInstance; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SapApplicationServerInstances Update. */ +public final class SapApplicationServerInstancesUpdateSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapapplicationinstances/SAPApplicationServerInstances_Update.json + */ + /** + * Sample code: SAPApplicationServerInstances_Update. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPApplicationServerInstancesUpdate( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + SapApplicationServerInstance resource = + manager + .sapApplicationServerInstances() + .getWithResponse("test-rg", "X00", "app01", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapCentralInstancesCreateSamples.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapCentralInstancesCreateSamples.java new file mode 100644 index 0000000000000..b893e2afb6a17 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapCentralInstancesCreateSamples.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.generated; + +import java.util.HashMap; +import java.util.Map; + +/** Samples for SapCentralInstances Create. */ +public final class SapCentralInstancesCreateSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapcentralinstances/SAPCentralInstances_Create_HA_AvSet.json + */ + /** + * Sample code: Create SAP Central Instances for HA System with Availability Set. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createSAPCentralInstancesForHASystemWithAvailabilitySet( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapCentralInstances() + .define("centralServer") + .withRegion("eastus") + .withExistingSapVirtualInstance("test-rg", "X00") + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapcentralinstances/SAPCentralInstances_Create.json + */ + /** + * Sample code: SAPCentralInstances_Create. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPCentralInstancesCreate( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapCentralInstances() + .define("centralServer") + .withRegion("eastus") + .withExistingSapVirtualInstance("test-rg", "X00") + .withTags(mapOf()) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapCentralInstancesDeleteSamples.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapCentralInstancesDeleteSamples.java new file mode 100644 index 0000000000000..2e4bdbf980eae --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapCentralInstancesDeleteSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.generated; + +/** Samples for SapCentralInstances Delete. */ +public final class SapCentralInstancesDeleteSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapcentralinstances/SAPCentralInstances_Delete.json + */ + /** + * Sample code: SAPCentralInstances_Delete. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPCentralInstancesDelete( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager.sapCentralInstances().delete("test-rg", "X00", "centralServer", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapCentralInstancesGetSamples.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapCentralInstancesGetSamples.java new file mode 100644 index 0000000000000..60c64b3480236 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapCentralInstancesGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.generated; + +/** Samples for SapCentralInstances Get. */ +public final class SapCentralInstancesGetSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapcentralinstances/SAPCentralInstances_Get.json + */ + /** + * Sample code: SAPCentralInstances_Get. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPCentralInstancesGet( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapCentralInstances() + .getWithResponse("test-rg", "X00", "centralServer", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapCentralInstancesListSamples.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapCentralInstancesListSamples.java new file mode 100644 index 0000000000000..efc609b7962d5 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapCentralInstancesListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.generated; + +/** Samples for SapCentralInstances List. */ +public final class SapCentralInstancesListSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapcentralinstances/SAPCentralInstances_List.json + */ + /** + * Sample code: SAPCentralInstances_List. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPCentralInstancesList( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager.sapCentralInstances().list("test-rg", "X00", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapCentralInstancesStartInstanceSamples.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapCentralInstancesStartInstanceSamples.java new file mode 100644 index 0000000000000..43b78188eede0 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapCentralInstancesStartInstanceSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.generated; + +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StartRequest; + +/** Samples for SapCentralInstances StartInstance. */ +public final class SapCentralInstancesStartInstanceSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapcentralinstances/SAPCentralInstances_StartInstance_WithInfraOperations.json + */ + /** + * Sample code: Start the virtual machine(s) and the SAP central services instance on it. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void startTheVirtualMachineSAndTheSAPCentralServicesInstanceOnIt( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapCentralInstances() + .startInstance( + "test-rg", + "X00", + "centralServer", + new StartRequest().withStartVm(true), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapcentralinstances/SAPCentralInstances_StartInstance.json + */ + /** + * Sample code: Start the SAP Central Services Instance. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void startTheSAPCentralServicesInstance( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapCentralInstances() + .startInstance("test-rg", "X00", "centralServer", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapCentralInstancesStopInstanceSamples.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapCentralInstancesStopInstanceSamples.java new file mode 100644 index 0000000000000..ef6a7c13f8ab4 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapCentralInstancesStopInstanceSamples.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.generated; + +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StopRequest; + +/** Samples for SapCentralInstances StopInstance. */ +public final class SapCentralInstancesStopInstanceSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapcentralinstances/SAPCentralInstances_StopInstance.json + */ + /** + * Sample code: Stop the SAP Central Services Instance. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void stopTheSAPCentralServicesInstance( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapCentralInstances() + .stopInstance( + "test-rg", + "X00", + "centralServer", + new StopRequest().withSoftStopTimeoutSeconds(1200L), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapcentralinstances/SAPCentralInstances_StopInstance_WithInfraOperations.json + */ + /** + * Sample code: Stop the SAP Central Services Instance and its underlying Virtual Machine(s). + * + * @param manager Entry point to WorkloadsManager. + */ + public static void stopTheSAPCentralServicesInstanceAndItsUnderlyingVirtualMachineS( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapCentralInstances() + .stopInstance( + "test-rg", + "X00", + "centralServer", + new StopRequest().withDeallocateVm(true), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapCentralInstancesUpdateSamples.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapCentralInstancesUpdateSamples.java new file mode 100644 index 0000000000000..311d07895e5be --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapCentralInstancesUpdateSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.generated; + +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapCentralServerInstance; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SapCentralInstances Update. */ +public final class SapCentralInstancesUpdateSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapcentralinstances/SAPCentralInstances_Update.json + */ + /** + * Sample code: SAPCentralInstances_Update. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPCentralInstancesUpdate( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + SapCentralServerInstance resource = + manager + .sapCentralInstances() + .getWithResponse("test-rg", "X00", "centralServer", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag1", "value1")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapDatabaseInstancesCreateSamples.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapDatabaseInstancesCreateSamples.java new file mode 100644 index 0000000000000..6ba1e6d7f4f62 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapDatabaseInstancesCreateSamples.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.generated; + +import java.util.HashMap; +import java.util.Map; + +/** Samples for SapDatabaseInstances Create. */ +public final class SapDatabaseInstancesCreateSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapdatabaseinstances/SAPDatabaseInstances_Create_HA_AvSet.json + */ + /** + * Sample code: Create SAP Database Instances for HA System with Availability Set. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createSAPDatabaseInstancesForHASystemWithAvailabilitySet( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapDatabaseInstances() + .define("databaseServer") + .withRegion("eastus") + .withExistingSapVirtualInstance("test-rg", "X00") + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapdatabaseinstances/SAPDatabaseInstances_Create.json + */ + /** + * Sample code: SAPDatabaseInstances_Create. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPDatabaseInstancesCreate( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapDatabaseInstances() + .define("databaseServer") + .withRegion("eastus") + .withExistingSapVirtualInstance("test-rg", "X00") + .withTags(mapOf()) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapDatabaseInstancesDeleteSamples.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapDatabaseInstancesDeleteSamples.java new file mode 100644 index 0000000000000..53df5ecbc0d40 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapDatabaseInstancesDeleteSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.generated; + +/** Samples for SapDatabaseInstances Delete. */ +public final class SapDatabaseInstancesDeleteSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapdatabaseinstances/SAPDatabaseInstances_Delete.json + */ + /** + * Sample code: SAPDatabaseInstances_Delete. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPDatabaseInstancesDelete( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager.sapDatabaseInstances().delete("test-rg", "X00", "databaseServer", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapDatabaseInstancesGetSamples.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapDatabaseInstancesGetSamples.java new file mode 100644 index 0000000000000..7995d37d02652 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapDatabaseInstancesGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.generated; + +/** Samples for SapDatabaseInstances Get. */ +public final class SapDatabaseInstancesGetSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapdatabaseinstances/SAPDatabaseInstances_Get.json + */ + /** + * Sample code: SAPDatabaseInstances_Get. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPDatabaseInstancesGet( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapDatabaseInstances() + .getWithResponse("test-rg", "X00", "databaseServer", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapDatabaseInstancesListSamples.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapDatabaseInstancesListSamples.java new file mode 100644 index 0000000000000..9cd960ede7a4a --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapDatabaseInstancesListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.generated; + +/** Samples for SapDatabaseInstances List. */ +public final class SapDatabaseInstancesListSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapdatabaseinstances/SAPDatabaseInstances_List.json + */ + /** + * Sample code: SAPDatabaseInstances_List. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPDatabaseInstancesList( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager.sapDatabaseInstances().list("test-rg", "X00", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapDatabaseInstancesStartInstanceSamples.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapDatabaseInstancesStartInstanceSamples.java new file mode 100644 index 0000000000000..9f5c6cb072c03 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapDatabaseInstancesStartInstanceSamples.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.generated; + +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StartRequest; + +/** Samples for SapDatabaseInstances StartInstance. */ +public final class SapDatabaseInstancesStartInstanceSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapdatabaseinstances/SAPDatabaseInstances_StartInstance.json + */ + /** + * Sample code: Start the database instance of the SAP system. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void startTheDatabaseInstanceOfTheSAPSystem( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager.sapDatabaseInstances().startInstance("test-rg", "X00", "db0", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapdatabaseinstances/SAPDatabaseInstances_StartInstance_WithInfraOperations.json + */ + /** + * Sample code: Start Virtual Machine and the database instance of the SAP system on it. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void startVirtualMachineAndTheDatabaseInstanceOfTheSAPSystemOnIt( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapDatabaseInstances() + .startInstance( + "test-rg", "X00", "db0", new StartRequest().withStartVm(true), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapDatabaseInstancesStopInstanceSamples.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapDatabaseInstancesStopInstanceSamples.java new file mode 100644 index 0000000000000..8f50b42737676 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapDatabaseInstancesStopInstanceSamples.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.generated; + +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StopRequest; + +/** Samples for SapDatabaseInstances StopInstance. */ +public final class SapDatabaseInstancesStopInstanceSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapdatabaseinstances/SAPDatabaseInstances_StopInstance.json + */ + /** + * Sample code: Stop the database instance of the SAP system. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void stopTheDatabaseInstanceOfTheSAPSystem( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapDatabaseInstances() + .stopInstance( + "test-rg", + "X00", + "db0", + new StopRequest().withSoftStopTimeoutSeconds(0L), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapdatabaseinstances/SAPDatabaseInstances_StopInstance_WithInfraOperations.json + */ + /** + * Sample code: Stop the database instance of the SAP system and the underlying Virtual Machine(s). + * + * @param manager Entry point to WorkloadsManager. + */ + public static void stopTheDatabaseInstanceOfTheSAPSystemAndTheUnderlyingVirtualMachineS( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapDatabaseInstances() + .stopInstance( + "test-rg", + "X00", + "db0", + new StopRequest().withSoftStopTimeoutSeconds(0L).withDeallocateVm(true), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapDatabaseInstancesUpdateSamples.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapDatabaseInstancesUpdateSamples.java new file mode 100644 index 0000000000000..f0dbffa5e1bc5 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapDatabaseInstancesUpdateSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.generated; + +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapDatabaseInstance; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SapDatabaseInstances Update. */ +public final class SapDatabaseInstancesUpdateSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapdatabaseinstances/SAPDatabaseInstances_Update.json + */ + /** + * Sample code: SAPDatabaseInstances_Update. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPDatabaseInstancesUpdate( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + SapDatabaseInstance resource = + manager + .sapDatabaseInstances() + .getWithResponse("test-rg", "X00", "databaseServer", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key1", "fakeTokenPlaceholder")).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapVirtualInstancesCreateSamples.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapVirtualInstancesCreateSamples.java new file mode 100644 index 0000000000000..5fcf02d027280 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapVirtualInstancesCreateSamples.java @@ -0,0 +1,3139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.generated; + +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.ApplicationServerConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.ApplicationServerFullResourceNames; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.CentralServerConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.CentralServerFullResourceNames; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.CreateAndMountFileShareConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.DatabaseConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.DatabaseServerFullResourceNames; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.DeploymentConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.DeploymentWithOSConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.DiscoveryConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.DiskConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.DiskSku; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.DiskSkuName; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.DiskVolumeConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.ExternalInstallationSoftwareConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.HighAvailabilityConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.ImageReference; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.LinuxConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.LoadBalancerResourceNames; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.ManagedResourcesNetworkAccessType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.MountFileShareConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.NetworkConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.NetworkInterfaceResourceNames; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.OSProfile; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.OsSapConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapDatabaseType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapEnvironmentType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapHighAvailabilityType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapInstallWithoutOSConfigSoftwareConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapProductType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SharedStorageResourceNames; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SingleServerConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SkipFileShareConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SshConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SshKeyPair; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SshPublicKey; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StorageConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.ThreeTierConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.ThreeTierFullResourceNames; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.VirtualMachineConfiguration; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.VirtualMachineResourceNames; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SapVirtualInstances Create. */ +public final class SapVirtualInstancesCreateSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Install_Distributed.json + */ + /** + * Sample code: Install SAP Software on Distributed System. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void installSAPSoftwareOnDistributedSystem( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus2") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentWithOSConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new ThreeTierConfiguration() + .withAppResourceGroup("{{resourcegrp}}") + .withNetworkConfiguration(new NetworkConfiguration().withIsSecondaryIpEnabled(true)) + .withCentralServer( + new CentralServerConfiguration() + .withSubnetId( + "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E4ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("8.2") + .withVersion("8.2.2021091201")) + .withOsProfile( + new OSProfile() + .withAdminUsername("azureuser") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withApplicationServer( + new ApplicationServerConfiguration() + .withSubnetId( + "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E4ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("8.2") + .withVersion("8.2.2021091201")) + .withOsProfile( + new OSProfile() + .withAdminUsername("azureuser") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withDatabaseServer( + new DatabaseConfiguration() + .withSubnetId( + "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_M32ts") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("8.2") + .withVersion("8.2.2021091201")) + .withOsProfile( + new OSProfile() + .withAdminUsername("azureuser") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L))) + .withSoftwareConfiguration( + new SapInstallWithoutOSConfigSoftwareConfiguration() + .withBomUrl( + "https://teststorageaccount.blob.core.windows.net/sapbits/sapfiles/boms/S41909SPS03_v0011ms/S41909SPS03_v0011ms.yaml") + .withSapBitsStorageAccountId( + "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Storage/storageAccounts/teststorageaccount") + .withSoftwareVersion("SAP S/4HANA 1909 SPS 03")) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("sap.bpaas.com"))) + .withTags(mapOf("created by", "azureuser")) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_HA_AvZone.json + */ + /** + * Sample code: Create Infrastructure only for HA System with Availability Zone. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createInfrastructureOnlyForHASystemWithAvailabilityZone( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new ThreeTierConfiguration() + .withAppResourceGroup("X00-RG") + .withCentralServer( + new CentralServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withKeyData( + "fakeTokenPlaceholder"))))))) + .withInstanceCount(2L)) + .withApplicationServer( + new ApplicationServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withKeyData( + "fakeTokenPlaceholder"))))))) + .withInstanceCount(6L)) + .withDatabaseServer( + new DatabaseConfiguration() + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_M32ts") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withKeyData( + "fakeTokenPlaceholder"))))))) + .withInstanceCount(2L)) + .withHighAvailabilityConfig( + new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_ZONE)))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_Distributed.json + */ + /** + * Sample code: Create Infrastructure with OS configuration for Distributed System (Recommended). + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createInfrastructureWithOSConfigurationForDistributedSystemRecommended( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentWithOSConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new ThreeTierConfiguration() + .withAppResourceGroup("X00-RG") + .withCentralServer( + new CentralServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withApplicationServer( + new ApplicationServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer( + new DatabaseConfiguration() + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_M32ts") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_DetectInstallation_SingleServer.json + */ + /** + * Sample code: Detect SAP Software Installation on a Single Server System. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void detectSAPSoftwareInstallationOnASingleServerSystem( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.NON_PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentWithOSConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new SingleServerConfiguration() + .withAppResourceGroup("X00-RG") + .withNetworkConfiguration(new NetworkConfiguration().withIsSecondaryIpEnabled(true)) + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder")))))) + .withSoftwareConfiguration( + new ExternalInstallationSoftwareConfiguration() + .withCentralServerVmId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0")) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_WithTrustedAccess.json + */ + /** + * Sample code: Create Infrastructure (with OS configuration) with trusted access enabled. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createInfrastructureWithOSConfigurationWithTrustedAccessEnabled( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentWithOSConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new ThreeTierConfiguration() + .withAppResourceGroup("X00-RG") + .withCentralServer( + new CentralServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withApplicationServer( + new ApplicationServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer( + new DatabaseConfiguration() + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_M32ts") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withTags(mapOf()) + .withManagedResourcesNetworkAccessType(ManagedResourcesNetworkAccessType.PRIVATE) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_DiskDetails_HA_AvSet.json + */ + /** + * Sample code: Create Infrastructure with Disk and OS configuration for HA System with Availability Set + * (Recommended). + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createInfrastructureWithDiskAndOSConfigurationForHASystemWithAvailabilitySetRecommended( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentWithOSConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new ThreeTierConfiguration() + .withAppResourceGroup("X00-RG") + .withCentralServer( + new CentralServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withApplicationServer( + new ApplicationServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer( + new DatabaseConfiguration() + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_M32ts") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L) + .withDiskConfiguration( + new DiskConfiguration() + .withDiskVolumeConfigurations( + mapOf( + "backup", + new DiskVolumeConfiguration() + .withCount(2L) + .withSizeGB(256L) + .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), + "hana/data", + new DiskVolumeConfiguration() + .withCount(4L) + .withSizeGB(128L) + .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), + "hana/log", + new DiskVolumeConfiguration() + .withCount(3L) + .withSizeGB(128L) + .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), + "hana/shared", + new DiskVolumeConfiguration() + .withCount(1L) + .withSizeGB(256L) + .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), + "os", + new DiskVolumeConfiguration() + .withCount(1L) + .withSizeGB(64L) + .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), + "usr/sap", + new DiskVolumeConfiguration() + .withCount(1L) + .withSizeGB(128L) + .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)))))) + .withHighAvailabilityConfig( + new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_SET))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_Discover_TrustedAccessEnable.json + */ + /** + * Sample code: Register with trusted access enabled. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void registerWithTrustedAccessEnabled( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("northeurope") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.NON_PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DiscoveryConfiguration() + .withCentralServerVmId( + "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0")) + .withTags(mapOf("createdby", "abc@microsoft.com", "test", "abc")) + .withManagedResourcesNetworkAccessType(ManagedResourcesNetworkAccessType.PRIVATE) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_Custom_Image.json + */ + /** + * Sample code: Create Infrastructure (with OS configuration) with Azure Compute Gallery Image. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createInfrastructureWithOSConfigurationWithAzureComputeGalleryImage( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new ThreeTierConfiguration() + .withAppResourceGroup("X00-RG") + .withCentralServer( + new CentralServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference( + new ImageReference() + .withId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/galleries/testgallery/images/rhelimagetest/versions/0.0.1")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withKeyData( + "fakeTokenPlaceholder"))))))) + .withInstanceCount(2L)) + .withApplicationServer( + new ApplicationServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/galleries/testgallery/images/rhelimagetest/versions/0.0.1")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withKeyData( + "fakeTokenPlaceholder"))))))) + .withInstanceCount(6L)) + .withDatabaseServer( + new DatabaseConfiguration() + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_M32ts") + .withImageReference( + new ImageReference() + .withId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/galleries/testgallery/images/rhelimagetest/versions/0.0.1")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withKeyData( + "fakeTokenPlaceholder"))))))) + .withInstanceCount(2L)) + .withHighAvailabilityConfig( + new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_ZONE)))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_HA_AvSet.json + */ + /** + * Sample code: Create Infrastructure only for HA System with Availability Set. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createInfrastructureOnlyForHASystemWithAvailabilitySet( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new ThreeTierConfiguration() + .withAppResourceGroup("X00-RG") + .withCentralServer( + new CentralServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withKeyData( + "fakeTokenPlaceholder"))))))) + .withInstanceCount(2L)) + .withApplicationServer( + new ApplicationServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withKeyData( + "fakeTokenPlaceholder"))))))) + .withInstanceCount(5L)) + .withDatabaseServer( + new DatabaseConfiguration() + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_M32ts") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withKeyData( + "fakeTokenPlaceholder"))))))) + .withInstanceCount(2L)) + .withHighAvailabilityConfig( + new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_SET)))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_DetectInstallation_HA_AvZone.json + */ + /** + * Sample code: Detect SAP Software Installation on an HA System with Availability Zone. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void detectSAPSoftwareInstallationOnAnHASystemWithAvailabilityZone( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentWithOSConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new ThreeTierConfiguration() + .withAppResourceGroup("X00-RG") + .withCentralServer( + new CentralServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withApplicationServer( + new ApplicationServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer( + new DatabaseConfiguration() + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_M32ts") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withHighAvailabilityConfig( + new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_ZONE))) + .withSoftwareConfiguration( + new ExternalInstallationSoftwareConfiguration() + .withCentralServerVmId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0")) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_SingleServer.json + */ + /** + * Sample code: Create Infrastructure only for Single Server System. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createInfrastructureOnlyForSingleServerSystem( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.NON_PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new SingleServerConfiguration() + .withAppResourceGroup("X00-RG") + .withNetworkConfiguration(new NetworkConfiguration().withIsSecondaryIpEnabled(true)) + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withKeyData("fakeTokenPlaceholder"))))))))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_Distributed_CreateTransport.json + */ + /** + * Sample code: Create Infrastructure with a new SAP Transport Directory Fileshare. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createInfrastructureWithANewSAPTransportDirectoryFileshare( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentWithOSConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new ThreeTierConfiguration() + .withAppResourceGroup("X00-RG") + .withCentralServer( + new CentralServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withApplicationServer( + new ApplicationServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer( + new DatabaseConfiguration() + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_M32ts") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withStorageConfiguration( + new StorageConfiguration() + .withTransportFileShareConfiguration( + new CreateAndMountFileShareConfiguration() + .withResourceGroup("rgName") + .withStorageAccountName("storageName")))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_Discover.json + */ + /** + * Sample code: Register existing SAP system as Virtual Instance for SAP solutions. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void registerExistingSAPSystemAsVirtualInstanceForSAPSolutions( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("northeurope") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.NON_PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DiscoveryConfiguration() + .withCentralServerVmId( + "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0")) + .withTags(mapOf("createdby", "abc@microsoft.com", "test", "abc")) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_CustomFullResourceNames_Distributed.json + */ + /** + * Sample code: Create Infrastructure (with OS configuration) with custom resource names for Distributed System. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createInfrastructureWithOSConfigurationWithCustomResourceNamesForDistributedSystem( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentWithOSConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new ThreeTierConfiguration() + .withAppResourceGroup("X00-RG") + .withCentralServer( + new CentralServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withApplicationServer( + new ApplicationServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer( + new DatabaseConfiguration() + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_M32ts") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withCustomResourceNames( + new ThreeTierFullResourceNames() + .withCentralServer( + new CentralServerFullResourceNames() + .withVirtualMachines( + Arrays + .asList( + new VirtualMachineResourceNames() + .withVmName("ascsvm") + .withHostname("ascshostName") + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("ascsnic"))) + .withOsDiskName("ascsosdisk") + .withDataDiskNames( + mapOf("default", Arrays.asList("ascsdisk0")))))) + .withApplicationServer( + new ApplicationServerFullResourceNames() + .withVirtualMachines( + Arrays + .asList( + new VirtualMachineResourceNames() + .withVmName("appvm0") + .withHostname("apphostName0") + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("appnic0"))) + .withOsDiskName("app0osdisk") + .withDataDiskNames( + mapOf("default", Arrays.asList("app0disk0"))), + new VirtualMachineResourceNames() + .withVmName("appvm1") + .withHostname("apphostName1") + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("appnic1"))) + .withOsDiskName("app1osdisk") + .withDataDiskNames( + mapOf("default", Arrays.asList("app1disk0"))))) + .withAvailabilitySetName("appAvSet")) + .withDatabaseServer( + new DatabaseServerFullResourceNames() + .withVirtualMachines( + Arrays + .asList( + new VirtualMachineResourceNames() + .withVmName("dbvm") + .withHostname("dbhostName") + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("dbnic"))) + .withOsDiskName("dbosdisk") + .withDataDiskNames( + mapOf( + "hanaData", + Arrays.asList("hanadata0", "hanadata1"), + "hanaLog", + Arrays.asList("hanalog0", "hanalog1", "hanalog2"), + "hanaShared", + Arrays.asList("hanashared0", "hanashared1"), + "usrSap", + Arrays.asList("usrsap0")))))) + .withSharedStorage( + new SharedStorageResourceNames() + .withSharedStorageAccountName("storageacc") + .withSharedStorageAccountPrivateEndPointName("peForxNFS")))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_CustomFullResourceNames_SingleServer.json + */ + /** + * Sample code: Create Infrastructure (with OS configuration) with custom resource names for Single Server System. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createInfrastructureWithOSConfigurationWithCustomResourceNamesForSingleServerSystem( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.NON_PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentWithOSConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new SingleServerConfiguration() + .withAppResourceGroup("X00-RG") + .withNetworkConfiguration(new NetworkConfiguration().withIsSecondaryIpEnabled(true)) + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder")))))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_CustomFullResourceNames_HA_AvZone.json + */ + /** + * Sample code: Create Infrastructure (with OS configuration) with custom resource names for HA system with + * Availability Zone. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createInfrastructureWithOSConfigurationWithCustomResourceNamesForHASystemWithAvailabilityZone( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentWithOSConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new ThreeTierConfiguration() + .withAppResourceGroup("X00-RG") + .withCentralServer( + new CentralServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withApplicationServer( + new ApplicationServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer( + new DatabaseConfiguration() + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_M32ts") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withHighAvailabilityConfig( + new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_ZONE)) + .withCustomResourceNames( + new ThreeTierFullResourceNames() + .withCentralServer( + new CentralServerFullResourceNames() + .withVirtualMachines( + Arrays + .asList( + new VirtualMachineResourceNames() + .withVmName("ascsvm") + .withHostname("ascshostName") + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("ascsnic"))) + .withOsDiskName("ascsosdisk"), + new VirtualMachineResourceNames() + .withVmName("ersvm") + .withHostname("ershostName") + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("ersnic"))) + .withOsDiskName("ersosdisk"))) + .withLoadBalancer( + new LoadBalancerResourceNames() + .withLoadBalancerName("ascslb") + .withFrontendIpConfigurationNames( + Arrays.asList("ascsip0", "ersip0")) + .withBackendPoolNames(Arrays.asList("ascsBackendPool")) + .withHealthProbeNames( + Arrays.asList("ascsHealthProbe", "ersHealthProbe")))) + .withApplicationServer( + new ApplicationServerFullResourceNames() + .withVirtualMachines( + Arrays + .asList( + new VirtualMachineResourceNames() + .withVmName("appvm0") + .withHostname("apphostName0") + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("appnic0"))) + .withOsDiskName("app0osdisk") + .withDataDiskNames( + mapOf("default", Arrays.asList("app0disk0"))), + new VirtualMachineResourceNames() + .withVmName("appvm1") + .withHostname("apphostName1") + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("appnic1"))) + .withOsDiskName("app1osdisk") + .withDataDiskNames( + mapOf("default", Arrays.asList("app1disk0")))))) + .withDatabaseServer( + new DatabaseServerFullResourceNames() + .withVirtualMachines( + Arrays + .asList( + new VirtualMachineResourceNames() + .withVmName("dbvmpr") + .withHostname("dbprhostName") + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("dbprnic"))) + .withOsDiskName("dbprosdisk") + .withDataDiskNames( + mapOf( + "hanaData", + Arrays.asList("hanadatapr0", "hanadatapr1"), + "hanaLog", + Arrays + .asList( + "hanalogpr0", "hanalogpr1", "hanalogpr2"), + "hanaShared", + Arrays.asList("hanasharedpr0", "hanasharedpr1"), + "usrSap", + Arrays.asList("usrsappr0"))), + new VirtualMachineResourceNames() + .withVmName("dbvmsr") + .withHostname("dbsrhostName") + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("dbsrnic"))) + .withOsDiskName("dbsrosdisk") + .withDataDiskNames( + mapOf( + "hanaData", + Arrays.asList("hanadatasr0", "hanadatasr1"), + "hanaLog", + Arrays + .asList( + "hanalogsr0", "hanalogsr1", "hanalogsr2"), + "hanaShared", + Arrays.asList("hanasharedsr0", "hanasharedsr1"), + "usrSap", + Arrays.asList("usrsapsr0"))))) + .withLoadBalancer( + new LoadBalancerResourceNames() + .withLoadBalancerName("dblb") + .withFrontendIpConfigurationNames(Arrays.asList("dbip")) + .withBackendPoolNames(Arrays.asList("dbBackendPool")) + .withHealthProbeNames(Arrays.asList("dbHealthProbe")))) + .withSharedStorage( + new SharedStorageResourceNames() + .withSharedStorageAccountName("storageacc") + .withSharedStorageAccountPrivateEndPointName("peForxNFS")))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_Distributed_MountTransport.json + */ + /** + * Sample code: Create Infrastructure with an existing SAP Transport Directory Fileshare. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createInfrastructureWithAnExistingSAPTransportDirectoryFileshare( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentWithOSConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new ThreeTierConfiguration() + .withAppResourceGroup("X00-RG") + .withCentralServer( + new CentralServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withApplicationServer( + new ApplicationServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer( + new DatabaseConfiguration() + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_M32ts") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withStorageConfiguration( + new StorageConfiguration() + .withTransportFileShareConfiguration( + new MountFileShareConfiguration() + .withId( + "/subscriptions/49d64d54-e888-4c46-a868-1936802b762c/resourceGroups/testrg/providers/Microsoft.Network/privateEndpoints/endpoint") + .withPrivateEndpointId( + "/subscriptions/49d64d54-e888-4c46-a868-1936802b762c/resourceGroups/testrg/providers/Microsoft.Network/privateEndpoints/endpoint")))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_CustomFullResourceNames_HA_AvSet.json + */ + /** + * Sample code: Create Infrastructure (with OS configuration) with custom resource names for HA System with + * Availability Set. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createInfrastructureWithOSConfigurationWithCustomResourceNamesForHASystemWithAvailabilitySet( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentWithOSConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new ThreeTierConfiguration() + .withAppResourceGroup("X00-RG") + .withCentralServer( + new CentralServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withApplicationServer( + new ApplicationServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer( + new DatabaseConfiguration() + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_M32ts") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withHighAvailabilityConfig( + new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_SET)) + .withCustomResourceNames( + new ThreeTierFullResourceNames() + .withCentralServer( + new CentralServerFullResourceNames() + .withVirtualMachines( + Arrays + .asList( + new VirtualMachineResourceNames() + .withVmName("ascsvm") + .withHostname("ascshostName") + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("ascsnic"))) + .withOsDiskName("ascsosdisk"), + new VirtualMachineResourceNames() + .withVmName("ersvm") + .withHostname("ershostName") + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("ersnic"))) + .withOsDiskName("ersosdisk"))) + .withAvailabilitySetName("csAvSet") + .withLoadBalancer( + new LoadBalancerResourceNames() + .withLoadBalancerName("ascslb") + .withFrontendIpConfigurationNames( + Arrays.asList("ascsip0", "ersip0")) + .withBackendPoolNames(Arrays.asList("ascsBackendPool")) + .withHealthProbeNames( + Arrays.asList("ascsHealthProbe", "ersHealthProbe")))) + .withApplicationServer( + new ApplicationServerFullResourceNames() + .withVirtualMachines( + Arrays + .asList( + new VirtualMachineResourceNames() + .withVmName("appvm0") + .withHostname("apphostName0") + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("appnic0"))) + .withOsDiskName("app0osdisk") + .withDataDiskNames( + mapOf("default", Arrays.asList("app0disk0"))), + new VirtualMachineResourceNames() + .withVmName("appvm1") + .withHostname("apphostName1") + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("appnic1"))) + .withOsDiskName("app1osdisk") + .withDataDiskNames( + mapOf("default", Arrays.asList("app1disk0"))))) + .withAvailabilitySetName("appAvSet")) + .withDatabaseServer( + new DatabaseServerFullResourceNames() + .withVirtualMachines( + Arrays + .asList( + new VirtualMachineResourceNames() + .withVmName("dbvmpr") + .withHostname("dbprhostName") + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("dbprnic"))) + .withOsDiskName("dbprosdisk") + .withDataDiskNames( + mapOf( + "hanaData", + Arrays.asList("hanadatapr0", "hanadatapr1"), + "hanaLog", + Arrays + .asList( + "hanalogpr0", "hanalogpr1", "hanalogpr2"), + "hanaShared", + Arrays.asList("hanasharedpr0", "hanasharedpr1"), + "usrSap", + Arrays.asList("usrsappr0"))), + new VirtualMachineResourceNames() + .withVmName("dbvmsr") + .withHostname("dbsrhostName") + .withNetworkInterfaces( + Arrays + .asList( + new NetworkInterfaceResourceNames() + .withNetworkInterfaceName("dbsrnic"))) + .withOsDiskName("dbsrosdisk") + .withDataDiskNames( + mapOf( + "hanaData", + Arrays.asList("hanadatasr0", "hanadatasr1"), + "hanaLog", + Arrays + .asList( + "hanalogsr0", "hanalogsr1", "hanalogsr2"), + "hanaShared", + Arrays.asList("hanasharedsr0", "hanasharedsr1"), + "usrSap", + Arrays.asList("usrsapsr0"))))) + .withAvailabilitySetName("dbAvSet") + .withLoadBalancer( + new LoadBalancerResourceNames() + .withLoadBalancerName("dblb") + .withFrontendIpConfigurationNames(Arrays.asList("dbip")) + .withBackendPoolNames(Arrays.asList("dbBackendPool")) + .withHealthProbeNames(Arrays.asList("dbHealthProbe")))) + .withSharedStorage( + new SharedStorageResourceNames() + .withSharedStorageAccountName("storageacc") + .withSharedStorageAccountPrivateEndPointName("peForxNFS")))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_HA_AvSet.json + */ + /** + * Sample code: Create Infrastructure with OS configuration for HA System with Availability Set (Recommended). + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createInfrastructureWithOSConfigurationForHASystemWithAvailabilitySetRecommended( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentWithOSConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new ThreeTierConfiguration() + .withAppResourceGroup("X00-RG") + .withCentralServer( + new CentralServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withApplicationServer( + new ApplicationServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer( + new DatabaseConfiguration() + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_M32ts") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withHighAvailabilityConfig( + new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_SET))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_DiskDetails_Distributed.json + */ + /** + * Sample code: Create Infrastructure with Disk and OS configuration for Distributed System (Recommended). + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createInfrastructureWithDiskAndOSConfigurationForDistributedSystemRecommended( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentWithOSConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new ThreeTierConfiguration() + .withAppResourceGroup("X00-RG") + .withCentralServer( + new CentralServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withApplicationServer( + new ApplicationServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer( + new DatabaseConfiguration() + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_M32ts") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L) + .withDiskConfiguration( + new DiskConfiguration() + .withDiskVolumeConfigurations( + mapOf( + "backup", + new DiskVolumeConfiguration() + .withCount(2L) + .withSizeGB(256L) + .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), + "hana/data", + new DiskVolumeConfiguration() + .withCount(4L) + .withSizeGB(128L) + .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), + "hana/log", + new DiskVolumeConfiguration() + .withCount(3L) + .withSizeGB(128L) + .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), + "hana/shared", + new DiskVolumeConfiguration() + .withCount(1L) + .withSizeGB(256L) + .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), + "os", + new DiskVolumeConfiguration() + .withCount(1L) + .withSizeGB(64L) + .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), + "usr/sap", + new DiskVolumeConfiguration() + .withCount(1L) + .withSizeGB(128L) + .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS))))))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_DetectInstallation_Distributed.json + */ + /** + * Sample code: Detect SAP Software Installation on a Distributed System. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void detectSAPSoftwareInstallationOnADistributedSystem( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus2") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentWithOSConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new ThreeTierConfiguration() + .withAppResourceGroup("{{resourcegrp}}") + .withNetworkConfiguration(new NetworkConfiguration().withIsSecondaryIpEnabled(true)) + .withCentralServer( + new CentralServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E4ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("azureuser") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withApplicationServer( + new ApplicationServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E4ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("azureuser") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withDatabaseServer( + new DatabaseConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_M32ts") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("azureuser") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L))) + .withSoftwareConfiguration( + new ExternalInstallationSoftwareConfiguration() + .withCentralServerVmId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0")) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("sap.bpaas.com"))) + .withTags(mapOf("created by", "azureuser")) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_DetectInstallation_HA_AvSet.json + */ + /** + * Sample code: Detect SAP Software Installation on an HA System with Availability Set. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void detectSAPSoftwareInstallationOnAnHASystemWithAvailabilitySet( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentWithOSConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new ThreeTierConfiguration() + .withAppResourceGroup("X00-RG") + .withCentralServer( + new CentralServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withApplicationServer( + new ApplicationServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer( + new DatabaseConfiguration() + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_M32ts") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP-HA") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withHighAvailabilityConfig( + new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_SET))) + .withSoftwareConfiguration( + new ExternalInstallationSoftwareConfiguration() + .withCentralServerVmId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0")) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Install_SingleServer.json + */ + /** + * Sample code: Install SAP Software on Single Server System. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void installSAPSoftwareOnSingleServerSystem( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus2") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.NON_PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentWithOSConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new SingleServerConfiguration() + .withAppResourceGroup("test-rg") + .withSubnetId( + "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/testsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("SUSE") + .withOffer("SLES-SAP") + .withSku("12-sp4-gen2") + .withVersion("2022.02.01")) + .withOsProfile( + new OSProfile() + .withAdminUsername("azureappadmin") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder")))))) + .withSoftwareConfiguration( + new SapInstallWithoutOSConfigSoftwareConfiguration() + .withBomUrl( + "https://teststorageaccount.blob.core.windows.net/sapbits/sapfiles/boms/S41909SPS03_v0011ms/S41909SPS03_v0011ms.yaml") + .withSapBitsStorageAccountId( + "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Storage/storageAccounts/teststorageaccount") + .withSoftwareVersion("SAP S/4HANA 1909 SPS 03")) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("sap.bpaas.com"))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_Distributed.json + */ + /** + * Sample code: Create Infrastructure only for Distributed System. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createInfrastructureOnlyForDistributedSystem( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new ThreeTierConfiguration() + .withAppResourceGroup("X00-RG") + .withCentralServer( + new CentralServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withKeyData( + "fakeTokenPlaceholder"))))))) + .withInstanceCount(1L)) + .withApplicationServer( + new ApplicationServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withKeyData( + "fakeTokenPlaceholder"))))))) + .withInstanceCount(6L)) + .withDatabaseServer( + new DatabaseConfiguration() + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_M32ts") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSsh( + new SshConfiguration() + .withPublicKeys( + Arrays + .asList( + new SshPublicKey() + .withKeyData( + "fakeTokenPlaceholder"))))))) + .withInstanceCount(1L)))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_Discover_CustomMrgStorageAccountName.json + */ + /** + * Sample code: Register existing SAP system as Virtual Instance for SAP solutions with optional customizations. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void registerExistingSAPSystemAsVirtualInstanceForSAPSolutionsWithOptionalCustomizations( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("northeurope") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.NON_PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DiscoveryConfiguration() + .withCentralServerVmId( + "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0") + .withManagedRgStorageAccountName("q20saacssgrs")) + .withTags(mapOf("createdby", "abc@microsoft.com", "test", "abc")) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_Distributed_SkipTransport.json + */ + /** + * Sample code: Create Infrastructure without a SAP Transport Directory Fileshare. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createInfrastructureWithoutASAPTransportDirectoryFileshare( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentWithOSConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new ThreeTierConfiguration() + .withAppResourceGroup("X00-RG") + .withCentralServer( + new CentralServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withApplicationServer( + new ApplicationServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer( + new DatabaseConfiguration() + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_M32ts") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(1L)) + .withStorageConfiguration( + new StorageConfiguration() + .withTransportFileShareConfiguration(new SkipFileShareConfiguration()))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_SingleServer.json + */ + /** + * Sample code: Create Infrastructure with OS configuration for Single Server System (Recommended). + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createInfrastructureWithOSConfigurationForSingleServerSystemRecommended( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.NON_PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentWithOSConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new SingleServerConfiguration() + .withAppResourceGroup("X00-RG") + .withNetworkConfiguration(new NetworkConfiguration().withIsSecondaryIpEnabled(true)) + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder")))))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_DiskDetails_HA_AvZone.json + */ + /** + * Sample code: Create Infrastructure with Disk and OS configuration for HA System with Availability Zone + * (Recommended). + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createInfrastructureWithDiskAndOSConfigurationForHASystemWithAvailabilityZoneRecommended( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentWithOSConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new ThreeTierConfiguration() + .withAppResourceGroup("X00-RG") + .withCentralServer( + new CentralServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withApplicationServer( + new ApplicationServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer( + new DatabaseConfiguration() + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_M32ts") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L) + .withDiskConfiguration( + new DiskConfiguration() + .withDiskVolumeConfigurations( + mapOf( + "backup", + new DiskVolumeConfiguration() + .withCount(2L) + .withSizeGB(256L) + .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), + "hana/data", + new DiskVolumeConfiguration() + .withCount(4L) + .withSizeGB(128L) + .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), + "hana/log", + new DiskVolumeConfiguration() + .withCount(3L) + .withSizeGB(128L) + .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), + "hana/shared", + new DiskVolumeConfiguration() + .withCount(1L) + .withSizeGB(256L) + .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), + "os", + new DiskVolumeConfiguration() + .withCount(1L) + .withSizeGB(64L) + .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), + "usr/sap", + new DiskVolumeConfiguration() + .withCount(1L) + .withSizeGB(128L) + .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)))))) + .withHighAvailabilityConfig( + new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_ZONE))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_HA_AvZone.json + */ + /** + * Sample code: Create Infrastructure with OS configuration for HA System with Availability Zone (Recommended). + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createInfrastructureWithOSConfigurationForHASystemWithAvailabilityZoneRecommended( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentWithOSConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new ThreeTierConfiguration() + .withAppResourceGroup("X00-RG") + .withCentralServer( + new CentralServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E16ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withApplicationServer( + new ApplicationServerConfiguration() + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(6L)) + .withDatabaseServer( + new DatabaseConfiguration() + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_M32ts") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withInstanceCount(2L)) + .withHighAvailabilityConfig( + new HighAvailabilityConfiguration() + .withHighAvailabilityType(SapHighAvailabilityType.AVAILABILITY_ZONE))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withTags(mapOf()) + .create(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_DiskDetails_SingleServer.json + */ + /** + * Sample code: Create Infrastructure with Disk and OS configurations for Single Server System (Recommended). + * + * @param manager Entry point to WorkloadsManager. + */ + public static void createInfrastructureWithDiskAndOSConfigurationsForSingleServerSystemRecommended( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .define("X00") + .withRegion("eastus") + .withExistingResourceGroup("test-rg") + .withEnvironment(SapEnvironmentType.NON_PROD) + .withSapProduct(SapProductType.S4HANA) + .withConfiguration( + new DeploymentWithOSConfiguration() + .withAppLocation("eastus") + .withInfrastructureConfiguration( + new SingleServerConfiguration() + .withAppResourceGroup("X00-RG") + .withNetworkConfiguration(new NetworkConfiguration().withIsSecondaryIpEnabled(true)) + .withDatabaseType(SapDatabaseType.HANA) + .withSubnetId( + "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet") + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withVmSize("Standard_E32ds_v4") + .withImageReference( + new ImageReference() + .withPublisher("RedHat") + .withOffer("RHEL-SAP") + .withSku("84sapha-gen2") + .withVersion("latest")) + .withOsProfile( + new OSProfile() + .withAdminUsername("{your-username}") + .withOsConfiguration( + new LinuxConfiguration() + .withDisablePasswordAuthentication(true) + .withSshKeyPair( + new SshKeyPair() + .withPublicKey("fakeTokenPlaceholder") + .withPrivateKey("fakeTokenPlaceholder"))))) + .withDbDiskConfiguration( + new DiskConfiguration() + .withDiskVolumeConfigurations( + mapOf( + "backup", + new DiskVolumeConfiguration() + .withCount(2L) + .withSizeGB(256L) + .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), + "hana/data", + new DiskVolumeConfiguration() + .withCount(4L) + .withSizeGB(128L) + .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), + "hana/log", + new DiskVolumeConfiguration() + .withCount(3L) + .withSizeGB(128L) + .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)), + "hana/shared", + new DiskVolumeConfiguration() + .withCount(1L) + .withSizeGB(256L) + .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), + "os", + new DiskVolumeConfiguration() + .withCount(1L) + .withSizeGB(64L) + .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS)), + "usr/sap", + new DiskVolumeConfiguration() + .withCount(1L) + .withSizeGB(128L) + .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS)))))) + .withOsSapConfiguration(new OsSapConfiguration().withSapFqdn("xyz.test.com"))) + .withTags(mapOf()) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapVirtualInstancesDeleteSamples.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapVirtualInstancesDeleteSamples.java new file mode 100644 index 0000000000000..51e2d69c1fecc --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapVirtualInstancesDeleteSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.generated; + +/** Samples for SapVirtualInstances Delete. */ +public final class SapVirtualInstancesDeleteSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Delete.json + */ + /** + * Sample code: SAPVirtualInstances_Delete. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPVirtualInstancesDelete( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager.sapVirtualInstances().delete("test-rg", "X00", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapVirtualInstancesGetByResourceGroupSamples.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapVirtualInstancesGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..dc4c055c19026 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapVirtualInstancesGetByResourceGroupSamples.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.generated; + +/** Samples for SapVirtualInstances GetByResourceGroup. */ +public final class SapVirtualInstancesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Get.json + */ + /** + * Sample code: SAPVirtualInstances_Get. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPVirtualInstancesGet( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .getByResourceGroupWithResponse("test-rg", "X00", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Get_ACSSInstallationBlocked.json + */ + /** + * Sample code: SAPVirtualInstances Get With ACSS Installation Blocked. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPVirtualInstancesGetWithACSSInstallationBlocked( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .getByResourceGroupWithResponse("test-rg", "X00", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapVirtualInstancesListByResourceGroupSamples.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapVirtualInstancesListByResourceGroupSamples.java new file mode 100644 index 0000000000000..888cf0e949dea --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapVirtualInstancesListByResourceGroupSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.generated; + +/** Samples for SapVirtualInstances ListByResourceGroup. */ +public final class SapVirtualInstancesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_ListByResourceGroup.json + */ + /** + * Sample code: SAPVirtualInstances_ListByResourceGroup. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPVirtualInstancesListByResourceGroup( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager.sapVirtualInstances().listByResourceGroup("test-rg", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapVirtualInstancesListSamples.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapVirtualInstancesListSamples.java new file mode 100644 index 0000000000000..64fb482ee8bd5 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapVirtualInstancesListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.generated; + +/** Samples for SapVirtualInstances List. */ +public final class SapVirtualInstancesListSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_ListBySubscription.json + */ + /** + * Sample code: SAPVirtualInstances_ListBySubscription. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPVirtualInstancesListBySubscription( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager.sapVirtualInstances().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapVirtualInstancesStartSamples.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapVirtualInstancesStartSamples.java new file mode 100644 index 0000000000000..1a342569e6e7d --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapVirtualInstancesStartSamples.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.generated; + +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StartRequest; + +/** Samples for SapVirtualInstances Start. */ +public final class SapVirtualInstancesStartSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Start_WithInfraOperations.json + */ + /** + * Sample code: Start the virtual machines and the SAP system. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void startTheVirtualMachinesAndTheSAPSystem( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .start("test-rg", "X00", new StartRequest().withStartVm(true), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Start.json + */ + /** + * Sample code: Start the SAP system. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void startTheSAPSystem( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager.sapVirtualInstances().start("test-rg", "X00", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapVirtualInstancesStopSamples.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapVirtualInstancesStopSamples.java new file mode 100644 index 0000000000000..bde93f54109e2 --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapVirtualInstancesStopSamples.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.generated; + +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.StopRequest; + +/** Samples for SapVirtualInstances Stop. */ +public final class SapVirtualInstancesStopSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Stop_WithInfraOperations.json + */ + /** + * Sample code: Stop the virtual machine(s) and the SAP system on it. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void stopTheVirtualMachineSAndTheSAPSystemOnIt( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .stop( + "test-rg", + "X00", + new StopRequest().withSoftStopTimeoutSeconds(0L).withDeallocateVm(true), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Stop.json + */ + /** + * Sample code: SAPVirtualInstances_Stop. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPVirtualInstancesStop( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + manager + .sapVirtualInstances() + .stop("test-rg", "X00", new StopRequest().withSoftStopTimeoutSeconds(0L), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapVirtualInstancesUpdateSamples.java b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapVirtualInstancesUpdateSamples.java new file mode 100644 index 0000000000000..7fb7df675bada --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/src/samples/java/com/azure/resourcemanager/workloadsmicrosoftworkloadssapvirtualinstance/generated/SapVirtualInstancesUpdateSamples.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.generated; + +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.ManagedResourcesNetworkAccessType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.ManagedServiceIdentityType; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.SapVirtualInstance; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.UpdateSapVirtualInstanceProperties; +import com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.models.UserAssignedServiceIdentity; +import java.util.HashMap; +import java.util.Map; + +/** Samples for SapVirtualInstances Update. */ +public final class SapVirtualInstancesUpdateSamples { + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Update.json + */ + /** + * Sample code: SAPVirtualInstances_Update. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPVirtualInstancesUpdate( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + SapVirtualInstance resource = + manager + .sapVirtualInstances() + .getByResourceGroupWithResponse("test-rg", "X00", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withIdentity(new UserAssignedServiceIdentity().withType(ManagedServiceIdentityType.NONE)) + .apply(); + } + + /* + * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/preview/2023-10-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_TrustedAccessEnable_Update.json + */ + /** + * Sample code: SAPVirtualInstances_TrustedAccessEnable_Update. + * + * @param manager Entry point to WorkloadsManager. + */ + public static void sAPVirtualInstancesTrustedAccessEnableUpdate( + com.azure.resourcemanager.workloadsmicrosoftworkloadssapvirtualinstance.WorkloadsManager manager) { + SapVirtualInstance resource = + manager + .sapVirtualInstances() + .getByResourceGroupWithResponse("test-rg", "X00", com.azure.core.util.Context.NONE) + .getValue(); + resource + .update() + .withTags(mapOf("key1", "fakeTokenPlaceholder")) + .withIdentity(new UserAssignedServiceIdentity().withType(ManagedServiceIdentityType.NONE)) + .withProperties( + new UpdateSapVirtualInstanceProperties() + .withManagedResourcesNetworkAccessType(ManagedResourcesNetworkAccessType.PRIVATE)) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/ci.yml b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/ci.yml new file mode 100644 index 0000000000000..98fac7a51ca4e --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/ci.yml @@ -0,0 +1,47 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/workloadsmicrosoftworkloadssapvirtualinstance/ci.yml + - sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/ + exclude: + - sdk/workloadsmicrosoftworkloadssapvirtualinstance/pom.xml + - sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/workloadsmicrosoftworkloadssapvirtualinstance/ci.yml + - sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/ + exclude: + - sdk/workloadsmicrosoftworkloadssapvirtualinstance/pom.xml + - sdk/workloadsmicrosoftworkloadssapvirtualinstance/azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance/pom.xml + +parameters: + - name: release_azureresourcemanagerworkloadsmicrosoftworkloadssapvirtualinstance + displayName: azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance + type: boolean + default: false + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: workloadsmicrosoftworkloadssapvirtualinstance + EnableBatchRelease: true + Artifacts: + - name: azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerworkloadsmicrosoftworkloadssapvirtualinstance + releaseInBatch: ${{ parameters.release_azureresourcemanagerworkloadsmicrosoftworkloadssapvirtualinstance }} diff --git a/sdk/workloadsmicrosoftworkloadssapvirtualinstance/pom.xml b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/pom.xml new file mode 100644 index 0000000000000..12136ee9cc4da --- /dev/null +++ b/sdk/workloadsmicrosoftworkloadssapvirtualinstance/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.azure + azure-workloadsmicrosoftworkloadssapvirtualinstance-service + pom + 1.0.0 + + + azure-resourcemanager-workloadsmicrosoftworkloadssapvirtualinstance + +