From 0e06da8607011baaae459efdf49ad0dfd3f264b3 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 9 May 2023 05:44:18 +0000 Subject: [PATCH] CodeGen from PR 23868 in Azure/azure-rest-api-specs Merge 3749f4e7ed300aaa0bca5a5442fc77addceead8b into 5c021b26d815babdb06989b25fbb834cbbe7ba6b --- common/config/rush/pnpm-lock.yaml | 4 +- sdk/workloads/arm-workloads/CHANGELOG.md | 5 - sdk/workloads/arm-workloads/README.md | 2 +- sdk/workloads/arm-workloads/_meta.json | 8 +- sdk/workloads/arm-workloads/assets.json | 6 - sdk/workloads/arm-workloads/package.json | 16 +- .../samples-dev/monitorsCreateSample.ts | 55 - .../samples-dev/monitorsDeleteSample.ts | 43 - .../samples-dev/monitorsGetSample.ts | 40 - .../monitorsListByResourceGroupSample.ts | 44 - .../samples-dev/monitorsListSample.ts | 40 - .../samples-dev/monitorsUpdateSample.ts | 73 - .../samples-dev/operationsListSample.ts | 40 - .../providerInstancesCreateSample.ts | 490 --- .../providerInstancesDeleteSample.ts | 45 - .../samples-dev/providerInstancesGetSample.ts | 170 - .../providerInstancesListSample.ts | 46 - ...pApplicationServerInstancesCreateSample.ts | 86 - ...pApplicationServerInstancesDeleteSample.ts | 45 - .../sapApplicationServerInstancesGetSample.ts | 45 - ...sapApplicationServerInstancesListSample.ts | 46 - ...ationServerInstancesStartInstanceSample.ts | 45 - ...cationServerInstancesStopInstanceSample.ts | 54 - ...pApplicationServerInstancesUpdateSample.ts | 54 - .../sapAvailabilityZoneDetailsSample.ts | 56 - .../sapCentralInstancesCreateSample.ts | 86 - .../sapCentralInstancesDeleteSample.ts | 45 - .../sapCentralInstancesGetSample.ts | 45 - .../sapCentralInstancesListSample.ts | 46 - .../sapCentralInstancesStartInstanceSample.ts | 45 - .../sapCentralInstancesStopInstanceSample.ts | 52 - .../sapCentralInstancesUpdateSample.ts | 52 - .../sapDatabaseInstancesCreateSample.ts | 80 - .../sapDatabaseInstancesDeleteSample.ts | 45 - .../sapDatabaseInstancesGetSample.ts | 45 - .../sapDatabaseInstancesListSample.ts | 46 - ...sapDatabaseInstancesStartInstanceSample.ts | 45 - .../sapDatabaseInstancesStopInstanceSample.ts | 52 - .../sapDatabaseInstancesUpdateSample.ts | 52 - .../sapDiskConfigurationsSample.ts | 56 - .../sapLandscapeMonitorCreateSample.ts | 53 - .../sapLandscapeMonitorDeleteSample.ts | 43 - .../sapLandscapeMonitorGetSample.ts | 43 - .../sapLandscapeMonitorListSample.ts | 43 - .../sapLandscapeMonitorUpdateSample.ts | 53 - .../sapSizingRecommendationsSample.ts | 92 - .../samples-dev/sapSupportedSkuSample.ts | 92 - .../sapVirtualInstancesCreateSample.ts | 2890 ----------------- .../sapVirtualInstancesDeleteSample.ts | 43 - .../sapVirtualInstancesGetSample.ts | 43 - ...rtualInstancesListByResourceGroupSample.ts | 44 - ...irtualInstancesListBySubscriptionSample.ts | 40 - .../sapVirtualInstancesStartSample.ts | 43 - .../sapVirtualInstancesStopSample.ts | 50 - .../sapVirtualInstancesUpdateSample.ts | 53 - .../samples/v1/javascript/README.md | 146 - .../v1/javascript/monitorsCreateSample.js | 51 - .../v1/javascript/monitorsDeleteSample.js | 36 - .../v1/javascript/monitorsGetSample.js | 36 - .../monitorsListByResourceGroupSample.js | 38 - .../v1/javascript/monitorsListSample.js | 37 - .../v1/javascript/monitorsUpdateSample.js | 59 - .../v1/javascript/operationsListSample.js | 37 - .../samples/v1/javascript/package.json | 32 - .../providerInstancesCreateSample.js | 458 --- .../providerInstancesDeleteSample.js | 41 - .../javascript/providerInstancesGetSample.js | 156 - .../javascript/providerInstancesListSample.js | 39 - .../samples/v1/javascript/sample.env | 4 - ...pApplicationServerInstancesCreateSample.js | 76 - ...pApplicationServerInstancesDeleteSample.js | 41 - .../sapApplicationServerInstancesGetSample.js | 41 - ...sapApplicationServerInstancesListSample.js | 42 - ...ationServerInstancesStartInstanceSample.js | 41 - ...cationServerInstancesStopInstanceSample.js | 46 - ...pApplicationServerInstancesUpdateSample.js | 46 - .../sapAvailabilityZoneDetailsSample.js | 52 - .../sapCentralInstancesCreateSample.js | 76 - .../sapCentralInstancesDeleteSample.js | 41 - .../sapCentralInstancesGetSample.js | 41 - .../sapCentralInstancesListSample.js | 42 - .../sapCentralInstancesStartInstanceSample.js | 41 - .../sapCentralInstancesStopInstanceSample.js | 44 - .../sapCentralInstancesUpdateSample.js | 44 - .../sapDatabaseInstancesCreateSample.js | 70 - .../sapDatabaseInstancesDeleteSample.js | 41 - .../sapDatabaseInstancesGetSample.js | 41 - .../sapDatabaseInstancesListSample.js | 42 - ...sapDatabaseInstancesStartInstanceSample.js | 41 - .../sapDatabaseInstancesStopInstanceSample.js | 44 - .../sapDatabaseInstancesUpdateSample.js | 44 - .../javascript/sapDiskConfigurationsSample.js | 52 - .../sapLandscapeMonitorCreateSample.js | 47 - .../sapLandscapeMonitorDeleteSample.js | 36 - .../sapLandscapeMonitorGetSample.js | 36 - .../sapLandscapeMonitorListSample.js | 36 - .../sapLandscapeMonitorUpdateSample.js | 47 - .../sapSizingRecommendationsSample.js | 86 - .../v1/javascript/sapSupportedSkuSample.js | 86 - .../sapVirtualInstancesCreateSample.js | 2829 ---------------- .../sapVirtualInstancesDeleteSample.js | 39 - .../sapVirtualInstancesGetSample.js | 36 - ...rtualInstancesListByResourceGroupSample.js | 38 - ...irtualInstancesListBySubscriptionSample.js | 37 - .../sapVirtualInstancesStartSample.js | 39 - .../sapVirtualInstancesStopSample.js | 42 - .../sapVirtualInstancesUpdateSample.js | 45 - .../samples/v1/typescript/README.md | 159 - .../samples/v1/typescript/package.json | 41 - .../samples/v1/typescript/sample.env | 4 - .../v1/typescript/src/monitorsCreateSample.ts | 55 - .../v1/typescript/src/monitorsDeleteSample.ts | 43 - .../v1/typescript/src/monitorsGetSample.ts | 40 - .../src/monitorsListByResourceGroupSample.ts | 44 - .../v1/typescript/src/monitorsListSample.ts | 40 - .../v1/typescript/src/monitorsUpdateSample.ts | 73 - .../v1/typescript/src/operationsListSample.ts | 40 - .../src/providerInstancesCreateSample.ts | 490 --- .../src/providerInstancesDeleteSample.ts | 45 - .../src/providerInstancesGetSample.ts | 170 - .../src/providerInstancesListSample.ts | 46 - ...pApplicationServerInstancesCreateSample.ts | 86 - ...pApplicationServerInstancesDeleteSample.ts | 45 - .../sapApplicationServerInstancesGetSample.ts | 45 - ...sapApplicationServerInstancesListSample.ts | 46 - ...ationServerInstancesStartInstanceSample.ts | 45 - ...cationServerInstancesStopInstanceSample.ts | 54 - ...pApplicationServerInstancesUpdateSample.ts | 54 - .../src/sapAvailabilityZoneDetailsSample.ts | 56 - .../src/sapCentralInstancesCreateSample.ts | 86 - .../src/sapCentralInstancesDeleteSample.ts | 45 - .../src/sapCentralInstancesGetSample.ts | 45 - .../src/sapCentralInstancesListSample.ts | 46 - .../sapCentralInstancesStartInstanceSample.ts | 45 - .../sapCentralInstancesStopInstanceSample.ts | 52 - .../src/sapCentralInstancesUpdateSample.ts | 52 - .../src/sapDatabaseInstancesCreateSample.ts | 80 - .../src/sapDatabaseInstancesDeleteSample.ts | 45 - .../src/sapDatabaseInstancesGetSample.ts | 45 - .../src/sapDatabaseInstancesListSample.ts | 46 - ...sapDatabaseInstancesStartInstanceSample.ts | 45 - .../sapDatabaseInstancesStopInstanceSample.ts | 52 - .../src/sapDatabaseInstancesUpdateSample.ts | 52 - .../src/sapDiskConfigurationsSample.ts | 56 - .../src/sapLandscapeMonitorCreateSample.ts | 53 - .../src/sapLandscapeMonitorDeleteSample.ts | 43 - .../src/sapLandscapeMonitorGetSample.ts | 43 - .../src/sapLandscapeMonitorListSample.ts | 43 - .../src/sapLandscapeMonitorUpdateSample.ts | 53 - .../src/sapSizingRecommendationsSample.ts | 92 - .../typescript/src/sapSupportedSkuSample.ts | 92 - .../src/sapVirtualInstancesCreateSample.ts | 2890 ----------------- .../src/sapVirtualInstancesDeleteSample.ts | 43 - .../src/sapVirtualInstancesGetSample.ts | 43 - ...rtualInstancesListByResourceGroupSample.ts | 44 - ...irtualInstancesListBySubscriptionSample.ts | 40 - .../src/sapVirtualInstancesStartSample.ts | 43 - .../src/sapVirtualInstancesStopSample.ts | 50 - .../src/sapVirtualInstancesUpdateSample.ts | 53 - .../samples/v1/typescript/tsconfig.json | 17 - .../arm-workloads/src/workloadsClient.ts | 2 +- .../arm-workloads/test/sampleTest.ts | 43 + .../arm-workloads/test/workloads_examples.ts | 178 - sdk/workloads/arm-workloads/tsconfig.json | 10 +- 164 files changed, 57 insertions(+), 18044 deletions(-) delete mode 100644 sdk/workloads/arm-workloads/CHANGELOG.md delete mode 100644 sdk/workloads/arm-workloads/assets.json delete mode 100644 sdk/workloads/arm-workloads/samples-dev/monitorsCreateSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples-dev/monitorsDeleteSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples-dev/monitorsGetSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples-dev/monitorsListByResourceGroupSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples-dev/monitorsListSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples-dev/monitorsUpdateSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples-dev/operationsListSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples-dev/providerInstancesCreateSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples-dev/providerInstancesDeleteSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples-dev/providerInstancesGetSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples-dev/providerInstancesListSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples-dev/sapApplicationServerInstancesCreateSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples-dev/sapApplicationServerInstancesDeleteSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples-dev/sapApplicationServerInstancesGetSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples-dev/sapApplicationServerInstancesListSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples-dev/sapApplicationServerInstancesStartInstanceSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples-dev/sapApplicationServerInstancesStopInstanceSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples-dev/sapApplicationServerInstancesUpdateSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples-dev/sapAvailabilityZoneDetailsSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples-dev/sapCentralInstancesCreateSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples-dev/sapCentralInstancesDeleteSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples-dev/sapCentralInstancesGetSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples-dev/sapCentralInstancesListSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples-dev/sapCentralInstancesStartInstanceSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples-dev/sapCentralInstancesStopInstanceSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples-dev/sapCentralInstancesUpdateSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples-dev/sapDatabaseInstancesCreateSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples-dev/sapDatabaseInstancesDeleteSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples-dev/sapDatabaseInstancesGetSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples-dev/sapDatabaseInstancesListSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples-dev/sapDatabaseInstancesStartInstanceSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples-dev/sapDatabaseInstancesStopInstanceSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples-dev/sapDatabaseInstancesUpdateSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples-dev/sapDiskConfigurationsSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples-dev/sapLandscapeMonitorCreateSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples-dev/sapLandscapeMonitorDeleteSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples-dev/sapLandscapeMonitorGetSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples-dev/sapLandscapeMonitorListSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples-dev/sapLandscapeMonitorUpdateSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples-dev/sapSizingRecommendationsSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples-dev/sapSupportedSkuSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples-dev/sapVirtualInstancesCreateSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples-dev/sapVirtualInstancesDeleteSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples-dev/sapVirtualInstancesGetSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples-dev/sapVirtualInstancesListByResourceGroupSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples-dev/sapVirtualInstancesListBySubscriptionSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples-dev/sapVirtualInstancesStartSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples-dev/sapVirtualInstancesStopSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples-dev/sapVirtualInstancesUpdateSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/README.md delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/monitorsCreateSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/monitorsDeleteSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/monitorsGetSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/monitorsListByResourceGroupSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/monitorsListSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/monitorsUpdateSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/operationsListSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/package.json delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/providerInstancesCreateSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/providerInstancesDeleteSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/providerInstancesGetSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/providerInstancesListSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/sample.env delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/sapApplicationServerInstancesCreateSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/sapApplicationServerInstancesDeleteSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/sapApplicationServerInstancesGetSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/sapApplicationServerInstancesListSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/sapApplicationServerInstancesStartInstanceSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/sapApplicationServerInstancesStopInstanceSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/sapApplicationServerInstancesUpdateSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/sapAvailabilityZoneDetailsSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/sapCentralInstancesCreateSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/sapCentralInstancesDeleteSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/sapCentralInstancesGetSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/sapCentralInstancesListSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/sapCentralInstancesStartInstanceSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/sapCentralInstancesStopInstanceSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/sapCentralInstancesUpdateSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/sapDatabaseInstancesCreateSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/sapDatabaseInstancesDeleteSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/sapDatabaseInstancesGetSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/sapDatabaseInstancesListSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/sapDatabaseInstancesStartInstanceSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/sapDatabaseInstancesStopInstanceSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/sapDatabaseInstancesUpdateSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/sapDiskConfigurationsSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/sapLandscapeMonitorCreateSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/sapLandscapeMonitorDeleteSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/sapLandscapeMonitorGetSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/sapLandscapeMonitorListSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/sapLandscapeMonitorUpdateSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/sapSizingRecommendationsSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/sapSupportedSkuSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/sapVirtualInstancesCreateSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/sapVirtualInstancesDeleteSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/sapVirtualInstancesGetSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/sapVirtualInstancesListByResourceGroupSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/sapVirtualInstancesListBySubscriptionSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/sapVirtualInstancesStartSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/sapVirtualInstancesStopSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/javascript/sapVirtualInstancesUpdateSample.js delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/README.md delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/package.json delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/sample.env delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/monitorsCreateSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/monitorsDeleteSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/monitorsGetSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/monitorsListByResourceGroupSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/monitorsListSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/monitorsUpdateSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/operationsListSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/providerInstancesCreateSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/providerInstancesDeleteSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/providerInstancesGetSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/providerInstancesListSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/sapApplicationServerInstancesCreateSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/sapApplicationServerInstancesDeleteSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/sapApplicationServerInstancesGetSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/sapApplicationServerInstancesListSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/sapApplicationServerInstancesStartInstanceSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/sapApplicationServerInstancesStopInstanceSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/sapApplicationServerInstancesUpdateSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/sapAvailabilityZoneDetailsSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/sapCentralInstancesCreateSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/sapCentralInstancesDeleteSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/sapCentralInstancesGetSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/sapCentralInstancesListSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/sapCentralInstancesStartInstanceSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/sapCentralInstancesStopInstanceSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/sapCentralInstancesUpdateSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/sapDatabaseInstancesCreateSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/sapDatabaseInstancesDeleteSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/sapDatabaseInstancesGetSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/sapDatabaseInstancesListSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/sapDatabaseInstancesStartInstanceSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/sapDatabaseInstancesStopInstanceSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/sapDatabaseInstancesUpdateSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/sapDiskConfigurationsSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/sapLandscapeMonitorCreateSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/sapLandscapeMonitorDeleteSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/sapLandscapeMonitorGetSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/sapLandscapeMonitorListSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/sapLandscapeMonitorUpdateSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/sapSizingRecommendationsSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/sapSupportedSkuSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/sapVirtualInstancesCreateSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/sapVirtualInstancesDeleteSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/sapVirtualInstancesGetSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/sapVirtualInstancesListByResourceGroupSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/sapVirtualInstancesListBySubscriptionSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/sapVirtualInstancesStartSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/sapVirtualInstancesStopSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/src/sapVirtualInstancesUpdateSample.ts delete mode 100644 sdk/workloads/arm-workloads/samples/v1/typescript/tsconfig.json create mode 100644 sdk/workloads/arm-workloads/test/sampleTest.ts delete mode 100644 sdk/workloads/arm-workloads/test/workloads_examples.ts diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 587b911bcea6..16b0750d28ed 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -15167,7 +15167,7 @@ packages: dev: false file:projects/arm-workloads.tgz: - resolution: {integrity: sha512-ClUQOEEH60AAJifADgMJzc2TW7SaIvdcoTwzt/c2oRUOkfy1PsgO6k8fe4aGNTiCKSyC+EICtFmc3+H1CCLTeQ==, tarball: file:projects/arm-workloads.tgz} + resolution: {integrity: sha512-DBcM72mR0ByFS3D2PXptJc8xBmq2+62o4retRm1LhFk3IWqTnjPOvl0Y+yidTO0Cjt7shdhN+y/TtNADeY1Zmw==, tarball: file:projects/arm-workloads.tgz} name: '@rush-temp/arm-workloads' version: 0.0.0 dependencies: @@ -15188,7 +15188,7 @@ packages: rollup: 2.79.1 rollup-plugin-sourcemaps: 0.6.3_mn2f3gd3jpedkkr23obcmzv5eq tslib: 2.5.0 - typescript: 5.0.4 + typescript: 4.8.4 uglify-js: 3.17.4 transitivePeerDependencies: - supports-color diff --git a/sdk/workloads/arm-workloads/CHANGELOG.md b/sdk/workloads/arm-workloads/CHANGELOG.md deleted file mode 100644 index 338c486d79bc..000000000000 --- a/sdk/workloads/arm-workloads/CHANGELOG.md +++ /dev/null @@ -1,5 +0,0 @@ -# Release History - -## 1.0.0 (2023-03-06) - -The package of @azure/arm-workloads is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/workloads/arm-workloads/README.md b/sdk/workloads/arm-workloads/README.md index 4650d5959441..29022d05540c 100644 --- a/sdk/workloads/arm-workloads/README.md +++ b/sdk/workloads/arm-workloads/README.md @@ -2,7 +2,7 @@ This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Workloads client. -Workloads client provides access to various workload operations.
Azure Center for SAP solutions is currently in PREVIEW. See the [Azure Center for SAP solutions - Legal Terms](https://learn.microsoft.com/legal/azure-center-for-sap-solutions/azure-center-for-sap-solutions-legal-terms) for legal notices applicable to Azure Center for SAP solutions. +Workloads client provides access to various workload operations. [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/workloads/arm-workloads) | [Package (NPM)](https://www.npmjs.com/package/@azure/arm-workloads) | diff --git a/sdk/workloads/arm-workloads/_meta.json b/sdk/workloads/arm-workloads/_meta.json index fa42cc8d6770..9e9f898d2cd3 100644 --- a/sdk/workloads/arm-workloads/_meta.json +++ b/sdk/workloads/arm-workloads/_meta.json @@ -1,8 +1,8 @@ { - "commit": "241e964afe675a7be98aa6a2e171a3c5f830816c", + "commit": "fc778e0e5cf96cc280122cf33de8efb799b223cb", "readme": "specification/workloads/resource-manager/readme.md", - "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\workloads\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.9 --generate-sample=true", + "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/workloads/resource-manager/readme.md --use=@autorest/typescript@6.0.0-rc.10", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.6.2", - "use": "@autorest/typescript@6.0.0-rc.9" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.0", + "use": "@autorest/typescript@6.0.0-rc.10" } \ No newline at end of file diff --git a/sdk/workloads/arm-workloads/assets.json b/sdk/workloads/arm-workloads/assets.json deleted file mode 100644 index 1a84cf9a5dc5..000000000000 --- a/sdk/workloads/arm-workloads/assets.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "AssetsRepo": "Azure/azure-sdk-assets", - "AssetsRepoPrefixPath": "js", - "TagPrefix": "js/workloads/arm-workloads", - "Tag": "js/workloads/arm-workloads_9f3bf438c5" -} diff --git a/sdk/workloads/arm-workloads/package.json b/sdk/workloads/arm-workloads/package.json index 0c9d1df45d2d..84c1437749ae 100644 --- a/sdk/workloads/arm-workloads/package.json +++ b/sdk/workloads/arm-workloads/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for WorkloadsClient.", - "version": "1.0.0", + "version": "1.0.1", "engines": { "node": ">=14.0.0" }, @@ -36,7 +36,7 @@ "mkdirp": "^2.1.2", "rollup": "^2.66.1", "rollup-plugin-sourcemaps": "^0.6.3", - "typescript": "~5.0.0", + "typescript": "~4.8.0", "uglify-js": "^3.4.9", "rimraf": "^3.0.0", "dotenv": "^16.0.0", @@ -111,13 +111,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/workloads/arm-workloads", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-workloads?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/workloads/arm-workloads" +} \ No newline at end of file diff --git a/sdk/workloads/arm-workloads/samples-dev/monitorsCreateSample.ts b/sdk/workloads/arm-workloads/samples-dev/monitorsCreateSample.ts deleted file mode 100644 index fccdac70596f..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/monitorsCreateSample.ts +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { Monitor, WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates a SAP monitor for the specified subscription, resource group, and resource name. - * - * @summary Creates a SAP monitor for the specified subscription, resource group, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/monitors_Create.json - */ -async function createASapMonitor() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const monitorParameter: Monitor = { - appLocation: "westus", - location: "westus", - logAnalyticsWorkspaceArmId: - "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.operationalinsights/workspaces/myWorkspace", - managedResourceGroupConfiguration: { name: "myManagedRg" }, - monitorSubnet: - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet", - routingPreference: "RouteAll", - tags: { key: "value" } - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.monitors.beginCreateAndWait( - resourceGroupName, - monitorName, - monitorParameter - ); - console.log(result); -} - -async function main() { - createASapMonitor(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples-dev/monitorsDeleteSample.ts b/sdk/workloads/arm-workloads/samples-dev/monitorsDeleteSample.ts deleted file mode 100644 index 30e31ca39382..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/monitorsDeleteSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. - * - * @summary Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/monitors_Delete.json - */ -async function deletesASapMonitor() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.monitors.beginDeleteAndWait( - resourceGroupName, - monitorName - ); - console.log(result); -} - -async function main() { - deletesASapMonitor(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples-dev/monitorsGetSample.ts b/sdk/workloads/arm-workloads/samples-dev/monitorsGetSample.ts deleted file mode 100644 index d1d58f3d4abc..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/monitorsGetSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. - * - * @summary Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/monitors_Get.json - */ -async function getPropertiesOfASapMonitor() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.monitors.get(resourceGroupName, monitorName); - console.log(result); -} - -async function main() { - getPropertiesOfASapMonitor(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples-dev/monitorsListByResourceGroupSample.ts b/sdk/workloads/arm-workloads/samples-dev/monitorsListByResourceGroupSample.ts deleted file mode 100644 index 4793d61a4fae..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/monitorsListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets a list of SAP monitors in the specified resource group. - * - * @summary Gets a list of SAP monitors in the specified resource group. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/monitors_ListByRG.json - */ -async function listAllSapMonitorsInAResourceGroup() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "example-rg"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.monitors.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAllSapMonitorsInAResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples-dev/monitorsListSample.ts b/sdk/workloads/arm-workloads/samples-dev/monitorsListSample.ts deleted file mode 100644 index c1bc935a7cdc..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/monitorsListSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each SAP monitor. - * - * @summary Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each SAP monitor. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/monitors_List.json - */ -async function listAllSapMonitorsInASubscription() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.monitors.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAllSapMonitorsInASubscription(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples-dev/monitorsUpdateSample.ts b/sdk/workloads/arm-workloads/samples-dev/monitorsUpdateSample.ts deleted file mode 100644 index 5bd2ca52187e..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/monitorsUpdateSample.ts +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { UpdateMonitorRequest, WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Patches the Tags field of a SAP monitor for the specified subscription, resource group, and SAP monitor name. - * - * @summary Patches the Tags field of a SAP monitor for the specified subscription, resource group, and SAP monitor name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/monitors_PatchTags_Delete.json - */ -async function deleteTagsFieldOfASapMonitor() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const body: UpdateMonitorRequest = { identity: { type: "None" }, tags: {} }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.monitors.update( - resourceGroupName, - monitorName, - body - ); - console.log(result); -} - -/** - * This sample demonstrates how to Patches the Tags field of a SAP monitor for the specified subscription, resource group, and SAP monitor name. - * - * @summary Patches the Tags field of a SAP monitor for the specified subscription, resource group, and SAP monitor name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/monitors_PatchTags.json - */ -async function updateTagsFieldOfASapMonitor() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const body: UpdateMonitorRequest = { - identity: { type: "None" }, - tags: { testkey: "testvalue" } - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.monitors.update( - resourceGroupName, - monitorName, - body - ); - console.log(result); -} - -async function main() { - deleteTagsFieldOfASapMonitor(); - updateTagsFieldOfASapMonitor(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples-dev/operationsListSample.ts b/sdk/workloads/arm-workloads/samples-dev/operationsListSample.ts deleted file mode 100644 index 771560636a4c..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/operationsListSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all the available API operations under this PR - * - * @summary Lists all the available API operations under this PR - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/Operations_List.json - */ -async function operations() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - operations(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples-dev/providerInstancesCreateSample.ts b/sdk/workloads/arm-workloads/samples-dev/providerInstancesCreateSample.ts deleted file mode 100644 index 604bdbfb2079..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/providerInstancesCreateSample.ts +++ /dev/null @@ -1,490 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ProviderInstance, WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/Db2ProviderInstances_Create.json - */ -async function createADb2Provider() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const providerInstanceParameter: ProviderInstance = { - providerSettings: { - dbName: "dbName", - dbPassword: "password", - dbPasswordUri: "", - dbPort: "dbPort", - dbUsername: "username", - hostname: "hostname", - providerType: "Db2", - sapSid: "SID", - sslCertificateUri: - "https://storageaccount.blob.core.windows.net/containername/filename", - sslPreference: "ServerCertificate" - } - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.beginCreateAndWait( - resourceGroupName, - monitorName, - providerInstanceName, - providerInstanceParameter - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/Db2ProviderInstances_Create_Root_Certificate.json - */ -async function createADb2ProviderWithRootCertificate() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const providerInstanceParameter: ProviderInstance = { - providerSettings: { - dbName: "dbName", - dbPassword: "password", - dbPasswordUri: "", - dbPort: "dbPort", - dbUsername: "username", - hostname: "hostname", - providerType: "Db2", - sapSid: "SID", - sslPreference: "RootCertificate" - } - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.beginCreateAndWait( - resourceGroupName, - monitorName, - providerInstanceName, - providerInstanceParameter - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/MsSqlServerProviderInstance_Create.json - */ -async function createAMSSqlServerProvider() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const providerInstanceParameter: ProviderInstance = { - providerSettings: { - dbPassword: "****", - dbPasswordUri: "", - dbPort: "5912", - dbUsername: "user", - hostname: "hostname", - providerType: "MsSqlServer", - sapSid: "sid", - sslCertificateUri: - "https://storageaccount.blob.core.windows.net/containername/filename", - sslPreference: "ServerCertificate" - } - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.beginCreateAndWait( - resourceGroupName, - monitorName, - providerInstanceName, - providerInstanceParameter - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/MsSqlServerProviderInstance_Create_Root_Certificate.json - */ -async function createAMSSqlServerProviderWithRootCertificate() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const providerInstanceParameter: ProviderInstance = { - providerSettings: { - dbPassword: "****", - dbPasswordUri: "", - dbPort: "5912", - dbUsername: "user", - hostname: "hostname", - providerType: "MsSqlServer", - sapSid: "sid", - sslPreference: "RootCertificate" - } - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.beginCreateAndWait( - resourceGroupName, - monitorName, - providerInstanceName, - providerInstanceParameter - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/PrometheusOSProviderInstances_Create.json - */ -async function createAOSProvider() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const providerInstanceParameter: ProviderInstance = { - providerSettings: { - prometheusUrl: "http://192.168.0.0:9090/metrics", - providerType: "PrometheusOS", - sapSid: "SID", - sslCertificateUri: - "https://storageaccount.blob.core.windows.net/containername/filename", - sslPreference: "ServerCertificate" - } - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.beginCreateAndWait( - resourceGroupName, - monitorName, - providerInstanceName, - providerInstanceParameter - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/PrometheusOSProviderInstances_Create_Root_Certificate.json - */ -async function createAOSProviderWithRootCertificate() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const providerInstanceParameter: ProviderInstance = { - providerSettings: { - prometheusUrl: "http://192.168.0.0:9090/metrics", - providerType: "PrometheusOS", - sapSid: "SID", - sslPreference: "RootCertificate" - } - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.beginCreateAndWait( - resourceGroupName, - monitorName, - providerInstanceName, - providerInstanceParameter - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/PrometheusHaClusterProviderInstances_Create.json - */ -async function createAPrometheusHaClusterProvider() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const providerInstanceParameter: ProviderInstance = { - providerSettings: { - clusterName: "clusterName", - hostname: "hostname", - prometheusUrl: "http://192.168.0.0:9090/metrics", - providerType: "PrometheusHaCluster", - sid: "sid", - sslCertificateUri: - "https://storageaccount.blob.core.windows.net/containername/filename", - sslPreference: "ServerCertificate" - } - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.beginCreateAndWait( - resourceGroupName, - monitorName, - providerInstanceName, - providerInstanceParameter - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/PrometheusHaClusterProviderInstances_Create_Root_Certificate.json - */ -async function createAPrometheusHaClusterProviderWithRootCertificate() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const providerInstanceParameter: ProviderInstance = { - providerSettings: { - clusterName: "clusterName", - hostname: "hostname", - prometheusUrl: "http://192.168.0.0:9090/metrics", - providerType: "PrometheusHaCluster", - sid: "sid", - sslPreference: "RootCertificate" - } - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.beginCreateAndWait( - resourceGroupName, - monitorName, - providerInstanceName, - providerInstanceParameter - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ProviderInstances_Create.json - */ -async function createASapMonitorHanaProvider() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const providerInstanceParameter: ProviderInstance = { - providerSettings: { - dbName: "db", - dbPassword: "****", - dbPasswordUri: "", - dbUsername: "user", - hostname: "name", - instanceNumber: "00", - providerType: "SapHana", - sapSid: "SID", - sqlPort: "0000", - sslCertificateUri: - "https://storageaccount.blob.core.windows.net/containername/filename", - sslHostNameInCertificate: "xyz.domain.com", - sslPreference: "ServerCertificate" - } - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.beginCreateAndWait( - resourceGroupName, - monitorName, - providerInstanceName, - providerInstanceParameter - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ProviderInstances_Create_Root_Certificate.json - */ -async function createASapMonitorHanaProviderWithRootCertificate() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const providerInstanceParameter: ProviderInstance = { - providerSettings: { - dbName: "db", - dbPassword: "****", - dbPasswordUri: "", - dbUsername: "user", - hostname: "name", - instanceNumber: "00", - providerType: "SapHana", - sapSid: "SID", - sqlPort: "0000", - sslHostNameInCertificate: "xyz.domain.com", - sslPreference: "RootCertificate" - } - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.beginCreateAndWait( - resourceGroupName, - monitorName, - providerInstanceName, - providerInstanceParameter - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/NetWeaverProviderInstances_Create.json - */ -async function createASapMonitorNetWeaverProvider() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const providerInstanceParameter: ProviderInstance = { - providerSettings: { - providerType: "SapNetWeaver", - sapClientId: "111", - sapHostFileEntries: ["127.0.0.1 name fqdn"], - sapHostname: "name", - sapInstanceNr: "00", - sapPassword: "****", - sapPasswordUri: "", - sapPortNumber: "1234", - sapSid: "SID", - sapUsername: "username", - sslCertificateUri: - "https://storageaccount.blob.core.windows.net/containername/filename", - sslPreference: "ServerCertificate" - } - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.beginCreateAndWait( - resourceGroupName, - monitorName, - providerInstanceName, - providerInstanceParameter - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/NetWeaverProviderInstances_Create_Root_Certificate.json - */ -async function createASapMonitorNetWeaverProviderWithRootCertificate() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const providerInstanceParameter: ProviderInstance = { - providerSettings: { - providerType: "SapNetWeaver", - sapClientId: "111", - sapHostFileEntries: ["127.0.0.1 name fqdn"], - sapHostname: "name", - sapInstanceNr: "00", - sapPassword: "****", - sapPasswordUri: "", - sapPortNumber: "1234", - sapSid: "SID", - sapUsername: "username", - sslPreference: "RootCertificate" - } - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.beginCreateAndWait( - resourceGroupName, - monitorName, - providerInstanceName, - providerInstanceParameter - ); - console.log(result); -} - -async function main() { - createADb2Provider(); - createADb2ProviderWithRootCertificate(); - createAMSSqlServerProvider(); - createAMSSqlServerProviderWithRootCertificate(); - createAOSProvider(); - createAOSProviderWithRootCertificate(); - createAPrometheusHaClusterProvider(); - createAPrometheusHaClusterProviderWithRootCertificate(); - createASapMonitorHanaProvider(); - createASapMonitorHanaProviderWithRootCertificate(); - createASapMonitorNetWeaverProvider(); - createASapMonitorNetWeaverProviderWithRootCertificate(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples-dev/providerInstancesDeleteSample.ts b/sdk/workloads/arm-workloads/samples-dev/providerInstancesDeleteSample.ts deleted file mode 100644 index df85797cacb3..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/providerInstancesDeleteSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ProviderInstances_Delete.json - */ -async function deletesASapMonitorProvider() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.beginDeleteAndWait( - resourceGroupName, - monitorName, - providerInstanceName - ); - console.log(result); -} - -async function main() { - deletesASapMonitorProvider(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples-dev/providerInstancesGetSample.ts b/sdk/workloads/arm-workloads/samples-dev/providerInstancesGetSample.ts deleted file mode 100644 index 69503059f8dc..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/providerInstancesGetSample.ts +++ /dev/null @@ -1,170 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/Db2ProviderInstances_Get.json - */ -async function getPropertiesOfADb2Provider() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.get( - resourceGroupName, - monitorName, - providerInstanceName - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/MsSqlServerProviderInstance_Get.json - */ -async function getPropertiesOfAMSSqlServerProvider() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.get( - resourceGroupName, - monitorName, - providerInstanceName - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/PrometheusOSProviderInstances_Get.json - */ -async function getPropertiesOfAOSProvider() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.get( - resourceGroupName, - monitorName, - providerInstanceName - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/PrometheusHaClusterProviderInstances_Get.json - */ -async function getPropertiesOfAPrometheusHaClusterProvider() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.get( - resourceGroupName, - monitorName, - providerInstanceName - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ProviderInstances_Get.json - */ -async function getPropertiesOfASapMonitorHanaProvider() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.get( - resourceGroupName, - monitorName, - providerInstanceName - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/NetWeaverProviderInstances_Get.json - */ -async function getPropertiesOfASapMonitorNetWeaverProvider() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.get( - resourceGroupName, - monitorName, - providerInstanceName - ); - console.log(result); -} - -async function main() { - getPropertiesOfADb2Provider(); - getPropertiesOfAMSSqlServerProvider(); - getPropertiesOfAOSProvider(); - getPropertiesOfAPrometheusHaClusterProvider(); - getPropertiesOfASapMonitorHanaProvider(); - getPropertiesOfASapMonitorNetWeaverProvider(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples-dev/providerInstancesListSample.ts b/sdk/workloads/arm-workloads/samples-dev/providerInstancesListSample.ts deleted file mode 100644 index ce5a4003459a..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/providerInstancesListSample.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of each provider instances. - * - * @summary Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of each provider instances. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ProviderInstances_List.json - */ -async function listAllSapMonitorsProvidersInASubscription() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.providerInstances.list( - resourceGroupName, - monitorName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAllSapMonitorsProvidersInASubscription(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples-dev/sapApplicationServerInstancesCreateSample.ts b/sdk/workloads/arm-workloads/samples-dev/sapApplicationServerInstancesCreateSample.ts deleted file mode 100644 index 99fa6d739756..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/sapApplicationServerInstancesCreateSample.ts +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - SAPApplicationServerInstance, - SAPApplicationServerInstancesCreateOptionalParams, - WorkloadsClient -} from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Puts the SAP Application Server Instance resource.

This will be used by service only. PUT by end user will return a Bad Request error. - * - * @summary Puts the SAP Application Server Instance resource.

This will be used by service only. PUT by end user will return a Bad Request error. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_Create_HA_AvSet.json - */ -async function createSapApplicationServerInstancesForHaSystemWithAvailabilitySet() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const applicationInstanceName = "app01"; - const body: SAPApplicationServerInstance = { - location: "westcentralus", - tags: {} - }; - const options: SAPApplicationServerInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPApplicationServerInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - applicationInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Puts the SAP Application Server Instance resource.

This will be used by service only. PUT by end user will return a Bad Request error. - * - * @summary Puts the SAP Application Server Instance resource.

This will be used by service only. PUT by end user will return a Bad Request error. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_Create.json - */ -async function sapApplicationServerInstancesCreate() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const applicationInstanceName = "app01"; - const body: SAPApplicationServerInstance = { - location: "westcentralus", - tags: {} - }; - const options: SAPApplicationServerInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPApplicationServerInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - applicationInstanceName, - options - ); - console.log(result); -} - -async function main() { - createSapApplicationServerInstancesForHaSystemWithAvailabilitySet(); - sapApplicationServerInstancesCreate(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples-dev/sapApplicationServerInstancesDeleteSample.ts b/sdk/workloads/arm-workloads/samples-dev/sapApplicationServerInstancesDeleteSample.ts deleted file mode 100644 index 412809ac32d2..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/sapApplicationServerInstancesDeleteSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes the SAP Application Server Instance resource.

This operation will be used by service only. Delete by end user will return a Bad Request error. - * - * @summary Deletes the SAP Application Server Instance resource.

This operation will be used by service only. Delete by end user will return a Bad Request error. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_Delete.json - */ -async function sapApplicationServerInstancesDelete() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const applicationInstanceName = "app01"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPApplicationServerInstances.beginDeleteAndWait( - resourceGroupName, - sapVirtualInstanceName, - applicationInstanceName - ); - console.log(result); -} - -async function main() { - sapApplicationServerInstancesDelete(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples-dev/sapApplicationServerInstancesGetSample.ts b/sdk/workloads/arm-workloads/samples-dev/sapApplicationServerInstancesGetSample.ts deleted file mode 100644 index d19e12d8a10e..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/sapApplicationServerInstancesGetSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. - * - * @summary Gets the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_Get.json - */ -async function sapApplicationServerInstancesGet() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const applicationInstanceName = "app01"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPApplicationServerInstances.get( - resourceGroupName, - sapVirtualInstanceName, - applicationInstanceName - ); - console.log(result); -} - -async function main() { - sapApplicationServerInstancesGet(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples-dev/sapApplicationServerInstancesListSample.ts b/sdk/workloads/arm-workloads/samples-dev/sapApplicationServerInstancesListSample.ts deleted file mode 100644 index 76ef8390d9db..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/sapApplicationServerInstancesListSample.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists the SAP Application Server Instance resources for a given Virtual Instance for SAP solutions resource. - * - * @summary Lists the SAP Application Server Instance resources for a given Virtual Instance for SAP solutions resource. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_List.json - */ -async function sapApplicationServerInstancesList() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.sAPApplicationServerInstances.list( - resourceGroupName, - sapVirtualInstanceName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - sapApplicationServerInstancesList(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples-dev/sapApplicationServerInstancesStartInstanceSample.ts b/sdk/workloads/arm-workloads/samples-dev/sapApplicationServerInstancesStartInstanceSample.ts deleted file mode 100644 index 8b66a8bbe627..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/sapApplicationServerInstancesStartInstanceSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Starts the SAP Application Server Instance. - * - * @summary Starts the SAP Application Server Instance. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_StartInstance.json - */ -async function startTheSapApplicationServerInstance() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const applicationInstanceName = "app01"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPApplicationServerInstances.beginStartInstanceAndWait( - resourceGroupName, - sapVirtualInstanceName, - applicationInstanceName - ); - console.log(result); -} - -async function main() { - startTheSapApplicationServerInstance(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples-dev/sapApplicationServerInstancesStopInstanceSample.ts b/sdk/workloads/arm-workloads/samples-dev/sapApplicationServerInstancesStopInstanceSample.ts deleted file mode 100644 index c635942d397e..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/sapApplicationServerInstancesStopInstanceSample.ts +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - StopRequest, - SAPApplicationServerInstancesStopInstanceOptionalParams, - WorkloadsClient -} from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Stops the SAP Application Server Instance. - * - * @summary Stops the SAP Application Server Instance. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_StopInstance.json - */ -async function stopTheSapApplicationServerInstance() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const applicationInstanceName = "app01"; - const body: StopRequest = { softStopTimeoutSeconds: 0 }; - const options: SAPApplicationServerInstancesStopInstanceOptionalParams = { - body - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPApplicationServerInstances.beginStopInstanceAndWait( - resourceGroupName, - sapVirtualInstanceName, - applicationInstanceName, - options - ); - console.log(result); -} - -async function main() { - stopTheSapApplicationServerInstance(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples-dev/sapApplicationServerInstancesUpdateSample.ts b/sdk/workloads/arm-workloads/samples-dev/sapApplicationServerInstancesUpdateSample.ts deleted file mode 100644 index d892bc3edb50..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/sapApplicationServerInstancesUpdateSample.ts +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - UpdateSAPApplicationInstanceRequest, - SAPApplicationServerInstancesUpdateOptionalParams, - WorkloadsClient -} from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Puts the SAP Application Server Instance resource. - * - * @summary Puts the SAP Application Server Instance resource. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_Update.json - */ -async function sapApplicationServerInstancesUpdate() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const applicationInstanceName = "app01"; - const body: UpdateSAPApplicationInstanceRequest = { - tags: { tag1: "value1" } - }; - const options: SAPApplicationServerInstancesUpdateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPApplicationServerInstances.beginUpdateAndWait( - resourceGroupName, - sapVirtualInstanceName, - applicationInstanceName, - options - ); - console.log(result); -} - -async function main() { - sapApplicationServerInstancesUpdate(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples-dev/sapAvailabilityZoneDetailsSample.ts b/sdk/workloads/arm-workloads/samples-dev/sapAvailabilityZoneDetailsSample.ts deleted file mode 100644 index 0b952a718980..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/sapAvailabilityZoneDetailsSample.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get the recommended SAP Availability Zone Pair Details for your region. - * - * @summary Get the recommended SAP Availability Zone Pair Details for your region. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPAvailabilityZoneDetails_eastus.json - */ -async function sapAvailabilityZoneDetailsEastus() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const location = "centralus"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPAvailabilityZoneDetails(location); - console.log(result); -} - -/** - * This sample demonstrates how to Get the recommended SAP Availability Zone Pair Details for your region. - * - * @summary Get the recommended SAP Availability Zone Pair Details for your region. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPAvailabilityZoneDetails_northeurope.json - */ -async function sapAvailabilityZoneDetailsNortheurope() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const location = "centralus"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPAvailabilityZoneDetails(location); - console.log(result); -} - -async function main() { - sapAvailabilityZoneDetailsEastus(); - sapAvailabilityZoneDetailsNortheurope(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples-dev/sapCentralInstancesCreateSample.ts b/sdk/workloads/arm-workloads/samples-dev/sapCentralInstancesCreateSample.ts deleted file mode 100644 index 046ea5104043..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/sapCentralInstancesCreateSample.ts +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - SAPCentralServerInstance, - SAPCentralInstancesCreateOptionalParams, - WorkloadsClient -} from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates the SAP Central Services Instance resource.

This will be used by service only. PUT operation on this resource by end user will return a Bad Request error. - * - * @summary Creates the SAP Central Services Instance resource.

This will be used by service only. PUT operation on this resource by end user will return a Bad Request error. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_Create_HA_AvSet.json - */ -async function createSapCentralInstancesForHaSystemWithAvailabilitySet() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const centralInstanceName = "centralServer"; - const body: SAPCentralServerInstance = { - location: "westcentralus", - tags: {} - }; - const options: SAPCentralInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPCentralInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - centralInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates the SAP Central Services Instance resource.

This will be used by service only. PUT operation on this resource by end user will return a Bad Request error. - * - * @summary Creates the SAP Central Services Instance resource.

This will be used by service only. PUT operation on this resource by end user will return a Bad Request error. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_Create.json - */ -async function sapCentralInstancesCreate() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const centralInstanceName = "centralServer"; - const body: SAPCentralServerInstance = { - location: "westcentralus", - tags: {} - }; - const options: SAPCentralInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPCentralInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - centralInstanceName, - options - ); - console.log(result); -} - -async function main() { - createSapCentralInstancesForHaSystemWithAvailabilitySet(); - sapCentralInstancesCreate(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples-dev/sapCentralInstancesDeleteSample.ts b/sdk/workloads/arm-workloads/samples-dev/sapCentralInstancesDeleteSample.ts deleted file mode 100644 index c7944eb8b0c1..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/sapCentralInstancesDeleteSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes the SAP Central Services Instance resource.

This will be used by service only. Delete operation on this resource by end user will return a Bad Request error. You can delete the parent resource, which is the Virtual Instance for SAP solutions resource, using the delete operation on it. - * - * @summary Deletes the SAP Central Services Instance resource.

This will be used by service only. Delete operation on this resource by end user will return a Bad Request error. You can delete the parent resource, which is the Virtual Instance for SAP solutions resource, using the delete operation on it. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_Delete.json - */ -async function sapCentralInstancesDelete() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const centralInstanceName = "centralServer"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPCentralInstances.beginDeleteAndWait( - resourceGroupName, - sapVirtualInstanceName, - centralInstanceName - ); - console.log(result); -} - -async function main() { - sapCentralInstancesDelete(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples-dev/sapCentralInstancesGetSample.ts b/sdk/workloads/arm-workloads/samples-dev/sapCentralInstancesGetSample.ts deleted file mode 100644 index 51857d4382b4..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/sapCentralInstancesGetSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets the SAP Central Services Instance resource. - * - * @summary Gets the SAP Central Services Instance resource. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_Get.json - */ -async function sapCentralInstancesGet() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const centralInstanceName = "centralServer"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPCentralInstances.get( - resourceGroupName, - sapVirtualInstanceName, - centralInstanceName - ); - console.log(result); -} - -async function main() { - sapCentralInstancesGet(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples-dev/sapCentralInstancesListSample.ts b/sdk/workloads/arm-workloads/samples-dev/sapCentralInstancesListSample.ts deleted file mode 100644 index 1a84725222e1..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/sapCentralInstancesListSample.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists the SAP Central Services Instance resource for the given Virtual Instance for SAP solutions resource. - * - * @summary Lists the SAP Central Services Instance resource for the given Virtual Instance for SAP solutions resource. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_List.json - */ -async function sapCentralInstancesList() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.sAPCentralInstances.list( - resourceGroupName, - sapVirtualInstanceName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - sapCentralInstancesList(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples-dev/sapCentralInstancesStartInstanceSample.ts b/sdk/workloads/arm-workloads/samples-dev/sapCentralInstancesStartInstanceSample.ts deleted file mode 100644 index 22e26a520c60..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/sapCentralInstancesStartInstanceSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Starts the SAP Central Services Instance. - * - * @summary Starts the SAP Central Services Instance. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_StartInstance.json - */ -async function startTheSapCentralServicesInstance() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const centralInstanceName = "centralServer"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPCentralInstances.beginStartInstanceAndWait( - resourceGroupName, - sapVirtualInstanceName, - centralInstanceName - ); - console.log(result); -} - -async function main() { - startTheSapCentralServicesInstance(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples-dev/sapCentralInstancesStopInstanceSample.ts b/sdk/workloads/arm-workloads/samples-dev/sapCentralInstancesStopInstanceSample.ts deleted file mode 100644 index 40a032b55f21..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/sapCentralInstancesStopInstanceSample.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - StopRequest, - SAPCentralInstancesStopInstanceOptionalParams, - WorkloadsClient -} from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Stops the SAP Central Services Instance. - * - * @summary Stops the SAP Central Services Instance. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_StopInstance.json - */ -async function stopTheSapCentralServicesInstance() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const centralInstanceName = "centralServer"; - const body: StopRequest = { softStopTimeoutSeconds: 1200 }; - const options: SAPCentralInstancesStopInstanceOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPCentralInstances.beginStopInstanceAndWait( - resourceGroupName, - sapVirtualInstanceName, - centralInstanceName, - options - ); - console.log(result); -} - -async function main() { - stopTheSapCentralServicesInstance(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples-dev/sapCentralInstancesUpdateSample.ts b/sdk/workloads/arm-workloads/samples-dev/sapCentralInstancesUpdateSample.ts deleted file mode 100644 index 4ca01687aa81..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/sapCentralInstancesUpdateSample.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - UpdateSAPCentralInstanceRequest, - SAPCentralInstancesUpdateOptionalParams, - WorkloadsClient -} from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates the SAP Central Services Instance resource.

This can be used to update tags on the resource. - * - * @summary Updates the SAP Central Services Instance resource.

This can be used to update tags on the resource. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_Update.json - */ -async function sapCentralInstancesUpdate() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const centralInstanceName = "centralServer"; - const body: UpdateSAPCentralInstanceRequest = { tags: { tag1: "value1" } }; - const options: SAPCentralInstancesUpdateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPCentralInstances.beginUpdateAndWait( - resourceGroupName, - sapVirtualInstanceName, - centralInstanceName, - options - ); - console.log(result); -} - -async function main() { - sapCentralInstancesUpdate(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples-dev/sapDatabaseInstancesCreateSample.ts b/sdk/workloads/arm-workloads/samples-dev/sapDatabaseInstancesCreateSample.ts deleted file mode 100644 index 637d902f939d..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/sapDatabaseInstancesCreateSample.ts +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - SAPDatabaseInstance, - SAPDatabaseInstancesCreateOptionalParams, - WorkloadsClient -} from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource.

This will be used by service only. PUT by end user will return a Bad Request error. - * - * @summary Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource.

This will be used by service only. PUT by end user will return a Bad Request error. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_Create_HA_AvSet.json - */ -async function createSapDatabaseInstancesForHaSystemWithAvailabilitySet() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const databaseInstanceName = "databaseServer"; - const body: SAPDatabaseInstance = { location: "westcentralus", tags: {} }; - const options: SAPDatabaseInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPDatabaseInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - databaseInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource.

This will be used by service only. PUT by end user will return a Bad Request error. - * - * @summary Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource.

This will be used by service only. PUT by end user will return a Bad Request error. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_Create.json - */ -async function sapDatabaseInstancesCreate() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const databaseInstanceName = "databaseServer"; - const body: SAPDatabaseInstance = { location: "westcentralus", tags: {} }; - const options: SAPDatabaseInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPDatabaseInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - databaseInstanceName, - options - ); - console.log(result); -} - -async function main() { - createSapDatabaseInstancesForHaSystemWithAvailabilitySet(); - sapDatabaseInstancesCreate(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples-dev/sapDatabaseInstancesDeleteSample.ts b/sdk/workloads/arm-workloads/samples-dev/sapDatabaseInstancesDeleteSample.ts deleted file mode 100644 index 30090d90f2cd..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/sapDatabaseInstancesDeleteSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource.

This will be used by service only. Delete by end user will return a Bad Request error. - * - * @summary Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource.

This will be used by service only. Delete by end user will return a Bad Request error. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_Delete.json - */ -async function sapDatabaseInstancesDelete() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const databaseInstanceName = "databaseServer"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPDatabaseInstances.beginDeleteAndWait( - resourceGroupName, - sapVirtualInstanceName, - databaseInstanceName - ); - console.log(result); -} - -async function main() { - sapDatabaseInstancesDelete(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples-dev/sapDatabaseInstancesGetSample.ts b/sdk/workloads/arm-workloads/samples-dev/sapDatabaseInstancesGetSample.ts deleted file mode 100644 index f9dbb15e0204..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/sapDatabaseInstancesGetSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets the SAP Database Instance resource. - * - * @summary Gets the SAP Database Instance resource. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_Get.json - */ -async function sapDatabaseInstancesGet() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const databaseInstanceName = "databaseServer"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPDatabaseInstances.get( - resourceGroupName, - sapVirtualInstanceName, - databaseInstanceName - ); - console.log(result); -} - -async function main() { - sapDatabaseInstancesGet(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples-dev/sapDatabaseInstancesListSample.ts b/sdk/workloads/arm-workloads/samples-dev/sapDatabaseInstancesListSample.ts deleted file mode 100644 index 42d7156327fe..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/sapDatabaseInstancesListSample.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists the Database resources associated with a Virtual Instance for SAP solutions resource. - * - * @summary Lists the Database resources associated with a Virtual Instance for SAP solutions resource. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_List.json - */ -async function sapDatabaseInstancesList() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.sAPDatabaseInstances.list( - resourceGroupName, - sapVirtualInstanceName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - sapDatabaseInstancesList(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples-dev/sapDatabaseInstancesStartInstanceSample.ts b/sdk/workloads/arm-workloads/samples-dev/sapDatabaseInstancesStartInstanceSample.ts deleted file mode 100644 index 92a0bf1d700e..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/sapDatabaseInstancesStartInstanceSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Starts the database instance of the SAP system. - * - * @summary Starts the database instance of the SAP system. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_StartInstance.json - */ -async function startTheDatabaseInstanceOfTheSapSystem() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const databaseInstanceName = "db0"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPDatabaseInstances.beginStartInstanceAndWait( - resourceGroupName, - sapVirtualInstanceName, - databaseInstanceName - ); - console.log(result); -} - -async function main() { - startTheDatabaseInstanceOfTheSapSystem(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples-dev/sapDatabaseInstancesStopInstanceSample.ts b/sdk/workloads/arm-workloads/samples-dev/sapDatabaseInstancesStopInstanceSample.ts deleted file mode 100644 index 7dfdfb6c1e8a..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/sapDatabaseInstancesStopInstanceSample.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - StopRequest, - SAPDatabaseInstancesStopInstanceOptionalParams, - WorkloadsClient -} from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Stops the database instance of the SAP system. - * - * @summary Stops the database instance of the SAP system. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_StopInstance.json - */ -async function stopTheDatabaseInstanceOfTheSapSystem() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const databaseInstanceName = "db0"; - const body: StopRequest = { softStopTimeoutSeconds: 0 }; - const options: SAPDatabaseInstancesStopInstanceOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPDatabaseInstances.beginStopInstanceAndWait( - resourceGroupName, - sapVirtualInstanceName, - databaseInstanceName, - options - ); - console.log(result); -} - -async function main() { - stopTheDatabaseInstanceOfTheSapSystem(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples-dev/sapDatabaseInstancesUpdateSample.ts b/sdk/workloads/arm-workloads/samples-dev/sapDatabaseInstancesUpdateSample.ts deleted file mode 100644 index 7bc88a89845e..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/sapDatabaseInstancesUpdateSample.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - UpdateSAPDatabaseInstanceRequest, - SAPDatabaseInstancesUpdateOptionalParams, - WorkloadsClient -} from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates the Database resource. - * - * @summary Updates the Database resource. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_Update.json - */ -async function sapDatabaseInstancesUpdate() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const databaseInstanceName = "databaseServer"; - const body: UpdateSAPDatabaseInstanceRequest = { tags: { key1: "value1" } }; - const options: SAPDatabaseInstancesUpdateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPDatabaseInstances.beginUpdateAndWait( - resourceGroupName, - sapVirtualInstanceName, - databaseInstanceName, - options - ); - console.log(result); -} - -async function main() { - sapDatabaseInstancesUpdate(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples-dev/sapDiskConfigurationsSample.ts b/sdk/workloads/arm-workloads/samples-dev/sapDiskConfigurationsSample.ts deleted file mode 100644 index d96e0b44c07b..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/sapDiskConfigurationsSample.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get the SAP Disk Configuration Layout prod/non-prod SAP System. - * - * @summary Get the SAP Disk Configuration Layout prod/non-prod SAP System. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDiskConfigurations_NonProd.json - */ -async function sapDiskConfigurationsNonProd() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const location = "centralus"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPDiskConfigurations(location); - console.log(result); -} - -/** - * This sample demonstrates how to Get the SAP Disk Configuration Layout prod/non-prod SAP System. - * - * @summary Get the SAP Disk Configuration Layout prod/non-prod SAP System. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDiskConfigurations_Prod.json - */ -async function sapDiskConfigurationsProd() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const location = "centralus"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPDiskConfigurations(location); - console.log(result); -} - -async function main() { - sapDiskConfigurationsNonProd(); - sapDiskConfigurationsProd(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples-dev/sapLandscapeMonitorCreateSample.ts b/sdk/workloads/arm-workloads/samples-dev/sapLandscapeMonitorCreateSample.ts deleted file mode 100644 index d4df88d19b53..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/sapLandscapeMonitorCreateSample.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { SapLandscapeMonitor, WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates a SAP Landscape Monitor Dashboard for the specified subscription, resource group, and resource name. - * - * @summary Creates a SAP Landscape Monitor Dashboard for the specified subscription, resource group, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/SapLandscapeMonitor_Create.json - */ -async function createForSapLandscapeMonitorDashboard() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const sapLandscapeMonitorParameter: SapLandscapeMonitor = { - grouping: { - landscape: [{ name: "Prod", topSid: ["SID1", "SID2"] }], - sapApplication: [{ name: "ERP1", topSid: ["SID1", "SID2"] }] - }, - topMetricsThresholds: [ - { name: "Instance Availability", green: 90, red: 50, yellow: 75 } - ] - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sapLandscapeMonitorOperations.create( - resourceGroupName, - monitorName, - sapLandscapeMonitorParameter - ); - console.log(result); -} - -async function main() { - createForSapLandscapeMonitorDashboard(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples-dev/sapLandscapeMonitorDeleteSample.ts b/sdk/workloads/arm-workloads/samples-dev/sapLandscapeMonitorDeleteSample.ts deleted file mode 100644 index d69d0126e37e..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/sapLandscapeMonitorDeleteSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes a SAP Landscape Monitor Dashboard with the specified subscription, resource group, and SAP monitor name. - * - * @summary Deletes a SAP Landscape Monitor Dashboard with the specified subscription, resource group, and SAP monitor name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/SapLandscapeMonitor_Delete.json - */ -async function deletesSapMonitor() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sapLandscapeMonitorOperations.delete( - resourceGroupName, - monitorName - ); - console.log(result); -} - -async function main() { - deletesSapMonitor(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples-dev/sapLandscapeMonitorGetSample.ts b/sdk/workloads/arm-workloads/samples-dev/sapLandscapeMonitorGetSample.ts deleted file mode 100644 index fa65d78264e8..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/sapLandscapeMonitorGetSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource group, and resource name. - * - * @summary Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource group, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/SapLandscapeMonitor_Get.json - */ -async function getPropertiesOfASapMonitor() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sapLandscapeMonitorOperations.get( - resourceGroupName, - monitorName - ); - console.log(result); -} - -async function main() { - getPropertiesOfASapMonitor(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples-dev/sapLandscapeMonitorListSample.ts b/sdk/workloads/arm-workloads/samples-dev/sapLandscapeMonitorListSample.ts deleted file mode 100644 index 34b1eadde490..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/sapLandscapeMonitorListSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource group, and resource name. - * - * @summary Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource group, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/SapLandscapeMonitor_List.json - */ -async function getPropertiesOfASapMonitor() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sapLandscapeMonitorOperations.list( - resourceGroupName, - monitorName - ); - console.log(result); -} - -async function main() { - getPropertiesOfASapMonitor(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples-dev/sapLandscapeMonitorUpdateSample.ts b/sdk/workloads/arm-workloads/samples-dev/sapLandscapeMonitorUpdateSample.ts deleted file mode 100644 index 0ed378c68281..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/sapLandscapeMonitorUpdateSample.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { SapLandscapeMonitor, WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Patches the SAP Landscape Monitor Dashboard for the specified subscription, resource group, and SAP monitor name. - * - * @summary Patches the SAP Landscape Monitor Dashboard for the specified subscription, resource group, and SAP monitor name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/SapLandscapeMonitor_Update.json - */ -async function updateSapMonitor() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const sapLandscapeMonitorParameter: SapLandscapeMonitor = { - grouping: { - landscape: [{ name: "Prod", topSid: ["SID1", "SID2"] }], - sapApplication: [{ name: "ERP1", topSid: ["SID1", "SID2"] }] - }, - topMetricsThresholds: [ - { name: "Instance Availability", green: 90, red: 50, yellow: 75 } - ] - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sapLandscapeMonitorOperations.update( - resourceGroupName, - monitorName, - sapLandscapeMonitorParameter - ); - console.log(result); -} - -async function main() { - updateSapMonitor(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples-dev/sapSizingRecommendationsSample.ts b/sdk/workloads/arm-workloads/samples-dev/sapSizingRecommendationsSample.ts deleted file mode 100644 index 7952cfe65fc9..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/sapSizingRecommendationsSample.ts +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get SAP sizing recommendations by providing input SAPS for application tier and memory required for database tier - * - * @summary Get SAP sizing recommendations by providing input SAPS for application tier and memory required for database tier - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPSizingRecommendations_S4HANA_Distributed.json - */ -async function sapSizingRecommendationsS4HanaDistributed() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const location = "centralus"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPSizingRecommendations(location); - console.log(result); -} - -/** - * This sample demonstrates how to Get SAP sizing recommendations by providing input SAPS for application tier and memory required for database tier - * - * @summary Get SAP sizing recommendations by providing input SAPS for application tier and memory required for database tier - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPSizingRecommendations_S4HANA_HA_AvSet.json - */ -async function sapSizingRecommendationsS4HanaDistributedHaAvSet() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const location = "centralus"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPSizingRecommendations(location); - console.log(result); -} - -/** - * This sample demonstrates how to Get SAP sizing recommendations by providing input SAPS for application tier and memory required for database tier - * - * @summary Get SAP sizing recommendations by providing input SAPS for application tier and memory required for database tier - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPSizingRecommendations_S4HANA_HA_AvZone.json - */ -async function sapSizingRecommendationsS4HanaDistributedHaAvZone() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const location = "centralus"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPSizingRecommendations(location); - console.log(result); -} - -/** - * This sample demonstrates how to Get SAP sizing recommendations by providing input SAPS for application tier and memory required for database tier - * - * @summary Get SAP sizing recommendations by providing input SAPS for application tier and memory required for database tier - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPSizingRecommendations_S4HANA_SingleServer.json - */ -async function sapSizingRecommendationsS4HanaSingleServer() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const location = "centralus"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPSizingRecommendations(location); - console.log(result); -} - -async function main() { - sapSizingRecommendationsS4HanaDistributed(); - sapSizingRecommendationsS4HanaDistributedHaAvSet(); - sapSizingRecommendationsS4HanaDistributedHaAvZone(); - sapSizingRecommendationsS4HanaSingleServer(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples-dev/sapSupportedSkuSample.ts b/sdk/workloads/arm-workloads/samples-dev/sapSupportedSkuSample.ts deleted file mode 100644 index cb9049477a30..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/sapSupportedSkuSample.ts +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get a list of SAP supported SKUs for ASCS, Application and Database tier. - * - * @summary Get a list of SAP supported SKUs for ASCS, Application and Database tier. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPSupportedSkus_Distributed.json - */ -async function sapSupportedSkusDistributed() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const location = "centralus"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPSupportedSku(location); - console.log(result); -} - -/** - * This sample demonstrates how to Get a list of SAP supported SKUs for ASCS, Application and Database tier. - * - * @summary Get a list of SAP supported SKUs for ASCS, Application and Database tier. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPSupportedSkus_DistributedHA_AvSet.json - */ -async function sapSupportedSkusDistributedHaAvSet() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const location = "centralus"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPSupportedSku(location); - console.log(result); -} - -/** - * This sample demonstrates how to Get a list of SAP supported SKUs for ASCS, Application and Database tier. - * - * @summary Get a list of SAP supported SKUs for ASCS, Application and Database tier. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPSupportedSkus_DistributedHA_AvZone.json - */ -async function sapSupportedSkusDistributedHaAvZone() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const location = "centralus"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPSupportedSku(location); - console.log(result); -} - -/** - * This sample demonstrates how to Get a list of SAP supported SKUs for ASCS, Application and Database tier. - * - * @summary Get a list of SAP supported SKUs for ASCS, Application and Database tier. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPSupportedSkus_SingleServer.json - */ -async function sapSupportedSkusSingleServer() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const location = "centralus"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPSupportedSku(location); - console.log(result); -} - -async function main() { - sapSupportedSkusDistributed(); - sapSupportedSkusDistributedHaAvSet(); - sapSupportedSkusDistributedHaAvZone(); - sapSupportedSkusSingleServer(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples-dev/sapVirtualInstancesCreateSample.ts b/sdk/workloads/arm-workloads/samples-dev/sapVirtualInstancesCreateSample.ts deleted file mode 100644 index a5f43e67295a..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/sapVirtualInstancesCreateSample.ts +++ /dev/null @@ -1,2890 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - SAPVirtualInstance, - SAPVirtualInstancesCreateOptionalParams, - WorkloadsClient -} from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_CustomFullResourceNames_Distributed.json - */ -async function createInfrastructureWithOSConfigurationWithCustomResourceNamesForDistributedSystem() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 6, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E32ds_v4" - } - }, - centralServer: { - instanceCount: 1, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E16ds_v4" - } - }, - customResourceNames: { - applicationServer: { - availabilitySetName: "appAvSet", - virtualMachines: [ - { - dataDiskNames: { default: ["app0disk0"] }, - hostName: "apphostName0", - networkInterfaces: [{ networkInterfaceName: "appnic0" }], - osDiskName: "app0osdisk", - vmName: "appvm0" - }, - { - dataDiskNames: { default: ["app1disk0"] }, - hostName: "apphostName1", - networkInterfaces: [{ networkInterfaceName: "appnic1" }], - osDiskName: "app1osdisk", - vmName: "appvm1" - } - ] - }, - centralServer: { - virtualMachines: [ - { - dataDiskNames: { default: ["ascsdisk0"] }, - hostName: "ascshostName", - networkInterfaces: [{ networkInterfaceName: "ascsnic" }], - osDiskName: "ascsosdisk", - vmName: "ascsvm" - } - ] - }, - databaseServer: { - virtualMachines: [ - { - dataDiskNames: { - hanaData: ["hanadata0", "hanadata1"], - hanaLog: ["hanalog0", "hanalog1", "hanalog2"], - hanaShared: ["hanashared0", "hanashared1"], - usrSap: ["usrsap0"] - }, - hostName: "dbhostName", - networkInterfaces: [{ networkInterfaceName: "dbnic" }], - osDiskName: "dbosdisk", - vmName: "dbvm" - } - ] - }, - namingPatternType: "FullResourceName", - sharedStorage: { - sharedStorageAccountName: "storageacc", - sharedStorageAccountPrivateEndPointName: "peForxNFS" - } - }, - databaseServer: { - databaseType: "HANA", - instanceCount: 1, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_M32ts" - } - }, - deploymentType: "ThreeTier" - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" } - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {} - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_CustomFullResourceNames_HA_AvSet.json - */ -async function createInfrastructureWithOSConfigurationWithCustomResourceNamesForHaSystemWithAvailabilitySet() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 6, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E32ds_v4" - } - }, - centralServer: { - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E16ds_v4" - } - }, - customResourceNames: { - applicationServer: { - availabilitySetName: "appAvSet", - virtualMachines: [ - { - dataDiskNames: { default: ["app0disk0"] }, - hostName: "apphostName0", - networkInterfaces: [{ networkInterfaceName: "appnic0" }], - osDiskName: "app0osdisk", - vmName: "appvm0" - }, - { - dataDiskNames: { default: ["app1disk0"] }, - hostName: "apphostName1", - networkInterfaces: [{ networkInterfaceName: "appnic1" }], - osDiskName: "app1osdisk", - vmName: "appvm1" - } - ] - }, - centralServer: { - availabilitySetName: "csAvSet", - loadBalancer: { - backendPoolNames: ["ascsBackendPool"], - frontendIpConfigurationNames: ["ascsip0", "ersip0"], - healthProbeNames: ["ascsHealthProbe", "ersHealthProbe"], - loadBalancerName: "ascslb" - }, - virtualMachines: [ - { - hostName: "ascshostName", - networkInterfaces: [{ networkInterfaceName: "ascsnic" }], - osDiskName: "ascsosdisk", - vmName: "ascsvm" - }, - { - hostName: "ershostName", - networkInterfaces: [{ networkInterfaceName: "ersnic" }], - osDiskName: "ersosdisk", - vmName: "ersvm" - } - ] - }, - databaseServer: { - availabilitySetName: "dbAvSet", - loadBalancer: { - backendPoolNames: ["dbBackendPool"], - frontendIpConfigurationNames: ["dbip"], - healthProbeNames: ["dbHealthProbe"], - loadBalancerName: "dblb" - }, - virtualMachines: [ - { - dataDiskNames: { - hanaData: ["hanadatapr0", "hanadatapr1"], - hanaLog: ["hanalogpr0", "hanalogpr1", "hanalogpr2"], - hanaShared: ["hanasharedpr0", "hanasharedpr1"], - usrSap: ["usrsappr0"] - }, - hostName: "dbprhostName", - networkInterfaces: [{ networkInterfaceName: "dbprnic" }], - osDiskName: "dbprosdisk", - vmName: "dbvmpr" - }, - { - dataDiskNames: { - hanaData: ["hanadatasr0", "hanadatasr1"], - hanaLog: ["hanalogsr0", "hanalogsr1", "hanalogsr2"], - hanaShared: ["hanasharedsr0", "hanasharedsr1"], - usrSap: ["usrsapsr0"] - }, - hostName: "dbsrhostName", - networkInterfaces: [{ networkInterfaceName: "dbsrnic" }], - osDiskName: "dbsrosdisk", - vmName: "dbvmsr" - } - ] - }, - namingPatternType: "FullResourceName", - sharedStorage: { - sharedStorageAccountName: "storageacc", - sharedStorageAccountPrivateEndPointName: "peForxNFS" - } - }, - databaseServer: { - databaseType: "HANA", - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_M32ts" - } - }, - deploymentType: "ThreeTier", - highAvailabilityConfig: { highAvailabilityType: "AvailabilitySet" } - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" } - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {} - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_CustomFullResourceNames_HA_AvZone.json - */ -async function createInfrastructureWithOSConfigurationWithCustomResourceNamesForHaSystemWithAvailabilityZone() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 6, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E32ds_v4" - } - }, - centralServer: { - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E16ds_v4" - } - }, - customResourceNames: { - applicationServer: { - virtualMachines: [ - { - dataDiskNames: { default: ["app0disk0"] }, - hostName: "apphostName0", - networkInterfaces: [{ networkInterfaceName: "appnic0" }], - osDiskName: "app0osdisk", - vmName: "appvm0" - }, - { - dataDiskNames: { default: ["app1disk0"] }, - hostName: "apphostName1", - networkInterfaces: [{ networkInterfaceName: "appnic1" }], - osDiskName: "app1osdisk", - vmName: "appvm1" - } - ] - }, - centralServer: { - loadBalancer: { - backendPoolNames: ["ascsBackendPool"], - frontendIpConfigurationNames: ["ascsip0", "ersip0"], - healthProbeNames: ["ascsHealthProbe", "ersHealthProbe"], - loadBalancerName: "ascslb" - }, - virtualMachines: [ - { - hostName: "ascshostName", - networkInterfaces: [{ networkInterfaceName: "ascsnic" }], - osDiskName: "ascsosdisk", - vmName: "ascsvm" - }, - { - hostName: "ershostName", - networkInterfaces: [{ networkInterfaceName: "ersnic" }], - osDiskName: "ersosdisk", - vmName: "ersvm" - } - ] - }, - databaseServer: { - loadBalancer: { - backendPoolNames: ["dbBackendPool"], - frontendIpConfigurationNames: ["dbip"], - healthProbeNames: ["dbHealthProbe"], - loadBalancerName: "dblb" - }, - virtualMachines: [ - { - dataDiskNames: { - hanaData: ["hanadatapr0", "hanadatapr1"], - hanaLog: ["hanalogpr0", "hanalogpr1", "hanalogpr2"], - hanaShared: ["hanasharedpr0", "hanasharedpr1"], - usrSap: ["usrsappr0"] - }, - hostName: "dbprhostName", - networkInterfaces: [{ networkInterfaceName: "dbprnic" }], - osDiskName: "dbprosdisk", - vmName: "dbvmpr" - }, - { - dataDiskNames: { - hanaData: ["hanadatasr0", "hanadatasr1"], - hanaLog: ["hanalogsr0", "hanalogsr1", "hanalogsr2"], - hanaShared: ["hanasharedsr0", "hanasharedsr1"], - usrSap: ["usrsapsr0"] - }, - hostName: "dbsrhostName", - networkInterfaces: [{ networkInterfaceName: "dbsrnic" }], - osDiskName: "dbsrosdisk", - vmName: "dbvmsr" - } - ] - }, - namingPatternType: "FullResourceName", - sharedStorage: { - sharedStorageAccountName: "storageacc", - sharedStorageAccountPrivateEndPointName: "peForxNFS" - } - }, - databaseServer: { - databaseType: "HANA", - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_M32ts" - } - }, - deploymentType: "ThreeTier", - highAvailabilityConfig: { highAvailabilityType: "AvailabilityZone" } - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" } - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {} - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_CustomFullResourceNames_SingleServer.json - */ -async function createInfrastructureWithOSConfigurationWithCustomResourceNamesForSingleServerSystem() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - databaseType: "HANA", - deploymentType: "SingleServer", - networkConfiguration: { isSecondaryIpEnabled: true }, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E32ds_v4" - } - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" } - }, - environment: "NonProd", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {} - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_Distributed.json - */ -async function createInfrastructureOnlyForDistributedSystem() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "Deployment", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 6, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - ssh: { publicKeys: [{ keyData: "ssh-rsa public key" }] } - } - }, - vmSize: "Standard_E32ds_v4" - } - }, - centralServer: { - instanceCount: 1, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - ssh: { publicKeys: [{ keyData: "ssh-rsa public key" }] } - } - }, - vmSize: "Standard_E16ds_v4" - } - }, - databaseServer: { - databaseType: "HANA", - instanceCount: 1, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - ssh: { publicKeys: [{ keyData: "ssh-rsa public key" }] } - } - }, - vmSize: "Standard_M32ts" - } - }, - deploymentType: "ThreeTier" - } - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {} - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_HA_AvSet.json - */ -async function createInfrastructureOnlyForHaSystemWithAvailabilitySet() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "Deployment", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 5, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - ssh: { publicKeys: [{ keyData: "ssh-rsa public key" }] } - } - }, - vmSize: "Standard_E32ds_v4" - } - }, - centralServer: { - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - ssh: { publicKeys: [{ keyData: "ssh-rsa public key" }] } - } - }, - vmSize: "Standard_E16ds_v4" - } - }, - databaseServer: { - databaseType: "HANA", - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - ssh: { publicKeys: [{ keyData: "ssh-rsa public key" }] } - } - }, - vmSize: "Standard_M32ts" - } - }, - deploymentType: "ThreeTier", - highAvailabilityConfig: { highAvailabilityType: "AvailabilitySet" } - } - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {} - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_HA_AvZone.json - */ -async function createInfrastructureOnlyForHaSystemWithAvailabilityZone() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "Deployment", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 6, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - ssh: { publicKeys: [{ keyData: "ssh-rsa public key" }] } - } - }, - vmSize: "Standard_E32ds_v4" - } - }, - centralServer: { - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - ssh: { publicKeys: [{ keyData: "ssh-rsa public key" }] } - } - }, - vmSize: "Standard_E16ds_v4" - } - }, - databaseServer: { - databaseType: "HANA", - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - ssh: { publicKeys: [{ keyData: "ssh-rsa public key" }] } - } - }, - vmSize: "Standard_M32ts" - } - }, - deploymentType: "ThreeTier", - highAvailabilityConfig: { highAvailabilityType: "AvailabilityZone" } - } - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {} - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_SingleServer.json - */ -async function createInfrastructureOnlyForSingleServerSystem() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "Deployment", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - databaseType: "HANA", - deploymentType: "SingleServer", - networkConfiguration: { isSecondaryIpEnabled: true }, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - ssh: { publicKeys: [{ keyData: "ssh-rsa public key" }] } - } - }, - vmSize: "Standard_E32ds_v4" - } - } - }, - environment: "NonProd", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {} - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_DiskDetails_Distributed.json - */ -async function createInfrastructureWithDiskAndOSConfigurationForDistributedSystemRecommended() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 6, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E32ds_v4" - } - }, - centralServer: { - instanceCount: 1, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E16ds_v4" - } - }, - databaseServer: { - databaseType: "HANA", - diskConfiguration: { - diskVolumeConfigurations: { - backup: { - count: 2, - sizeGB: 256, - sku: { name: "StandardSSD_LRS" } - }, - "hana/data": { - count: 4, - sizeGB: 128, - sku: { name: "Premium_LRS" } - }, - "hana/log": { - count: 3, - sizeGB: 128, - sku: { name: "Premium_LRS" } - }, - "hana/shared": { - count: 1, - sizeGB: 256, - sku: { name: "StandardSSD_LRS" } - }, - os: { count: 1, sizeGB: 64, sku: { name: "StandardSSD_LRS" } }, - "usr/sap": { count: 1, sizeGB: 128, sku: { name: "Premium_LRS" } } - } - }, - instanceCount: 1, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_M32ts" - } - }, - deploymentType: "ThreeTier" - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" } - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {} - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_DiskDetails_HA_AvSet.json - */ -async function createInfrastructureWithDiskAndOSConfigurationForHaSystemWithAvailabilitySetRecommended() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 6, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E32ds_v4" - } - }, - centralServer: { - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E16ds_v4" - } - }, - databaseServer: { - databaseType: "HANA", - diskConfiguration: { - diskVolumeConfigurations: { - backup: { - count: 2, - sizeGB: 256, - sku: { name: "StandardSSD_LRS" } - }, - "hana/data": { - count: 4, - sizeGB: 128, - sku: { name: "Premium_LRS" } - }, - "hana/log": { - count: 3, - sizeGB: 128, - sku: { name: "Premium_LRS" } - }, - "hana/shared": { - count: 1, - sizeGB: 256, - sku: { name: "StandardSSD_LRS" } - }, - os: { count: 1, sizeGB: 64, sku: { name: "StandardSSD_LRS" } }, - "usr/sap": { count: 1, sizeGB: 128, sku: { name: "Premium_LRS" } } - } - }, - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_M32ts" - } - }, - deploymentType: "ThreeTier", - highAvailabilityConfig: { highAvailabilityType: "AvailabilitySet" } - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" } - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {} - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_DiskDetails_HA_AvZone.json - */ -async function createInfrastructureWithDiskAndOSConfigurationForHaSystemWithAvailabilityZoneRecommended() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 6, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E32ds_v4" - } - }, - centralServer: { - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E16ds_v4" - } - }, - databaseServer: { - databaseType: "HANA", - diskConfiguration: { - diskVolumeConfigurations: { - backup: { - count: 2, - sizeGB: 256, - sku: { name: "StandardSSD_LRS" } - }, - "hana/data": { - count: 4, - sizeGB: 128, - sku: { name: "Premium_LRS" } - }, - "hana/log": { - count: 3, - sizeGB: 128, - sku: { name: "Premium_LRS" } - }, - "hana/shared": { - count: 1, - sizeGB: 256, - sku: { name: "StandardSSD_LRS" } - }, - os: { count: 1, sizeGB: 64, sku: { name: "StandardSSD_LRS" } }, - "usr/sap": { count: 1, sizeGB: 128, sku: { name: "Premium_LRS" } } - } - }, - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_M32ts" - } - }, - deploymentType: "ThreeTier", - highAvailabilityConfig: { highAvailabilityType: "AvailabilityZone" } - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" } - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {} - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_DiskDetails_SingleServer.json - */ -async function createInfrastructureWithDiskAndOSConfigurationsForSingleServerSystemRecommended() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - databaseType: "HANA", - dbDiskConfiguration: { - diskVolumeConfigurations: { - backup: { count: 2, sizeGB: 256, sku: { name: "StandardSSD_LRS" } }, - "hana/data": { - count: 4, - sizeGB: 128, - sku: { name: "Premium_LRS" } - }, - "hana/log": { count: 3, sizeGB: 128, sku: { name: "Premium_LRS" } }, - "hana/shared": { - count: 1, - sizeGB: 256, - sku: { name: "StandardSSD_LRS" } - }, - os: { count: 1, sizeGB: 64, sku: { name: "StandardSSD_LRS" } }, - "usr/sap": { count: 1, sizeGB: 128, sku: { name: "Premium_LRS" } } - } - }, - deploymentType: "SingleServer", - networkConfiguration: { isSecondaryIpEnabled: true }, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E32ds_v4" - } - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" } - }, - environment: "NonProd", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {} - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_Distributed.json - */ -async function createInfrastructureWithOSConfigurationForDistributedSystemRecommended() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 6, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E32ds_v4" - } - }, - centralServer: { - instanceCount: 1, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E16ds_v4" - } - }, - databaseServer: { - databaseType: "HANA", - instanceCount: 1, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_M32ts" - } - }, - deploymentType: "ThreeTier" - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" } - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {} - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_HA_AvSet.json - */ -async function createInfrastructureWithOSConfigurationForHaSystemWithAvailabilitySetRecommended() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 6, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E32ds_v4" - } - }, - centralServer: { - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E16ds_v4" - } - }, - databaseServer: { - databaseType: "HANA", - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_M32ts" - } - }, - deploymentType: "ThreeTier", - highAvailabilityConfig: { highAvailabilityType: "AvailabilitySet" } - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" } - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {} - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_HA_AvZone.json - */ -async function createInfrastructureWithOSConfigurationForHaSystemWithAvailabilityZoneRecommended() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 6, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E32ds_v4" - } - }, - centralServer: { - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E16ds_v4" - } - }, - databaseServer: { - databaseType: "HANA", - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_M32ts" - } - }, - deploymentType: "ThreeTier", - highAvailabilityConfig: { highAvailabilityType: "AvailabilityZone" } - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" } - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {} - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_SingleServer.json - */ -async function createInfrastructureWithOSConfigurationForSingleServerSystemRecommended() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - databaseType: "HANA", - deploymentType: "SingleServer", - networkConfiguration: { isSecondaryIpEnabled: true }, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E32ds_v4" - } - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" } - }, - environment: "NonProd", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {} - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_Distributed_CreateTransport.json - */ -async function createInfrastructureWithANewSapTransportDirectoryFileshare() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 6, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E32ds_v4" - } - }, - centralServer: { - instanceCount: 1, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E16ds_v4" - } - }, - databaseServer: { - databaseType: "HANA", - instanceCount: 1, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_M32ts" - } - }, - deploymentType: "ThreeTier", - storageConfiguration: { - transportFileShareConfiguration: { - configurationType: "CreateAndMount", - resourceGroup: "rgName", - storageAccountName: "storageName" - } - } - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" } - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {} - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_Distributed_MountTransport.json - */ -async function createInfrastructureWithAnExistingSapTransportDirectoryFileshare() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 6, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E32ds_v4" - } - }, - centralServer: { - instanceCount: 1, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E16ds_v4" - } - }, - databaseServer: { - databaseType: "HANA", - instanceCount: 1, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_M32ts" - } - }, - deploymentType: "ThreeTier", - storageConfiguration: { - transportFileShareConfiguration: { - configurationType: "Mount", - id: - "/subscriptions/49d64d54-e888-4c46-a868-1936802b762c/resourceGroups/testrg/providers/Microsoft.Network/privateEndpoints/endpoint", - privateEndpointId: - "/subscriptions/49d64d54-e888-4c46-a868-1936802b762c/resourceGroups/testrg/providers/Microsoft.Network/privateEndpoints/endpoint" - } - } - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" } - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {} - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_Distributed_SkipTransport.json - */ -async function createInfrastructureWithoutASapTransportDirectoryFileshare() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 6, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E32ds_v4" - } - }, - centralServer: { - instanceCount: 1, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E16ds_v4" - } - }, - databaseServer: { - databaseType: "HANA", - instanceCount: 1, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_M32ts" - } - }, - deploymentType: "ThreeTier", - storageConfiguration: { - transportFileShareConfiguration: { configurationType: "Skip" } - } - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" } - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {} - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_DetectInstallation_Distributed.json - */ -async function detectSapSoftwareInstallationOnADistributedSystem() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "{{resourcegrp}}", - applicationServer: { - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP-HA", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "azureuser", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { - privateKey: "{{privateKey}}", - publicKey: "{{sshkey}}" - } - } - }, - vmSize: "Standard_E4ds_v4" - } - }, - centralServer: { - instanceCount: 1, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP-HA", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "azureuser", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { - privateKey: "{{privateKey}}", - publicKey: "{{sshkey}}" - } - } - }, - vmSize: "Standard_E4ds_v4" - } - }, - databaseServer: { - instanceCount: 1, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP-HA", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "azureuser", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { - privateKey: "{{privateKey}}", - publicKey: "{{sshkey}}" - } - } - }, - vmSize: "Standard_M32ts" - } - }, - deploymentType: "ThreeTier", - networkConfiguration: { isSecondaryIpEnabled: true } - }, - osSapConfiguration: { sapFqdn: "sap.bpaas.com" }, - softwareConfiguration: { - centralServerVmId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0", - softwareInstallationType: "External" - } - }, - environment: "Prod", - location: "eastus2", - sapProduct: "S4HANA", - tags: { createdBy: "azureuser" } - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_DetectInstallation_SingleServer.json - */ -async function detectSapSoftwareInstallationOnASingleServerSystem() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - databaseType: "HANA", - deploymentType: "SingleServer", - networkConfiguration: { isSecondaryIpEnabled: true }, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP-HA", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E32ds_v4" - } - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" }, - softwareConfiguration: { - centralServerVmId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0", - softwareInstallationType: "External" - } - }, - environment: "NonProd", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {} - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_DetectInstallation_HA_AvSet.json - */ -async function detectSapSoftwareInstallationOnAnHaSystemWithAvailabilitySet() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 6, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP-HA", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E32ds_v4" - } - }, - centralServer: { - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP-HA", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E16ds_v4" - } - }, - databaseServer: { - databaseType: "HANA", - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP-HA", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_M32ts" - } - }, - deploymentType: "ThreeTier", - highAvailabilityConfig: { highAvailabilityType: "AvailabilitySet" } - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" }, - softwareConfiguration: { - centralServerVmId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0", - softwareInstallationType: "External" - } - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {} - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_DetectInstallation_HA_AvZone.json - */ -async function detectSapSoftwareInstallationOnAnHaSystemWithAvailabilityZone() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 6, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP-HA", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E32ds_v4" - } - }, - centralServer: { - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP-HA", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E16ds_v4" - } - }, - databaseServer: { - databaseType: "HANA", - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP-HA", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_M32ts" - } - }, - deploymentType: "ThreeTier", - highAvailabilityConfig: { highAvailabilityType: "AvailabilityZone" } - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" }, - softwareConfiguration: { - centralServerVmId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0", - softwareInstallationType: "External" - } - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {} - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Install_Distributed.json - */ -async function installSapSoftwareOnDistributedSystem() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "{{resourcegrp}}", - applicationServer: { - instanceCount: 2, - subnetId: - "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP-HA", - publisher: "RedHat", - sku: "8.2", - version: "8.2.2021091201" - }, - osProfile: { - adminUsername: "azureuser", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { - privateKey: "{{privateKey}}", - publicKey: "{{sshkey}}" - } - } - }, - vmSize: "Standard_E4ds_v4" - } - }, - centralServer: { - instanceCount: 1, - subnetId: - "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP-HA", - publisher: "RedHat", - sku: "8.2", - version: "8.2.2021091201" - }, - osProfile: { - adminUsername: "azureuser", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { - privateKey: "{{privateKey}}", - publicKey: "{{sshkey}}" - } - } - }, - vmSize: "Standard_E4ds_v4" - } - }, - databaseServer: { - instanceCount: 1, - subnetId: - "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP-HA", - publisher: "RedHat", - sku: "8.2", - version: "8.2.2021091201" - }, - osProfile: { - adminUsername: "azureuser", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { - privateKey: "{{privateKey}}", - publicKey: "{{sshkey}}" - } - } - }, - vmSize: "Standard_M32ts" - } - }, - deploymentType: "ThreeTier", - networkConfiguration: { isSecondaryIpEnabled: true } - }, - osSapConfiguration: { sapFqdn: "sap.bpaas.com" }, - softwareConfiguration: { - bomUrl: - "https://teststorageaccount.blob.core.windows.net/sapbits/sapfiles/boms/S41909SPS03_v0011ms/S41909SPS03_v0011ms.yaml", - sapBitsStorageAccountId: - "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Storage/storageAccounts/teststorageaccount", - softwareInstallationType: "SAPInstallWithoutOSConfig", - softwareVersion: "SAP S/4HANA 1909 SPS 03" - } - }, - environment: "Prod", - location: "eastus2", - sapProduct: "S4HANA", - tags: { createdBy: "azureuser" } - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Install_SingleServer.json - */ -async function installSapSoftwareOnSingleServerSystem() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "test-rg", - deploymentType: "SingleServer", - subnetId: - "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/testsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "SLES-SAP", - publisher: "SUSE", - sku: "12-sp4-gen2", - version: "2022.02.01" - }, - osProfile: { - adminUsername: "azureappadmin", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { - privateKey: "{{privateKey}}", - publicKey: "{{sshkey}}" - } - } - }, - vmSize: "Standard_E32ds_v4" - } - }, - osSapConfiguration: { sapFqdn: "sap.bpaas.com" }, - softwareConfiguration: { - bomUrl: - "https://teststorageaccount.blob.core.windows.net/sapbits/sapfiles/boms/S41909SPS03_v0011ms/S41909SPS03_v0011ms.yaml", - sapBitsStorageAccountId: - "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Storage/storageAccounts/teststorageaccount", - softwareInstallationType: "SAPInstallWithoutOSConfig", - softwareVersion: "SAP S/4HANA 1909 SPS 03" - } - }, - environment: "NonProd", - location: "eastus2", - sapProduct: "S4HANA", - tags: {} - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_Discover_CustomMrgStorageAccountName.json - */ -async function registerExistingSapSystemAsVirtualInstanceForSapSolutionsWithOptionalCustomizations() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - centralServerVmId: - "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0", - configurationType: "Discovery", - managedRgStorageAccountName: "q20saacssgrs" - }, - environment: "NonProd", - location: "northeurope", - sapProduct: "S4HANA", - tags: { createdby: "abc@microsoft.com", test: "abc" } - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_Discover.json - */ -async function registerExistingSapSystemAsVirtualInstanceForSapSolutions() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - centralServerVmId: - "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0", - configurationType: "Discovery" - }, - environment: "NonProd", - location: "northeurope", - sapProduct: "S4HANA", - tags: { createdby: "abc@microsoft.com", test: "abc" } - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -async function main() { - createInfrastructureWithOSConfigurationWithCustomResourceNamesForDistributedSystem(); - createInfrastructureWithOSConfigurationWithCustomResourceNamesForHaSystemWithAvailabilitySet(); - createInfrastructureWithOSConfigurationWithCustomResourceNamesForHaSystemWithAvailabilityZone(); - createInfrastructureWithOSConfigurationWithCustomResourceNamesForSingleServerSystem(); - createInfrastructureOnlyForDistributedSystem(); - createInfrastructureOnlyForHaSystemWithAvailabilitySet(); - createInfrastructureOnlyForHaSystemWithAvailabilityZone(); - createInfrastructureOnlyForSingleServerSystem(); - createInfrastructureWithDiskAndOSConfigurationForDistributedSystemRecommended(); - createInfrastructureWithDiskAndOSConfigurationForHaSystemWithAvailabilitySetRecommended(); - createInfrastructureWithDiskAndOSConfigurationForHaSystemWithAvailabilityZoneRecommended(); - createInfrastructureWithDiskAndOSConfigurationsForSingleServerSystemRecommended(); - createInfrastructureWithOSConfigurationForDistributedSystemRecommended(); - createInfrastructureWithOSConfigurationForHaSystemWithAvailabilitySetRecommended(); - createInfrastructureWithOSConfigurationForHaSystemWithAvailabilityZoneRecommended(); - createInfrastructureWithOSConfigurationForSingleServerSystemRecommended(); - createInfrastructureWithANewSapTransportDirectoryFileshare(); - createInfrastructureWithAnExistingSapTransportDirectoryFileshare(); - createInfrastructureWithoutASapTransportDirectoryFileshare(); - detectSapSoftwareInstallationOnADistributedSystem(); - detectSapSoftwareInstallationOnASingleServerSystem(); - detectSapSoftwareInstallationOnAnHaSystemWithAvailabilitySet(); - detectSapSoftwareInstallationOnAnHaSystemWithAvailabilityZone(); - installSapSoftwareOnDistributedSystem(); - installSapSoftwareOnSingleServerSystem(); - registerExistingSapSystemAsVirtualInstanceForSapSolutionsWithOptionalCustomizations(); - registerExistingSapSystemAsVirtualInstanceForSapSolutions(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples-dev/sapVirtualInstancesDeleteSample.ts b/sdk/workloads/arm-workloads/samples-dev/sapVirtualInstancesDeleteSample.ts deleted file mode 100644 index abd0b22a458c..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/sapVirtualInstancesDeleteSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to 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. - * - * @summary 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. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Delete.json - */ -async function sapVirtualInstancesDelete() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginDeleteAndWait( - resourceGroupName, - sapVirtualInstanceName - ); - console.log(result); -} - -async function main() { - sapVirtualInstancesDelete(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples-dev/sapVirtualInstancesGetSample.ts b/sdk/workloads/arm-workloads/samples-dev/sapVirtualInstancesGetSample.ts deleted file mode 100644 index 834a41533195..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/sapVirtualInstancesGetSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets a Virtual Instance for SAP solutions resource - * - * @summary Gets a Virtual Instance for SAP solutions resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Get.json - */ -async function sapVirtualInstancesGet() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.get( - resourceGroupName, - sapVirtualInstanceName - ); - console.log(result); -} - -async function main() { - sapVirtualInstancesGet(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples-dev/sapVirtualInstancesListByResourceGroupSample.ts b/sdk/workloads/arm-workloads/samples-dev/sapVirtualInstancesListByResourceGroupSample.ts deleted file mode 100644 index e6141d812e3e..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/sapVirtualInstancesListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets all Virtual Instances for SAP solutions resources in a Resource Group. - * - * @summary Gets all Virtual Instances for SAP solutions resources in a Resource Group. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_ListByResourceGroup.json - */ -async function sapVirtualInstancesListByResourceGroup() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.sAPVirtualInstances.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - sapVirtualInstancesListByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples-dev/sapVirtualInstancesListBySubscriptionSample.ts b/sdk/workloads/arm-workloads/samples-dev/sapVirtualInstancesListBySubscriptionSample.ts deleted file mode 100644 index e474f61f5cbf..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/sapVirtualInstancesListBySubscriptionSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets all Virtual Instances for SAP solutions resources in a Subscription. - * - * @summary Gets all Virtual Instances for SAP solutions resources in a Subscription. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_ListBySubscription.json - */ -async function sapVirtualInstancesListBySubscription() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "6d875e77-e412-4d7d-9af4-8895278b4443"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.sAPVirtualInstances.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - sapVirtualInstancesListBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples-dev/sapVirtualInstancesStartSample.ts b/sdk/workloads/arm-workloads/samples-dev/sapVirtualInstancesStartSample.ts deleted file mode 100644 index b9bb4f738d01..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/sapVirtualInstancesStartSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Starts the SAP application, that is the Central Services instance and Application server instances. - * - * @summary Starts the SAP application, that is the Central Services instance and Application server instances. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Start.json - */ -async function sapVirtualInstancesStart() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginStartAndWait( - resourceGroupName, - sapVirtualInstanceName - ); - console.log(result); -} - -async function main() { - sapVirtualInstancesStart(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples-dev/sapVirtualInstancesStopSample.ts b/sdk/workloads/arm-workloads/samples-dev/sapVirtualInstancesStopSample.ts deleted file mode 100644 index 22521588e301..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/sapVirtualInstancesStopSample.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - StopRequest, - SAPVirtualInstancesStopOptionalParams, - WorkloadsClient -} from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Stops the SAP Application, that is the Application server instances and Central Services instance. - * - * @summary Stops the SAP Application, that is the Application server instances and Central Services instance. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Stop.json - */ -async function sapVirtualInstancesStop() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: StopRequest = { softStopTimeoutSeconds: 0 }; - const options: SAPVirtualInstancesStopOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginStopAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -async function main() { - sapVirtualInstancesStop(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples-dev/sapVirtualInstancesUpdateSample.ts b/sdk/workloads/arm-workloads/samples-dev/sapVirtualInstancesUpdateSample.ts deleted file mode 100644 index 090a1d35b9e4..000000000000 --- a/sdk/workloads/arm-workloads/samples-dev/sapVirtualInstancesUpdateSample.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - UpdateSAPVirtualInstanceRequest, - SAPVirtualInstancesUpdateOptionalParams, - WorkloadsClient -} from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates a Virtual Instance for SAP solutions resource - * - * @summary Updates a Virtual Instance for SAP solutions resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Update.json - */ -async function sapVirtualInstancesUpdate() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: UpdateSAPVirtualInstanceRequest = { - identity: { type: "None" }, - tags: { key1: "svi1" } - }; - const options: SAPVirtualInstancesUpdateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.update( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -async function main() { - sapVirtualInstancesUpdate(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/README.md b/sdk/workloads/arm-workloads/samples/v1/javascript/README.md deleted file mode 100644 index 0292ccd29309..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/README.md +++ /dev/null @@ -1,146 +0,0 @@ -# client library samples for JavaScript - -These sample programs show how to use the JavaScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| ------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [monitorsCreateSample.js][monitorscreatesample] | Creates a SAP monitor for the specified subscription, resource group, and resource name. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/monitors_Create.json | -| [monitorsDeleteSample.js][monitorsdeletesample] | Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/monitors_Delete.json | -| [monitorsGetSample.js][monitorsgetsample] | Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/monitors_Get.json | -| [monitorsListByResourceGroupSample.js][monitorslistbyresourcegroupsample] | Gets a list of SAP monitors in the specified resource group. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/monitors_ListByRG.json | -| [monitorsListSample.js][monitorslistsample] | Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each SAP monitor. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/monitors_List.json | -| [monitorsUpdateSample.js][monitorsupdatesample] | Patches the Tags field of a SAP monitor for the specified subscription, resource group, and SAP monitor name. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/monitors_PatchTags_Delete.json | -| [operationsListSample.js][operationslistsample] | Lists all the available API operations under this PR x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/Operations_List.json | -| [providerInstancesCreateSample.js][providerinstancescreatesample] | Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/Db2ProviderInstances_Create.json | -| [providerInstancesDeleteSample.js][providerinstancesdeletesample] | Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ProviderInstances_Delete.json | -| [providerInstancesGetSample.js][providerinstancesgetsample] | Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/Db2ProviderInstances_Get.json | -| [providerInstancesListSample.js][providerinstanceslistsample] | Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of each provider instances. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ProviderInstances_List.json | -| [sapApplicationServerInstancesCreateSample.js][sapapplicationserverinstancescreatesample] | Puts the SAP Application Server Instance resource.

This will be used by service only. PUT by end user will return a Bad Request error. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_Create_HA_AvSet.json | -| [sapApplicationServerInstancesDeleteSample.js][sapapplicationserverinstancesdeletesample] | Deletes the SAP Application Server Instance resource.

This operation will be used by service only. Delete by end user will return a Bad Request error. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_Delete.json | -| [sapApplicationServerInstancesGetSample.js][sapapplicationserverinstancesgetsample] | Gets the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_Get.json | -| [sapApplicationServerInstancesListSample.js][sapapplicationserverinstanceslistsample] | Lists the SAP Application Server Instance resources for a given Virtual Instance for SAP solutions resource. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_List.json | -| [sapApplicationServerInstancesStartInstanceSample.js][sapapplicationserverinstancesstartinstancesample] | Starts the SAP Application Server Instance. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_StartInstance.json | -| [sapApplicationServerInstancesStopInstanceSample.js][sapapplicationserverinstancesstopinstancesample] | Stops the SAP Application Server Instance. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_StopInstance.json | -| [sapApplicationServerInstancesUpdateSample.js][sapapplicationserverinstancesupdatesample] | Puts the SAP Application Server Instance resource. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_Update.json | -| [sapAvailabilityZoneDetailsSample.js][sapavailabilityzonedetailssample] | Get the recommended SAP Availability Zone Pair Details for your region. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPAvailabilityZoneDetails_eastus.json | -| [sapCentralInstancesCreateSample.js][sapcentralinstancescreatesample] | Creates the SAP Central Services Instance resource.

This will be used by service only. PUT operation on this resource by end user will return a Bad Request error. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_Create_HA_AvSet.json | -| [sapCentralInstancesDeleteSample.js][sapcentralinstancesdeletesample] | Deletes the SAP Central Services Instance resource.

This will be used by service only. Delete operation on this resource by end user will return a Bad Request error. You can delete the parent resource, which is the Virtual Instance for SAP solutions resource, using the delete operation on it. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_Delete.json | -| [sapCentralInstancesGetSample.js][sapcentralinstancesgetsample] | Gets the SAP Central Services Instance resource. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_Get.json | -| [sapCentralInstancesListSample.js][sapcentralinstanceslistsample] | Lists the SAP Central Services Instance resource for the given Virtual Instance for SAP solutions resource. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_List.json | -| [sapCentralInstancesStartInstanceSample.js][sapcentralinstancesstartinstancesample] | Starts the SAP Central Services Instance. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_StartInstance.json | -| [sapCentralInstancesStopInstanceSample.js][sapcentralinstancesstopinstancesample] | Stops the SAP Central Services Instance. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_StopInstance.json | -| [sapCentralInstancesUpdateSample.js][sapcentralinstancesupdatesample] | Updates the SAP Central Services Instance resource.

This can be used to update tags on the resource. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_Update.json | -| [sapDatabaseInstancesCreateSample.js][sapdatabaseinstancescreatesample] | Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource.

This will be used by service only. PUT by end user will return a Bad Request error. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_Create_HA_AvSet.json | -| [sapDatabaseInstancesDeleteSample.js][sapdatabaseinstancesdeletesample] | Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource.

This will be used by service only. Delete by end user will return a Bad Request error. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_Delete.json | -| [sapDatabaseInstancesGetSample.js][sapdatabaseinstancesgetsample] | Gets the SAP Database Instance resource. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_Get.json | -| [sapDatabaseInstancesListSample.js][sapdatabaseinstanceslistsample] | Lists the Database resources associated with a Virtual Instance for SAP solutions resource. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_List.json | -| [sapDatabaseInstancesStartInstanceSample.js][sapdatabaseinstancesstartinstancesample] | Starts the database instance of the SAP system. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_StartInstance.json | -| [sapDatabaseInstancesStopInstanceSample.js][sapdatabaseinstancesstopinstancesample] | Stops the database instance of the SAP system. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_StopInstance.json | -| [sapDatabaseInstancesUpdateSample.js][sapdatabaseinstancesupdatesample] | Updates the Database resource. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_Update.json | -| [sapDiskConfigurationsSample.js][sapdiskconfigurationssample] | Get the SAP Disk Configuration Layout prod/non-prod SAP System. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDiskConfigurations_NonProd.json | -| [sapLandscapeMonitorCreateSample.js][saplandscapemonitorcreatesample] | Creates a SAP Landscape Monitor Dashboard for the specified subscription, resource group, and resource name. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/SapLandscapeMonitor_Create.json | -| [sapLandscapeMonitorDeleteSample.js][saplandscapemonitordeletesample] | Deletes a SAP Landscape Monitor Dashboard with the specified subscription, resource group, and SAP monitor name. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/SapLandscapeMonitor_Delete.json | -| [sapLandscapeMonitorGetSample.js][saplandscapemonitorgetsample] | Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource group, and resource name. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/SapLandscapeMonitor_Get.json | -| [sapLandscapeMonitorListSample.js][saplandscapemonitorlistsample] | Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource group, and resource name. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/SapLandscapeMonitor_List.json | -| [sapLandscapeMonitorUpdateSample.js][saplandscapemonitorupdatesample] | Patches the SAP Landscape Monitor Dashboard for the specified subscription, resource group, and SAP monitor name. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/SapLandscapeMonitor_Update.json | -| [sapSizingRecommendationsSample.js][sapsizingrecommendationssample] | Get SAP sizing recommendations by providing input SAPS for application tier and memory required for database tier x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPSizingRecommendations_S4HANA_Distributed.json | -| [sapSupportedSkuSample.js][sapsupportedskusample] | Get a list of SAP supported SKUs for ASCS, Application and Database tier. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPSupportedSkus_Distributed.json | -| [sapVirtualInstancesCreateSample.js][sapvirtualinstancescreatesample] | Creates a Virtual Instance for SAP solutions (VIS) resource x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_CustomFullResourceNames_Distributed.json | -| [sapVirtualInstancesDeleteSample.js][sapvirtualinstancesdeletesample] | 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. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Delete.json | -| [sapVirtualInstancesGetSample.js][sapvirtualinstancesgetsample] | Gets a Virtual Instance for SAP solutions resource x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Get.json | -| [sapVirtualInstancesListByResourceGroupSample.js][sapvirtualinstanceslistbyresourcegroupsample] | Gets all Virtual Instances for SAP solutions resources in a Resource Group. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_ListByResourceGroup.json | -| [sapVirtualInstancesListBySubscriptionSample.js][sapvirtualinstanceslistbysubscriptionsample] | Gets all Virtual Instances for SAP solutions resources in a Subscription. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_ListBySubscription.json | -| [sapVirtualInstancesStartSample.js][sapvirtualinstancesstartsample] | Starts the SAP application, that is the Central Services instance and Application server instances. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Start.json | -| [sapVirtualInstancesStopSample.js][sapvirtualinstancesstopsample] | Stops the SAP Application, that is the Application server instances and Central Services instance. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Stop.json | -| [sapVirtualInstancesUpdateSample.js][sapvirtualinstancesupdatesample] | Updates a Virtual Instance for SAP solutions resource x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Update.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -3. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node monitorsCreateSample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx cross-env WORKLOADS_SUBSCRIPTION_ID="" WORKLOADS_RESOURCE_GROUP="" node monitorsCreateSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[monitorscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/monitorsCreateSample.js -[monitorsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/monitorsDeleteSample.js -[monitorsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/monitorsGetSample.js -[monitorslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/monitorsListByResourceGroupSample.js -[monitorslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/monitorsListSample.js -[monitorsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/monitorsUpdateSample.js -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/operationsListSample.js -[providerinstancescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/providerInstancesCreateSample.js -[providerinstancesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/providerInstancesDeleteSample.js -[providerinstancesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/providerInstancesGetSample.js -[providerinstanceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/providerInstancesListSample.js -[sapapplicationserverinstancescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/sapApplicationServerInstancesCreateSample.js -[sapapplicationserverinstancesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/sapApplicationServerInstancesDeleteSample.js -[sapapplicationserverinstancesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/sapApplicationServerInstancesGetSample.js -[sapapplicationserverinstanceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/sapApplicationServerInstancesListSample.js -[sapapplicationserverinstancesstartinstancesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/sapApplicationServerInstancesStartInstanceSample.js -[sapapplicationserverinstancesstopinstancesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/sapApplicationServerInstancesStopInstanceSample.js -[sapapplicationserverinstancesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/sapApplicationServerInstancesUpdateSample.js -[sapavailabilityzonedetailssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/sapAvailabilityZoneDetailsSample.js -[sapcentralinstancescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/sapCentralInstancesCreateSample.js -[sapcentralinstancesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/sapCentralInstancesDeleteSample.js -[sapcentralinstancesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/sapCentralInstancesGetSample.js -[sapcentralinstanceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/sapCentralInstancesListSample.js -[sapcentralinstancesstartinstancesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/sapCentralInstancesStartInstanceSample.js -[sapcentralinstancesstopinstancesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/sapCentralInstancesStopInstanceSample.js -[sapcentralinstancesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/sapCentralInstancesUpdateSample.js -[sapdatabaseinstancescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/sapDatabaseInstancesCreateSample.js -[sapdatabaseinstancesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/sapDatabaseInstancesDeleteSample.js -[sapdatabaseinstancesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/sapDatabaseInstancesGetSample.js -[sapdatabaseinstanceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/sapDatabaseInstancesListSample.js -[sapdatabaseinstancesstartinstancesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/sapDatabaseInstancesStartInstanceSample.js -[sapdatabaseinstancesstopinstancesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/sapDatabaseInstancesStopInstanceSample.js -[sapdatabaseinstancesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/sapDatabaseInstancesUpdateSample.js -[sapdiskconfigurationssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/sapDiskConfigurationsSample.js -[saplandscapemonitorcreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/sapLandscapeMonitorCreateSample.js -[saplandscapemonitordeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/sapLandscapeMonitorDeleteSample.js -[saplandscapemonitorgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/sapLandscapeMonitorGetSample.js -[saplandscapemonitorlistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/sapLandscapeMonitorListSample.js -[saplandscapemonitorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/sapLandscapeMonitorUpdateSample.js -[sapsizingrecommendationssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/sapSizingRecommendationsSample.js -[sapsupportedskusample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/sapSupportedSkuSample.js -[sapvirtualinstancescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/sapVirtualInstancesCreateSample.js -[sapvirtualinstancesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/sapVirtualInstancesDeleteSample.js -[sapvirtualinstancesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/sapVirtualInstancesGetSample.js -[sapvirtualinstanceslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/sapVirtualInstancesListByResourceGroupSample.js -[sapvirtualinstanceslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/sapVirtualInstancesListBySubscriptionSample.js -[sapvirtualinstancesstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/sapVirtualInstancesStartSample.js -[sapvirtualinstancesstopsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/sapVirtualInstancesStopSample.js -[sapvirtualinstancesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/javascript/sapVirtualInstancesUpdateSample.js -[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-workloads?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/workloads/arm-workloads/README.md diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/monitorsCreateSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/monitorsCreateSample.js deleted file mode 100644 index 8446d8718faf..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/monitorsCreateSample.js +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Creates a SAP monitor for the specified subscription, resource group, and resource name. - * - * @summary Creates a SAP monitor for the specified subscription, resource group, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/monitors_Create.json - */ -async function createASapMonitor() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const monitorParameter = { - appLocation: "westus", - location: "westus", - logAnalyticsWorkspaceArmId: - "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.operationalinsights/workspaces/myWorkspace", - managedResourceGroupConfiguration: { name: "myManagedRg" }, - monitorSubnet: - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet", - routingPreference: "RouteAll", - tags: { key: "value" }, - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.monitors.beginCreateAndWait( - resourceGroupName, - monitorName, - monitorParameter - ); - console.log(result); -} - -async function main() { - createASapMonitor(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/monitorsDeleteSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/monitorsDeleteSample.js deleted file mode 100644 index 5545a2663d09..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/monitorsDeleteSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. - * - * @summary Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/monitors_Delete.json - */ -async function deletesASapMonitor() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.monitors.beginDeleteAndWait(resourceGroupName, monitorName); - console.log(result); -} - -async function main() { - deletesASapMonitor(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/monitorsGetSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/monitorsGetSample.js deleted file mode 100644 index 36bbc9d288df..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/monitorsGetSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. - * - * @summary Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/monitors_Get.json - */ -async function getPropertiesOfASapMonitor() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.monitors.get(resourceGroupName, monitorName); - console.log(result); -} - -async function main() { - getPropertiesOfASapMonitor(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/monitorsListByResourceGroupSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/monitorsListByResourceGroupSample.js deleted file mode 100644 index 07ee868f36a5..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/monitorsListByResourceGroupSample.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets a list of SAP monitors in the specified resource group. - * - * @summary Gets a list of SAP monitors in the specified resource group. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/monitors_ListByRG.json - */ -async function listAllSapMonitorsInAResourceGroup() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "example-rg"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.monitors.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAllSapMonitorsInAResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/monitorsListSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/monitorsListSample.js deleted file mode 100644 index bed269a24b10..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/monitorsListSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each SAP monitor. - * - * @summary Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each SAP monitor. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/monitors_List.json - */ -async function listAllSapMonitorsInASubscription() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.monitors.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAllSapMonitorsInASubscription(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/monitorsUpdateSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/monitorsUpdateSample.js deleted file mode 100644 index c4528ed7a64d..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/monitorsUpdateSample.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Patches the Tags field of a SAP monitor for the specified subscription, resource group, and SAP monitor name. - * - * @summary Patches the Tags field of a SAP monitor for the specified subscription, resource group, and SAP monitor name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/monitors_PatchTags_Delete.json - */ -async function deleteTagsFieldOfASapMonitor() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const body = { identity: { type: "None" }, tags: {} }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.monitors.update(resourceGroupName, monitorName, body); - console.log(result); -} - -/** - * This sample demonstrates how to Patches the Tags field of a SAP monitor for the specified subscription, resource group, and SAP monitor name. - * - * @summary Patches the Tags field of a SAP monitor for the specified subscription, resource group, and SAP monitor name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/monitors_PatchTags.json - */ -async function updateTagsFieldOfASapMonitor() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const body = { - identity: { type: "None" }, - tags: { testkey: "testvalue" }, - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.monitors.update(resourceGroupName, monitorName, body); - console.log(result); -} - -async function main() { - deleteTagsFieldOfASapMonitor(); - updateTagsFieldOfASapMonitor(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/operationsListSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/operationsListSample.js deleted file mode 100644 index 0e11b5a5076c..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/operationsListSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists all the available API operations under this PR - * - * @summary Lists all the available API operations under this PR - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/Operations_List.json - */ -async function operations() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - operations(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/package.json b/sdk/workloads/arm-workloads/samples/v1/javascript/package.json deleted file mode 100644 index b55711e1d4fa..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "@azure-samples/arm-workloads-js", - "private": true, - "version": "1.0.0", - "description": " client library samples for JavaScript", - "engines": { - "node": ">=14.0.0" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/workloads/arm-workloads" - }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], - "author": "Microsoft Corporation", - "license": "MIT", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/workloads/arm-workloads", - "dependencies": { - "@azure/arm-workloads": "latest", - "dotenv": "latest", - "@azure/identity": "^2.0.1" - } -} diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/providerInstancesCreateSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/providerInstancesCreateSample.js deleted file mode 100644 index 535ad6329df3..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/providerInstancesCreateSample.js +++ /dev/null @@ -1,458 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/Db2ProviderInstances_Create.json - */ -async function createADb2Provider() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const providerInstanceParameter = { - providerSettings: { - dbName: "dbName", - dbPassword: "password", - dbPasswordUri: "", - dbPort: "dbPort", - dbUsername: "username", - hostname: "hostname", - providerType: "Db2", - sapSid: "SID", - sslCertificateUri: "https://storageaccount.blob.core.windows.net/containername/filename", - sslPreference: "ServerCertificate", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.beginCreateAndWait( - resourceGroupName, - monitorName, - providerInstanceName, - providerInstanceParameter - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/Db2ProviderInstances_Create_Root_Certificate.json - */ -async function createADb2ProviderWithRootCertificate() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const providerInstanceParameter = { - providerSettings: { - dbName: "dbName", - dbPassword: "password", - dbPasswordUri: "", - dbPort: "dbPort", - dbUsername: "username", - hostname: "hostname", - providerType: "Db2", - sapSid: "SID", - sslPreference: "RootCertificate", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.beginCreateAndWait( - resourceGroupName, - monitorName, - providerInstanceName, - providerInstanceParameter - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/MsSqlServerProviderInstance_Create.json - */ -async function createAMSSqlServerProvider() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const providerInstanceParameter = { - providerSettings: { - dbPassword: "****", - dbPasswordUri: "", - dbPort: "5912", - dbUsername: "user", - hostname: "hostname", - providerType: "MsSqlServer", - sapSid: "sid", - sslCertificateUri: "https://storageaccount.blob.core.windows.net/containername/filename", - sslPreference: "ServerCertificate", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.beginCreateAndWait( - resourceGroupName, - monitorName, - providerInstanceName, - providerInstanceParameter - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/MsSqlServerProviderInstance_Create_Root_Certificate.json - */ -async function createAMSSqlServerProviderWithRootCertificate() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const providerInstanceParameter = { - providerSettings: { - dbPassword: "****", - dbPasswordUri: "", - dbPort: "5912", - dbUsername: "user", - hostname: "hostname", - providerType: "MsSqlServer", - sapSid: "sid", - sslPreference: "RootCertificate", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.beginCreateAndWait( - resourceGroupName, - monitorName, - providerInstanceName, - providerInstanceParameter - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/PrometheusOSProviderInstances_Create.json - */ -async function createAOSProvider() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const providerInstanceParameter = { - providerSettings: { - prometheusUrl: "http://192.168.0.0:9090/metrics", - providerType: "PrometheusOS", - sapSid: "SID", - sslCertificateUri: "https://storageaccount.blob.core.windows.net/containername/filename", - sslPreference: "ServerCertificate", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.beginCreateAndWait( - resourceGroupName, - monitorName, - providerInstanceName, - providerInstanceParameter - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/PrometheusOSProviderInstances_Create_Root_Certificate.json - */ -async function createAOSProviderWithRootCertificate() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const providerInstanceParameter = { - providerSettings: { - prometheusUrl: "http://192.168.0.0:9090/metrics", - providerType: "PrometheusOS", - sapSid: "SID", - sslPreference: "RootCertificate", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.beginCreateAndWait( - resourceGroupName, - monitorName, - providerInstanceName, - providerInstanceParameter - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/PrometheusHaClusterProviderInstances_Create.json - */ -async function createAPrometheusHaClusterProvider() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const providerInstanceParameter = { - providerSettings: { - clusterName: "clusterName", - hostname: "hostname", - prometheusUrl: "http://192.168.0.0:9090/metrics", - providerType: "PrometheusHaCluster", - sid: "sid", - sslCertificateUri: "https://storageaccount.blob.core.windows.net/containername/filename", - sslPreference: "ServerCertificate", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.beginCreateAndWait( - resourceGroupName, - monitorName, - providerInstanceName, - providerInstanceParameter - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/PrometheusHaClusterProviderInstances_Create_Root_Certificate.json - */ -async function createAPrometheusHaClusterProviderWithRootCertificate() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const providerInstanceParameter = { - providerSettings: { - clusterName: "clusterName", - hostname: "hostname", - prometheusUrl: "http://192.168.0.0:9090/metrics", - providerType: "PrometheusHaCluster", - sid: "sid", - sslPreference: "RootCertificate", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.beginCreateAndWait( - resourceGroupName, - monitorName, - providerInstanceName, - providerInstanceParameter - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ProviderInstances_Create.json - */ -async function createASapMonitorHanaProvider() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const providerInstanceParameter = { - providerSettings: { - dbName: "db", - dbPassword: "****", - dbPasswordUri: "", - dbUsername: "user", - hostname: "name", - instanceNumber: "00", - providerType: "SapHana", - sapSid: "SID", - sqlPort: "0000", - sslCertificateUri: "https://storageaccount.blob.core.windows.net/containername/filename", - sslHostNameInCertificate: "xyz.domain.com", - sslPreference: "ServerCertificate", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.beginCreateAndWait( - resourceGroupName, - monitorName, - providerInstanceName, - providerInstanceParameter - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ProviderInstances_Create_Root_Certificate.json - */ -async function createASapMonitorHanaProviderWithRootCertificate() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const providerInstanceParameter = { - providerSettings: { - dbName: "db", - dbPassword: "****", - dbPasswordUri: "", - dbUsername: "user", - hostname: "name", - instanceNumber: "00", - providerType: "SapHana", - sapSid: "SID", - sqlPort: "0000", - sslHostNameInCertificate: "xyz.domain.com", - sslPreference: "RootCertificate", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.beginCreateAndWait( - resourceGroupName, - monitorName, - providerInstanceName, - providerInstanceParameter - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/NetWeaverProviderInstances_Create.json - */ -async function createASapMonitorNetWeaverProvider() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const providerInstanceParameter = { - providerSettings: { - providerType: "SapNetWeaver", - sapClientId: "111", - sapHostFileEntries: ["127.0.0.1 name fqdn"], - sapHostname: "name", - sapInstanceNr: "00", - sapPassword: "****", - sapPasswordUri: "", - sapPortNumber: "1234", - sapSid: "SID", - sapUsername: "username", - sslCertificateUri: "https://storageaccount.blob.core.windows.net/containername/filename", - sslPreference: "ServerCertificate", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.beginCreateAndWait( - resourceGroupName, - monitorName, - providerInstanceName, - providerInstanceParameter - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/NetWeaverProviderInstances_Create_Root_Certificate.json - */ -async function createASapMonitorNetWeaverProviderWithRootCertificate() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const providerInstanceParameter = { - providerSettings: { - providerType: "SapNetWeaver", - sapClientId: "111", - sapHostFileEntries: ["127.0.0.1 name fqdn"], - sapHostname: "name", - sapInstanceNr: "00", - sapPassword: "****", - sapPasswordUri: "", - sapPortNumber: "1234", - sapSid: "SID", - sapUsername: "username", - sslPreference: "RootCertificate", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.beginCreateAndWait( - resourceGroupName, - monitorName, - providerInstanceName, - providerInstanceParameter - ); - console.log(result); -} - -async function main() { - createADb2Provider(); - createADb2ProviderWithRootCertificate(); - createAMSSqlServerProvider(); - createAMSSqlServerProviderWithRootCertificate(); - createAOSProvider(); - createAOSProviderWithRootCertificate(); - createAPrometheusHaClusterProvider(); - createAPrometheusHaClusterProviderWithRootCertificate(); - createASapMonitorHanaProvider(); - createASapMonitorHanaProviderWithRootCertificate(); - createASapMonitorNetWeaverProvider(); - createASapMonitorNetWeaverProviderWithRootCertificate(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/providerInstancesDeleteSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/providerInstancesDeleteSample.js deleted file mode 100644 index 3eac82f3f214..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/providerInstancesDeleteSample.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ProviderInstances_Delete.json - */ -async function deletesASapMonitorProvider() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.beginDeleteAndWait( - resourceGroupName, - monitorName, - providerInstanceName - ); - console.log(result); -} - -async function main() { - deletesASapMonitorProvider(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/providerInstancesGetSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/providerInstancesGetSample.js deleted file mode 100644 index 0885c72060af..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/providerInstancesGetSample.js +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/Db2ProviderInstances_Get.json - */ -async function getPropertiesOfADb2Provider() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.get( - resourceGroupName, - monitorName, - providerInstanceName - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/MsSqlServerProviderInstance_Get.json - */ -async function getPropertiesOfAMSSqlServerProvider() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.get( - resourceGroupName, - monitorName, - providerInstanceName - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/PrometheusOSProviderInstances_Get.json - */ -async function getPropertiesOfAOSProvider() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.get( - resourceGroupName, - monitorName, - providerInstanceName - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/PrometheusHaClusterProviderInstances_Get.json - */ -async function getPropertiesOfAPrometheusHaClusterProvider() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.get( - resourceGroupName, - monitorName, - providerInstanceName - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ProviderInstances_Get.json - */ -async function getPropertiesOfASapMonitorHanaProvider() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.get( - resourceGroupName, - monitorName, - providerInstanceName - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/NetWeaverProviderInstances_Get.json - */ -async function getPropertiesOfASapMonitorNetWeaverProvider() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.get( - resourceGroupName, - monitorName, - providerInstanceName - ); - console.log(result); -} - -async function main() { - getPropertiesOfADb2Provider(); - getPropertiesOfAMSSqlServerProvider(); - getPropertiesOfAOSProvider(); - getPropertiesOfAPrometheusHaClusterProvider(); - getPropertiesOfASapMonitorHanaProvider(); - getPropertiesOfASapMonitorNetWeaverProvider(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/providerInstancesListSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/providerInstancesListSample.js deleted file mode 100644 index 45d62a8d0d07..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/providerInstancesListSample.js +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of each provider instances. - * - * @summary Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of each provider instances. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ProviderInstances_List.json - */ -async function listAllSapMonitorsProvidersInASubscription() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.providerInstances.list(resourceGroupName, monitorName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAllSapMonitorsProvidersInASubscription(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/sample.env b/sdk/workloads/arm-workloads/samples/v1/javascript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/sapApplicationServerInstancesCreateSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/sapApplicationServerInstancesCreateSample.js deleted file mode 100644 index 93cc808f731d..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/sapApplicationServerInstancesCreateSample.js +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Puts the SAP Application Server Instance resource.

This will be used by service only. PUT by end user will return a Bad Request error. - * - * @summary Puts the SAP Application Server Instance resource.

This will be used by service only. PUT by end user will return a Bad Request error. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_Create_HA_AvSet.json - */ -async function createSapApplicationServerInstancesForHaSystemWithAvailabilitySet() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const applicationInstanceName = "app01"; - const body = { - location: "westcentralus", - tags: {}, - }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPApplicationServerInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - applicationInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Puts the SAP Application Server Instance resource.

This will be used by service only. PUT by end user will return a Bad Request error. - * - * @summary Puts the SAP Application Server Instance resource.

This will be used by service only. PUT by end user will return a Bad Request error. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_Create.json - */ -async function sapApplicationServerInstancesCreate() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const applicationInstanceName = "app01"; - const body = { - location: "westcentralus", - tags: {}, - }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPApplicationServerInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - applicationInstanceName, - options - ); - console.log(result); -} - -async function main() { - createSapApplicationServerInstancesForHaSystemWithAvailabilitySet(); - sapApplicationServerInstancesCreate(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/sapApplicationServerInstancesDeleteSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/sapApplicationServerInstancesDeleteSample.js deleted file mode 100644 index b8f1f1f2272b..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/sapApplicationServerInstancesDeleteSample.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deletes the SAP Application Server Instance resource.

This operation will be used by service only. Delete by end user will return a Bad Request error. - * - * @summary Deletes the SAP Application Server Instance resource.

This operation will be used by service only. Delete by end user will return a Bad Request error. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_Delete.json - */ -async function sapApplicationServerInstancesDelete() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const applicationInstanceName = "app01"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPApplicationServerInstances.beginDeleteAndWait( - resourceGroupName, - sapVirtualInstanceName, - applicationInstanceName - ); - console.log(result); -} - -async function main() { - sapApplicationServerInstancesDelete(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/sapApplicationServerInstancesGetSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/sapApplicationServerInstancesGetSample.js deleted file mode 100644 index e3063da83afa..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/sapApplicationServerInstancesGetSample.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. - * - * @summary Gets the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_Get.json - */ -async function sapApplicationServerInstancesGet() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const applicationInstanceName = "app01"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPApplicationServerInstances.get( - resourceGroupName, - sapVirtualInstanceName, - applicationInstanceName - ); - console.log(result); -} - -async function main() { - sapApplicationServerInstancesGet(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/sapApplicationServerInstancesListSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/sapApplicationServerInstancesListSample.js deleted file mode 100644 index b2b115cde1ef..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/sapApplicationServerInstancesListSample.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists the SAP Application Server Instance resources for a given Virtual Instance for SAP solutions resource. - * - * @summary Lists the SAP Application Server Instance resources for a given Virtual Instance for SAP solutions resource. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_List.json - */ -async function sapApplicationServerInstancesList() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.sAPApplicationServerInstances.list( - resourceGroupName, - sapVirtualInstanceName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - sapApplicationServerInstancesList(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/sapApplicationServerInstancesStartInstanceSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/sapApplicationServerInstancesStartInstanceSample.js deleted file mode 100644 index 57fa99b90bb2..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/sapApplicationServerInstancesStartInstanceSample.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Starts the SAP Application Server Instance. - * - * @summary Starts the SAP Application Server Instance. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_StartInstance.json - */ -async function startTheSapApplicationServerInstance() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const applicationInstanceName = "app01"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPApplicationServerInstances.beginStartInstanceAndWait( - resourceGroupName, - sapVirtualInstanceName, - applicationInstanceName - ); - console.log(result); -} - -async function main() { - startTheSapApplicationServerInstance(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/sapApplicationServerInstancesStopInstanceSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/sapApplicationServerInstancesStopInstanceSample.js deleted file mode 100644 index 632c145f0cf8..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/sapApplicationServerInstancesStopInstanceSample.js +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Stops the SAP Application Server Instance. - * - * @summary Stops the SAP Application Server Instance. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_StopInstance.json - */ -async function stopTheSapApplicationServerInstance() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const applicationInstanceName = "app01"; - const body = { softStopTimeoutSeconds: 0 }; - const options = { - body, - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPApplicationServerInstances.beginStopInstanceAndWait( - resourceGroupName, - sapVirtualInstanceName, - applicationInstanceName, - options - ); - console.log(result); -} - -async function main() { - stopTheSapApplicationServerInstance(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/sapApplicationServerInstancesUpdateSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/sapApplicationServerInstancesUpdateSample.js deleted file mode 100644 index 28da633dec26..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/sapApplicationServerInstancesUpdateSample.js +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Puts the SAP Application Server Instance resource. - * - * @summary Puts the SAP Application Server Instance resource. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_Update.json - */ -async function sapApplicationServerInstancesUpdate() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const applicationInstanceName = "app01"; - const body = { - tags: { tag1: "value1" }, - }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPApplicationServerInstances.beginUpdateAndWait( - resourceGroupName, - sapVirtualInstanceName, - applicationInstanceName, - options - ); - console.log(result); -} - -async function main() { - sapApplicationServerInstancesUpdate(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/sapAvailabilityZoneDetailsSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/sapAvailabilityZoneDetailsSample.js deleted file mode 100644 index 359d5384fae8..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/sapAvailabilityZoneDetailsSample.js +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get the recommended SAP Availability Zone Pair Details for your region. - * - * @summary Get the recommended SAP Availability Zone Pair Details for your region. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPAvailabilityZoneDetails_eastus.json - */ -async function sapAvailabilityZoneDetailsEastus() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const location = "centralus"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPAvailabilityZoneDetails(location); - console.log(result); -} - -/** - * This sample demonstrates how to Get the recommended SAP Availability Zone Pair Details for your region. - * - * @summary Get the recommended SAP Availability Zone Pair Details for your region. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPAvailabilityZoneDetails_northeurope.json - */ -async function sapAvailabilityZoneDetailsNortheurope() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const location = "centralus"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPAvailabilityZoneDetails(location); - console.log(result); -} - -async function main() { - sapAvailabilityZoneDetailsEastus(); - sapAvailabilityZoneDetailsNortheurope(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/sapCentralInstancesCreateSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/sapCentralInstancesCreateSample.js deleted file mode 100644 index dbc81b088d47..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/sapCentralInstancesCreateSample.js +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Creates the SAP Central Services Instance resource.

This will be used by service only. PUT operation on this resource by end user will return a Bad Request error. - * - * @summary Creates the SAP Central Services Instance resource.

This will be used by service only. PUT operation on this resource by end user will return a Bad Request error. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_Create_HA_AvSet.json - */ -async function createSapCentralInstancesForHaSystemWithAvailabilitySet() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const centralInstanceName = "centralServer"; - const body = { - location: "westcentralus", - tags: {}, - }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPCentralInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - centralInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates the SAP Central Services Instance resource.

This will be used by service only. PUT operation on this resource by end user will return a Bad Request error. - * - * @summary Creates the SAP Central Services Instance resource.

This will be used by service only. PUT operation on this resource by end user will return a Bad Request error. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_Create.json - */ -async function sapCentralInstancesCreate() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const centralInstanceName = "centralServer"; - const body = { - location: "westcentralus", - tags: {}, - }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPCentralInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - centralInstanceName, - options - ); - console.log(result); -} - -async function main() { - createSapCentralInstancesForHaSystemWithAvailabilitySet(); - sapCentralInstancesCreate(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/sapCentralInstancesDeleteSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/sapCentralInstancesDeleteSample.js deleted file mode 100644 index d7212af18856..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/sapCentralInstancesDeleteSample.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deletes the SAP Central Services Instance resource.

This will be used by service only. Delete operation on this resource by end user will return a Bad Request error. You can delete the parent resource, which is the Virtual Instance for SAP solutions resource, using the delete operation on it. - * - * @summary Deletes the SAP Central Services Instance resource.

This will be used by service only. Delete operation on this resource by end user will return a Bad Request error. You can delete the parent resource, which is the Virtual Instance for SAP solutions resource, using the delete operation on it. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_Delete.json - */ -async function sapCentralInstancesDelete() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const centralInstanceName = "centralServer"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPCentralInstances.beginDeleteAndWait( - resourceGroupName, - sapVirtualInstanceName, - centralInstanceName - ); - console.log(result); -} - -async function main() { - sapCentralInstancesDelete(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/sapCentralInstancesGetSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/sapCentralInstancesGetSample.js deleted file mode 100644 index 3ef70873f20d..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/sapCentralInstancesGetSample.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets the SAP Central Services Instance resource. - * - * @summary Gets the SAP Central Services Instance resource. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_Get.json - */ -async function sapCentralInstancesGet() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const centralInstanceName = "centralServer"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPCentralInstances.get( - resourceGroupName, - sapVirtualInstanceName, - centralInstanceName - ); - console.log(result); -} - -async function main() { - sapCentralInstancesGet(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/sapCentralInstancesListSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/sapCentralInstancesListSample.js deleted file mode 100644 index 1d7a7d671808..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/sapCentralInstancesListSample.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists the SAP Central Services Instance resource for the given Virtual Instance for SAP solutions resource. - * - * @summary Lists the SAP Central Services Instance resource for the given Virtual Instance for SAP solutions resource. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_List.json - */ -async function sapCentralInstancesList() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.sAPCentralInstances.list( - resourceGroupName, - sapVirtualInstanceName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - sapCentralInstancesList(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/sapCentralInstancesStartInstanceSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/sapCentralInstancesStartInstanceSample.js deleted file mode 100644 index 7b67e4c864be..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/sapCentralInstancesStartInstanceSample.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Starts the SAP Central Services Instance. - * - * @summary Starts the SAP Central Services Instance. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_StartInstance.json - */ -async function startTheSapCentralServicesInstance() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const centralInstanceName = "centralServer"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPCentralInstances.beginStartInstanceAndWait( - resourceGroupName, - sapVirtualInstanceName, - centralInstanceName - ); - console.log(result); -} - -async function main() { - startTheSapCentralServicesInstance(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/sapCentralInstancesStopInstanceSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/sapCentralInstancesStopInstanceSample.js deleted file mode 100644 index 979610843fe1..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/sapCentralInstancesStopInstanceSample.js +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Stops the SAP Central Services Instance. - * - * @summary Stops the SAP Central Services Instance. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_StopInstance.json - */ -async function stopTheSapCentralServicesInstance() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const centralInstanceName = "centralServer"; - const body = { softStopTimeoutSeconds: 1200 }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPCentralInstances.beginStopInstanceAndWait( - resourceGroupName, - sapVirtualInstanceName, - centralInstanceName, - options - ); - console.log(result); -} - -async function main() { - stopTheSapCentralServicesInstance(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/sapCentralInstancesUpdateSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/sapCentralInstancesUpdateSample.js deleted file mode 100644 index 2d5eb35388b4..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/sapCentralInstancesUpdateSample.js +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Updates the SAP Central Services Instance resource.

This can be used to update tags on the resource. - * - * @summary Updates the SAP Central Services Instance resource.

This can be used to update tags on the resource. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_Update.json - */ -async function sapCentralInstancesUpdate() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const centralInstanceName = "centralServer"; - const body = { tags: { tag1: "value1" } }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPCentralInstances.beginUpdateAndWait( - resourceGroupName, - sapVirtualInstanceName, - centralInstanceName, - options - ); - console.log(result); -} - -async function main() { - sapCentralInstancesUpdate(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/sapDatabaseInstancesCreateSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/sapDatabaseInstancesCreateSample.js deleted file mode 100644 index b9785818020e..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/sapDatabaseInstancesCreateSample.js +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource.

This will be used by service only. PUT by end user will return a Bad Request error. - * - * @summary Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource.

This will be used by service only. PUT by end user will return a Bad Request error. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_Create_HA_AvSet.json - */ -async function createSapDatabaseInstancesForHaSystemWithAvailabilitySet() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const databaseInstanceName = "databaseServer"; - const body = { location: "westcentralus", tags: {} }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPDatabaseInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - databaseInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource.

This will be used by service only. PUT by end user will return a Bad Request error. - * - * @summary Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource.

This will be used by service only. PUT by end user will return a Bad Request error. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_Create.json - */ -async function sapDatabaseInstancesCreate() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const databaseInstanceName = "databaseServer"; - const body = { location: "westcentralus", tags: {} }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPDatabaseInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - databaseInstanceName, - options - ); - console.log(result); -} - -async function main() { - createSapDatabaseInstancesForHaSystemWithAvailabilitySet(); - sapDatabaseInstancesCreate(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/sapDatabaseInstancesDeleteSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/sapDatabaseInstancesDeleteSample.js deleted file mode 100644 index 1fca7b02af08..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/sapDatabaseInstancesDeleteSample.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource.

This will be used by service only. Delete by end user will return a Bad Request error. - * - * @summary Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource.

This will be used by service only. Delete by end user will return a Bad Request error. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_Delete.json - */ -async function sapDatabaseInstancesDelete() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const databaseInstanceName = "databaseServer"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPDatabaseInstances.beginDeleteAndWait( - resourceGroupName, - sapVirtualInstanceName, - databaseInstanceName - ); - console.log(result); -} - -async function main() { - sapDatabaseInstancesDelete(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/sapDatabaseInstancesGetSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/sapDatabaseInstancesGetSample.js deleted file mode 100644 index 3a2d682f8b9e..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/sapDatabaseInstancesGetSample.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets the SAP Database Instance resource. - * - * @summary Gets the SAP Database Instance resource. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_Get.json - */ -async function sapDatabaseInstancesGet() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const databaseInstanceName = "databaseServer"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPDatabaseInstances.get( - resourceGroupName, - sapVirtualInstanceName, - databaseInstanceName - ); - console.log(result); -} - -async function main() { - sapDatabaseInstancesGet(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/sapDatabaseInstancesListSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/sapDatabaseInstancesListSample.js deleted file mode 100644 index 1870f12cff5d..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/sapDatabaseInstancesListSample.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists the Database resources associated with a Virtual Instance for SAP solutions resource. - * - * @summary Lists the Database resources associated with a Virtual Instance for SAP solutions resource. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_List.json - */ -async function sapDatabaseInstancesList() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.sAPDatabaseInstances.list( - resourceGroupName, - sapVirtualInstanceName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - sapDatabaseInstancesList(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/sapDatabaseInstancesStartInstanceSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/sapDatabaseInstancesStartInstanceSample.js deleted file mode 100644 index 9164eeca69ce..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/sapDatabaseInstancesStartInstanceSample.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Starts the database instance of the SAP system. - * - * @summary Starts the database instance of the SAP system. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_StartInstance.json - */ -async function startTheDatabaseInstanceOfTheSapSystem() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const databaseInstanceName = "db0"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPDatabaseInstances.beginStartInstanceAndWait( - resourceGroupName, - sapVirtualInstanceName, - databaseInstanceName - ); - console.log(result); -} - -async function main() { - startTheDatabaseInstanceOfTheSapSystem(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/sapDatabaseInstancesStopInstanceSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/sapDatabaseInstancesStopInstanceSample.js deleted file mode 100644 index 1e81df5aa2db..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/sapDatabaseInstancesStopInstanceSample.js +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Stops the database instance of the SAP system. - * - * @summary Stops the database instance of the SAP system. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_StopInstance.json - */ -async function stopTheDatabaseInstanceOfTheSapSystem() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const databaseInstanceName = "db0"; - const body = { softStopTimeoutSeconds: 0 }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPDatabaseInstances.beginStopInstanceAndWait( - resourceGroupName, - sapVirtualInstanceName, - databaseInstanceName, - options - ); - console.log(result); -} - -async function main() { - stopTheDatabaseInstanceOfTheSapSystem(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/sapDatabaseInstancesUpdateSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/sapDatabaseInstancesUpdateSample.js deleted file mode 100644 index 3884e25d6a29..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/sapDatabaseInstancesUpdateSample.js +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Updates the Database resource. - * - * @summary Updates the Database resource. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_Update.json - */ -async function sapDatabaseInstancesUpdate() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const databaseInstanceName = "databaseServer"; - const body = { tags: { key1: "value1" } }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPDatabaseInstances.beginUpdateAndWait( - resourceGroupName, - sapVirtualInstanceName, - databaseInstanceName, - options - ); - console.log(result); -} - -async function main() { - sapDatabaseInstancesUpdate(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/sapDiskConfigurationsSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/sapDiskConfigurationsSample.js deleted file mode 100644 index 255683ecf012..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/sapDiskConfigurationsSample.js +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get the SAP Disk Configuration Layout prod/non-prod SAP System. - * - * @summary Get the SAP Disk Configuration Layout prod/non-prod SAP System. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDiskConfigurations_NonProd.json - */ -async function sapDiskConfigurationsNonProd() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const location = "centralus"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPDiskConfigurations(location); - console.log(result); -} - -/** - * This sample demonstrates how to Get the SAP Disk Configuration Layout prod/non-prod SAP System. - * - * @summary Get the SAP Disk Configuration Layout prod/non-prod SAP System. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDiskConfigurations_Prod.json - */ -async function sapDiskConfigurationsProd() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const location = "centralus"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPDiskConfigurations(location); - console.log(result); -} - -async function main() { - sapDiskConfigurationsNonProd(); - sapDiskConfigurationsProd(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/sapLandscapeMonitorCreateSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/sapLandscapeMonitorCreateSample.js deleted file mode 100644 index 0c91364dfddb..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/sapLandscapeMonitorCreateSample.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Creates a SAP Landscape Monitor Dashboard for the specified subscription, resource group, and resource name. - * - * @summary Creates a SAP Landscape Monitor Dashboard for the specified subscription, resource group, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/SapLandscapeMonitor_Create.json - */ -async function createForSapLandscapeMonitorDashboard() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const sapLandscapeMonitorParameter = { - grouping: { - landscape: [{ name: "Prod", topSid: ["SID1", "SID2"] }], - sapApplication: [{ name: "ERP1", topSid: ["SID1", "SID2"] }], - }, - topMetricsThresholds: [{ name: "Instance Availability", green: 90, red: 50, yellow: 75 }], - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sapLandscapeMonitorOperations.create( - resourceGroupName, - monitorName, - sapLandscapeMonitorParameter - ); - console.log(result); -} - -async function main() { - createForSapLandscapeMonitorDashboard(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/sapLandscapeMonitorDeleteSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/sapLandscapeMonitorDeleteSample.js deleted file mode 100644 index 72272bad8ee2..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/sapLandscapeMonitorDeleteSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Deletes a SAP Landscape Monitor Dashboard with the specified subscription, resource group, and SAP monitor name. - * - * @summary Deletes a SAP Landscape Monitor Dashboard with the specified subscription, resource group, and SAP monitor name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/SapLandscapeMonitor_Delete.json - */ -async function deletesSapMonitor() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sapLandscapeMonitorOperations.delete(resourceGroupName, monitorName); - console.log(result); -} - -async function main() { - deletesSapMonitor(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/sapLandscapeMonitorGetSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/sapLandscapeMonitorGetSample.js deleted file mode 100644 index b8209226ddb1..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/sapLandscapeMonitorGetSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource group, and resource name. - * - * @summary Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource group, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/SapLandscapeMonitor_Get.json - */ -async function getPropertiesOfASapMonitor() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sapLandscapeMonitorOperations.get(resourceGroupName, monitorName); - console.log(result); -} - -async function main() { - getPropertiesOfASapMonitor(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/sapLandscapeMonitorListSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/sapLandscapeMonitorListSample.js deleted file mode 100644 index d357a5d5cfb3..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/sapLandscapeMonitorListSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource group, and resource name. - * - * @summary Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource group, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/SapLandscapeMonitor_List.json - */ -async function getPropertiesOfASapMonitor() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sapLandscapeMonitorOperations.list(resourceGroupName, monitorName); - console.log(result); -} - -async function main() { - getPropertiesOfASapMonitor(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/sapLandscapeMonitorUpdateSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/sapLandscapeMonitorUpdateSample.js deleted file mode 100644 index 1c1c5487c18e..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/sapLandscapeMonitorUpdateSample.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Patches the SAP Landscape Monitor Dashboard for the specified subscription, resource group, and SAP monitor name. - * - * @summary Patches the SAP Landscape Monitor Dashboard for the specified subscription, resource group, and SAP monitor name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/SapLandscapeMonitor_Update.json - */ -async function updateSapMonitor() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const sapLandscapeMonitorParameter = { - grouping: { - landscape: [{ name: "Prod", topSid: ["SID1", "SID2"] }], - sapApplication: [{ name: "ERP1", topSid: ["SID1", "SID2"] }], - }, - topMetricsThresholds: [{ name: "Instance Availability", green: 90, red: 50, yellow: 75 }], - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sapLandscapeMonitorOperations.update( - resourceGroupName, - monitorName, - sapLandscapeMonitorParameter - ); - console.log(result); -} - -async function main() { - updateSapMonitor(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/sapSizingRecommendationsSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/sapSizingRecommendationsSample.js deleted file mode 100644 index a9b3a63296da..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/sapSizingRecommendationsSample.js +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get SAP sizing recommendations by providing input SAPS for application tier and memory required for database tier - * - * @summary Get SAP sizing recommendations by providing input SAPS for application tier and memory required for database tier - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPSizingRecommendations_S4HANA_Distributed.json - */ -async function sapSizingRecommendationsS4HanaDistributed() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const location = "centralus"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPSizingRecommendations(location); - console.log(result); -} - -/** - * This sample demonstrates how to Get SAP sizing recommendations by providing input SAPS for application tier and memory required for database tier - * - * @summary Get SAP sizing recommendations by providing input SAPS for application tier and memory required for database tier - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPSizingRecommendations_S4HANA_HA_AvSet.json - */ -async function sapSizingRecommendationsS4HanaDistributedHaAvSet() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const location = "centralus"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPSizingRecommendations(location); - console.log(result); -} - -/** - * This sample demonstrates how to Get SAP sizing recommendations by providing input SAPS for application tier and memory required for database tier - * - * @summary Get SAP sizing recommendations by providing input SAPS for application tier and memory required for database tier - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPSizingRecommendations_S4HANA_HA_AvZone.json - */ -async function sapSizingRecommendationsS4HanaDistributedHaAvZone() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const location = "centralus"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPSizingRecommendations(location); - console.log(result); -} - -/** - * This sample demonstrates how to Get SAP sizing recommendations by providing input SAPS for application tier and memory required for database tier - * - * @summary Get SAP sizing recommendations by providing input SAPS for application tier and memory required for database tier - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPSizingRecommendations_S4HANA_SingleServer.json - */ -async function sapSizingRecommendationsS4HanaSingleServer() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const location = "centralus"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPSizingRecommendations(location); - console.log(result); -} - -async function main() { - sapSizingRecommendationsS4HanaDistributed(); - sapSizingRecommendationsS4HanaDistributedHaAvSet(); - sapSizingRecommendationsS4HanaDistributedHaAvZone(); - sapSizingRecommendationsS4HanaSingleServer(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/sapSupportedSkuSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/sapSupportedSkuSample.js deleted file mode 100644 index d97c072f36f6..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/sapSupportedSkuSample.js +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get a list of SAP supported SKUs for ASCS, Application and Database tier. - * - * @summary Get a list of SAP supported SKUs for ASCS, Application and Database tier. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPSupportedSkus_Distributed.json - */ -async function sapSupportedSkusDistributed() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const location = "centralus"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPSupportedSku(location); - console.log(result); -} - -/** - * This sample demonstrates how to Get a list of SAP supported SKUs for ASCS, Application and Database tier. - * - * @summary Get a list of SAP supported SKUs for ASCS, Application and Database tier. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPSupportedSkus_DistributedHA_AvSet.json - */ -async function sapSupportedSkusDistributedHaAvSet() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const location = "centralus"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPSupportedSku(location); - console.log(result); -} - -/** - * This sample demonstrates how to Get a list of SAP supported SKUs for ASCS, Application and Database tier. - * - * @summary Get a list of SAP supported SKUs for ASCS, Application and Database tier. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPSupportedSkus_DistributedHA_AvZone.json - */ -async function sapSupportedSkusDistributedHaAvZone() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const location = "centralus"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPSupportedSku(location); - console.log(result); -} - -/** - * This sample demonstrates how to Get a list of SAP supported SKUs for ASCS, Application and Database tier. - * - * @summary Get a list of SAP supported SKUs for ASCS, Application and Database tier. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPSupportedSkus_SingleServer.json - */ -async function sapSupportedSkusSingleServer() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const location = "centralus"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPSupportedSku(location); - console.log(result); -} - -async function main() { - sapSupportedSkusDistributed(); - sapSupportedSkusDistributedHaAvSet(); - sapSupportedSkusDistributedHaAvZone(); - sapSupportedSkusSingleServer(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/sapVirtualInstancesCreateSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/sapVirtualInstancesCreateSample.js deleted file mode 100644 index bd8938a5ef84..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/sapVirtualInstancesCreateSample.js +++ /dev/null @@ -1,2829 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_CustomFullResourceNames_Distributed.json - */ -async function createInfrastructureWithOSConfigurationWithCustomResourceNamesForDistributedSystem() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 6, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" }, - }, - }, - vmSize: "Standard_E32ds_v4", - }, - }, - centralServer: { - instanceCount: 1, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" }, - }, - }, - vmSize: "Standard_E16ds_v4", - }, - }, - customResourceNames: { - applicationServer: { - availabilitySetName: "appAvSet", - virtualMachines: [ - { - dataDiskNames: { default: ["app0disk0"] }, - hostName: "apphostName0", - networkInterfaces: [{ networkInterfaceName: "appnic0" }], - osDiskName: "app0osdisk", - vmName: "appvm0", - }, - { - dataDiskNames: { default: ["app1disk0"] }, - hostName: "apphostName1", - networkInterfaces: [{ networkInterfaceName: "appnic1" }], - osDiskName: "app1osdisk", - vmName: "appvm1", - }, - ], - }, - centralServer: { - virtualMachines: [ - { - dataDiskNames: { default: ["ascsdisk0"] }, - hostName: "ascshostName", - networkInterfaces: [{ networkInterfaceName: "ascsnic" }], - osDiskName: "ascsosdisk", - vmName: "ascsvm", - }, - ], - }, - databaseServer: { - virtualMachines: [ - { - dataDiskNames: { - hanaData: ["hanadata0", "hanadata1"], - hanaLog: ["hanalog0", "hanalog1", "hanalog2"], - hanaShared: ["hanashared0", "hanashared1"], - usrSap: ["usrsap0"], - }, - hostName: "dbhostName", - networkInterfaces: [{ networkInterfaceName: "dbnic" }], - osDiskName: "dbosdisk", - vmName: "dbvm", - }, - ], - }, - namingPatternType: "FullResourceName", - sharedStorage: { - sharedStorageAccountName: "storageacc", - sharedStorageAccountPrivateEndPointName: "peForxNFS", - }, - }, - databaseServer: { - databaseType: "HANA", - instanceCount: 1, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" }, - }, - }, - vmSize: "Standard_M32ts", - }, - }, - deploymentType: "ThreeTier", - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" }, - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {}, - }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_CustomFullResourceNames_HA_AvSet.json - */ -async function createInfrastructureWithOSConfigurationWithCustomResourceNamesForHaSystemWithAvailabilitySet() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 6, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" }, - }, - }, - vmSize: "Standard_E32ds_v4", - }, - }, - centralServer: { - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" }, - }, - }, - vmSize: "Standard_E16ds_v4", - }, - }, - customResourceNames: { - applicationServer: { - availabilitySetName: "appAvSet", - virtualMachines: [ - { - dataDiskNames: { default: ["app0disk0"] }, - hostName: "apphostName0", - networkInterfaces: [{ networkInterfaceName: "appnic0" }], - osDiskName: "app0osdisk", - vmName: "appvm0", - }, - { - dataDiskNames: { default: ["app1disk0"] }, - hostName: "apphostName1", - networkInterfaces: [{ networkInterfaceName: "appnic1" }], - osDiskName: "app1osdisk", - vmName: "appvm1", - }, - ], - }, - centralServer: { - availabilitySetName: "csAvSet", - loadBalancer: { - backendPoolNames: ["ascsBackendPool"], - frontendIpConfigurationNames: ["ascsip0", "ersip0"], - healthProbeNames: ["ascsHealthProbe", "ersHealthProbe"], - loadBalancerName: "ascslb", - }, - virtualMachines: [ - { - hostName: "ascshostName", - networkInterfaces: [{ networkInterfaceName: "ascsnic" }], - osDiskName: "ascsosdisk", - vmName: "ascsvm", - }, - { - hostName: "ershostName", - networkInterfaces: [{ networkInterfaceName: "ersnic" }], - osDiskName: "ersosdisk", - vmName: "ersvm", - }, - ], - }, - databaseServer: { - availabilitySetName: "dbAvSet", - loadBalancer: { - backendPoolNames: ["dbBackendPool"], - frontendIpConfigurationNames: ["dbip"], - healthProbeNames: ["dbHealthProbe"], - loadBalancerName: "dblb", - }, - virtualMachines: [ - { - dataDiskNames: { - hanaData: ["hanadatapr0", "hanadatapr1"], - hanaLog: ["hanalogpr0", "hanalogpr1", "hanalogpr2"], - hanaShared: ["hanasharedpr0", "hanasharedpr1"], - usrSap: ["usrsappr0"], - }, - hostName: "dbprhostName", - networkInterfaces: [{ networkInterfaceName: "dbprnic" }], - osDiskName: "dbprosdisk", - vmName: "dbvmpr", - }, - { - dataDiskNames: { - hanaData: ["hanadatasr0", "hanadatasr1"], - hanaLog: ["hanalogsr0", "hanalogsr1", "hanalogsr2"], - hanaShared: ["hanasharedsr0", "hanasharedsr1"], - usrSap: ["usrsapsr0"], - }, - hostName: "dbsrhostName", - networkInterfaces: [{ networkInterfaceName: "dbsrnic" }], - osDiskName: "dbsrosdisk", - vmName: "dbvmsr", - }, - ], - }, - namingPatternType: "FullResourceName", - sharedStorage: { - sharedStorageAccountName: "storageacc", - sharedStorageAccountPrivateEndPointName: "peForxNFS", - }, - }, - databaseServer: { - databaseType: "HANA", - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" }, - }, - }, - vmSize: "Standard_M32ts", - }, - }, - deploymentType: "ThreeTier", - highAvailabilityConfig: { highAvailabilityType: "AvailabilitySet" }, - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" }, - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {}, - }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_CustomFullResourceNames_HA_AvZone.json - */ -async function createInfrastructureWithOSConfigurationWithCustomResourceNamesForHaSystemWithAvailabilityZone() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 6, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" }, - }, - }, - vmSize: "Standard_E32ds_v4", - }, - }, - centralServer: { - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" }, - }, - }, - vmSize: "Standard_E16ds_v4", - }, - }, - customResourceNames: { - applicationServer: { - virtualMachines: [ - { - dataDiskNames: { default: ["app0disk0"] }, - hostName: "apphostName0", - networkInterfaces: [{ networkInterfaceName: "appnic0" }], - osDiskName: "app0osdisk", - vmName: "appvm0", - }, - { - dataDiskNames: { default: ["app1disk0"] }, - hostName: "apphostName1", - networkInterfaces: [{ networkInterfaceName: "appnic1" }], - osDiskName: "app1osdisk", - vmName: "appvm1", - }, - ], - }, - centralServer: { - loadBalancer: { - backendPoolNames: ["ascsBackendPool"], - frontendIpConfigurationNames: ["ascsip0", "ersip0"], - healthProbeNames: ["ascsHealthProbe", "ersHealthProbe"], - loadBalancerName: "ascslb", - }, - virtualMachines: [ - { - hostName: "ascshostName", - networkInterfaces: [{ networkInterfaceName: "ascsnic" }], - osDiskName: "ascsosdisk", - vmName: "ascsvm", - }, - { - hostName: "ershostName", - networkInterfaces: [{ networkInterfaceName: "ersnic" }], - osDiskName: "ersosdisk", - vmName: "ersvm", - }, - ], - }, - databaseServer: { - loadBalancer: { - backendPoolNames: ["dbBackendPool"], - frontendIpConfigurationNames: ["dbip"], - healthProbeNames: ["dbHealthProbe"], - loadBalancerName: "dblb", - }, - virtualMachines: [ - { - dataDiskNames: { - hanaData: ["hanadatapr0", "hanadatapr1"], - hanaLog: ["hanalogpr0", "hanalogpr1", "hanalogpr2"], - hanaShared: ["hanasharedpr0", "hanasharedpr1"], - usrSap: ["usrsappr0"], - }, - hostName: "dbprhostName", - networkInterfaces: [{ networkInterfaceName: "dbprnic" }], - osDiskName: "dbprosdisk", - vmName: "dbvmpr", - }, - { - dataDiskNames: { - hanaData: ["hanadatasr0", "hanadatasr1"], - hanaLog: ["hanalogsr0", "hanalogsr1", "hanalogsr2"], - hanaShared: ["hanasharedsr0", "hanasharedsr1"], - usrSap: ["usrsapsr0"], - }, - hostName: "dbsrhostName", - networkInterfaces: [{ networkInterfaceName: "dbsrnic" }], - osDiskName: "dbsrosdisk", - vmName: "dbvmsr", - }, - ], - }, - namingPatternType: "FullResourceName", - sharedStorage: { - sharedStorageAccountName: "storageacc", - sharedStorageAccountPrivateEndPointName: "peForxNFS", - }, - }, - databaseServer: { - databaseType: "HANA", - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" }, - }, - }, - vmSize: "Standard_M32ts", - }, - }, - deploymentType: "ThreeTier", - highAvailabilityConfig: { highAvailabilityType: "AvailabilityZone" }, - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" }, - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {}, - }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_CustomFullResourceNames_SingleServer.json - */ -async function createInfrastructureWithOSConfigurationWithCustomResourceNamesForSingleServerSystem() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - databaseType: "HANA", - deploymentType: "SingleServer", - networkConfiguration: { isSecondaryIpEnabled: true }, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" }, - }, - }, - vmSize: "Standard_E32ds_v4", - }, - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" }, - }, - environment: "NonProd", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {}, - }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_Distributed.json - */ -async function createInfrastructureOnlyForDistributedSystem() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body = { - configuration: { - appLocation: "eastus", - configurationType: "Deployment", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 6, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - ssh: { publicKeys: [{ keyData: "ssh-rsa public key" }] }, - }, - }, - vmSize: "Standard_E32ds_v4", - }, - }, - centralServer: { - instanceCount: 1, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - ssh: { publicKeys: [{ keyData: "ssh-rsa public key" }] }, - }, - }, - vmSize: "Standard_E16ds_v4", - }, - }, - databaseServer: { - databaseType: "HANA", - instanceCount: 1, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - ssh: { publicKeys: [{ keyData: "ssh-rsa public key" }] }, - }, - }, - vmSize: "Standard_M32ts", - }, - }, - deploymentType: "ThreeTier", - }, - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {}, - }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_HA_AvSet.json - */ -async function createInfrastructureOnlyForHaSystemWithAvailabilitySet() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body = { - configuration: { - appLocation: "eastus", - configurationType: "Deployment", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 5, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - ssh: { publicKeys: [{ keyData: "ssh-rsa public key" }] }, - }, - }, - vmSize: "Standard_E32ds_v4", - }, - }, - centralServer: { - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - ssh: { publicKeys: [{ keyData: "ssh-rsa public key" }] }, - }, - }, - vmSize: "Standard_E16ds_v4", - }, - }, - databaseServer: { - databaseType: "HANA", - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - ssh: { publicKeys: [{ keyData: "ssh-rsa public key" }] }, - }, - }, - vmSize: "Standard_M32ts", - }, - }, - deploymentType: "ThreeTier", - highAvailabilityConfig: { highAvailabilityType: "AvailabilitySet" }, - }, - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {}, - }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_HA_AvZone.json - */ -async function createInfrastructureOnlyForHaSystemWithAvailabilityZone() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body = { - configuration: { - appLocation: "eastus", - configurationType: "Deployment", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 6, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - ssh: { publicKeys: [{ keyData: "ssh-rsa public key" }] }, - }, - }, - vmSize: "Standard_E32ds_v4", - }, - }, - centralServer: { - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - ssh: { publicKeys: [{ keyData: "ssh-rsa public key" }] }, - }, - }, - vmSize: "Standard_E16ds_v4", - }, - }, - databaseServer: { - databaseType: "HANA", - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - ssh: { publicKeys: [{ keyData: "ssh-rsa public key" }] }, - }, - }, - vmSize: "Standard_M32ts", - }, - }, - deploymentType: "ThreeTier", - highAvailabilityConfig: { highAvailabilityType: "AvailabilityZone" }, - }, - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {}, - }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_SingleServer.json - */ -async function createInfrastructureOnlyForSingleServerSystem() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body = { - configuration: { - appLocation: "eastus", - configurationType: "Deployment", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - databaseType: "HANA", - deploymentType: "SingleServer", - networkConfiguration: { isSecondaryIpEnabled: true }, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - ssh: { publicKeys: [{ keyData: "ssh-rsa public key" }] }, - }, - }, - vmSize: "Standard_E32ds_v4", - }, - }, - }, - environment: "NonProd", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {}, - }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_DiskDetails_Distributed.json - */ -async function createInfrastructureWithDiskAndOSConfigurationForDistributedSystemRecommended() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 6, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" }, - }, - }, - vmSize: "Standard_E32ds_v4", - }, - }, - centralServer: { - instanceCount: 1, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" }, - }, - }, - vmSize: "Standard_E16ds_v4", - }, - }, - databaseServer: { - databaseType: "HANA", - diskConfiguration: { - diskVolumeConfigurations: { - backup: { - count: 2, - sizeGB: 256, - sku: { name: "StandardSSD_LRS" }, - }, - "hana/data": { - count: 4, - sizeGB: 128, - sku: { name: "Premium_LRS" }, - }, - "hana/log": { - count: 3, - sizeGB: 128, - sku: { name: "Premium_LRS" }, - }, - "hana/shared": { - count: 1, - sizeGB: 256, - sku: { name: "StandardSSD_LRS" }, - }, - os: { count: 1, sizeGB: 64, sku: { name: "StandardSSD_LRS" } }, - "usr/sap": { count: 1, sizeGB: 128, sku: { name: "Premium_LRS" } }, - }, - }, - instanceCount: 1, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" }, - }, - }, - vmSize: "Standard_M32ts", - }, - }, - deploymentType: "ThreeTier", - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" }, - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {}, - }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_DiskDetails_HA_AvSet.json - */ -async function createInfrastructureWithDiskAndOSConfigurationForHaSystemWithAvailabilitySetRecommended() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 6, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" }, - }, - }, - vmSize: "Standard_E32ds_v4", - }, - }, - centralServer: { - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" }, - }, - }, - vmSize: "Standard_E16ds_v4", - }, - }, - databaseServer: { - databaseType: "HANA", - diskConfiguration: { - diskVolumeConfigurations: { - backup: { - count: 2, - sizeGB: 256, - sku: { name: "StandardSSD_LRS" }, - }, - "hana/data": { - count: 4, - sizeGB: 128, - sku: { name: "Premium_LRS" }, - }, - "hana/log": { - count: 3, - sizeGB: 128, - sku: { name: "Premium_LRS" }, - }, - "hana/shared": { - count: 1, - sizeGB: 256, - sku: { name: "StandardSSD_LRS" }, - }, - os: { count: 1, sizeGB: 64, sku: { name: "StandardSSD_LRS" } }, - "usr/sap": { count: 1, sizeGB: 128, sku: { name: "Premium_LRS" } }, - }, - }, - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" }, - }, - }, - vmSize: "Standard_M32ts", - }, - }, - deploymentType: "ThreeTier", - highAvailabilityConfig: { highAvailabilityType: "AvailabilitySet" }, - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" }, - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {}, - }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_DiskDetails_HA_AvZone.json - */ -async function createInfrastructureWithDiskAndOSConfigurationForHaSystemWithAvailabilityZoneRecommended() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 6, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" }, - }, - }, - vmSize: "Standard_E32ds_v4", - }, - }, - centralServer: { - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" }, - }, - }, - vmSize: "Standard_E16ds_v4", - }, - }, - databaseServer: { - databaseType: "HANA", - diskConfiguration: { - diskVolumeConfigurations: { - backup: { - count: 2, - sizeGB: 256, - sku: { name: "StandardSSD_LRS" }, - }, - "hana/data": { - count: 4, - sizeGB: 128, - sku: { name: "Premium_LRS" }, - }, - "hana/log": { - count: 3, - sizeGB: 128, - sku: { name: "Premium_LRS" }, - }, - "hana/shared": { - count: 1, - sizeGB: 256, - sku: { name: "StandardSSD_LRS" }, - }, - os: { count: 1, sizeGB: 64, sku: { name: "StandardSSD_LRS" } }, - "usr/sap": { count: 1, sizeGB: 128, sku: { name: "Premium_LRS" } }, - }, - }, - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" }, - }, - }, - vmSize: "Standard_M32ts", - }, - }, - deploymentType: "ThreeTier", - highAvailabilityConfig: { highAvailabilityType: "AvailabilityZone" }, - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" }, - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {}, - }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_DiskDetails_SingleServer.json - */ -async function createInfrastructureWithDiskAndOSConfigurationsForSingleServerSystemRecommended() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - databaseType: "HANA", - dbDiskConfiguration: { - diskVolumeConfigurations: { - backup: { count: 2, sizeGB: 256, sku: { name: "StandardSSD_LRS" } }, - "hana/data": { - count: 4, - sizeGB: 128, - sku: { name: "Premium_LRS" }, - }, - "hana/log": { count: 3, sizeGB: 128, sku: { name: "Premium_LRS" } }, - "hana/shared": { - count: 1, - sizeGB: 256, - sku: { name: "StandardSSD_LRS" }, - }, - os: { count: 1, sizeGB: 64, sku: { name: "StandardSSD_LRS" } }, - "usr/sap": { count: 1, sizeGB: 128, sku: { name: "Premium_LRS" } }, - }, - }, - deploymentType: "SingleServer", - networkConfiguration: { isSecondaryIpEnabled: true }, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" }, - }, - }, - vmSize: "Standard_E32ds_v4", - }, - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" }, - }, - environment: "NonProd", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {}, - }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_Distributed.json - */ -async function createInfrastructureWithOSConfigurationForDistributedSystemRecommended() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 6, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" }, - }, - }, - vmSize: "Standard_E32ds_v4", - }, - }, - centralServer: { - instanceCount: 1, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" }, - }, - }, - vmSize: "Standard_E16ds_v4", - }, - }, - databaseServer: { - databaseType: "HANA", - instanceCount: 1, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" }, - }, - }, - vmSize: "Standard_M32ts", - }, - }, - deploymentType: "ThreeTier", - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" }, - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {}, - }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_HA_AvSet.json - */ -async function createInfrastructureWithOSConfigurationForHaSystemWithAvailabilitySetRecommended() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 6, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" }, - }, - }, - vmSize: "Standard_E32ds_v4", - }, - }, - centralServer: { - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" }, - }, - }, - vmSize: "Standard_E16ds_v4", - }, - }, - databaseServer: { - databaseType: "HANA", - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" }, - }, - }, - vmSize: "Standard_M32ts", - }, - }, - deploymentType: "ThreeTier", - highAvailabilityConfig: { highAvailabilityType: "AvailabilitySet" }, - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" }, - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {}, - }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_HA_AvZone.json - */ -async function createInfrastructureWithOSConfigurationForHaSystemWithAvailabilityZoneRecommended() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 6, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" }, - }, - }, - vmSize: "Standard_E32ds_v4", - }, - }, - centralServer: { - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" }, - }, - }, - vmSize: "Standard_E16ds_v4", - }, - }, - databaseServer: { - databaseType: "HANA", - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" }, - }, - }, - vmSize: "Standard_M32ts", - }, - }, - deploymentType: "ThreeTier", - highAvailabilityConfig: { highAvailabilityType: "AvailabilityZone" }, - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" }, - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {}, - }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_SingleServer.json - */ -async function createInfrastructureWithOSConfigurationForSingleServerSystemRecommended() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - databaseType: "HANA", - deploymentType: "SingleServer", - networkConfiguration: { isSecondaryIpEnabled: true }, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" }, - }, - }, - vmSize: "Standard_E32ds_v4", - }, - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" }, - }, - environment: "NonProd", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {}, - }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_Distributed_CreateTransport.json - */ -async function createInfrastructureWithANewSapTransportDirectoryFileshare() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 6, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" }, - }, - }, - vmSize: "Standard_E32ds_v4", - }, - }, - centralServer: { - instanceCount: 1, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" }, - }, - }, - vmSize: "Standard_E16ds_v4", - }, - }, - databaseServer: { - databaseType: "HANA", - instanceCount: 1, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" }, - }, - }, - vmSize: "Standard_M32ts", - }, - }, - deploymentType: "ThreeTier", - storageConfiguration: { - transportFileShareConfiguration: { - configurationType: "CreateAndMount", - resourceGroup: "rgName", - storageAccountName: "storageName", - }, - }, - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" }, - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {}, - }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_Distributed_MountTransport.json - */ -async function createInfrastructureWithAnExistingSapTransportDirectoryFileshare() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 6, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" }, - }, - }, - vmSize: "Standard_E32ds_v4", - }, - }, - centralServer: { - instanceCount: 1, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" }, - }, - }, - vmSize: "Standard_E16ds_v4", - }, - }, - databaseServer: { - databaseType: "HANA", - instanceCount: 1, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" }, - }, - }, - vmSize: "Standard_M32ts", - }, - }, - deploymentType: "ThreeTier", - storageConfiguration: { - transportFileShareConfiguration: { - configurationType: "Mount", - id: "/subscriptions/49d64d54-e888-4c46-a868-1936802b762c/resourceGroups/testrg/providers/Microsoft.Network/privateEndpoints/endpoint", - privateEndpointId: - "/subscriptions/49d64d54-e888-4c46-a868-1936802b762c/resourceGroups/testrg/providers/Microsoft.Network/privateEndpoints/endpoint", - }, - }, - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" }, - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {}, - }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_Distributed_SkipTransport.json - */ -async function createInfrastructureWithoutASapTransportDirectoryFileshare() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 6, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" }, - }, - }, - vmSize: "Standard_E32ds_v4", - }, - }, - centralServer: { - instanceCount: 1, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" }, - }, - }, - vmSize: "Standard_E16ds_v4", - }, - }, - databaseServer: { - databaseType: "HANA", - instanceCount: 1, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" }, - }, - }, - vmSize: "Standard_M32ts", - }, - }, - deploymentType: "ThreeTier", - storageConfiguration: { - transportFileShareConfiguration: { configurationType: "Skip" }, - }, - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" }, - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {}, - }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_DetectInstallation_Distributed.json - */ -async function detectSapSoftwareInstallationOnADistributedSystem() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "{{resourcegrp}}", - applicationServer: { - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP-HA", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "azureuser", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { - privateKey: "{{privateKey}}", - publicKey: "{{sshkey}}", - }, - }, - }, - vmSize: "Standard_E4ds_v4", - }, - }, - centralServer: { - instanceCount: 1, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP-HA", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "azureuser", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { - privateKey: "{{privateKey}}", - publicKey: "{{sshkey}}", - }, - }, - }, - vmSize: "Standard_E4ds_v4", - }, - }, - databaseServer: { - instanceCount: 1, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP-HA", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "azureuser", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { - privateKey: "{{privateKey}}", - publicKey: "{{sshkey}}", - }, - }, - }, - vmSize: "Standard_M32ts", - }, - }, - deploymentType: "ThreeTier", - networkConfiguration: { isSecondaryIpEnabled: true }, - }, - osSapConfiguration: { sapFqdn: "sap.bpaas.com" }, - softwareConfiguration: { - centralServerVmId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0", - softwareInstallationType: "External", - }, - }, - environment: "Prod", - location: "eastus2", - sapProduct: "S4HANA", - tags: { createdBy: "azureuser" }, - }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_DetectInstallation_SingleServer.json - */ -async function detectSapSoftwareInstallationOnASingleServerSystem() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - databaseType: "HANA", - deploymentType: "SingleServer", - networkConfiguration: { isSecondaryIpEnabled: true }, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP-HA", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" }, - }, - }, - vmSize: "Standard_E32ds_v4", - }, - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" }, - softwareConfiguration: { - centralServerVmId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0", - softwareInstallationType: "External", - }, - }, - environment: "NonProd", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {}, - }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_DetectInstallation_HA_AvSet.json - */ -async function detectSapSoftwareInstallationOnAnHaSystemWithAvailabilitySet() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 6, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP-HA", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" }, - }, - }, - vmSize: "Standard_E32ds_v4", - }, - }, - centralServer: { - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP-HA", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" }, - }, - }, - vmSize: "Standard_E16ds_v4", - }, - }, - databaseServer: { - databaseType: "HANA", - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP-HA", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" }, - }, - }, - vmSize: "Standard_M32ts", - }, - }, - deploymentType: "ThreeTier", - highAvailabilityConfig: { highAvailabilityType: "AvailabilitySet" }, - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" }, - softwareConfiguration: { - centralServerVmId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0", - softwareInstallationType: "External", - }, - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {}, - }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_DetectInstallation_HA_AvZone.json - */ -async function detectSapSoftwareInstallationOnAnHaSystemWithAvailabilityZone() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 6, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP-HA", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" }, - }, - }, - vmSize: "Standard_E32ds_v4", - }, - }, - centralServer: { - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP-HA", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" }, - }, - }, - vmSize: "Standard_E16ds_v4", - }, - }, - databaseServer: { - databaseType: "HANA", - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP-HA", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest", - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" }, - }, - }, - vmSize: "Standard_M32ts", - }, - }, - deploymentType: "ThreeTier", - highAvailabilityConfig: { highAvailabilityType: "AvailabilityZone" }, - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" }, - softwareConfiguration: { - centralServerVmId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0", - softwareInstallationType: "External", - }, - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {}, - }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Install_Distributed.json - */ -async function installSapSoftwareOnDistributedSystem() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "{{resourcegrp}}", - applicationServer: { - instanceCount: 2, - subnetId: - "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP-HA", - publisher: "RedHat", - sku: "8.2", - version: "8.2.2021091201", - }, - osProfile: { - adminUsername: "azureuser", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { - privateKey: "{{privateKey}}", - publicKey: "{{sshkey}}", - }, - }, - }, - vmSize: "Standard_E4ds_v4", - }, - }, - centralServer: { - instanceCount: 1, - subnetId: - "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP-HA", - publisher: "RedHat", - sku: "8.2", - version: "8.2.2021091201", - }, - osProfile: { - adminUsername: "azureuser", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { - privateKey: "{{privateKey}}", - publicKey: "{{sshkey}}", - }, - }, - }, - vmSize: "Standard_E4ds_v4", - }, - }, - databaseServer: { - instanceCount: 1, - subnetId: - "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP-HA", - publisher: "RedHat", - sku: "8.2", - version: "8.2.2021091201", - }, - osProfile: { - adminUsername: "azureuser", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { - privateKey: "{{privateKey}}", - publicKey: "{{sshkey}}", - }, - }, - }, - vmSize: "Standard_M32ts", - }, - }, - deploymentType: "ThreeTier", - networkConfiguration: { isSecondaryIpEnabled: true }, - }, - osSapConfiguration: { sapFqdn: "sap.bpaas.com" }, - softwareConfiguration: { - bomUrl: - "https://teststorageaccount.blob.core.windows.net/sapbits/sapfiles/boms/S41909SPS03_v0011ms/S41909SPS03_v0011ms.yaml", - sapBitsStorageAccountId: - "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Storage/storageAccounts/teststorageaccount", - softwareInstallationType: "SAPInstallWithoutOSConfig", - softwareVersion: "SAP S/4HANA 1909 SPS 03", - }, - }, - environment: "Prod", - location: "eastus2", - sapProduct: "S4HANA", - tags: { createdBy: "azureuser" }, - }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Install_SingleServer.json - */ -async function installSapSoftwareOnSingleServerSystem() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "test-rg", - deploymentType: "SingleServer", - subnetId: - "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/testsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "SLES-SAP", - publisher: "SUSE", - sku: "12-sp4-gen2", - version: "2022.02.01", - }, - osProfile: { - adminUsername: "azureappadmin", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { - privateKey: "{{privateKey}}", - publicKey: "{{sshkey}}", - }, - }, - }, - vmSize: "Standard_E32ds_v4", - }, - }, - osSapConfiguration: { sapFqdn: "sap.bpaas.com" }, - softwareConfiguration: { - bomUrl: - "https://teststorageaccount.blob.core.windows.net/sapbits/sapfiles/boms/S41909SPS03_v0011ms/S41909SPS03_v0011ms.yaml", - sapBitsStorageAccountId: - "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Storage/storageAccounts/teststorageaccount", - softwareInstallationType: "SAPInstallWithoutOSConfig", - softwareVersion: "SAP S/4HANA 1909 SPS 03", - }, - }, - environment: "NonProd", - location: "eastus2", - sapProduct: "S4HANA", - tags: {}, - }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_Discover_CustomMrgStorageAccountName.json - */ -async function registerExistingSapSystemAsVirtualInstanceForSapSolutionsWithOptionalCustomizations() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body = { - configuration: { - centralServerVmId: - "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0", - configurationType: "Discovery", - managedRgStorageAccountName: "q20saacssgrs", - }, - environment: "NonProd", - location: "northeurope", - sapProduct: "S4HANA", - tags: { createdby: "abc@microsoft.com", test: "abc" }, - }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_Discover.json - */ -async function registerExistingSapSystemAsVirtualInstanceForSapSolutions() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body = { - configuration: { - centralServerVmId: - "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0", - configurationType: "Discovery", - }, - environment: "NonProd", - location: "northeurope", - sapProduct: "S4HANA", - tags: { createdby: "abc@microsoft.com", test: "abc" }, - }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -async function main() { - createInfrastructureWithOSConfigurationWithCustomResourceNamesForDistributedSystem(); - createInfrastructureWithOSConfigurationWithCustomResourceNamesForHaSystemWithAvailabilitySet(); - createInfrastructureWithOSConfigurationWithCustomResourceNamesForHaSystemWithAvailabilityZone(); - createInfrastructureWithOSConfigurationWithCustomResourceNamesForSingleServerSystem(); - createInfrastructureOnlyForDistributedSystem(); - createInfrastructureOnlyForHaSystemWithAvailabilitySet(); - createInfrastructureOnlyForHaSystemWithAvailabilityZone(); - createInfrastructureOnlyForSingleServerSystem(); - createInfrastructureWithDiskAndOSConfigurationForDistributedSystemRecommended(); - createInfrastructureWithDiskAndOSConfigurationForHaSystemWithAvailabilitySetRecommended(); - createInfrastructureWithDiskAndOSConfigurationForHaSystemWithAvailabilityZoneRecommended(); - createInfrastructureWithDiskAndOSConfigurationsForSingleServerSystemRecommended(); - createInfrastructureWithOSConfigurationForDistributedSystemRecommended(); - createInfrastructureWithOSConfigurationForHaSystemWithAvailabilitySetRecommended(); - createInfrastructureWithOSConfigurationForHaSystemWithAvailabilityZoneRecommended(); - createInfrastructureWithOSConfigurationForSingleServerSystemRecommended(); - createInfrastructureWithANewSapTransportDirectoryFileshare(); - createInfrastructureWithAnExistingSapTransportDirectoryFileshare(); - createInfrastructureWithoutASapTransportDirectoryFileshare(); - detectSapSoftwareInstallationOnADistributedSystem(); - detectSapSoftwareInstallationOnASingleServerSystem(); - detectSapSoftwareInstallationOnAnHaSystemWithAvailabilitySet(); - detectSapSoftwareInstallationOnAnHaSystemWithAvailabilityZone(); - installSapSoftwareOnDistributedSystem(); - installSapSoftwareOnSingleServerSystem(); - registerExistingSapSystemAsVirtualInstanceForSapSolutionsWithOptionalCustomizations(); - registerExistingSapSystemAsVirtualInstanceForSapSolutions(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/sapVirtualInstancesDeleteSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/sapVirtualInstancesDeleteSample.js deleted file mode 100644 index 658be5b4591e..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/sapVirtualInstancesDeleteSample.js +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to 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. - * - * @summary 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. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Delete.json - */ -async function sapVirtualInstancesDelete() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginDeleteAndWait( - resourceGroupName, - sapVirtualInstanceName - ); - console.log(result); -} - -async function main() { - sapVirtualInstancesDelete(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/sapVirtualInstancesGetSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/sapVirtualInstancesGetSample.js deleted file mode 100644 index 75a2543712a4..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/sapVirtualInstancesGetSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets a Virtual Instance for SAP solutions resource - * - * @summary Gets a Virtual Instance for SAP solutions resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Get.json - */ -async function sapVirtualInstancesGet() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.get(resourceGroupName, sapVirtualInstanceName); - console.log(result); -} - -async function main() { - sapVirtualInstancesGet(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/sapVirtualInstancesListByResourceGroupSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/sapVirtualInstancesListByResourceGroupSample.js deleted file mode 100644 index 685828ba6317..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/sapVirtualInstancesListByResourceGroupSample.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets all Virtual Instances for SAP solutions resources in a Resource Group. - * - * @summary Gets all Virtual Instances for SAP solutions resources in a Resource Group. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_ListByResourceGroup.json - */ -async function sapVirtualInstancesListByResourceGroup() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.sAPVirtualInstances.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - sapVirtualInstancesListByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/sapVirtualInstancesListBySubscriptionSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/sapVirtualInstancesListBySubscriptionSample.js deleted file mode 100644 index 3533184a2f05..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/sapVirtualInstancesListBySubscriptionSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets all Virtual Instances for SAP solutions resources in a Subscription. - * - * @summary Gets all Virtual Instances for SAP solutions resources in a Subscription. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_ListBySubscription.json - */ -async function sapVirtualInstancesListBySubscription() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "6d875e77-e412-4d7d-9af4-8895278b4443"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.sAPVirtualInstances.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - sapVirtualInstancesListBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/sapVirtualInstancesStartSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/sapVirtualInstancesStartSample.js deleted file mode 100644 index 22a87cb2056a..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/sapVirtualInstancesStartSample.js +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Starts the SAP application, that is the Central Services instance and Application server instances. - * - * @summary Starts the SAP application, that is the Central Services instance and Application server instances. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Start.json - */ -async function sapVirtualInstancesStart() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginStartAndWait( - resourceGroupName, - sapVirtualInstanceName - ); - console.log(result); -} - -async function main() { - sapVirtualInstancesStart(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/sapVirtualInstancesStopSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/sapVirtualInstancesStopSample.js deleted file mode 100644 index 5c973c3a6009..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/sapVirtualInstancesStopSample.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Stops the SAP Application, that is the Application server instances and Central Services instance. - * - * @summary Stops the SAP Application, that is the Application server instances and Central Services instance. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Stop.json - */ -async function sapVirtualInstancesStop() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body = { softStopTimeoutSeconds: 0 }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginStopAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -async function main() { - sapVirtualInstancesStop(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/javascript/sapVirtualInstancesUpdateSample.js b/sdk/workloads/arm-workloads/samples/v1/javascript/sapVirtualInstancesUpdateSample.js deleted file mode 100644 index 334e2e7b0b8b..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/javascript/sapVirtualInstancesUpdateSample.js +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { WorkloadsClient } = require("@azure/arm-workloads"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Updates a Virtual Instance for SAP solutions resource - * - * @summary Updates a Virtual Instance for SAP solutions resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Update.json - */ -async function sapVirtualInstancesUpdate() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body = { - identity: { type: "None" }, - tags: { key1: "svi1" }, - }; - const options = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.update( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -async function main() { - sapVirtualInstancesUpdate(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/README.md b/sdk/workloads/arm-workloads/samples/v1/typescript/README.md deleted file mode 100644 index 241a6934d544..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/README.md +++ /dev/null @@ -1,159 +0,0 @@ -# client library samples for TypeScript - -These sample programs show how to use the TypeScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| ------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [monitorsCreateSample.ts][monitorscreatesample] | Creates a SAP monitor for the specified subscription, resource group, and resource name. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/monitors_Create.json | -| [monitorsDeleteSample.ts][monitorsdeletesample] | Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/monitors_Delete.json | -| [monitorsGetSample.ts][monitorsgetsample] | Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/monitors_Get.json | -| [monitorsListByResourceGroupSample.ts][monitorslistbyresourcegroupsample] | Gets a list of SAP monitors in the specified resource group. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/monitors_ListByRG.json | -| [monitorsListSample.ts][monitorslistsample] | Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each SAP monitor. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/monitors_List.json | -| [monitorsUpdateSample.ts][monitorsupdatesample] | Patches the Tags field of a SAP monitor for the specified subscription, resource group, and SAP monitor name. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/monitors_PatchTags_Delete.json | -| [operationsListSample.ts][operationslistsample] | Lists all the available API operations under this PR x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/Operations_List.json | -| [providerInstancesCreateSample.ts][providerinstancescreatesample] | Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/Db2ProviderInstances_Create.json | -| [providerInstancesDeleteSample.ts][providerinstancesdeletesample] | Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ProviderInstances_Delete.json | -| [providerInstancesGetSample.ts][providerinstancesgetsample] | Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/Db2ProviderInstances_Get.json | -| [providerInstancesListSample.ts][providerinstanceslistsample] | Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of each provider instances. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ProviderInstances_List.json | -| [sapApplicationServerInstancesCreateSample.ts][sapapplicationserverinstancescreatesample] | Puts the SAP Application Server Instance resource.

This will be used by service only. PUT by end user will return a Bad Request error. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_Create_HA_AvSet.json | -| [sapApplicationServerInstancesDeleteSample.ts][sapapplicationserverinstancesdeletesample] | Deletes the SAP Application Server Instance resource.

This operation will be used by service only. Delete by end user will return a Bad Request error. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_Delete.json | -| [sapApplicationServerInstancesGetSample.ts][sapapplicationserverinstancesgetsample] | Gets the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_Get.json | -| [sapApplicationServerInstancesListSample.ts][sapapplicationserverinstanceslistsample] | Lists the SAP Application Server Instance resources for a given Virtual Instance for SAP solutions resource. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_List.json | -| [sapApplicationServerInstancesStartInstanceSample.ts][sapapplicationserverinstancesstartinstancesample] | Starts the SAP Application Server Instance. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_StartInstance.json | -| [sapApplicationServerInstancesStopInstanceSample.ts][sapapplicationserverinstancesstopinstancesample] | Stops the SAP Application Server Instance. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_StopInstance.json | -| [sapApplicationServerInstancesUpdateSample.ts][sapapplicationserverinstancesupdatesample] | Puts the SAP Application Server Instance resource. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_Update.json | -| [sapAvailabilityZoneDetailsSample.ts][sapavailabilityzonedetailssample] | Get the recommended SAP Availability Zone Pair Details for your region. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPAvailabilityZoneDetails_eastus.json | -| [sapCentralInstancesCreateSample.ts][sapcentralinstancescreatesample] | Creates the SAP Central Services Instance resource.

This will be used by service only. PUT operation on this resource by end user will return a Bad Request error. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_Create_HA_AvSet.json | -| [sapCentralInstancesDeleteSample.ts][sapcentralinstancesdeletesample] | Deletes the SAP Central Services Instance resource.

This will be used by service only. Delete operation on this resource by end user will return a Bad Request error. You can delete the parent resource, which is the Virtual Instance for SAP solutions resource, using the delete operation on it. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_Delete.json | -| [sapCentralInstancesGetSample.ts][sapcentralinstancesgetsample] | Gets the SAP Central Services Instance resource. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_Get.json | -| [sapCentralInstancesListSample.ts][sapcentralinstanceslistsample] | Lists the SAP Central Services Instance resource for the given Virtual Instance for SAP solutions resource. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_List.json | -| [sapCentralInstancesStartInstanceSample.ts][sapcentralinstancesstartinstancesample] | Starts the SAP Central Services Instance. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_StartInstance.json | -| [sapCentralInstancesStopInstanceSample.ts][sapcentralinstancesstopinstancesample] | Stops the SAP Central Services Instance. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_StopInstance.json | -| [sapCentralInstancesUpdateSample.ts][sapcentralinstancesupdatesample] | Updates the SAP Central Services Instance resource.

This can be used to update tags on the resource. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_Update.json | -| [sapDatabaseInstancesCreateSample.ts][sapdatabaseinstancescreatesample] | Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource.

This will be used by service only. PUT by end user will return a Bad Request error. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_Create_HA_AvSet.json | -| [sapDatabaseInstancesDeleteSample.ts][sapdatabaseinstancesdeletesample] | Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource.

This will be used by service only. Delete by end user will return a Bad Request error. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_Delete.json | -| [sapDatabaseInstancesGetSample.ts][sapdatabaseinstancesgetsample] | Gets the SAP Database Instance resource. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_Get.json | -| [sapDatabaseInstancesListSample.ts][sapdatabaseinstanceslistsample] | Lists the Database resources associated with a Virtual Instance for SAP solutions resource. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_List.json | -| [sapDatabaseInstancesStartInstanceSample.ts][sapdatabaseinstancesstartinstancesample] | Starts the database instance of the SAP system. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_StartInstance.json | -| [sapDatabaseInstancesStopInstanceSample.ts][sapdatabaseinstancesstopinstancesample] | Stops the database instance of the SAP system. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_StopInstance.json | -| [sapDatabaseInstancesUpdateSample.ts][sapdatabaseinstancesupdatesample] | Updates the Database resource. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_Update.json | -| [sapDiskConfigurationsSample.ts][sapdiskconfigurationssample] | Get the SAP Disk Configuration Layout prod/non-prod SAP System. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDiskConfigurations_NonProd.json | -| [sapLandscapeMonitorCreateSample.ts][saplandscapemonitorcreatesample] | Creates a SAP Landscape Monitor Dashboard for the specified subscription, resource group, and resource name. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/SapLandscapeMonitor_Create.json | -| [sapLandscapeMonitorDeleteSample.ts][saplandscapemonitordeletesample] | Deletes a SAP Landscape Monitor Dashboard with the specified subscription, resource group, and SAP monitor name. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/SapLandscapeMonitor_Delete.json | -| [sapLandscapeMonitorGetSample.ts][saplandscapemonitorgetsample] | Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource group, and resource name. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/SapLandscapeMonitor_Get.json | -| [sapLandscapeMonitorListSample.ts][saplandscapemonitorlistsample] | Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource group, and resource name. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/SapLandscapeMonitor_List.json | -| [sapLandscapeMonitorUpdateSample.ts][saplandscapemonitorupdatesample] | Patches the SAP Landscape Monitor Dashboard for the specified subscription, resource group, and SAP monitor name. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/SapLandscapeMonitor_Update.json | -| [sapSizingRecommendationsSample.ts][sapsizingrecommendationssample] | Get SAP sizing recommendations by providing input SAPS for application tier and memory required for database tier x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPSizingRecommendations_S4HANA_Distributed.json | -| [sapSupportedSkuSample.ts][sapsupportedskusample] | Get a list of SAP supported SKUs for ASCS, Application and Database tier. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPSupportedSkus_Distributed.json | -| [sapVirtualInstancesCreateSample.ts][sapvirtualinstancescreatesample] | Creates a Virtual Instance for SAP solutions (VIS) resource x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_CustomFullResourceNames_Distributed.json | -| [sapVirtualInstancesDeleteSample.ts][sapvirtualinstancesdeletesample] | 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. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Delete.json | -| [sapVirtualInstancesGetSample.ts][sapvirtualinstancesgetsample] | Gets a Virtual Instance for SAP solutions resource x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Get.json | -| [sapVirtualInstancesListByResourceGroupSample.ts][sapvirtualinstanceslistbyresourcegroupsample] | Gets all Virtual Instances for SAP solutions resources in a Resource Group. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_ListByResourceGroup.json | -| [sapVirtualInstancesListBySubscriptionSample.ts][sapvirtualinstanceslistbysubscriptionsample] | Gets all Virtual Instances for SAP solutions resources in a Subscription. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_ListBySubscription.json | -| [sapVirtualInstancesStartSample.ts][sapvirtualinstancesstartsample] | Starts the SAP application, that is the Central Services instance and Application server instances. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Start.json | -| [sapVirtualInstancesStopSample.ts][sapvirtualinstancesstopsample] | Stops the SAP Application, that is the Application server instances and Central Services instance. x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Stop.json | -| [sapVirtualInstancesUpdateSample.ts][sapvirtualinstancesupdatesample] | Updates a Virtual Instance for SAP solutions resource x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Update.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: - -```bash -npm install -g typescript -``` - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Compile the samples: - -```bash -npm run build -``` - -3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -4. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node dist/monitorsCreateSample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx cross-env WORKLOADS_SUBSCRIPTION_ID="" WORKLOADS_RESOURCE_GROUP="" node dist/monitorsCreateSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[monitorscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/monitorsCreateSample.ts -[monitorsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/monitorsDeleteSample.ts -[monitorsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/monitorsGetSample.ts -[monitorslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/monitorsListByResourceGroupSample.ts -[monitorslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/monitorsListSample.ts -[monitorsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/monitorsUpdateSample.ts -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/operationsListSample.ts -[providerinstancescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/providerInstancesCreateSample.ts -[providerinstancesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/providerInstancesDeleteSample.ts -[providerinstancesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/providerInstancesGetSample.ts -[providerinstanceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/providerInstancesListSample.ts -[sapapplicationserverinstancescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapApplicationServerInstancesCreateSample.ts -[sapapplicationserverinstancesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapApplicationServerInstancesDeleteSample.ts -[sapapplicationserverinstancesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapApplicationServerInstancesGetSample.ts -[sapapplicationserverinstanceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapApplicationServerInstancesListSample.ts -[sapapplicationserverinstancesstartinstancesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapApplicationServerInstancesStartInstanceSample.ts -[sapapplicationserverinstancesstopinstancesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapApplicationServerInstancesStopInstanceSample.ts -[sapapplicationserverinstancesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapApplicationServerInstancesUpdateSample.ts -[sapavailabilityzonedetailssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapAvailabilityZoneDetailsSample.ts -[sapcentralinstancescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapCentralInstancesCreateSample.ts -[sapcentralinstancesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapCentralInstancesDeleteSample.ts -[sapcentralinstancesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapCentralInstancesGetSample.ts -[sapcentralinstanceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapCentralInstancesListSample.ts -[sapcentralinstancesstartinstancesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapCentralInstancesStartInstanceSample.ts -[sapcentralinstancesstopinstancesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapCentralInstancesStopInstanceSample.ts -[sapcentralinstancesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapCentralInstancesUpdateSample.ts -[sapdatabaseinstancescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapDatabaseInstancesCreateSample.ts -[sapdatabaseinstancesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapDatabaseInstancesDeleteSample.ts -[sapdatabaseinstancesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapDatabaseInstancesGetSample.ts -[sapdatabaseinstanceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapDatabaseInstancesListSample.ts -[sapdatabaseinstancesstartinstancesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapDatabaseInstancesStartInstanceSample.ts -[sapdatabaseinstancesstopinstancesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapDatabaseInstancesStopInstanceSample.ts -[sapdatabaseinstancesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapDatabaseInstancesUpdateSample.ts -[sapdiskconfigurationssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapDiskConfigurationsSample.ts -[saplandscapemonitorcreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapLandscapeMonitorCreateSample.ts -[saplandscapemonitordeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapLandscapeMonitorDeleteSample.ts -[saplandscapemonitorgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapLandscapeMonitorGetSample.ts -[saplandscapemonitorlistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapLandscapeMonitorListSample.ts -[saplandscapemonitorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapLandscapeMonitorUpdateSample.ts -[sapsizingrecommendationssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapSizingRecommendationsSample.ts -[sapsupportedskusample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapSupportedSkuSample.ts -[sapvirtualinstancescreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapVirtualInstancesCreateSample.ts -[sapvirtualinstancesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapVirtualInstancesDeleteSample.ts -[sapvirtualinstancesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapVirtualInstancesGetSample.ts -[sapvirtualinstanceslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapVirtualInstancesListByResourceGroupSample.ts -[sapvirtualinstanceslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapVirtualInstancesListBySubscriptionSample.ts -[sapvirtualinstancesstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapVirtualInstancesStartSample.ts -[sapvirtualinstancesstopsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapVirtualInstancesStopSample.ts -[sapvirtualinstancesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapVirtualInstancesUpdateSample.ts -[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-workloads?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/workloads/arm-workloads/README.md -[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/package.json b/sdk/workloads/arm-workloads/samples/v1/typescript/package.json deleted file mode 100644 index f95c31f40082..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "@azure-samples/arm-workloads-ts", - "private": true, - "version": "1.0.0", - "description": " client library samples for TypeScript", - "engines": { - "node": ">=14.0.0" - }, - "scripts": { - "build": "tsc", - "prebuild": "rimraf dist/" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/workloads/arm-workloads" - }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], - "author": "Microsoft Corporation", - "license": "MIT", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/workloads/arm-workloads", - "dependencies": { - "@azure/arm-workloads": "latest", - "dotenv": "latest", - "@azure/identity": "^2.0.1" - }, - "devDependencies": { - "@types/node": "^14.0.0", - "typescript": "~5.0.0", - "rimraf": "latest" - } -} diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/sample.env b/sdk/workloads/arm-workloads/samples/v1/typescript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/monitorsCreateSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/monitorsCreateSample.ts deleted file mode 100644 index fccdac70596f..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/monitorsCreateSample.ts +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { Monitor, WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates a SAP monitor for the specified subscription, resource group, and resource name. - * - * @summary Creates a SAP monitor for the specified subscription, resource group, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/monitors_Create.json - */ -async function createASapMonitor() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const monitorParameter: Monitor = { - appLocation: "westus", - location: "westus", - logAnalyticsWorkspaceArmId: - "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.operationalinsights/workspaces/myWorkspace", - managedResourceGroupConfiguration: { name: "myManagedRg" }, - monitorSubnet: - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet", - routingPreference: "RouteAll", - tags: { key: "value" } - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.monitors.beginCreateAndWait( - resourceGroupName, - monitorName, - monitorParameter - ); - console.log(result); -} - -async function main() { - createASapMonitor(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/monitorsDeleteSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/monitorsDeleteSample.ts deleted file mode 100644 index 30e31ca39382..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/monitorsDeleteSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. - * - * @summary Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/monitors_Delete.json - */ -async function deletesASapMonitor() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.monitors.beginDeleteAndWait( - resourceGroupName, - monitorName - ); - console.log(result); -} - -async function main() { - deletesASapMonitor(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/monitorsGetSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/monitorsGetSample.ts deleted file mode 100644 index d1d58f3d4abc..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/monitorsGetSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. - * - * @summary Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/monitors_Get.json - */ -async function getPropertiesOfASapMonitor() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.monitors.get(resourceGroupName, monitorName); - console.log(result); -} - -async function main() { - getPropertiesOfASapMonitor(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/monitorsListByResourceGroupSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/monitorsListByResourceGroupSample.ts deleted file mode 100644 index 4793d61a4fae..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/monitorsListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets a list of SAP monitors in the specified resource group. - * - * @summary Gets a list of SAP monitors in the specified resource group. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/monitors_ListByRG.json - */ -async function listAllSapMonitorsInAResourceGroup() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "example-rg"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.monitors.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAllSapMonitorsInAResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/monitorsListSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/monitorsListSample.ts deleted file mode 100644 index c1bc935a7cdc..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/monitorsListSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each SAP monitor. - * - * @summary Gets a list of SAP monitors in the specified subscription. The operations returns various properties of each SAP monitor. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/monitors_List.json - */ -async function listAllSapMonitorsInASubscription() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.monitors.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAllSapMonitorsInASubscription(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/monitorsUpdateSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/monitorsUpdateSample.ts deleted file mode 100644 index 5bd2ca52187e..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/monitorsUpdateSample.ts +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { UpdateMonitorRequest, WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Patches the Tags field of a SAP monitor for the specified subscription, resource group, and SAP monitor name. - * - * @summary Patches the Tags field of a SAP monitor for the specified subscription, resource group, and SAP monitor name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/monitors_PatchTags_Delete.json - */ -async function deleteTagsFieldOfASapMonitor() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const body: UpdateMonitorRequest = { identity: { type: "None" }, tags: {} }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.monitors.update( - resourceGroupName, - monitorName, - body - ); - console.log(result); -} - -/** - * This sample demonstrates how to Patches the Tags field of a SAP monitor for the specified subscription, resource group, and SAP monitor name. - * - * @summary Patches the Tags field of a SAP monitor for the specified subscription, resource group, and SAP monitor name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/monitors_PatchTags.json - */ -async function updateTagsFieldOfASapMonitor() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const body: UpdateMonitorRequest = { - identity: { type: "None" }, - tags: { testkey: "testvalue" } - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.monitors.update( - resourceGroupName, - monitorName, - body - ); - console.log(result); -} - -async function main() { - deleteTagsFieldOfASapMonitor(); - updateTagsFieldOfASapMonitor(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/operationsListSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/operationsListSample.ts deleted file mode 100644 index 771560636a4c..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/operationsListSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists all the available API operations under this PR - * - * @summary Lists all the available API operations under this PR - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/Operations_List.json - */ -async function operations() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - operations(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/providerInstancesCreateSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/providerInstancesCreateSample.ts deleted file mode 100644 index 604bdbfb2079..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/providerInstancesCreateSample.ts +++ /dev/null @@ -1,490 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ProviderInstance, WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/Db2ProviderInstances_Create.json - */ -async function createADb2Provider() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const providerInstanceParameter: ProviderInstance = { - providerSettings: { - dbName: "dbName", - dbPassword: "password", - dbPasswordUri: "", - dbPort: "dbPort", - dbUsername: "username", - hostname: "hostname", - providerType: "Db2", - sapSid: "SID", - sslCertificateUri: - "https://storageaccount.blob.core.windows.net/containername/filename", - sslPreference: "ServerCertificate" - } - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.beginCreateAndWait( - resourceGroupName, - monitorName, - providerInstanceName, - providerInstanceParameter - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/Db2ProviderInstances_Create_Root_Certificate.json - */ -async function createADb2ProviderWithRootCertificate() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const providerInstanceParameter: ProviderInstance = { - providerSettings: { - dbName: "dbName", - dbPassword: "password", - dbPasswordUri: "", - dbPort: "dbPort", - dbUsername: "username", - hostname: "hostname", - providerType: "Db2", - sapSid: "SID", - sslPreference: "RootCertificate" - } - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.beginCreateAndWait( - resourceGroupName, - monitorName, - providerInstanceName, - providerInstanceParameter - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/MsSqlServerProviderInstance_Create.json - */ -async function createAMSSqlServerProvider() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const providerInstanceParameter: ProviderInstance = { - providerSettings: { - dbPassword: "****", - dbPasswordUri: "", - dbPort: "5912", - dbUsername: "user", - hostname: "hostname", - providerType: "MsSqlServer", - sapSid: "sid", - sslCertificateUri: - "https://storageaccount.blob.core.windows.net/containername/filename", - sslPreference: "ServerCertificate" - } - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.beginCreateAndWait( - resourceGroupName, - monitorName, - providerInstanceName, - providerInstanceParameter - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/MsSqlServerProviderInstance_Create_Root_Certificate.json - */ -async function createAMSSqlServerProviderWithRootCertificate() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const providerInstanceParameter: ProviderInstance = { - providerSettings: { - dbPassword: "****", - dbPasswordUri: "", - dbPort: "5912", - dbUsername: "user", - hostname: "hostname", - providerType: "MsSqlServer", - sapSid: "sid", - sslPreference: "RootCertificate" - } - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.beginCreateAndWait( - resourceGroupName, - monitorName, - providerInstanceName, - providerInstanceParameter - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/PrometheusOSProviderInstances_Create.json - */ -async function createAOSProvider() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const providerInstanceParameter: ProviderInstance = { - providerSettings: { - prometheusUrl: "http://192.168.0.0:9090/metrics", - providerType: "PrometheusOS", - sapSid: "SID", - sslCertificateUri: - "https://storageaccount.blob.core.windows.net/containername/filename", - sslPreference: "ServerCertificate" - } - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.beginCreateAndWait( - resourceGroupName, - monitorName, - providerInstanceName, - providerInstanceParameter - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/PrometheusOSProviderInstances_Create_Root_Certificate.json - */ -async function createAOSProviderWithRootCertificate() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const providerInstanceParameter: ProviderInstance = { - providerSettings: { - prometheusUrl: "http://192.168.0.0:9090/metrics", - providerType: "PrometheusOS", - sapSid: "SID", - sslPreference: "RootCertificate" - } - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.beginCreateAndWait( - resourceGroupName, - monitorName, - providerInstanceName, - providerInstanceParameter - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/PrometheusHaClusterProviderInstances_Create.json - */ -async function createAPrometheusHaClusterProvider() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const providerInstanceParameter: ProviderInstance = { - providerSettings: { - clusterName: "clusterName", - hostname: "hostname", - prometheusUrl: "http://192.168.0.0:9090/metrics", - providerType: "PrometheusHaCluster", - sid: "sid", - sslCertificateUri: - "https://storageaccount.blob.core.windows.net/containername/filename", - sslPreference: "ServerCertificate" - } - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.beginCreateAndWait( - resourceGroupName, - monitorName, - providerInstanceName, - providerInstanceParameter - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/PrometheusHaClusterProviderInstances_Create_Root_Certificate.json - */ -async function createAPrometheusHaClusterProviderWithRootCertificate() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const providerInstanceParameter: ProviderInstance = { - providerSettings: { - clusterName: "clusterName", - hostname: "hostname", - prometheusUrl: "http://192.168.0.0:9090/metrics", - providerType: "PrometheusHaCluster", - sid: "sid", - sslPreference: "RootCertificate" - } - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.beginCreateAndWait( - resourceGroupName, - monitorName, - providerInstanceName, - providerInstanceParameter - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ProviderInstances_Create.json - */ -async function createASapMonitorHanaProvider() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const providerInstanceParameter: ProviderInstance = { - providerSettings: { - dbName: "db", - dbPassword: "****", - dbPasswordUri: "", - dbUsername: "user", - hostname: "name", - instanceNumber: "00", - providerType: "SapHana", - sapSid: "SID", - sqlPort: "0000", - sslCertificateUri: - "https://storageaccount.blob.core.windows.net/containername/filename", - sslHostNameInCertificate: "xyz.domain.com", - sslPreference: "ServerCertificate" - } - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.beginCreateAndWait( - resourceGroupName, - monitorName, - providerInstanceName, - providerInstanceParameter - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ProviderInstances_Create_Root_Certificate.json - */ -async function createASapMonitorHanaProviderWithRootCertificate() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const providerInstanceParameter: ProviderInstance = { - providerSettings: { - dbName: "db", - dbPassword: "****", - dbPasswordUri: "", - dbUsername: "user", - hostname: "name", - instanceNumber: "00", - providerType: "SapHana", - sapSid: "SID", - sqlPort: "0000", - sslHostNameInCertificate: "xyz.domain.com", - sslPreference: "RootCertificate" - } - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.beginCreateAndWait( - resourceGroupName, - monitorName, - providerInstanceName, - providerInstanceParameter - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/NetWeaverProviderInstances_Create.json - */ -async function createASapMonitorNetWeaverProvider() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const providerInstanceParameter: ProviderInstance = { - providerSettings: { - providerType: "SapNetWeaver", - sapClientId: "111", - sapHostFileEntries: ["127.0.0.1 name fqdn"], - sapHostname: "name", - sapInstanceNr: "00", - sapPassword: "****", - sapPasswordUri: "", - sapPortNumber: "1234", - sapSid: "SID", - sapUsername: "username", - sslCertificateUri: - "https://storageaccount.blob.core.windows.net/containername/filename", - sslPreference: "ServerCertificate" - } - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.beginCreateAndWait( - resourceGroupName, - monitorName, - providerInstanceName, - providerInstanceParameter - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/NetWeaverProviderInstances_Create_Root_Certificate.json - */ -async function createASapMonitorNetWeaverProviderWithRootCertificate() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const providerInstanceParameter: ProviderInstance = { - providerSettings: { - providerType: "SapNetWeaver", - sapClientId: "111", - sapHostFileEntries: ["127.0.0.1 name fqdn"], - sapHostname: "name", - sapInstanceNr: "00", - sapPassword: "****", - sapPasswordUri: "", - sapPortNumber: "1234", - sapSid: "SID", - sapUsername: "username", - sslPreference: "RootCertificate" - } - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.beginCreateAndWait( - resourceGroupName, - monitorName, - providerInstanceName, - providerInstanceParameter - ); - console.log(result); -} - -async function main() { - createADb2Provider(); - createADb2ProviderWithRootCertificate(); - createAMSSqlServerProvider(); - createAMSSqlServerProviderWithRootCertificate(); - createAOSProvider(); - createAOSProviderWithRootCertificate(); - createAPrometheusHaClusterProvider(); - createAPrometheusHaClusterProviderWithRootCertificate(); - createASapMonitorHanaProvider(); - createASapMonitorHanaProviderWithRootCertificate(); - createASapMonitorNetWeaverProvider(); - createASapMonitorNetWeaverProviderWithRootCertificate(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/providerInstancesDeleteSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/providerInstancesDeleteSample.ts deleted file mode 100644 index df85797cacb3..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/providerInstancesDeleteSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ProviderInstances_Delete.json - */ -async function deletesASapMonitorProvider() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.beginDeleteAndWait( - resourceGroupName, - monitorName, - providerInstanceName - ); - console.log(result); -} - -async function main() { - deletesASapMonitorProvider(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/providerInstancesGetSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/providerInstancesGetSample.ts deleted file mode 100644 index 69503059f8dc..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/providerInstancesGetSample.ts +++ /dev/null @@ -1,170 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/Db2ProviderInstances_Get.json - */ -async function getPropertiesOfADb2Provider() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.get( - resourceGroupName, - monitorName, - providerInstanceName - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/MsSqlServerProviderInstance_Get.json - */ -async function getPropertiesOfAMSSqlServerProvider() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.get( - resourceGroupName, - monitorName, - providerInstanceName - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/PrometheusOSProviderInstances_Get.json - */ -async function getPropertiesOfAOSProvider() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.get( - resourceGroupName, - monitorName, - providerInstanceName - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/PrometheusHaClusterProviderInstances_Get.json - */ -async function getPropertiesOfAPrometheusHaClusterProvider() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.get( - resourceGroupName, - monitorName, - providerInstanceName - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ProviderInstances_Get.json - */ -async function getPropertiesOfASapMonitorHanaProvider() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.get( - resourceGroupName, - monitorName, - providerInstanceName - ); - console.log(result); -} - -/** - * This sample demonstrates how to Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * - * @summary Gets properties of a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/NetWeaverProviderInstances_Get.json - */ -async function getPropertiesOfASapMonitorNetWeaverProvider() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const providerInstanceName = "myProviderInstance"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.providerInstances.get( - resourceGroupName, - monitorName, - providerInstanceName - ); - console.log(result); -} - -async function main() { - getPropertiesOfADb2Provider(); - getPropertiesOfAMSSqlServerProvider(); - getPropertiesOfAOSProvider(); - getPropertiesOfAPrometheusHaClusterProvider(); - getPropertiesOfASapMonitorHanaProvider(); - getPropertiesOfASapMonitorNetWeaverProvider(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/providerInstancesListSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/providerInstancesListSample.ts deleted file mode 100644 index ce5a4003459a..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/providerInstancesListSample.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of each provider instances. - * - * @summary Gets a list of provider instances in the specified SAP monitor. The operations returns various properties of each provider instances. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/ProviderInstances_List.json - */ -async function listAllSapMonitorsProvidersInASubscription() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.providerInstances.list( - resourceGroupName, - monitorName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listAllSapMonitorsProvidersInASubscription(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapApplicationServerInstancesCreateSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapApplicationServerInstancesCreateSample.ts deleted file mode 100644 index 99fa6d739756..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapApplicationServerInstancesCreateSample.ts +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - SAPApplicationServerInstance, - SAPApplicationServerInstancesCreateOptionalParams, - WorkloadsClient -} from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Puts the SAP Application Server Instance resource.

This will be used by service only. PUT by end user will return a Bad Request error. - * - * @summary Puts the SAP Application Server Instance resource.

This will be used by service only. PUT by end user will return a Bad Request error. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_Create_HA_AvSet.json - */ -async function createSapApplicationServerInstancesForHaSystemWithAvailabilitySet() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const applicationInstanceName = "app01"; - const body: SAPApplicationServerInstance = { - location: "westcentralus", - tags: {} - }; - const options: SAPApplicationServerInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPApplicationServerInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - applicationInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Puts the SAP Application Server Instance resource.

This will be used by service only. PUT by end user will return a Bad Request error. - * - * @summary Puts the SAP Application Server Instance resource.

This will be used by service only. PUT by end user will return a Bad Request error. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_Create.json - */ -async function sapApplicationServerInstancesCreate() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const applicationInstanceName = "app01"; - const body: SAPApplicationServerInstance = { - location: "westcentralus", - tags: {} - }; - const options: SAPApplicationServerInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPApplicationServerInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - applicationInstanceName, - options - ); - console.log(result); -} - -async function main() { - createSapApplicationServerInstancesForHaSystemWithAvailabilitySet(); - sapApplicationServerInstancesCreate(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapApplicationServerInstancesDeleteSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapApplicationServerInstancesDeleteSample.ts deleted file mode 100644 index 412809ac32d2..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapApplicationServerInstancesDeleteSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes the SAP Application Server Instance resource.

This operation will be used by service only. Delete by end user will return a Bad Request error. - * - * @summary Deletes the SAP Application Server Instance resource.

This operation will be used by service only. Delete by end user will return a Bad Request error. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_Delete.json - */ -async function sapApplicationServerInstancesDelete() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const applicationInstanceName = "app01"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPApplicationServerInstances.beginDeleteAndWait( - resourceGroupName, - sapVirtualInstanceName, - applicationInstanceName - ); - console.log(result); -} - -async function main() { - sapApplicationServerInstancesDelete(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapApplicationServerInstancesGetSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapApplicationServerInstancesGetSample.ts deleted file mode 100644 index d19e12d8a10e..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapApplicationServerInstancesGetSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. - * - * @summary Gets the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_Get.json - */ -async function sapApplicationServerInstancesGet() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const applicationInstanceName = "app01"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPApplicationServerInstances.get( - resourceGroupName, - sapVirtualInstanceName, - applicationInstanceName - ); - console.log(result); -} - -async function main() { - sapApplicationServerInstancesGet(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapApplicationServerInstancesListSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapApplicationServerInstancesListSample.ts deleted file mode 100644 index 76ef8390d9db..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapApplicationServerInstancesListSample.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists the SAP Application Server Instance resources for a given Virtual Instance for SAP solutions resource. - * - * @summary Lists the SAP Application Server Instance resources for a given Virtual Instance for SAP solutions resource. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_List.json - */ -async function sapApplicationServerInstancesList() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.sAPApplicationServerInstances.list( - resourceGroupName, - sapVirtualInstanceName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - sapApplicationServerInstancesList(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapApplicationServerInstancesStartInstanceSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapApplicationServerInstancesStartInstanceSample.ts deleted file mode 100644 index 8b66a8bbe627..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapApplicationServerInstancesStartInstanceSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Starts the SAP Application Server Instance. - * - * @summary Starts the SAP Application Server Instance. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_StartInstance.json - */ -async function startTheSapApplicationServerInstance() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const applicationInstanceName = "app01"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPApplicationServerInstances.beginStartInstanceAndWait( - resourceGroupName, - sapVirtualInstanceName, - applicationInstanceName - ); - console.log(result); -} - -async function main() { - startTheSapApplicationServerInstance(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapApplicationServerInstancesStopInstanceSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapApplicationServerInstancesStopInstanceSample.ts deleted file mode 100644 index c635942d397e..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapApplicationServerInstancesStopInstanceSample.ts +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - StopRequest, - SAPApplicationServerInstancesStopInstanceOptionalParams, - WorkloadsClient -} from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Stops the SAP Application Server Instance. - * - * @summary Stops the SAP Application Server Instance. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_StopInstance.json - */ -async function stopTheSapApplicationServerInstance() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const applicationInstanceName = "app01"; - const body: StopRequest = { softStopTimeoutSeconds: 0 }; - const options: SAPApplicationServerInstancesStopInstanceOptionalParams = { - body - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPApplicationServerInstances.beginStopInstanceAndWait( - resourceGroupName, - sapVirtualInstanceName, - applicationInstanceName, - options - ); - console.log(result); -} - -async function main() { - stopTheSapApplicationServerInstance(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapApplicationServerInstancesUpdateSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapApplicationServerInstancesUpdateSample.ts deleted file mode 100644 index d892bc3edb50..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapApplicationServerInstancesUpdateSample.ts +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - UpdateSAPApplicationInstanceRequest, - SAPApplicationServerInstancesUpdateOptionalParams, - WorkloadsClient -} from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Puts the SAP Application Server Instance resource. - * - * @summary Puts the SAP Application Server Instance resource. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPApplicationServerInstances_Update.json - */ -async function sapApplicationServerInstancesUpdate() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const applicationInstanceName = "app01"; - const body: UpdateSAPApplicationInstanceRequest = { - tags: { tag1: "value1" } - }; - const options: SAPApplicationServerInstancesUpdateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPApplicationServerInstances.beginUpdateAndWait( - resourceGroupName, - sapVirtualInstanceName, - applicationInstanceName, - options - ); - console.log(result); -} - -async function main() { - sapApplicationServerInstancesUpdate(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapAvailabilityZoneDetailsSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapAvailabilityZoneDetailsSample.ts deleted file mode 100644 index 0b952a718980..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapAvailabilityZoneDetailsSample.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get the recommended SAP Availability Zone Pair Details for your region. - * - * @summary Get the recommended SAP Availability Zone Pair Details for your region. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPAvailabilityZoneDetails_eastus.json - */ -async function sapAvailabilityZoneDetailsEastus() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const location = "centralus"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPAvailabilityZoneDetails(location); - console.log(result); -} - -/** - * This sample demonstrates how to Get the recommended SAP Availability Zone Pair Details for your region. - * - * @summary Get the recommended SAP Availability Zone Pair Details for your region. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPAvailabilityZoneDetails_northeurope.json - */ -async function sapAvailabilityZoneDetailsNortheurope() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const location = "centralus"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPAvailabilityZoneDetails(location); - console.log(result); -} - -async function main() { - sapAvailabilityZoneDetailsEastus(); - sapAvailabilityZoneDetailsNortheurope(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapCentralInstancesCreateSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapCentralInstancesCreateSample.ts deleted file mode 100644 index 046ea5104043..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapCentralInstancesCreateSample.ts +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - SAPCentralServerInstance, - SAPCentralInstancesCreateOptionalParams, - WorkloadsClient -} from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates the SAP Central Services Instance resource.

This will be used by service only. PUT operation on this resource by end user will return a Bad Request error. - * - * @summary Creates the SAP Central Services Instance resource.

This will be used by service only. PUT operation on this resource by end user will return a Bad Request error. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_Create_HA_AvSet.json - */ -async function createSapCentralInstancesForHaSystemWithAvailabilitySet() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const centralInstanceName = "centralServer"; - const body: SAPCentralServerInstance = { - location: "westcentralus", - tags: {} - }; - const options: SAPCentralInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPCentralInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - centralInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates the SAP Central Services Instance resource.

This will be used by service only. PUT operation on this resource by end user will return a Bad Request error. - * - * @summary Creates the SAP Central Services Instance resource.

This will be used by service only. PUT operation on this resource by end user will return a Bad Request error. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_Create.json - */ -async function sapCentralInstancesCreate() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const centralInstanceName = "centralServer"; - const body: SAPCentralServerInstance = { - location: "westcentralus", - tags: {} - }; - const options: SAPCentralInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPCentralInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - centralInstanceName, - options - ); - console.log(result); -} - -async function main() { - createSapCentralInstancesForHaSystemWithAvailabilitySet(); - sapCentralInstancesCreate(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapCentralInstancesDeleteSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapCentralInstancesDeleteSample.ts deleted file mode 100644 index c7944eb8b0c1..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapCentralInstancesDeleteSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes the SAP Central Services Instance resource.

This will be used by service only. Delete operation on this resource by end user will return a Bad Request error. You can delete the parent resource, which is the Virtual Instance for SAP solutions resource, using the delete operation on it. - * - * @summary Deletes the SAP Central Services Instance resource.

This will be used by service only. Delete operation on this resource by end user will return a Bad Request error. You can delete the parent resource, which is the Virtual Instance for SAP solutions resource, using the delete operation on it. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_Delete.json - */ -async function sapCentralInstancesDelete() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const centralInstanceName = "centralServer"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPCentralInstances.beginDeleteAndWait( - resourceGroupName, - sapVirtualInstanceName, - centralInstanceName - ); - console.log(result); -} - -async function main() { - sapCentralInstancesDelete(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapCentralInstancesGetSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapCentralInstancesGetSample.ts deleted file mode 100644 index 51857d4382b4..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapCentralInstancesGetSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets the SAP Central Services Instance resource. - * - * @summary Gets the SAP Central Services Instance resource. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_Get.json - */ -async function sapCentralInstancesGet() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const centralInstanceName = "centralServer"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPCentralInstances.get( - resourceGroupName, - sapVirtualInstanceName, - centralInstanceName - ); - console.log(result); -} - -async function main() { - sapCentralInstancesGet(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapCentralInstancesListSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapCentralInstancesListSample.ts deleted file mode 100644 index 1a84725222e1..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapCentralInstancesListSample.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists the SAP Central Services Instance resource for the given Virtual Instance for SAP solutions resource. - * - * @summary Lists the SAP Central Services Instance resource for the given Virtual Instance for SAP solutions resource. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_List.json - */ -async function sapCentralInstancesList() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.sAPCentralInstances.list( - resourceGroupName, - sapVirtualInstanceName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - sapCentralInstancesList(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapCentralInstancesStartInstanceSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapCentralInstancesStartInstanceSample.ts deleted file mode 100644 index 22e26a520c60..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapCentralInstancesStartInstanceSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Starts the SAP Central Services Instance. - * - * @summary Starts the SAP Central Services Instance. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_StartInstance.json - */ -async function startTheSapCentralServicesInstance() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const centralInstanceName = "centralServer"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPCentralInstances.beginStartInstanceAndWait( - resourceGroupName, - sapVirtualInstanceName, - centralInstanceName - ); - console.log(result); -} - -async function main() { - startTheSapCentralServicesInstance(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapCentralInstancesStopInstanceSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapCentralInstancesStopInstanceSample.ts deleted file mode 100644 index 40a032b55f21..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapCentralInstancesStopInstanceSample.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - StopRequest, - SAPCentralInstancesStopInstanceOptionalParams, - WorkloadsClient -} from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Stops the SAP Central Services Instance. - * - * @summary Stops the SAP Central Services Instance. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_StopInstance.json - */ -async function stopTheSapCentralServicesInstance() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const centralInstanceName = "centralServer"; - const body: StopRequest = { softStopTimeoutSeconds: 1200 }; - const options: SAPCentralInstancesStopInstanceOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPCentralInstances.beginStopInstanceAndWait( - resourceGroupName, - sapVirtualInstanceName, - centralInstanceName, - options - ); - console.log(result); -} - -async function main() { - stopTheSapCentralServicesInstance(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapCentralInstancesUpdateSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapCentralInstancesUpdateSample.ts deleted file mode 100644 index 4ca01687aa81..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapCentralInstancesUpdateSample.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - UpdateSAPCentralInstanceRequest, - SAPCentralInstancesUpdateOptionalParams, - WorkloadsClient -} from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates the SAP Central Services Instance resource.

This can be used to update tags on the resource. - * - * @summary Updates the SAP Central Services Instance resource.

This can be used to update tags on the resource. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPCentralInstances_Update.json - */ -async function sapCentralInstancesUpdate() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const centralInstanceName = "centralServer"; - const body: UpdateSAPCentralInstanceRequest = { tags: { tag1: "value1" } }; - const options: SAPCentralInstancesUpdateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPCentralInstances.beginUpdateAndWait( - resourceGroupName, - sapVirtualInstanceName, - centralInstanceName, - options - ); - console.log(result); -} - -async function main() { - sapCentralInstancesUpdate(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapDatabaseInstancesCreateSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapDatabaseInstancesCreateSample.ts deleted file mode 100644 index 637d902f939d..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapDatabaseInstancesCreateSample.ts +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - SAPDatabaseInstance, - SAPDatabaseInstancesCreateOptionalParams, - WorkloadsClient -} from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource.

This will be used by service only. PUT by end user will return a Bad Request error. - * - * @summary Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource.

This will be used by service only. PUT by end user will return a Bad Request error. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_Create_HA_AvSet.json - */ -async function createSapDatabaseInstancesForHaSystemWithAvailabilitySet() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const databaseInstanceName = "databaseServer"; - const body: SAPDatabaseInstance = { location: "westcentralus", tags: {} }; - const options: SAPDatabaseInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPDatabaseInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - databaseInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource.

This will be used by service only. PUT by end user will return a Bad Request error. - * - * @summary Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource.

This will be used by service only. PUT by end user will return a Bad Request error. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_Create.json - */ -async function sapDatabaseInstancesCreate() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const databaseInstanceName = "databaseServer"; - const body: SAPDatabaseInstance = { location: "westcentralus", tags: {} }; - const options: SAPDatabaseInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPDatabaseInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - databaseInstanceName, - options - ); - console.log(result); -} - -async function main() { - createSapDatabaseInstancesForHaSystemWithAvailabilitySet(); - sapDatabaseInstancesCreate(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapDatabaseInstancesDeleteSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapDatabaseInstancesDeleteSample.ts deleted file mode 100644 index 30090d90f2cd..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapDatabaseInstancesDeleteSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource.

This will be used by service only. Delete by end user will return a Bad Request error. - * - * @summary Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource.

This will be used by service only. Delete by end user will return a Bad Request error. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_Delete.json - */ -async function sapDatabaseInstancesDelete() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const databaseInstanceName = "databaseServer"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPDatabaseInstances.beginDeleteAndWait( - resourceGroupName, - sapVirtualInstanceName, - databaseInstanceName - ); - console.log(result); -} - -async function main() { - sapDatabaseInstancesDelete(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapDatabaseInstancesGetSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapDatabaseInstancesGetSample.ts deleted file mode 100644 index f9dbb15e0204..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapDatabaseInstancesGetSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets the SAP Database Instance resource. - * - * @summary Gets the SAP Database Instance resource. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_Get.json - */ -async function sapDatabaseInstancesGet() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const databaseInstanceName = "databaseServer"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPDatabaseInstances.get( - resourceGroupName, - sapVirtualInstanceName, - databaseInstanceName - ); - console.log(result); -} - -async function main() { - sapDatabaseInstancesGet(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapDatabaseInstancesListSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapDatabaseInstancesListSample.ts deleted file mode 100644 index 42d7156327fe..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapDatabaseInstancesListSample.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists the Database resources associated with a Virtual Instance for SAP solutions resource. - * - * @summary Lists the Database resources associated with a Virtual Instance for SAP solutions resource. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_List.json - */ -async function sapDatabaseInstancesList() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.sAPDatabaseInstances.list( - resourceGroupName, - sapVirtualInstanceName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - sapDatabaseInstancesList(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapDatabaseInstancesStartInstanceSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapDatabaseInstancesStartInstanceSample.ts deleted file mode 100644 index 92a0bf1d700e..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapDatabaseInstancesStartInstanceSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Starts the database instance of the SAP system. - * - * @summary Starts the database instance of the SAP system. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_StartInstance.json - */ -async function startTheDatabaseInstanceOfTheSapSystem() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const databaseInstanceName = "db0"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPDatabaseInstances.beginStartInstanceAndWait( - resourceGroupName, - sapVirtualInstanceName, - databaseInstanceName - ); - console.log(result); -} - -async function main() { - startTheDatabaseInstanceOfTheSapSystem(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapDatabaseInstancesStopInstanceSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapDatabaseInstancesStopInstanceSample.ts deleted file mode 100644 index 7dfdfb6c1e8a..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapDatabaseInstancesStopInstanceSample.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - StopRequest, - SAPDatabaseInstancesStopInstanceOptionalParams, - WorkloadsClient -} from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Stops the database instance of the SAP system. - * - * @summary Stops the database instance of the SAP system. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_StopInstance.json - */ -async function stopTheDatabaseInstanceOfTheSapSystem() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const databaseInstanceName = "db0"; - const body: StopRequest = { softStopTimeoutSeconds: 0 }; - const options: SAPDatabaseInstancesStopInstanceOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPDatabaseInstances.beginStopInstanceAndWait( - resourceGroupName, - sapVirtualInstanceName, - databaseInstanceName, - options - ); - console.log(result); -} - -async function main() { - stopTheDatabaseInstanceOfTheSapSystem(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapDatabaseInstancesUpdateSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapDatabaseInstancesUpdateSample.ts deleted file mode 100644 index 7bc88a89845e..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapDatabaseInstancesUpdateSample.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - UpdateSAPDatabaseInstanceRequest, - SAPDatabaseInstancesUpdateOptionalParams, - WorkloadsClient -} from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates the Database resource. - * - * @summary Updates the Database resource. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDatabaseInstances_Update.json - */ -async function sapDatabaseInstancesUpdate() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const databaseInstanceName = "databaseServer"; - const body: UpdateSAPDatabaseInstanceRequest = { tags: { key1: "value1" } }; - const options: SAPDatabaseInstancesUpdateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPDatabaseInstances.beginUpdateAndWait( - resourceGroupName, - sapVirtualInstanceName, - databaseInstanceName, - options - ); - console.log(result); -} - -async function main() { - sapDatabaseInstancesUpdate(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapDiskConfigurationsSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapDiskConfigurationsSample.ts deleted file mode 100644 index d96e0b44c07b..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapDiskConfigurationsSample.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get the SAP Disk Configuration Layout prod/non-prod SAP System. - * - * @summary Get the SAP Disk Configuration Layout prod/non-prod SAP System. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDiskConfigurations_NonProd.json - */ -async function sapDiskConfigurationsNonProd() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const location = "centralus"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPDiskConfigurations(location); - console.log(result); -} - -/** - * This sample demonstrates how to Get the SAP Disk Configuration Layout prod/non-prod SAP System. - * - * @summary Get the SAP Disk Configuration Layout prod/non-prod SAP System. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPDiskConfigurations_Prod.json - */ -async function sapDiskConfigurationsProd() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const location = "centralus"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPDiskConfigurations(location); - console.log(result); -} - -async function main() { - sapDiskConfigurationsNonProd(); - sapDiskConfigurationsProd(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapLandscapeMonitorCreateSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapLandscapeMonitorCreateSample.ts deleted file mode 100644 index d4df88d19b53..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapLandscapeMonitorCreateSample.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { SapLandscapeMonitor, WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates a SAP Landscape Monitor Dashboard for the specified subscription, resource group, and resource name. - * - * @summary Creates a SAP Landscape Monitor Dashboard for the specified subscription, resource group, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/SapLandscapeMonitor_Create.json - */ -async function createForSapLandscapeMonitorDashboard() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const sapLandscapeMonitorParameter: SapLandscapeMonitor = { - grouping: { - landscape: [{ name: "Prod", topSid: ["SID1", "SID2"] }], - sapApplication: [{ name: "ERP1", topSid: ["SID1", "SID2"] }] - }, - topMetricsThresholds: [ - { name: "Instance Availability", green: 90, red: 50, yellow: 75 } - ] - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sapLandscapeMonitorOperations.create( - resourceGroupName, - monitorName, - sapLandscapeMonitorParameter - ); - console.log(result); -} - -async function main() { - createForSapLandscapeMonitorDashboard(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapLandscapeMonitorDeleteSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapLandscapeMonitorDeleteSample.ts deleted file mode 100644 index d69d0126e37e..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapLandscapeMonitorDeleteSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Deletes a SAP Landscape Monitor Dashboard with the specified subscription, resource group, and SAP monitor name. - * - * @summary Deletes a SAP Landscape Monitor Dashboard with the specified subscription, resource group, and SAP monitor name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/SapLandscapeMonitor_Delete.json - */ -async function deletesSapMonitor() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sapLandscapeMonitorOperations.delete( - resourceGroupName, - monitorName - ); - console.log(result); -} - -async function main() { - deletesSapMonitor(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapLandscapeMonitorGetSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapLandscapeMonitorGetSample.ts deleted file mode 100644 index fa65d78264e8..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapLandscapeMonitorGetSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource group, and resource name. - * - * @summary Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource group, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/SapLandscapeMonitor_Get.json - */ -async function getPropertiesOfASapMonitor() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sapLandscapeMonitorOperations.get( - resourceGroupName, - monitorName - ); - console.log(result); -} - -async function main() { - getPropertiesOfASapMonitor(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapLandscapeMonitorListSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapLandscapeMonitorListSample.ts deleted file mode 100644 index 34b1eadde490..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapLandscapeMonitorListSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource group, and resource name. - * - * @summary Gets configuration values for Single Pane Of Glass for SAP monitor for the specified subscription, resource group, and resource name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/SapLandscapeMonitor_List.json - */ -async function getPropertiesOfASapMonitor() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sapLandscapeMonitorOperations.list( - resourceGroupName, - monitorName - ); - console.log(result); -} - -async function main() { - getPropertiesOfASapMonitor(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapLandscapeMonitorUpdateSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapLandscapeMonitorUpdateSample.ts deleted file mode 100644 index 0ed378c68281..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapLandscapeMonitorUpdateSample.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { SapLandscapeMonitor, WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Patches the SAP Landscape Monitor Dashboard for the specified subscription, resource group, and SAP monitor name. - * - * @summary Patches the SAP Landscape Monitor Dashboard for the specified subscription, resource group, and SAP monitor name. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/workloadmonitor/SapLandscapeMonitor_Update.json - */ -async function updateSapMonitor() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "myResourceGroup"; - const monitorName = "mySapMonitor"; - const sapLandscapeMonitorParameter: SapLandscapeMonitor = { - grouping: { - landscape: [{ name: "Prod", topSid: ["SID1", "SID2"] }], - sapApplication: [{ name: "ERP1", topSid: ["SID1", "SID2"] }] - }, - topMetricsThresholds: [ - { name: "Instance Availability", green: 90, red: 50, yellow: 75 } - ] - }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sapLandscapeMonitorOperations.update( - resourceGroupName, - monitorName, - sapLandscapeMonitorParameter - ); - console.log(result); -} - -async function main() { - updateSapMonitor(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapSizingRecommendationsSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapSizingRecommendationsSample.ts deleted file mode 100644 index 7952cfe65fc9..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapSizingRecommendationsSample.ts +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get SAP sizing recommendations by providing input SAPS for application tier and memory required for database tier - * - * @summary Get SAP sizing recommendations by providing input SAPS for application tier and memory required for database tier - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPSizingRecommendations_S4HANA_Distributed.json - */ -async function sapSizingRecommendationsS4HanaDistributed() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const location = "centralus"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPSizingRecommendations(location); - console.log(result); -} - -/** - * This sample demonstrates how to Get SAP sizing recommendations by providing input SAPS for application tier and memory required for database tier - * - * @summary Get SAP sizing recommendations by providing input SAPS for application tier and memory required for database tier - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPSizingRecommendations_S4HANA_HA_AvSet.json - */ -async function sapSizingRecommendationsS4HanaDistributedHaAvSet() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const location = "centralus"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPSizingRecommendations(location); - console.log(result); -} - -/** - * This sample demonstrates how to Get SAP sizing recommendations by providing input SAPS for application tier and memory required for database tier - * - * @summary Get SAP sizing recommendations by providing input SAPS for application tier and memory required for database tier - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPSizingRecommendations_S4HANA_HA_AvZone.json - */ -async function sapSizingRecommendationsS4HanaDistributedHaAvZone() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const location = "centralus"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPSizingRecommendations(location); - console.log(result); -} - -/** - * This sample demonstrates how to Get SAP sizing recommendations by providing input SAPS for application tier and memory required for database tier - * - * @summary Get SAP sizing recommendations by providing input SAPS for application tier and memory required for database tier - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPSizingRecommendations_S4HANA_SingleServer.json - */ -async function sapSizingRecommendationsS4HanaSingleServer() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const location = "centralus"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPSizingRecommendations(location); - console.log(result); -} - -async function main() { - sapSizingRecommendationsS4HanaDistributed(); - sapSizingRecommendationsS4HanaDistributedHaAvSet(); - sapSizingRecommendationsS4HanaDistributedHaAvZone(); - sapSizingRecommendationsS4HanaSingleServer(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapSupportedSkuSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapSupportedSkuSample.ts deleted file mode 100644 index cb9049477a30..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapSupportedSkuSample.ts +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get a list of SAP supported SKUs for ASCS, Application and Database tier. - * - * @summary Get a list of SAP supported SKUs for ASCS, Application and Database tier. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPSupportedSkus_Distributed.json - */ -async function sapSupportedSkusDistributed() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const location = "centralus"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPSupportedSku(location); - console.log(result); -} - -/** - * This sample demonstrates how to Get a list of SAP supported SKUs for ASCS, Application and Database tier. - * - * @summary Get a list of SAP supported SKUs for ASCS, Application and Database tier. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPSupportedSkus_DistributedHA_AvSet.json - */ -async function sapSupportedSkusDistributedHaAvSet() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const location = "centralus"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPSupportedSku(location); - console.log(result); -} - -/** - * This sample demonstrates how to Get a list of SAP supported SKUs for ASCS, Application and Database tier. - * - * @summary Get a list of SAP supported SKUs for ASCS, Application and Database tier. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPSupportedSkus_DistributedHA_AvZone.json - */ -async function sapSupportedSkusDistributedHaAvZone() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const location = "centralus"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPSupportedSku(location); - console.log(result); -} - -/** - * This sample demonstrates how to Get a list of SAP supported SKUs for ASCS, Application and Database tier. - * - * @summary Get a list of SAP supported SKUs for ASCS, Application and Database tier. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPSupportedSkus_SingleServer.json - */ -async function sapSupportedSkusSingleServer() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const location = "centralus"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPSupportedSku(location); - console.log(result); -} - -async function main() { - sapSupportedSkusDistributed(); - sapSupportedSkusDistributedHaAvSet(); - sapSupportedSkusDistributedHaAvZone(); - sapSupportedSkusSingleServer(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapVirtualInstancesCreateSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapVirtualInstancesCreateSample.ts deleted file mode 100644 index a5f43e67295a..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapVirtualInstancesCreateSample.ts +++ /dev/null @@ -1,2890 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - SAPVirtualInstance, - SAPVirtualInstancesCreateOptionalParams, - WorkloadsClient -} from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_CustomFullResourceNames_Distributed.json - */ -async function createInfrastructureWithOSConfigurationWithCustomResourceNamesForDistributedSystem() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 6, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E32ds_v4" - } - }, - centralServer: { - instanceCount: 1, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E16ds_v4" - } - }, - customResourceNames: { - applicationServer: { - availabilitySetName: "appAvSet", - virtualMachines: [ - { - dataDiskNames: { default: ["app0disk0"] }, - hostName: "apphostName0", - networkInterfaces: [{ networkInterfaceName: "appnic0" }], - osDiskName: "app0osdisk", - vmName: "appvm0" - }, - { - dataDiskNames: { default: ["app1disk0"] }, - hostName: "apphostName1", - networkInterfaces: [{ networkInterfaceName: "appnic1" }], - osDiskName: "app1osdisk", - vmName: "appvm1" - } - ] - }, - centralServer: { - virtualMachines: [ - { - dataDiskNames: { default: ["ascsdisk0"] }, - hostName: "ascshostName", - networkInterfaces: [{ networkInterfaceName: "ascsnic" }], - osDiskName: "ascsosdisk", - vmName: "ascsvm" - } - ] - }, - databaseServer: { - virtualMachines: [ - { - dataDiskNames: { - hanaData: ["hanadata0", "hanadata1"], - hanaLog: ["hanalog0", "hanalog1", "hanalog2"], - hanaShared: ["hanashared0", "hanashared1"], - usrSap: ["usrsap0"] - }, - hostName: "dbhostName", - networkInterfaces: [{ networkInterfaceName: "dbnic" }], - osDiskName: "dbosdisk", - vmName: "dbvm" - } - ] - }, - namingPatternType: "FullResourceName", - sharedStorage: { - sharedStorageAccountName: "storageacc", - sharedStorageAccountPrivateEndPointName: "peForxNFS" - } - }, - databaseServer: { - databaseType: "HANA", - instanceCount: 1, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_M32ts" - } - }, - deploymentType: "ThreeTier" - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" } - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {} - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_CustomFullResourceNames_HA_AvSet.json - */ -async function createInfrastructureWithOSConfigurationWithCustomResourceNamesForHaSystemWithAvailabilitySet() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 6, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E32ds_v4" - } - }, - centralServer: { - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E16ds_v4" - } - }, - customResourceNames: { - applicationServer: { - availabilitySetName: "appAvSet", - virtualMachines: [ - { - dataDiskNames: { default: ["app0disk0"] }, - hostName: "apphostName0", - networkInterfaces: [{ networkInterfaceName: "appnic0" }], - osDiskName: "app0osdisk", - vmName: "appvm0" - }, - { - dataDiskNames: { default: ["app1disk0"] }, - hostName: "apphostName1", - networkInterfaces: [{ networkInterfaceName: "appnic1" }], - osDiskName: "app1osdisk", - vmName: "appvm1" - } - ] - }, - centralServer: { - availabilitySetName: "csAvSet", - loadBalancer: { - backendPoolNames: ["ascsBackendPool"], - frontendIpConfigurationNames: ["ascsip0", "ersip0"], - healthProbeNames: ["ascsHealthProbe", "ersHealthProbe"], - loadBalancerName: "ascslb" - }, - virtualMachines: [ - { - hostName: "ascshostName", - networkInterfaces: [{ networkInterfaceName: "ascsnic" }], - osDiskName: "ascsosdisk", - vmName: "ascsvm" - }, - { - hostName: "ershostName", - networkInterfaces: [{ networkInterfaceName: "ersnic" }], - osDiskName: "ersosdisk", - vmName: "ersvm" - } - ] - }, - databaseServer: { - availabilitySetName: "dbAvSet", - loadBalancer: { - backendPoolNames: ["dbBackendPool"], - frontendIpConfigurationNames: ["dbip"], - healthProbeNames: ["dbHealthProbe"], - loadBalancerName: "dblb" - }, - virtualMachines: [ - { - dataDiskNames: { - hanaData: ["hanadatapr0", "hanadatapr1"], - hanaLog: ["hanalogpr0", "hanalogpr1", "hanalogpr2"], - hanaShared: ["hanasharedpr0", "hanasharedpr1"], - usrSap: ["usrsappr0"] - }, - hostName: "dbprhostName", - networkInterfaces: [{ networkInterfaceName: "dbprnic" }], - osDiskName: "dbprosdisk", - vmName: "dbvmpr" - }, - { - dataDiskNames: { - hanaData: ["hanadatasr0", "hanadatasr1"], - hanaLog: ["hanalogsr0", "hanalogsr1", "hanalogsr2"], - hanaShared: ["hanasharedsr0", "hanasharedsr1"], - usrSap: ["usrsapsr0"] - }, - hostName: "dbsrhostName", - networkInterfaces: [{ networkInterfaceName: "dbsrnic" }], - osDiskName: "dbsrosdisk", - vmName: "dbvmsr" - } - ] - }, - namingPatternType: "FullResourceName", - sharedStorage: { - sharedStorageAccountName: "storageacc", - sharedStorageAccountPrivateEndPointName: "peForxNFS" - } - }, - databaseServer: { - databaseType: "HANA", - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_M32ts" - } - }, - deploymentType: "ThreeTier", - highAvailabilityConfig: { highAvailabilityType: "AvailabilitySet" } - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" } - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {} - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_CustomFullResourceNames_HA_AvZone.json - */ -async function createInfrastructureWithOSConfigurationWithCustomResourceNamesForHaSystemWithAvailabilityZone() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 6, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E32ds_v4" - } - }, - centralServer: { - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E16ds_v4" - } - }, - customResourceNames: { - applicationServer: { - virtualMachines: [ - { - dataDiskNames: { default: ["app0disk0"] }, - hostName: "apphostName0", - networkInterfaces: [{ networkInterfaceName: "appnic0" }], - osDiskName: "app0osdisk", - vmName: "appvm0" - }, - { - dataDiskNames: { default: ["app1disk0"] }, - hostName: "apphostName1", - networkInterfaces: [{ networkInterfaceName: "appnic1" }], - osDiskName: "app1osdisk", - vmName: "appvm1" - } - ] - }, - centralServer: { - loadBalancer: { - backendPoolNames: ["ascsBackendPool"], - frontendIpConfigurationNames: ["ascsip0", "ersip0"], - healthProbeNames: ["ascsHealthProbe", "ersHealthProbe"], - loadBalancerName: "ascslb" - }, - virtualMachines: [ - { - hostName: "ascshostName", - networkInterfaces: [{ networkInterfaceName: "ascsnic" }], - osDiskName: "ascsosdisk", - vmName: "ascsvm" - }, - { - hostName: "ershostName", - networkInterfaces: [{ networkInterfaceName: "ersnic" }], - osDiskName: "ersosdisk", - vmName: "ersvm" - } - ] - }, - databaseServer: { - loadBalancer: { - backendPoolNames: ["dbBackendPool"], - frontendIpConfigurationNames: ["dbip"], - healthProbeNames: ["dbHealthProbe"], - loadBalancerName: "dblb" - }, - virtualMachines: [ - { - dataDiskNames: { - hanaData: ["hanadatapr0", "hanadatapr1"], - hanaLog: ["hanalogpr0", "hanalogpr1", "hanalogpr2"], - hanaShared: ["hanasharedpr0", "hanasharedpr1"], - usrSap: ["usrsappr0"] - }, - hostName: "dbprhostName", - networkInterfaces: [{ networkInterfaceName: "dbprnic" }], - osDiskName: "dbprosdisk", - vmName: "dbvmpr" - }, - { - dataDiskNames: { - hanaData: ["hanadatasr0", "hanadatasr1"], - hanaLog: ["hanalogsr0", "hanalogsr1", "hanalogsr2"], - hanaShared: ["hanasharedsr0", "hanasharedsr1"], - usrSap: ["usrsapsr0"] - }, - hostName: "dbsrhostName", - networkInterfaces: [{ networkInterfaceName: "dbsrnic" }], - osDiskName: "dbsrosdisk", - vmName: "dbvmsr" - } - ] - }, - namingPatternType: "FullResourceName", - sharedStorage: { - sharedStorageAccountName: "storageacc", - sharedStorageAccountPrivateEndPointName: "peForxNFS" - } - }, - databaseServer: { - databaseType: "HANA", - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_M32ts" - } - }, - deploymentType: "ThreeTier", - highAvailabilityConfig: { highAvailabilityType: "AvailabilityZone" } - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" } - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {} - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_CustomFullResourceNames_SingleServer.json - */ -async function createInfrastructureWithOSConfigurationWithCustomResourceNamesForSingleServerSystem() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - databaseType: "HANA", - deploymentType: "SingleServer", - networkConfiguration: { isSecondaryIpEnabled: true }, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E32ds_v4" - } - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" } - }, - environment: "NonProd", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {} - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_Distributed.json - */ -async function createInfrastructureOnlyForDistributedSystem() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "Deployment", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 6, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - ssh: { publicKeys: [{ keyData: "ssh-rsa public key" }] } - } - }, - vmSize: "Standard_E32ds_v4" - } - }, - centralServer: { - instanceCount: 1, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - ssh: { publicKeys: [{ keyData: "ssh-rsa public key" }] } - } - }, - vmSize: "Standard_E16ds_v4" - } - }, - databaseServer: { - databaseType: "HANA", - instanceCount: 1, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - ssh: { publicKeys: [{ keyData: "ssh-rsa public key" }] } - } - }, - vmSize: "Standard_M32ts" - } - }, - deploymentType: "ThreeTier" - } - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {} - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_HA_AvSet.json - */ -async function createInfrastructureOnlyForHaSystemWithAvailabilitySet() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "Deployment", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 5, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - ssh: { publicKeys: [{ keyData: "ssh-rsa public key" }] } - } - }, - vmSize: "Standard_E32ds_v4" - } - }, - centralServer: { - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - ssh: { publicKeys: [{ keyData: "ssh-rsa public key" }] } - } - }, - vmSize: "Standard_E16ds_v4" - } - }, - databaseServer: { - databaseType: "HANA", - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - ssh: { publicKeys: [{ keyData: "ssh-rsa public key" }] } - } - }, - vmSize: "Standard_M32ts" - } - }, - deploymentType: "ThreeTier", - highAvailabilityConfig: { highAvailabilityType: "AvailabilitySet" } - } - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {} - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_HA_AvZone.json - */ -async function createInfrastructureOnlyForHaSystemWithAvailabilityZone() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "Deployment", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 6, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - ssh: { publicKeys: [{ keyData: "ssh-rsa public key" }] } - } - }, - vmSize: "Standard_E32ds_v4" - } - }, - centralServer: { - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - ssh: { publicKeys: [{ keyData: "ssh-rsa public key" }] } - } - }, - vmSize: "Standard_E16ds_v4" - } - }, - databaseServer: { - databaseType: "HANA", - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - ssh: { publicKeys: [{ keyData: "ssh-rsa public key" }] } - } - }, - vmSize: "Standard_M32ts" - } - }, - deploymentType: "ThreeTier", - highAvailabilityConfig: { highAvailabilityType: "AvailabilityZone" } - } - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {} - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_SingleServer.json - */ -async function createInfrastructureOnlyForSingleServerSystem() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "Deployment", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - databaseType: "HANA", - deploymentType: "SingleServer", - networkConfiguration: { isSecondaryIpEnabled: true }, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - ssh: { publicKeys: [{ keyData: "ssh-rsa public key" }] } - } - }, - vmSize: "Standard_E32ds_v4" - } - } - }, - environment: "NonProd", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {} - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_DiskDetails_Distributed.json - */ -async function createInfrastructureWithDiskAndOSConfigurationForDistributedSystemRecommended() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 6, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E32ds_v4" - } - }, - centralServer: { - instanceCount: 1, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E16ds_v4" - } - }, - databaseServer: { - databaseType: "HANA", - diskConfiguration: { - diskVolumeConfigurations: { - backup: { - count: 2, - sizeGB: 256, - sku: { name: "StandardSSD_LRS" } - }, - "hana/data": { - count: 4, - sizeGB: 128, - sku: { name: "Premium_LRS" } - }, - "hana/log": { - count: 3, - sizeGB: 128, - sku: { name: "Premium_LRS" } - }, - "hana/shared": { - count: 1, - sizeGB: 256, - sku: { name: "StandardSSD_LRS" } - }, - os: { count: 1, sizeGB: 64, sku: { name: "StandardSSD_LRS" } }, - "usr/sap": { count: 1, sizeGB: 128, sku: { name: "Premium_LRS" } } - } - }, - instanceCount: 1, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_M32ts" - } - }, - deploymentType: "ThreeTier" - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" } - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {} - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_DiskDetails_HA_AvSet.json - */ -async function createInfrastructureWithDiskAndOSConfigurationForHaSystemWithAvailabilitySetRecommended() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 6, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E32ds_v4" - } - }, - centralServer: { - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E16ds_v4" - } - }, - databaseServer: { - databaseType: "HANA", - diskConfiguration: { - diskVolumeConfigurations: { - backup: { - count: 2, - sizeGB: 256, - sku: { name: "StandardSSD_LRS" } - }, - "hana/data": { - count: 4, - sizeGB: 128, - sku: { name: "Premium_LRS" } - }, - "hana/log": { - count: 3, - sizeGB: 128, - sku: { name: "Premium_LRS" } - }, - "hana/shared": { - count: 1, - sizeGB: 256, - sku: { name: "StandardSSD_LRS" } - }, - os: { count: 1, sizeGB: 64, sku: { name: "StandardSSD_LRS" } }, - "usr/sap": { count: 1, sizeGB: 128, sku: { name: "Premium_LRS" } } - } - }, - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_M32ts" - } - }, - deploymentType: "ThreeTier", - highAvailabilityConfig: { highAvailabilityType: "AvailabilitySet" } - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" } - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {} - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_DiskDetails_HA_AvZone.json - */ -async function createInfrastructureWithDiskAndOSConfigurationForHaSystemWithAvailabilityZoneRecommended() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 6, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E32ds_v4" - } - }, - centralServer: { - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E16ds_v4" - } - }, - databaseServer: { - databaseType: "HANA", - diskConfiguration: { - diskVolumeConfigurations: { - backup: { - count: 2, - sizeGB: 256, - sku: { name: "StandardSSD_LRS" } - }, - "hana/data": { - count: 4, - sizeGB: 128, - sku: { name: "Premium_LRS" } - }, - "hana/log": { - count: 3, - sizeGB: 128, - sku: { name: "Premium_LRS" } - }, - "hana/shared": { - count: 1, - sizeGB: 256, - sku: { name: "StandardSSD_LRS" } - }, - os: { count: 1, sizeGB: 64, sku: { name: "StandardSSD_LRS" } }, - "usr/sap": { count: 1, sizeGB: 128, sku: { name: "Premium_LRS" } } - } - }, - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_M32ts" - } - }, - deploymentType: "ThreeTier", - highAvailabilityConfig: { highAvailabilityType: "AvailabilityZone" } - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" } - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {} - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_DiskDetails_SingleServer.json - */ -async function createInfrastructureWithDiskAndOSConfigurationsForSingleServerSystemRecommended() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - databaseType: "HANA", - dbDiskConfiguration: { - diskVolumeConfigurations: { - backup: { count: 2, sizeGB: 256, sku: { name: "StandardSSD_LRS" } }, - "hana/data": { - count: 4, - sizeGB: 128, - sku: { name: "Premium_LRS" } - }, - "hana/log": { count: 3, sizeGB: 128, sku: { name: "Premium_LRS" } }, - "hana/shared": { - count: 1, - sizeGB: 256, - sku: { name: "StandardSSD_LRS" } - }, - os: { count: 1, sizeGB: 64, sku: { name: "StandardSSD_LRS" } }, - "usr/sap": { count: 1, sizeGB: 128, sku: { name: "Premium_LRS" } } - } - }, - deploymentType: "SingleServer", - networkConfiguration: { isSecondaryIpEnabled: true }, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E32ds_v4" - } - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" } - }, - environment: "NonProd", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {} - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_Distributed.json - */ -async function createInfrastructureWithOSConfigurationForDistributedSystemRecommended() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 6, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E32ds_v4" - } - }, - centralServer: { - instanceCount: 1, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E16ds_v4" - } - }, - databaseServer: { - databaseType: "HANA", - instanceCount: 1, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_M32ts" - } - }, - deploymentType: "ThreeTier" - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" } - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {} - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_HA_AvSet.json - */ -async function createInfrastructureWithOSConfigurationForHaSystemWithAvailabilitySetRecommended() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 6, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E32ds_v4" - } - }, - centralServer: { - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E16ds_v4" - } - }, - databaseServer: { - databaseType: "HANA", - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_M32ts" - } - }, - deploymentType: "ThreeTier", - highAvailabilityConfig: { highAvailabilityType: "AvailabilitySet" } - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" } - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {} - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_HA_AvZone.json - */ -async function createInfrastructureWithOSConfigurationForHaSystemWithAvailabilityZoneRecommended() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 6, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E32ds_v4" - } - }, - centralServer: { - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E16ds_v4" - } - }, - databaseServer: { - databaseType: "HANA", - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_M32ts" - } - }, - deploymentType: "ThreeTier", - highAvailabilityConfig: { highAvailabilityType: "AvailabilityZone" } - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" } - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {} - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_SingleServer.json - */ -async function createInfrastructureWithOSConfigurationForSingleServerSystemRecommended() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - databaseType: "HANA", - deploymentType: "SingleServer", - networkConfiguration: { isSecondaryIpEnabled: true }, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E32ds_v4" - } - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" } - }, - environment: "NonProd", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {} - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_Distributed_CreateTransport.json - */ -async function createInfrastructureWithANewSapTransportDirectoryFileshare() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 6, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E32ds_v4" - } - }, - centralServer: { - instanceCount: 1, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E16ds_v4" - } - }, - databaseServer: { - databaseType: "HANA", - instanceCount: 1, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_M32ts" - } - }, - deploymentType: "ThreeTier", - storageConfiguration: { - transportFileShareConfiguration: { - configurationType: "CreateAndMount", - resourceGroup: "rgName", - storageAccountName: "storageName" - } - } - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" } - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {} - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_Distributed_MountTransport.json - */ -async function createInfrastructureWithAnExistingSapTransportDirectoryFileshare() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 6, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E32ds_v4" - } - }, - centralServer: { - instanceCount: 1, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E16ds_v4" - } - }, - databaseServer: { - databaseType: "HANA", - instanceCount: 1, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_M32ts" - } - }, - deploymentType: "ThreeTier", - storageConfiguration: { - transportFileShareConfiguration: { - configurationType: "Mount", - id: - "/subscriptions/49d64d54-e888-4c46-a868-1936802b762c/resourceGroups/testrg/providers/Microsoft.Network/privateEndpoints/endpoint", - privateEndpointId: - "/subscriptions/49d64d54-e888-4c46-a868-1936802b762c/resourceGroups/testrg/providers/Microsoft.Network/privateEndpoints/endpoint" - } - } - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" } - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {} - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_Distributed_SkipTransport.json - */ -async function createInfrastructureWithoutASapTransportDirectoryFileshare() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 6, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E32ds_v4" - } - }, - centralServer: { - instanceCount: 1, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E16ds_v4" - } - }, - databaseServer: { - databaseType: "HANA", - instanceCount: 1, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_M32ts" - } - }, - deploymentType: "ThreeTier", - storageConfiguration: { - transportFileShareConfiguration: { configurationType: "Skip" } - } - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" } - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {} - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_DetectInstallation_Distributed.json - */ -async function detectSapSoftwareInstallationOnADistributedSystem() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "{{resourcegrp}}", - applicationServer: { - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP-HA", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "azureuser", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { - privateKey: "{{privateKey}}", - publicKey: "{{sshkey}}" - } - } - }, - vmSize: "Standard_E4ds_v4" - } - }, - centralServer: { - instanceCount: 1, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP-HA", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "azureuser", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { - privateKey: "{{privateKey}}", - publicKey: "{{sshkey}}" - } - } - }, - vmSize: "Standard_E4ds_v4" - } - }, - databaseServer: { - instanceCount: 1, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP-HA", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "azureuser", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { - privateKey: "{{privateKey}}", - publicKey: "{{sshkey}}" - } - } - }, - vmSize: "Standard_M32ts" - } - }, - deploymentType: "ThreeTier", - networkConfiguration: { isSecondaryIpEnabled: true } - }, - osSapConfiguration: { sapFqdn: "sap.bpaas.com" }, - softwareConfiguration: { - centralServerVmId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0", - softwareInstallationType: "External" - } - }, - environment: "Prod", - location: "eastus2", - sapProduct: "S4HANA", - tags: { createdBy: "azureuser" } - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_DetectInstallation_SingleServer.json - */ -async function detectSapSoftwareInstallationOnASingleServerSystem() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - databaseType: "HANA", - deploymentType: "SingleServer", - networkConfiguration: { isSecondaryIpEnabled: true }, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP-HA", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E32ds_v4" - } - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" }, - softwareConfiguration: { - centralServerVmId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0", - softwareInstallationType: "External" - } - }, - environment: "NonProd", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {} - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_DetectInstallation_HA_AvSet.json - */ -async function detectSapSoftwareInstallationOnAnHaSystemWithAvailabilitySet() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 6, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP-HA", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E32ds_v4" - } - }, - centralServer: { - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP-HA", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E16ds_v4" - } - }, - databaseServer: { - databaseType: "HANA", - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP-HA", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_M32ts" - } - }, - deploymentType: "ThreeTier", - highAvailabilityConfig: { highAvailabilityType: "AvailabilitySet" } - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" }, - softwareConfiguration: { - centralServerVmId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0", - softwareInstallationType: "External" - } - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {} - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_DetectInstallation_HA_AvZone.json - */ -async function detectSapSoftwareInstallationOnAnHaSystemWithAvailabilityZone() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "X00-RG", - applicationServer: { - instanceCount: 6, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP-HA", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E32ds_v4" - } - }, - centralServer: { - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP-HA", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_E16ds_v4" - } - }, - databaseServer: { - databaseType: "HANA", - instanceCount: 2, - subnetId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP-HA", - publisher: "RedHat", - sku: "84sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "{your-username}", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { privateKey: "xyz", publicKey: "abc" } - } - }, - vmSize: "Standard_M32ts" - } - }, - deploymentType: "ThreeTier", - highAvailabilityConfig: { highAvailabilityType: "AvailabilityZone" } - }, - osSapConfiguration: { sapFqdn: "xyz.test.com" }, - softwareConfiguration: { - centralServerVmId: - "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0", - softwareInstallationType: "External" - } - }, - environment: "Prod", - location: "westcentralus", - sapProduct: "S4HANA", - tags: {} - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Install_Distributed.json - */ -async function installSapSoftwareOnDistributedSystem() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "{{resourcegrp}}", - applicationServer: { - instanceCount: 2, - subnetId: - "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP-HA", - publisher: "RedHat", - sku: "8.2", - version: "8.2.2021091201" - }, - osProfile: { - adminUsername: "azureuser", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { - privateKey: "{{privateKey}}", - publicKey: "{{sshkey}}" - } - } - }, - vmSize: "Standard_E4ds_v4" - } - }, - centralServer: { - instanceCount: 1, - subnetId: - "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP-HA", - publisher: "RedHat", - sku: "8.2", - version: "8.2.2021091201" - }, - osProfile: { - adminUsername: "azureuser", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { - privateKey: "{{privateKey}}", - publicKey: "{{sshkey}}" - } - } - }, - vmSize: "Standard_E4ds_v4" - } - }, - databaseServer: { - instanceCount: 1, - subnetId: - "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app", - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP-HA", - publisher: "RedHat", - sku: "8.2", - version: "8.2.2021091201" - }, - osProfile: { - adminUsername: "azureuser", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { - privateKey: "{{privateKey}}", - publicKey: "{{sshkey}}" - } - } - }, - vmSize: "Standard_M32ts" - } - }, - deploymentType: "ThreeTier", - networkConfiguration: { isSecondaryIpEnabled: true } - }, - osSapConfiguration: { sapFqdn: "sap.bpaas.com" }, - softwareConfiguration: { - bomUrl: - "https://teststorageaccount.blob.core.windows.net/sapbits/sapfiles/boms/S41909SPS03_v0011ms/S41909SPS03_v0011ms.yaml", - sapBitsStorageAccountId: - "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Storage/storageAccounts/teststorageaccount", - softwareInstallationType: "SAPInstallWithoutOSConfig", - softwareVersion: "SAP S/4HANA 1909 SPS 03" - } - }, - environment: "Prod", - location: "eastus2", - sapProduct: "S4HANA", - tags: { createdBy: "azureuser" } - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Install_SingleServer.json - */ -async function installSapSoftwareOnSingleServerSystem() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - appLocation: "eastus", - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: "test-rg", - deploymentType: "SingleServer", - subnetId: - "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/testsubnet", - virtualMachineConfiguration: { - imageReference: { - offer: "SLES-SAP", - publisher: "SUSE", - sku: "12-sp4-gen2", - version: "2022.02.01" - }, - osProfile: { - adminUsername: "azureappadmin", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { - privateKey: "{{privateKey}}", - publicKey: "{{sshkey}}" - } - } - }, - vmSize: "Standard_E32ds_v4" - } - }, - osSapConfiguration: { sapFqdn: "sap.bpaas.com" }, - softwareConfiguration: { - bomUrl: - "https://teststorageaccount.blob.core.windows.net/sapbits/sapfiles/boms/S41909SPS03_v0011ms/S41909SPS03_v0011ms.yaml", - sapBitsStorageAccountId: - "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Storage/storageAccounts/teststorageaccount", - softwareInstallationType: "SAPInstallWithoutOSConfig", - softwareVersion: "SAP S/4HANA 1909 SPS 03" - } - }, - environment: "NonProd", - location: "eastus2", - sapProduct: "S4HANA", - tags: {} - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_Discover_CustomMrgStorageAccountName.json - */ -async function registerExistingSapSystemAsVirtualInstanceForSapSolutionsWithOptionalCustomizations() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - centralServerVmId: - "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0", - configurationType: "Discovery", - managedRgStorageAccountName: "q20saacssgrs" - }, - environment: "NonProd", - location: "northeurope", - sapProduct: "S4HANA", - tags: { createdby: "abc@microsoft.com", test: "abc" } - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -/** - * This sample demonstrates how to Creates a Virtual Instance for SAP solutions (VIS) resource - * - * @summary Creates a Virtual Instance for SAP solutions (VIS) resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Create_Discover.json - */ -async function registerExistingSapSystemAsVirtualInstanceForSapSolutions() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: SAPVirtualInstance = { - configuration: { - centralServerVmId: - "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0", - configurationType: "Discovery" - }, - environment: "NonProd", - location: "northeurope", - sapProduct: "S4HANA", - tags: { createdby: "abc@microsoft.com", test: "abc" } - }; - const options: SAPVirtualInstancesCreateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -async function main() { - createInfrastructureWithOSConfigurationWithCustomResourceNamesForDistributedSystem(); - createInfrastructureWithOSConfigurationWithCustomResourceNamesForHaSystemWithAvailabilitySet(); - createInfrastructureWithOSConfigurationWithCustomResourceNamesForHaSystemWithAvailabilityZone(); - createInfrastructureWithOSConfigurationWithCustomResourceNamesForSingleServerSystem(); - createInfrastructureOnlyForDistributedSystem(); - createInfrastructureOnlyForHaSystemWithAvailabilitySet(); - createInfrastructureOnlyForHaSystemWithAvailabilityZone(); - createInfrastructureOnlyForSingleServerSystem(); - createInfrastructureWithDiskAndOSConfigurationForDistributedSystemRecommended(); - createInfrastructureWithDiskAndOSConfigurationForHaSystemWithAvailabilitySetRecommended(); - createInfrastructureWithDiskAndOSConfigurationForHaSystemWithAvailabilityZoneRecommended(); - createInfrastructureWithDiskAndOSConfigurationsForSingleServerSystemRecommended(); - createInfrastructureWithOSConfigurationForDistributedSystemRecommended(); - createInfrastructureWithOSConfigurationForHaSystemWithAvailabilitySetRecommended(); - createInfrastructureWithOSConfigurationForHaSystemWithAvailabilityZoneRecommended(); - createInfrastructureWithOSConfigurationForSingleServerSystemRecommended(); - createInfrastructureWithANewSapTransportDirectoryFileshare(); - createInfrastructureWithAnExistingSapTransportDirectoryFileshare(); - createInfrastructureWithoutASapTransportDirectoryFileshare(); - detectSapSoftwareInstallationOnADistributedSystem(); - detectSapSoftwareInstallationOnASingleServerSystem(); - detectSapSoftwareInstallationOnAnHaSystemWithAvailabilitySet(); - detectSapSoftwareInstallationOnAnHaSystemWithAvailabilityZone(); - installSapSoftwareOnDistributedSystem(); - installSapSoftwareOnSingleServerSystem(); - registerExistingSapSystemAsVirtualInstanceForSapSolutionsWithOptionalCustomizations(); - registerExistingSapSystemAsVirtualInstanceForSapSolutions(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapVirtualInstancesDeleteSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapVirtualInstancesDeleteSample.ts deleted file mode 100644 index abd0b22a458c..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapVirtualInstancesDeleteSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to 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. - * - * @summary 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. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Delete.json - */ -async function sapVirtualInstancesDelete() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginDeleteAndWait( - resourceGroupName, - sapVirtualInstanceName - ); - console.log(result); -} - -async function main() { - sapVirtualInstancesDelete(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapVirtualInstancesGetSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapVirtualInstancesGetSample.ts deleted file mode 100644 index 834a41533195..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapVirtualInstancesGetSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets a Virtual Instance for SAP solutions resource - * - * @summary Gets a Virtual Instance for SAP solutions resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Get.json - */ -async function sapVirtualInstancesGet() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.get( - resourceGroupName, - sapVirtualInstanceName - ); - console.log(result); -} - -async function main() { - sapVirtualInstancesGet(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapVirtualInstancesListByResourceGroupSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapVirtualInstancesListByResourceGroupSample.ts deleted file mode 100644 index e6141d812e3e..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapVirtualInstancesListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets all Virtual Instances for SAP solutions resources in a Resource Group. - * - * @summary Gets all Virtual Instances for SAP solutions resources in a Resource Group. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_ListByResourceGroup.json - */ -async function sapVirtualInstancesListByResourceGroup() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "6d875e77-e412-4d7d-9af4-8895278b4443"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.sAPVirtualInstances.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - sapVirtualInstancesListByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapVirtualInstancesListBySubscriptionSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapVirtualInstancesListBySubscriptionSample.ts deleted file mode 100644 index e474f61f5cbf..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapVirtualInstancesListBySubscriptionSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets all Virtual Instances for SAP solutions resources in a Subscription. - * - * @summary Gets all Virtual Instances for SAP solutions resources in a Subscription. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_ListBySubscription.json - */ -async function sapVirtualInstancesListBySubscription() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "6d875e77-e412-4d7d-9af4-8895278b4443"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.sAPVirtualInstances.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - sapVirtualInstancesListBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapVirtualInstancesStartSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapVirtualInstancesStartSample.ts deleted file mode 100644 index b9bb4f738d01..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapVirtualInstancesStartSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { WorkloadsClient } from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Starts the SAP application, that is the Central Services instance and Application server instances. - * - * @summary Starts the SAP application, that is the Central Services instance and Application server instances. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Start.json - */ -async function sapVirtualInstancesStart() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginStartAndWait( - resourceGroupName, - sapVirtualInstanceName - ); - console.log(result); -} - -async function main() { - sapVirtualInstancesStart(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapVirtualInstancesStopSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapVirtualInstancesStopSample.ts deleted file mode 100644 index 22521588e301..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapVirtualInstancesStopSample.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - StopRequest, - SAPVirtualInstancesStopOptionalParams, - WorkloadsClient -} from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Stops the SAP Application, that is the Application server instances and Central Services instance. - * - * @summary Stops the SAP Application, that is the Application server instances and Central Services instance. - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Stop.json - */ -async function sapVirtualInstancesStop() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: StopRequest = { softStopTimeoutSeconds: 0 }; - const options: SAPVirtualInstancesStopOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.beginStopAndWait( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -async function main() { - sapVirtualInstancesStop(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapVirtualInstancesUpdateSample.ts b/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapVirtualInstancesUpdateSample.ts deleted file mode 100644 index 090a1d35b9e4..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/src/sapVirtualInstancesUpdateSample.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - UpdateSAPVirtualInstanceRequest, - SAPVirtualInstancesUpdateOptionalParams, - WorkloadsClient -} from "@azure/arm-workloads"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Updates a Virtual Instance for SAP solutions resource - * - * @summary Updates a Virtual Instance for SAP solutions resource - * x-ms-original-file: specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/examples/sapvirtualinstances/SAPVirtualInstances_Update.json - */ -async function sapVirtualInstancesUpdate() { - const subscriptionId = - process.env["WORKLOADS_SUBSCRIPTION_ID"] || - "8e17e36c-42e9-4cd5-a078-7b44883414e0"; - const resourceGroupName = - process.env["WORKLOADS_RESOURCE_GROUP"] || "test-rg"; - const sapVirtualInstanceName = "X00"; - const body: UpdateSAPVirtualInstanceRequest = { - identity: { type: "None" }, - tags: { key1: "svi1" } - }; - const options: SAPVirtualInstancesUpdateOptionalParams = { body }; - const credential = new DefaultAzureCredential(); - const client = new WorkloadsClient(credential, subscriptionId); - const result = await client.sAPVirtualInstances.update( - resourceGroupName, - sapVirtualInstanceName, - options - ); - console.log(result); -} - -async function main() { - sapVirtualInstancesUpdate(); -} - -main().catch(console.error); diff --git a/sdk/workloads/arm-workloads/samples/v1/typescript/tsconfig.json b/sdk/workloads/arm-workloads/samples/v1/typescript/tsconfig.json deleted file mode 100644 index e26ce2a6d8f7..000000000000 --- a/sdk/workloads/arm-workloads/samples/v1/typescript/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2020", - "module": "commonjs", - "moduleResolution": "node", - "resolveJsonModule": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "strict": true, - "alwaysStrict": true, - "outDir": "dist", - "rootDir": "src" - }, - "include": [ - "src/**.ts" - ] -} diff --git a/sdk/workloads/arm-workloads/src/workloadsClient.ts b/sdk/workloads/arm-workloads/src/workloadsClient.ts index 00acb3e56c26..61bbde3431b7 100644 --- a/sdk/workloads/arm-workloads/src/workloadsClient.ts +++ b/sdk/workloads/arm-workloads/src/workloadsClient.ts @@ -80,7 +80,7 @@ export class WorkloadsClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-workloads/1.0.0`; + const packageDetails = `azsdk-js-arm-workloads/1.0.1`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` diff --git a/sdk/workloads/arm-workloads/test/sampleTest.ts b/sdk/workloads/arm-workloads/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/workloads/arm-workloads/test/sampleTest.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + Recorder, + RecorderStartOptions, + env +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/workloads/arm-workloads/test/workloads_examples.ts b/sdk/workloads/arm-workloads/test/workloads_examples.ts deleted file mode 100644 index bc937f82fdd1..000000000000 --- a/sdk/workloads/arm-workloads/test/workloads_examples.ts +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { - env, - Recorder, - RecorderStartOptions, - delay, - isPlaybackMode, -} from "@azure-tools/test-recorder"; -import { createTestCredential } from "@azure-tools/test-credential"; -import { assert } from "chai"; -import { Context } from "mocha"; -import { WorkloadsClient } from "../src/workloadsClient" -import { Monitor } from "../src/models"; - -const replaceableVariables: Record = { - AZURE_CLIENT_ID: "azure_client_id", - AZURE_CLIENT_SECRET: "azure_client_secret", - AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", - SUBSCRIPTION_ID: "azure_subscription_id" -}; - -const recorderOptions: RecorderStartOptions = { - envSetupForPlayback: replaceableVariables -}; - -export const testPollingOptions = { - updateIntervalInMs: isPlaybackMode() ? 0 : undefined, -}; - -describe("workloads test", () => { - let recorder: Recorder; - let subscriptionId: string; - let client: WorkloadsClient; - let resourceGroup: string; - let monitorName: string; - let monitorParameter: Monitor; - let sapVirtualInstanceName: string; - let location: string; - - beforeEach(async function (this: Context) { - recorder = new Recorder(this.currentTest); - await recorder.start(recorderOptions); - subscriptionId = env.SUBSCRIPTION_ID || ''; - // This is an example of how the environment variables are used - const credential = createTestCredential(); - client = new WorkloadsClient(credential, subscriptionId, recorder.configureClientOptions({})); - resourceGroup = "myjstest"; - monitorName = "myMonitor"; - sapVirtualInstanceName = "O13"; - location = "eastus2" - }); - - afterEach(async function () { - await recorder.stop(); - }); - - //create monitors - it("Workloads create test", async function () { - monitorParameter = { - appLocation: "eastus2", - location: "eastus2", - logAnalyticsWorkspaceArmId: - "/subscriptions/" + subscriptionId + "/resourcegroups/myjstest/providers/microsoft.operationalinsights/workspaces/myWorkspace", - managedResourceGroupConfiguration: { name: "myManagedRg" }, - monitorSubnet: - "/subscriptions/" + subscriptionId + "/resourceGroups/myjstest/providers/Microsoft.Network/virtualNetworks/virtualnetworkabc/subnets/mySubnet", - routingPreference: "RouteAll", - tags: { key: "value" } - }; - const res = await client.monitors.beginCreateAndWait(resourceGroup, monitorName, monitorParameter) - assert.equal(res.name, monitorName); - }); - - //create svi - it.skip("svi create test", async function () { - const subnetId = "/subscriptions/" + subscriptionId + "/resourceGroups/myjstest/providers/Microsoft.Networks/virtualNetworks/networknamex/subnets/subnetworknamex" - const res = await client.sAPVirtualInstances.beginCreateAndWait( - resourceGroup, - sapVirtualInstanceName, - { - body: { - configuration: { - appLocation: location, - configurationType: "DeploymentWithOSConfig", - infrastructureConfiguration: { - appResourceGroup: resourceGroup, - databaseType: "HANA", - deploymentType: "SingleServer", - networkConfiguration: { isSecondaryIpEnabled: true }, - subnetId, - virtualMachineConfiguration: { - imageReference: { - offer: "RHEL-SAP-HA", - publisher: "RedHat", - sku: "82sapha-gen2", - version: "latest" - }, - osProfile: { - adminUsername: "testuser", - osConfiguration: { - disablePasswordAuthentication: true, - osType: "Linux", - sshKeyPair: { - publicKey: "", - privateKey: "" - } - } - }, - vmSize: "Standard_E32ds_v4" - } - }, - osSapConfiguration: { sapFqdn: "sap.test.com" }, - }, - environment: "NonProd", - location, - sapProduct: "S4HANA", - tags: {}, - managedResourceGroupConfiguration: { - "name": "mrg-Y13-bf4ab3" - } - } - } - ); - assert.equal(res.name, monitorName); - }).timeout(3600000); - - //get svi - it.skip("svi get test", async function () { - //get monitors from workloads - const res = await client.sAPVirtualInstances.get(resourceGroup, sapVirtualInstanceName); - assert.equal(res.name, sapVirtualInstanceName); - }); - - //get monitors - it("Workloads get test", async function () { - //get monitors from workloads - const res = await client.monitors.get(resourceGroup, monitorName); - assert.equal(res.name, monitorName); - }); - - //list Workloads - it("Workloads list test", async function () { - //list monitors from workloads - const res = await client.monitors.list() - const resArray = []; - for await (let item of res) { - resArray.push(item); - } - assert.equal(resArray.length, 1); - }); - - //delete monitors - it("Workloads delete test", async function () { - const res = await client.monitors.beginDeleteAndWait(resourceGroup, monitorName); - const resArray = new Array(); - for await (let item of client.monitors.listByResourceGroup(resourceGroup)) { - resArray.push(item); - } - assert.equal(resArray.length, 0); - }); - - //delete svi - it.skip("svi delete test", async function () { - const res = await client.sAPVirtualInstances.beginDeleteAndWait(resourceGroup, sapVirtualInstanceName); - const resArray = new Array(); - for await (let item of client.sAPVirtualInstances.listByResourceGroup(resourceGroup)) { - resArray.push(item); - } - assert.equal(resArray.length, 1); - }); -}); diff --git a/sdk/workloads/arm-workloads/tsconfig.json b/sdk/workloads/arm-workloads/tsconfig.json index cd59b27395e6..3e6ae96443f3 100644 --- a/sdk/workloads/arm-workloads/tsconfig.json +++ b/sdk/workloads/arm-workloads/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-workloads": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"