From 7e0bcb838910530e79f5208cf0ece70a6016b5c7 Mon Sep 17 00:00:00 2001 From: kazrael2119 <98569699+kazrael2119@users.noreply.github.com> Date: Fri, 30 Jun 2023 16:39:45 +0800 Subject: [PATCH 1/3] batch release --- common/config/rush/pnpm-lock.yaml | 37 ++-- sdk/batch/arm-batch/CHANGELOG.md | 32 ++- sdk/batch/arm-batch/LICENSE | 2 +- sdk/batch/arm-batch/_meta.json | 8 +- sdk/batch/arm-batch/assets.json | 2 +- sdk/batch/arm-batch/package.json | 11 +- sdk/batch/arm-batch/review/arm-batch.api.md | 43 ++-- .../samples-dev/applicationCreateSample.ts | 16 +- .../samples-dev/applicationDeleteSample.ts | 16 +- .../samples-dev/applicationGetSample.ts | 16 +- .../samples-dev/applicationListSample.ts | 16 +- .../applicationPackageActivateSample.ts | 16 +- .../applicationPackageCreateSample.ts | 16 +- .../applicationPackageDeleteSample.ts | 16 +- .../applicationPackageGetSample.ts | 16 +- .../applicationPackageListSample.ts | 16 +- .../samples-dev/applicationUpdateSample.ts | 16 +- .../samples-dev/batchAccountCreateSample.ts | 56 +++--- .../samples-dev/batchAccountDeleteSample.ts | 16 +- .../batchAccountGetDetectorSample.ts | 16 +- .../samples-dev/batchAccountGetKeysSample.ts | 16 +- .../samples-dev/batchAccountGetSample.ts | 26 ++- .../batchAccountListByResourceGroupSample.ts | 16 +- .../batchAccountListDetectorsSample.ts | 16 +- ...boundNetworkDependenciesEndpointsSample.ts | 16 +- .../samples-dev/batchAccountListSample.ts | 13 +- .../batchAccountRegenerateKeySample.ts | 16 +- ...AccountSynchronizeAutoStorageKeysSample.ts | 16 +- .../samples-dev/batchAccountUpdateSample.ts | 16 +- .../certificateCancelDeletionSample.ts | 16 +- .../samples-dev/certificateCreateSample.ts | 36 ++-- .../samples-dev/certificateDeleteSample.ts | 16 +- .../samples-dev/certificateGetSample.ts | 26 ++- .../certificateListByBatchAccountSample.ts | 26 ++- .../samples-dev/certificateUpdateSample.ts | 16 +- .../locationCheckNameAvailabilitySample.ts | 20 +- .../samples-dev/locationGetQuotasSample.ts | 13 +- ...tionListSupportedCloudServiceSkusSample.ts | 13 +- ...onListSupportedVirtualMachineSkusSample.ts | 13 +- .../samples-dev/operationsListSample.ts | 15 +- .../arm-batch/samples-dev/poolCreateSample.ts | 155 ++++++++++----- .../arm-batch/samples-dev/poolDeleteSample.ts | 16 +- .../samples-dev/poolDisableAutoScaleSample.ts | 16 +- .../arm-batch/samples-dev/poolGetSample.ts | 47 ++++- .../poolListByBatchAccountSample.ts | 26 ++- .../samples-dev/poolStopResizeSample.ts | 16 +- .../arm-batch/samples-dev/poolUpdateSample.ts | 46 +++-- .../privateEndpointConnectionDeleteSample.ts | 16 +- .../privateEndpointConnectionGetSample.ts | 16 +- ...pointConnectionListByBatchAccountSample.ts | 16 +- .../privateEndpointConnectionUpdateSample.ts | 16 +- .../privateLinkResourceGetSample.ts | 16 +- ...ateLinkResourceListByBatchAccountSample.ts | 16 +- .../samples/{v8 => v9}/javascript/README.md | 186 +++++++++--------- .../javascript/applicationCreateSample.js | 13 +- .../javascript/applicationDeleteSample.js | 13 +- .../javascript/applicationGetSample.js | 13 +- .../javascript/applicationListSample.js | 13 +- .../applicationPackageActivateSample.js | 13 +- .../applicationPackageCreateSample.js | 13 +- .../applicationPackageDeleteSample.js | 13 +- .../javascript/applicationPackageGetSample.js | 13 +- .../applicationPackageListSample.js | 13 +- .../javascript/applicationUpdateSample.js | 13 +- .../javascript/batchAccountCreateSample.js | 49 ++--- .../javascript/batchAccountDeleteSample.js | 13 +- .../batchAccountGetDetectorSample.js | 13 +- .../javascript/batchAccountGetKeysSample.js | 13 +- .../javascript/batchAccountGetSample.js | 22 ++- .../batchAccountListByResourceGroupSample.js | 13 +- .../batchAccountListDetectorsSample.js | 13 +- ...boundNetworkDependenciesEndpointsSample.js | 13 +- .../javascript/batchAccountListSample.js | 11 +- .../batchAccountRegenerateKeySample.js | 13 +- ...AccountSynchronizeAutoStorageKeysSample.js | 13 +- .../javascript/batchAccountUpdateSample.js | 13 +- .../certificateCancelDeletionSample.js | 13 +- .../javascript/certificateCreateSample.js | 31 +-- .../javascript/certificateDeleteSample.js | 13 +- .../javascript/certificateGetSample.js | 22 ++- .../certificateListByBatchAccountSample.js | 22 ++- .../javascript/certificateUpdateSample.js | 13 +- .../locationCheckNameAvailabilitySample.js | 18 +- .../javascript/locationGetQuotasSample.js | 11 +- ...tionListSupportedCloudServiceSkusSample.js | 11 +- ...onListSupportedVirtualMachineSkusSample.js | 11 +- .../javascript/operationsListSample.js | 12 +- .../{v8 => v9}/javascript/package.json | 0 .../{v8 => v9}/javascript/poolCreateSample.js | 143 +++++++++----- .../{v8 => v9}/javascript/poolDeleteSample.js | 13 +- .../javascript/poolDisableAutoScaleSample.js | 13 +- .../{v8 => v9}/javascript/poolGetSample.js | 38 +++- .../poolListByBatchAccountSample.js | 22 ++- .../javascript/poolStopResizeSample.js | 13 +- .../{v8 => v9}/javascript/poolUpdateSample.js | 40 ++-- .../privateEndpointConnectionDeleteSample.js | 13 +- .../privateEndpointConnectionGetSample.js | 13 +- ...pointConnectionListByBatchAccountSample.js | 13 +- .../privateEndpointConnectionUpdateSample.js | 13 +- .../privateLinkResourceGetSample.js | 13 +- ...ateLinkResourceListByBatchAccountSample.js | 13 +- .../samples/{v8 => v9}/javascript/sample.env | 0 .../samples/{v8 => v9}/typescript/README.md | 186 +++++++++--------- .../{v8 => v9}/typescript/package.json | 0 .../samples/{v8 => v9}/typescript/sample.env | 0 .../typescript/src/applicationCreateSample.ts | 16 +- .../typescript/src/applicationDeleteSample.ts | 16 +- .../typescript/src/applicationGetSample.ts | 16 +- .../typescript/src/applicationListSample.ts | 16 +- .../src/applicationPackageActivateSample.ts | 16 +- .../src/applicationPackageCreateSample.ts | 16 +- .../src/applicationPackageDeleteSample.ts | 16 +- .../src/applicationPackageGetSample.ts | 16 +- .../src/applicationPackageListSample.ts | 16 +- .../typescript/src/applicationUpdateSample.ts | 16 +- .../src/batchAccountCreateSample.ts | 56 +++--- .../src/batchAccountDeleteSample.ts | 16 +- .../src/batchAccountGetDetectorSample.ts | 16 +- .../src/batchAccountGetKeysSample.ts | 16 +- .../typescript/src/batchAccountGetSample.ts | 26 ++- .../batchAccountListByResourceGroupSample.ts | 16 +- .../src/batchAccountListDetectorsSample.ts | 16 +- ...boundNetworkDependenciesEndpointsSample.ts | 16 +- .../typescript/src/batchAccountListSample.ts | 13 +- .../src/batchAccountRegenerateKeySample.ts | 16 +- ...AccountSynchronizeAutoStorageKeysSample.ts | 16 +- .../src/batchAccountUpdateSample.ts | 16 +- .../src/certificateCancelDeletionSample.ts | 16 +- .../typescript/src/certificateCreateSample.ts | 36 ++-- .../typescript/src/certificateDeleteSample.ts | 16 +- .../typescript/src/certificateGetSample.ts | 26 ++- .../certificateListByBatchAccountSample.ts | 26 ++- .../typescript/src/certificateUpdateSample.ts | 16 +- .../locationCheckNameAvailabilitySample.ts | 20 +- .../typescript/src/locationGetQuotasSample.ts | 13 +- ...tionListSupportedCloudServiceSkusSample.ts | 13 +- ...onListSupportedVirtualMachineSkusSample.ts | 13 +- .../typescript/src/operationsListSample.ts | 15 +- .../typescript/src/poolCreateSample.ts | 155 ++++++++++----- .../typescript/src/poolDeleteSample.ts | 16 +- .../src/poolDisableAutoScaleSample.ts | 16 +- .../typescript/src/poolGetSample.ts | 47 ++++- .../src/poolListByBatchAccountSample.ts | 26 ++- .../typescript/src/poolStopResizeSample.ts | 16 +- .../typescript/src/poolUpdateSample.ts | 46 +++-- .../privateEndpointConnectionDeleteSample.ts | 16 +- .../src/privateEndpointConnectionGetSample.ts | 16 +- ...pointConnectionListByBatchAccountSample.ts | 16 +- .../privateEndpointConnectionUpdateSample.ts | 16 +- .../src/privateLinkResourceGetSample.ts | 16 +- ...ateLinkResourceListByBatchAccountSample.ts | 16 +- .../{v8 => v9}/typescript/tsconfig.json | 2 +- .../arm-batch/src/batchManagementClient.ts | 4 +- sdk/batch/arm-batch/src/lroImpl.ts | 54 ++--- sdk/batch/arm-batch/src/models/index.ts | 91 +++------ sdk/batch/arm-batch/src/models/mappers.ts | 15 +- sdk/batch/arm-batch/src/models/parameters.ts | 2 +- .../src/operations/applicationOperations.ts | 1 - .../applicationPackageOperations.ts | 1 - .../src/operations/batchAccountOperations.ts | 57 +++--- .../src/operations/certificateOperations.ts | 34 ++-- .../arm-batch/src/operations/location.ts | 10 - .../arm-batch/src/operations/operations.ts | 1 - .../src/operations/poolOperations.ts | 34 ++-- .../privateEndpointConnectionOperations.ts | 59 +++--- .../privateLinkResourceOperations.ts | 1 - .../batchAccountOperations.ts | 8 +- .../certificateOperations.ts | 4 +- .../operationsInterfaces/poolOperations.ts | 4 +- .../privateEndpointConnectionOperations.ts | 10 +- sdk/batch/arm-batch/src/pagingHelper.ts | 8 +- sdk/batch/arm-batch/test/batch_examples.ts | 3 +- 172 files changed, 2482 insertions(+), 1348 deletions(-) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/README.md (88%) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/applicationCreateSample.js (77%) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/applicationDeleteSample.js (74%) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/applicationGetSample.js (75%) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/applicationListSample.js (75%) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/applicationPackageActivateSample.js (80%) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/applicationPackageCreateSample.js (82%) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/applicationPackageDeleteSample.js (76%) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/applicationPackageGetSample.js (76%) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/applicationPackageListSample.js (76%) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/applicationUpdateSample.js (77%) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/batchAccountCreateSample.js (82%) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/batchAccountDeleteSample.js (73%) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/batchAccountGetDetectorSample.js (76%) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/batchAccountGetKeysSample.js (81%) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/batchAccountGetSample.js (71%) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/batchAccountListByResourceGroupSample.js (75%) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/batchAccountListDetectorsSample.js (76%) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/batchAccountListOutboundNetworkDependenciesEndpointsSample.js (85%) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/batchAccountListSample.js (80%) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/batchAccountRegenerateKeySample.js (82%) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/batchAccountSynchronizeAutoStorageKeysSample.js (77%) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/batchAccountUpdateSample.js (77%) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/certificateCancelDeletionSample.js (87%) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/certificateCreateSample.js (81%) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/certificateDeleteSample.js (80%) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/certificateGetSample.js (79%) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/certificateListByBatchAccountSample.js (80%) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/certificateUpdateSample.js (81%) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/locationCheckNameAvailabilitySample.js (80%) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/locationGetQuotasSample.js (80%) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/locationListSupportedCloudServiceSkusSample.js (81%) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/locationListSupportedVirtualMachineSkusSample.js (81%) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/operationsListSample.js (78%) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/package.json (100%) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/poolCreateSample.js (76%) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/poolDeleteSample.js (74%) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/poolDisableAutoScaleSample.js (74%) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/poolGetSample.js (52%) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/poolListByBatchAccountSample.js (77%) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/poolStopResizeSample.js (85%) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/poolUpdateSample.js (77%) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/privateEndpointConnectionDeleteSample.js (77%) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/privateEndpointConnectionGetSample.js (77%) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/privateEndpointConnectionListByBatchAccountSample.js (76%) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/privateEndpointConnectionUpdateSample.js (79%) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/privateLinkResourceGetSample.js (75%) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/privateLinkResourceListByBatchAccountSample.js (76%) rename sdk/batch/arm-batch/samples/{v8 => v9}/javascript/sample.env (100%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/README.md (88%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/package.json (100%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/sample.env (100%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/src/applicationCreateSample.ts (77%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/src/applicationDeleteSample.ts (72%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/src/applicationGetSample.ts (73%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/src/applicationListSample.ts (74%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/src/applicationPackageActivateSample.ts (80%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/src/applicationPackageCreateSample.ts (81%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/src/applicationPackageDeleteSample.ts (74%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/src/applicationPackageGetSample.ts (74%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/src/applicationPackageListSample.ts (75%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/src/applicationUpdateSample.ts (75%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/src/batchAccountCreateSample.ts (82%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/src/batchAccountDeleteSample.ts (72%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/src/batchAccountGetDetectorSample.ts (74%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/src/batchAccountGetKeysSample.ts (80%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/src/batchAccountGetSample.ts (70%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/src/batchAccountListByResourceGroupSample.ts (74%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/src/batchAccountListDetectorsSample.ts (75%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/src/batchAccountListOutboundNetworkDependenciesEndpointsSample.ts (84%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/src/batchAccountListSample.ts (79%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/src/batchAccountRegenerateKeySample.ts (81%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/src/batchAccountSynchronizeAutoStorageKeysSample.ts (75%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/src/batchAccountUpdateSample.ts (77%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/src/certificateCancelDeletionSample.ts (86%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/src/certificateCreateSample.ts (81%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/src/certificateDeleteSample.ts (78%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/src/certificateGetSample.ts (78%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/src/certificateListByBatchAccountSample.ts (80%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/src/certificateUpdateSample.ts (81%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/src/locationCheckNameAvailabilitySample.ts (80%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/src/locationGetQuotasSample.ts (78%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/src/locationListSupportedCloudServiceSkusSample.ts (80%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/src/locationListSupportedVirtualMachineSkusSample.ts (80%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/src/operationsListSample.ts (76%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/src/poolCreateSample.ts (76%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/src/poolDeleteSample.ts (73%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/src/poolDisableAutoScaleSample.ts (72%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/src/poolGetSample.ts (51%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/src/poolListByBatchAccountSample.ts (77%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/src/poolStopResizeSample.ts (84%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/src/poolUpdateSample.ts (77%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/src/privateEndpointConnectionDeleteSample.ts (75%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/src/privateEndpointConnectionGetSample.ts (76%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/src/privateEndpointConnectionListByBatchAccountSample.ts (74%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/src/privateEndpointConnectionUpdateSample.ts (78%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/src/privateLinkResourceGetSample.ts (74%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/src/privateLinkResourceListByBatchAccountSample.ts (74%) rename sdk/batch/arm-batch/samples/{v8 => v9}/typescript/tsconfig.json (92%) diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 7ed306b41ccc..a6614385e9e1 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -2556,12 +2556,6 @@ packages: type-detect: 4.0.8 dev: false - /@sinonjs/fake-timers/10.0.2: - resolution: {integrity: sha512-SwUDyjWnah1AaNl7kxsa7cfLhlTYoiyhDAIgyh+El30YvXs/o7OLXpYH88Zdhyx9JExKrmHDJ+10bwIcY80Jmw==} - dependencies: - '@sinonjs/commons': 2.0.0 - dev: false - /@sinonjs/fake-timers/10.3.0: resolution: {integrity: sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==} dependencies: @@ -4593,7 +4587,7 @@ packages: dependencies: semver: 7.5.3 shelljs: 0.8.5 - typescript: 5.2.0-dev.20230628 + typescript: 5.2.0-dev.20230629 dev: false /duplexer3/0.1.5: @@ -9865,7 +9859,7 @@ packages: yn: 3.1.1 dev: false - /ts-node/10.9.1_m72xuhxrv7ih4n5gqhkie72f4y: + /ts-node/10.9.1_px3ahiygkmubixvexbbu2qfoza: resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true peerDependencies: @@ -9891,7 +9885,7 @@ packages: create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 5.1.5 + typescript: 5.1.6 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 dev: false @@ -10043,14 +10037,14 @@ packages: hasBin: true dev: false - /typescript/5.1.5: - resolution: {integrity: sha512-FOH+WN/DQjUvN6WgW+c4Ml3yi0PH+a/8q+kNIfRehv1wLhWONedw85iu+vQ39Wp49IzTJEsZ2lyLXpBF7mkF1g==} + /typescript/5.1.6: + resolution: {integrity: sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==} engines: {node: '>=14.17'} hasBin: true dev: false - /typescript/5.2.0-dev.20230628: - resolution: {integrity: sha512-dWItHqHLu37lksKsUBRDXlnWdI8WVhKQoVRxlv8w2XfbL/jAA6vFeJLtmb6C3pQKm1X0Sl9BFHJgYWdyiN3u9g==} + /typescript/5.2.0-dev.20230629: + resolution: {integrity: sha512-/8eGjHX3BI9Cpb2ghyC3qeWD4PTXx7npbvZuKsphLdvFJkbOrKbvmnYGW+3QKs5rREjTq5/0A4IIlp9yCIit0g==} engines: {node: '>=14.17'} hasBin: true dev: false @@ -11908,7 +11902,7 @@ packages: dev: false file:projects/arm-batch.tgz: - resolution: {integrity: sha512-2fxbZvesjWy2JPLb6VHPHvCwsZ75ahGZ4aAwTBIWrgTzUUuzHuAit+FCkuYC8ohoyoMgspiLhJqygMy12pDQ9A==, tarball: file:projects/arm-batch.tgz} + resolution: {integrity: sha512-MQRzbCbv4hc8isw9GqLL4lS40K7UPozFRyR/UcIb0mAa/bgOkBpbPGk1ydZKDqxAyi3qKdkn2II7XKpk0ltPdg==, tarball: file:projects/arm-batch.tgz} name: '@rush-temp/arm-batch' version: 0.0.0 dependencies: @@ -11923,7 +11917,8 @@ packages: '@types/node': 14.18.51 chai: 4.3.7 cross-env: 7.0.3 - mkdirp: 1.0.4 + dotenv: 16.3.1 + mkdirp: 2.1.6 mocha: 7.2.0 rimraf: 3.0.2 rollup: 2.79.1 @@ -18039,7 +18034,7 @@ packages: dev: false file:projects/core-client.tgz: - resolution: {integrity: sha512-DD1MezAP4ZkP3o8F2g80m0zqnyYXxrvexL35titsE8+UprlOKcrJVMYF++ZUYgMEHrdn0ty6v7tUctmPgqQOwg==, tarball: file:projects/core-client.tgz} + resolution: {integrity: sha512-0f6tvrsFDRRLUf6atVFtPIUCMCDCIZDBMFSobCRb25oZ/1UFenVZLZ60MYTTtTswPKJfR3gvlwt4J5JCCACxOg==, tarball: file:projects/core-client.tgz} name: '@rush-temp/core-client' version: 0.0.0 dependencies: @@ -18404,13 +18399,13 @@ packages: dev: false file:projects/cosmos.tgz: - resolution: {integrity: sha512-YFCaW1JpVf6hza6MzlJ9v9wWbgl/C4MG8/RZ7R8D7li+fnhDi9PPZUfaxlPd/on5bdWX+7yK5U2JNVh28jEUXA==, tarball: file:projects/cosmos.tgz} + resolution: {integrity: sha512-LJz+1OIFq2SgnmWTitdaXdnVjEhoeYKGPGZpktlZRmqzTYQXHYXuxgNW2wvvJrKUfJ2eKkOnf3P5HFBSCAw2DQ==, tarball: file:projects/cosmos.tgz} name: '@rush-temp/cosmos' version: 0.0.0 dependencies: '@azure/identity': 2.1.0 '@microsoft/api-extractor': 7.36.0_@types+node@14.18.51 - '@sinonjs/fake-timers': 10.0.2 + '@sinonjs/fake-timers': 10.3.0 '@types/debug': 4.1.8 '@types/mocha': 7.0.2 '@types/node': 14.18.51 @@ -18503,7 +18498,7 @@ packages: name: '@rush-temp/dev-tool' version: 0.0.0 dependencies: - '@_ts/max': /typescript/5.1.5 + '@_ts/max': /typescript/5.1.6 '@_ts/min': /typescript/4.2.4 '@microsoft/api-extractor': 7.36.0_@types+node@14.18.51 '@rollup/plugin-commonjs': 24.1.0_rollup@2.79.1 @@ -18547,7 +18542,7 @@ packages: semver: 7.5.3 strip-json-comments: 3.1.1 ts-morph: 18.0.0 - ts-node: 10.9.1_m72xuhxrv7ih4n5gqhkie72f4y + ts-node: 10.9.1_px3ahiygkmubixvexbbu2qfoza tslib: 2.5.3 typescript: 5.0.4 yaml: 2.3.1 @@ -19801,7 +19796,7 @@ packages: dev: false file:projects/monitor-opentelemetry.tgz: - resolution: {integrity: sha512-U6oNE8zhwGOaMkbgb5KFzgBUIz7VSXpPqIhJ49AJ3Z3KyurQFQR/NrAjq+qvQcuwaEE0Tyu4HP7V4OC8VcwBvQ==, tarball: file:projects/monitor-opentelemetry.tgz} + resolution: {integrity: sha512-Il/WauhL+cvhnrtsGg6Y0S99Y38nuVYQQYUoGgYheosAtrxQxgdGkuylHru0Cm81h3PovRW6yg/nBBFLuV4t3A==, tarball: file:projects/monitor-opentelemetry.tgz} name: '@rush-temp/monitor-opentelemetry' version: 0.0.0 dependencies: diff --git a/sdk/batch/arm-batch/CHANGELOG.md b/sdk/batch/arm-batch/CHANGELOG.md index d221994f753e..64c719432964 100644 --- a/sdk/batch/arm-batch/CHANGELOG.md +++ b/sdk/batch/arm-batch/CHANGELOG.md @@ -1,15 +1,33 @@ # Release History + +## 9.0.0 (2023-06-30) + +**Features** -## 8.0.1 (Unreleased) - -### Features Added - -### Breaking Changes + - Added Type Alias ContainerType + - Interface NetworkConfiguration has a new optional parameter enableAcceleratedNetworking + - Interface VMExtension has a new optional parameter enableAutomaticUpgrade + - Added Enum KnownContainerType + - Interface ApplicationListNextOptionalParams no longer has parameter maxresults + - Interface ApplicationPackageListNextOptionalParams no longer has parameter maxresults + - Interface CertificateListByBatchAccountNextOptionalParams no longer has parameter filter + - Interface CertificateListByBatchAccountNextOptionalParams no longer has parameter maxresults + - Interface CertificateListByBatchAccountNextOptionalParams no longer has parameter select + - Interface LocationListSupportedCloudServiceSkusNextOptionalParams no longer has parameter filter + - Interface LocationListSupportedCloudServiceSkusNextOptionalParams no longer has parameter maxresults + - Interface LocationListSupportedVirtualMachineSkusNextOptionalParams no longer has parameter filter + - Interface LocationListSupportedVirtualMachineSkusNextOptionalParams no longer has parameter maxresults + - Interface PoolListByBatchAccountNextOptionalParams no longer has parameter filter + - Interface PoolListByBatchAccountNextOptionalParams no longer has parameter maxresults + - Interface PoolListByBatchAccountNextOptionalParams no longer has parameter select + - Interface PrivateEndpointConnectionListByBatchAccountNextOptionalParams no longer has parameter maxresults + - Interface PrivateLinkResourceListByBatchAccountNextOptionalParams no longer has parameter maxresults -### Bugs Fixed +**Breaking Changes** -### Other Changes + - Type of parameter type of interface ContainerConfiguration is changed from "DockerCompatible" to ContainerType + ## 8.0.0 (2022-11-10) **Features** diff --git a/sdk/batch/arm-batch/LICENSE b/sdk/batch/arm-batch/LICENSE index 5d1d36e0af80..3a1d9b6f24f7 100644 --- a/sdk/batch/arm-batch/LICENSE +++ b/sdk/batch/arm-batch/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2022 Microsoft +Copyright (c) 2023 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/sdk/batch/arm-batch/_meta.json b/sdk/batch/arm-batch/_meta.json index 2d826f2fb2ec..22d44456608b 100644 --- a/sdk/batch/arm-batch/_meta.json +++ b/sdk/batch/arm-batch/_meta.json @@ -1,8 +1,8 @@ { - "commit": "05fc1b443a1ba7b120a48e1ad204d267565ef57a", + "commit": "64efc48302878a07d1d1231eaed0ca9cadfaf037", "readme": "specification/batch/resource-manager/readme.md", - "autorest_command": "autorest --version=3.8.4 --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\\batch\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.3.20221108.1 --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=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\batch\\resource-manager\\readme.md --use=@autorest/typescript@6.0.5 --generate-sample=true", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.4.2", - "use": "@autorest/typescript@6.0.0-rc.3.20221108.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.0", + "use": "@autorest/typescript@6.0.5" } \ No newline at end of file diff --git a/sdk/batch/arm-batch/assets.json b/sdk/batch/arm-batch/assets.json index 522e0639cc71..8e5ef8c35f2e 100644 --- a/sdk/batch/arm-batch/assets.json +++ b/sdk/batch/arm-batch/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "js", "TagPrefix": "js/batch/arm-batch", - "Tag": "js/batch/arm-batch_7d52e8edfe" + "Tag": "js/batch/arm-batch_c4e09c3bab" } diff --git a/sdk/batch/arm-batch/package.json b/sdk/batch/arm-batch/package.json index 04a0dcfbc3a2..8818c8e84b0d 100644 --- a/sdk/batch/arm-batch/package.json +++ b/sdk/batch/arm-batch/package.json @@ -3,15 +3,15 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for BatchManagementClient.", - "version": "8.0.1", + "version": "9.0.0", "engines": { "node": ">=14.0.0" }, "dependencies": { - "@azure/core-lro": "^2.2.0", + "@azure/core-lro": "^2.5.3", "@azure/abort-controller": "^1.0.0", "@azure/core-paging": "^1.2.0", - "@azure/core-client": "^1.6.1", + "@azure/core-client": "^1.7.0", "@azure/core-auth": "^1.3.0", "@azure/core-rest-pipeline": "^1.8.0", "tslib": "^2.2.0" @@ -33,12 +33,13 @@ "@rollup/plugin-json": "^6.0.0", "@rollup/plugin-multi-entry": "^6.0.0", "@rollup/plugin-node-resolve": "^13.1.3", - "mkdirp": "^1.0.4", + "mkdirp": "^2.1.2", "rollup": "^2.66.1", "rollup-plugin-sourcemaps": "^0.6.3", "typescript": "~5.0.0", "uglify-js": "^3.4.9", "rimraf": "^3.0.0", + "dotenv": "^16.0.0", "@azure/identity": "^2.0.1", "@azure-tools/test-recorder": "^3.0.0", "@azure-tools/test-credential": "^1.0.0", @@ -50,7 +51,6 @@ "@azure/dev-tool": "^1.0.0", "@azure/arm-storage": "^17.1.0" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/batch/arm-batch", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" @@ -112,6 +112,7 @@ ] }, "autoPublish": true, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/batch/arm-batch", "//sampleConfiguration": { "productName": "", "productSlugs": [ diff --git a/sdk/batch/arm-batch/review/arm-batch.api.md b/sdk/batch/arm-batch/review/arm-batch.api.md index be1b272190bb..0b8a862cf30e 100644 --- a/sdk/batch/arm-batch/review/arm-batch.api.md +++ b/sdk/batch/arm-batch/review/arm-batch.api.md @@ -6,9 +6,9 @@ import * as coreAuth from '@azure/core-auth'; import * as coreClient from '@azure/core-client'; +import { OperationState } from '@azure/core-lro'; import { PagedAsyncIterableIterator } from '@azure/core-paging'; -import { PollerLike } from '@azure/core-lro'; -import { PollOperationState } from '@azure/core-lro'; +import { SimplePollerLike } from '@azure/core-lro'; // @public export type AccountKeyType = "Primary" | "Secondary"; @@ -49,7 +49,6 @@ export type ApplicationGetResponse = Application; // @public export interface ApplicationListNextOptionalParams extends coreClient.OperationOptions { - maxresults?: number; } // @public @@ -109,7 +108,6 @@ export type ApplicationPackageGetResponse = ApplicationPackage; // @public export interface ApplicationPackageListNextOptionalParams extends coreClient.OperationOptions { - maxresults?: number; } // @public @@ -379,9 +377,9 @@ export interface BatchAccountListResult { // @public export interface BatchAccountOperations { - beginCreate(resourceGroupName: string, accountName: string, parameters: BatchAccountCreateParameters, options?: BatchAccountCreateOptionalParams): Promise, BatchAccountCreateResponse>>; + beginCreate(resourceGroupName: string, accountName: string, parameters: BatchAccountCreateParameters, options?: BatchAccountCreateOptionalParams): Promise, BatchAccountCreateResponse>>; beginCreateAndWait(resourceGroupName: string, accountName: string, parameters: BatchAccountCreateParameters, options?: BatchAccountCreateOptionalParams): Promise; - beginDelete(resourceGroupName: string, accountName: string, options?: BatchAccountDeleteOptionalParams): Promise, void>>; + beginDelete(resourceGroupName: string, accountName: string, options?: BatchAccountDeleteOptionalParams): Promise, void>>; beginDeleteAndWait(resourceGroupName: string, accountName: string, options?: BatchAccountDeleteOptionalParams): Promise; get(resourceGroupName: string, accountName: string, options?: BatchAccountGetOptionalParams): Promise; getDetector(resourceGroupName: string, accountName: string, detectorId: string, options?: BatchAccountGetDetectorOptionalParams): Promise; @@ -573,9 +571,6 @@ export type CertificateGetResponse = CertificateGetHeaders & Certificate; // @public export interface CertificateListByBatchAccountNextOptionalParams extends coreClient.OperationOptions { - filter?: string; - maxresults?: number; - select?: string; } // @public @@ -593,7 +588,7 @@ export type CertificateListByBatchAccountResponse = ListCertificatesResult; // @public export interface CertificateOperations { - beginDelete(resourceGroupName: string, accountName: string, certificateName: string, options?: CertificateDeleteOptionalParams): Promise, void>>; + beginDelete(resourceGroupName: string, accountName: string, certificateName: string, options?: CertificateDeleteOptionalParams): Promise, void>>; beginDeleteAndWait(resourceGroupName: string, accountName: string, certificateName: string, options?: CertificateDeleteOptionalParams): Promise; cancelDeletion(resourceGroupName: string, accountName: string, certificateName: string, options?: CertificateCancelDeletionOptionalParams): Promise; create(resourceGroupName: string, accountName: string, certificateName: string, parameters: CertificateCreateOrUpdateParameters, options?: CertificateCreateOptionalParams): Promise; @@ -698,7 +693,7 @@ export interface ComputeNodeIdentityReference { export interface ContainerConfiguration { containerImageNames?: string[]; containerRegistries?: ContainerRegistry[]; - type: "DockerCompatible"; + type: ContainerType; } // @public @@ -709,6 +704,9 @@ export interface ContainerRegistry { userName?: string; } +// @public +export type ContainerType = string; + // @public export type ContainerWorkingDirectory = "TaskWorkingDirectory" | "ContainerImageDefault"; @@ -856,6 +854,12 @@ export interface KeyVaultReference { url: string; } +// @public +export enum KnownContainerType { + CriCompatible = "CriCompatible", + DockerCompatible = "DockerCompatible" +} + // @public export interface LinuxUserConfiguration { gid?: number; @@ -924,8 +928,6 @@ export type LocationGetQuotasResponse = BatchLocationQuota; // @public export interface LocationListSupportedCloudServiceSkusNextOptionalParams extends coreClient.OperationOptions { - filter?: string; - maxresults?: number; } // @public @@ -942,8 +944,6 @@ export type LocationListSupportedCloudServiceSkusResponse = SupportedSkusResult; // @public export interface LocationListSupportedVirtualMachineSkusNextOptionalParams extends coreClient.OperationOptions { - filter?: string; - maxresults?: number; } // @public @@ -981,6 +981,7 @@ export type NameAvailabilityReason = "Invalid" | "AlreadyExists"; // @public export interface NetworkConfiguration { dynamicVnetAssignmentScope?: DynamicVNetAssignmentScope; + enableAcceleratedNetworking?: boolean; endpointConfiguration?: PoolEndpointConfiguration; publicIPAddressConfiguration?: PublicIPAddressConfiguration; subnetId?: string; @@ -1178,9 +1179,6 @@ export type PoolIdentityType = "UserAssigned" | "None"; // @public export interface PoolListByBatchAccountNextOptionalParams extends coreClient.OperationOptions { - filter?: string; - maxresults?: number; - select?: string; } // @public @@ -1198,7 +1196,7 @@ export type PoolListByBatchAccountResponse = ListPoolsResult; // @public export interface PoolOperations { - beginDelete(resourceGroupName: string, accountName: string, poolName: string, options?: PoolDeleteOptionalParams): Promise, void>>; + beginDelete(resourceGroupName: string, accountName: string, poolName: string, options?: PoolDeleteOptionalParams): Promise, void>>; beginDeleteAndWait(resourceGroupName: string, accountName: string, poolName: string, options?: PoolDeleteOptionalParams): Promise; create(resourceGroupName: string, accountName: string, poolName: string, parameters: Pool, options?: PoolCreateOptionalParams): Promise; disableAutoScale(resourceGroupName: string, accountName: string, poolName: string, options?: PoolDisableAutoScaleOptionalParams): Promise; @@ -1273,7 +1271,6 @@ export type PrivateEndpointConnectionGetResponse = PrivateEndpointConnection; // @public export interface PrivateEndpointConnectionListByBatchAccountNextOptionalParams extends coreClient.OperationOptions { - maxresults?: number; } // @public @@ -1289,9 +1286,9 @@ export type PrivateEndpointConnectionListByBatchAccountResponse = ListPrivateEnd // @public export interface PrivateEndpointConnectionOperations { - beginDelete(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionDeleteOptionalParams): Promise, PrivateEndpointConnectionDeleteResponse>>; + beginDelete(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionDeleteOptionalParams): Promise, PrivateEndpointConnectionDeleteResponse>>; beginDeleteAndWait(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionDeleteOptionalParams): Promise; - beginUpdate(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, parameters: PrivateEndpointConnection, options?: PrivateEndpointConnectionUpdateOptionalParams): Promise, PrivateEndpointConnectionUpdateResponse>>; + beginUpdate(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, parameters: PrivateEndpointConnection, options?: PrivateEndpointConnectionUpdateOptionalParams): Promise, PrivateEndpointConnectionUpdateResponse>>; beginUpdateAndWait(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, parameters: PrivateEndpointConnection, options?: PrivateEndpointConnectionUpdateOptionalParams): Promise; get(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionGetOptionalParams): Promise; listByBatchAccount(resourceGroupName: string, accountName: string, options?: PrivateEndpointConnectionListByBatchAccountOptionalParams): PagedAsyncIterableIterator; @@ -1332,7 +1329,6 @@ export type PrivateLinkResourceGetResponse = PrivateLinkResource; // @public export interface PrivateLinkResourceListByBatchAccountNextOptionalParams extends coreClient.OperationOptions { - maxresults?: number; } // @public @@ -1520,6 +1516,7 @@ export interface VirtualMachineFamilyCoreQuota { // @public export interface VMExtension { autoUpgradeMinorVersion?: boolean; + enableAutomaticUpgrade?: boolean; name: string; protectedSettings?: Record; provisionAfterExtensions?: string[]; diff --git a/sdk/batch/arm-batch/samples-dev/applicationCreateSample.ts b/sdk/batch/arm-batch/samples-dev/applicationCreateSample.ts index 9cdb9ed8e0c5..9fe607f0d9fc 100644 --- a/sdk/batch/arm-batch/samples-dev/applicationCreateSample.ts +++ b/sdk/batch/arm-batch/samples-dev/applicationCreateSample.ts @@ -14,16 +14,20 @@ import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Adds an application to the specified Batch account. * * @summary Adds an application to the specified Batch account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationCreate.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationCreate.json */ async function applicationCreate() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const applicationName = "app1"; const parameters: Application = { @@ -42,4 +46,8 @@ async function applicationCreate() { console.log(result); } -applicationCreate().catch(console.error); +async function main() { + applicationCreate(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples-dev/applicationDeleteSample.ts b/sdk/batch/arm-batch/samples-dev/applicationDeleteSample.ts index 919a282e96d6..cf2412f8b231 100644 --- a/sdk/batch/arm-batch/samples-dev/applicationDeleteSample.ts +++ b/sdk/batch/arm-batch/samples-dev/applicationDeleteSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes an application. * * @summary Deletes an application. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationDelete.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationDelete.json */ async function applicationDelete() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const applicationName = "app1"; const credential = new DefaultAzureCredential(); @@ -32,4 +36,8 @@ async function applicationDelete() { console.log(result); } -applicationDelete().catch(console.error); +async function main() { + applicationDelete(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples-dev/applicationGetSample.ts b/sdk/batch/arm-batch/samples-dev/applicationGetSample.ts index 548af5c385fe..4e5f89cc7cda 100644 --- a/sdk/batch/arm-batch/samples-dev/applicationGetSample.ts +++ b/sdk/batch/arm-batch/samples-dev/applicationGetSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets information about the specified application. * * @summary Gets information about the specified application. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationGet.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationGet.json */ async function applicationGet() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const applicationName = "app1"; const credential = new DefaultAzureCredential(); @@ -32,4 +36,8 @@ async function applicationGet() { console.log(result); } -applicationGet().catch(console.error); +async function main() { + applicationGet(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples-dev/applicationListSample.ts b/sdk/batch/arm-batch/samples-dev/applicationListSample.ts index 3b87fde9a3fb..9ab7a0058207 100644 --- a/sdk/batch/arm-batch/samples-dev/applicationListSample.ts +++ b/sdk/batch/arm-batch/samples-dev/applicationListSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists all of the applications in the specified account. * * @summary Lists all of the applications in the specified account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationList.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationList.json */ async function applicationList() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); @@ -33,4 +37,8 @@ async function applicationList() { console.log(resArray); } -applicationList().catch(console.error); +async function main() { + applicationList(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples-dev/applicationPackageActivateSample.ts b/sdk/batch/arm-batch/samples-dev/applicationPackageActivateSample.ts index 9a6311b6b83d..cf23cd68b5f8 100644 --- a/sdk/batch/arm-batch/samples-dev/applicationPackageActivateSample.ts +++ b/sdk/batch/arm-batch/samples-dev/applicationPackageActivateSample.ts @@ -13,16 +13,20 @@ import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Activates the specified application package. This should be done after the `ApplicationPackage` was created and uploaded. This needs to be done before an `ApplicationPackage` can be used on Pools or Tasks. * * @summary Activates the specified application package. This should be done after the `ApplicationPackage` was created and uploaded. This needs to be done before an `ApplicationPackage` can be used on Pools or Tasks. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationPackageActivate.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationPackageActivate.json */ async function applicationPackageActivate() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const applicationName = "app1"; const versionName = "1"; @@ -39,4 +43,8 @@ async function applicationPackageActivate() { console.log(result); } -applicationPackageActivate().catch(console.error); +async function main() { + applicationPackageActivate(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples-dev/applicationPackageCreateSample.ts b/sdk/batch/arm-batch/samples-dev/applicationPackageCreateSample.ts index 701f11dd0a45..57823abaa733 100644 --- a/sdk/batch/arm-batch/samples-dev/applicationPackageCreateSample.ts +++ b/sdk/batch/arm-batch/samples-dev/applicationPackageCreateSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates an application package record. The record contains a storageUrl where the package should be uploaded to. Once it is uploaded the `ApplicationPackage` needs to be activated using `ApplicationPackageActive` before it can be used. If the auto storage account was configured to use storage keys, the URL returned will contain a SAS. * * @summary Creates an application package record. The record contains a storageUrl where the package should be uploaded to. Once it is uploaded the `ApplicationPackage` needs to be activated using `ApplicationPackageActive` before it can be used. If the auto storage account was configured to use storage keys, the URL returned will contain a SAS. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationPackageCreate.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationPackageCreate.json */ async function applicationPackageCreate() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const applicationName = "app1"; const versionName = "1"; @@ -34,4 +38,8 @@ async function applicationPackageCreate() { console.log(result); } -applicationPackageCreate().catch(console.error); +async function main() { + applicationPackageCreate(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples-dev/applicationPackageDeleteSample.ts b/sdk/batch/arm-batch/samples-dev/applicationPackageDeleteSample.ts index 70844be18df8..297dad5d0670 100644 --- a/sdk/batch/arm-batch/samples-dev/applicationPackageDeleteSample.ts +++ b/sdk/batch/arm-batch/samples-dev/applicationPackageDeleteSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes an application package record and its associated binary file. * * @summary Deletes an application package record and its associated binary file. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationPackageDelete.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationPackageDelete.json */ async function applicationPackageDelete() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const applicationName = "app1"; const versionName = "1"; @@ -34,4 +38,8 @@ async function applicationPackageDelete() { console.log(result); } -applicationPackageDelete().catch(console.error); +async function main() { + applicationPackageDelete(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples-dev/applicationPackageGetSample.ts b/sdk/batch/arm-batch/samples-dev/applicationPackageGetSample.ts index 570232bb34c9..7c739a0c3546 100644 --- a/sdk/batch/arm-batch/samples-dev/applicationPackageGetSample.ts +++ b/sdk/batch/arm-batch/samples-dev/applicationPackageGetSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets information about the specified application package. * * @summary Gets information about the specified application package. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationPackageGet.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationPackageGet.json */ async function applicationPackageGet() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const applicationName = "app1"; const versionName = "1"; @@ -34,4 +38,8 @@ async function applicationPackageGet() { console.log(result); } -applicationPackageGet().catch(console.error); +async function main() { + applicationPackageGet(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples-dev/applicationPackageListSample.ts b/sdk/batch/arm-batch/samples-dev/applicationPackageListSample.ts index 773a99458218..2ac7d90a1359 100644 --- a/sdk/batch/arm-batch/samples-dev/applicationPackageListSample.ts +++ b/sdk/batch/arm-batch/samples-dev/applicationPackageListSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists all of the application packages in the specified application. * * @summary Lists all of the application packages in the specified application. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationPackageList.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationPackageList.json */ async function applicationPackageList() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const applicationName = "app1"; const credential = new DefaultAzureCredential(); @@ -35,4 +39,8 @@ async function applicationPackageList() { console.log(resArray); } -applicationPackageList().catch(console.error); +async function main() { + applicationPackageList(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples-dev/applicationUpdateSample.ts b/sdk/batch/arm-batch/samples-dev/applicationUpdateSample.ts index add0ffdd2c02..e1c95c6a5c14 100644 --- a/sdk/batch/arm-batch/samples-dev/applicationUpdateSample.ts +++ b/sdk/batch/arm-batch/samples-dev/applicationUpdateSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { Application, BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Updates settings for the specified application. * * @summary Updates settings for the specified application. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationUpdate.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationUpdate.json */ async function applicationUpdate() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const applicationName = "app1"; const parameters: Application = { @@ -38,4 +42,8 @@ async function applicationUpdate() { console.log(result); } -applicationUpdate().catch(console.error); +async function main() { + applicationUpdate(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples-dev/batchAccountCreateSample.ts b/sdk/batch/arm-batch/samples-dev/batchAccountCreateSample.ts index 5436f2e0df9d..2030ea0a871a 100644 --- a/sdk/batch/arm-batch/samples-dev/batchAccountCreateSample.ts +++ b/sdk/batch/arm-batch/samples-dev/batchAccountCreateSample.ts @@ -13,16 +13,20 @@ import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API. * * @summary Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountCreate_BYOS.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountCreate_BYOS.json */ async function batchAccountCreateByos() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const parameters: BatchAccountCreateParameters = { autoStorage: { @@ -47,17 +51,16 @@ async function batchAccountCreateByos() { console.log(result); } -batchAccountCreateByos().catch(console.error); - /** * This sample demonstrates how to Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API. * * @summary Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountCreate_Default.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountCreate_Default.json */ async function batchAccountCreateDefault() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const parameters: BatchAccountCreateParameters = { autoStorage: { @@ -76,17 +79,16 @@ async function batchAccountCreateDefault() { console.log(result); } -batchAccountCreateDefault().catch(console.error); - /** * This sample demonstrates how to Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API. * * @summary Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountCreate_SystemAssignedIdentity.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountCreate_SystemAssignedIdentity.json */ async function batchAccountCreateSystemAssignedIdentity() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const parameters: BatchAccountCreateParameters = { autoStorage: { @@ -106,17 +108,16 @@ async function batchAccountCreateSystemAssignedIdentity() { console.log(result); } -batchAccountCreateSystemAssignedIdentity().catch(console.error); - /** * This sample demonstrates how to Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API. * * @summary Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountCreate_UserAssignedIdentity.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountCreate_UserAssignedIdentity.json */ async function batchAccountCreateUserAssignedIdentity() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const parameters: BatchAccountCreateParameters = { autoStorage: { @@ -141,17 +142,16 @@ async function batchAccountCreateUserAssignedIdentity() { console.log(result); } -batchAccountCreateUserAssignedIdentity().catch(console.error); - /** * This sample demonstrates how to Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API. * * @summary Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PrivateBatchAccountCreate.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PrivateBatchAccountCreate.json */ async function privateBatchAccountCreate() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const parameters: BatchAccountCreateParameters = { autoStorage: { @@ -176,4 +176,12 @@ async function privateBatchAccountCreate() { console.log(result); } -privateBatchAccountCreate().catch(console.error); +async function main() { + batchAccountCreateByos(); + batchAccountCreateDefault(); + batchAccountCreateSystemAssignedIdentity(); + batchAccountCreateUserAssignedIdentity(); + privateBatchAccountCreate(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples-dev/batchAccountDeleteSample.ts b/sdk/batch/arm-batch/samples-dev/batchAccountDeleteSample.ts index f531bce1f946..e61b863e3f4c 100644 --- a/sdk/batch/arm-batch/samples-dev/batchAccountDeleteSample.ts +++ b/sdk/batch/arm-batch/samples-dev/batchAccountDeleteSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes the specified Batch account. * * @summary Deletes the specified Batch account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountDelete.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountDelete.json */ async function batchAccountDelete() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); @@ -30,4 +34,8 @@ async function batchAccountDelete() { console.log(result); } -batchAccountDelete().catch(console.error); +async function main() { + batchAccountDelete(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples-dev/batchAccountGetDetectorSample.ts b/sdk/batch/arm-batch/samples-dev/batchAccountGetDetectorSample.ts index 7757fa31117c..87ff51dbea44 100644 --- a/sdk/batch/arm-batch/samples-dev/batchAccountGetDetectorSample.ts +++ b/sdk/batch/arm-batch/samples-dev/batchAccountGetDetectorSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets information about the given detector for a given Batch account. * * @summary Gets information about the given detector for a given Batch account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/DetectorGet.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/DetectorGet.json */ async function getDetector() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const detectorId = "poolsAndNodes"; const credential = new DefaultAzureCredential(); @@ -32,4 +36,8 @@ async function getDetector() { console.log(result); } -getDetector().catch(console.error); +async function main() { + getDetector(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples-dev/batchAccountGetKeysSample.ts b/sdk/batch/arm-batch/samples-dev/batchAccountGetKeysSample.ts index cf55667c1247..1e0774147615 100644 --- a/sdk/batch/arm-batch/samples-dev/batchAccountGetKeysSample.ts +++ b/sdk/batch/arm-batch/samples-dev/batchAccountGetKeysSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to This operation applies only to Batch accounts with allowedAuthenticationModes containing 'SharedKey'. If the Batch account doesn't contain 'SharedKey' in its allowedAuthenticationMode, clients cannot use shared keys to authenticate, and must use another allowedAuthenticationModes instead. In this case, getting the keys will fail. * * @summary This operation applies only to Batch accounts with allowedAuthenticationModes containing 'SharedKey'. If the Batch account doesn't contain 'SharedKey' in its allowedAuthenticationMode, clients cannot use shared keys to authenticate, and must use another allowedAuthenticationModes instead. In this case, getting the keys will fail. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountGetKeys.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountGetKeys.json */ async function batchAccountGetKeys() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); @@ -30,4 +34,8 @@ async function batchAccountGetKeys() { console.log(result); } -batchAccountGetKeys().catch(console.error); +async function main() { + batchAccountGetKeys(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples-dev/batchAccountGetSample.ts b/sdk/batch/arm-batch/samples-dev/batchAccountGetSample.ts index 8624afd49ac4..57d4dc6d4c5a 100644 --- a/sdk/batch/arm-batch/samples-dev/batchAccountGetSample.ts +++ b/sdk/batch/arm-batch/samples-dev/batchAccountGetSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets information about the specified Batch account. * * @summary Gets information about the specified Batch account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountGet.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountGet.json */ async function batchAccountGet() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); @@ -30,17 +34,16 @@ async function batchAccountGet() { console.log(result); } -batchAccountGet().catch(console.error); - /** * This sample demonstrates how to Gets information about the specified Batch account. * * @summary Gets information about the specified Batch account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PrivateBatchAccountGet.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PrivateBatchAccountGet.json */ async function privateBatchAccountGet() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); @@ -51,4 +54,9 @@ async function privateBatchAccountGet() { console.log(result); } -privateBatchAccountGet().catch(console.error); +async function main() { + batchAccountGet(); + privateBatchAccountGet(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples-dev/batchAccountListByResourceGroupSample.ts b/sdk/batch/arm-batch/samples-dev/batchAccountListByResourceGroupSample.ts index 5cd3f5607fa6..0c838799954d 100644 --- a/sdk/batch/arm-batch/samples-dev/batchAccountListByResourceGroupSample.ts +++ b/sdk/batch/arm-batch/samples-dev/batchAccountListByResourceGroupSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets information about the Batch accounts associated with the specified resource group. * * @summary Gets information about the Batch accounts associated with the specified resource group. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountListByResourceGroup.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountListByResourceGroup.json */ async function batchAccountListByResourceGroup() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -31,4 +35,8 @@ async function batchAccountListByResourceGroup() { console.log(resArray); } -batchAccountListByResourceGroup().catch(console.error); +async function main() { + batchAccountListByResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples-dev/batchAccountListDetectorsSample.ts b/sdk/batch/arm-batch/samples-dev/batchAccountListDetectorsSample.ts index 04987567adcc..f7dfaac51b2a 100644 --- a/sdk/batch/arm-batch/samples-dev/batchAccountListDetectorsSample.ts +++ b/sdk/batch/arm-batch/samples-dev/batchAccountListDetectorsSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets information about the detectors available for a given Batch account. * * @summary Gets information about the detectors available for a given Batch account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/DetectorList.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/DetectorList.json */ async function listDetectors() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); @@ -33,4 +37,8 @@ async function listDetectors() { console.log(resArray); } -listDetectors().catch(console.error); +async function main() { + listDetectors(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples-dev/batchAccountListOutboundNetworkDependenciesEndpointsSample.ts b/sdk/batch/arm-batch/samples-dev/batchAccountListOutboundNetworkDependenciesEndpointsSample.ts index b6fea70e698b..c2aa48bbdfcf 100644 --- a/sdk/batch/arm-batch/samples-dev/batchAccountListOutboundNetworkDependenciesEndpointsSample.ts +++ b/sdk/batch/arm-batch/samples-dev/batchAccountListOutboundNetworkDependenciesEndpointsSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://docs.microsoft.com/en-us/azure/batch/batch-virtual-network. * * @summary Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://docs.microsoft.com/en-us/azure/batch/batch-virtual-network. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountListOutboundNetworkDependenciesEndpoints.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountListOutboundNetworkDependenciesEndpoints.json */ async function listOutboundNetworkDependencies() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); @@ -33,4 +37,8 @@ async function listOutboundNetworkDependencies() { console.log(resArray); } -listOutboundNetworkDependencies().catch(console.error); +async function main() { + listOutboundNetworkDependencies(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples-dev/batchAccountListSample.ts b/sdk/batch/arm-batch/samples-dev/batchAccountListSample.ts index 503f5c669526..d36977007e23 100644 --- a/sdk/batch/arm-batch/samples-dev/batchAccountListSample.ts +++ b/sdk/batch/arm-batch/samples-dev/batchAccountListSample.ts @@ -10,15 +10,18 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets information about the Batch accounts associated with the subscription. * * @summary Gets information about the Batch accounts associated with the subscription. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountList.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountList.json */ async function batchAccountList() { - const subscriptionId = "subid"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -28,4 +31,8 @@ async function batchAccountList() { console.log(resArray); } -batchAccountList().catch(console.error); +async function main() { + batchAccountList(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples-dev/batchAccountRegenerateKeySample.ts b/sdk/batch/arm-batch/samples-dev/batchAccountRegenerateKeySample.ts index f57eccd82666..5c12fc508b03 100644 --- a/sdk/batch/arm-batch/samples-dev/batchAccountRegenerateKeySample.ts +++ b/sdk/batch/arm-batch/samples-dev/batchAccountRegenerateKeySample.ts @@ -13,16 +13,20 @@ import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to This operation applies only to Batch accounts with allowedAuthenticationModes containing 'SharedKey'. If the Batch account doesn't contain 'SharedKey' in its allowedAuthenticationMode, clients cannot use shared keys to authenticate, and must use another allowedAuthenticationModes instead. In this case, regenerating the keys will fail. * * @summary This operation applies only to Batch accounts with allowedAuthenticationModes containing 'SharedKey'. If the Batch account doesn't contain 'SharedKey' in its allowedAuthenticationMode, clients cannot use shared keys to authenticate, and must use another allowedAuthenticationModes instead. In this case, regenerating the keys will fail. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountRegenerateKey.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountRegenerateKey.json */ async function batchAccountRegenerateKey() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const parameters: BatchAccountRegenerateKeyParameters = { keyName: "Primary" @@ -37,4 +41,8 @@ async function batchAccountRegenerateKey() { console.log(result); } -batchAccountRegenerateKey().catch(console.error); +async function main() { + batchAccountRegenerateKey(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples-dev/batchAccountSynchronizeAutoStorageKeysSample.ts b/sdk/batch/arm-batch/samples-dev/batchAccountSynchronizeAutoStorageKeysSample.ts index f2fd6c5f5a62..2738e8a263ea 100644 --- a/sdk/batch/arm-batch/samples-dev/batchAccountSynchronizeAutoStorageKeysSample.ts +++ b/sdk/batch/arm-batch/samples-dev/batchAccountSynchronizeAutoStorageKeysSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Synchronizes access keys for the auto-storage account configured for the specified Batch account, only if storage key authentication is being used. * * @summary Synchronizes access keys for the auto-storage account configured for the specified Batch account, only if storage key authentication is being used. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountSynchronizeAutoStorageKeys.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountSynchronizeAutoStorageKeys.json */ async function batchAccountSynchronizeAutoStorageKeys() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); @@ -30,4 +34,8 @@ async function batchAccountSynchronizeAutoStorageKeys() { console.log(result); } -batchAccountSynchronizeAutoStorageKeys().catch(console.error); +async function main() { + batchAccountSynchronizeAutoStorageKeys(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples-dev/batchAccountUpdateSample.ts b/sdk/batch/arm-batch/samples-dev/batchAccountUpdateSample.ts index cac67ddbc921..d6ff6eae14a4 100644 --- a/sdk/batch/arm-batch/samples-dev/batchAccountUpdateSample.ts +++ b/sdk/batch/arm-batch/samples-dev/batchAccountUpdateSample.ts @@ -13,16 +13,20 @@ import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Updates the properties of an existing Batch account. * * @summary Updates the properties of an existing Batch account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountUpdate.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountUpdate.json */ async function batchAccountUpdate() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const parameters: BatchAccountUpdateParameters = { autoStorage: { @@ -40,4 +44,8 @@ async function batchAccountUpdate() { console.log(result); } -batchAccountUpdate().catch(console.error); +async function main() { + batchAccountUpdate(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples-dev/certificateCancelDeletionSample.ts b/sdk/batch/arm-batch/samples-dev/certificateCancelDeletionSample.ts index 6c61c149c581..e01a82f20a8a 100644 --- a/sdk/batch/arm-batch/samples-dev/certificateCancelDeletionSample.ts +++ b/sdk/batch/arm-batch/samples-dev/certificateCancelDeletionSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to If you try to delete a certificate that is being used by a pool or compute node, the status of the certificate changes to deleteFailed. If you decide that you want to continue using the certificate, you can use this operation to set the status of the certificate back to active. If you intend to delete the certificate, you do not need to run this operation after the deletion failed. You must make sure that the certificate is not being used by any resources, and then you can try again to delete the certificate. @@ -19,11 +22,12 @@ Warning: This operation is deprecated and will be removed after February, 2024. * @summary If you try to delete a certificate that is being used by a pool or compute node, the status of the certificate changes to deleteFailed. If you decide that you want to continue using the certificate, you can use this operation to set the status of the certificate back to active. If you intend to delete the certificate, you do not need to run this operation after the deletion failed. You must make sure that the certificate is not being used by any resources, and then you can try again to delete the certificate. Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateCancelDeletion.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/CertificateCancelDeletion.json */ async function certificateCancelDeletion() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const certificateName = "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"; const credential = new DefaultAzureCredential(); @@ -36,4 +40,8 @@ async function certificateCancelDeletion() { console.log(result); } -certificateCancelDeletion().catch(console.error); +async function main() { + certificateCancelDeletion(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples-dev/certificateCreateSample.ts b/sdk/batch/arm-batch/samples-dev/certificateCreateSample.ts index 9df986821acf..28dd1812c719 100644 --- a/sdk/batch/arm-batch/samples-dev/certificateCreateSample.ts +++ b/sdk/batch/arm-batch/samples-dev/certificateCreateSample.ts @@ -13,16 +13,20 @@ import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. * * @summary Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateCreate_Full.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/CertificateCreate_Full.json */ async function createCertificateFull() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const certificateName = "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"; const parameters: CertificateCreateOrUpdateParameters = { @@ -43,17 +47,16 @@ async function createCertificateFull() { console.log(result); } -createCertificateFull().catch(console.error); - /** * This sample demonstrates how to Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. * * @summary Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateCreate_MinimalCer.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/CertificateCreate_MinimalCer.json */ async function createCertificateMinimalCer() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const certificateName = "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"; const parameters: CertificateCreateOrUpdateParameters = { @@ -71,17 +74,16 @@ async function createCertificateMinimalCer() { console.log(result); } -createCertificateMinimalCer().catch(console.error); - /** * This sample demonstrates how to Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. * * @summary Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateCreate_Minimal.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/CertificateCreate_Minimal.json */ async function createCertificateMinimalPfx() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const certificateName = "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"; const parameters: CertificateCreateOrUpdateParameters = { @@ -99,4 +101,10 @@ async function createCertificateMinimalPfx() { console.log(result); } -createCertificateMinimalPfx().catch(console.error); +async function main() { + createCertificateFull(); + createCertificateMinimalCer(); + createCertificateMinimalPfx(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples-dev/certificateDeleteSample.ts b/sdk/batch/arm-batch/samples-dev/certificateDeleteSample.ts index b549fa9631ce..9fdffd74b2c7 100644 --- a/sdk/batch/arm-batch/samples-dev/certificateDeleteSample.ts +++ b/sdk/batch/arm-batch/samples-dev/certificateDeleteSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. * * @summary Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateDelete.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/CertificateDelete.json */ async function certificateDelete() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const certificateName = "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"; const credential = new DefaultAzureCredential(); @@ -32,4 +36,8 @@ async function certificateDelete() { console.log(result); } -certificateDelete().catch(console.error); +async function main() { + certificateDelete(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples-dev/certificateGetSample.ts b/sdk/batch/arm-batch/samples-dev/certificateGetSample.ts index 19477b3d285c..4bae2897191d 100644 --- a/sdk/batch/arm-batch/samples-dev/certificateGetSample.ts +++ b/sdk/batch/arm-batch/samples-dev/certificateGetSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. * * @summary Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateGet.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/CertificateGet.json */ async function getCertificate() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const certificateName = "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"; const credential = new DefaultAzureCredential(); @@ -32,17 +36,16 @@ async function getCertificate() { console.log(result); } -getCertificate().catch(console.error); - /** * This sample demonstrates how to Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. * * @summary Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateGetWithDeletionError.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/CertificateGetWithDeletionError.json */ async function getCertificateWithDeletionError() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const certificateName = "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"; const credential = new DefaultAzureCredential(); @@ -55,4 +58,9 @@ async function getCertificateWithDeletionError() { console.log(result); } -getCertificateWithDeletionError().catch(console.error); +async function main() { + getCertificate(); + getCertificateWithDeletionError(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples-dev/certificateListByBatchAccountSample.ts b/sdk/batch/arm-batch/samples-dev/certificateListByBatchAccountSample.ts index af7eff7bad4f..eccf6cc3d132 100644 --- a/sdk/batch/arm-batch/samples-dev/certificateListByBatchAccountSample.ts +++ b/sdk/batch/arm-batch/samples-dev/certificateListByBatchAccountSample.ts @@ -13,16 +13,20 @@ import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. * * @summary Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateList.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/CertificateList.json */ async function listCertificates() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); @@ -36,17 +40,16 @@ async function listCertificates() { console.log(resArray); } -listCertificates().catch(console.error); - /** * This sample demonstrates how to Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. * * @summary Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateListWithFilter.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/CertificateListWithFilter.json */ async function listCertificatesFilterAndSelect() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const select = "properties/format,properties/provisioningState"; const filter = @@ -68,4 +71,9 @@ async function listCertificatesFilterAndSelect() { console.log(resArray); } -listCertificatesFilterAndSelect().catch(console.error); +async function main() { + listCertificates(); + listCertificatesFilterAndSelect(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples-dev/certificateUpdateSample.ts b/sdk/batch/arm-batch/samples-dev/certificateUpdateSample.ts index ed0a6cd23767..deac61b3a77d 100644 --- a/sdk/batch/arm-batch/samples-dev/certificateUpdateSample.ts +++ b/sdk/batch/arm-batch/samples-dev/certificateUpdateSample.ts @@ -13,16 +13,20 @@ import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. * * @summary Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateUpdate.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/CertificateUpdate.json */ async function updateCertificate() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const certificateName = "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"; const parameters: CertificateCreateOrUpdateParameters = { @@ -40,4 +44,8 @@ async function updateCertificate() { console.log(result); } -updateCertificate().catch(console.error); +async function main() { + updateCertificate(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples-dev/locationCheckNameAvailabilitySample.ts b/sdk/batch/arm-batch/samples-dev/locationCheckNameAvailabilitySample.ts index 3c0ad64fab53..e66be150209e 100644 --- a/sdk/batch/arm-batch/samples-dev/locationCheckNameAvailabilitySample.ts +++ b/sdk/batch/arm-batch/samples-dev/locationCheckNameAvailabilitySample.ts @@ -13,15 +13,18 @@ import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Checks whether the Batch account name is available in the specified region. * * @summary Checks whether the Batch account name is available in the specified region. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/LocationCheckNameAvailability_AlreadyExists.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/LocationCheckNameAvailability_AlreadyExists.json */ async function locationCheckNameAvailabilityAlreadyExists() { - const subscriptionId = "subid"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; const locationName = "japaneast"; const parameters: CheckNameAvailabilityParameters = { name: "existingaccountname", @@ -36,16 +39,14 @@ async function locationCheckNameAvailabilityAlreadyExists() { console.log(result); } -locationCheckNameAvailabilityAlreadyExists().catch(console.error); - /** * This sample demonstrates how to Checks whether the Batch account name is available in the specified region. * * @summary Checks whether the Batch account name is available in the specified region. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/LocationCheckNameAvailability_Available.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/LocationCheckNameAvailability_Available.json */ async function locationCheckNameAvailabilityAvailable() { - const subscriptionId = "subid"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; const locationName = "japaneast"; const parameters: CheckNameAvailabilityParameters = { name: "newaccountname", @@ -60,4 +61,9 @@ async function locationCheckNameAvailabilityAvailable() { console.log(result); } -locationCheckNameAvailabilityAvailable().catch(console.error); +async function main() { + locationCheckNameAvailabilityAlreadyExists(); + locationCheckNameAvailabilityAvailable(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples-dev/locationGetQuotasSample.ts b/sdk/batch/arm-batch/samples-dev/locationGetQuotasSample.ts index 33ea374077e0..24f77cad7fc2 100644 --- a/sdk/batch/arm-batch/samples-dev/locationGetQuotasSample.ts +++ b/sdk/batch/arm-batch/samples-dev/locationGetQuotasSample.ts @@ -10,15 +10,18 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets the Batch service quotas for the specified subscription at the given location. * * @summary Gets the Batch service quotas for the specified subscription at the given location. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/LocationGetQuotas.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/LocationGetQuotas.json */ async function locationGetQuotas() { - const subscriptionId = "subid"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; const locationName = "japaneast"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); @@ -26,4 +29,8 @@ async function locationGetQuotas() { console.log(result); } -locationGetQuotas().catch(console.error); +async function main() { + locationGetQuotas(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples-dev/locationListSupportedCloudServiceSkusSample.ts b/sdk/batch/arm-batch/samples-dev/locationListSupportedCloudServiceSkusSample.ts index 927cbfc37913..1e7194c41fe1 100644 --- a/sdk/batch/arm-batch/samples-dev/locationListSupportedCloudServiceSkusSample.ts +++ b/sdk/batch/arm-batch/samples-dev/locationListSupportedCloudServiceSkusSample.ts @@ -10,15 +10,18 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets the list of Batch supported Cloud Service VM sizes available at the given location. * * @summary Gets the list of Batch supported Cloud Service VM sizes available at the given location. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/LocationListCloudServiceSkus.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/LocationListCloudServiceSkus.json */ async function locationListCloudServiceSkus() { - const subscriptionId = "subid"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; const locationName = "japaneast"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); @@ -31,4 +34,8 @@ async function locationListCloudServiceSkus() { console.log(resArray); } -locationListCloudServiceSkus().catch(console.error); +async function main() { + locationListCloudServiceSkus(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples-dev/locationListSupportedVirtualMachineSkusSample.ts b/sdk/batch/arm-batch/samples-dev/locationListSupportedVirtualMachineSkusSample.ts index 85f2471df89a..d599a668a32d 100644 --- a/sdk/batch/arm-batch/samples-dev/locationListSupportedVirtualMachineSkusSample.ts +++ b/sdk/batch/arm-batch/samples-dev/locationListSupportedVirtualMachineSkusSample.ts @@ -10,15 +10,18 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets the list of Batch supported Virtual Machine VM sizes available at the given location. * * @summary Gets the list of Batch supported Virtual Machine VM sizes available at the given location. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/LocationListVirtualMachineSkus.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/LocationListVirtualMachineSkus.json */ async function locationListVirtualMachineSkus() { - const subscriptionId = "subid"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; const locationName = "japaneast"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); @@ -31,4 +34,8 @@ async function locationListVirtualMachineSkus() { console.log(resArray); } -locationListVirtualMachineSkus().catch(console.error); +async function main() { + locationListVirtualMachineSkus(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples-dev/operationsListSample.ts b/sdk/batch/arm-batch/samples-dev/operationsListSample.ts index 060944a592a0..6114f912b2ff 100644 --- a/sdk/batch/arm-batch/samples-dev/operationsListSample.ts +++ b/sdk/batch/arm-batch/samples-dev/operationsListSample.ts @@ -10,15 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists available operations for the Microsoft.Batch provider * * @summary Lists available operations for the Microsoft.Batch provider - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/OperationsList.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/OperationsList.json */ async function operationsList() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const subscriptionId = + process.env["BATCH_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -28,4 +33,8 @@ async function operationsList() { console.log(resArray); } -operationsList().catch(console.error); +async function main() { + operationsList(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples-dev/poolCreateSample.ts b/sdk/batch/arm-batch/samples-dev/poolCreateSample.ts index 4b26e0996709..fe27144f0bbc 100644 --- a/sdk/batch/arm-batch/samples-dev/poolCreateSample.ts +++ b/sdk/batch/arm-batch/samples-dev/poolCreateSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { Pool, BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates a new pool inside the specified account. * * @summary Creates a new pool inside the specified account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolCreate_SharedImageGallery.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolCreate_SharedImageGallery.json */ async function createPoolCustomImage() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const parameters: Pool = { @@ -45,17 +49,16 @@ async function createPoolCustomImage() { console.log(result); } -createPoolCustomImage().catch(console.error); - /** * This sample demonstrates how to Creates a new pool inside the specified account. * * @summary Creates a new pool inside the specified account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolCreate_CloudServiceConfiguration.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolCreate_CloudServiceConfiguration.json */ async function createPoolFullCloudServiceConfiguration() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const parameters: Pool = { @@ -148,17 +151,16 @@ async function createPoolFullCloudServiceConfiguration() { console.log(result); } -createPoolFullCloudServiceConfiguration().catch(console.error); - /** * This sample demonstrates how to Creates a new pool inside the specified account. * * @summary Creates a new pool inside the specified account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolCreate_VirtualMachineConfiguration.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolCreate_VirtualMachineConfiguration.json */ async function createPoolFullVirtualMachineConfiguration() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const parameters: Pool = { @@ -238,17 +240,16 @@ async function createPoolFullVirtualMachineConfiguration() { console.log(result); } -createPoolFullVirtualMachineConfiguration().catch(console.error); - /** * This sample demonstrates how to Creates a new pool inside the specified account. * * @summary Creates a new pool inside the specified account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolCreate_MinimalCloudServiceConfiguration.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolCreate_MinimalCloudServiceConfiguration.json */ async function createPoolMinimalCloudServiceConfiguration() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const parameters: Pool = { @@ -267,17 +268,16 @@ async function createPoolMinimalCloudServiceConfiguration() { console.log(result); } -createPoolMinimalCloudServiceConfiguration().catch(console.error); - /** * This sample demonstrates how to Creates a new pool inside the specified account. * * @summary Creates a new pool inside the specified account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolCreate_MinimalVirtualMachineConfiguration.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolCreate_MinimalVirtualMachineConfiguration.json */ async function createPoolMinimalVirtualMachineConfiguration() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const parameters: Pool = { @@ -311,17 +311,16 @@ async function createPoolMinimalVirtualMachineConfiguration() { console.log(result); } -createPoolMinimalVirtualMachineConfiguration().catch(console.error); - /** * This sample demonstrates how to Creates a new pool inside the specified account. * * @summary Creates a new pool inside the specified account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolCreate_NoPublicIPAddresses.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolCreate_NoPublicIPAddresses.json */ async function createPoolNoPublicIP() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const parameters: Pool = { @@ -352,17 +351,16 @@ async function createPoolNoPublicIP() { console.log(result); } -createPoolNoPublicIP().catch(console.error); - /** * This sample demonstrates how to Creates a new pool inside the specified account. * * @summary Creates a new pool inside the specified account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolCreate_PublicIPs.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolCreate_PublicIPs.json */ async function createPoolPublicIPs() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const parameters: Pool = { @@ -398,17 +396,16 @@ async function createPoolPublicIPs() { console.log(result); } -createPoolPublicIPs().catch(console.error); - /** * This sample demonstrates how to Creates a new pool inside the specified account. * * @summary Creates a new pool inside the specified account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolCreate_UserAssignedIdentities.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolCreate_UserAssignedIdentities.json */ async function createPoolUserAssignedIdentities() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const parameters: Pool = { @@ -449,17 +446,16 @@ async function createPoolUserAssignedIdentities() { console.log(result); } -createPoolUserAssignedIdentities().catch(console.error); - /** * This sample demonstrates how to Creates a new pool inside the specified account. * * @summary Creates a new pool inside the specified account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolCreate_VirtualMachineConfiguration_Extensions.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolCreate_VirtualMachineConfiguration_Extensions.json */ async function createPoolVirtualMachineConfigurationExtensions() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const parameters: Pool = { @@ -474,14 +470,15 @@ async function createPoolVirtualMachineConfigurationExtensions() { extensions: [ { name: "batchextension1", - type: "SecurityMonitoringForLinux", + type: "KeyVaultForLinux", autoUpgradeMinorVersion: true, - protectedSettings: { - protectedSettingsKey: "protectedSettingsValue" + enableAutomaticUpgrade: true, + publisher: "Microsoft.Azure.KeyVault", + settings: { + authenticationSettingsKey: "authenticationSettingsValue", + secretsManagementSettingsKey: "secretsManagementSettingsValue" }, - publisher: "Microsoft.Azure.Security.Monitoring", - settings: { settingsKey: "settingsValue" }, - typeHandlerVersion: "1.0" + typeHandlerVersion: "2.0" } ] } @@ -506,4 +503,62 @@ async function createPoolVirtualMachineConfigurationExtensions() { console.log(result); } -createPoolVirtualMachineConfigurationExtensions().catch(console.error); +/** + * This sample demonstrates how to Creates a new pool inside the specified account. + * + * @summary Creates a new pool inside the specified account. + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolCreate_AcceleratedNetworking.json + */ +async function createPoolAcceleratedNetworking() { + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; + const accountName = "sampleacct"; + const poolName = "testpool"; + const parameters: Pool = { + deploymentConfiguration: { + virtualMachineConfiguration: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-datacenter-smalldisk", + version: "latest" + }, + nodeAgentSkuId: "batch.node.windows amd64" + } + }, + networkConfiguration: { + enableAcceleratedNetworking: true, + subnetId: + "/subscriptions/subid/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123" + }, + scaleSettings: { + fixedScale: { targetDedicatedNodes: 1, targetLowPriorityNodes: 0 } + }, + vmSize: "STANDARD_D1_V2" + }; + const credential = new DefaultAzureCredential(); + const client = new BatchManagementClient(credential, subscriptionId); + const result = await client.poolOperations.create( + resourceGroupName, + accountName, + poolName, + parameters + ); + console.log(result); +} + +async function main() { + createPoolCustomImage(); + createPoolFullCloudServiceConfiguration(); + createPoolFullVirtualMachineConfiguration(); + createPoolMinimalCloudServiceConfiguration(); + createPoolMinimalVirtualMachineConfiguration(); + createPoolNoPublicIP(); + createPoolPublicIPs(); + createPoolUserAssignedIdentities(); + createPoolVirtualMachineConfigurationExtensions(); + createPoolAcceleratedNetworking(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples-dev/poolDeleteSample.ts b/sdk/batch/arm-batch/samples-dev/poolDeleteSample.ts index b84751200638..aff6c8349f81 100644 --- a/sdk/batch/arm-batch/samples-dev/poolDeleteSample.ts +++ b/sdk/batch/arm-batch/samples-dev/poolDeleteSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes the specified pool. * * @summary Deletes the specified pool. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolDelete.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolDelete.json */ async function deletePool() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const credential = new DefaultAzureCredential(); @@ -32,4 +36,8 @@ async function deletePool() { console.log(result); } -deletePool().catch(console.error); +async function main() { + deletePool(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples-dev/poolDisableAutoScaleSample.ts b/sdk/batch/arm-batch/samples-dev/poolDisableAutoScaleSample.ts index 73be2ed961f5..e37ab9e56405 100644 --- a/sdk/batch/arm-batch/samples-dev/poolDisableAutoScaleSample.ts +++ b/sdk/batch/arm-batch/samples-dev/poolDisableAutoScaleSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Disables automatic scaling for a pool. * * @summary Disables automatic scaling for a pool. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolDisableAutoScale.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolDisableAutoScale.json */ async function disableAutoScale() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const credential = new DefaultAzureCredential(); @@ -32,4 +36,8 @@ async function disableAutoScale() { console.log(result); } -disableAutoScale().catch(console.error); +async function main() { + disableAutoScale(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples-dev/poolGetSample.ts b/sdk/batch/arm-batch/samples-dev/poolGetSample.ts index dda6bc1df856..f4cdf8cc8de1 100644 --- a/sdk/batch/arm-batch/samples-dev/poolGetSample.ts +++ b/sdk/batch/arm-batch/samples-dev/poolGetSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets information about the specified pool. * * @summary Gets information about the specified pool. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolGet.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolGet.json */ async function getPool() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const credential = new DefaultAzureCredential(); @@ -32,17 +36,38 @@ async function getPool() { console.log(result); } -getPool().catch(console.error); +/** + * This sample demonstrates how to Gets information about the specified pool. + * + * @summary Gets information about the specified pool. + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolGet_AcceleratedNetworking.json + */ +async function getPoolAcceleratedNetworking() { + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; + const accountName = "sampleacct"; + const poolName = "testpool"; + const credential = new DefaultAzureCredential(); + const client = new BatchManagementClient(credential, subscriptionId); + const result = await client.poolOperations.get( + resourceGroupName, + accountName, + poolName + ); + console.log(result); +} /** * This sample demonstrates how to Gets information about the specified pool. * * @summary Gets information about the specified pool. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolGet_VirtualMachineConfiguration_Extensions.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolGet_VirtualMachineConfiguration_Extensions.json */ async function getPoolVirtualMachineConfigurationExtensions() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const credential = new DefaultAzureCredential(); @@ -55,4 +80,10 @@ async function getPoolVirtualMachineConfigurationExtensions() { console.log(result); } -getPoolVirtualMachineConfigurationExtensions().catch(console.error); +async function main() { + getPool(); + getPoolAcceleratedNetworking(); + getPoolVirtualMachineConfigurationExtensions(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples-dev/poolListByBatchAccountSample.ts b/sdk/batch/arm-batch/samples-dev/poolListByBatchAccountSample.ts index a342a968e782..76e57a72fffd 100644 --- a/sdk/batch/arm-batch/samples-dev/poolListByBatchAccountSample.ts +++ b/sdk/batch/arm-batch/samples-dev/poolListByBatchAccountSample.ts @@ -13,16 +13,20 @@ import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists all of the pools in the specified account. * * @summary Lists all of the pools in the specified account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolList.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolList.json */ async function listPool() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); @@ -36,17 +40,16 @@ async function listPool() { console.log(resArray); } -listPool().catch(console.error); - /** * This sample demonstrates how to Lists all of the pools in the specified account. * * @summary Lists all of the pools in the specified account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolListWithFilter.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolListWithFilter.json */ async function listPoolWithFilter() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const select = "properties/allocationState,properties/provisioningStateTransitionTime,properties/currentDedicatedNodes,properties/currentLowPriorityNodes"; @@ -66,4 +69,9 @@ async function listPoolWithFilter() { console.log(resArray); } -listPoolWithFilter().catch(console.error); +async function main() { + listPool(); + listPoolWithFilter(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples-dev/poolStopResizeSample.ts b/sdk/batch/arm-batch/samples-dev/poolStopResizeSample.ts index 2519c9dbd597..c3ff11b1c7d8 100644 --- a/sdk/batch/arm-batch/samples-dev/poolStopResizeSample.ts +++ b/sdk/batch/arm-batch/samples-dev/poolStopResizeSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to This does not restore the pool to its previous state before the resize operation: it only stops any further changes being made, and the pool maintains its current state. After stopping, the pool stabilizes at the number of nodes it was at when the stop operation was done. During the stop operation, the pool allocation state changes first to stopping and then to steady. A resize operation need not be an explicit resize pool request; this API can also be used to halt the initial sizing of the pool when it is created. * * @summary This does not restore the pool to its previous state before the resize operation: it only stops any further changes being made, and the pool maintains its current state. After stopping, the pool stabilizes at the number of nodes it was at when the stop operation was done. During the stop operation, the pool allocation state changes first to stopping and then to steady. A resize operation need not be an explicit resize pool request; this API can also be used to halt the initial sizing of the pool when it is created. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolStopResize.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolStopResize.json */ async function stopPoolResize() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const credential = new DefaultAzureCredential(); @@ -32,4 +36,8 @@ async function stopPoolResize() { console.log(result); } -stopPoolResize().catch(console.error); +async function main() { + stopPoolResize(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples-dev/poolUpdateSample.ts b/sdk/batch/arm-batch/samples-dev/poolUpdateSample.ts index b78bc19e2dbf..4df776c8db00 100644 --- a/sdk/batch/arm-batch/samples-dev/poolUpdateSample.ts +++ b/sdk/batch/arm-batch/samples-dev/poolUpdateSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { Pool, BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Updates the properties of an existing pool. * * @summary Updates the properties of an existing pool. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolUpdate_EnableAutoScale.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolUpdate_EnableAutoScale.json */ async function updatePoolEnableAutoscale() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const parameters: Pool = { @@ -36,17 +40,16 @@ async function updatePoolEnableAutoscale() { console.log(result); } -updatePoolEnableAutoscale().catch(console.error); - /** * This sample demonstrates how to Updates the properties of an existing pool. * * @summary Updates the properties of an existing pool. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolUpdate_OtherProperties.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolUpdate_OtherProperties.json */ async function updatePoolOtherProperties() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const parameters: Pool = { @@ -83,17 +86,16 @@ async function updatePoolOtherProperties() { console.log(result); } -updatePoolOtherProperties().catch(console.error); - /** * This sample demonstrates how to Updates the properties of an existing pool. * * @summary Updates the properties of an existing pool. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolUpdate_RemoveStartTask.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolUpdate_RemoveStartTask.json */ async function updatePoolRemoveStartTask() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const parameters: Pool = { startTask: {} }; @@ -108,17 +110,16 @@ async function updatePoolRemoveStartTask() { console.log(result); } -updatePoolRemoveStartTask().catch(console.error); - /** * This sample demonstrates how to Updates the properties of an existing pool. * * @summary Updates the properties of an existing pool. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolUpdate_ResizePool.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolUpdate_ResizePool.json */ async function updatePoolResizePool() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const parameters: Pool = { @@ -142,4 +143,11 @@ async function updatePoolResizePool() { console.log(result); } -updatePoolResizePool().catch(console.error); +async function main() { + updatePoolEnableAutoscale(); + updatePoolOtherProperties(); + updatePoolRemoveStartTask(); + updatePoolResizePool(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples-dev/privateEndpointConnectionDeleteSample.ts b/sdk/batch/arm-batch/samples-dev/privateEndpointConnectionDeleteSample.ts index 00da020f0c8f..7e20710b64ec 100644 --- a/sdk/batch/arm-batch/samples-dev/privateEndpointConnectionDeleteSample.ts +++ b/sdk/batch/arm-batch/samples-dev/privateEndpointConnectionDeleteSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes the specified private endpoint connection. * * @summary Deletes the specified private endpoint connection. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PrivateEndpointConnectionDelete.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PrivateEndpointConnectionDelete.json */ async function privateEndpointConnectionDelete() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const privateEndpointConnectionName = "testprivateEndpointConnection5testprivateEndpointConnection5.24d6b4b5-e65c-4330-bbe9-3a290d62f8e0"; @@ -33,4 +37,8 @@ async function privateEndpointConnectionDelete() { console.log(result); } -privateEndpointConnectionDelete().catch(console.error); +async function main() { + privateEndpointConnectionDelete(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples-dev/privateEndpointConnectionGetSample.ts b/sdk/batch/arm-batch/samples-dev/privateEndpointConnectionGetSample.ts index aae3a3b627a8..baca136374e3 100644 --- a/sdk/batch/arm-batch/samples-dev/privateEndpointConnectionGetSample.ts +++ b/sdk/batch/arm-batch/samples-dev/privateEndpointConnectionGetSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets information about the specified private endpoint connection. * * @summary Gets information about the specified private endpoint connection. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PrivateEndpointConnectionGet.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PrivateEndpointConnectionGet.json */ async function getPrivateEndpointConnection() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const privateEndpointConnectionName = "testprivateEndpointConnection5testprivateEndpointConnection5.24d6b4b5-e65c-4330-bbe9-3a290d62f8e0"; @@ -33,4 +37,8 @@ async function getPrivateEndpointConnection() { console.log(result); } -getPrivateEndpointConnection().catch(console.error); +async function main() { + getPrivateEndpointConnection(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples-dev/privateEndpointConnectionListByBatchAccountSample.ts b/sdk/batch/arm-batch/samples-dev/privateEndpointConnectionListByBatchAccountSample.ts index 29f7b274f728..18ab728d63cd 100644 --- a/sdk/batch/arm-batch/samples-dev/privateEndpointConnectionListByBatchAccountSample.ts +++ b/sdk/batch/arm-batch/samples-dev/privateEndpointConnectionListByBatchAccountSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists all of the private endpoint connections in the specified account. * * @summary Lists all of the private endpoint connections in the specified account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PrivateEndpointConnectionsList.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PrivateEndpointConnectionsList.json */ async function listPrivateEndpointConnections() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); @@ -33,4 +37,8 @@ async function listPrivateEndpointConnections() { console.log(resArray); } -listPrivateEndpointConnections().catch(console.error); +async function main() { + listPrivateEndpointConnections(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples-dev/privateEndpointConnectionUpdateSample.ts b/sdk/batch/arm-batch/samples-dev/privateEndpointConnectionUpdateSample.ts index 36d0d8a6cfa6..959bdf23ab13 100644 --- a/sdk/batch/arm-batch/samples-dev/privateEndpointConnectionUpdateSample.ts +++ b/sdk/batch/arm-batch/samples-dev/privateEndpointConnectionUpdateSample.ts @@ -13,16 +13,20 @@ import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Updates the properties of an existing private endpoint connection. * * @summary Updates the properties of an existing private endpoint connection. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PrivateEndpointConnectionUpdate.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PrivateEndpointConnectionUpdate.json */ async function updatePrivateEndpointConnection() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const privateEndpointConnectionName = "testprivateEndpointConnection5.24d6b4b5-e65c-4330-bbe9-3a290d62f8e0"; @@ -43,4 +47,8 @@ async function updatePrivateEndpointConnection() { console.log(result); } -updatePrivateEndpointConnection().catch(console.error); +async function main() { + updatePrivateEndpointConnection(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples-dev/privateLinkResourceGetSample.ts b/sdk/batch/arm-batch/samples-dev/privateLinkResourceGetSample.ts index 7ec37fe27f94..f22c4d5ee6a3 100644 --- a/sdk/batch/arm-batch/samples-dev/privateLinkResourceGetSample.ts +++ b/sdk/batch/arm-batch/samples-dev/privateLinkResourceGetSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets information about the specified private link resource. * * @summary Gets information about the specified private link resource. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PrivateLinkResourceGet.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PrivateLinkResourceGet.json */ async function getPrivateLinkResource() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const privateLinkResourceName = "batchAccount"; const credential = new DefaultAzureCredential(); @@ -32,4 +36,8 @@ async function getPrivateLinkResource() { console.log(result); } -getPrivateLinkResource().catch(console.error); +async function main() { + getPrivateLinkResource(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples-dev/privateLinkResourceListByBatchAccountSample.ts b/sdk/batch/arm-batch/samples-dev/privateLinkResourceListByBatchAccountSample.ts index 438d73224653..09a352e623ba 100644 --- a/sdk/batch/arm-batch/samples-dev/privateLinkResourceListByBatchAccountSample.ts +++ b/sdk/batch/arm-batch/samples-dev/privateLinkResourceListByBatchAccountSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists all of the private link resources in the specified account. * * @summary Lists all of the private link resources in the specified account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PrivateLinkResourcesList.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PrivateLinkResourcesList.json */ async function listPrivateLinkResource() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); @@ -33,4 +37,8 @@ async function listPrivateLinkResource() { console.log(resArray); } -listPrivateLinkResource().catch(console.error); +async function main() { + listPrivateLinkResource(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/javascript/README.md b/sdk/batch/arm-batch/samples/v9/javascript/README.md similarity index 88% rename from sdk/batch/arm-batch/samples/v8/javascript/README.md rename to sdk/batch/arm-batch/samples/v9/javascript/README.md index 4a3f746ab97a..546280fd1ac9 100644 --- a/sdk/batch/arm-batch/samples/v8/javascript/README.md +++ b/sdk/batch/arm-batch/samples/v9/javascript/README.md @@ -4,52 +4,52 @@ These sample programs show how to use the JavaScript client libraries for in som | **File Name** | **Description** | | --------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [applicationCreateSample.js][applicationcreatesample] | Adds an application to the specified Batch account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationCreate.json | -| [applicationDeleteSample.js][applicationdeletesample] | Deletes an application. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationDelete.json | -| [applicationGetSample.js][applicationgetsample] | Gets information about the specified application. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationGet.json | -| [applicationListSample.js][applicationlistsample] | Lists all of the applications in the specified account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationList.json | -| [applicationPackageActivateSample.js][applicationpackageactivatesample] | Activates the specified application package. This should be done after the `ApplicationPackage` was created and uploaded. This needs to be done before an `ApplicationPackage` can be used on Pools or Tasks. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationPackageActivate.json | -| [applicationPackageCreateSample.js][applicationpackagecreatesample] | Creates an application package record. The record contains a storageUrl where the package should be uploaded to. Once it is uploaded the `ApplicationPackage` needs to be activated using `ApplicationPackageActive` before it can be used. If the auto storage account was configured to use storage keys, the URL returned will contain a SAS. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationPackageCreate.json | -| [applicationPackageDeleteSample.js][applicationpackagedeletesample] | Deletes an application package record and its associated binary file. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationPackageDelete.json | -| [applicationPackageGetSample.js][applicationpackagegetsample] | Gets information about the specified application package. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationPackageGet.json | -| [applicationPackageListSample.js][applicationpackagelistsample] | Lists all of the application packages in the specified application. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationPackageList.json | -| [applicationUpdateSample.js][applicationupdatesample] | Updates settings for the specified application. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationUpdate.json | -| [batchAccountCreateSample.js][batchaccountcreatesample] | Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountCreate_BYOS.json | -| [batchAccountDeleteSample.js][batchaccountdeletesample] | Deletes the specified Batch account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountDelete.json | -| [batchAccountGetDetectorSample.js][batchaccountgetdetectorsample] | Gets information about the given detector for a given Batch account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/DetectorGet.json | -| [batchAccountGetKeysSample.js][batchaccountgetkeyssample] | This operation applies only to Batch accounts with allowedAuthenticationModes containing 'SharedKey'. If the Batch account doesn't contain 'SharedKey' in its allowedAuthenticationMode, clients cannot use shared keys to authenticate, and must use another allowedAuthenticationModes instead. In this case, getting the keys will fail. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountGetKeys.json | -| [batchAccountGetSample.js][batchaccountgetsample] | Gets information about the specified Batch account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountGet.json | -| [batchAccountListByResourceGroupSample.js][batchaccountlistbyresourcegroupsample] | Gets information about the Batch accounts associated with the specified resource group. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountListByResourceGroup.json | -| [batchAccountListDetectorsSample.js][batchaccountlistdetectorssample] | Gets information about the detectors available for a given Batch account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/DetectorList.json | -| [batchAccountListOutboundNetworkDependenciesEndpointsSample.js][batchaccountlistoutboundnetworkdependenciesendpointssample] | Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://docs.microsoft.com/azure/batch/batch-virtual-network. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountListOutboundNetworkDependenciesEndpoints.json | -| [batchAccountListSample.js][batchaccountlistsample] | Gets information about the Batch accounts associated with the subscription. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountList.json | -| [batchAccountRegenerateKeySample.js][batchaccountregeneratekeysample] | This operation applies only to Batch accounts with allowedAuthenticationModes containing 'SharedKey'. If the Batch account doesn't contain 'SharedKey' in its allowedAuthenticationMode, clients cannot use shared keys to authenticate, and must use another allowedAuthenticationModes instead. In this case, regenerating the keys will fail. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountRegenerateKey.json | -| [batchAccountSynchronizeAutoStorageKeysSample.js][batchaccountsynchronizeautostoragekeyssample] | Synchronizes access keys for the auto-storage account configured for the specified Batch account, only if storage key authentication is being used. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountSynchronizeAutoStorageKeys.json | -| [batchAccountUpdateSample.js][batchaccountupdatesample] | Updates the properties of an existing Batch account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountUpdate.json | -| [certificateCancelDeletionSample.js][certificatecanceldeletionsample] | If you try to delete a certificate that is being used by a pool or compute node, the status of the certificate changes to deleteFailed. If you decide that you want to continue using the certificate, you can use this operation to set the status of the certificate back to active. If you intend to delete the certificate, you do not need to run this operation after the deletion failed. You must make sure that the certificate is not being used by any resources, and then you can try again to delete the certificate. //@@TS-MAGIC-NEWLINE@@ Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateCancelDeletion.json | -| [certificateCreateSample.js][certificatecreatesample] | Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateCreate_Full.json | -| [certificateDeleteSample.js][certificatedeletesample] | Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateDelete.json | -| [certificateGetSample.js][certificategetsample] | Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateGet.json | -| [certificateListByBatchAccountSample.js][certificatelistbybatchaccountsample] | Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateList.json | -| [certificateUpdateSample.js][certificateupdatesample] | Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateUpdate.json | -| [locationCheckNameAvailabilitySample.js][locationchecknameavailabilitysample] | Checks whether the Batch account name is available in the specified region. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/LocationCheckNameAvailability_AlreadyExists.json | -| [locationGetQuotasSample.js][locationgetquotassample] | Gets the Batch service quotas for the specified subscription at the given location. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/LocationGetQuotas.json | -| [locationListSupportedCloudServiceSkusSample.js][locationlistsupportedcloudserviceskussample] | Gets the list of Batch supported Cloud Service VM sizes available at the given location. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/LocationListCloudServiceSkus.json | -| [locationListSupportedVirtualMachineSkusSample.js][locationlistsupportedvirtualmachineskussample] | Gets the list of Batch supported Virtual Machine VM sizes available at the given location. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/LocationListVirtualMachineSkus.json | -| [operationsListSample.js][operationslistsample] | Lists available operations for the Microsoft.Batch provider x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/OperationsList.json | -| [poolCreateSample.js][poolcreatesample] | Creates a new pool inside the specified account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolCreate_SharedImageGallery.json | -| [poolDeleteSample.js][pooldeletesample] | Deletes the specified pool. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolDelete.json | -| [poolDisableAutoScaleSample.js][pooldisableautoscalesample] | Disables automatic scaling for a pool. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolDisableAutoScale.json | -| [poolGetSample.js][poolgetsample] | Gets information about the specified pool. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolGet.json | -| [poolListByBatchAccountSample.js][poollistbybatchaccountsample] | Lists all of the pools in the specified account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolList.json | -| [poolStopResizeSample.js][poolstopresizesample] | This does not restore the pool to its previous state before the resize operation: it only stops any further changes being made, and the pool maintains its current state. After stopping, the pool stabilizes at the number of nodes it was at when the stop operation was done. During the stop operation, the pool allocation state changes first to stopping and then to steady. A resize operation need not be an explicit resize pool request; this API can also be used to halt the initial sizing of the pool when it is created. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolStopResize.json | -| [poolUpdateSample.js][poolupdatesample] | Updates the properties of an existing pool. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolUpdate_EnableAutoScale.json | -| [privateEndpointConnectionDeleteSample.js][privateendpointconnectiondeletesample] | Deletes the specified private endpoint connection. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PrivateEndpointConnectionDelete.json | -| [privateEndpointConnectionGetSample.js][privateendpointconnectiongetsample] | Gets information about the specified private endpoint connection. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PrivateEndpointConnectionGet.json | -| [privateEndpointConnectionListByBatchAccountSample.js][privateendpointconnectionlistbybatchaccountsample] | Lists all of the private endpoint connections in the specified account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PrivateEndpointConnectionsList.json | -| [privateEndpointConnectionUpdateSample.js][privateendpointconnectionupdatesample] | Updates the properties of an existing private endpoint connection. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PrivateEndpointConnectionUpdate.json | -| [privateLinkResourceGetSample.js][privatelinkresourcegetsample] | Gets information about the specified private link resource. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PrivateLinkResourceGet.json | -| [privateLinkResourceListByBatchAccountSample.js][privatelinkresourcelistbybatchaccountsample] | Lists all of the private link resources in the specified account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PrivateLinkResourcesList.json | +| [applicationCreateSample.js][applicationcreatesample] | Adds an application to the specified Batch account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationCreate.json | +| [applicationDeleteSample.js][applicationdeletesample] | Deletes an application. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationDelete.json | +| [applicationGetSample.js][applicationgetsample] | Gets information about the specified application. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationGet.json | +| [applicationListSample.js][applicationlistsample] | Lists all of the applications in the specified account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationList.json | +| [applicationPackageActivateSample.js][applicationpackageactivatesample] | Activates the specified application package. This should be done after the `ApplicationPackage` was created and uploaded. This needs to be done before an `ApplicationPackage` can be used on Pools or Tasks. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationPackageActivate.json | +| [applicationPackageCreateSample.js][applicationpackagecreatesample] | Creates an application package record. The record contains a storageUrl where the package should be uploaded to. Once it is uploaded the `ApplicationPackage` needs to be activated using `ApplicationPackageActive` before it can be used. If the auto storage account was configured to use storage keys, the URL returned will contain a SAS. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationPackageCreate.json | +| [applicationPackageDeleteSample.js][applicationpackagedeletesample] | Deletes an application package record and its associated binary file. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationPackageDelete.json | +| [applicationPackageGetSample.js][applicationpackagegetsample] | Gets information about the specified application package. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationPackageGet.json | +| [applicationPackageListSample.js][applicationpackagelistsample] | Lists all of the application packages in the specified application. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationPackageList.json | +| [applicationUpdateSample.js][applicationupdatesample] | Updates settings for the specified application. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationUpdate.json | +| [batchAccountCreateSample.js][batchaccountcreatesample] | Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountCreate_BYOS.json | +| [batchAccountDeleteSample.js][batchaccountdeletesample] | Deletes the specified Batch account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountDelete.json | +| [batchAccountGetDetectorSample.js][batchaccountgetdetectorsample] | Gets information about the given detector for a given Batch account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/DetectorGet.json | +| [batchAccountGetKeysSample.js][batchaccountgetkeyssample] | This operation applies only to Batch accounts with allowedAuthenticationModes containing 'SharedKey'. If the Batch account doesn't contain 'SharedKey' in its allowedAuthenticationMode, clients cannot use shared keys to authenticate, and must use another allowedAuthenticationModes instead. In this case, getting the keys will fail. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountGetKeys.json | +| [batchAccountGetSample.js][batchaccountgetsample] | Gets information about the specified Batch account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountGet.json | +| [batchAccountListByResourceGroupSample.js][batchaccountlistbyresourcegroupsample] | Gets information about the Batch accounts associated with the specified resource group. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountListByResourceGroup.json | +| [batchAccountListDetectorsSample.js][batchaccountlistdetectorssample] | Gets information about the detectors available for a given Batch account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/DetectorList.json | +| [batchAccountListOutboundNetworkDependenciesEndpointsSample.js][batchaccountlistoutboundnetworkdependenciesendpointssample] | Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://docs.microsoft.com/en-us/azure/batch/batch-virtual-network. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountListOutboundNetworkDependenciesEndpoints.json | +| [batchAccountListSample.js][batchaccountlistsample] | Gets information about the Batch accounts associated with the subscription. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountList.json | +| [batchAccountRegenerateKeySample.js][batchaccountregeneratekeysample] | This operation applies only to Batch accounts with allowedAuthenticationModes containing 'SharedKey'. If the Batch account doesn't contain 'SharedKey' in its allowedAuthenticationMode, clients cannot use shared keys to authenticate, and must use another allowedAuthenticationModes instead. In this case, regenerating the keys will fail. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountRegenerateKey.json | +| [batchAccountSynchronizeAutoStorageKeysSample.js][batchaccountsynchronizeautostoragekeyssample] | Synchronizes access keys for the auto-storage account configured for the specified Batch account, only if storage key authentication is being used. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountSynchronizeAutoStorageKeys.json | +| [batchAccountUpdateSample.js][batchaccountupdatesample] | Updates the properties of an existing Batch account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountUpdate.json | +| [certificateCancelDeletionSample.js][certificatecanceldeletionsample] | If you try to delete a certificate that is being used by a pool or compute node, the status of the certificate changes to deleteFailed. If you decide that you want to continue using the certificate, you can use this operation to set the status of the certificate back to active. If you intend to delete the certificate, you do not need to run this operation after the deletion failed. You must make sure that the certificate is not being used by any resources, and then you can try again to delete the certificate. //@@TS-MAGIC-NEWLINE@@ Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/CertificateCancelDeletion.json | +| [certificateCreateSample.js][certificatecreatesample] | Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/CertificateCreate_Full.json | +| [certificateDeleteSample.js][certificatedeletesample] | Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/CertificateDelete.json | +| [certificateGetSample.js][certificategetsample] | Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/CertificateGet.json | +| [certificateListByBatchAccountSample.js][certificatelistbybatchaccountsample] | Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/CertificateList.json | +| [certificateUpdateSample.js][certificateupdatesample] | Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/CertificateUpdate.json | +| [locationCheckNameAvailabilitySample.js][locationchecknameavailabilitysample] | Checks whether the Batch account name is available in the specified region. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/LocationCheckNameAvailability_AlreadyExists.json | +| [locationGetQuotasSample.js][locationgetquotassample] | Gets the Batch service quotas for the specified subscription at the given location. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/LocationGetQuotas.json | +| [locationListSupportedCloudServiceSkusSample.js][locationlistsupportedcloudserviceskussample] | Gets the list of Batch supported Cloud Service VM sizes available at the given location. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/LocationListCloudServiceSkus.json | +| [locationListSupportedVirtualMachineSkusSample.js][locationlistsupportedvirtualmachineskussample] | Gets the list of Batch supported Virtual Machine VM sizes available at the given location. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/LocationListVirtualMachineSkus.json | +| [operationsListSample.js][operationslistsample] | Lists available operations for the Microsoft.Batch provider x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/OperationsList.json | +| [poolCreateSample.js][poolcreatesample] | Creates a new pool inside the specified account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolCreate_SharedImageGallery.json | +| [poolDeleteSample.js][pooldeletesample] | Deletes the specified pool. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolDelete.json | +| [poolDisableAutoScaleSample.js][pooldisableautoscalesample] | Disables automatic scaling for a pool. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolDisableAutoScale.json | +| [poolGetSample.js][poolgetsample] | Gets information about the specified pool. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolGet.json | +| [poolListByBatchAccountSample.js][poollistbybatchaccountsample] | Lists all of the pools in the specified account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolList.json | +| [poolStopResizeSample.js][poolstopresizesample] | This does not restore the pool to its previous state before the resize operation: it only stops any further changes being made, and the pool maintains its current state. After stopping, the pool stabilizes at the number of nodes it was at when the stop operation was done. During the stop operation, the pool allocation state changes first to stopping and then to steady. A resize operation need not be an explicit resize pool request; this API can also be used to halt the initial sizing of the pool when it is created. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolStopResize.json | +| [poolUpdateSample.js][poolupdatesample] | Updates the properties of an existing pool. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolUpdate_EnableAutoScale.json | +| [privateEndpointConnectionDeleteSample.js][privateendpointconnectiondeletesample] | Deletes the specified private endpoint connection. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PrivateEndpointConnectionDelete.json | +| [privateEndpointConnectionGetSample.js][privateendpointconnectiongetsample] | Gets information about the specified private endpoint connection. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PrivateEndpointConnectionGet.json | +| [privateEndpointConnectionListByBatchAccountSample.js][privateendpointconnectionlistbybatchaccountsample] | Lists all of the private endpoint connections in the specified account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PrivateEndpointConnectionsList.json | +| [privateEndpointConnectionUpdateSample.js][privateendpointconnectionupdatesample] | Updates the properties of an existing private endpoint connection. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PrivateEndpointConnectionUpdate.json | +| [privateLinkResourceGetSample.js][privatelinkresourcegetsample] | Gets information about the specified private link resource. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PrivateLinkResourceGet.json | +| [privateLinkResourceListByBatchAccountSample.js][privatelinkresourcelistbybatchaccountsample] | Lists all of the private link resources in the specified account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PrivateLinkResourcesList.json | ## Prerequisites @@ -82,59 +82,59 @@ node applicationCreateSample.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 node applicationCreateSample.js +npx cross-env BATCH_SUBSCRIPTION_ID="" BATCH_RESOURCE_GROUP="" node applicationCreateSample.js ``` ## Next Steps Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. -[applicationcreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/javascript/applicationCreateSample.js -[applicationdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/javascript/applicationDeleteSample.js -[applicationgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/javascript/applicationGetSample.js -[applicationlistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/javascript/applicationListSample.js -[applicationpackageactivatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/javascript/applicationPackageActivateSample.js -[applicationpackagecreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/javascript/applicationPackageCreateSample.js -[applicationpackagedeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/javascript/applicationPackageDeleteSample.js -[applicationpackagegetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/javascript/applicationPackageGetSample.js -[applicationpackagelistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/javascript/applicationPackageListSample.js -[applicationupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/javascript/applicationUpdateSample.js -[batchaccountcreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/javascript/batchAccountCreateSample.js -[batchaccountdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/javascript/batchAccountDeleteSample.js -[batchaccountgetdetectorsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/javascript/batchAccountGetDetectorSample.js -[batchaccountgetkeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/javascript/batchAccountGetKeysSample.js -[batchaccountgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/javascript/batchAccountGetSample.js -[batchaccountlistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/javascript/batchAccountListByResourceGroupSample.js -[batchaccountlistdetectorssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/javascript/batchAccountListDetectorsSample.js -[batchaccountlistoutboundnetworkdependenciesendpointssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/javascript/batchAccountListOutboundNetworkDependenciesEndpointsSample.js -[batchaccountlistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/javascript/batchAccountListSample.js -[batchaccountregeneratekeysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/javascript/batchAccountRegenerateKeySample.js -[batchaccountsynchronizeautostoragekeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/javascript/batchAccountSynchronizeAutoStorageKeysSample.js -[batchaccountupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/javascript/batchAccountUpdateSample.js -[certificatecanceldeletionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/javascript/certificateCancelDeletionSample.js -[certificatecreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/javascript/certificateCreateSample.js -[certificatedeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/javascript/certificateDeleteSample.js -[certificategetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/javascript/certificateGetSample.js -[certificatelistbybatchaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/javascript/certificateListByBatchAccountSample.js -[certificateupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/javascript/certificateUpdateSample.js -[locationchecknameavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/javascript/locationCheckNameAvailabilitySample.js -[locationgetquotassample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/javascript/locationGetQuotasSample.js -[locationlistsupportedcloudserviceskussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/javascript/locationListSupportedCloudServiceSkusSample.js -[locationlistsupportedvirtualmachineskussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/javascript/locationListSupportedVirtualMachineSkusSample.js -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/javascript/operationsListSample.js -[poolcreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/javascript/poolCreateSample.js -[pooldeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/javascript/poolDeleteSample.js -[pooldisableautoscalesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/javascript/poolDisableAutoScaleSample.js -[poolgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/javascript/poolGetSample.js -[poollistbybatchaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/javascript/poolListByBatchAccountSample.js -[poolstopresizesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/javascript/poolStopResizeSample.js -[poolupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/javascript/poolUpdateSample.js -[privateendpointconnectiondeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/javascript/privateEndpointConnectionDeleteSample.js -[privateendpointconnectiongetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/javascript/privateEndpointConnectionGetSample.js -[privateendpointconnectionlistbybatchaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/javascript/privateEndpointConnectionListByBatchAccountSample.js -[privateendpointconnectionupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/javascript/privateEndpointConnectionUpdateSample.js -[privatelinkresourcegetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/javascript/privateLinkResourceGetSample.js -[privatelinkresourcelistbybatchaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/javascript/privateLinkResourceListByBatchAccountSample.js +[applicationcreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/javascript/applicationCreateSample.js +[applicationdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/javascript/applicationDeleteSample.js +[applicationgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/javascript/applicationGetSample.js +[applicationlistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/javascript/applicationListSample.js +[applicationpackageactivatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/javascript/applicationPackageActivateSample.js +[applicationpackagecreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/javascript/applicationPackageCreateSample.js +[applicationpackagedeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/javascript/applicationPackageDeleteSample.js +[applicationpackagegetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/javascript/applicationPackageGetSample.js +[applicationpackagelistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/javascript/applicationPackageListSample.js +[applicationupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/javascript/applicationUpdateSample.js +[batchaccountcreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/javascript/batchAccountCreateSample.js +[batchaccountdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/javascript/batchAccountDeleteSample.js +[batchaccountgetdetectorsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/javascript/batchAccountGetDetectorSample.js +[batchaccountgetkeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/javascript/batchAccountGetKeysSample.js +[batchaccountgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/javascript/batchAccountGetSample.js +[batchaccountlistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/javascript/batchAccountListByResourceGroupSample.js +[batchaccountlistdetectorssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/javascript/batchAccountListDetectorsSample.js +[batchaccountlistoutboundnetworkdependenciesendpointssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/javascript/batchAccountListOutboundNetworkDependenciesEndpointsSample.js +[batchaccountlistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/javascript/batchAccountListSample.js +[batchaccountregeneratekeysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/javascript/batchAccountRegenerateKeySample.js +[batchaccountsynchronizeautostoragekeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/javascript/batchAccountSynchronizeAutoStorageKeysSample.js +[batchaccountupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/javascript/batchAccountUpdateSample.js +[certificatecanceldeletionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/javascript/certificateCancelDeletionSample.js +[certificatecreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/javascript/certificateCreateSample.js +[certificatedeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/javascript/certificateDeleteSample.js +[certificategetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/javascript/certificateGetSample.js +[certificatelistbybatchaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/javascript/certificateListByBatchAccountSample.js +[certificateupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/javascript/certificateUpdateSample.js +[locationchecknameavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/javascript/locationCheckNameAvailabilitySample.js +[locationgetquotassample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/javascript/locationGetQuotasSample.js +[locationlistsupportedcloudserviceskussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/javascript/locationListSupportedCloudServiceSkusSample.js +[locationlistsupportedvirtualmachineskussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/javascript/locationListSupportedVirtualMachineSkusSample.js +[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/javascript/operationsListSample.js +[poolcreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/javascript/poolCreateSample.js +[pooldeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/javascript/poolDeleteSample.js +[pooldisableautoscalesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/javascript/poolDisableAutoScaleSample.js +[poolgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/javascript/poolGetSample.js +[poollistbybatchaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/javascript/poolListByBatchAccountSample.js +[poolstopresizesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/javascript/poolStopResizeSample.js +[poolupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/javascript/poolUpdateSample.js +[privateendpointconnectiondeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/javascript/privateEndpointConnectionDeleteSample.js +[privateendpointconnectiongetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/javascript/privateEndpointConnectionGetSample.js +[privateendpointconnectionlistbybatchaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/javascript/privateEndpointConnectionListByBatchAccountSample.js +[privateendpointconnectionupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/javascript/privateEndpointConnectionUpdateSample.js +[privatelinkresourcegetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/javascript/privateLinkResourceGetSample.js +[privatelinkresourcelistbybatchaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/javascript/privateLinkResourceListByBatchAccountSample.js [apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-batch?view=azure-node-preview [freesub]: https://azure.microsoft.com/free/ [package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/batch/arm-batch/README.md diff --git a/sdk/batch/arm-batch/samples/v8/javascript/applicationCreateSample.js b/sdk/batch/arm-batch/samples/v9/javascript/applicationCreateSample.js similarity index 77% rename from sdk/batch/arm-batch/samples/v8/javascript/applicationCreateSample.js rename to sdk/batch/arm-batch/samples/v9/javascript/applicationCreateSample.js index 3ac0b5040e62..dc817556d1f6 100644 --- a/sdk/batch/arm-batch/samples/v8/javascript/applicationCreateSample.js +++ b/sdk/batch/arm-batch/samples/v9/javascript/applicationCreateSample.js @@ -10,16 +10,17 @@ // Licensed under the MIT License. const { BatchManagementClient } = require("@azure/arm-batch"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Adds an application to the specified Batch account. * * @summary Adds an application to the specified Batch account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationCreate.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationCreate.json */ async function applicationCreate() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const applicationName = "app1"; const parameters = { @@ -38,4 +39,8 @@ async function applicationCreate() { console.log(result); } -applicationCreate().catch(console.error); +async function main() { + applicationCreate(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/javascript/applicationDeleteSample.js b/sdk/batch/arm-batch/samples/v9/javascript/applicationDeleteSample.js similarity index 74% rename from sdk/batch/arm-batch/samples/v8/javascript/applicationDeleteSample.js rename to sdk/batch/arm-batch/samples/v9/javascript/applicationDeleteSample.js index 5f40a8278f64..51b78ad706e8 100644 --- a/sdk/batch/arm-batch/samples/v8/javascript/applicationDeleteSample.js +++ b/sdk/batch/arm-batch/samples/v9/javascript/applicationDeleteSample.js @@ -10,16 +10,17 @@ // Licensed under the MIT License. const { BatchManagementClient } = require("@azure/arm-batch"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Deletes an application. * * @summary Deletes an application. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationDelete.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationDelete.json */ async function applicationDelete() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const applicationName = "app1"; const credential = new DefaultAzureCredential(); @@ -32,4 +33,8 @@ async function applicationDelete() { console.log(result); } -applicationDelete().catch(console.error); +async function main() { + applicationDelete(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/javascript/applicationGetSample.js b/sdk/batch/arm-batch/samples/v9/javascript/applicationGetSample.js similarity index 75% rename from sdk/batch/arm-batch/samples/v8/javascript/applicationGetSample.js rename to sdk/batch/arm-batch/samples/v9/javascript/applicationGetSample.js index 742043467523..0e82a51badc0 100644 --- a/sdk/batch/arm-batch/samples/v8/javascript/applicationGetSample.js +++ b/sdk/batch/arm-batch/samples/v9/javascript/applicationGetSample.js @@ -10,16 +10,17 @@ // Licensed under the MIT License. const { BatchManagementClient } = require("@azure/arm-batch"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets information about the specified application. * * @summary Gets information about the specified application. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationGet.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationGet.json */ async function applicationGet() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const applicationName = "app1"; const credential = new DefaultAzureCredential(); @@ -32,4 +33,8 @@ async function applicationGet() { console.log(result); } -applicationGet().catch(console.error); +async function main() { + applicationGet(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/javascript/applicationListSample.js b/sdk/batch/arm-batch/samples/v9/javascript/applicationListSample.js similarity index 75% rename from sdk/batch/arm-batch/samples/v8/javascript/applicationListSample.js rename to sdk/batch/arm-batch/samples/v9/javascript/applicationListSample.js index 8723ac0dbba3..83e0ec48e76c 100644 --- a/sdk/batch/arm-batch/samples/v8/javascript/applicationListSample.js +++ b/sdk/batch/arm-batch/samples/v9/javascript/applicationListSample.js @@ -10,16 +10,17 @@ // Licensed under the MIT License. const { BatchManagementClient } = require("@azure/arm-batch"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists all of the applications in the specified account. * * @summary Lists all of the applications in the specified account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationList.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationList.json */ async function applicationList() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); @@ -30,4 +31,8 @@ async function applicationList() { console.log(resArray); } -applicationList().catch(console.error); +async function main() { + applicationList(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/javascript/applicationPackageActivateSample.js b/sdk/batch/arm-batch/samples/v9/javascript/applicationPackageActivateSample.js similarity index 80% rename from sdk/batch/arm-batch/samples/v8/javascript/applicationPackageActivateSample.js rename to sdk/batch/arm-batch/samples/v9/javascript/applicationPackageActivateSample.js index eb7700200904..773e3ce56102 100644 --- a/sdk/batch/arm-batch/samples/v8/javascript/applicationPackageActivateSample.js +++ b/sdk/batch/arm-batch/samples/v9/javascript/applicationPackageActivateSample.js @@ -10,16 +10,17 @@ // Licensed under the MIT License. const { BatchManagementClient } = require("@azure/arm-batch"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Activates the specified application package. This should be done after the `ApplicationPackage` was created and uploaded. This needs to be done before an `ApplicationPackage` can be used on Pools or Tasks. * * @summary Activates the specified application package. This should be done after the `ApplicationPackage` was created and uploaded. This needs to be done before an `ApplicationPackage` can be used on Pools or Tasks. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationPackageActivate.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationPackageActivate.json */ async function applicationPackageActivate() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const applicationName = "app1"; const versionName = "1"; @@ -36,4 +37,8 @@ async function applicationPackageActivate() { console.log(result); } -applicationPackageActivate().catch(console.error); +async function main() { + applicationPackageActivate(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/javascript/applicationPackageCreateSample.js b/sdk/batch/arm-batch/samples/v9/javascript/applicationPackageCreateSample.js similarity index 82% rename from sdk/batch/arm-batch/samples/v8/javascript/applicationPackageCreateSample.js rename to sdk/batch/arm-batch/samples/v9/javascript/applicationPackageCreateSample.js index 0ea184fea1e3..c8493dcfefb1 100644 --- a/sdk/batch/arm-batch/samples/v8/javascript/applicationPackageCreateSample.js +++ b/sdk/batch/arm-batch/samples/v9/javascript/applicationPackageCreateSample.js @@ -10,16 +10,17 @@ // Licensed under the MIT License. const { BatchManagementClient } = require("@azure/arm-batch"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Creates an application package record. The record contains a storageUrl where the package should be uploaded to. Once it is uploaded the `ApplicationPackage` needs to be activated using `ApplicationPackageActive` before it can be used. If the auto storage account was configured to use storage keys, the URL returned will contain a SAS. * * @summary Creates an application package record. The record contains a storageUrl where the package should be uploaded to. Once it is uploaded the `ApplicationPackage` needs to be activated using `ApplicationPackageActive` before it can be used. If the auto storage account was configured to use storage keys, the URL returned will contain a SAS. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationPackageCreate.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationPackageCreate.json */ async function applicationPackageCreate() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const applicationName = "app1"; const versionName = "1"; @@ -34,4 +35,8 @@ async function applicationPackageCreate() { console.log(result); } -applicationPackageCreate().catch(console.error); +async function main() { + applicationPackageCreate(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/javascript/applicationPackageDeleteSample.js b/sdk/batch/arm-batch/samples/v9/javascript/applicationPackageDeleteSample.js similarity index 76% rename from sdk/batch/arm-batch/samples/v8/javascript/applicationPackageDeleteSample.js rename to sdk/batch/arm-batch/samples/v9/javascript/applicationPackageDeleteSample.js index bf2576a4dacc..4a39c6afac0a 100644 --- a/sdk/batch/arm-batch/samples/v8/javascript/applicationPackageDeleteSample.js +++ b/sdk/batch/arm-batch/samples/v9/javascript/applicationPackageDeleteSample.js @@ -10,16 +10,17 @@ // Licensed under the MIT License. const { BatchManagementClient } = require("@azure/arm-batch"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Deletes an application package record and its associated binary file. * * @summary Deletes an application package record and its associated binary file. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationPackageDelete.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationPackageDelete.json */ async function applicationPackageDelete() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const applicationName = "app1"; const versionName = "1"; @@ -34,4 +35,8 @@ async function applicationPackageDelete() { console.log(result); } -applicationPackageDelete().catch(console.error); +async function main() { + applicationPackageDelete(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/javascript/applicationPackageGetSample.js b/sdk/batch/arm-batch/samples/v9/javascript/applicationPackageGetSample.js similarity index 76% rename from sdk/batch/arm-batch/samples/v8/javascript/applicationPackageGetSample.js rename to sdk/batch/arm-batch/samples/v9/javascript/applicationPackageGetSample.js index 08ac2bb76387..c709dc6d9183 100644 --- a/sdk/batch/arm-batch/samples/v8/javascript/applicationPackageGetSample.js +++ b/sdk/batch/arm-batch/samples/v9/javascript/applicationPackageGetSample.js @@ -10,16 +10,17 @@ // Licensed under the MIT License. const { BatchManagementClient } = require("@azure/arm-batch"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets information about the specified application package. * * @summary Gets information about the specified application package. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationPackageGet.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationPackageGet.json */ async function applicationPackageGet() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const applicationName = "app1"; const versionName = "1"; @@ -34,4 +35,8 @@ async function applicationPackageGet() { console.log(result); } -applicationPackageGet().catch(console.error); +async function main() { + applicationPackageGet(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/javascript/applicationPackageListSample.js b/sdk/batch/arm-batch/samples/v9/javascript/applicationPackageListSample.js similarity index 76% rename from sdk/batch/arm-batch/samples/v8/javascript/applicationPackageListSample.js rename to sdk/batch/arm-batch/samples/v9/javascript/applicationPackageListSample.js index 16ea9d61b9d7..051871f77701 100644 --- a/sdk/batch/arm-batch/samples/v8/javascript/applicationPackageListSample.js +++ b/sdk/batch/arm-batch/samples/v9/javascript/applicationPackageListSample.js @@ -10,16 +10,17 @@ // Licensed under the MIT License. const { BatchManagementClient } = require("@azure/arm-batch"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists all of the application packages in the specified application. * * @summary Lists all of the application packages in the specified application. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationPackageList.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationPackageList.json */ async function applicationPackageList() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const applicationName = "app1"; const credential = new DefaultAzureCredential(); @@ -35,4 +36,8 @@ async function applicationPackageList() { console.log(resArray); } -applicationPackageList().catch(console.error); +async function main() { + applicationPackageList(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/javascript/applicationUpdateSample.js b/sdk/batch/arm-batch/samples/v9/javascript/applicationUpdateSample.js similarity index 77% rename from sdk/batch/arm-batch/samples/v8/javascript/applicationUpdateSample.js rename to sdk/batch/arm-batch/samples/v9/javascript/applicationUpdateSample.js index 1a072edfbb4a..171d17428514 100644 --- a/sdk/batch/arm-batch/samples/v8/javascript/applicationUpdateSample.js +++ b/sdk/batch/arm-batch/samples/v9/javascript/applicationUpdateSample.js @@ -10,16 +10,17 @@ // Licensed under the MIT License. const { BatchManagementClient } = require("@azure/arm-batch"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Updates settings for the specified application. * * @summary Updates settings for the specified application. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationUpdate.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationUpdate.json */ async function applicationUpdate() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const applicationName = "app1"; const parameters = { @@ -38,4 +39,8 @@ async function applicationUpdate() { console.log(result); } -applicationUpdate().catch(console.error); +async function main() { + applicationUpdate(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/javascript/batchAccountCreateSample.js b/sdk/batch/arm-batch/samples/v9/javascript/batchAccountCreateSample.js similarity index 82% rename from sdk/batch/arm-batch/samples/v8/javascript/batchAccountCreateSample.js rename to sdk/batch/arm-batch/samples/v9/javascript/batchAccountCreateSample.js index e99ca4f328c0..1a998f6f5935 100644 --- a/sdk/batch/arm-batch/samples/v8/javascript/batchAccountCreateSample.js +++ b/sdk/batch/arm-batch/samples/v9/javascript/batchAccountCreateSample.js @@ -10,16 +10,17 @@ // Licensed under the MIT License. const { BatchManagementClient } = require("@azure/arm-batch"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API. * * @summary Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountCreate_BYOS.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountCreate_BYOS.json */ async function batchAccountCreateByos() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const parameters = { autoStorage: { @@ -43,17 +44,15 @@ async function batchAccountCreateByos() { console.log(result); } -batchAccountCreateByos().catch(console.error); - /** * This sample demonstrates how to Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API. * * @summary Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountCreate_Default.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountCreate_Default.json */ async function batchAccountCreateDefault() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const parameters = { autoStorage: { @@ -72,17 +71,15 @@ async function batchAccountCreateDefault() { console.log(result); } -batchAccountCreateDefault().catch(console.error); - /** * This sample demonstrates how to Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API. * * @summary Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountCreate_SystemAssignedIdentity.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountCreate_SystemAssignedIdentity.json */ async function batchAccountCreateSystemAssignedIdentity() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const parameters = { autoStorage: { @@ -102,17 +99,15 @@ async function batchAccountCreateSystemAssignedIdentity() { console.log(result); } -batchAccountCreateSystemAssignedIdentity().catch(console.error); - /** * This sample demonstrates how to Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API. * * @summary Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountCreate_UserAssignedIdentity.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountCreate_UserAssignedIdentity.json */ async function batchAccountCreateUserAssignedIdentity() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const parameters = { autoStorage: { @@ -138,17 +133,15 @@ async function batchAccountCreateUserAssignedIdentity() { console.log(result); } -batchAccountCreateUserAssignedIdentity().catch(console.error); - /** * This sample demonstrates how to Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API. * * @summary Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PrivateBatchAccountCreate.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PrivateBatchAccountCreate.json */ async function privateBatchAccountCreate() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const parameters = { autoStorage: { @@ -172,4 +165,12 @@ async function privateBatchAccountCreate() { console.log(result); } -privateBatchAccountCreate().catch(console.error); +async function main() { + batchAccountCreateByos(); + batchAccountCreateDefault(); + batchAccountCreateSystemAssignedIdentity(); + batchAccountCreateUserAssignedIdentity(); + privateBatchAccountCreate(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/javascript/batchAccountDeleteSample.js b/sdk/batch/arm-batch/samples/v9/javascript/batchAccountDeleteSample.js similarity index 73% rename from sdk/batch/arm-batch/samples/v8/javascript/batchAccountDeleteSample.js rename to sdk/batch/arm-batch/samples/v9/javascript/batchAccountDeleteSample.js index 9f735ed27cce..c0a029f0fcb0 100644 --- a/sdk/batch/arm-batch/samples/v8/javascript/batchAccountDeleteSample.js +++ b/sdk/batch/arm-batch/samples/v9/javascript/batchAccountDeleteSample.js @@ -10,16 +10,17 @@ // Licensed under the MIT License. const { BatchManagementClient } = require("@azure/arm-batch"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Deletes the specified Batch account. * * @summary Deletes the specified Batch account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountDelete.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountDelete.json */ async function batchAccountDelete() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); @@ -30,4 +31,8 @@ async function batchAccountDelete() { console.log(result); } -batchAccountDelete().catch(console.error); +async function main() { + batchAccountDelete(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/javascript/batchAccountGetDetectorSample.js b/sdk/batch/arm-batch/samples/v9/javascript/batchAccountGetDetectorSample.js similarity index 76% rename from sdk/batch/arm-batch/samples/v8/javascript/batchAccountGetDetectorSample.js rename to sdk/batch/arm-batch/samples/v9/javascript/batchAccountGetDetectorSample.js index 7d5a32d0887d..cedf06eea228 100644 --- a/sdk/batch/arm-batch/samples/v8/javascript/batchAccountGetDetectorSample.js +++ b/sdk/batch/arm-batch/samples/v9/javascript/batchAccountGetDetectorSample.js @@ -10,16 +10,17 @@ // Licensed under the MIT License. const { BatchManagementClient } = require("@azure/arm-batch"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets information about the given detector for a given Batch account. * * @summary Gets information about the given detector for a given Batch account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/DetectorGet.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/DetectorGet.json */ async function getDetector() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const detectorId = "poolsAndNodes"; const credential = new DefaultAzureCredential(); @@ -32,4 +33,8 @@ async function getDetector() { console.log(result); } -getDetector().catch(console.error); +async function main() { + getDetector(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/javascript/batchAccountGetKeysSample.js b/sdk/batch/arm-batch/samples/v9/javascript/batchAccountGetKeysSample.js similarity index 81% rename from sdk/batch/arm-batch/samples/v8/javascript/batchAccountGetKeysSample.js rename to sdk/batch/arm-batch/samples/v9/javascript/batchAccountGetKeysSample.js index a1743cd3e30d..b22a1ab05bd3 100644 --- a/sdk/batch/arm-batch/samples/v8/javascript/batchAccountGetKeysSample.js +++ b/sdk/batch/arm-batch/samples/v9/javascript/batchAccountGetKeysSample.js @@ -10,16 +10,17 @@ // Licensed under the MIT License. const { BatchManagementClient } = require("@azure/arm-batch"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to This operation applies only to Batch accounts with allowedAuthenticationModes containing 'SharedKey'. If the Batch account doesn't contain 'SharedKey' in its allowedAuthenticationMode, clients cannot use shared keys to authenticate, and must use another allowedAuthenticationModes instead. In this case, getting the keys will fail. * * @summary This operation applies only to Batch accounts with allowedAuthenticationModes containing 'SharedKey'. If the Batch account doesn't contain 'SharedKey' in its allowedAuthenticationMode, clients cannot use shared keys to authenticate, and must use another allowedAuthenticationModes instead. In this case, getting the keys will fail. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountGetKeys.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountGetKeys.json */ async function batchAccountGetKeys() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); @@ -27,4 +28,8 @@ async function batchAccountGetKeys() { console.log(result); } -batchAccountGetKeys().catch(console.error); +async function main() { + batchAccountGetKeys(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/javascript/batchAccountGetSample.js b/sdk/batch/arm-batch/samples/v9/javascript/batchAccountGetSample.js similarity index 71% rename from sdk/batch/arm-batch/samples/v8/javascript/batchAccountGetSample.js rename to sdk/batch/arm-batch/samples/v9/javascript/batchAccountGetSample.js index d8ba19ea08bd..d7810e4afd19 100644 --- a/sdk/batch/arm-batch/samples/v8/javascript/batchAccountGetSample.js +++ b/sdk/batch/arm-batch/samples/v9/javascript/batchAccountGetSample.js @@ -10,16 +10,17 @@ // Licensed under the MIT License. const { BatchManagementClient } = require("@azure/arm-batch"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets information about the specified Batch account. * * @summary Gets information about the specified Batch account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountGet.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountGet.json */ async function batchAccountGet() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); @@ -27,17 +28,15 @@ async function batchAccountGet() { console.log(result); } -batchAccountGet().catch(console.error); - /** * This sample demonstrates how to Gets information about the specified Batch account. * * @summary Gets information about the specified Batch account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PrivateBatchAccountGet.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PrivateBatchAccountGet.json */ async function privateBatchAccountGet() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); @@ -45,4 +44,9 @@ async function privateBatchAccountGet() { console.log(result); } -privateBatchAccountGet().catch(console.error); +async function main() { + batchAccountGet(); + privateBatchAccountGet(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/javascript/batchAccountListByResourceGroupSample.js b/sdk/batch/arm-batch/samples/v9/javascript/batchAccountListByResourceGroupSample.js similarity index 75% rename from sdk/batch/arm-batch/samples/v8/javascript/batchAccountListByResourceGroupSample.js rename to sdk/batch/arm-batch/samples/v9/javascript/batchAccountListByResourceGroupSample.js index 33d65c998acd..a86f77ce8189 100644 --- a/sdk/batch/arm-batch/samples/v8/javascript/batchAccountListByResourceGroupSample.js +++ b/sdk/batch/arm-batch/samples/v9/javascript/batchAccountListByResourceGroupSample.js @@ -10,16 +10,17 @@ // Licensed under the MIT License. const { BatchManagementClient } = require("@azure/arm-batch"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets information about the Batch accounts associated with the specified resource group. * * @summary Gets information about the Batch accounts associated with the specified resource group. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountListByResourceGroup.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountListByResourceGroup.json */ async function batchAccountListByResourceGroup() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -29,4 +30,8 @@ async function batchAccountListByResourceGroup() { console.log(resArray); } -batchAccountListByResourceGroup().catch(console.error); +async function main() { + batchAccountListByResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/javascript/batchAccountListDetectorsSample.js b/sdk/batch/arm-batch/samples/v9/javascript/batchAccountListDetectorsSample.js similarity index 76% rename from sdk/batch/arm-batch/samples/v8/javascript/batchAccountListDetectorsSample.js rename to sdk/batch/arm-batch/samples/v9/javascript/batchAccountListDetectorsSample.js index af9619ff5211..14e17f13a92d 100644 --- a/sdk/batch/arm-batch/samples/v8/javascript/batchAccountListDetectorsSample.js +++ b/sdk/batch/arm-batch/samples/v9/javascript/batchAccountListDetectorsSample.js @@ -10,16 +10,17 @@ // Licensed under the MIT License. const { BatchManagementClient } = require("@azure/arm-batch"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets information about the detectors available for a given Batch account. * * @summary Gets information about the detectors available for a given Batch account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/DetectorList.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/DetectorList.json */ async function listDetectors() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); @@ -33,4 +34,8 @@ async function listDetectors() { console.log(resArray); } -listDetectors().catch(console.error); +async function main() { + listDetectors(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/javascript/batchAccountListOutboundNetworkDependenciesEndpointsSample.js b/sdk/batch/arm-batch/samples/v9/javascript/batchAccountListOutboundNetworkDependenciesEndpointsSample.js similarity index 85% rename from sdk/batch/arm-batch/samples/v8/javascript/batchAccountListOutboundNetworkDependenciesEndpointsSample.js rename to sdk/batch/arm-batch/samples/v9/javascript/batchAccountListOutboundNetworkDependenciesEndpointsSample.js index a1e607747db2..e2f01bdf71b9 100644 --- a/sdk/batch/arm-batch/samples/v8/javascript/batchAccountListOutboundNetworkDependenciesEndpointsSample.js +++ b/sdk/batch/arm-batch/samples/v9/javascript/batchAccountListOutboundNetworkDependenciesEndpointsSample.js @@ -10,16 +10,17 @@ // Licensed under the MIT License. const { BatchManagementClient } = require("@azure/arm-batch"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://docs.microsoft.com/en-us/azure/batch/batch-virtual-network. * * @summary Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://docs.microsoft.com/en-us/azure/batch/batch-virtual-network. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountListOutboundNetworkDependenciesEndpoints.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountListOutboundNetworkDependenciesEndpoints.json */ async function listOutboundNetworkDependencies() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); @@ -33,4 +34,8 @@ async function listOutboundNetworkDependencies() { console.log(resArray); } -listOutboundNetworkDependencies().catch(console.error); +async function main() { + listOutboundNetworkDependencies(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/javascript/batchAccountListSample.js b/sdk/batch/arm-batch/samples/v9/javascript/batchAccountListSample.js similarity index 80% rename from sdk/batch/arm-batch/samples/v8/javascript/batchAccountListSample.js rename to sdk/batch/arm-batch/samples/v9/javascript/batchAccountListSample.js index 9d76dc6b269c..3b5a8bf58f05 100644 --- a/sdk/batch/arm-batch/samples/v8/javascript/batchAccountListSample.js +++ b/sdk/batch/arm-batch/samples/v9/javascript/batchAccountListSample.js @@ -10,15 +10,16 @@ // Licensed under the MIT License. const { BatchManagementClient } = require("@azure/arm-batch"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets information about the Batch accounts associated with the subscription. * * @summary Gets information about the Batch accounts associated with the subscription. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountList.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountList.json */ async function batchAccountList() { - const subscriptionId = "subid"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -28,4 +29,8 @@ async function batchAccountList() { console.log(resArray); } -batchAccountList().catch(console.error); +async function main() { + batchAccountList(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/javascript/batchAccountRegenerateKeySample.js b/sdk/batch/arm-batch/samples/v9/javascript/batchAccountRegenerateKeySample.js similarity index 82% rename from sdk/batch/arm-batch/samples/v8/javascript/batchAccountRegenerateKeySample.js rename to sdk/batch/arm-batch/samples/v9/javascript/batchAccountRegenerateKeySample.js index 1675d7cc6274..86d00691159c 100644 --- a/sdk/batch/arm-batch/samples/v8/javascript/batchAccountRegenerateKeySample.js +++ b/sdk/batch/arm-batch/samples/v9/javascript/batchAccountRegenerateKeySample.js @@ -10,16 +10,17 @@ // Licensed under the MIT License. const { BatchManagementClient } = require("@azure/arm-batch"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to This operation applies only to Batch accounts with allowedAuthenticationModes containing 'SharedKey'. If the Batch account doesn't contain 'SharedKey' in its allowedAuthenticationMode, clients cannot use shared keys to authenticate, and must use another allowedAuthenticationModes instead. In this case, regenerating the keys will fail. * * @summary This operation applies only to Batch accounts with allowedAuthenticationModes containing 'SharedKey'. If the Batch account doesn't contain 'SharedKey' in its allowedAuthenticationMode, clients cannot use shared keys to authenticate, and must use another allowedAuthenticationModes instead. In this case, regenerating the keys will fail. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountRegenerateKey.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountRegenerateKey.json */ async function batchAccountRegenerateKey() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const parameters = { keyName: "Primary", @@ -34,4 +35,8 @@ async function batchAccountRegenerateKey() { console.log(result); } -batchAccountRegenerateKey().catch(console.error); +async function main() { + batchAccountRegenerateKey(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/javascript/batchAccountSynchronizeAutoStorageKeysSample.js b/sdk/batch/arm-batch/samples/v9/javascript/batchAccountSynchronizeAutoStorageKeysSample.js similarity index 77% rename from sdk/batch/arm-batch/samples/v8/javascript/batchAccountSynchronizeAutoStorageKeysSample.js rename to sdk/batch/arm-batch/samples/v9/javascript/batchAccountSynchronizeAutoStorageKeysSample.js index e93798869111..0683999bf291 100644 --- a/sdk/batch/arm-batch/samples/v8/javascript/batchAccountSynchronizeAutoStorageKeysSample.js +++ b/sdk/batch/arm-batch/samples/v9/javascript/batchAccountSynchronizeAutoStorageKeysSample.js @@ -10,16 +10,17 @@ // Licensed under the MIT License. const { BatchManagementClient } = require("@azure/arm-batch"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Synchronizes access keys for the auto-storage account configured for the specified Batch account, only if storage key authentication is being used. * * @summary Synchronizes access keys for the auto-storage account configured for the specified Batch account, only if storage key authentication is being used. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountSynchronizeAutoStorageKeys.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountSynchronizeAutoStorageKeys.json */ async function batchAccountSynchronizeAutoStorageKeys() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); @@ -30,4 +31,8 @@ async function batchAccountSynchronizeAutoStorageKeys() { console.log(result); } -batchAccountSynchronizeAutoStorageKeys().catch(console.error); +async function main() { + batchAccountSynchronizeAutoStorageKeys(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/javascript/batchAccountUpdateSample.js b/sdk/batch/arm-batch/samples/v9/javascript/batchAccountUpdateSample.js similarity index 77% rename from sdk/batch/arm-batch/samples/v8/javascript/batchAccountUpdateSample.js rename to sdk/batch/arm-batch/samples/v9/javascript/batchAccountUpdateSample.js index 75518950f607..28981b8f2f3c 100644 --- a/sdk/batch/arm-batch/samples/v8/javascript/batchAccountUpdateSample.js +++ b/sdk/batch/arm-batch/samples/v9/javascript/batchAccountUpdateSample.js @@ -10,16 +10,17 @@ // Licensed under the MIT License. const { BatchManagementClient } = require("@azure/arm-batch"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Updates the properties of an existing Batch account. * * @summary Updates the properties of an existing Batch account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountUpdate.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountUpdate.json */ async function batchAccountUpdate() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const parameters = { autoStorage: { @@ -37,4 +38,8 @@ async function batchAccountUpdate() { console.log(result); } -batchAccountUpdate().catch(console.error); +async function main() { + batchAccountUpdate(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/javascript/certificateCancelDeletionSample.js b/sdk/batch/arm-batch/samples/v9/javascript/certificateCancelDeletionSample.js similarity index 87% rename from sdk/batch/arm-batch/samples/v8/javascript/certificateCancelDeletionSample.js rename to sdk/batch/arm-batch/samples/v9/javascript/certificateCancelDeletionSample.js index d7b7909ec5eb..69f82e76c573 100644 --- a/sdk/batch/arm-batch/samples/v8/javascript/certificateCancelDeletionSample.js +++ b/sdk/batch/arm-batch/samples/v9/javascript/certificateCancelDeletionSample.js @@ -10,6 +10,7 @@ // Licensed under the MIT License. const { BatchManagementClient } = require("@azure/arm-batch"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to If you try to delete a certificate that is being used by a pool or compute node, the status of the certificate changes to deleteFailed. If you decide that you want to continue using the certificate, you can use this operation to set the status of the certificate back to active. If you intend to delete the certificate, you do not need to run this operation after the deletion failed. You must make sure that the certificate is not being used by any resources, and then you can try again to delete the certificate. @@ -19,11 +20,11 @@ Warning: This operation is deprecated and will be removed after February, 2024. * @summary If you try to delete a certificate that is being used by a pool or compute node, the status of the certificate changes to deleteFailed. If you decide that you want to continue using the certificate, you can use this operation to set the status of the certificate back to active. If you intend to delete the certificate, you do not need to run this operation after the deletion failed. You must make sure that the certificate is not being used by any resources, and then you can try again to delete the certificate. Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateCancelDeletion.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/CertificateCancelDeletion.json */ async function certificateCancelDeletion() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const certificateName = "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"; const credential = new DefaultAzureCredential(); @@ -36,4 +37,8 @@ async function certificateCancelDeletion() { console.log(result); } -certificateCancelDeletion().catch(console.error); +async function main() { + certificateCancelDeletion(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/javascript/certificateCreateSample.js b/sdk/batch/arm-batch/samples/v9/javascript/certificateCreateSample.js similarity index 81% rename from sdk/batch/arm-batch/samples/v8/javascript/certificateCreateSample.js rename to sdk/batch/arm-batch/samples/v9/javascript/certificateCreateSample.js index eb326fcb60cf..46804a3b3e41 100644 --- a/sdk/batch/arm-batch/samples/v8/javascript/certificateCreateSample.js +++ b/sdk/batch/arm-batch/samples/v9/javascript/certificateCreateSample.js @@ -10,16 +10,17 @@ // Licensed under the MIT License. const { BatchManagementClient } = require("@azure/arm-batch"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. * * @summary Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateCreate_Full.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/CertificateCreate_Full.json */ async function createCertificateFull() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const certificateName = "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"; const parameters = { @@ -40,17 +41,15 @@ async function createCertificateFull() { console.log(result); } -createCertificateFull().catch(console.error); - /** * This sample demonstrates how to Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. * * @summary Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateCreate_MinimalCer.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/CertificateCreate_MinimalCer.json */ async function createCertificateMinimalCer() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const certificateName = "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"; const parameters = { @@ -68,17 +67,15 @@ async function createCertificateMinimalCer() { console.log(result); } -createCertificateMinimalCer().catch(console.error); - /** * This sample demonstrates how to Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. * * @summary Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateCreate_Minimal.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/CertificateCreate_Minimal.json */ async function createCertificateMinimalPfx() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const certificateName = "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"; const parameters = { @@ -96,4 +93,10 @@ async function createCertificateMinimalPfx() { console.log(result); } -createCertificateMinimalPfx().catch(console.error); +async function main() { + createCertificateFull(); + createCertificateMinimalCer(); + createCertificateMinimalPfx(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/javascript/certificateDeleteSample.js b/sdk/batch/arm-batch/samples/v9/javascript/certificateDeleteSample.js similarity index 80% rename from sdk/batch/arm-batch/samples/v8/javascript/certificateDeleteSample.js rename to sdk/batch/arm-batch/samples/v9/javascript/certificateDeleteSample.js index d03535e18af0..c4046446442d 100644 --- a/sdk/batch/arm-batch/samples/v8/javascript/certificateDeleteSample.js +++ b/sdk/batch/arm-batch/samples/v9/javascript/certificateDeleteSample.js @@ -10,16 +10,17 @@ // Licensed under the MIT License. const { BatchManagementClient } = require("@azure/arm-batch"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. * * @summary Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateDelete.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/CertificateDelete.json */ async function certificateDelete() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const certificateName = "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"; const credential = new DefaultAzureCredential(); @@ -32,4 +33,8 @@ async function certificateDelete() { console.log(result); } -certificateDelete().catch(console.error); +async function main() { + certificateDelete(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/javascript/certificateGetSample.js b/sdk/batch/arm-batch/samples/v9/javascript/certificateGetSample.js similarity index 79% rename from sdk/batch/arm-batch/samples/v8/javascript/certificateGetSample.js rename to sdk/batch/arm-batch/samples/v9/javascript/certificateGetSample.js index 0b5ae74ab826..bea8b57888f6 100644 --- a/sdk/batch/arm-batch/samples/v8/javascript/certificateGetSample.js +++ b/sdk/batch/arm-batch/samples/v9/javascript/certificateGetSample.js @@ -10,16 +10,17 @@ // Licensed under the MIT License. const { BatchManagementClient } = require("@azure/arm-batch"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. * * @summary Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateGet.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/CertificateGet.json */ async function getCertificate() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const certificateName = "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"; const credential = new DefaultAzureCredential(); @@ -32,17 +33,15 @@ async function getCertificate() { console.log(result); } -getCertificate().catch(console.error); - /** * This sample demonstrates how to Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. * * @summary Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateGetWithDeletionError.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/CertificateGetWithDeletionError.json */ async function getCertificateWithDeletionError() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const certificateName = "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"; const credential = new DefaultAzureCredential(); @@ -55,4 +54,9 @@ async function getCertificateWithDeletionError() { console.log(result); } -getCertificateWithDeletionError().catch(console.error); +async function main() { + getCertificate(); + getCertificateWithDeletionError(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/javascript/certificateListByBatchAccountSample.js b/sdk/batch/arm-batch/samples/v9/javascript/certificateListByBatchAccountSample.js similarity index 80% rename from sdk/batch/arm-batch/samples/v8/javascript/certificateListByBatchAccountSample.js rename to sdk/batch/arm-batch/samples/v9/javascript/certificateListByBatchAccountSample.js index 9611c8317a59..b9b22149f4b9 100644 --- a/sdk/batch/arm-batch/samples/v8/javascript/certificateListByBatchAccountSample.js +++ b/sdk/batch/arm-batch/samples/v9/javascript/certificateListByBatchAccountSample.js @@ -10,16 +10,17 @@ // Licensed under the MIT License. const { BatchManagementClient } = require("@azure/arm-batch"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. * * @summary Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateList.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/CertificateList.json */ async function listCertificates() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); @@ -33,17 +34,15 @@ async function listCertificates() { console.log(resArray); } -listCertificates().catch(console.error); - /** * This sample demonstrates how to Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. * * @summary Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateListWithFilter.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/CertificateListWithFilter.json */ async function listCertificatesFilterAndSelect() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const select = "properties/format,properties/provisioningState"; const filter = @@ -65,4 +64,9 @@ async function listCertificatesFilterAndSelect() { console.log(resArray); } -listCertificatesFilterAndSelect().catch(console.error); +async function main() { + listCertificates(); + listCertificatesFilterAndSelect(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/javascript/certificateUpdateSample.js b/sdk/batch/arm-batch/samples/v9/javascript/certificateUpdateSample.js similarity index 81% rename from sdk/batch/arm-batch/samples/v8/javascript/certificateUpdateSample.js rename to sdk/batch/arm-batch/samples/v9/javascript/certificateUpdateSample.js index fe20a1c8d7be..0614edf18d71 100644 --- a/sdk/batch/arm-batch/samples/v8/javascript/certificateUpdateSample.js +++ b/sdk/batch/arm-batch/samples/v9/javascript/certificateUpdateSample.js @@ -10,16 +10,17 @@ // Licensed under the MIT License. const { BatchManagementClient } = require("@azure/arm-batch"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. * * @summary Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateUpdate.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/CertificateUpdate.json */ async function updateCertificate() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const certificateName = "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"; const parameters = { @@ -37,4 +38,8 @@ async function updateCertificate() { console.log(result); } -updateCertificate().catch(console.error); +async function main() { + updateCertificate(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/javascript/locationCheckNameAvailabilitySample.js b/sdk/batch/arm-batch/samples/v9/javascript/locationCheckNameAvailabilitySample.js similarity index 80% rename from sdk/batch/arm-batch/samples/v8/javascript/locationCheckNameAvailabilitySample.js rename to sdk/batch/arm-batch/samples/v9/javascript/locationCheckNameAvailabilitySample.js index 36170cc8966e..b891e7206320 100644 --- a/sdk/batch/arm-batch/samples/v8/javascript/locationCheckNameAvailabilitySample.js +++ b/sdk/batch/arm-batch/samples/v9/javascript/locationCheckNameAvailabilitySample.js @@ -10,15 +10,16 @@ // Licensed under the MIT License. const { BatchManagementClient } = require("@azure/arm-batch"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Checks whether the Batch account name is available in the specified region. * * @summary Checks whether the Batch account name is available in the specified region. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/LocationCheckNameAvailability_AlreadyExists.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/LocationCheckNameAvailability_AlreadyExists.json */ async function locationCheckNameAvailabilityAlreadyExists() { - const subscriptionId = "subid"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; const locationName = "japaneast"; const parameters = { name: "existingaccountname", @@ -30,16 +31,14 @@ async function locationCheckNameAvailabilityAlreadyExists() { console.log(result); } -locationCheckNameAvailabilityAlreadyExists().catch(console.error); - /** * This sample demonstrates how to Checks whether the Batch account name is available in the specified region. * * @summary Checks whether the Batch account name is available in the specified region. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/LocationCheckNameAvailability_Available.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/LocationCheckNameAvailability_Available.json */ async function locationCheckNameAvailabilityAvailable() { - const subscriptionId = "subid"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; const locationName = "japaneast"; const parameters = { name: "newaccountname", @@ -51,4 +50,9 @@ async function locationCheckNameAvailabilityAvailable() { console.log(result); } -locationCheckNameAvailabilityAvailable().catch(console.error); +async function main() { + locationCheckNameAvailabilityAlreadyExists(); + locationCheckNameAvailabilityAvailable(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/javascript/locationGetQuotasSample.js b/sdk/batch/arm-batch/samples/v9/javascript/locationGetQuotasSample.js similarity index 80% rename from sdk/batch/arm-batch/samples/v8/javascript/locationGetQuotasSample.js rename to sdk/batch/arm-batch/samples/v9/javascript/locationGetQuotasSample.js index 190200366833..f2cdb24ed486 100644 --- a/sdk/batch/arm-batch/samples/v8/javascript/locationGetQuotasSample.js +++ b/sdk/batch/arm-batch/samples/v9/javascript/locationGetQuotasSample.js @@ -10,15 +10,16 @@ // Licensed under the MIT License. const { BatchManagementClient } = require("@azure/arm-batch"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets the Batch service quotas for the specified subscription at the given location. * * @summary Gets the Batch service quotas for the specified subscription at the given location. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/LocationGetQuotas.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/LocationGetQuotas.json */ async function locationGetQuotas() { - const subscriptionId = "subid"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; const locationName = "japaneast"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); @@ -26,4 +27,8 @@ async function locationGetQuotas() { console.log(result); } -locationGetQuotas().catch(console.error); +async function main() { + locationGetQuotas(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/javascript/locationListSupportedCloudServiceSkusSample.js b/sdk/batch/arm-batch/samples/v9/javascript/locationListSupportedCloudServiceSkusSample.js similarity index 81% rename from sdk/batch/arm-batch/samples/v8/javascript/locationListSupportedCloudServiceSkusSample.js rename to sdk/batch/arm-batch/samples/v9/javascript/locationListSupportedCloudServiceSkusSample.js index f155f48ccd71..757ac6d60f29 100644 --- a/sdk/batch/arm-batch/samples/v8/javascript/locationListSupportedCloudServiceSkusSample.js +++ b/sdk/batch/arm-batch/samples/v9/javascript/locationListSupportedCloudServiceSkusSample.js @@ -10,15 +10,16 @@ // Licensed under the MIT License. const { BatchManagementClient } = require("@azure/arm-batch"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets the list of Batch supported Cloud Service VM sizes available at the given location. * * @summary Gets the list of Batch supported Cloud Service VM sizes available at the given location. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/LocationListCloudServiceSkus.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/LocationListCloudServiceSkus.json */ async function locationListCloudServiceSkus() { - const subscriptionId = "subid"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; const locationName = "japaneast"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); @@ -29,4 +30,8 @@ async function locationListCloudServiceSkus() { console.log(resArray); } -locationListCloudServiceSkus().catch(console.error); +async function main() { + locationListCloudServiceSkus(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/javascript/locationListSupportedVirtualMachineSkusSample.js b/sdk/batch/arm-batch/samples/v9/javascript/locationListSupportedVirtualMachineSkusSample.js similarity index 81% rename from sdk/batch/arm-batch/samples/v8/javascript/locationListSupportedVirtualMachineSkusSample.js rename to sdk/batch/arm-batch/samples/v9/javascript/locationListSupportedVirtualMachineSkusSample.js index 9e9f434ae29f..98b5e858d7d3 100644 --- a/sdk/batch/arm-batch/samples/v8/javascript/locationListSupportedVirtualMachineSkusSample.js +++ b/sdk/batch/arm-batch/samples/v9/javascript/locationListSupportedVirtualMachineSkusSample.js @@ -10,15 +10,16 @@ // Licensed under the MIT License. const { BatchManagementClient } = require("@azure/arm-batch"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets the list of Batch supported Virtual Machine VM sizes available at the given location. * * @summary Gets the list of Batch supported Virtual Machine VM sizes available at the given location. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/LocationListVirtualMachineSkus.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/LocationListVirtualMachineSkus.json */ async function locationListVirtualMachineSkus() { - const subscriptionId = "subid"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; const locationName = "japaneast"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); @@ -29,4 +30,8 @@ async function locationListVirtualMachineSkus() { console.log(resArray); } -locationListVirtualMachineSkus().catch(console.error); +async function main() { + locationListVirtualMachineSkus(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/javascript/operationsListSample.js b/sdk/batch/arm-batch/samples/v9/javascript/operationsListSample.js similarity index 78% rename from sdk/batch/arm-batch/samples/v8/javascript/operationsListSample.js rename to sdk/batch/arm-batch/samples/v9/javascript/operationsListSample.js index 323a28b89905..a687471e56db 100644 --- a/sdk/batch/arm-batch/samples/v8/javascript/operationsListSample.js +++ b/sdk/batch/arm-batch/samples/v9/javascript/operationsListSample.js @@ -10,15 +10,17 @@ // Licensed under the MIT License. const { BatchManagementClient } = require("@azure/arm-batch"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists available operations for the Microsoft.Batch provider * * @summary Lists available operations for the Microsoft.Batch provider - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/OperationsList.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/OperationsList.json */ async function operationsList() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const subscriptionId = + process.env["BATCH_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -28,4 +30,8 @@ async function operationsList() { console.log(resArray); } -operationsList().catch(console.error); +async function main() { + operationsList(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/javascript/package.json b/sdk/batch/arm-batch/samples/v9/javascript/package.json similarity index 100% rename from sdk/batch/arm-batch/samples/v8/javascript/package.json rename to sdk/batch/arm-batch/samples/v9/javascript/package.json diff --git a/sdk/batch/arm-batch/samples/v8/javascript/poolCreateSample.js b/sdk/batch/arm-batch/samples/v9/javascript/poolCreateSample.js similarity index 76% rename from sdk/batch/arm-batch/samples/v8/javascript/poolCreateSample.js rename to sdk/batch/arm-batch/samples/v9/javascript/poolCreateSample.js index c615abddd2e1..910de3af4cc3 100644 --- a/sdk/batch/arm-batch/samples/v8/javascript/poolCreateSample.js +++ b/sdk/batch/arm-batch/samples/v9/javascript/poolCreateSample.js @@ -10,16 +10,17 @@ // Licensed under the MIT License. const { BatchManagementClient } = require("@azure/arm-batch"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Creates a new pool inside the specified account. * * @summary Creates a new pool inside the specified account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolCreate_SharedImageGallery.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolCreate_SharedImageGallery.json */ async function createPoolCustomImage() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const parameters = { @@ -44,17 +45,15 @@ async function createPoolCustomImage() { console.log(result); } -createPoolCustomImage().catch(console.error); - /** * This sample demonstrates how to Creates a new pool inside the specified account. * * @summary Creates a new pool inside the specified account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolCreate_CloudServiceConfiguration.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolCreate_CloudServiceConfiguration.json */ async function createPoolFullCloudServiceConfiguration() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const parameters = { @@ -145,17 +144,15 @@ async function createPoolFullCloudServiceConfiguration() { console.log(result); } -createPoolFullCloudServiceConfiguration().catch(console.error); - /** * This sample demonstrates how to Creates a new pool inside the specified account. * * @summary Creates a new pool inside the specified account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolCreate_VirtualMachineConfiguration.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolCreate_VirtualMachineConfiguration.json */ async function createPoolFullVirtualMachineConfiguration() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const parameters = { @@ -235,17 +232,15 @@ async function createPoolFullVirtualMachineConfiguration() { console.log(result); } -createPoolFullVirtualMachineConfiguration().catch(console.error); - /** * This sample demonstrates how to Creates a new pool inside the specified account. * * @summary Creates a new pool inside the specified account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolCreate_MinimalCloudServiceConfiguration.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolCreate_MinimalCloudServiceConfiguration.json */ async function createPoolMinimalCloudServiceConfiguration() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const parameters = { @@ -264,17 +259,15 @@ async function createPoolMinimalCloudServiceConfiguration() { console.log(result); } -createPoolMinimalCloudServiceConfiguration().catch(console.error); - /** * This sample demonstrates how to Creates a new pool inside the specified account. * * @summary Creates a new pool inside the specified account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolCreate_MinimalVirtualMachineConfiguration.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolCreate_MinimalVirtualMachineConfiguration.json */ async function createPoolMinimalVirtualMachineConfiguration() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const parameters = { @@ -308,17 +301,15 @@ async function createPoolMinimalVirtualMachineConfiguration() { console.log(result); } -createPoolMinimalVirtualMachineConfiguration().catch(console.error); - /** * This sample demonstrates how to Creates a new pool inside the specified account. * * @summary Creates a new pool inside the specified account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolCreate_NoPublicIPAddresses.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolCreate_NoPublicIPAddresses.json */ async function createPoolNoPublicIP() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const parameters = { @@ -348,17 +339,15 @@ async function createPoolNoPublicIP() { console.log(result); } -createPoolNoPublicIP().catch(console.error); - /** * This sample demonstrates how to Creates a new pool inside the specified account. * * @summary Creates a new pool inside the specified account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolCreate_PublicIPs.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolCreate_PublicIPs.json */ async function createPoolPublicIPs() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const parameters = { @@ -393,17 +382,15 @@ async function createPoolPublicIPs() { console.log(result); } -createPoolPublicIPs().catch(console.error); - /** * This sample demonstrates how to Creates a new pool inside the specified account. * * @summary Creates a new pool inside the specified account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolCreate_UserAssignedIdentities.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolCreate_UserAssignedIdentities.json */ async function createPoolUserAssignedIdentities() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const parameters = { @@ -446,17 +433,15 @@ async function createPoolUserAssignedIdentities() { console.log(result); } -createPoolUserAssignedIdentities().catch(console.error); - /** * This sample demonstrates how to Creates a new pool inside the specified account. * * @summary Creates a new pool inside the specified account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolCreate_VirtualMachineConfiguration_Extensions.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolCreate_VirtualMachineConfiguration_Extensions.json */ async function createPoolVirtualMachineConfigurationExtensions() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const parameters = { @@ -471,14 +456,15 @@ async function createPoolVirtualMachineConfigurationExtensions() { extensions: [ { name: "batchextension1", - type: "SecurityMonitoringForLinux", + type: "KeyVaultForLinux", autoUpgradeMinorVersion: true, - protectedSettings: { - protectedSettingsKey: "protectedSettingsValue", + enableAutomaticUpgrade: true, + publisher: "Microsoft.Azure.KeyVault", + settings: { + authenticationSettingsKey: "authenticationSettingsValue", + secretsManagementSettingsKey: "secretsManagementSettingsValue", }, - publisher: "Microsoft.Azure.Security.Monitoring", - settings: { settingsKey: "settingsValue" }, - typeHandlerVersion: "1.0", + typeHandlerVersion: "2.0", }, ], }, @@ -503,4 +489,61 @@ async function createPoolVirtualMachineConfigurationExtensions() { console.log(result); } -createPoolVirtualMachineConfigurationExtensions().catch(console.error); +/** + * This sample demonstrates how to Creates a new pool inside the specified account. + * + * @summary Creates a new pool inside the specified account. + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolCreate_AcceleratedNetworking.json + */ +async function createPoolAcceleratedNetworking() { + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; + const accountName = "sampleacct"; + const poolName = "testpool"; + const parameters = { + deploymentConfiguration: { + virtualMachineConfiguration: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-datacenter-smalldisk", + version: "latest", + }, + nodeAgentSkuId: "batch.node.windows amd64", + }, + }, + networkConfiguration: { + enableAcceleratedNetworking: true, + subnetId: + "/subscriptions/subid/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123", + }, + scaleSettings: { + fixedScale: { targetDedicatedNodes: 1, targetLowPriorityNodes: 0 }, + }, + vmSize: "STANDARD_D1_V2", + }; + const credential = new DefaultAzureCredential(); + const client = new BatchManagementClient(credential, subscriptionId); + const result = await client.poolOperations.create( + resourceGroupName, + accountName, + poolName, + parameters + ); + console.log(result); +} + +async function main() { + createPoolCustomImage(); + createPoolFullCloudServiceConfiguration(); + createPoolFullVirtualMachineConfiguration(); + createPoolMinimalCloudServiceConfiguration(); + createPoolMinimalVirtualMachineConfiguration(); + createPoolNoPublicIP(); + createPoolPublicIPs(); + createPoolUserAssignedIdentities(); + createPoolVirtualMachineConfigurationExtensions(); + createPoolAcceleratedNetworking(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/javascript/poolDeleteSample.js b/sdk/batch/arm-batch/samples/v9/javascript/poolDeleteSample.js similarity index 74% rename from sdk/batch/arm-batch/samples/v8/javascript/poolDeleteSample.js rename to sdk/batch/arm-batch/samples/v9/javascript/poolDeleteSample.js index 7ca8b54001ef..33258b92371e 100644 --- a/sdk/batch/arm-batch/samples/v8/javascript/poolDeleteSample.js +++ b/sdk/batch/arm-batch/samples/v9/javascript/poolDeleteSample.js @@ -10,16 +10,17 @@ // Licensed under the MIT License. const { BatchManagementClient } = require("@azure/arm-batch"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Deletes the specified pool. * * @summary Deletes the specified pool. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolDelete.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolDelete.json */ async function deletePool() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const credential = new DefaultAzureCredential(); @@ -32,4 +33,8 @@ async function deletePool() { console.log(result); } -deletePool().catch(console.error); +async function main() { + deletePool(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/javascript/poolDisableAutoScaleSample.js b/sdk/batch/arm-batch/samples/v9/javascript/poolDisableAutoScaleSample.js similarity index 74% rename from sdk/batch/arm-batch/samples/v8/javascript/poolDisableAutoScaleSample.js rename to sdk/batch/arm-batch/samples/v9/javascript/poolDisableAutoScaleSample.js index 1f04bb26155c..79bbce3f74d9 100644 --- a/sdk/batch/arm-batch/samples/v8/javascript/poolDisableAutoScaleSample.js +++ b/sdk/batch/arm-batch/samples/v9/javascript/poolDisableAutoScaleSample.js @@ -10,16 +10,17 @@ // Licensed under the MIT License. const { BatchManagementClient } = require("@azure/arm-batch"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Disables automatic scaling for a pool. * * @summary Disables automatic scaling for a pool. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolDisableAutoScale.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolDisableAutoScale.json */ async function disableAutoScale() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const credential = new DefaultAzureCredential(); @@ -32,4 +33,8 @@ async function disableAutoScale() { console.log(result); } -disableAutoScale().catch(console.error); +async function main() { + disableAutoScale(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/javascript/poolGetSample.js b/sdk/batch/arm-batch/samples/v9/javascript/poolGetSample.js similarity index 52% rename from sdk/batch/arm-batch/samples/v8/javascript/poolGetSample.js rename to sdk/batch/arm-batch/samples/v9/javascript/poolGetSample.js index 688f062cae92..1c2738a3d997 100644 --- a/sdk/batch/arm-batch/samples/v8/javascript/poolGetSample.js +++ b/sdk/batch/arm-batch/samples/v9/javascript/poolGetSample.js @@ -10,16 +10,17 @@ // Licensed under the MIT License. const { BatchManagementClient } = require("@azure/arm-batch"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets information about the specified pool. * * @summary Gets information about the specified pool. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolGet.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolGet.json */ async function getPool() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const credential = new DefaultAzureCredential(); @@ -28,17 +29,32 @@ async function getPool() { console.log(result); } -getPool().catch(console.error); +/** + * This sample demonstrates how to Gets information about the specified pool. + * + * @summary Gets information about the specified pool. + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolGet_AcceleratedNetworking.json + */ +async function getPoolAcceleratedNetworking() { + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; + const accountName = "sampleacct"; + const poolName = "testpool"; + const credential = new DefaultAzureCredential(); + const client = new BatchManagementClient(credential, subscriptionId); + const result = await client.poolOperations.get(resourceGroupName, accountName, poolName); + console.log(result); +} /** * This sample demonstrates how to Gets information about the specified pool. * * @summary Gets information about the specified pool. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolGet_VirtualMachineConfiguration_Extensions.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolGet_VirtualMachineConfiguration_Extensions.json */ async function getPoolVirtualMachineConfigurationExtensions() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const credential = new DefaultAzureCredential(); @@ -47,4 +63,10 @@ async function getPoolVirtualMachineConfigurationExtensions() { console.log(result); } -getPoolVirtualMachineConfigurationExtensions().catch(console.error); +async function main() { + getPool(); + getPoolAcceleratedNetworking(); + getPoolVirtualMachineConfigurationExtensions(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/javascript/poolListByBatchAccountSample.js b/sdk/batch/arm-batch/samples/v9/javascript/poolListByBatchAccountSample.js similarity index 77% rename from sdk/batch/arm-batch/samples/v8/javascript/poolListByBatchAccountSample.js rename to sdk/batch/arm-batch/samples/v9/javascript/poolListByBatchAccountSample.js index 7e6dab6cc59c..c00005030d64 100644 --- a/sdk/batch/arm-batch/samples/v8/javascript/poolListByBatchAccountSample.js +++ b/sdk/batch/arm-batch/samples/v9/javascript/poolListByBatchAccountSample.js @@ -10,16 +10,17 @@ // Licensed under the MIT License. const { BatchManagementClient } = require("@azure/arm-batch"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists all of the pools in the specified account. * * @summary Lists all of the pools in the specified account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolList.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolList.json */ async function listPool() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); @@ -30,17 +31,15 @@ async function listPool() { console.log(resArray); } -listPool().catch(console.error); - /** * This sample demonstrates how to Lists all of the pools in the specified account. * * @summary Lists all of the pools in the specified account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolListWithFilter.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolListWithFilter.json */ async function listPoolWithFilter() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const select = "properties/allocationState,properties/provisioningStateTransitionTime,properties/currentDedicatedNodes,properties/currentLowPriorityNodes"; @@ -60,4 +59,9 @@ async function listPoolWithFilter() { console.log(resArray); } -listPoolWithFilter().catch(console.error); +async function main() { + listPool(); + listPoolWithFilter(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/javascript/poolStopResizeSample.js b/sdk/batch/arm-batch/samples/v9/javascript/poolStopResizeSample.js similarity index 85% rename from sdk/batch/arm-batch/samples/v8/javascript/poolStopResizeSample.js rename to sdk/batch/arm-batch/samples/v9/javascript/poolStopResizeSample.js index 58754a9a4619..a48af6280983 100644 --- a/sdk/batch/arm-batch/samples/v8/javascript/poolStopResizeSample.js +++ b/sdk/batch/arm-batch/samples/v9/javascript/poolStopResizeSample.js @@ -10,16 +10,17 @@ // Licensed under the MIT License. const { BatchManagementClient } = require("@azure/arm-batch"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to This does not restore the pool to its previous state before the resize operation: it only stops any further changes being made, and the pool maintains its current state. After stopping, the pool stabilizes at the number of nodes it was at when the stop operation was done. During the stop operation, the pool allocation state changes first to stopping and then to steady. A resize operation need not be an explicit resize pool request; this API can also be used to halt the initial sizing of the pool when it is created. * * @summary This does not restore the pool to its previous state before the resize operation: it only stops any further changes being made, and the pool maintains its current state. After stopping, the pool stabilizes at the number of nodes it was at when the stop operation was done. During the stop operation, the pool allocation state changes first to stopping and then to steady. A resize operation need not be an explicit resize pool request; this API can also be used to halt the initial sizing of the pool when it is created. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolStopResize.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolStopResize.json */ async function stopPoolResize() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const credential = new DefaultAzureCredential(); @@ -28,4 +29,8 @@ async function stopPoolResize() { console.log(result); } -stopPoolResize().catch(console.error); +async function main() { + stopPoolResize(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/javascript/poolUpdateSample.js b/sdk/batch/arm-batch/samples/v9/javascript/poolUpdateSample.js similarity index 77% rename from sdk/batch/arm-batch/samples/v8/javascript/poolUpdateSample.js rename to sdk/batch/arm-batch/samples/v9/javascript/poolUpdateSample.js index a933c3a2eae9..2421d96f4d56 100644 --- a/sdk/batch/arm-batch/samples/v8/javascript/poolUpdateSample.js +++ b/sdk/batch/arm-batch/samples/v9/javascript/poolUpdateSample.js @@ -10,16 +10,17 @@ // Licensed under the MIT License. const { BatchManagementClient } = require("@azure/arm-batch"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Updates the properties of an existing pool. * * @summary Updates the properties of an existing pool. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolUpdate_EnableAutoScale.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolUpdate_EnableAutoScale.json */ async function updatePoolEnableAutoscale() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const parameters = { @@ -36,17 +37,15 @@ async function updatePoolEnableAutoscale() { console.log(result); } -updatePoolEnableAutoscale().catch(console.error); - /** * This sample demonstrates how to Updates the properties of an existing pool. * * @summary Updates the properties of an existing pool. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolUpdate_OtherProperties.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolUpdate_OtherProperties.json */ async function updatePoolOtherProperties() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const parameters = { @@ -80,17 +79,15 @@ async function updatePoolOtherProperties() { console.log(result); } -updatePoolOtherProperties().catch(console.error); - /** * This sample demonstrates how to Updates the properties of an existing pool. * * @summary Updates the properties of an existing pool. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolUpdate_RemoveStartTask.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolUpdate_RemoveStartTask.json */ async function updatePoolRemoveStartTask() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const parameters = { startTask: {} }; @@ -105,17 +102,15 @@ async function updatePoolRemoveStartTask() { console.log(result); } -updatePoolRemoveStartTask().catch(console.error); - /** * This sample demonstrates how to Updates the properties of an existing pool. * * @summary Updates the properties of an existing pool. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolUpdate_ResizePool.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolUpdate_ResizePool.json */ async function updatePoolResizePool() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const parameters = { @@ -139,4 +134,11 @@ async function updatePoolResizePool() { console.log(result); } -updatePoolResizePool().catch(console.error); +async function main() { + updatePoolEnableAutoscale(); + updatePoolOtherProperties(); + updatePoolRemoveStartTask(); + updatePoolResizePool(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/javascript/privateEndpointConnectionDeleteSample.js b/sdk/batch/arm-batch/samples/v9/javascript/privateEndpointConnectionDeleteSample.js similarity index 77% rename from sdk/batch/arm-batch/samples/v8/javascript/privateEndpointConnectionDeleteSample.js rename to sdk/batch/arm-batch/samples/v9/javascript/privateEndpointConnectionDeleteSample.js index 07a137700256..05e11dcbb9d8 100644 --- a/sdk/batch/arm-batch/samples/v8/javascript/privateEndpointConnectionDeleteSample.js +++ b/sdk/batch/arm-batch/samples/v9/javascript/privateEndpointConnectionDeleteSample.js @@ -10,16 +10,17 @@ // Licensed under the MIT License. const { BatchManagementClient } = require("@azure/arm-batch"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Deletes the specified private endpoint connection. * * @summary Deletes the specified private endpoint connection. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PrivateEndpointConnectionDelete.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PrivateEndpointConnectionDelete.json */ async function privateEndpointConnectionDelete() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const privateEndpointConnectionName = "testprivateEndpointConnection5testprivateEndpointConnection5.24d6b4b5-e65c-4330-bbe9-3a290d62f8e0"; @@ -33,4 +34,8 @@ async function privateEndpointConnectionDelete() { console.log(result); } -privateEndpointConnectionDelete().catch(console.error); +async function main() { + privateEndpointConnectionDelete(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/javascript/privateEndpointConnectionGetSample.js b/sdk/batch/arm-batch/samples/v9/javascript/privateEndpointConnectionGetSample.js similarity index 77% rename from sdk/batch/arm-batch/samples/v8/javascript/privateEndpointConnectionGetSample.js rename to sdk/batch/arm-batch/samples/v9/javascript/privateEndpointConnectionGetSample.js index ad18300868db..54894ec2f18e 100644 --- a/sdk/batch/arm-batch/samples/v8/javascript/privateEndpointConnectionGetSample.js +++ b/sdk/batch/arm-batch/samples/v9/javascript/privateEndpointConnectionGetSample.js @@ -10,16 +10,17 @@ // Licensed under the MIT License. const { BatchManagementClient } = require("@azure/arm-batch"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets information about the specified private endpoint connection. * * @summary Gets information about the specified private endpoint connection. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PrivateEndpointConnectionGet.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PrivateEndpointConnectionGet.json */ async function getPrivateEndpointConnection() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const privateEndpointConnectionName = "testprivateEndpointConnection5testprivateEndpointConnection5.24d6b4b5-e65c-4330-bbe9-3a290d62f8e0"; @@ -33,4 +34,8 @@ async function getPrivateEndpointConnection() { console.log(result); } -getPrivateEndpointConnection().catch(console.error); +async function main() { + getPrivateEndpointConnection(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/javascript/privateEndpointConnectionListByBatchAccountSample.js b/sdk/batch/arm-batch/samples/v9/javascript/privateEndpointConnectionListByBatchAccountSample.js similarity index 76% rename from sdk/batch/arm-batch/samples/v8/javascript/privateEndpointConnectionListByBatchAccountSample.js rename to sdk/batch/arm-batch/samples/v9/javascript/privateEndpointConnectionListByBatchAccountSample.js index 337409f101c9..9575c7cf9fee 100644 --- a/sdk/batch/arm-batch/samples/v8/javascript/privateEndpointConnectionListByBatchAccountSample.js +++ b/sdk/batch/arm-batch/samples/v9/javascript/privateEndpointConnectionListByBatchAccountSample.js @@ -10,16 +10,17 @@ // Licensed under the MIT License. const { BatchManagementClient } = require("@azure/arm-batch"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists all of the private endpoint connections in the specified account. * * @summary Lists all of the private endpoint connections in the specified account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PrivateEndpointConnectionsList.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PrivateEndpointConnectionsList.json */ async function listPrivateEndpointConnections() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); @@ -33,4 +34,8 @@ async function listPrivateEndpointConnections() { console.log(resArray); } -listPrivateEndpointConnections().catch(console.error); +async function main() { + listPrivateEndpointConnections(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/javascript/privateEndpointConnectionUpdateSample.js b/sdk/batch/arm-batch/samples/v9/javascript/privateEndpointConnectionUpdateSample.js similarity index 79% rename from sdk/batch/arm-batch/samples/v8/javascript/privateEndpointConnectionUpdateSample.js rename to sdk/batch/arm-batch/samples/v9/javascript/privateEndpointConnectionUpdateSample.js index d637e764e21d..02b05e624dec 100644 --- a/sdk/batch/arm-batch/samples/v8/javascript/privateEndpointConnectionUpdateSample.js +++ b/sdk/batch/arm-batch/samples/v9/javascript/privateEndpointConnectionUpdateSample.js @@ -10,16 +10,17 @@ // Licensed under the MIT License. const { BatchManagementClient } = require("@azure/arm-batch"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Updates the properties of an existing private endpoint connection. * * @summary Updates the properties of an existing private endpoint connection. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PrivateEndpointConnectionUpdate.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PrivateEndpointConnectionUpdate.json */ async function updatePrivateEndpointConnection() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const privateEndpointConnectionName = "testprivateEndpointConnection5.24d6b4b5-e65c-4330-bbe9-3a290d62f8e0"; @@ -40,4 +41,8 @@ async function updatePrivateEndpointConnection() { console.log(result); } -updatePrivateEndpointConnection().catch(console.error); +async function main() { + updatePrivateEndpointConnection(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/javascript/privateLinkResourceGetSample.js b/sdk/batch/arm-batch/samples/v9/javascript/privateLinkResourceGetSample.js similarity index 75% rename from sdk/batch/arm-batch/samples/v8/javascript/privateLinkResourceGetSample.js rename to sdk/batch/arm-batch/samples/v9/javascript/privateLinkResourceGetSample.js index 0170f9d2ad9e..07b2340d01ba 100644 --- a/sdk/batch/arm-batch/samples/v8/javascript/privateLinkResourceGetSample.js +++ b/sdk/batch/arm-batch/samples/v9/javascript/privateLinkResourceGetSample.js @@ -10,16 +10,17 @@ // Licensed under the MIT License. const { BatchManagementClient } = require("@azure/arm-batch"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets information about the specified private link resource. * * @summary Gets information about the specified private link resource. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PrivateLinkResourceGet.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PrivateLinkResourceGet.json */ async function getPrivateLinkResource() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const privateLinkResourceName = "batchAccount"; const credential = new DefaultAzureCredential(); @@ -32,4 +33,8 @@ async function getPrivateLinkResource() { console.log(result); } -getPrivateLinkResource().catch(console.error); +async function main() { + getPrivateLinkResource(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/javascript/privateLinkResourceListByBatchAccountSample.js b/sdk/batch/arm-batch/samples/v9/javascript/privateLinkResourceListByBatchAccountSample.js similarity index 76% rename from sdk/batch/arm-batch/samples/v8/javascript/privateLinkResourceListByBatchAccountSample.js rename to sdk/batch/arm-batch/samples/v9/javascript/privateLinkResourceListByBatchAccountSample.js index e47320b4ffce..3c14c3975e15 100644 --- a/sdk/batch/arm-batch/samples/v8/javascript/privateLinkResourceListByBatchAccountSample.js +++ b/sdk/batch/arm-batch/samples/v9/javascript/privateLinkResourceListByBatchAccountSample.js @@ -10,16 +10,17 @@ // Licensed under the MIT License. const { BatchManagementClient } = require("@azure/arm-batch"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists all of the private link resources in the specified account. * * @summary Lists all of the private link resources in the specified account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PrivateLinkResourcesList.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PrivateLinkResourcesList.json */ async function listPrivateLinkResource() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); @@ -33,4 +34,8 @@ async function listPrivateLinkResource() { console.log(resArray); } -listPrivateLinkResource().catch(console.error); +async function main() { + listPrivateLinkResource(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/javascript/sample.env b/sdk/batch/arm-batch/samples/v9/javascript/sample.env similarity index 100% rename from sdk/batch/arm-batch/samples/v8/javascript/sample.env rename to sdk/batch/arm-batch/samples/v9/javascript/sample.env diff --git a/sdk/batch/arm-batch/samples/v8/typescript/README.md b/sdk/batch/arm-batch/samples/v9/typescript/README.md similarity index 88% rename from sdk/batch/arm-batch/samples/v8/typescript/README.md rename to sdk/batch/arm-batch/samples/v9/typescript/README.md index 10d366ab6469..18a4fdc8c850 100644 --- a/sdk/batch/arm-batch/samples/v8/typescript/README.md +++ b/sdk/batch/arm-batch/samples/v9/typescript/README.md @@ -4,52 +4,52 @@ These sample programs show how to use the TypeScript client libraries for in som | **File Name** | **Description** | | --------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [applicationCreateSample.ts][applicationcreatesample] | Adds an application to the specified Batch account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationCreate.json | -| [applicationDeleteSample.ts][applicationdeletesample] | Deletes an application. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationDelete.json | -| [applicationGetSample.ts][applicationgetsample] | Gets information about the specified application. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationGet.json | -| [applicationListSample.ts][applicationlistsample] | Lists all of the applications in the specified account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationList.json | -| [applicationPackageActivateSample.ts][applicationpackageactivatesample] | Activates the specified application package. This should be done after the `ApplicationPackage` was created and uploaded. This needs to be done before an `ApplicationPackage` can be used on Pools or Tasks. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationPackageActivate.json | -| [applicationPackageCreateSample.ts][applicationpackagecreatesample] | Creates an application package record. The record contains a storageUrl where the package should be uploaded to. Once it is uploaded the `ApplicationPackage` needs to be activated using `ApplicationPackageActive` before it can be used. If the auto storage account was configured to use storage keys, the URL returned will contain a SAS. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationPackageCreate.json | -| [applicationPackageDeleteSample.ts][applicationpackagedeletesample] | Deletes an application package record and its associated binary file. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationPackageDelete.json | -| [applicationPackageGetSample.ts][applicationpackagegetsample] | Gets information about the specified application package. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationPackageGet.json | -| [applicationPackageListSample.ts][applicationpackagelistsample] | Lists all of the application packages in the specified application. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationPackageList.json | -| [applicationUpdateSample.ts][applicationupdatesample] | Updates settings for the specified application. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationUpdate.json | -| [batchAccountCreateSample.ts][batchaccountcreatesample] | Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountCreate_BYOS.json | -| [batchAccountDeleteSample.ts][batchaccountdeletesample] | Deletes the specified Batch account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountDelete.json | -| [batchAccountGetDetectorSample.ts][batchaccountgetdetectorsample] | Gets information about the given detector for a given Batch account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/DetectorGet.json | -| [batchAccountGetKeysSample.ts][batchaccountgetkeyssample] | This operation applies only to Batch accounts with allowedAuthenticationModes containing 'SharedKey'. If the Batch account doesn't contain 'SharedKey' in its allowedAuthenticationMode, clients cannot use shared keys to authenticate, and must use another allowedAuthenticationModes instead. In this case, getting the keys will fail. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountGetKeys.json | -| [batchAccountGetSample.ts][batchaccountgetsample] | Gets information about the specified Batch account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountGet.json | -| [batchAccountListByResourceGroupSample.ts][batchaccountlistbyresourcegroupsample] | Gets information about the Batch accounts associated with the specified resource group. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountListByResourceGroup.json | -| [batchAccountListDetectorsSample.ts][batchaccountlistdetectorssample] | Gets information about the detectors available for a given Batch account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/DetectorList.json | -| [batchAccountListOutboundNetworkDependenciesEndpointsSample.ts][batchaccountlistoutboundnetworkdependenciesendpointssample] | Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://docs.microsoft.com/azure/batch/batch-virtual-network. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountListOutboundNetworkDependenciesEndpoints.json | -| [batchAccountListSample.ts][batchaccountlistsample] | Gets information about the Batch accounts associated with the subscription. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountList.json | -| [batchAccountRegenerateKeySample.ts][batchaccountregeneratekeysample] | This operation applies only to Batch accounts with allowedAuthenticationModes containing 'SharedKey'. If the Batch account doesn't contain 'SharedKey' in its allowedAuthenticationMode, clients cannot use shared keys to authenticate, and must use another allowedAuthenticationModes instead. In this case, regenerating the keys will fail. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountRegenerateKey.json | -| [batchAccountSynchronizeAutoStorageKeysSample.ts][batchaccountsynchronizeautostoragekeyssample] | Synchronizes access keys for the auto-storage account configured for the specified Batch account, only if storage key authentication is being used. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountSynchronizeAutoStorageKeys.json | -| [batchAccountUpdateSample.ts][batchaccountupdatesample] | Updates the properties of an existing Batch account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountUpdate.json | -| [certificateCancelDeletionSample.ts][certificatecanceldeletionsample] | If you try to delete a certificate that is being used by a pool or compute node, the status of the certificate changes to deleteFailed. If you decide that you want to continue using the certificate, you can use this operation to set the status of the certificate back to active. If you intend to delete the certificate, you do not need to run this operation after the deletion failed. You must make sure that the certificate is not being used by any resources, and then you can try again to delete the certificate. //@@TS-MAGIC-NEWLINE@@ Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateCancelDeletion.json | -| [certificateCreateSample.ts][certificatecreatesample] | Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateCreate_Full.json | -| [certificateDeleteSample.ts][certificatedeletesample] | Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateDelete.json | -| [certificateGetSample.ts][certificategetsample] | Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateGet.json | -| [certificateListByBatchAccountSample.ts][certificatelistbybatchaccountsample] | Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateList.json | -| [certificateUpdateSample.ts][certificateupdatesample] | Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateUpdate.json | -| [locationCheckNameAvailabilitySample.ts][locationchecknameavailabilitysample] | Checks whether the Batch account name is available in the specified region. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/LocationCheckNameAvailability_AlreadyExists.json | -| [locationGetQuotasSample.ts][locationgetquotassample] | Gets the Batch service quotas for the specified subscription at the given location. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/LocationGetQuotas.json | -| [locationListSupportedCloudServiceSkusSample.ts][locationlistsupportedcloudserviceskussample] | Gets the list of Batch supported Cloud Service VM sizes available at the given location. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/LocationListCloudServiceSkus.json | -| [locationListSupportedVirtualMachineSkusSample.ts][locationlistsupportedvirtualmachineskussample] | Gets the list of Batch supported Virtual Machine VM sizes available at the given location. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/LocationListVirtualMachineSkus.json | -| [operationsListSample.ts][operationslistsample] | Lists available operations for the Microsoft.Batch provider x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/OperationsList.json | -| [poolCreateSample.ts][poolcreatesample] | Creates a new pool inside the specified account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolCreate_SharedImageGallery.json | -| [poolDeleteSample.ts][pooldeletesample] | Deletes the specified pool. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolDelete.json | -| [poolDisableAutoScaleSample.ts][pooldisableautoscalesample] | Disables automatic scaling for a pool. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolDisableAutoScale.json | -| [poolGetSample.ts][poolgetsample] | Gets information about the specified pool. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolGet.json | -| [poolListByBatchAccountSample.ts][poollistbybatchaccountsample] | Lists all of the pools in the specified account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolList.json | -| [poolStopResizeSample.ts][poolstopresizesample] | This does not restore the pool to its previous state before the resize operation: it only stops any further changes being made, and the pool maintains its current state. After stopping, the pool stabilizes at the number of nodes it was at when the stop operation was done. During the stop operation, the pool allocation state changes first to stopping and then to steady. A resize operation need not be an explicit resize pool request; this API can also be used to halt the initial sizing of the pool when it is created. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolStopResize.json | -| [poolUpdateSample.ts][poolupdatesample] | Updates the properties of an existing pool. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolUpdate_EnableAutoScale.json | -| [privateEndpointConnectionDeleteSample.ts][privateendpointconnectiondeletesample] | Deletes the specified private endpoint connection. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PrivateEndpointConnectionDelete.json | -| [privateEndpointConnectionGetSample.ts][privateendpointconnectiongetsample] | Gets information about the specified private endpoint connection. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PrivateEndpointConnectionGet.json | -| [privateEndpointConnectionListByBatchAccountSample.ts][privateendpointconnectionlistbybatchaccountsample] | Lists all of the private endpoint connections in the specified account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PrivateEndpointConnectionsList.json | -| [privateEndpointConnectionUpdateSample.ts][privateendpointconnectionupdatesample] | Updates the properties of an existing private endpoint connection. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PrivateEndpointConnectionUpdate.json | -| [privateLinkResourceGetSample.ts][privatelinkresourcegetsample] | Gets information about the specified private link resource. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PrivateLinkResourceGet.json | -| [privateLinkResourceListByBatchAccountSample.ts][privatelinkresourcelistbybatchaccountsample] | Lists all of the private link resources in the specified account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PrivateLinkResourcesList.json | +| [applicationCreateSample.ts][applicationcreatesample] | Adds an application to the specified Batch account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationCreate.json | +| [applicationDeleteSample.ts][applicationdeletesample] | Deletes an application. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationDelete.json | +| [applicationGetSample.ts][applicationgetsample] | Gets information about the specified application. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationGet.json | +| [applicationListSample.ts][applicationlistsample] | Lists all of the applications in the specified account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationList.json | +| [applicationPackageActivateSample.ts][applicationpackageactivatesample] | Activates the specified application package. This should be done after the `ApplicationPackage` was created and uploaded. This needs to be done before an `ApplicationPackage` can be used on Pools or Tasks. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationPackageActivate.json | +| [applicationPackageCreateSample.ts][applicationpackagecreatesample] | Creates an application package record. The record contains a storageUrl where the package should be uploaded to. Once it is uploaded the `ApplicationPackage` needs to be activated using `ApplicationPackageActive` before it can be used. If the auto storage account was configured to use storage keys, the URL returned will contain a SAS. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationPackageCreate.json | +| [applicationPackageDeleteSample.ts][applicationpackagedeletesample] | Deletes an application package record and its associated binary file. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationPackageDelete.json | +| [applicationPackageGetSample.ts][applicationpackagegetsample] | Gets information about the specified application package. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationPackageGet.json | +| [applicationPackageListSample.ts][applicationpackagelistsample] | Lists all of the application packages in the specified application. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationPackageList.json | +| [applicationUpdateSample.ts][applicationupdatesample] | Updates settings for the specified application. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationUpdate.json | +| [batchAccountCreateSample.ts][batchaccountcreatesample] | Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountCreate_BYOS.json | +| [batchAccountDeleteSample.ts][batchaccountdeletesample] | Deletes the specified Batch account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountDelete.json | +| [batchAccountGetDetectorSample.ts][batchaccountgetdetectorsample] | Gets information about the given detector for a given Batch account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/DetectorGet.json | +| [batchAccountGetKeysSample.ts][batchaccountgetkeyssample] | This operation applies only to Batch accounts with allowedAuthenticationModes containing 'SharedKey'. If the Batch account doesn't contain 'SharedKey' in its allowedAuthenticationMode, clients cannot use shared keys to authenticate, and must use another allowedAuthenticationModes instead. In this case, getting the keys will fail. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountGetKeys.json | +| [batchAccountGetSample.ts][batchaccountgetsample] | Gets information about the specified Batch account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountGet.json | +| [batchAccountListByResourceGroupSample.ts][batchaccountlistbyresourcegroupsample] | Gets information about the Batch accounts associated with the specified resource group. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountListByResourceGroup.json | +| [batchAccountListDetectorsSample.ts][batchaccountlistdetectorssample] | Gets information about the detectors available for a given Batch account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/DetectorList.json | +| [batchAccountListOutboundNetworkDependenciesEndpointsSample.ts][batchaccountlistoutboundnetworkdependenciesendpointssample] | Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://docs.microsoft.com/en-us/azure/batch/batch-virtual-network. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountListOutboundNetworkDependenciesEndpoints.json | +| [batchAccountListSample.ts][batchaccountlistsample] | Gets information about the Batch accounts associated with the subscription. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountList.json | +| [batchAccountRegenerateKeySample.ts][batchaccountregeneratekeysample] | This operation applies only to Batch accounts with allowedAuthenticationModes containing 'SharedKey'. If the Batch account doesn't contain 'SharedKey' in its allowedAuthenticationMode, clients cannot use shared keys to authenticate, and must use another allowedAuthenticationModes instead. In this case, regenerating the keys will fail. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountRegenerateKey.json | +| [batchAccountSynchronizeAutoStorageKeysSample.ts][batchaccountsynchronizeautostoragekeyssample] | Synchronizes access keys for the auto-storage account configured for the specified Batch account, only if storage key authentication is being used. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountSynchronizeAutoStorageKeys.json | +| [batchAccountUpdateSample.ts][batchaccountupdatesample] | Updates the properties of an existing Batch account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountUpdate.json | +| [certificateCancelDeletionSample.ts][certificatecanceldeletionsample] | If you try to delete a certificate that is being used by a pool or compute node, the status of the certificate changes to deleteFailed. If you decide that you want to continue using the certificate, you can use this operation to set the status of the certificate back to active. If you intend to delete the certificate, you do not need to run this operation after the deletion failed. You must make sure that the certificate is not being used by any resources, and then you can try again to delete the certificate. //@@TS-MAGIC-NEWLINE@@ Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/CertificateCancelDeletion.json | +| [certificateCreateSample.ts][certificatecreatesample] | Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/CertificateCreate_Full.json | +| [certificateDeleteSample.ts][certificatedeletesample] | Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/CertificateDelete.json | +| [certificateGetSample.ts][certificategetsample] | Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/CertificateGet.json | +| [certificateListByBatchAccountSample.ts][certificatelistbybatchaccountsample] | Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/CertificateList.json | +| [certificateUpdateSample.ts][certificateupdatesample] | Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/CertificateUpdate.json | +| [locationCheckNameAvailabilitySample.ts][locationchecknameavailabilitysample] | Checks whether the Batch account name is available in the specified region. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/LocationCheckNameAvailability_AlreadyExists.json | +| [locationGetQuotasSample.ts][locationgetquotassample] | Gets the Batch service quotas for the specified subscription at the given location. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/LocationGetQuotas.json | +| [locationListSupportedCloudServiceSkusSample.ts][locationlistsupportedcloudserviceskussample] | Gets the list of Batch supported Cloud Service VM sizes available at the given location. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/LocationListCloudServiceSkus.json | +| [locationListSupportedVirtualMachineSkusSample.ts][locationlistsupportedvirtualmachineskussample] | Gets the list of Batch supported Virtual Machine VM sizes available at the given location. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/LocationListVirtualMachineSkus.json | +| [operationsListSample.ts][operationslistsample] | Lists available operations for the Microsoft.Batch provider x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/OperationsList.json | +| [poolCreateSample.ts][poolcreatesample] | Creates a new pool inside the specified account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolCreate_SharedImageGallery.json | +| [poolDeleteSample.ts][pooldeletesample] | Deletes the specified pool. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolDelete.json | +| [poolDisableAutoScaleSample.ts][pooldisableautoscalesample] | Disables automatic scaling for a pool. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolDisableAutoScale.json | +| [poolGetSample.ts][poolgetsample] | Gets information about the specified pool. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolGet.json | +| [poolListByBatchAccountSample.ts][poollistbybatchaccountsample] | Lists all of the pools in the specified account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolList.json | +| [poolStopResizeSample.ts][poolstopresizesample] | This does not restore the pool to its previous state before the resize operation: it only stops any further changes being made, and the pool maintains its current state. After stopping, the pool stabilizes at the number of nodes it was at when the stop operation was done. During the stop operation, the pool allocation state changes first to stopping and then to steady. A resize operation need not be an explicit resize pool request; this API can also be used to halt the initial sizing of the pool when it is created. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolStopResize.json | +| [poolUpdateSample.ts][poolupdatesample] | Updates the properties of an existing pool. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolUpdate_EnableAutoScale.json | +| [privateEndpointConnectionDeleteSample.ts][privateendpointconnectiondeletesample] | Deletes the specified private endpoint connection. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PrivateEndpointConnectionDelete.json | +| [privateEndpointConnectionGetSample.ts][privateendpointconnectiongetsample] | Gets information about the specified private endpoint connection. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PrivateEndpointConnectionGet.json | +| [privateEndpointConnectionListByBatchAccountSample.ts][privateendpointconnectionlistbybatchaccountsample] | Lists all of the private endpoint connections in the specified account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PrivateEndpointConnectionsList.json | +| [privateEndpointConnectionUpdateSample.ts][privateendpointconnectionupdatesample] | Updates the properties of an existing private endpoint connection. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PrivateEndpointConnectionUpdate.json | +| [privateLinkResourceGetSample.ts][privatelinkresourcegetsample] | Gets information about the specified private link resource. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PrivateLinkResourceGet.json | +| [privateLinkResourceListByBatchAccountSample.ts][privatelinkresourcelistbybatchaccountsample] | Lists all of the private link resources in the specified account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PrivateLinkResourcesList.json | ## Prerequisites @@ -94,59 +94,59 @@ node dist/applicationCreateSample.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 node dist/applicationCreateSample.js +npx cross-env BATCH_SUBSCRIPTION_ID="" BATCH_RESOURCE_GROUP="" node dist/applicationCreateSample.js ``` ## Next Steps Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. -[applicationcreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/typescript/src/applicationCreateSample.ts -[applicationdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/typescript/src/applicationDeleteSample.ts -[applicationgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/typescript/src/applicationGetSample.ts -[applicationlistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/typescript/src/applicationListSample.ts -[applicationpackageactivatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/typescript/src/applicationPackageActivateSample.ts -[applicationpackagecreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/typescript/src/applicationPackageCreateSample.ts -[applicationpackagedeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/typescript/src/applicationPackageDeleteSample.ts -[applicationpackagegetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/typescript/src/applicationPackageGetSample.ts -[applicationpackagelistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/typescript/src/applicationPackageListSample.ts -[applicationupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/typescript/src/applicationUpdateSample.ts -[batchaccountcreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/typescript/src/batchAccountCreateSample.ts -[batchaccountdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/typescript/src/batchAccountDeleteSample.ts -[batchaccountgetdetectorsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/typescript/src/batchAccountGetDetectorSample.ts -[batchaccountgetkeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/typescript/src/batchAccountGetKeysSample.ts -[batchaccountgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/typescript/src/batchAccountGetSample.ts -[batchaccountlistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/typescript/src/batchAccountListByResourceGroupSample.ts -[batchaccountlistdetectorssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/typescript/src/batchAccountListDetectorsSample.ts -[batchaccountlistoutboundnetworkdependenciesendpointssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/typescript/src/batchAccountListOutboundNetworkDependenciesEndpointsSample.ts -[batchaccountlistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/typescript/src/batchAccountListSample.ts -[batchaccountregeneratekeysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/typescript/src/batchAccountRegenerateKeySample.ts -[batchaccountsynchronizeautostoragekeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/typescript/src/batchAccountSynchronizeAutoStorageKeysSample.ts -[batchaccountupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/typescript/src/batchAccountUpdateSample.ts -[certificatecanceldeletionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/typescript/src/certificateCancelDeletionSample.ts -[certificatecreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/typescript/src/certificateCreateSample.ts -[certificatedeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/typescript/src/certificateDeleteSample.ts -[certificategetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/typescript/src/certificateGetSample.ts -[certificatelistbybatchaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/typescript/src/certificateListByBatchAccountSample.ts -[certificateupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/typescript/src/certificateUpdateSample.ts -[locationchecknameavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/typescript/src/locationCheckNameAvailabilitySample.ts -[locationgetquotassample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/typescript/src/locationGetQuotasSample.ts -[locationlistsupportedcloudserviceskussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/typescript/src/locationListSupportedCloudServiceSkusSample.ts -[locationlistsupportedvirtualmachineskussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/typescript/src/locationListSupportedVirtualMachineSkusSample.ts -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/typescript/src/operationsListSample.ts -[poolcreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/typescript/src/poolCreateSample.ts -[pooldeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/typescript/src/poolDeleteSample.ts -[pooldisableautoscalesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/typescript/src/poolDisableAutoScaleSample.ts -[poolgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/typescript/src/poolGetSample.ts -[poollistbybatchaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/typescript/src/poolListByBatchAccountSample.ts -[poolstopresizesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/typescript/src/poolStopResizeSample.ts -[poolupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/typescript/src/poolUpdateSample.ts -[privateendpointconnectiondeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/typescript/src/privateEndpointConnectionDeleteSample.ts -[privateendpointconnectiongetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/typescript/src/privateEndpointConnectionGetSample.ts -[privateendpointconnectionlistbybatchaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/typescript/src/privateEndpointConnectionListByBatchAccountSample.ts -[privateendpointconnectionupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/typescript/src/privateEndpointConnectionUpdateSample.ts -[privatelinkresourcegetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/typescript/src/privateLinkResourceGetSample.ts -[privatelinkresourcelistbybatchaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v8/typescript/src/privateLinkResourceListByBatchAccountSample.ts +[applicationcreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/typescript/src/applicationCreateSample.ts +[applicationdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/typescript/src/applicationDeleteSample.ts +[applicationgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/typescript/src/applicationGetSample.ts +[applicationlistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/typescript/src/applicationListSample.ts +[applicationpackageactivatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/typescript/src/applicationPackageActivateSample.ts +[applicationpackagecreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/typescript/src/applicationPackageCreateSample.ts +[applicationpackagedeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/typescript/src/applicationPackageDeleteSample.ts +[applicationpackagegetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/typescript/src/applicationPackageGetSample.ts +[applicationpackagelistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/typescript/src/applicationPackageListSample.ts +[applicationupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/typescript/src/applicationUpdateSample.ts +[batchaccountcreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountCreateSample.ts +[batchaccountdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountDeleteSample.ts +[batchaccountgetdetectorsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountGetDetectorSample.ts +[batchaccountgetkeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountGetKeysSample.ts +[batchaccountgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountGetSample.ts +[batchaccountlistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountListByResourceGroupSample.ts +[batchaccountlistdetectorssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountListDetectorsSample.ts +[batchaccountlistoutboundnetworkdependenciesendpointssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountListOutboundNetworkDependenciesEndpointsSample.ts +[batchaccountlistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountListSample.ts +[batchaccountregeneratekeysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountRegenerateKeySample.ts +[batchaccountsynchronizeautostoragekeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountSynchronizeAutoStorageKeysSample.ts +[batchaccountupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountUpdateSample.ts +[certificatecanceldeletionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/typescript/src/certificateCancelDeletionSample.ts +[certificatecreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/typescript/src/certificateCreateSample.ts +[certificatedeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/typescript/src/certificateDeleteSample.ts +[certificategetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/typescript/src/certificateGetSample.ts +[certificatelistbybatchaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/typescript/src/certificateListByBatchAccountSample.ts +[certificateupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/typescript/src/certificateUpdateSample.ts +[locationchecknameavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/typescript/src/locationCheckNameAvailabilitySample.ts +[locationgetquotassample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/typescript/src/locationGetQuotasSample.ts +[locationlistsupportedcloudserviceskussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/typescript/src/locationListSupportedCloudServiceSkusSample.ts +[locationlistsupportedvirtualmachineskussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/typescript/src/locationListSupportedVirtualMachineSkusSample.ts +[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/typescript/src/operationsListSample.ts +[poolcreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/typescript/src/poolCreateSample.ts +[pooldeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/typescript/src/poolDeleteSample.ts +[pooldisableautoscalesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/typescript/src/poolDisableAutoScaleSample.ts +[poolgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/typescript/src/poolGetSample.ts +[poollistbybatchaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/typescript/src/poolListByBatchAccountSample.ts +[poolstopresizesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/typescript/src/poolStopResizeSample.ts +[poolupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/typescript/src/poolUpdateSample.ts +[privateendpointconnectiondeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/typescript/src/privateEndpointConnectionDeleteSample.ts +[privateendpointconnectiongetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/typescript/src/privateEndpointConnectionGetSample.ts +[privateendpointconnectionlistbybatchaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/typescript/src/privateEndpointConnectionListByBatchAccountSample.ts +[privateendpointconnectionupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/typescript/src/privateEndpointConnectionUpdateSample.ts +[privatelinkresourcegetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/typescript/src/privateLinkResourceGetSample.ts +[privatelinkresourcelistbybatchaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v9/typescript/src/privateLinkResourceListByBatchAccountSample.ts [apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-batch?view=azure-node-preview [freesub]: https://azure.microsoft.com/free/ [package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/batch/arm-batch/README.md diff --git a/sdk/batch/arm-batch/samples/v8/typescript/package.json b/sdk/batch/arm-batch/samples/v9/typescript/package.json similarity index 100% rename from sdk/batch/arm-batch/samples/v8/typescript/package.json rename to sdk/batch/arm-batch/samples/v9/typescript/package.json diff --git a/sdk/batch/arm-batch/samples/v8/typescript/sample.env b/sdk/batch/arm-batch/samples/v9/typescript/sample.env similarity index 100% rename from sdk/batch/arm-batch/samples/v8/typescript/sample.env rename to sdk/batch/arm-batch/samples/v9/typescript/sample.env diff --git a/sdk/batch/arm-batch/samples/v8/typescript/src/applicationCreateSample.ts b/sdk/batch/arm-batch/samples/v9/typescript/src/applicationCreateSample.ts similarity index 77% rename from sdk/batch/arm-batch/samples/v8/typescript/src/applicationCreateSample.ts rename to sdk/batch/arm-batch/samples/v9/typescript/src/applicationCreateSample.ts index 9cdb9ed8e0c5..9fe607f0d9fc 100644 --- a/sdk/batch/arm-batch/samples/v8/typescript/src/applicationCreateSample.ts +++ b/sdk/batch/arm-batch/samples/v9/typescript/src/applicationCreateSample.ts @@ -14,16 +14,20 @@ import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Adds an application to the specified Batch account. * * @summary Adds an application to the specified Batch account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationCreate.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationCreate.json */ async function applicationCreate() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const applicationName = "app1"; const parameters: Application = { @@ -42,4 +46,8 @@ async function applicationCreate() { console.log(result); } -applicationCreate().catch(console.error); +async function main() { + applicationCreate(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/typescript/src/applicationDeleteSample.ts b/sdk/batch/arm-batch/samples/v9/typescript/src/applicationDeleteSample.ts similarity index 72% rename from sdk/batch/arm-batch/samples/v8/typescript/src/applicationDeleteSample.ts rename to sdk/batch/arm-batch/samples/v9/typescript/src/applicationDeleteSample.ts index 919a282e96d6..cf2412f8b231 100644 --- a/sdk/batch/arm-batch/samples/v8/typescript/src/applicationDeleteSample.ts +++ b/sdk/batch/arm-batch/samples/v9/typescript/src/applicationDeleteSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes an application. * * @summary Deletes an application. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationDelete.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationDelete.json */ async function applicationDelete() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const applicationName = "app1"; const credential = new DefaultAzureCredential(); @@ -32,4 +36,8 @@ async function applicationDelete() { console.log(result); } -applicationDelete().catch(console.error); +async function main() { + applicationDelete(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/typescript/src/applicationGetSample.ts b/sdk/batch/arm-batch/samples/v9/typescript/src/applicationGetSample.ts similarity index 73% rename from sdk/batch/arm-batch/samples/v8/typescript/src/applicationGetSample.ts rename to sdk/batch/arm-batch/samples/v9/typescript/src/applicationGetSample.ts index 548af5c385fe..4e5f89cc7cda 100644 --- a/sdk/batch/arm-batch/samples/v8/typescript/src/applicationGetSample.ts +++ b/sdk/batch/arm-batch/samples/v9/typescript/src/applicationGetSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets information about the specified application. * * @summary Gets information about the specified application. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationGet.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationGet.json */ async function applicationGet() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const applicationName = "app1"; const credential = new DefaultAzureCredential(); @@ -32,4 +36,8 @@ async function applicationGet() { console.log(result); } -applicationGet().catch(console.error); +async function main() { + applicationGet(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/typescript/src/applicationListSample.ts b/sdk/batch/arm-batch/samples/v9/typescript/src/applicationListSample.ts similarity index 74% rename from sdk/batch/arm-batch/samples/v8/typescript/src/applicationListSample.ts rename to sdk/batch/arm-batch/samples/v9/typescript/src/applicationListSample.ts index 3b87fde9a3fb..9ab7a0058207 100644 --- a/sdk/batch/arm-batch/samples/v8/typescript/src/applicationListSample.ts +++ b/sdk/batch/arm-batch/samples/v9/typescript/src/applicationListSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists all of the applications in the specified account. * * @summary Lists all of the applications in the specified account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationList.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationList.json */ async function applicationList() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); @@ -33,4 +37,8 @@ async function applicationList() { console.log(resArray); } -applicationList().catch(console.error); +async function main() { + applicationList(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/typescript/src/applicationPackageActivateSample.ts b/sdk/batch/arm-batch/samples/v9/typescript/src/applicationPackageActivateSample.ts similarity index 80% rename from sdk/batch/arm-batch/samples/v8/typescript/src/applicationPackageActivateSample.ts rename to sdk/batch/arm-batch/samples/v9/typescript/src/applicationPackageActivateSample.ts index 9a6311b6b83d..cf23cd68b5f8 100644 --- a/sdk/batch/arm-batch/samples/v8/typescript/src/applicationPackageActivateSample.ts +++ b/sdk/batch/arm-batch/samples/v9/typescript/src/applicationPackageActivateSample.ts @@ -13,16 +13,20 @@ import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Activates the specified application package. This should be done after the `ApplicationPackage` was created and uploaded. This needs to be done before an `ApplicationPackage` can be used on Pools or Tasks. * * @summary Activates the specified application package. This should be done after the `ApplicationPackage` was created and uploaded. This needs to be done before an `ApplicationPackage` can be used on Pools or Tasks. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationPackageActivate.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationPackageActivate.json */ async function applicationPackageActivate() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const applicationName = "app1"; const versionName = "1"; @@ -39,4 +43,8 @@ async function applicationPackageActivate() { console.log(result); } -applicationPackageActivate().catch(console.error); +async function main() { + applicationPackageActivate(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/typescript/src/applicationPackageCreateSample.ts b/sdk/batch/arm-batch/samples/v9/typescript/src/applicationPackageCreateSample.ts similarity index 81% rename from sdk/batch/arm-batch/samples/v8/typescript/src/applicationPackageCreateSample.ts rename to sdk/batch/arm-batch/samples/v9/typescript/src/applicationPackageCreateSample.ts index 701f11dd0a45..57823abaa733 100644 --- a/sdk/batch/arm-batch/samples/v8/typescript/src/applicationPackageCreateSample.ts +++ b/sdk/batch/arm-batch/samples/v9/typescript/src/applicationPackageCreateSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates an application package record. The record contains a storageUrl where the package should be uploaded to. Once it is uploaded the `ApplicationPackage` needs to be activated using `ApplicationPackageActive` before it can be used. If the auto storage account was configured to use storage keys, the URL returned will contain a SAS. * * @summary Creates an application package record. The record contains a storageUrl where the package should be uploaded to. Once it is uploaded the `ApplicationPackage` needs to be activated using `ApplicationPackageActive` before it can be used. If the auto storage account was configured to use storage keys, the URL returned will contain a SAS. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationPackageCreate.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationPackageCreate.json */ async function applicationPackageCreate() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const applicationName = "app1"; const versionName = "1"; @@ -34,4 +38,8 @@ async function applicationPackageCreate() { console.log(result); } -applicationPackageCreate().catch(console.error); +async function main() { + applicationPackageCreate(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/typescript/src/applicationPackageDeleteSample.ts b/sdk/batch/arm-batch/samples/v9/typescript/src/applicationPackageDeleteSample.ts similarity index 74% rename from sdk/batch/arm-batch/samples/v8/typescript/src/applicationPackageDeleteSample.ts rename to sdk/batch/arm-batch/samples/v9/typescript/src/applicationPackageDeleteSample.ts index 70844be18df8..297dad5d0670 100644 --- a/sdk/batch/arm-batch/samples/v8/typescript/src/applicationPackageDeleteSample.ts +++ b/sdk/batch/arm-batch/samples/v9/typescript/src/applicationPackageDeleteSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes an application package record and its associated binary file. * * @summary Deletes an application package record and its associated binary file. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationPackageDelete.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationPackageDelete.json */ async function applicationPackageDelete() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const applicationName = "app1"; const versionName = "1"; @@ -34,4 +38,8 @@ async function applicationPackageDelete() { console.log(result); } -applicationPackageDelete().catch(console.error); +async function main() { + applicationPackageDelete(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/typescript/src/applicationPackageGetSample.ts b/sdk/batch/arm-batch/samples/v9/typescript/src/applicationPackageGetSample.ts similarity index 74% rename from sdk/batch/arm-batch/samples/v8/typescript/src/applicationPackageGetSample.ts rename to sdk/batch/arm-batch/samples/v9/typescript/src/applicationPackageGetSample.ts index 570232bb34c9..7c739a0c3546 100644 --- a/sdk/batch/arm-batch/samples/v8/typescript/src/applicationPackageGetSample.ts +++ b/sdk/batch/arm-batch/samples/v9/typescript/src/applicationPackageGetSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets information about the specified application package. * * @summary Gets information about the specified application package. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationPackageGet.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationPackageGet.json */ async function applicationPackageGet() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const applicationName = "app1"; const versionName = "1"; @@ -34,4 +38,8 @@ async function applicationPackageGet() { console.log(result); } -applicationPackageGet().catch(console.error); +async function main() { + applicationPackageGet(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/typescript/src/applicationPackageListSample.ts b/sdk/batch/arm-batch/samples/v9/typescript/src/applicationPackageListSample.ts similarity index 75% rename from sdk/batch/arm-batch/samples/v8/typescript/src/applicationPackageListSample.ts rename to sdk/batch/arm-batch/samples/v9/typescript/src/applicationPackageListSample.ts index 773a99458218..2ac7d90a1359 100644 --- a/sdk/batch/arm-batch/samples/v8/typescript/src/applicationPackageListSample.ts +++ b/sdk/batch/arm-batch/samples/v9/typescript/src/applicationPackageListSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists all of the application packages in the specified application. * * @summary Lists all of the application packages in the specified application. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationPackageList.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationPackageList.json */ async function applicationPackageList() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const applicationName = "app1"; const credential = new DefaultAzureCredential(); @@ -35,4 +39,8 @@ async function applicationPackageList() { console.log(resArray); } -applicationPackageList().catch(console.error); +async function main() { + applicationPackageList(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/typescript/src/applicationUpdateSample.ts b/sdk/batch/arm-batch/samples/v9/typescript/src/applicationUpdateSample.ts similarity index 75% rename from sdk/batch/arm-batch/samples/v8/typescript/src/applicationUpdateSample.ts rename to sdk/batch/arm-batch/samples/v9/typescript/src/applicationUpdateSample.ts index add0ffdd2c02..e1c95c6a5c14 100644 --- a/sdk/batch/arm-batch/samples/v8/typescript/src/applicationUpdateSample.ts +++ b/sdk/batch/arm-batch/samples/v9/typescript/src/applicationUpdateSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { Application, BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Updates settings for the specified application. * * @summary Updates settings for the specified application. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/ApplicationUpdate.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/ApplicationUpdate.json */ async function applicationUpdate() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const applicationName = "app1"; const parameters: Application = { @@ -38,4 +42,8 @@ async function applicationUpdate() { console.log(result); } -applicationUpdate().catch(console.error); +async function main() { + applicationUpdate(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/typescript/src/batchAccountCreateSample.ts b/sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountCreateSample.ts similarity index 82% rename from sdk/batch/arm-batch/samples/v8/typescript/src/batchAccountCreateSample.ts rename to sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountCreateSample.ts index 5436f2e0df9d..2030ea0a871a 100644 --- a/sdk/batch/arm-batch/samples/v8/typescript/src/batchAccountCreateSample.ts +++ b/sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountCreateSample.ts @@ -13,16 +13,20 @@ import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API. * * @summary Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountCreate_BYOS.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountCreate_BYOS.json */ async function batchAccountCreateByos() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const parameters: BatchAccountCreateParameters = { autoStorage: { @@ -47,17 +51,16 @@ async function batchAccountCreateByos() { console.log(result); } -batchAccountCreateByos().catch(console.error); - /** * This sample demonstrates how to Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API. * * @summary Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountCreate_Default.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountCreate_Default.json */ async function batchAccountCreateDefault() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const parameters: BatchAccountCreateParameters = { autoStorage: { @@ -76,17 +79,16 @@ async function batchAccountCreateDefault() { console.log(result); } -batchAccountCreateDefault().catch(console.error); - /** * This sample demonstrates how to Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API. * * @summary Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountCreate_SystemAssignedIdentity.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountCreate_SystemAssignedIdentity.json */ async function batchAccountCreateSystemAssignedIdentity() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const parameters: BatchAccountCreateParameters = { autoStorage: { @@ -106,17 +108,16 @@ async function batchAccountCreateSystemAssignedIdentity() { console.log(result); } -batchAccountCreateSystemAssignedIdentity().catch(console.error); - /** * This sample demonstrates how to Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API. * * @summary Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountCreate_UserAssignedIdentity.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountCreate_UserAssignedIdentity.json */ async function batchAccountCreateUserAssignedIdentity() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const parameters: BatchAccountCreateParameters = { autoStorage: { @@ -141,17 +142,16 @@ async function batchAccountCreateUserAssignedIdentity() { console.log(result); } -batchAccountCreateUserAssignedIdentity().catch(console.error); - /** * This sample demonstrates how to Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API. * * @summary Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PrivateBatchAccountCreate.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PrivateBatchAccountCreate.json */ async function privateBatchAccountCreate() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const parameters: BatchAccountCreateParameters = { autoStorage: { @@ -176,4 +176,12 @@ async function privateBatchAccountCreate() { console.log(result); } -privateBatchAccountCreate().catch(console.error); +async function main() { + batchAccountCreateByos(); + batchAccountCreateDefault(); + batchAccountCreateSystemAssignedIdentity(); + batchAccountCreateUserAssignedIdentity(); + privateBatchAccountCreate(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/typescript/src/batchAccountDeleteSample.ts b/sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountDeleteSample.ts similarity index 72% rename from sdk/batch/arm-batch/samples/v8/typescript/src/batchAccountDeleteSample.ts rename to sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountDeleteSample.ts index f531bce1f946..e61b863e3f4c 100644 --- a/sdk/batch/arm-batch/samples/v8/typescript/src/batchAccountDeleteSample.ts +++ b/sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountDeleteSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes the specified Batch account. * * @summary Deletes the specified Batch account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountDelete.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountDelete.json */ async function batchAccountDelete() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); @@ -30,4 +34,8 @@ async function batchAccountDelete() { console.log(result); } -batchAccountDelete().catch(console.error); +async function main() { + batchAccountDelete(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/typescript/src/batchAccountGetDetectorSample.ts b/sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountGetDetectorSample.ts similarity index 74% rename from sdk/batch/arm-batch/samples/v8/typescript/src/batchAccountGetDetectorSample.ts rename to sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountGetDetectorSample.ts index 7757fa31117c..87ff51dbea44 100644 --- a/sdk/batch/arm-batch/samples/v8/typescript/src/batchAccountGetDetectorSample.ts +++ b/sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountGetDetectorSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets information about the given detector for a given Batch account. * * @summary Gets information about the given detector for a given Batch account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/DetectorGet.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/DetectorGet.json */ async function getDetector() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const detectorId = "poolsAndNodes"; const credential = new DefaultAzureCredential(); @@ -32,4 +36,8 @@ async function getDetector() { console.log(result); } -getDetector().catch(console.error); +async function main() { + getDetector(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/typescript/src/batchAccountGetKeysSample.ts b/sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountGetKeysSample.ts similarity index 80% rename from sdk/batch/arm-batch/samples/v8/typescript/src/batchAccountGetKeysSample.ts rename to sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountGetKeysSample.ts index cf55667c1247..1e0774147615 100644 --- a/sdk/batch/arm-batch/samples/v8/typescript/src/batchAccountGetKeysSample.ts +++ b/sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountGetKeysSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to This operation applies only to Batch accounts with allowedAuthenticationModes containing 'SharedKey'. If the Batch account doesn't contain 'SharedKey' in its allowedAuthenticationMode, clients cannot use shared keys to authenticate, and must use another allowedAuthenticationModes instead. In this case, getting the keys will fail. * * @summary This operation applies only to Batch accounts with allowedAuthenticationModes containing 'SharedKey'. If the Batch account doesn't contain 'SharedKey' in its allowedAuthenticationMode, clients cannot use shared keys to authenticate, and must use another allowedAuthenticationModes instead. In this case, getting the keys will fail. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountGetKeys.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountGetKeys.json */ async function batchAccountGetKeys() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); @@ -30,4 +34,8 @@ async function batchAccountGetKeys() { console.log(result); } -batchAccountGetKeys().catch(console.error); +async function main() { + batchAccountGetKeys(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/typescript/src/batchAccountGetSample.ts b/sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountGetSample.ts similarity index 70% rename from sdk/batch/arm-batch/samples/v8/typescript/src/batchAccountGetSample.ts rename to sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountGetSample.ts index 8624afd49ac4..57d4dc6d4c5a 100644 --- a/sdk/batch/arm-batch/samples/v8/typescript/src/batchAccountGetSample.ts +++ b/sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountGetSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets information about the specified Batch account. * * @summary Gets information about the specified Batch account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountGet.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountGet.json */ async function batchAccountGet() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); @@ -30,17 +34,16 @@ async function batchAccountGet() { console.log(result); } -batchAccountGet().catch(console.error); - /** * This sample demonstrates how to Gets information about the specified Batch account. * * @summary Gets information about the specified Batch account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PrivateBatchAccountGet.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PrivateBatchAccountGet.json */ async function privateBatchAccountGet() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); @@ -51,4 +54,9 @@ async function privateBatchAccountGet() { console.log(result); } -privateBatchAccountGet().catch(console.error); +async function main() { + batchAccountGet(); + privateBatchAccountGet(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/typescript/src/batchAccountListByResourceGroupSample.ts b/sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountListByResourceGroupSample.ts similarity index 74% rename from sdk/batch/arm-batch/samples/v8/typescript/src/batchAccountListByResourceGroupSample.ts rename to sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountListByResourceGroupSample.ts index 5cd3f5607fa6..0c838799954d 100644 --- a/sdk/batch/arm-batch/samples/v8/typescript/src/batchAccountListByResourceGroupSample.ts +++ b/sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountListByResourceGroupSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets information about the Batch accounts associated with the specified resource group. * * @summary Gets information about the Batch accounts associated with the specified resource group. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountListByResourceGroup.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountListByResourceGroup.json */ async function batchAccountListByResourceGroup() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -31,4 +35,8 @@ async function batchAccountListByResourceGroup() { console.log(resArray); } -batchAccountListByResourceGroup().catch(console.error); +async function main() { + batchAccountListByResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/typescript/src/batchAccountListDetectorsSample.ts b/sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountListDetectorsSample.ts similarity index 75% rename from sdk/batch/arm-batch/samples/v8/typescript/src/batchAccountListDetectorsSample.ts rename to sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountListDetectorsSample.ts index 04987567adcc..f7dfaac51b2a 100644 --- a/sdk/batch/arm-batch/samples/v8/typescript/src/batchAccountListDetectorsSample.ts +++ b/sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountListDetectorsSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets information about the detectors available for a given Batch account. * * @summary Gets information about the detectors available for a given Batch account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/DetectorList.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/DetectorList.json */ async function listDetectors() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); @@ -33,4 +37,8 @@ async function listDetectors() { console.log(resArray); } -listDetectors().catch(console.error); +async function main() { + listDetectors(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/typescript/src/batchAccountListOutboundNetworkDependenciesEndpointsSample.ts b/sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountListOutboundNetworkDependenciesEndpointsSample.ts similarity index 84% rename from sdk/batch/arm-batch/samples/v8/typescript/src/batchAccountListOutboundNetworkDependenciesEndpointsSample.ts rename to sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountListOutboundNetworkDependenciesEndpointsSample.ts index b6fea70e698b..c2aa48bbdfcf 100644 --- a/sdk/batch/arm-batch/samples/v8/typescript/src/batchAccountListOutboundNetworkDependenciesEndpointsSample.ts +++ b/sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountListOutboundNetworkDependenciesEndpointsSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://docs.microsoft.com/en-us/azure/batch/batch-virtual-network. * * @summary Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://docs.microsoft.com/en-us/azure/batch/batch-virtual-network. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountListOutboundNetworkDependenciesEndpoints.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountListOutboundNetworkDependenciesEndpoints.json */ async function listOutboundNetworkDependencies() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); @@ -33,4 +37,8 @@ async function listOutboundNetworkDependencies() { console.log(resArray); } -listOutboundNetworkDependencies().catch(console.error); +async function main() { + listOutboundNetworkDependencies(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/typescript/src/batchAccountListSample.ts b/sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountListSample.ts similarity index 79% rename from sdk/batch/arm-batch/samples/v8/typescript/src/batchAccountListSample.ts rename to sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountListSample.ts index 503f5c669526..d36977007e23 100644 --- a/sdk/batch/arm-batch/samples/v8/typescript/src/batchAccountListSample.ts +++ b/sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountListSample.ts @@ -10,15 +10,18 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets information about the Batch accounts associated with the subscription. * * @summary Gets information about the Batch accounts associated with the subscription. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountList.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountList.json */ async function batchAccountList() { - const subscriptionId = "subid"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -28,4 +31,8 @@ async function batchAccountList() { console.log(resArray); } -batchAccountList().catch(console.error); +async function main() { + batchAccountList(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/typescript/src/batchAccountRegenerateKeySample.ts b/sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountRegenerateKeySample.ts similarity index 81% rename from sdk/batch/arm-batch/samples/v8/typescript/src/batchAccountRegenerateKeySample.ts rename to sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountRegenerateKeySample.ts index f57eccd82666..5c12fc508b03 100644 --- a/sdk/batch/arm-batch/samples/v8/typescript/src/batchAccountRegenerateKeySample.ts +++ b/sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountRegenerateKeySample.ts @@ -13,16 +13,20 @@ import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to This operation applies only to Batch accounts with allowedAuthenticationModes containing 'SharedKey'. If the Batch account doesn't contain 'SharedKey' in its allowedAuthenticationMode, clients cannot use shared keys to authenticate, and must use another allowedAuthenticationModes instead. In this case, regenerating the keys will fail. * * @summary This operation applies only to Batch accounts with allowedAuthenticationModes containing 'SharedKey'. If the Batch account doesn't contain 'SharedKey' in its allowedAuthenticationMode, clients cannot use shared keys to authenticate, and must use another allowedAuthenticationModes instead. In this case, regenerating the keys will fail. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountRegenerateKey.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountRegenerateKey.json */ async function batchAccountRegenerateKey() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const parameters: BatchAccountRegenerateKeyParameters = { keyName: "Primary" @@ -37,4 +41,8 @@ async function batchAccountRegenerateKey() { console.log(result); } -batchAccountRegenerateKey().catch(console.error); +async function main() { + batchAccountRegenerateKey(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/typescript/src/batchAccountSynchronizeAutoStorageKeysSample.ts b/sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountSynchronizeAutoStorageKeysSample.ts similarity index 75% rename from sdk/batch/arm-batch/samples/v8/typescript/src/batchAccountSynchronizeAutoStorageKeysSample.ts rename to sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountSynchronizeAutoStorageKeysSample.ts index f2fd6c5f5a62..2738e8a263ea 100644 --- a/sdk/batch/arm-batch/samples/v8/typescript/src/batchAccountSynchronizeAutoStorageKeysSample.ts +++ b/sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountSynchronizeAutoStorageKeysSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Synchronizes access keys for the auto-storage account configured for the specified Batch account, only if storage key authentication is being used. * * @summary Synchronizes access keys for the auto-storage account configured for the specified Batch account, only if storage key authentication is being used. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountSynchronizeAutoStorageKeys.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountSynchronizeAutoStorageKeys.json */ async function batchAccountSynchronizeAutoStorageKeys() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); @@ -30,4 +34,8 @@ async function batchAccountSynchronizeAutoStorageKeys() { console.log(result); } -batchAccountSynchronizeAutoStorageKeys().catch(console.error); +async function main() { + batchAccountSynchronizeAutoStorageKeys(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/typescript/src/batchAccountUpdateSample.ts b/sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountUpdateSample.ts similarity index 77% rename from sdk/batch/arm-batch/samples/v8/typescript/src/batchAccountUpdateSample.ts rename to sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountUpdateSample.ts index cac67ddbc921..d6ff6eae14a4 100644 --- a/sdk/batch/arm-batch/samples/v8/typescript/src/batchAccountUpdateSample.ts +++ b/sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountUpdateSample.ts @@ -13,16 +13,20 @@ import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Updates the properties of an existing Batch account. * * @summary Updates the properties of an existing Batch account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/BatchAccountUpdate.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountUpdate.json */ async function batchAccountUpdate() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const parameters: BatchAccountUpdateParameters = { autoStorage: { @@ -40,4 +44,8 @@ async function batchAccountUpdate() { console.log(result); } -batchAccountUpdate().catch(console.error); +async function main() { + batchAccountUpdate(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/typescript/src/certificateCancelDeletionSample.ts b/sdk/batch/arm-batch/samples/v9/typescript/src/certificateCancelDeletionSample.ts similarity index 86% rename from sdk/batch/arm-batch/samples/v8/typescript/src/certificateCancelDeletionSample.ts rename to sdk/batch/arm-batch/samples/v9/typescript/src/certificateCancelDeletionSample.ts index 6c61c149c581..e01a82f20a8a 100644 --- a/sdk/batch/arm-batch/samples/v8/typescript/src/certificateCancelDeletionSample.ts +++ b/sdk/batch/arm-batch/samples/v9/typescript/src/certificateCancelDeletionSample.ts @@ -10,6 +10,9 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to If you try to delete a certificate that is being used by a pool or compute node, the status of the certificate changes to deleteFailed. If you decide that you want to continue using the certificate, you can use this operation to set the status of the certificate back to active. If you intend to delete the certificate, you do not need to run this operation after the deletion failed. You must make sure that the certificate is not being used by any resources, and then you can try again to delete the certificate. @@ -19,11 +22,12 @@ Warning: This operation is deprecated and will be removed after February, 2024. * @summary If you try to delete a certificate that is being used by a pool or compute node, the status of the certificate changes to deleteFailed. If you decide that you want to continue using the certificate, you can use this operation to set the status of the certificate back to active. If you intend to delete the certificate, you do not need to run this operation after the deletion failed. You must make sure that the certificate is not being used by any resources, and then you can try again to delete the certificate. Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateCancelDeletion.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/CertificateCancelDeletion.json */ async function certificateCancelDeletion() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const certificateName = "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"; const credential = new DefaultAzureCredential(); @@ -36,4 +40,8 @@ async function certificateCancelDeletion() { console.log(result); } -certificateCancelDeletion().catch(console.error); +async function main() { + certificateCancelDeletion(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/typescript/src/certificateCreateSample.ts b/sdk/batch/arm-batch/samples/v9/typescript/src/certificateCreateSample.ts similarity index 81% rename from sdk/batch/arm-batch/samples/v8/typescript/src/certificateCreateSample.ts rename to sdk/batch/arm-batch/samples/v9/typescript/src/certificateCreateSample.ts index 9df986821acf..28dd1812c719 100644 --- a/sdk/batch/arm-batch/samples/v8/typescript/src/certificateCreateSample.ts +++ b/sdk/batch/arm-batch/samples/v9/typescript/src/certificateCreateSample.ts @@ -13,16 +13,20 @@ import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. * * @summary Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateCreate_Full.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/CertificateCreate_Full.json */ async function createCertificateFull() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const certificateName = "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"; const parameters: CertificateCreateOrUpdateParameters = { @@ -43,17 +47,16 @@ async function createCertificateFull() { console.log(result); } -createCertificateFull().catch(console.error); - /** * This sample demonstrates how to Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. * * @summary Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateCreate_MinimalCer.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/CertificateCreate_MinimalCer.json */ async function createCertificateMinimalCer() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const certificateName = "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"; const parameters: CertificateCreateOrUpdateParameters = { @@ -71,17 +74,16 @@ async function createCertificateMinimalCer() { console.log(result); } -createCertificateMinimalCer().catch(console.error); - /** * This sample demonstrates how to Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. * * @summary Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateCreate_Minimal.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/CertificateCreate_Minimal.json */ async function createCertificateMinimalPfx() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const certificateName = "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"; const parameters: CertificateCreateOrUpdateParameters = { @@ -99,4 +101,10 @@ async function createCertificateMinimalPfx() { console.log(result); } -createCertificateMinimalPfx().catch(console.error); +async function main() { + createCertificateFull(); + createCertificateMinimalCer(); + createCertificateMinimalPfx(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/typescript/src/certificateDeleteSample.ts b/sdk/batch/arm-batch/samples/v9/typescript/src/certificateDeleteSample.ts similarity index 78% rename from sdk/batch/arm-batch/samples/v8/typescript/src/certificateDeleteSample.ts rename to sdk/batch/arm-batch/samples/v9/typescript/src/certificateDeleteSample.ts index b549fa9631ce..9fdffd74b2c7 100644 --- a/sdk/batch/arm-batch/samples/v8/typescript/src/certificateDeleteSample.ts +++ b/sdk/batch/arm-batch/samples/v9/typescript/src/certificateDeleteSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. * * @summary Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateDelete.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/CertificateDelete.json */ async function certificateDelete() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const certificateName = "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"; const credential = new DefaultAzureCredential(); @@ -32,4 +36,8 @@ async function certificateDelete() { console.log(result); } -certificateDelete().catch(console.error); +async function main() { + certificateDelete(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/typescript/src/certificateGetSample.ts b/sdk/batch/arm-batch/samples/v9/typescript/src/certificateGetSample.ts similarity index 78% rename from sdk/batch/arm-batch/samples/v8/typescript/src/certificateGetSample.ts rename to sdk/batch/arm-batch/samples/v9/typescript/src/certificateGetSample.ts index 19477b3d285c..4bae2897191d 100644 --- a/sdk/batch/arm-batch/samples/v8/typescript/src/certificateGetSample.ts +++ b/sdk/batch/arm-batch/samples/v9/typescript/src/certificateGetSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. * * @summary Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateGet.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/CertificateGet.json */ async function getCertificate() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const certificateName = "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"; const credential = new DefaultAzureCredential(); @@ -32,17 +36,16 @@ async function getCertificate() { console.log(result); } -getCertificate().catch(console.error); - /** * This sample demonstrates how to Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. * * @summary Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateGetWithDeletionError.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/CertificateGetWithDeletionError.json */ async function getCertificateWithDeletionError() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const certificateName = "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"; const credential = new DefaultAzureCredential(); @@ -55,4 +58,9 @@ async function getCertificateWithDeletionError() { console.log(result); } -getCertificateWithDeletionError().catch(console.error); +async function main() { + getCertificate(); + getCertificateWithDeletionError(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/typescript/src/certificateListByBatchAccountSample.ts b/sdk/batch/arm-batch/samples/v9/typescript/src/certificateListByBatchAccountSample.ts similarity index 80% rename from sdk/batch/arm-batch/samples/v8/typescript/src/certificateListByBatchAccountSample.ts rename to sdk/batch/arm-batch/samples/v9/typescript/src/certificateListByBatchAccountSample.ts index af7eff7bad4f..eccf6cc3d132 100644 --- a/sdk/batch/arm-batch/samples/v8/typescript/src/certificateListByBatchAccountSample.ts +++ b/sdk/batch/arm-batch/samples/v9/typescript/src/certificateListByBatchAccountSample.ts @@ -13,16 +13,20 @@ import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. * * @summary Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateList.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/CertificateList.json */ async function listCertificates() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); @@ -36,17 +40,16 @@ async function listCertificates() { console.log(resArray); } -listCertificates().catch(console.error); - /** * This sample demonstrates how to Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. * * @summary Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateListWithFilter.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/CertificateListWithFilter.json */ async function listCertificatesFilterAndSelect() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const select = "properties/format,properties/provisioningState"; const filter = @@ -68,4 +71,9 @@ async function listCertificatesFilterAndSelect() { console.log(resArray); } -listCertificatesFilterAndSelect().catch(console.error); +async function main() { + listCertificates(); + listCertificatesFilterAndSelect(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/typescript/src/certificateUpdateSample.ts b/sdk/batch/arm-batch/samples/v9/typescript/src/certificateUpdateSample.ts similarity index 81% rename from sdk/batch/arm-batch/samples/v8/typescript/src/certificateUpdateSample.ts rename to sdk/batch/arm-batch/samples/v9/typescript/src/certificateUpdateSample.ts index ed0a6cd23767..deac61b3a77d 100644 --- a/sdk/batch/arm-batch/samples/v8/typescript/src/certificateUpdateSample.ts +++ b/sdk/batch/arm-batch/samples/v9/typescript/src/certificateUpdateSample.ts @@ -13,16 +13,20 @@ import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. * * @summary Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/CertificateUpdate.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/CertificateUpdate.json */ async function updateCertificate() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const certificateName = "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"; const parameters: CertificateCreateOrUpdateParameters = { @@ -40,4 +44,8 @@ async function updateCertificate() { console.log(result); } -updateCertificate().catch(console.error); +async function main() { + updateCertificate(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/typescript/src/locationCheckNameAvailabilitySample.ts b/sdk/batch/arm-batch/samples/v9/typescript/src/locationCheckNameAvailabilitySample.ts similarity index 80% rename from sdk/batch/arm-batch/samples/v8/typescript/src/locationCheckNameAvailabilitySample.ts rename to sdk/batch/arm-batch/samples/v9/typescript/src/locationCheckNameAvailabilitySample.ts index 3c0ad64fab53..e66be150209e 100644 --- a/sdk/batch/arm-batch/samples/v8/typescript/src/locationCheckNameAvailabilitySample.ts +++ b/sdk/batch/arm-batch/samples/v9/typescript/src/locationCheckNameAvailabilitySample.ts @@ -13,15 +13,18 @@ import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Checks whether the Batch account name is available in the specified region. * * @summary Checks whether the Batch account name is available in the specified region. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/LocationCheckNameAvailability_AlreadyExists.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/LocationCheckNameAvailability_AlreadyExists.json */ async function locationCheckNameAvailabilityAlreadyExists() { - const subscriptionId = "subid"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; const locationName = "japaneast"; const parameters: CheckNameAvailabilityParameters = { name: "existingaccountname", @@ -36,16 +39,14 @@ async function locationCheckNameAvailabilityAlreadyExists() { console.log(result); } -locationCheckNameAvailabilityAlreadyExists().catch(console.error); - /** * This sample demonstrates how to Checks whether the Batch account name is available in the specified region. * * @summary Checks whether the Batch account name is available in the specified region. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/LocationCheckNameAvailability_Available.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/LocationCheckNameAvailability_Available.json */ async function locationCheckNameAvailabilityAvailable() { - const subscriptionId = "subid"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; const locationName = "japaneast"; const parameters: CheckNameAvailabilityParameters = { name: "newaccountname", @@ -60,4 +61,9 @@ async function locationCheckNameAvailabilityAvailable() { console.log(result); } -locationCheckNameAvailabilityAvailable().catch(console.error); +async function main() { + locationCheckNameAvailabilityAlreadyExists(); + locationCheckNameAvailabilityAvailable(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/typescript/src/locationGetQuotasSample.ts b/sdk/batch/arm-batch/samples/v9/typescript/src/locationGetQuotasSample.ts similarity index 78% rename from sdk/batch/arm-batch/samples/v8/typescript/src/locationGetQuotasSample.ts rename to sdk/batch/arm-batch/samples/v9/typescript/src/locationGetQuotasSample.ts index 33ea374077e0..24f77cad7fc2 100644 --- a/sdk/batch/arm-batch/samples/v8/typescript/src/locationGetQuotasSample.ts +++ b/sdk/batch/arm-batch/samples/v9/typescript/src/locationGetQuotasSample.ts @@ -10,15 +10,18 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets the Batch service quotas for the specified subscription at the given location. * * @summary Gets the Batch service quotas for the specified subscription at the given location. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/LocationGetQuotas.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/LocationGetQuotas.json */ async function locationGetQuotas() { - const subscriptionId = "subid"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; const locationName = "japaneast"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); @@ -26,4 +29,8 @@ async function locationGetQuotas() { console.log(result); } -locationGetQuotas().catch(console.error); +async function main() { + locationGetQuotas(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/typescript/src/locationListSupportedCloudServiceSkusSample.ts b/sdk/batch/arm-batch/samples/v9/typescript/src/locationListSupportedCloudServiceSkusSample.ts similarity index 80% rename from sdk/batch/arm-batch/samples/v8/typescript/src/locationListSupportedCloudServiceSkusSample.ts rename to sdk/batch/arm-batch/samples/v9/typescript/src/locationListSupportedCloudServiceSkusSample.ts index 927cbfc37913..1e7194c41fe1 100644 --- a/sdk/batch/arm-batch/samples/v8/typescript/src/locationListSupportedCloudServiceSkusSample.ts +++ b/sdk/batch/arm-batch/samples/v9/typescript/src/locationListSupportedCloudServiceSkusSample.ts @@ -10,15 +10,18 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets the list of Batch supported Cloud Service VM sizes available at the given location. * * @summary Gets the list of Batch supported Cloud Service VM sizes available at the given location. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/LocationListCloudServiceSkus.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/LocationListCloudServiceSkus.json */ async function locationListCloudServiceSkus() { - const subscriptionId = "subid"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; const locationName = "japaneast"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); @@ -31,4 +34,8 @@ async function locationListCloudServiceSkus() { console.log(resArray); } -locationListCloudServiceSkus().catch(console.error); +async function main() { + locationListCloudServiceSkus(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/typescript/src/locationListSupportedVirtualMachineSkusSample.ts b/sdk/batch/arm-batch/samples/v9/typescript/src/locationListSupportedVirtualMachineSkusSample.ts similarity index 80% rename from sdk/batch/arm-batch/samples/v8/typescript/src/locationListSupportedVirtualMachineSkusSample.ts rename to sdk/batch/arm-batch/samples/v9/typescript/src/locationListSupportedVirtualMachineSkusSample.ts index 85f2471df89a..d599a668a32d 100644 --- a/sdk/batch/arm-batch/samples/v8/typescript/src/locationListSupportedVirtualMachineSkusSample.ts +++ b/sdk/batch/arm-batch/samples/v9/typescript/src/locationListSupportedVirtualMachineSkusSample.ts @@ -10,15 +10,18 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets the list of Batch supported Virtual Machine VM sizes available at the given location. * * @summary Gets the list of Batch supported Virtual Machine VM sizes available at the given location. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/LocationListVirtualMachineSkus.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/LocationListVirtualMachineSkus.json */ async function locationListVirtualMachineSkus() { - const subscriptionId = "subid"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; const locationName = "japaneast"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); @@ -31,4 +34,8 @@ async function locationListVirtualMachineSkus() { console.log(resArray); } -locationListVirtualMachineSkus().catch(console.error); +async function main() { + locationListVirtualMachineSkus(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/typescript/src/operationsListSample.ts b/sdk/batch/arm-batch/samples/v9/typescript/src/operationsListSample.ts similarity index 76% rename from sdk/batch/arm-batch/samples/v8/typescript/src/operationsListSample.ts rename to sdk/batch/arm-batch/samples/v9/typescript/src/operationsListSample.ts index 060944a592a0..6114f912b2ff 100644 --- a/sdk/batch/arm-batch/samples/v8/typescript/src/operationsListSample.ts +++ b/sdk/batch/arm-batch/samples/v9/typescript/src/operationsListSample.ts @@ -10,15 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists available operations for the Microsoft.Batch provider * * @summary Lists available operations for the Microsoft.Batch provider - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/OperationsList.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/OperationsList.json */ async function operationsList() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const subscriptionId = + process.env["BATCH_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); const resArray = new Array(); @@ -28,4 +33,8 @@ async function operationsList() { console.log(resArray); } -operationsList().catch(console.error); +async function main() { + operationsList(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/typescript/src/poolCreateSample.ts b/sdk/batch/arm-batch/samples/v9/typescript/src/poolCreateSample.ts similarity index 76% rename from sdk/batch/arm-batch/samples/v8/typescript/src/poolCreateSample.ts rename to sdk/batch/arm-batch/samples/v9/typescript/src/poolCreateSample.ts index 4b26e0996709..fe27144f0bbc 100644 --- a/sdk/batch/arm-batch/samples/v8/typescript/src/poolCreateSample.ts +++ b/sdk/batch/arm-batch/samples/v9/typescript/src/poolCreateSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { Pool, BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates a new pool inside the specified account. * * @summary Creates a new pool inside the specified account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolCreate_SharedImageGallery.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolCreate_SharedImageGallery.json */ async function createPoolCustomImage() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const parameters: Pool = { @@ -45,17 +49,16 @@ async function createPoolCustomImage() { console.log(result); } -createPoolCustomImage().catch(console.error); - /** * This sample demonstrates how to Creates a new pool inside the specified account. * * @summary Creates a new pool inside the specified account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolCreate_CloudServiceConfiguration.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolCreate_CloudServiceConfiguration.json */ async function createPoolFullCloudServiceConfiguration() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const parameters: Pool = { @@ -148,17 +151,16 @@ async function createPoolFullCloudServiceConfiguration() { console.log(result); } -createPoolFullCloudServiceConfiguration().catch(console.error); - /** * This sample demonstrates how to Creates a new pool inside the specified account. * * @summary Creates a new pool inside the specified account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolCreate_VirtualMachineConfiguration.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolCreate_VirtualMachineConfiguration.json */ async function createPoolFullVirtualMachineConfiguration() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const parameters: Pool = { @@ -238,17 +240,16 @@ async function createPoolFullVirtualMachineConfiguration() { console.log(result); } -createPoolFullVirtualMachineConfiguration().catch(console.error); - /** * This sample demonstrates how to Creates a new pool inside the specified account. * * @summary Creates a new pool inside the specified account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolCreate_MinimalCloudServiceConfiguration.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolCreate_MinimalCloudServiceConfiguration.json */ async function createPoolMinimalCloudServiceConfiguration() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const parameters: Pool = { @@ -267,17 +268,16 @@ async function createPoolMinimalCloudServiceConfiguration() { console.log(result); } -createPoolMinimalCloudServiceConfiguration().catch(console.error); - /** * This sample demonstrates how to Creates a new pool inside the specified account. * * @summary Creates a new pool inside the specified account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolCreate_MinimalVirtualMachineConfiguration.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolCreate_MinimalVirtualMachineConfiguration.json */ async function createPoolMinimalVirtualMachineConfiguration() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const parameters: Pool = { @@ -311,17 +311,16 @@ async function createPoolMinimalVirtualMachineConfiguration() { console.log(result); } -createPoolMinimalVirtualMachineConfiguration().catch(console.error); - /** * This sample demonstrates how to Creates a new pool inside the specified account. * * @summary Creates a new pool inside the specified account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolCreate_NoPublicIPAddresses.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolCreate_NoPublicIPAddresses.json */ async function createPoolNoPublicIP() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const parameters: Pool = { @@ -352,17 +351,16 @@ async function createPoolNoPublicIP() { console.log(result); } -createPoolNoPublicIP().catch(console.error); - /** * This sample demonstrates how to Creates a new pool inside the specified account. * * @summary Creates a new pool inside the specified account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolCreate_PublicIPs.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolCreate_PublicIPs.json */ async function createPoolPublicIPs() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const parameters: Pool = { @@ -398,17 +396,16 @@ async function createPoolPublicIPs() { console.log(result); } -createPoolPublicIPs().catch(console.error); - /** * This sample demonstrates how to Creates a new pool inside the specified account. * * @summary Creates a new pool inside the specified account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolCreate_UserAssignedIdentities.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolCreate_UserAssignedIdentities.json */ async function createPoolUserAssignedIdentities() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const parameters: Pool = { @@ -449,17 +446,16 @@ async function createPoolUserAssignedIdentities() { console.log(result); } -createPoolUserAssignedIdentities().catch(console.error); - /** * This sample demonstrates how to Creates a new pool inside the specified account. * * @summary Creates a new pool inside the specified account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolCreate_VirtualMachineConfiguration_Extensions.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolCreate_VirtualMachineConfiguration_Extensions.json */ async function createPoolVirtualMachineConfigurationExtensions() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const parameters: Pool = { @@ -474,14 +470,15 @@ async function createPoolVirtualMachineConfigurationExtensions() { extensions: [ { name: "batchextension1", - type: "SecurityMonitoringForLinux", + type: "KeyVaultForLinux", autoUpgradeMinorVersion: true, - protectedSettings: { - protectedSettingsKey: "protectedSettingsValue" + enableAutomaticUpgrade: true, + publisher: "Microsoft.Azure.KeyVault", + settings: { + authenticationSettingsKey: "authenticationSettingsValue", + secretsManagementSettingsKey: "secretsManagementSettingsValue" }, - publisher: "Microsoft.Azure.Security.Monitoring", - settings: { settingsKey: "settingsValue" }, - typeHandlerVersion: "1.0" + typeHandlerVersion: "2.0" } ] } @@ -506,4 +503,62 @@ async function createPoolVirtualMachineConfigurationExtensions() { console.log(result); } -createPoolVirtualMachineConfigurationExtensions().catch(console.error); +/** + * This sample demonstrates how to Creates a new pool inside the specified account. + * + * @summary Creates a new pool inside the specified account. + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolCreate_AcceleratedNetworking.json + */ +async function createPoolAcceleratedNetworking() { + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; + const accountName = "sampleacct"; + const poolName = "testpool"; + const parameters: Pool = { + deploymentConfiguration: { + virtualMachineConfiguration: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-datacenter-smalldisk", + version: "latest" + }, + nodeAgentSkuId: "batch.node.windows amd64" + } + }, + networkConfiguration: { + enableAcceleratedNetworking: true, + subnetId: + "/subscriptions/subid/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123" + }, + scaleSettings: { + fixedScale: { targetDedicatedNodes: 1, targetLowPriorityNodes: 0 } + }, + vmSize: "STANDARD_D1_V2" + }; + const credential = new DefaultAzureCredential(); + const client = new BatchManagementClient(credential, subscriptionId); + const result = await client.poolOperations.create( + resourceGroupName, + accountName, + poolName, + parameters + ); + console.log(result); +} + +async function main() { + createPoolCustomImage(); + createPoolFullCloudServiceConfiguration(); + createPoolFullVirtualMachineConfiguration(); + createPoolMinimalCloudServiceConfiguration(); + createPoolMinimalVirtualMachineConfiguration(); + createPoolNoPublicIP(); + createPoolPublicIPs(); + createPoolUserAssignedIdentities(); + createPoolVirtualMachineConfigurationExtensions(); + createPoolAcceleratedNetworking(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/typescript/src/poolDeleteSample.ts b/sdk/batch/arm-batch/samples/v9/typescript/src/poolDeleteSample.ts similarity index 73% rename from sdk/batch/arm-batch/samples/v8/typescript/src/poolDeleteSample.ts rename to sdk/batch/arm-batch/samples/v9/typescript/src/poolDeleteSample.ts index b84751200638..aff6c8349f81 100644 --- a/sdk/batch/arm-batch/samples/v8/typescript/src/poolDeleteSample.ts +++ b/sdk/batch/arm-batch/samples/v9/typescript/src/poolDeleteSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes the specified pool. * * @summary Deletes the specified pool. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolDelete.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolDelete.json */ async function deletePool() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const credential = new DefaultAzureCredential(); @@ -32,4 +36,8 @@ async function deletePool() { console.log(result); } -deletePool().catch(console.error); +async function main() { + deletePool(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/typescript/src/poolDisableAutoScaleSample.ts b/sdk/batch/arm-batch/samples/v9/typescript/src/poolDisableAutoScaleSample.ts similarity index 72% rename from sdk/batch/arm-batch/samples/v8/typescript/src/poolDisableAutoScaleSample.ts rename to sdk/batch/arm-batch/samples/v9/typescript/src/poolDisableAutoScaleSample.ts index 73be2ed961f5..e37ab9e56405 100644 --- a/sdk/batch/arm-batch/samples/v8/typescript/src/poolDisableAutoScaleSample.ts +++ b/sdk/batch/arm-batch/samples/v9/typescript/src/poolDisableAutoScaleSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Disables automatic scaling for a pool. * * @summary Disables automatic scaling for a pool. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolDisableAutoScale.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolDisableAutoScale.json */ async function disableAutoScale() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const credential = new DefaultAzureCredential(); @@ -32,4 +36,8 @@ async function disableAutoScale() { console.log(result); } -disableAutoScale().catch(console.error); +async function main() { + disableAutoScale(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/typescript/src/poolGetSample.ts b/sdk/batch/arm-batch/samples/v9/typescript/src/poolGetSample.ts similarity index 51% rename from sdk/batch/arm-batch/samples/v8/typescript/src/poolGetSample.ts rename to sdk/batch/arm-batch/samples/v9/typescript/src/poolGetSample.ts index dda6bc1df856..f4cdf8cc8de1 100644 --- a/sdk/batch/arm-batch/samples/v8/typescript/src/poolGetSample.ts +++ b/sdk/batch/arm-batch/samples/v9/typescript/src/poolGetSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets information about the specified pool. * * @summary Gets information about the specified pool. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolGet.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolGet.json */ async function getPool() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const credential = new DefaultAzureCredential(); @@ -32,17 +36,38 @@ async function getPool() { console.log(result); } -getPool().catch(console.error); +/** + * This sample demonstrates how to Gets information about the specified pool. + * + * @summary Gets information about the specified pool. + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolGet_AcceleratedNetworking.json + */ +async function getPoolAcceleratedNetworking() { + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; + const accountName = "sampleacct"; + const poolName = "testpool"; + const credential = new DefaultAzureCredential(); + const client = new BatchManagementClient(credential, subscriptionId); + const result = await client.poolOperations.get( + resourceGroupName, + accountName, + poolName + ); + console.log(result); +} /** * This sample demonstrates how to Gets information about the specified pool. * * @summary Gets information about the specified pool. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolGet_VirtualMachineConfiguration_Extensions.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolGet_VirtualMachineConfiguration_Extensions.json */ async function getPoolVirtualMachineConfigurationExtensions() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const credential = new DefaultAzureCredential(); @@ -55,4 +80,10 @@ async function getPoolVirtualMachineConfigurationExtensions() { console.log(result); } -getPoolVirtualMachineConfigurationExtensions().catch(console.error); +async function main() { + getPool(); + getPoolAcceleratedNetworking(); + getPoolVirtualMachineConfigurationExtensions(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/typescript/src/poolListByBatchAccountSample.ts b/sdk/batch/arm-batch/samples/v9/typescript/src/poolListByBatchAccountSample.ts similarity index 77% rename from sdk/batch/arm-batch/samples/v8/typescript/src/poolListByBatchAccountSample.ts rename to sdk/batch/arm-batch/samples/v9/typescript/src/poolListByBatchAccountSample.ts index a342a968e782..76e57a72fffd 100644 --- a/sdk/batch/arm-batch/samples/v8/typescript/src/poolListByBatchAccountSample.ts +++ b/sdk/batch/arm-batch/samples/v9/typescript/src/poolListByBatchAccountSample.ts @@ -13,16 +13,20 @@ import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists all of the pools in the specified account. * * @summary Lists all of the pools in the specified account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolList.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolList.json */ async function listPool() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); @@ -36,17 +40,16 @@ async function listPool() { console.log(resArray); } -listPool().catch(console.error); - /** * This sample demonstrates how to Lists all of the pools in the specified account. * * @summary Lists all of the pools in the specified account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolListWithFilter.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolListWithFilter.json */ async function listPoolWithFilter() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const select = "properties/allocationState,properties/provisioningStateTransitionTime,properties/currentDedicatedNodes,properties/currentLowPriorityNodes"; @@ -66,4 +69,9 @@ async function listPoolWithFilter() { console.log(resArray); } -listPoolWithFilter().catch(console.error); +async function main() { + listPool(); + listPoolWithFilter(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/typescript/src/poolStopResizeSample.ts b/sdk/batch/arm-batch/samples/v9/typescript/src/poolStopResizeSample.ts similarity index 84% rename from sdk/batch/arm-batch/samples/v8/typescript/src/poolStopResizeSample.ts rename to sdk/batch/arm-batch/samples/v9/typescript/src/poolStopResizeSample.ts index 2519c9dbd597..c3ff11b1c7d8 100644 --- a/sdk/batch/arm-batch/samples/v8/typescript/src/poolStopResizeSample.ts +++ b/sdk/batch/arm-batch/samples/v9/typescript/src/poolStopResizeSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to This does not restore the pool to its previous state before the resize operation: it only stops any further changes being made, and the pool maintains its current state. After stopping, the pool stabilizes at the number of nodes it was at when the stop operation was done. During the stop operation, the pool allocation state changes first to stopping and then to steady. A resize operation need not be an explicit resize pool request; this API can also be used to halt the initial sizing of the pool when it is created. * * @summary This does not restore the pool to its previous state before the resize operation: it only stops any further changes being made, and the pool maintains its current state. After stopping, the pool stabilizes at the number of nodes it was at when the stop operation was done. During the stop operation, the pool allocation state changes first to stopping and then to steady. A resize operation need not be an explicit resize pool request; this API can also be used to halt the initial sizing of the pool when it is created. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolStopResize.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolStopResize.json */ async function stopPoolResize() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const credential = new DefaultAzureCredential(); @@ -32,4 +36,8 @@ async function stopPoolResize() { console.log(result); } -stopPoolResize().catch(console.error); +async function main() { + stopPoolResize(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/typescript/src/poolUpdateSample.ts b/sdk/batch/arm-batch/samples/v9/typescript/src/poolUpdateSample.ts similarity index 77% rename from sdk/batch/arm-batch/samples/v8/typescript/src/poolUpdateSample.ts rename to sdk/batch/arm-batch/samples/v9/typescript/src/poolUpdateSample.ts index b78bc19e2dbf..4df776c8db00 100644 --- a/sdk/batch/arm-batch/samples/v8/typescript/src/poolUpdateSample.ts +++ b/sdk/batch/arm-batch/samples/v9/typescript/src/poolUpdateSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { Pool, BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Updates the properties of an existing pool. * * @summary Updates the properties of an existing pool. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolUpdate_EnableAutoScale.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolUpdate_EnableAutoScale.json */ async function updatePoolEnableAutoscale() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const parameters: Pool = { @@ -36,17 +40,16 @@ async function updatePoolEnableAutoscale() { console.log(result); } -updatePoolEnableAutoscale().catch(console.error); - /** * This sample demonstrates how to Updates the properties of an existing pool. * * @summary Updates the properties of an existing pool. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolUpdate_OtherProperties.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolUpdate_OtherProperties.json */ async function updatePoolOtherProperties() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const parameters: Pool = { @@ -83,17 +86,16 @@ async function updatePoolOtherProperties() { console.log(result); } -updatePoolOtherProperties().catch(console.error); - /** * This sample demonstrates how to Updates the properties of an existing pool. * * @summary Updates the properties of an existing pool. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolUpdate_RemoveStartTask.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolUpdate_RemoveStartTask.json */ async function updatePoolRemoveStartTask() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const parameters: Pool = { startTask: {} }; @@ -108,17 +110,16 @@ async function updatePoolRemoveStartTask() { console.log(result); } -updatePoolRemoveStartTask().catch(console.error); - /** * This sample demonstrates how to Updates the properties of an existing pool. * * @summary Updates the properties of an existing pool. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PoolUpdate_ResizePool.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PoolUpdate_ResizePool.json */ async function updatePoolResizePool() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const poolName = "testpool"; const parameters: Pool = { @@ -142,4 +143,11 @@ async function updatePoolResizePool() { console.log(result); } -updatePoolResizePool().catch(console.error); +async function main() { + updatePoolEnableAutoscale(); + updatePoolOtherProperties(); + updatePoolRemoveStartTask(); + updatePoolResizePool(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/typescript/src/privateEndpointConnectionDeleteSample.ts b/sdk/batch/arm-batch/samples/v9/typescript/src/privateEndpointConnectionDeleteSample.ts similarity index 75% rename from sdk/batch/arm-batch/samples/v8/typescript/src/privateEndpointConnectionDeleteSample.ts rename to sdk/batch/arm-batch/samples/v9/typescript/src/privateEndpointConnectionDeleteSample.ts index 00da020f0c8f..7e20710b64ec 100644 --- a/sdk/batch/arm-batch/samples/v8/typescript/src/privateEndpointConnectionDeleteSample.ts +++ b/sdk/batch/arm-batch/samples/v9/typescript/src/privateEndpointConnectionDeleteSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes the specified private endpoint connection. * * @summary Deletes the specified private endpoint connection. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PrivateEndpointConnectionDelete.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PrivateEndpointConnectionDelete.json */ async function privateEndpointConnectionDelete() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const privateEndpointConnectionName = "testprivateEndpointConnection5testprivateEndpointConnection5.24d6b4b5-e65c-4330-bbe9-3a290d62f8e0"; @@ -33,4 +37,8 @@ async function privateEndpointConnectionDelete() { console.log(result); } -privateEndpointConnectionDelete().catch(console.error); +async function main() { + privateEndpointConnectionDelete(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/typescript/src/privateEndpointConnectionGetSample.ts b/sdk/batch/arm-batch/samples/v9/typescript/src/privateEndpointConnectionGetSample.ts similarity index 76% rename from sdk/batch/arm-batch/samples/v8/typescript/src/privateEndpointConnectionGetSample.ts rename to sdk/batch/arm-batch/samples/v9/typescript/src/privateEndpointConnectionGetSample.ts index aae3a3b627a8..baca136374e3 100644 --- a/sdk/batch/arm-batch/samples/v8/typescript/src/privateEndpointConnectionGetSample.ts +++ b/sdk/batch/arm-batch/samples/v9/typescript/src/privateEndpointConnectionGetSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets information about the specified private endpoint connection. * * @summary Gets information about the specified private endpoint connection. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PrivateEndpointConnectionGet.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PrivateEndpointConnectionGet.json */ async function getPrivateEndpointConnection() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const privateEndpointConnectionName = "testprivateEndpointConnection5testprivateEndpointConnection5.24d6b4b5-e65c-4330-bbe9-3a290d62f8e0"; @@ -33,4 +37,8 @@ async function getPrivateEndpointConnection() { console.log(result); } -getPrivateEndpointConnection().catch(console.error); +async function main() { + getPrivateEndpointConnection(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/typescript/src/privateEndpointConnectionListByBatchAccountSample.ts b/sdk/batch/arm-batch/samples/v9/typescript/src/privateEndpointConnectionListByBatchAccountSample.ts similarity index 74% rename from sdk/batch/arm-batch/samples/v8/typescript/src/privateEndpointConnectionListByBatchAccountSample.ts rename to sdk/batch/arm-batch/samples/v9/typescript/src/privateEndpointConnectionListByBatchAccountSample.ts index 29f7b274f728..18ab728d63cd 100644 --- a/sdk/batch/arm-batch/samples/v8/typescript/src/privateEndpointConnectionListByBatchAccountSample.ts +++ b/sdk/batch/arm-batch/samples/v9/typescript/src/privateEndpointConnectionListByBatchAccountSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists all of the private endpoint connections in the specified account. * * @summary Lists all of the private endpoint connections in the specified account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PrivateEndpointConnectionsList.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PrivateEndpointConnectionsList.json */ async function listPrivateEndpointConnections() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); @@ -33,4 +37,8 @@ async function listPrivateEndpointConnections() { console.log(resArray); } -listPrivateEndpointConnections().catch(console.error); +async function main() { + listPrivateEndpointConnections(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/typescript/src/privateEndpointConnectionUpdateSample.ts b/sdk/batch/arm-batch/samples/v9/typescript/src/privateEndpointConnectionUpdateSample.ts similarity index 78% rename from sdk/batch/arm-batch/samples/v8/typescript/src/privateEndpointConnectionUpdateSample.ts rename to sdk/batch/arm-batch/samples/v9/typescript/src/privateEndpointConnectionUpdateSample.ts index 36d0d8a6cfa6..959bdf23ab13 100644 --- a/sdk/batch/arm-batch/samples/v8/typescript/src/privateEndpointConnectionUpdateSample.ts +++ b/sdk/batch/arm-batch/samples/v9/typescript/src/privateEndpointConnectionUpdateSample.ts @@ -13,16 +13,20 @@ import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Updates the properties of an existing private endpoint connection. * * @summary Updates the properties of an existing private endpoint connection. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PrivateEndpointConnectionUpdate.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PrivateEndpointConnectionUpdate.json */ async function updatePrivateEndpointConnection() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const privateEndpointConnectionName = "testprivateEndpointConnection5.24d6b4b5-e65c-4330-bbe9-3a290d62f8e0"; @@ -43,4 +47,8 @@ async function updatePrivateEndpointConnection() { console.log(result); } -updatePrivateEndpointConnection().catch(console.error); +async function main() { + updatePrivateEndpointConnection(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/typescript/src/privateLinkResourceGetSample.ts b/sdk/batch/arm-batch/samples/v9/typescript/src/privateLinkResourceGetSample.ts similarity index 74% rename from sdk/batch/arm-batch/samples/v8/typescript/src/privateLinkResourceGetSample.ts rename to sdk/batch/arm-batch/samples/v9/typescript/src/privateLinkResourceGetSample.ts index 7ec37fe27f94..f22c4d5ee6a3 100644 --- a/sdk/batch/arm-batch/samples/v8/typescript/src/privateLinkResourceGetSample.ts +++ b/sdk/batch/arm-batch/samples/v9/typescript/src/privateLinkResourceGetSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets information about the specified private link resource. * * @summary Gets information about the specified private link resource. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PrivateLinkResourceGet.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PrivateLinkResourceGet.json */ async function getPrivateLinkResource() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const privateLinkResourceName = "batchAccount"; const credential = new DefaultAzureCredential(); @@ -32,4 +36,8 @@ async function getPrivateLinkResource() { console.log(result); } -getPrivateLinkResource().catch(console.error); +async function main() { + getPrivateLinkResource(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/typescript/src/privateLinkResourceListByBatchAccountSample.ts b/sdk/batch/arm-batch/samples/v9/typescript/src/privateLinkResourceListByBatchAccountSample.ts similarity index 74% rename from sdk/batch/arm-batch/samples/v8/typescript/src/privateLinkResourceListByBatchAccountSample.ts rename to sdk/batch/arm-batch/samples/v9/typescript/src/privateLinkResourceListByBatchAccountSample.ts index 438d73224653..09a352e623ba 100644 --- a/sdk/batch/arm-batch/samples/v8/typescript/src/privateLinkResourceListByBatchAccountSample.ts +++ b/sdk/batch/arm-batch/samples/v9/typescript/src/privateLinkResourceListByBatchAccountSample.ts @@ -10,16 +10,20 @@ // Licensed under the MIT License. import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists all of the private link resources in the specified account. * * @summary Lists all of the private link resources in the specified account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2022-10-01/examples/PrivateLinkResourcesList.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/PrivateLinkResourcesList.json */ async function listPrivateLinkResource() { - const subscriptionId = "subid"; - const resourceGroupName = "default-azurebatch-japaneast"; + const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; + const resourceGroupName = + process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const accountName = "sampleacct"; const credential = new DefaultAzureCredential(); const client = new BatchManagementClient(credential, subscriptionId); @@ -33,4 +37,8 @@ async function listPrivateLinkResource() { console.log(resArray); } -listPrivateLinkResource().catch(console.error); +async function main() { + listPrivateLinkResource(); +} + +main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v8/typescript/tsconfig.json b/sdk/batch/arm-batch/samples/v9/typescript/tsconfig.json similarity index 92% rename from sdk/batch/arm-batch/samples/v8/typescript/tsconfig.json rename to sdk/batch/arm-batch/samples/v9/typescript/tsconfig.json index 416c2dd82e00..e26ce2a6d8f7 100644 --- a/sdk/batch/arm-batch/samples/v8/typescript/tsconfig.json +++ b/sdk/batch/arm-batch/samples/v9/typescript/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "target": "ES2018", + "target": "ES2020", "module": "commonjs", "moduleResolution": "node", "resolveJsonModule": true, diff --git a/sdk/batch/arm-batch/src/batchManagementClient.ts b/sdk/batch/arm-batch/src/batchManagementClient.ts index 18998ece4889..f8ac9c0268ef 100644 --- a/sdk/batch/arm-batch/src/batchManagementClient.ts +++ b/sdk/batch/arm-batch/src/batchManagementClient.ts @@ -71,7 +71,7 @@ export class BatchManagementClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-batch/8.0.1`; + const packageDetails = `azsdk-js-arm-batch/9.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -124,7 +124,7 @@ export class BatchManagementClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2022-10-01"; + this.apiVersion = options.apiVersion || "2023-05-01"; this.batchAccountOperations = new BatchAccountOperationsImpl(this); this.applicationPackageOperations = new ApplicationPackageOperationsImpl( this diff --git a/sdk/batch/arm-batch/src/lroImpl.ts b/sdk/batch/arm-batch/src/lroImpl.ts index 518d5f053b4e..dd803cd5e28c 100644 --- a/sdk/batch/arm-batch/src/lroImpl.ts +++ b/sdk/batch/arm-batch/src/lroImpl.ts @@ -6,29 +6,37 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { AbortSignalLike } from "@azure/abort-controller"; import { LongRunningOperation, LroResponse } from "@azure/core-lro"; -export class LroImpl implements LongRunningOperation { - constructor( - private sendOperationFn: (args: any, spec: any) => Promise>, - private args: Record, - private spec: { - readonly requestBody?: unknown; - readonly path?: string; - readonly httpMethod: string; - } & Record, - public requestPath: string = spec.path!, - public requestMethod: string = spec.httpMethod - ) {} - public async sendInitialRequest(): Promise> { - return this.sendOperationFn(this.args, this.spec); - } - public async sendPollRequest(path: string): Promise> { - const { requestBody, ...restSpec } = this.spec; - return this.sendOperationFn(this.args, { - ...restSpec, - path, - httpMethod: "GET" - }); - } +export function createLroSpec(inputs: { + sendOperationFn: (args: any, spec: any) => Promise>; + args: Record; + spec: { + readonly requestBody?: unknown; + readonly path?: string; + readonly httpMethod: string; + } & Record; +}): LongRunningOperation { + const { args, spec, sendOperationFn } = inputs; + return { + requestMethod: spec.httpMethod, + requestPath: spec.path!, + sendInitialRequest: () => sendOperationFn(args, spec), + sendPollRequest: ( + path: string, + options?: { abortSignal?: AbortSignalLike } + ) => { + const { requestBody, ...restSpec } = spec; + return sendOperationFn(args, { + ...restSpec, + httpMethod: "GET", + path, + abortSignal: options?.abortSignal + }); + } + }; } diff --git a/sdk/batch/arm-batch/src/models/index.ts b/sdk/batch/arm-batch/src/models/index.ts index 885e04242bd8..300951c43e4f 100644 --- a/sdk/batch/arm-batch/src/models/index.ts +++ b/sdk/batch/arm-batch/src/models/index.ts @@ -91,7 +91,7 @@ export interface EncryptionProperties { /** KeyVault configuration when using an encryption KeySource of Microsoft.KeyVault. */ export interface KeyVaultProperties { /** - * Full path to the versioned secret. Example https://mykeyvault.vault.azure.net/keys/testkey/6e34a81fef704045975661e297a4c053. To be usable the following prerequisites must be met: + * Full path to the secret with or without version. Example https://mykeyvault.vault.azure.net/keys/testkey/6e34a81fef704045975661e297a4c053. or https://mykeyvault.vault.azure.net/keys/testkey. To be usable the following prerequisites must be met: * * The Batch Account has a System Assigned identity * The account identity has been granted Key/Get, Key/Unwrap and Key/Wrap permissions @@ -582,7 +582,7 @@ export interface DataDisk { /** The configuration for container-enabled pools. */ export interface ContainerConfiguration { /** The container technology to be used. */ - type: "DockerCompatible"; + type: ContainerType; /** This is the full image reference, as would be specified to "docker pull". An image will be sourced from the default Docker registry unless the image is fully qualified with an alternative registry. */ containerImageNames?: string[]; /** If any images must be downloaded from a private registry which requires credentials, then those credentials must be provided here. */ @@ -625,6 +625,8 @@ export interface VMExtension { typeHandlerVersion?: string; /** Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. */ autoUpgradeMinorVersion?: boolean; + /** Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available. */ + enableAutomaticUpgrade?: boolean; /** JSON formatted public settings for the extension. */ settings?: Record; /** The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. */ @@ -703,6 +705,8 @@ export interface NetworkConfiguration { endpointConfiguration?: PoolEndpointConfiguration; /** This property is only supported on Pools with the virtualMachineConfiguration property. */ publicIPAddressConfiguration?: PublicIPAddressConfiguration; + /** Accelerated networking enables single root I/O virtualization (SR-IOV) to a VM, which may lead to improved networking performance. For more details, see: https://learn.microsoft.com/azure/virtual-network/accelerated-networking-overview. */ + enableAcceleratedNetworking?: boolean; } /** The endpoint configuration for a pool. */ @@ -1504,6 +1508,23 @@ export interface PoolStopResizeHeaders { eTag?: string; } +/** Known values of {@link ContainerType} that the service accepts. */ +export enum KnownContainerType { + /** A Docker compatible container technology will be used to launch the containers. */ + DockerCompatible = "DockerCompatible", + /** A CRI based technology will be used to launch the containers. */ + CriCompatible = "CriCompatible" +} + +/** + * Defines values for ContainerType. \ + * {@link KnownContainerType} can be used interchangeably with ContainerType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **DockerCompatible**: A Docker compatible container technology will be used to launch the containers. \ + * **CriCompatible**: A CRI based technology will be used to launch the containers. + */ +export type ContainerType = string; /** Defines values for AutoStorageAuthenticationMode. */ export type AutoStorageAuthenticationMode = | "StorageKeys" @@ -1763,10 +1784,7 @@ export type ApplicationPackageListResponse = ListApplicationPackagesResult; /** Optional parameters. */ export interface ApplicationPackageListNextOptionalParams - extends coreClient.OperationOptions { - /** The maximum number of items to return in the response. */ - maxresults?: number; -} + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type ApplicationPackageListNextResponse = ListApplicationPackagesResult; @@ -1811,10 +1829,7 @@ export type ApplicationListResponse = ListApplicationsResult; /** Optional parameters. */ export interface ApplicationListNextOptionalParams - extends coreClient.OperationOptions { - /** The maximum number of items to return in the response. */ - maxresults?: number; -} + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type ApplicationListNextResponse = ListApplicationsResult; @@ -1859,24 +1874,14 @@ export type LocationCheckNameAvailabilityResponse = CheckNameAvailabilityResult; /** Optional parameters. */ export interface LocationListSupportedVirtualMachineSkusNextOptionalParams - extends coreClient.OperationOptions { - /** The maximum number of items to return in the response. */ - maxresults?: number; - /** OData filter expression. Valid properties for filtering are "familyName". */ - filter?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listSupportedVirtualMachineSkusNext operation. */ export type LocationListSupportedVirtualMachineSkusNextResponse = SupportedSkusResult; /** Optional parameters. */ export interface LocationListSupportedCloudServiceSkusNextOptionalParams - extends coreClient.OperationOptions { - /** The maximum number of items to return in the response. */ - maxresults?: number; - /** OData filter expression. Valid properties for filtering are "familyName". */ - filter?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listSupportedCloudServiceSkusNext operation. */ export type LocationListSupportedCloudServiceSkusNextResponse = SupportedSkusResult; @@ -1957,14 +1962,7 @@ export type CertificateCancelDeletionResponse = CertificateCancelDeletionHeaders /** Optional parameters. */ export interface CertificateListByBatchAccountNextOptionalParams - extends coreClient.OperationOptions { - /** The maximum number of items to return in the response. */ - maxresults?: number; - /** OData filter expression. Valid properties for filtering are "properties/provisioningState", "properties/provisioningStateTransitionTime", "name". */ - filter?: string; - /** Comma separated list of properties that should be returned. e.g. "properties/provisioningState". Only top level properties under properties/ are valid for selection. */ - select?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listByBatchAccountNext operation. */ export type CertificateListByBatchAccountNextResponse = ListCertificatesResult; @@ -1988,10 +1986,7 @@ export type PrivateLinkResourceGetResponse = PrivateLinkResource; /** Optional parameters. */ export interface PrivateLinkResourceListByBatchAccountNextOptionalParams - extends coreClient.OperationOptions { - /** The maximum number of items to return in the response. */ - maxresults?: number; -} + extends coreClient.OperationOptions {} /** Contains response data for the listByBatchAccountNext operation. */ export type PrivateLinkResourceListByBatchAccountNextResponse = ListPrivateLinkResourcesResult; @@ -2041,10 +2036,7 @@ export type PrivateEndpointConnectionDeleteResponse = PrivateEndpointConnectionD /** Optional parameters. */ export interface PrivateEndpointConnectionListByBatchAccountNextOptionalParams - extends coreClient.OperationOptions { - /** The maximum number of items to return in the response. */ - maxresults?: number; -} + extends coreClient.OperationOptions {} /** Contains response data for the listByBatchAccountNext operation. */ export type PrivateEndpointConnectionListByBatchAccountNextResponse = ListPrivateEndpointConnectionsResult; @@ -2127,28 +2119,7 @@ export type PoolStopResizeResponse = PoolStopResizeHeaders & Pool; /** Optional parameters. */ export interface PoolListByBatchAccountNextOptionalParams - extends coreClient.OperationOptions { - /** The maximum number of items to return in the response. */ - maxresults?: number; - /** - * OData filter expression. Valid properties for filtering are: - * - * name - * properties/allocationState - * properties/allocationStateTransitionTime - * properties/creationTime - * properties/provisioningState - * properties/provisioningStateTransitionTime - * properties/lastModified - * properties/vmSize - * properties/interNodeCommunication - * properties/scaleSettings/autoScale - * properties/scaleSettings/fixedScale - */ - filter?: string; - /** Comma separated list of properties that should be returned. e.g. "properties/provisioningState". Only top level properties under properties/ are valid for selection. */ - select?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listByBatchAccountNext operation. */ export type PoolListByBatchAccountNextResponse = ListPoolsResult; diff --git a/sdk/batch/arm-batch/src/models/mappers.ts b/sdk/batch/arm-batch/src/models/mappers.ts index fee562ba7f20..c744e4c83e18 100644 --- a/sdk/batch/arm-batch/src/models/mappers.ts +++ b/sdk/batch/arm-batch/src/models/mappers.ts @@ -1449,9 +1449,8 @@ export const ContainerConfiguration: coreClient.CompositeMapper = { className: "ContainerConfiguration", modelProperties: { type: { - defaultValue: "DockerCompatible", - isConstant: true, serializedName: "type", + required: true, type: { name: "String" } @@ -1592,6 +1591,12 @@ export const VMExtension: coreClient.CompositeMapper = { name: "Boolean" } }, + enableAutomaticUpgrade: { + serializedName: "enableAutomaticUpgrade", + type: { + name: "Boolean" + } + }, settings: { serializedName: "settings", type: { @@ -1833,6 +1838,12 @@ export const NetworkConfiguration: coreClient.CompositeMapper = { name: "Composite", className: "PublicIPAddressConfiguration" } + }, + enableAcceleratedNetworking: { + serializedName: "enableAcceleratedNetworking", + type: { + name: "Boolean" + } } } } diff --git a/sdk/batch/arm-batch/src/models/parameters.ts b/sdk/batch/arm-batch/src/models/parameters.ts index 6d4fb951e538..3be66a149d27 100644 --- a/sdk/batch/arm-batch/src/models/parameters.ts +++ b/sdk/batch/arm-batch/src/models/parameters.ts @@ -95,7 +95,7 @@ export const accountName: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2022-10-01", + defaultValue: "2023-05-01", isConstant: true, serializedName: "api-version", type: { diff --git a/sdk/batch/arm-batch/src/operations/applicationOperations.ts b/sdk/batch/arm-batch/src/operations/applicationOperations.ts index d9a3dd1bbd73..f48191b33b65 100644 --- a/sdk/batch/arm-batch/src/operations/applicationOperations.ts +++ b/sdk/batch/arm-batch/src/operations/applicationOperations.ts @@ -362,7 +362,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion, Parameters.maxresults], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, diff --git a/sdk/batch/arm-batch/src/operations/applicationPackageOperations.ts b/sdk/batch/arm-batch/src/operations/applicationPackageOperations.ts index 0930de862544..7ff1fbc2349c 100644 --- a/sdk/batch/arm-batch/src/operations/applicationPackageOperations.ts +++ b/sdk/batch/arm-batch/src/operations/applicationPackageOperations.ts @@ -410,7 +410,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion, Parameters.maxresults], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, diff --git a/sdk/batch/arm-batch/src/operations/batchAccountOperations.ts b/sdk/batch/arm-batch/src/operations/batchAccountOperations.ts index 82577c79903d..99ba2a797294 100644 --- a/sdk/batch/arm-batch/src/operations/batchAccountOperations.ts +++ b/sdk/batch/arm-batch/src/operations/batchAccountOperations.ts @@ -13,8 +13,12 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { BatchManagementClient } from "../batchManagementClient"; -import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; -import { LroImpl } from "../lroImpl"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; import { BatchAccount, BatchAccountListNextOptionalParams, @@ -380,8 +384,8 @@ export class BatchAccountOperationsImpl implements BatchAccountOperations { parameters: BatchAccountCreateParameters, options?: BatchAccountCreateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, BatchAccountCreateResponse > > { @@ -391,7 +395,7 @@ export class BatchAccountOperationsImpl implements BatchAccountOperations { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -424,15 +428,18 @@ export class BatchAccountOperationsImpl implements BatchAccountOperations { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, accountName, parameters, options }, - createOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, accountName, parameters, options }, + spec: createOperationSpec + }); + const poller = await createHttpPoller< + BatchAccountCreateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "location" + resourceLocationConfig: "location" }); await poller.poll(); return poller; @@ -493,14 +500,14 @@ export class BatchAccountOperationsImpl implements BatchAccountOperations { resourceGroupName: string, accountName: string, options?: BatchAccountDeleteOptionalParams - ): Promise, void>> { + ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -533,15 +540,15 @@ export class BatchAccountOperationsImpl implements BatchAccountOperations { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, accountName, options }, - deleteOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, accountName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "location" + resourceLocationConfig: "location" }); await poller.poll(); return poller; @@ -1084,7 +1091,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -1104,7 +1110,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, @@ -1125,7 +1130,6 @@ const listDetectorsNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, @@ -1147,7 +1151,6 @@ const listOutboundNetworkDependenciesEndpointsNextOperationSpec: coreClient.Oper bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, diff --git a/sdk/batch/arm-batch/src/operations/certificateOperations.ts b/sdk/batch/arm-batch/src/operations/certificateOperations.ts index 94018e7cd0a7..faf4b1e9145a 100644 --- a/sdk/batch/arm-batch/src/operations/certificateOperations.ts +++ b/sdk/batch/arm-batch/src/operations/certificateOperations.ts @@ -13,8 +13,12 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { BatchManagementClient } from "../batchManagementClient"; -import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; -import { LroImpl } from "../lroImpl"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; import { Certificate, CertificateListByBatchAccountNextOptionalParams, @@ -217,14 +221,14 @@ export class CertificateOperationsImpl implements CertificateOperations { accountName: string, certificateName: string, options?: CertificateDeleteOptionalParams - ): Promise, void>> { + ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -257,15 +261,15 @@ export class CertificateOperationsImpl implements CertificateOperations { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, accountName, certificateName, options }, - deleteOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, accountName, certificateName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "location" + resourceLocationConfig: "location" }); await poller.poll(); return poller; @@ -543,12 +547,6 @@ const listByBatchAccountNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [ - Parameters.apiVersion, - Parameters.maxresults, - Parameters.filter, - Parameters.select - ], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, diff --git a/sdk/batch/arm-batch/src/operations/location.ts b/sdk/batch/arm-batch/src/operations/location.ts index 168b47494ab4..2efa1d7f3919 100644 --- a/sdk/batch/arm-batch/src/operations/location.ts +++ b/sdk/batch/arm-batch/src/operations/location.ts @@ -396,11 +396,6 @@ const listSupportedVirtualMachineSkusNextOperationSpec: coreClient.OperationSpec bodyMapper: Mappers.CloudError } }, - queryParameters: [ - Parameters.apiVersion, - Parameters.maxresults, - Parameters.filter - ], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -421,11 +416,6 @@ const listSupportedCloudServiceSkusNextOperationSpec: coreClient.OperationSpec = bodyMapper: Mappers.CloudError } }, - queryParameters: [ - Parameters.apiVersion, - Parameters.maxresults, - Parameters.filter - ], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/batch/arm-batch/src/operations/operations.ts b/sdk/batch/arm-batch/src/operations/operations.ts index 694c20337296..517211c24fa2 100644 --- a/sdk/batch/arm-batch/src/operations/operations.ts +++ b/sdk/batch/arm-batch/src/operations/operations.ts @@ -143,7 +143,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.nextLink], headerParameters: [Parameters.accept], serializer diff --git a/sdk/batch/arm-batch/src/operations/poolOperations.ts b/sdk/batch/arm-batch/src/operations/poolOperations.ts index 810bfda2eb33..f4338b80c41c 100644 --- a/sdk/batch/arm-batch/src/operations/poolOperations.ts +++ b/sdk/batch/arm-batch/src/operations/poolOperations.ts @@ -13,8 +13,12 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { BatchManagementClient } from "../batchManagementClient"; -import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; -import { LroImpl } from "../lroImpl"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; import { Pool, PoolListByBatchAccountNextOptionalParams, @@ -203,14 +207,14 @@ export class PoolOperationsImpl implements PoolOperations { accountName: string, poolName: string, options?: PoolDeleteOptionalParams - ): Promise, void>> { + ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -243,15 +247,15 @@ export class PoolOperationsImpl implements PoolOperations { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, accountName, poolName, options }, - deleteOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, accountName, poolName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "location" + resourceLocationConfig: "location" }); await poller.poll(); return poller; @@ -558,12 +562,6 @@ const listByBatchAccountNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [ - Parameters.apiVersion, - Parameters.maxresults, - Parameters.filter, - Parameters.select - ], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, diff --git a/sdk/batch/arm-batch/src/operations/privateEndpointConnectionOperations.ts b/sdk/batch/arm-batch/src/operations/privateEndpointConnectionOperations.ts index cb891f22460a..9b9a50fda5b7 100644 --- a/sdk/batch/arm-batch/src/operations/privateEndpointConnectionOperations.ts +++ b/sdk/batch/arm-batch/src/operations/privateEndpointConnectionOperations.ts @@ -13,8 +13,12 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { BatchManagementClient } from "../batchManagementClient"; -import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; -import { LroImpl } from "../lroImpl"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; import { PrivateEndpointConnection, PrivateEndpointConnectionListByBatchAccountNextOptionalParams, @@ -186,8 +190,8 @@ export class PrivateEndpointConnectionOperationsImpl parameters: PrivateEndpointConnection, options?: PrivateEndpointConnectionUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, PrivateEndpointConnectionUpdateResponse > > { @@ -197,7 +201,7 @@ export class PrivateEndpointConnectionOperationsImpl ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -230,21 +234,24 @@ export class PrivateEndpointConnectionOperationsImpl }; }; - const lro = new LroImpl( - sendOperation, - { + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, accountName, privateEndpointConnectionName, parameters, options }, - updateOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + spec: updateOperationSpec + }); + const poller = await createHttpPoller< + PrivateEndpointConnectionUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "azure-async-operation" }); await poller.poll(); return poller; @@ -291,8 +298,8 @@ export class PrivateEndpointConnectionOperationsImpl privateEndpointConnectionName: string, options?: PrivateEndpointConnectionDeleteOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, PrivateEndpointConnectionDeleteResponse > > { @@ -302,7 +309,7 @@ export class PrivateEndpointConnectionOperationsImpl ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -335,20 +342,23 @@ export class PrivateEndpointConnectionOperationsImpl }; }; - const lro = new LroImpl( - sendOperation, - { + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, accountName, privateEndpointConnectionName, options }, - deleteOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller< + PrivateEndpointConnectionDeleteResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "azure-async-operation" }); await poller.poll(); return poller; @@ -525,7 +535,6 @@ const listByBatchAccountNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion, Parameters.maxresults], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, diff --git a/sdk/batch/arm-batch/src/operations/privateLinkResourceOperations.ts b/sdk/batch/arm-batch/src/operations/privateLinkResourceOperations.ts index 6f24c4dba4b6..b5bde5b736b5 100644 --- a/sdk/batch/arm-batch/src/operations/privateLinkResourceOperations.ts +++ b/sdk/batch/arm-batch/src/operations/privateLinkResourceOperations.ts @@ -236,7 +236,6 @@ const listByBatchAccountNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion, Parameters.maxresults], urlParameters: [ Parameters.$host, Parameters.resourceGroupName, diff --git a/sdk/batch/arm-batch/src/operationsInterfaces/batchAccountOperations.ts b/sdk/batch/arm-batch/src/operationsInterfaces/batchAccountOperations.ts index 24c1be7d5026..cf1258fa85b1 100644 --- a/sdk/batch/arm-batch/src/operationsInterfaces/batchAccountOperations.ts +++ b/sdk/batch/arm-batch/src/operationsInterfaces/batchAccountOperations.ts @@ -7,7 +7,7 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { BatchAccount, BatchAccountListOptionalParams, @@ -98,8 +98,8 @@ export interface BatchAccountOperations { parameters: BatchAccountCreateParameters, options?: BatchAccountCreateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, BatchAccountCreateResponse > >; @@ -143,7 +143,7 @@ export interface BatchAccountOperations { resourceGroupName: string, accountName: string, options?: BatchAccountDeleteOptionalParams - ): Promise, void>>; + ): Promise, void>>; /** * Deletes the specified Batch account. * @param resourceGroupName The name of the resource group that contains the Batch account. diff --git a/sdk/batch/arm-batch/src/operationsInterfaces/certificateOperations.ts b/sdk/batch/arm-batch/src/operationsInterfaces/certificateOperations.ts index 474fff5ac174..0d1dcf9ae7d9 100644 --- a/sdk/batch/arm-batch/src/operationsInterfaces/certificateOperations.ts +++ b/sdk/batch/arm-batch/src/operationsInterfaces/certificateOperations.ts @@ -7,7 +7,7 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { Certificate, CertificateListByBatchAccountOptionalParams, @@ -93,7 +93,7 @@ export interface CertificateOperations { accountName: string, certificateName: string, options?: CertificateDeleteOptionalParams - ): Promise, void>>; + ): Promise, void>>; /** * Warning: This operation is deprecated and will be removed after February, 2024. Please use the * [Azure KeyVault diff --git a/sdk/batch/arm-batch/src/operationsInterfaces/poolOperations.ts b/sdk/batch/arm-batch/src/operationsInterfaces/poolOperations.ts index ed2bfa759623..0949ed1456a7 100644 --- a/sdk/batch/arm-batch/src/operationsInterfaces/poolOperations.ts +++ b/sdk/batch/arm-batch/src/operationsInterfaces/poolOperations.ts @@ -7,7 +7,7 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { Pool, PoolListByBatchAccountOptionalParams, @@ -81,7 +81,7 @@ export interface PoolOperations { accountName: string, poolName: string, options?: PoolDeleteOptionalParams - ): Promise, void>>; + ): Promise, void>>; /** * Deletes the specified pool. * @param resourceGroupName The name of the resource group that contains the Batch account. diff --git a/sdk/batch/arm-batch/src/operationsInterfaces/privateEndpointConnectionOperations.ts b/sdk/batch/arm-batch/src/operationsInterfaces/privateEndpointConnectionOperations.ts index 7157f6bea448..04bd4b2bf8db 100644 --- a/sdk/batch/arm-batch/src/operationsInterfaces/privateEndpointConnectionOperations.ts +++ b/sdk/batch/arm-batch/src/operationsInterfaces/privateEndpointConnectionOperations.ts @@ -7,7 +7,7 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { PrivateEndpointConnection, PrivateEndpointConnectionListByBatchAccountOptionalParams, @@ -64,8 +64,8 @@ export interface PrivateEndpointConnectionOperations { parameters: PrivateEndpointConnection, options?: PrivateEndpointConnectionUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, PrivateEndpointConnectionUpdateResponse > >; @@ -100,8 +100,8 @@ export interface PrivateEndpointConnectionOperations { privateEndpointConnectionName: string, options?: PrivateEndpointConnectionDeleteOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, PrivateEndpointConnectionDeleteResponse > >; diff --git a/sdk/batch/arm-batch/src/pagingHelper.ts b/sdk/batch/arm-batch/src/pagingHelper.ts index d85fc13bce1e..269a2b9814b5 100644 --- a/sdk/batch/arm-batch/src/pagingHelper.ts +++ b/sdk/batch/arm-batch/src/pagingHelper.ts @@ -13,11 +13,11 @@ export interface PageInfo { const pageMap = new WeakMap(); /** - * Given a result page from a pageable operation, returns a - * continuation token that can be used to begin paging from + * Given the last `.value` produced by the `byPage` iterator, + * returns a continuation token that can be used to begin paging from * that point later. - * @param page A result object from calling .byPage() on a paged operation. - * @returns The continuation token that can be passed into byPage(). + * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator. + * @returns The continuation token that can be passed into byPage() during future calls. */ export function getContinuationToken(page: unknown): string | undefined { if (typeof page !== "object" || page === null) { diff --git a/sdk/batch/arm-batch/test/batch_examples.ts b/sdk/batch/arm-batch/test/batch_examples.ts index 6cad66ecd8db..b95c60fd6867 100644 --- a/sdk/batch/arm-batch/test/batch_examples.ts +++ b/sdk/batch/arm-batch/test/batch_examples.ts @@ -98,7 +98,7 @@ describe("Batch test", () => { }; it("batchAccountOperations create test", async function () { - //await storageAccounts_beginCreateAndWait(); + await storageAccounts_beginCreateAndWait(); const res = await client.batchAccountOperations.beginCreateAndWait(resourceGroup, accountName, { location: location, autoStorage: { @@ -318,5 +318,6 @@ describe("Batch test", () => { resArray.push(item); } assert.equal(resArray.length, 0); + const res1 = await storage_client.storageAccounts.beginDeleteAndWait(resourceGroup, storageaccountName, testPollingOptions); }); }); From 35e00dac8f20db8bd2d62b9db851ad487de8ef68 Mon Sep 17 00:00:00 2001 From: kazrael2119 <98569699+kazrael2119@users.noreply.github.com> Date: Mon, 3 Jul 2023 15:55:55 +0800 Subject: [PATCH 2/3] update files --- sdk/batch/arm-batch/assets.json | 2 +- sdk/batch/arm-batch/test/batch_examples.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/batch/arm-batch/assets.json b/sdk/batch/arm-batch/assets.json index 8e5ef8c35f2e..ec56cbbb2888 100644 --- a/sdk/batch/arm-batch/assets.json +++ b/sdk/batch/arm-batch/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "js", "TagPrefix": "js/batch/arm-batch", - "Tag": "js/batch/arm-batch_c4e09c3bab" + "Tag": "js/batch/arm-batch_beed3813b7" } diff --git a/sdk/batch/arm-batch/test/batch_examples.ts b/sdk/batch/arm-batch/test/batch_examples.ts index b95c60fd6867..173f6fa0cc0c 100644 --- a/sdk/batch/arm-batch/test/batch_examples.ts +++ b/sdk/batch/arm-batch/test/batch_examples.ts @@ -318,6 +318,6 @@ describe("Batch test", () => { resArray.push(item); } assert.equal(resArray.length, 0); - const res1 = await storage_client.storageAccounts.beginDeleteAndWait(resourceGroup, storageaccountName, testPollingOptions); + const res1 = await storage_client.storageAccounts.delete(resourceGroup, storageaccountName); }); }); From 43979e208f4bebe9d19236c0089930de244256b7 Mon Sep 17 00:00:00 2001 From: kazrael2119 <98569699+kazrael2119@users.noreply.github.com> Date: Mon, 3 Jul 2023 16:14:22 +0800 Subject: [PATCH 3/3] update file --- ...chAccountListOutboundNetworkDependenciesEndpointsSample.ts | 4 ++-- sdk/batch/arm-batch/samples/v9/javascript/README.md | 2 +- ...chAccountListOutboundNetworkDependenciesEndpointsSample.js | 4 ++-- sdk/batch/arm-batch/samples/v9/typescript/README.md | 2 +- ...chAccountListOutboundNetworkDependenciesEndpointsSample.ts | 4 ++-- sdk/batch/arm-batch/src/operations/batchAccountOperations.ts | 4 ++-- .../src/operationsInterfaces/batchAccountOperations.ts | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/sdk/batch/arm-batch/samples-dev/batchAccountListOutboundNetworkDependenciesEndpointsSample.ts b/sdk/batch/arm-batch/samples-dev/batchAccountListOutboundNetworkDependenciesEndpointsSample.ts index c2aa48bbdfcf..6c2d46991cb9 100644 --- a/sdk/batch/arm-batch/samples-dev/batchAccountListOutboundNetworkDependenciesEndpointsSample.ts +++ b/sdk/batch/arm-batch/samples-dev/batchAccountListOutboundNetworkDependenciesEndpointsSample.ts @@ -15,9 +15,9 @@ import * as dotenv from "dotenv"; dotenv.config(); /** - * This sample demonstrates how to Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://docs.microsoft.com/en-us/azure/batch/batch-virtual-network. + * This sample demonstrates how to Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://docs.microsoft.com/azure/batch/batch-virtual-network. * - * @summary Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://docs.microsoft.com/en-us/azure/batch/batch-virtual-network. + * @summary Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://docs.microsoft.com/azure/batch/batch-virtual-network. * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountListOutboundNetworkDependenciesEndpoints.json */ async function listOutboundNetworkDependencies() { diff --git a/sdk/batch/arm-batch/samples/v9/javascript/README.md b/sdk/batch/arm-batch/samples/v9/javascript/README.md index 546280fd1ac9..e466ad9f10f1 100644 --- a/sdk/batch/arm-batch/samples/v9/javascript/README.md +++ b/sdk/batch/arm-batch/samples/v9/javascript/README.md @@ -21,7 +21,7 @@ These sample programs show how to use the JavaScript client libraries for in som | [batchAccountGetSample.js][batchaccountgetsample] | Gets information about the specified Batch account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountGet.json | | [batchAccountListByResourceGroupSample.js][batchaccountlistbyresourcegroupsample] | Gets information about the Batch accounts associated with the specified resource group. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountListByResourceGroup.json | | [batchAccountListDetectorsSample.js][batchaccountlistdetectorssample] | Gets information about the detectors available for a given Batch account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/DetectorList.json | -| [batchAccountListOutboundNetworkDependenciesEndpointsSample.js][batchaccountlistoutboundnetworkdependenciesendpointssample] | Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://docs.microsoft.com/en-us/azure/batch/batch-virtual-network. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountListOutboundNetworkDependenciesEndpoints.json | +| [batchAccountListOutboundNetworkDependenciesEndpointsSample.js][batchaccountlistoutboundnetworkdependenciesendpointssample] | Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://docs.microsoft.com/azure/batch/batch-virtual-network. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountListOutboundNetworkDependenciesEndpoints.json | | [batchAccountListSample.js][batchaccountlistsample] | Gets information about the Batch accounts associated with the subscription. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountList.json | | [batchAccountRegenerateKeySample.js][batchaccountregeneratekeysample] | This operation applies only to Batch accounts with allowedAuthenticationModes containing 'SharedKey'. If the Batch account doesn't contain 'SharedKey' in its allowedAuthenticationMode, clients cannot use shared keys to authenticate, and must use another allowedAuthenticationModes instead. In this case, regenerating the keys will fail. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountRegenerateKey.json | | [batchAccountSynchronizeAutoStorageKeysSample.js][batchaccountsynchronizeautostoragekeyssample] | Synchronizes access keys for the auto-storage account configured for the specified Batch account, only if storage key authentication is being used. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountSynchronizeAutoStorageKeys.json | diff --git a/sdk/batch/arm-batch/samples/v9/javascript/batchAccountListOutboundNetworkDependenciesEndpointsSample.js b/sdk/batch/arm-batch/samples/v9/javascript/batchAccountListOutboundNetworkDependenciesEndpointsSample.js index e2f01bdf71b9..0c9246b6bd04 100644 --- a/sdk/batch/arm-batch/samples/v9/javascript/batchAccountListOutboundNetworkDependenciesEndpointsSample.js +++ b/sdk/batch/arm-batch/samples/v9/javascript/batchAccountListOutboundNetworkDependenciesEndpointsSample.js @@ -13,9 +13,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); require("dotenv").config(); /** - * This sample demonstrates how to Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://docs.microsoft.com/en-us/azure/batch/batch-virtual-network. + * This sample demonstrates how to Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://docs.microsoft.com/azure/batch/batch-virtual-network. * - * @summary Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://docs.microsoft.com/en-us/azure/batch/batch-virtual-network. + * @summary Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://docs.microsoft.com/azure/batch/batch-virtual-network. * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountListOutboundNetworkDependenciesEndpoints.json */ async function listOutboundNetworkDependencies() { diff --git a/sdk/batch/arm-batch/samples/v9/typescript/README.md b/sdk/batch/arm-batch/samples/v9/typescript/README.md index 18a4fdc8c850..b241b4d5cf8c 100644 --- a/sdk/batch/arm-batch/samples/v9/typescript/README.md +++ b/sdk/batch/arm-batch/samples/v9/typescript/README.md @@ -21,7 +21,7 @@ These sample programs show how to use the TypeScript client libraries for in som | [batchAccountGetSample.ts][batchaccountgetsample] | Gets information about the specified Batch account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountGet.json | | [batchAccountListByResourceGroupSample.ts][batchaccountlistbyresourcegroupsample] | Gets information about the Batch accounts associated with the specified resource group. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountListByResourceGroup.json | | [batchAccountListDetectorsSample.ts][batchaccountlistdetectorssample] | Gets information about the detectors available for a given Batch account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/DetectorList.json | -| [batchAccountListOutboundNetworkDependenciesEndpointsSample.ts][batchaccountlistoutboundnetworkdependenciesendpointssample] | Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://docs.microsoft.com/en-us/azure/batch/batch-virtual-network. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountListOutboundNetworkDependenciesEndpoints.json | +| [batchAccountListOutboundNetworkDependenciesEndpointsSample.ts][batchaccountlistoutboundnetworkdependenciesendpointssample] | Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://docs.microsoft.com/azure/batch/batch-virtual-network. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountListOutboundNetworkDependenciesEndpoints.json | | [batchAccountListSample.ts][batchaccountlistsample] | Gets information about the Batch accounts associated with the subscription. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountList.json | | [batchAccountRegenerateKeySample.ts][batchaccountregeneratekeysample] | This operation applies only to Batch accounts with allowedAuthenticationModes containing 'SharedKey'. If the Batch account doesn't contain 'SharedKey' in its allowedAuthenticationMode, clients cannot use shared keys to authenticate, and must use another allowedAuthenticationModes instead. In this case, regenerating the keys will fail. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountRegenerateKey.json | | [batchAccountSynchronizeAutoStorageKeysSample.ts][batchaccountsynchronizeautostoragekeyssample] | Synchronizes access keys for the auto-storage account configured for the specified Batch account, only if storage key authentication is being used. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountSynchronizeAutoStorageKeys.json | diff --git a/sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountListOutboundNetworkDependenciesEndpointsSample.ts b/sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountListOutboundNetworkDependenciesEndpointsSample.ts index c2aa48bbdfcf..6c2d46991cb9 100644 --- a/sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountListOutboundNetworkDependenciesEndpointsSample.ts +++ b/sdk/batch/arm-batch/samples/v9/typescript/src/batchAccountListOutboundNetworkDependenciesEndpointsSample.ts @@ -15,9 +15,9 @@ import * as dotenv from "dotenv"; dotenv.config(); /** - * This sample demonstrates how to Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://docs.microsoft.com/en-us/azure/batch/batch-virtual-network. + * This sample demonstrates how to Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://docs.microsoft.com/azure/batch/batch-virtual-network. * - * @summary Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://docs.microsoft.com/en-us/azure/batch/batch-virtual-network. + * @summary Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://docs.microsoft.com/azure/batch/batch-virtual-network. * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-05-01/examples/BatchAccountListOutboundNetworkDependenciesEndpoints.json */ async function listOutboundNetworkDependencies() { diff --git a/sdk/batch/arm-batch/src/operations/batchAccountOperations.ts b/sdk/batch/arm-batch/src/operations/batchAccountOperations.ts index 99ba2a797294..212f700e901f 100644 --- a/sdk/batch/arm-batch/src/operations/batchAccountOperations.ts +++ b/sdk/batch/arm-batch/src/operations/batchAccountOperations.ts @@ -284,7 +284,7 @@ export class BatchAccountOperationsImpl implements BatchAccountOperations { * you must make sure your network allows outbound access to these endpoints. Failure to allow access * to these endpoints may cause Batch to mark the affected nodes as unusable. For more information * about creating a pool inside of a virtual network, see - * https://docs.microsoft.com/en-us/azure/batch/batch-virtual-network. + * https://docs.microsoft.com/azure/batch/batch-virtual-network. * @param resourceGroupName The name of the resource group that contains the Batch account. * @param accountName The name of the Batch account. * @param options The options parameters. @@ -717,7 +717,7 @@ export class BatchAccountOperationsImpl implements BatchAccountOperations { * you must make sure your network allows outbound access to these endpoints. Failure to allow access * to these endpoints may cause Batch to mark the affected nodes as unusable. For more information * about creating a pool inside of a virtual network, see - * https://docs.microsoft.com/en-us/azure/batch/batch-virtual-network. + * https://docs.microsoft.com/azure/batch/batch-virtual-network. * @param resourceGroupName The name of the resource group that contains the Batch account. * @param accountName The name of the Batch account. * @param options The options parameters. diff --git a/sdk/batch/arm-batch/src/operationsInterfaces/batchAccountOperations.ts b/sdk/batch/arm-batch/src/operationsInterfaces/batchAccountOperations.ts index cf1258fa85b1..eaf5581f29f0 100644 --- a/sdk/batch/arm-batch/src/operationsInterfaces/batchAccountOperations.ts +++ b/sdk/batch/arm-batch/src/operationsInterfaces/batchAccountOperations.ts @@ -71,7 +71,7 @@ export interface BatchAccountOperations { * you must make sure your network allows outbound access to these endpoints. Failure to allow access * to these endpoints may cause Batch to mark the affected nodes as unusable. For more information * about creating a pool inside of a virtual network, see - * https://docs.microsoft.com/en-us/azure/batch/batch-virtual-network. + * https://docs.microsoft.com/azure/batch/batch-virtual-network. * @param resourceGroupName The name of the resource group that contains the Batch account. * @param accountName The name of the Batch account. * @param options The options parameters.