From d149ae9f925a34b9ba5a3a03aec3aa62779c220d Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Fri, 6 Mar 2026 23:59:54 +0000 Subject: [PATCH] Configurations: 'specification/batch/resource-manager/Microsoft.Batch/Batch/tspconfig.yaml', API Version: 2025-06-01, SDK Release Type: stable, and CommitSHA: '74cc90c49189a079b3cc93fde9c9ad76742f0184' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=5975771 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- sdk/batch/arm-batch/CHANGELOG.md | 221 - sdk/batch/arm-batch/LICENSE | 2 +- sdk/batch/arm-batch/README.md | 28 +- sdk/batch/arm-batch/_meta.json | 8 - sdk/batch/arm-batch/api-extractor.json | 4 +- sdk/batch/arm-batch/eslint.config.mjs | 14 + sdk/batch/arm-batch/metadata.json | 242 + sdk/batch/arm-batch/package.json | 161 +- .../arm-batch/review/arm-batch-node.api.md | 1854 ------- sdk/batch/arm-batch/sample.env | 5 +- .../samples-dev/applicationCreateSample.ts | 35 +- .../samples-dev/applicationDeleteSample.ts | 26 +- .../samples-dev/applicationGetSample.ts | 25 +- .../samples-dev/applicationListSample.ts | 21 +- .../applicationPackageActivateSample.ts | 34 +- .../applicationPackageCreateSample.ts | 30 +- .../applicationPackageDeleteSample.ts | 28 +- .../applicationPackageGetSample.ts | 30 +- .../applicationPackageListSample.ts | 28 +- .../samples-dev/applicationUpdateSample.ts | 35 +- .../samples-dev/batchAccountCreateSample.ts | 156 +- .../samples-dev/batchAccountDeleteSample.ts | 24 +- .../batchAccountGetDetectorSample.ts | 27 +- .../samples-dev/batchAccountGetKeysSample.ts | 20 +- .../samples-dev/batchAccountGetSample.ts | 32 +- .../batchAccountListByResourceGroupSample.ts | 22 +- .../batchAccountListDetectorsSample.ts | 25 +- ...boundNetworkDependenciesEndpointsSample.ts | 25 +- .../samples-dev/batchAccountListSample.ts | 19 +- .../batchAccountRegenerateKeySample.ts | 30 +- ...AccountSynchronizeAutoStorageKeysSample.ts | 25 +- .../samples-dev/batchAccountUpdateSample.ts | 34 +- .../certificateCancelDeletionSample.ts | 38 - .../samples-dev/certificateCreateSample.ts | 97 - .../samples-dev/certificateDeleteSample.ts | 34 - .../samples-dev/certificateGetSample.ts | 56 - .../certificateListByBatchAccountSample.ts | 67 - .../samples-dev/certificateUpdateSample.ts | 40 - .../locationCheckNameAvailabilitySample.ts | 45 +- .../samples-dev/locationGetQuotasSample.ts | 19 +- ...onListSupportedVirtualMachineSkusSample.ts | 20 +- ...SecurityPerimeterGetConfigurationSample.ts | 28 +- ...curityPerimeterListConfigurationsSample.ts | 25 +- ...tyPerimeterReconcileConfigurationSample.ts | 29 +- .../samples-dev/operationsListSample.ts | 19 +- .../arm-batch/samples-dev/poolCreateSample.ts | 1095 ++-- .../arm-batch/samples-dev/poolDeleteSample.ts | 26 +- .../samples-dev/poolDisableAutoScaleSample.ts | 27 +- .../arm-batch/samples-dev/poolGetSample.ts | 99 +- .../poolListByBatchAccountSample.ts | 55 +- .../samples-dev/poolStopResizeSample.ts | 25 +- .../arm-batch/samples-dev/poolUpdateSample.ts | 147 +- .../privateEndpointConnectionDeleteSample.ts | 29 +- .../privateEndpointConnectionGetSample.ts | 28 +- ...pointConnectionListByBatchAccountSample.ts | 25 +- .../privateEndpointConnectionUpdateSample.ts | 42 +- .../privateLinkResourceGetSample.ts | 27 +- ...ateLinkResourceListByBatchAccountSample.ts | 25 +- .../samples/v10/javascript/README.md | 144 - .../v10/javascript/applicationCreateSample.js | 46 - .../v10/javascript/applicationDeleteSample.js | 40 - .../v10/javascript/applicationGetSample.js | 40 - .../v10/javascript/applicationListSample.js | 38 - .../applicationPackageActivateSample.js | 44 - .../applicationPackageCreateSample.js | 42 - .../applicationPackageDeleteSample.js | 42 - .../javascript/applicationPackageGetSample.js | 42 - .../applicationPackageListSample.js | 43 - .../v10/javascript/applicationUpdateSample.js | 46 - .../javascript/batchAccountCreateSample.js | 176 - .../javascript/batchAccountDeleteSample.js | 38 - .../batchAccountGetDetectorSample.js | 40 - .../javascript/batchAccountGetKeysSample.js | 35 - .../v10/javascript/batchAccountGetSample.js | 52 - .../batchAccountListByResourceGroupSample.js | 37 - .../batchAccountListDetectorsSample.js | 41 - ...boundNetworkDependenciesEndpointsSample.js | 41 - .../v10/javascript/batchAccountListSample.js | 36 - .../batchAccountRegenerateKeySample.js | 42 - ...AccountSynchronizeAutoStorageKeysSample.js | 38 - .../javascript/batchAccountUpdateSample.js | 45 - .../certificateCancelDeletionSample.js | 44 - .../v10/javascript/certificateCreateSample.js | 102 - .../v10/javascript/certificateDeleteSample.js | 40 - .../v10/javascript/certificateGetSample.js | 62 - .../certificateListByBatchAccountSample.js | 72 - .../v10/javascript/certificateUpdateSample.js | 45 - .../locationCheckNameAvailabilitySample.js | 58 - .../v10/javascript/locationGetQuotasSample.js | 34 - ...onListSupportedVirtualMachineSkusSample.js | 37 - ...SecurityPerimeterGetConfigurationSample.js | 41 - ...curityPerimeterListConfigurationsSample.js | 41 - ...tyPerimeterReconcileConfigurationSample.js | 41 - .../v10/javascript/operationsListSample.js | 37 - .../samples/v10/javascript/package.json | 32 - .../v10/javascript/poolCreateSample.js | 701 --- .../v10/javascript/poolDeleteSample.js | 40 - .../javascript/poolDisableAutoScaleSample.js | 40 - .../samples/v10/javascript/poolGetSample.js | 144 - .../poolListByBatchAccountSample.js | 67 - .../v10/javascript/poolStopResizeSample.js | 36 - .../v10/javascript/poolUpdateSample.js | 144 - .../privateEndpointConnectionDeleteSample.js | 41 - .../privateEndpointConnectionGetSample.js | 41 - ...pointConnectionListByBatchAccountSample.js | 41 - .../privateEndpointConnectionUpdateSample.js | 48 - .../privateLinkResourceGetSample.js | 40 - ...ateLinkResourceListByBatchAccountSample.js | 41 - .../samples/v10/javascript/sample.env | 4 - .../samples/v10/typescript/README.md | 157 - .../samples/v10/typescript/package.json | 41 - .../samples/v10/typescript/sample.env | 4 - .../typescript/src/applicationCreateSample.ts | 48 - .../typescript/src/applicationDeleteSample.ts | 38 - .../typescript/src/applicationGetSample.ts | 38 - .../typescript/src/applicationListSample.ts | 39 - .../src/applicationPackageActivateSample.ts | 45 - .../src/applicationPackageCreateSample.ts | 40 - .../src/applicationPackageDeleteSample.ts | 40 - .../src/applicationPackageGetSample.ts | 40 - .../src/applicationPackageListSample.ts | 41 - .../typescript/src/applicationUpdateSample.ts | 44 - .../src/batchAccountCreateSample.ts | 181 - .../src/batchAccountDeleteSample.ts | 36 - .../src/batchAccountGetDetectorSample.ts | 38 - .../src/batchAccountGetKeysSample.ts | 36 - .../typescript/src/batchAccountGetSample.ts | 57 - .../batchAccountListByResourceGroupSample.ts | 37 - .../src/batchAccountListDetectorsSample.ts | 39 - ...boundNetworkDependenciesEndpointsSample.ts | 39 - .../typescript/src/batchAccountListSample.ts | 33 - .../src/batchAccountRegenerateKeySample.ts | 43 - ...AccountSynchronizeAutoStorageKeysSample.ts | 36 - .../src/batchAccountUpdateSample.ts | 46 - .../src/certificateCancelDeletionSample.ts | 42 - .../typescript/src/certificateCreateSample.ts | 105 - .../typescript/src/certificateDeleteSample.ts | 38 - .../typescript/src/certificateGetSample.ts | 61 - .../certificateListByBatchAccountSample.ts | 74 - .../typescript/src/certificateUpdateSample.ts | 46 - .../locationCheckNameAvailabilitySample.ts | 64 - .../typescript/src/locationGetQuotasSample.ts | 31 - ...onListSupportedVirtualMachineSkusSample.ts | 36 - ...SecurityPerimeterGetConfigurationSample.ts | 40 - ...curityPerimeterListConfigurationsSample.ts | 39 - ...tyPerimeterReconcileConfigurationSample.ts | 40 - .../typescript/src/operationsListSample.ts | 35 - .../v10/typescript/src/poolCreateSample.ts | 712 --- .../v10/typescript/src/poolDeleteSample.ts | 38 - .../src/poolDisableAutoScaleSample.ts | 38 - .../v10/typescript/src/poolGetSample.ts | 176 - .../src/poolListByBatchAccountSample.ts | 72 - .../typescript/src/poolStopResizeSample.ts | 38 - .../v10/typescript/src/poolUpdateSample.ts | 145 - .../privateEndpointConnectionDeleteSample.ts | 40 - .../src/privateEndpointConnectionGetSample.ts | 39 - ...pointConnectionListByBatchAccountSample.ts | 39 - .../privateEndpointConnectionUpdateSample.ts | 50 - .../src/privateLinkResourceGetSample.ts | 38 - ...ateLinkResourceListByBatchAccountSample.ts | 39 - .../samples/v10/typescript/tsconfig.json | 17 - .../arm-batch/src/api/application/index.ts | 11 + .../src/api/application/operations.ts | 322 ++ .../arm-batch/src/api/application/options.ts | 26 + .../src/api/applicationPackage/index.ts | 11 + .../src/api/applicationPackage/operations.ts | 353 ++ .../src/api/applicationPackage/options.ts | 26 + .../arm-batch/src/api/batchAccount/index.ts | 31 + .../src/api/batchAccount/operations.ts | 716 +++ .../arm-batch/src/api/batchAccount/options.ts | 46 + .../src/api/batchManagementContext.ts | 50 + sdk/batch/arm-batch/src/api/index.ts | 8 + sdk/batch/arm-batch/src/api/location/index.ts | 9 + .../arm-batch/src/api/location/operations.ts | 187 + .../arm-batch/src/api/location/options.ts | 18 + .../src/api/networkSecurityPerimeter/index.ts | 9 + .../networkSecurityPerimeter/operations.ts | 207 + .../api/networkSecurityPerimeter/options.ts | 16 + .../arm-batch/src/api/operations/index.ts | 5 + .../src/api/operations/operations.ts | 71 + .../arm-batch/src/api/operations/options.ts | 7 + sdk/batch/arm-batch/src/api/pool/index.ts | 21 + .../arm-batch/src/api/pool/operations.ts | 448 ++ sdk/batch/arm-batch/src/api/pool/options.ts | 57 + .../api/privateEndpointConnection/index.ts | 10 + .../privateEndpointConnection/operations.ts | 281 + .../api/privateEndpointConnection/options.ts | 27 + .../src/api/privateLinkResource/index.ts | 8 + .../src/api/privateLinkResource/operations.ts | 141 + .../src/api/privateLinkResource/options.ts | 13 + .../arm-batch/src/batchManagementClient.ts | 252 +- .../src/classic/application/index.ts | 99 + .../src/classic/applicationPackage/index.ts | 120 + .../src/classic/batchAccount/index.ts | 256 + sdk/batch/arm-batch/src/classic/index.ts | 12 + .../arm-batch/src/classic/location/index.ts | 63 + .../classic/networkSecurityPerimeter/index.ts | 130 + .../arm-batch/src/classic/operations/index.ts | 26 + sdk/batch/arm-batch/src/classic/pool/index.ts | 171 + .../privateEndpointConnection/index.ts | 198 + .../src/classic/privateLinkResource/index.ts | 52 + sdk/batch/arm-batch/src/index.ts | 276 +- sdk/batch/arm-batch/src/logger.ts | 5 + sdk/batch/arm-batch/src/lroImpl.ts | 38 - sdk/batch/arm-batch/src/models/index.ts | 2890 +--------- sdk/batch/arm-batch/src/models/mappers.ts | 4828 ----------------- sdk/batch/arm-batch/src/models/models.ts | 4781 ++++++++++++++++ sdk/batch/arm-batch/src/models/parameters.ts | 377 -- .../src/operations/applicationOperations.ts | 369 -- .../applicationPackageOperations.ts | 419 -- .../src/operations/batchAccountOperations.ts | 1151 ---- .../src/operations/certificateOperations.ts | 552 -- sdk/batch/arm-batch/src/operations/index.ts | 18 - .../arm-batch/src/operations/location.ts | 271 - .../networkSecurityPerimeterOperations.ts | 397 -- .../arm-batch/src/operations/operations.ts | 149 - .../src/operations/poolOperations.ts | 566 -- .../privateEndpointConnectionOperations.ts | 542 -- .../privateLinkResourceOperations.ts | 247 - .../applicationOperations.ts | 90 - .../applicationPackageOperations.ts | 106 - .../batchAccountOperations.ts | 224 - .../certificateOperations.ts | 155 - .../src/operationsInterfaces/index.ts | 18 - .../src/operationsInterfaces/location.ts | 52 - .../networkSecurityPerimeterOperations.ts | 81 - .../src/operationsInterfaces/operations.ts | 22 - .../operationsInterfaces/poolOperations.ts | 142 - .../privateEndpointConnectionOperations.ts | 122 - .../privateLinkResourceOperations.ts | 45 - sdk/batch/arm-batch/src/pagingHelper.ts | 39 - .../arm-batch/src/restorePollerHelpers.ts | 180 + .../src/static-helpers/cloudSettingHelpers.ts | 42 + .../src/static-helpers/pagingHelpers.ts | 269 + .../src/static-helpers/pollingHelpers.ts | 149 + .../serialization/check-prop-undefined.ts | 17 + .../src/static-helpers/simplePollerHelpers.ts | 119 + .../src/static-helpers/urlTemplate.ts | 227 + sdk/batch/arm-batch/test/snippets.spec.ts | 2 +- sdk/batch/arm-batch/tsconfig.json | 3 +- sdk/batch/arm-batch/tsconfig.samples.json | 4 +- sdk/batch/arm-batch/tsp-location.yaml | 4 + sdk/batch/arm-batch/vitest.esm.config.ts | 8 + sdk/batch/arm-batch/warp.config.yml | 15 - 244 files changed, 12128 insertions(+), 24504 deletions(-) delete mode 100644 sdk/batch/arm-batch/CHANGELOG.md delete mode 100644 sdk/batch/arm-batch/_meta.json create mode 100644 sdk/batch/arm-batch/eslint.config.mjs create mode 100644 sdk/batch/arm-batch/metadata.json delete mode 100644 sdk/batch/arm-batch/review/arm-batch-node.api.md delete mode 100644 sdk/batch/arm-batch/samples-dev/certificateCancelDeletionSample.ts delete mode 100644 sdk/batch/arm-batch/samples-dev/certificateCreateSample.ts delete mode 100644 sdk/batch/arm-batch/samples-dev/certificateDeleteSample.ts delete mode 100644 sdk/batch/arm-batch/samples-dev/certificateGetSample.ts delete mode 100644 sdk/batch/arm-batch/samples-dev/certificateListByBatchAccountSample.ts delete mode 100644 sdk/batch/arm-batch/samples-dev/certificateUpdateSample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/README.md delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/applicationCreateSample.js delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/applicationDeleteSample.js delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/applicationGetSample.js delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/applicationListSample.js delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/applicationPackageActivateSample.js delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/applicationPackageCreateSample.js delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/applicationPackageDeleteSample.js delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/applicationPackageGetSample.js delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/applicationPackageListSample.js delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/applicationUpdateSample.js delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/batchAccountCreateSample.js delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/batchAccountDeleteSample.js delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/batchAccountGetDetectorSample.js delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/batchAccountGetKeysSample.js delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/batchAccountGetSample.js delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/batchAccountListByResourceGroupSample.js delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/batchAccountListDetectorsSample.js delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/batchAccountListOutboundNetworkDependenciesEndpointsSample.js delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/batchAccountListSample.js delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/batchAccountRegenerateKeySample.js delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/batchAccountSynchronizeAutoStorageKeysSample.js delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/batchAccountUpdateSample.js delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/certificateCancelDeletionSample.js delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/certificateCreateSample.js delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/certificateDeleteSample.js delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/certificateGetSample.js delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/certificateListByBatchAccountSample.js delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/certificateUpdateSample.js delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/locationCheckNameAvailabilitySample.js delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/locationGetQuotasSample.js delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/locationListSupportedVirtualMachineSkusSample.js delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/networkSecurityPerimeterGetConfigurationSample.js delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/networkSecurityPerimeterListConfigurationsSample.js delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/networkSecurityPerimeterReconcileConfigurationSample.js delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/operationsListSample.js delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/package.json delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/poolCreateSample.js delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/poolDeleteSample.js delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/poolDisableAutoScaleSample.js delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/poolGetSample.js delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/poolListByBatchAccountSample.js delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/poolStopResizeSample.js delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/poolUpdateSample.js delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/privateEndpointConnectionDeleteSample.js delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/privateEndpointConnectionGetSample.js delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/privateEndpointConnectionListByBatchAccountSample.js delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/privateEndpointConnectionUpdateSample.js delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/privateLinkResourceGetSample.js delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/privateLinkResourceListByBatchAccountSample.js delete mode 100644 sdk/batch/arm-batch/samples/v10/javascript/sample.env delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/README.md delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/package.json delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/sample.env delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/src/applicationCreateSample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/src/applicationDeleteSample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/src/applicationGetSample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/src/applicationListSample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/src/applicationPackageActivateSample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/src/applicationPackageCreateSample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/src/applicationPackageDeleteSample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/src/applicationPackageGetSample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/src/applicationPackageListSample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/src/applicationUpdateSample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountCreateSample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountDeleteSample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountGetDetectorSample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountGetKeysSample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountGetSample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountListByResourceGroupSample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountListDetectorsSample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountListOutboundNetworkDependenciesEndpointsSample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountListSample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountRegenerateKeySample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountSynchronizeAutoStorageKeysSample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountUpdateSample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/src/certificateCancelDeletionSample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/src/certificateCreateSample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/src/certificateDeleteSample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/src/certificateGetSample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/src/certificateListByBatchAccountSample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/src/certificateUpdateSample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/src/locationCheckNameAvailabilitySample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/src/locationGetQuotasSample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/src/locationListSupportedVirtualMachineSkusSample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/src/networkSecurityPerimeterGetConfigurationSample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/src/networkSecurityPerimeterListConfigurationsSample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/src/networkSecurityPerimeterReconcileConfigurationSample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/src/operationsListSample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/src/poolCreateSample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/src/poolDeleteSample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/src/poolDisableAutoScaleSample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/src/poolGetSample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/src/poolListByBatchAccountSample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/src/poolStopResizeSample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/src/poolUpdateSample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/src/privateEndpointConnectionDeleteSample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/src/privateEndpointConnectionGetSample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/src/privateEndpointConnectionListByBatchAccountSample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/src/privateEndpointConnectionUpdateSample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/src/privateLinkResourceGetSample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/src/privateLinkResourceListByBatchAccountSample.ts delete mode 100644 sdk/batch/arm-batch/samples/v10/typescript/tsconfig.json create mode 100644 sdk/batch/arm-batch/src/api/application/index.ts create mode 100644 sdk/batch/arm-batch/src/api/application/operations.ts create mode 100644 sdk/batch/arm-batch/src/api/application/options.ts create mode 100644 sdk/batch/arm-batch/src/api/applicationPackage/index.ts create mode 100644 sdk/batch/arm-batch/src/api/applicationPackage/operations.ts create mode 100644 sdk/batch/arm-batch/src/api/applicationPackage/options.ts create mode 100644 sdk/batch/arm-batch/src/api/batchAccount/index.ts create mode 100644 sdk/batch/arm-batch/src/api/batchAccount/operations.ts create mode 100644 sdk/batch/arm-batch/src/api/batchAccount/options.ts create mode 100644 sdk/batch/arm-batch/src/api/batchManagementContext.ts create mode 100644 sdk/batch/arm-batch/src/api/index.ts create mode 100644 sdk/batch/arm-batch/src/api/location/index.ts create mode 100644 sdk/batch/arm-batch/src/api/location/operations.ts create mode 100644 sdk/batch/arm-batch/src/api/location/options.ts create mode 100644 sdk/batch/arm-batch/src/api/networkSecurityPerimeter/index.ts create mode 100644 sdk/batch/arm-batch/src/api/networkSecurityPerimeter/operations.ts create mode 100644 sdk/batch/arm-batch/src/api/networkSecurityPerimeter/options.ts create mode 100644 sdk/batch/arm-batch/src/api/operations/index.ts create mode 100644 sdk/batch/arm-batch/src/api/operations/operations.ts create mode 100644 sdk/batch/arm-batch/src/api/operations/options.ts create mode 100644 sdk/batch/arm-batch/src/api/pool/index.ts create mode 100644 sdk/batch/arm-batch/src/api/pool/operations.ts create mode 100644 sdk/batch/arm-batch/src/api/pool/options.ts create mode 100644 sdk/batch/arm-batch/src/api/privateEndpointConnection/index.ts create mode 100644 sdk/batch/arm-batch/src/api/privateEndpointConnection/operations.ts create mode 100644 sdk/batch/arm-batch/src/api/privateEndpointConnection/options.ts create mode 100644 sdk/batch/arm-batch/src/api/privateLinkResource/index.ts create mode 100644 sdk/batch/arm-batch/src/api/privateLinkResource/operations.ts create mode 100644 sdk/batch/arm-batch/src/api/privateLinkResource/options.ts create mode 100644 sdk/batch/arm-batch/src/classic/application/index.ts create mode 100644 sdk/batch/arm-batch/src/classic/applicationPackage/index.ts create mode 100644 sdk/batch/arm-batch/src/classic/batchAccount/index.ts create mode 100644 sdk/batch/arm-batch/src/classic/index.ts create mode 100644 sdk/batch/arm-batch/src/classic/location/index.ts create mode 100644 sdk/batch/arm-batch/src/classic/networkSecurityPerimeter/index.ts create mode 100644 sdk/batch/arm-batch/src/classic/operations/index.ts create mode 100644 sdk/batch/arm-batch/src/classic/pool/index.ts create mode 100644 sdk/batch/arm-batch/src/classic/privateEndpointConnection/index.ts create mode 100644 sdk/batch/arm-batch/src/classic/privateLinkResource/index.ts create mode 100644 sdk/batch/arm-batch/src/logger.ts delete mode 100644 sdk/batch/arm-batch/src/lroImpl.ts delete mode 100644 sdk/batch/arm-batch/src/models/mappers.ts create mode 100644 sdk/batch/arm-batch/src/models/models.ts delete mode 100644 sdk/batch/arm-batch/src/models/parameters.ts delete mode 100644 sdk/batch/arm-batch/src/operations/applicationOperations.ts delete mode 100644 sdk/batch/arm-batch/src/operations/applicationPackageOperations.ts delete mode 100644 sdk/batch/arm-batch/src/operations/batchAccountOperations.ts delete mode 100644 sdk/batch/arm-batch/src/operations/certificateOperations.ts delete mode 100644 sdk/batch/arm-batch/src/operations/index.ts delete mode 100644 sdk/batch/arm-batch/src/operations/location.ts delete mode 100644 sdk/batch/arm-batch/src/operations/networkSecurityPerimeterOperations.ts delete mode 100644 sdk/batch/arm-batch/src/operations/operations.ts delete mode 100644 sdk/batch/arm-batch/src/operations/poolOperations.ts delete mode 100644 sdk/batch/arm-batch/src/operations/privateEndpointConnectionOperations.ts delete mode 100644 sdk/batch/arm-batch/src/operations/privateLinkResourceOperations.ts delete mode 100644 sdk/batch/arm-batch/src/operationsInterfaces/applicationOperations.ts delete mode 100644 sdk/batch/arm-batch/src/operationsInterfaces/applicationPackageOperations.ts delete mode 100644 sdk/batch/arm-batch/src/operationsInterfaces/batchAccountOperations.ts delete mode 100644 sdk/batch/arm-batch/src/operationsInterfaces/certificateOperations.ts delete mode 100644 sdk/batch/arm-batch/src/operationsInterfaces/index.ts delete mode 100644 sdk/batch/arm-batch/src/operationsInterfaces/location.ts delete mode 100644 sdk/batch/arm-batch/src/operationsInterfaces/networkSecurityPerimeterOperations.ts delete mode 100644 sdk/batch/arm-batch/src/operationsInterfaces/operations.ts delete mode 100644 sdk/batch/arm-batch/src/operationsInterfaces/poolOperations.ts delete mode 100644 sdk/batch/arm-batch/src/operationsInterfaces/privateEndpointConnectionOperations.ts delete mode 100644 sdk/batch/arm-batch/src/operationsInterfaces/privateLinkResourceOperations.ts delete mode 100644 sdk/batch/arm-batch/src/pagingHelper.ts create mode 100644 sdk/batch/arm-batch/src/restorePollerHelpers.ts create mode 100644 sdk/batch/arm-batch/src/static-helpers/cloudSettingHelpers.ts create mode 100644 sdk/batch/arm-batch/src/static-helpers/pagingHelpers.ts create mode 100644 sdk/batch/arm-batch/src/static-helpers/pollingHelpers.ts create mode 100644 sdk/batch/arm-batch/src/static-helpers/serialization/check-prop-undefined.ts create mode 100644 sdk/batch/arm-batch/src/static-helpers/simplePollerHelpers.ts create mode 100644 sdk/batch/arm-batch/src/static-helpers/urlTemplate.ts create mode 100644 sdk/batch/arm-batch/tsp-location.yaml create mode 100644 sdk/batch/arm-batch/vitest.esm.config.ts delete mode 100644 sdk/batch/arm-batch/warp.config.yml diff --git a/sdk/batch/arm-batch/CHANGELOG.md b/sdk/batch/arm-batch/CHANGELOG.md deleted file mode 100644 index 89143a06bbc1..000000000000 --- a/sdk/batch/arm-batch/CHANGELOG.md +++ /dev/null @@ -1,221 +0,0 @@ -# Release History - -## 10.0.2 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 10.0.1 (2025-08-22) - -### Other Changes - - - Other fixes - -## 10.0.0 (2024-09-11) - -### Features Added - - - Added operation group NetworkSecurityPerimeterOperations - - Added Interface AccessRule - - Added Interface AccessRuleProperties - - Added Interface AccessRulePropertiesSubscriptionsItem - - Added Interface AzureProxyResource - - Added Interface AzureResource - - Added Interface ContainerHostBatchBindMountEntry - - Added Interface ErrorAdditionalInfo - - Added Interface ErrorDetail - - Added Interface ErrorResponse - - Added Interface NetworkSecurityPerimeter - - Added Interface NetworkSecurityPerimeterConfiguration - - Added Interface NetworkSecurityPerimeterConfigurationListResult - - Added Interface NetworkSecurityPerimeterConfigurationProperties - - Added Interface NetworkSecurityPerimeterGetConfigurationOptionalParams - - Added Interface NetworkSecurityPerimeterListConfigurationsNextOptionalParams - - Added Interface NetworkSecurityPerimeterListConfigurationsOptionalParams - - Added Interface NetworkSecurityPerimeterReconcileConfigurationHeaders - - Added Interface NetworkSecurityPerimeterReconcileConfigurationOptionalParams - - Added Interface NetworkSecurityProfile - - Added Interface ProvisioningIssue - - Added Interface ProvisioningIssueProperties - - Added Interface ResourceAssociation - - Added Interface SystemData - - Added Interface VMDiskSecurityProfile - - Added Type Alias AccessRuleDirection - - Added Type Alias ContainerHostDataPath - - Added Type Alias CreatedByType - - Added Type Alias IssueType - - Added Type Alias NetworkSecurityPerimeterConfigurationProvisioningState - - Added Type Alias NetworkSecurityPerimeterGetConfigurationResponse - - Added Type Alias NetworkSecurityPerimeterListConfigurationsNextResponse - - Added Type Alias NetworkSecurityPerimeterListConfigurationsResponse - - Added Type Alias NetworkSecurityPerimeterReconcileConfigurationResponse - - Added Type Alias ResourceAssociationAccessMode - - Added Type Alias SecurityEncryptionTypes - - Added Type Alias SecurityTypes - - Added Type Alias Severity - - Interface ImageReference has a new optional parameter communityGalleryImageId - - Interface ImageReference has a new optional parameter sharedGalleryImageId - - Interface ManagedDisk has a new optional parameter securityProfile - - Interface Resource has a new optional parameter systemData - - Interface TaskContainerSettings has a new optional parameter containerHostBatchBindMounts - - Added Enum KnownAccessRuleDirection - - Added Enum KnownContainerHostDataPath - - Added Enum KnownCreatedByType - - Added Enum KnownIssueType - - Added Enum KnownNetworkSecurityPerimeterConfigurationProvisioningState - - Added Enum KnownResourceAssociationAccessMode - - Added Enum KnownSecurityEncryptionTypes - - Added Enum KnownSeverity - -### Breaking Changes - - - Removed operation Location_2.listSupportedCloudServiceSkus - - Interface DeploymentConfiguration no longer has parameter cloudServiceConfiguration - - Interface ProxyResource no longer has parameter etag - - Interface Resource no longer has parameter location - - Interface Resource no longer has parameter tags - - Type of parameter securityType of interface SecurityProfile is changed from "trustedLaunch" to SecurityTypes - - -## 9.2.0 (2024-03-13) - -### Features Added - - - Added Interface AutomaticOSUpgradePolicy - - Added Interface RollingUpgradePolicy - - Added Interface UpgradePolicy - - Added Type Alias UpgradeMode - - Interface Pool has a new optional parameter upgradePolicy - - Interface SupportedSku has a new optional parameter batchSupportEndOfLife - - -## 9.1.0 (2023-12-08) - -### Features Added - - - Added Interface ManagedDisk - - Added Interface SecurityProfile - - Added Interface ServiceArtifactReference - - Added Interface UefiSettings - - Interface OSDisk has a new optional parameter caching - - Interface OSDisk has a new optional parameter diskSizeGB - - Interface OSDisk has a new optional parameter managedDisk - - Interface OSDisk has a new optional parameter writeAcceleratorEnabled - - Interface Pool has a new optional parameter resourceTags - - Interface VirtualMachineConfiguration has a new optional parameter securityProfile - - Interface VirtualMachineConfiguration has a new optional parameter serviceArtifactReference - - -## 9.0.0 (2023-06-30) - -### Features Added - - - 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 - -### Breaking Changes - - - Type of parameter type of interface ContainerConfiguration is changed from "DockerCompatible" to ContainerType - - -## 8.0.0 (2022-11-10) - -### Features Added - - - Added Type Alias NodeCommunicationMode - - Interface NetworkConfiguration has a new optional parameter dynamicVnetAssignmentScope - - Interface Pool has a new optional parameter currentNodeCommunicationMode - - Interface Pool has a new optional parameter targetNodeCommunicationMode - - Interface PrivateLinkServiceConnectionState has a new optional parameter actionsRequired - -### Breaking Changes - - - Interface CifsMountConfiguration no longer has parameter username - - Interface NetworkConfiguration no longer has parameter dynamicVNetAssignmentScope - - Interface PrivateLinkServiceConnectionState no longer has parameter actionRequired - - Interface CifsMountConfiguration has a new required parameter userName - - -## 7.2.0 (2022-07-19) - -### Features Added - - - Added operation PrivateEndpointConnectionOperations.beginDelete - - Added operation PrivateEndpointConnectionOperations.beginDeleteAndWait - - Added Interface Application - - Added Interface ApplicationPackage - - Added Interface AutoStorageProperties - - Added Interface BatchAccount - - Added Interface Certificate - - Added Interface CertificateCreateOrUpdateParameters - - Added Interface CertificateCreateOrUpdateProperties - - Added Interface CertificateProperties - - Added Interface DetectorResponse - - Added Interface EndpointAccessProfile - - Added Interface IPRule - - Added Interface NetworkProfile - - Added Interface Pool - - Added Interface PrivateEndpointConnection - - Added Interface PrivateEndpointConnectionDeleteHeaders - - Added Interface PrivateEndpointConnectionDeleteOptionalParams - - Added Interface PrivateLinkResource - - Added Type Alias EndpointAccessDefaultAction - - Added Type Alias PrivateEndpointConnectionDeleteResponse - - Interface BatchAccountCreateParameters has a new optional parameter networkProfile - - Interface BatchAccountUpdateParameters has a new optional parameter networkProfile - - Interface BatchAccountUpdateParameters has a new optional parameter publicNetworkAccess - -## 7.1.1 (2022-04-11) - -### Features Added - - - Bug fix - -## 7.1.0 (2022-03-02) - -### Features Added - - - Added operation BatchAccountOperations.getDetector - - Added operation BatchAccountOperations.listDetectors - - Added Interface BatchAccountGetDetectorOptionalParams - - Added Interface BatchAccountListDetectorsNextOptionalParams - - Added Interface BatchAccountListDetectorsOptionalParams - - Added Interface DetectorListResult - - Added Type Alias BatchAccountGetDetectorResponse - - Added Type Alias BatchAccountListDetectorsNextResponse - - Added Type Alias BatchAccountListDetectorsResponse - - Added Type Alias DetectorResponse - - Added Type Alias DynamicVNetAssignmentScope - - Interface NetworkConfiguration has a new optional parameter dynamicVNetAssignmentScope - - -## 7.0.0 (2021-12-24) - -The package of @azure/arm-batch is using our next generation design principles since version 7.0.0, which contains breaking changes. - -To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog). - -To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide). - -To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart). diff --git a/sdk/batch/arm-batch/LICENSE b/sdk/batch/arm-batch/LICENSE index b2f52a2bad4e..63447fd8bbbf 100644 --- a/sdk/batch/arm-batch/LICENSE +++ b/sdk/batch/arm-batch/LICENSE @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +SOFTWARE. \ No newline at end of file diff --git a/sdk/batch/arm-batch/README.md b/sdk/batch/arm-batch/README.md index 48219b9ad7dd..32182cb9131b 100644 --- a/sdk/batch/arm-batch/README.md +++ b/sdk/batch/arm-batch/README.md @@ -2,12 +2,14 @@ This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure BatchManagement client. -Batch Client +The Batch Management Client. -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/batch/arm-batch) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-batch) | -[API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-batch) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) +Key links: + +- [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/batch/arm-batch) +- [Package (NPM)](https://www.npmjs.com/package/@azure/arm-batch) +- [API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-batch) +- [Samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/batch/arm-batch/samples) ## Getting started @@ -35,7 +37,7 @@ npm install @azure/arm-batch To create a client object to access the Azure BatchManagement API, you will need the `endpoint` of your Azure BatchManagement resource and a `credential`. The Azure BatchManagement client can use Azure Active Directory credentials to authenticate. You can find the endpoint for your Azure BatchManagement resource in the [Azure Portal][azure_portal]. -You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). +You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: @@ -44,7 +46,6 @@ npm install @azure/identity ``` You will also need to **register a new AAD application and grant access to Azure BatchManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. For more information about how to create an Azure AD Application check out [this guide](https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). @@ -64,16 +65,17 @@ For browser environments, use the `InteractiveBrowserCredential` from the `@azur import { InteractiveBrowserCredential } from "@azure/identity"; import { BatchManagementClient } from "@azure/arm-batch"; -const subscriptionId = "00000000-0000-0000-0000-000000000000"; const credential = new InteractiveBrowserCredential({ tenantId: "", clientId: "", -}); + }); + +const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new BatchManagementClient(credential, subscriptionId); ``` -### JavaScript Bundle +### JavaScript Bundle To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). ## Key concepts @@ -98,7 +100,7 @@ For more detailed instructions on how to enable logs, you can look at the [@azur ## Next steps -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. +Please take a look at the [samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/batch/arm-batch/samples) directory for detailed examples on how to use this library. ## Contributing @@ -108,10 +110,6 @@ If you'd like to contribute to this library, please read the [contributing guide - [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) - - -[azure_cli]: https://learn.microsoft.com/cli/azure -[azure_sub]: https://azure.microsoft.com/free/ [azure_sub]: https://azure.microsoft.com/free/ [azure_portal]: https://portal.azure.com [azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity diff --git a/sdk/batch/arm-batch/_meta.json b/sdk/batch/arm-batch/_meta.json deleted file mode 100644 index b313aeadc281..000000000000 --- a/sdk/batch/arm-batch/_meta.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "commit": "3519c80fe510a268f6e59a29ccac8a53fdec15b6", - "readme": "specification/batch/resource-manager/readme.md", - "autorest_command": "autorest --version=3.9.7 --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.27 --generate-sample=true", - "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.7.12", - "use": "@autorest/typescript@6.0.27" -} \ No newline at end of file diff --git a/sdk/batch/arm-batch/api-extractor.json b/sdk/batch/arm-batch/api-extractor.json index 16d81e2eb512..870d6d399477 100644 --- a/sdk/batch/arm-batch/api-extractor.json +++ b/sdk/batch/arm-batch/api-extractor.json @@ -1,3 +1 @@ -{ - "extends": "../../../api-extractor-base.json" -} +{ "extends": "../../../api-extractor-base.json" } diff --git a/sdk/batch/arm-batch/eslint.config.mjs b/sdk/batch/arm-batch/eslint.config.mjs new file mode 100644 index 000000000000..9396819633a9 --- /dev/null +++ b/sdk/batch/arm-batch/eslint.config.mjs @@ -0,0 +1,14 @@ +import azsdkEslint from "@azure/eslint-plugin-azure-sdk"; + +export default azsdkEslint.config([ + { + rules: { + "@azure/azure-sdk/ts-modules-only-named": "warn", + "@azure/azure-sdk/ts-package-json-types": "warn", + "@azure/azure-sdk/ts-package-json-engine-is-present": "warn", + "@azure/azure-sdk/ts-package-json-files-required": "off", + "@azure/azure-sdk/ts-package-json-main-is-cjs": "off", + "tsdoc/syntax": "warn" + } + } +]); diff --git a/sdk/batch/arm-batch/metadata.json b/sdk/batch/arm-batch/metadata.json new file mode 100644 index 000000000000..803a40002e51 --- /dev/null +++ b/sdk/batch/arm-batch/metadata.json @@ -0,0 +1,242 @@ +{ + "apiVersion": "2025-06-01", + "emitterVersion": "0.50.0", + "crossLanguageDefinitions": { + "CrossLanguagePackageId": "Microsoft.Batch", + "CrossLanguageDefinitionId": { + "@azure/arm-batch!OperationListResult:interface": "Microsoft.Batch.OperationListResult", + "@azure/arm-batch!Operation:interface": "Microsoft.Batch.Operation", + "@azure/arm-batch!OperationDisplay:interface": "Microsoft.Batch.OperationDisplay", + "@azure/arm-batch!CloudError:interface": "Microsoft.Batch.CloudError", + "@azure/arm-batch!CloudErrorBody:interface": "Microsoft.Batch.CloudErrorBody", + "@azure/arm-batch!BatchAccount:interface": "Microsoft.Batch.BatchAccount", + "@azure/arm-batch!BatchAccountProperties:interface": "Microsoft.Batch.BatchAccountProperties", + "@azure/arm-batch!KeyVaultReference:interface": "Microsoft.Batch.KeyVaultReference", + "@azure/arm-batch!NetworkProfile:interface": "Microsoft.Batch.NetworkProfile", + "@azure/arm-batch!EndpointAccessProfile:interface": "Microsoft.Batch.EndpointAccessProfile", + "@azure/arm-batch!IPRule:interface": "Microsoft.Batch.IPRule", + "@azure/arm-batch!PrivateEndpointConnection:interface": "Microsoft.Batch.PrivateEndpointConnection", + "@azure/arm-batch!PrivateEndpointConnectionProperties:interface": "Microsoft.Batch.PrivateEndpointConnectionProperties", + "@azure/arm-batch!PrivateEndpoint:interface": "Microsoft.Batch.PrivateEndpoint", + "@azure/arm-batch!PrivateLinkServiceConnectionState:interface": "Microsoft.Batch.PrivateLinkServiceConnectionState", + "@azure/arm-batch!ProxyResource:interface": "Azure.ResourceManager.CommonTypes.ProxyResource", + "@azure/arm-batch!Resource:interface": "Azure.ResourceManager.CommonTypes.Resource", + "@azure/arm-batch!SystemData:interface": "Azure.ResourceManager.CommonTypes.SystemData", + "@azure/arm-batch!AutoStorageProperties:interface": "Microsoft.Batch.AutoStorageProperties", + "@azure/arm-batch!AutoStorageBaseProperties:interface": "Microsoft.Batch.AutoStorageBaseProperties", + "@azure/arm-batch!ComputeNodeIdentityReference:interface": "Microsoft.Batch.ComputeNodeIdentityReference", + "@azure/arm-batch!EncryptionProperties:interface": "Microsoft.Batch.EncryptionProperties", + "@azure/arm-batch!KeyVaultProperties:interface": "Microsoft.Batch.KeyVaultProperties", + "@azure/arm-batch!VirtualMachineFamilyCoreQuota:interface": "Microsoft.Batch.VirtualMachineFamilyCoreQuota", + "@azure/arm-batch!BatchAccountIdentity:interface": "Microsoft.Batch.BatchAccountIdentity", + "@azure/arm-batch!UserAssignedIdentities:interface": "Microsoft.Batch.UserAssignedIdentities", + "@azure/arm-batch!TrackedResource:interface": "Azure.ResourceManager.CommonTypes.TrackedResource", + "@azure/arm-batch!BatchAccountCreateParameters:interface": "Microsoft.Batch.BatchAccountCreateParameters", + "@azure/arm-batch!BatchAccountCreateProperties:interface": "Microsoft.Batch.BatchAccountCreateProperties", + "@azure/arm-batch!ArmOperationStatusResourceProvisioningState:interface": "Azure.ResourceManager.ArmOperationStatus", + "@azure/arm-batch!ErrorDetail:interface": "Azure.ResourceManager.CommonTypes.ErrorDetail", + "@azure/arm-batch!ErrorAdditionalInfo:interface": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", + "@azure/arm-batch!BatchAccountUpdateParameters:interface": "Microsoft.Batch.BatchAccountUpdateParameters", + "@azure/arm-batch!BatchAccountUpdateProperties:interface": "Microsoft.Batch.BatchAccountUpdateProperties", + "@azure/arm-batch!BatchAccountListResult:interface": "Microsoft.Batch.BatchAccountListResult", + "@azure/arm-batch!BatchAccountRegenerateKeyParameters:interface": "Microsoft.Batch.BatchAccountRegenerateKeyParameters", + "@azure/arm-batch!BatchAccountKeys:interface": "Microsoft.Batch.BatchAccountKeys", + "@azure/arm-batch!OutboundEnvironmentEndpointCollection:interface": "Microsoft.Batch.OutboundEnvironmentEndpointCollection", + "@azure/arm-batch!OutboundEnvironmentEndpoint:interface": "Microsoft.Batch.OutboundEnvironmentEndpoint", + "@azure/arm-batch!EndpointDependency:interface": "Microsoft.Batch.EndpointDependency", + "@azure/arm-batch!EndpointDetail:interface": "Microsoft.Batch.EndpointDetail", + "@azure/arm-batch!DetectorResponse:interface": "Microsoft.Batch.DetectorResponse", + "@azure/arm-batch!DetectorResponseProperties:interface": "Microsoft.Batch.DetectorResponseProperties", + "@azure/arm-batch!DetectorListResult:interface": "Microsoft.Batch.DetectorListResult", + "@azure/arm-batch!ApplicationPackage:interface": "Microsoft.Batch.ApplicationPackage", + "@azure/arm-batch!ApplicationPackageProperties:interface": "Microsoft.Batch.ApplicationPackageProperties", + "@azure/arm-batch!ListApplicationPackagesResult:interface": "Microsoft.Batch.ListApplicationPackagesResult", + "@azure/arm-batch!ActivateApplicationPackageParameters:interface": "Microsoft.Batch.ActivateApplicationPackageParameters", + "@azure/arm-batch!Application:interface": "Microsoft.Batch.Application", + "@azure/arm-batch!ApplicationProperties:interface": "Microsoft.Batch.ApplicationProperties", + "@azure/arm-batch!ListApplicationsResult:interface": "Microsoft.Batch.ListApplicationsResult", + "@azure/arm-batch!PrivateLinkResource:interface": "Microsoft.Batch.PrivateLinkResource", + "@azure/arm-batch!PrivateLinkResourceProperties:interface": "Microsoft.Batch.PrivateLinkResourceProperties", + "@azure/arm-batch!ListPrivateLinkResourcesResult:interface": "Microsoft.Batch.ListPrivateLinkResourcesResult", + "@azure/arm-batch!ListPrivateEndpointConnectionsResult:interface": "Microsoft.Batch.ListPrivateEndpointConnectionsResult", + "@azure/arm-batch!Pool:interface": "Microsoft.Batch.Pool", + "@azure/arm-batch!PoolProperties:interface": "Microsoft.Batch.PoolProperties", + "@azure/arm-batch!DeploymentConfiguration:interface": "Microsoft.Batch.DeploymentConfiguration", + "@azure/arm-batch!VirtualMachineConfiguration:interface": "Microsoft.Batch.VirtualMachineConfiguration", + "@azure/arm-batch!ImageReference:interface": "Microsoft.Batch.ImageReference", + "@azure/arm-batch!WindowsConfiguration:interface": "Microsoft.Batch.WindowsConfiguration", + "@azure/arm-batch!DataDisk:interface": "Microsoft.Batch.DataDisk", + "@azure/arm-batch!ManagedDisk:interface": "Microsoft.Batch.ManagedDisk", + "@azure/arm-batch!VMDiskSecurityProfile:interface": "Microsoft.Batch.VMDiskSecurityProfile", + "@azure/arm-batch!DiskEncryptionSetParameters:interface": "Microsoft.Batch.DiskEncryptionSetParameters", + "@azure/arm-batch!ContainerConfiguration:interface": "Microsoft.Batch.ContainerConfiguration", + "@azure/arm-batch!ContainerRegistry:interface": "Microsoft.Batch.ContainerRegistry", + "@azure/arm-batch!DiskEncryptionConfiguration:interface": "Microsoft.Batch.DiskEncryptionConfiguration", + "@azure/arm-batch!DiskCustomerManagedKey:interface": "Microsoft.Batch.DiskCustomerManagedKey", + "@azure/arm-batch!NodePlacementConfiguration:interface": "Microsoft.Batch.NodePlacementConfiguration", + "@azure/arm-batch!VMExtension:interface": "Microsoft.Batch.VMExtension", + "@azure/arm-batch!OSDisk:interface": "Microsoft.Batch.OSDisk", + "@azure/arm-batch!DiffDiskSettings:interface": "Microsoft.Batch.DiffDiskSettings", + "@azure/arm-batch!SecurityProfile:interface": "Microsoft.Batch.SecurityProfile", + "@azure/arm-batch!UefiSettings:interface": "Microsoft.Batch.UefiSettings", + "@azure/arm-batch!ProxyAgentSettings:interface": "Microsoft.Batch.ProxyAgentSettings", + "@azure/arm-batch!HostEndpointSettings:interface": "Microsoft.Batch.HostEndpointSettings", + "@azure/arm-batch!ServiceArtifactReference:interface": "Microsoft.Batch.ServiceArtifactReference", + "@azure/arm-batch!ScaleSettings:interface": "Microsoft.Batch.ScaleSettings", + "@azure/arm-batch!FixedScaleSettings:interface": "Microsoft.Batch.FixedScaleSettings", + "@azure/arm-batch!AutoScaleSettings:interface": "Microsoft.Batch.AutoScaleSettings", + "@azure/arm-batch!AutoScaleRun:interface": "Microsoft.Batch.AutoScaleRun", + "@azure/arm-batch!AutoScaleRunError:interface": "Microsoft.Batch.AutoScaleRunError", + "@azure/arm-batch!NetworkConfiguration:interface": "Microsoft.Batch.NetworkConfiguration", + "@azure/arm-batch!PoolEndpointConfiguration:interface": "Microsoft.Batch.PoolEndpointConfiguration", + "@azure/arm-batch!InboundNatPool:interface": "Microsoft.Batch.InboundNatPool", + "@azure/arm-batch!NetworkSecurityGroupRule:interface": "Microsoft.Batch.NetworkSecurityGroupRule", + "@azure/arm-batch!PublicIPAddressConfiguration:interface": "Microsoft.Batch.PublicIPAddressConfiguration", + "@azure/arm-batch!IPTag:interface": "Microsoft.Batch.IPTag", + "@azure/arm-batch!TaskSchedulingPolicy:interface": "Microsoft.Batch.TaskSchedulingPolicy", + "@azure/arm-batch!UserAccount:interface": "Microsoft.Batch.UserAccount", + "@azure/arm-batch!LinuxUserConfiguration:interface": "Microsoft.Batch.LinuxUserConfiguration", + "@azure/arm-batch!WindowsUserConfiguration:interface": "Microsoft.Batch.WindowsUserConfiguration", + "@azure/arm-batch!MetadataItem:interface": "Microsoft.Batch.MetadataItem", + "@azure/arm-batch!StartTask:interface": "Microsoft.Batch.StartTask", + "@azure/arm-batch!ResourceFile:interface": "Microsoft.Batch.ResourceFile", + "@azure/arm-batch!EnvironmentSetting:interface": "Microsoft.Batch.EnvironmentSetting", + "@azure/arm-batch!UserIdentity:interface": "Microsoft.Batch.UserIdentity", + "@azure/arm-batch!AutoUserSpecification:interface": "Microsoft.Batch.AutoUserSpecification", + "@azure/arm-batch!TaskContainerSettings:interface": "Microsoft.Batch.TaskContainerSettings", + "@azure/arm-batch!ContainerHostBatchBindMountEntry:interface": "Microsoft.Batch.ContainerHostBatchBindMountEntry", + "@azure/arm-batch!ApplicationPackageReference:interface": "Microsoft.Batch.ApplicationPackageReference", + "@azure/arm-batch!ResizeOperationStatus:interface": "Microsoft.Batch.ResizeOperationStatus", + "@azure/arm-batch!ResizeError:interface": "Microsoft.Batch.ResizeError", + "@azure/arm-batch!MountConfiguration:interface": "Microsoft.Batch.MountConfiguration", + "@azure/arm-batch!AzureBlobFileSystemConfiguration:interface": "Microsoft.Batch.AzureBlobFileSystemConfiguration", + "@azure/arm-batch!NFSMountConfiguration:interface": "Microsoft.Batch.NFSMountConfiguration", + "@azure/arm-batch!CIFSMountConfiguration:interface": "Microsoft.Batch.CifsMountConfiguration", + "@azure/arm-batch!AzureFileShareConfiguration:interface": "Microsoft.Batch.AzureFileShareConfiguration", + "@azure/arm-batch!UpgradePolicy:interface": "Microsoft.Batch.UpgradePolicy", + "@azure/arm-batch!AutomaticOSUpgradePolicy:interface": "Microsoft.Batch.AutomaticOSUpgradePolicy", + "@azure/arm-batch!RollingUpgradePolicy:interface": "Microsoft.Batch.RollingUpgradePolicy", + "@azure/arm-batch!BatchPoolIdentity:interface": "Microsoft.Batch.BatchPoolIdentity", + "@azure/arm-batch!ListPoolsResult:interface": "Microsoft.Batch.ListPoolsResult", + "@azure/arm-batch!NetworkSecurityPerimeterConfiguration:interface": "Azure.ResourceManager.CommonTypes.NetworkSecurityPerimeterConfiguration", + "@azure/arm-batch!NetworkSecurityPerimeterConfigurationProperties:interface": "Azure.ResourceManager.CommonTypes.NetworkSecurityPerimeterConfigurationProperties", + "@azure/arm-batch!ProvisioningIssue:interface": "Azure.ResourceManager.CommonTypes.ProvisioningIssue", + "@azure/arm-batch!ProvisioningIssueProperties:interface": "Azure.ResourceManager.CommonTypes.ProvisioningIssueProperties", + "@azure/arm-batch!AccessRule:interface": "Azure.ResourceManager.CommonTypes.AccessRule", + "@azure/arm-batch!AccessRuleProperties:interface": "Azure.ResourceManager.CommonTypes.AccessRuleProperties", + "@azure/arm-batch!AccessRulePropertiesSubscription:interface": "Azure.ResourceManager.CommonTypes.AccessRuleProperties.subscription.anonymous", + "@azure/arm-batch!NetworkSecurityPerimeter:interface": "Azure.ResourceManager.CommonTypes.NetworkSecurityPerimeter", + "@azure/arm-batch!ResourceAssociation:interface": "Azure.ResourceManager.CommonTypes.ResourceAssociation", + "@azure/arm-batch!NetworkSecurityProfile:interface": "Azure.ResourceManager.CommonTypes.NetworkSecurityProfile", + "@azure/arm-batch!NetworkSecurityPerimeterConfigurationListResult:interface": "Azure.ResourceManager.CommonTypes.NetworkSecurityPerimeterConfigurationListResult", + "@azure/arm-batch!ErrorResponse:interface": "Azure.ResourceManager.CommonTypes.ErrorResponse", + "@azure/arm-batch!BatchLocationQuota:interface": "Microsoft.Batch.BatchLocationQuota", + "@azure/arm-batch!SupportedSkusResult:interface": "Microsoft.Batch.SupportedSkusResult", + "@azure/arm-batch!SupportedSku:interface": "Microsoft.Batch.SupportedSku", + "@azure/arm-batch!SkuCapability:interface": "Microsoft.Batch.SkuCapability", + "@azure/arm-batch!CheckNameAvailabilityParameters:interface": "Microsoft.Batch.CheckNameAvailabilityParameters", + "@azure/arm-batch!CheckNameAvailabilityResult:interface": "Microsoft.Batch.CheckNameAvailabilityResult", + "@azure/arm-batch!KnownProvisioningState:enum": "Microsoft.Batch.ProvisioningState", + "@azure/arm-batch!KnownPoolAllocationMode:enum": "Microsoft.Batch.PoolAllocationMode", + "@azure/arm-batch!KnownPublicNetworkAccessType:enum": "Microsoft.Batch.PublicNetworkAccessType", + "@azure/arm-batch!KnownEndpointAccessDefaultAction:enum": "Microsoft.Batch.EndpointAccessDefaultAction", + "@azure/arm-batch!KnownIPRuleAction:enum": "Microsoft.Batch.IPRuleAction", + "@azure/arm-batch!KnownPrivateEndpointConnectionProvisioningState:enum": "Microsoft.Batch.PrivateEndpointConnectionProvisioningState", + "@azure/arm-batch!KnownPrivateLinkServiceConnectionStatus:enum": "Microsoft.Batch.PrivateLinkServiceConnectionStatus", + "@azure/arm-batch!KnowncreatedByType:enum": "Azure.ResourceManager.CommonTypes.createdByType", + "@azure/arm-batch!KnownAutoStorageAuthenticationMode:enum": "Microsoft.Batch.AutoStorageAuthenticationMode", + "@azure/arm-batch!KnownKeySource:enum": "Microsoft.Batch.KeySource", + "@azure/arm-batch!KnownAuthenticationMode:enum": "Microsoft.Batch.AuthenticationMode", + "@azure/arm-batch!KnownResourceIdentityType:enum": "Microsoft.Batch.ResourceIdentityType", + "@azure/arm-batch!KnownResourceProvisioningState:enum": "Azure.ResourceManager.ResourceProvisioningState", + "@azure/arm-batch!KnownAccountKeyType:enum": "Microsoft.Batch.AccountKeyType", + "@azure/arm-batch!KnownPackageState:enum": "Microsoft.Batch.PackageState", + "@azure/arm-batch!KnownPoolProvisioningState:enum": "Microsoft.Batch.PoolProvisioningState", + "@azure/arm-batch!KnownAllocationState:enum": "Microsoft.Batch.AllocationState", + "@azure/arm-batch!KnownCachingType:enum": "Microsoft.Batch.CachingType", + "@azure/arm-batch!KnownStorageAccountType:enum": "Microsoft.Batch.StorageAccountType", + "@azure/arm-batch!KnownSecurityEncryptionTypes:enum": "Microsoft.Batch.SecurityEncryptionTypes", + "@azure/arm-batch!KnownContainerType:enum": "Microsoft.Batch.ContainerType", + "@azure/arm-batch!KnownDiskEncryptionTarget:enum": "Microsoft.Batch.DiskEncryptionTarget", + "@azure/arm-batch!KnownNodePlacementPolicyType:enum": "Microsoft.Batch.NodePlacementPolicyType", + "@azure/arm-batch!KnownDiffDiskPlacement:enum": "Microsoft.Batch.DiffDiskPlacement", + "@azure/arm-batch!KnownSecurityTypes:enum": "Microsoft.Batch.SecurityTypes", + "@azure/arm-batch!KnownHostEndpointSettingsModeTypes:enum": "Microsoft.Batch.HostEndpointSettingsModeTypes", + "@azure/arm-batch!KnownComputeNodeDeallocationOption:enum": "Microsoft.Batch.ComputeNodeDeallocationOption", + "@azure/arm-batch!KnownInterNodeCommunicationState:enum": "Microsoft.Batch.InterNodeCommunicationState", + "@azure/arm-batch!KnownDynamicVNetAssignmentScope:enum": "Microsoft.Batch.DynamicVNetAssignmentScope", + "@azure/arm-batch!KnownInboundEndpointProtocol:enum": "Microsoft.Batch.InboundEndpointProtocol", + "@azure/arm-batch!KnownNetworkSecurityGroupRuleAccess:enum": "Microsoft.Batch.NetworkSecurityGroupRuleAccess", + "@azure/arm-batch!KnownIPAddressProvisioningType:enum": "Microsoft.Batch.IPAddressProvisioningType", + "@azure/arm-batch!KnownIPFamily:enum": "Microsoft.Batch.IPFamily", + "@azure/arm-batch!KnownJobDefaultOrder:enum": "Microsoft.Batch.JobDefaultOrder", + "@azure/arm-batch!KnownComputeNodeFillType:enum": "Microsoft.Batch.ComputeNodeFillType", + "@azure/arm-batch!KnownElevationLevel:enum": "Microsoft.Batch.ElevationLevel", + "@azure/arm-batch!KnownLoginMode:enum": "Microsoft.Batch.LoginMode", + "@azure/arm-batch!KnownAutoUserScope:enum": "Microsoft.Batch.AutoUserScope", + "@azure/arm-batch!KnownContainerWorkingDirectory:enum": "Microsoft.Batch.ContainerWorkingDirectory", + "@azure/arm-batch!KnownContainerHostDataPath:enum": "Microsoft.Batch.ContainerHostDataPath", + "@azure/arm-batch!KnownUpgradeMode:enum": "Microsoft.Batch.UpgradeMode", + "@azure/arm-batch!KnownPoolIdentityType:enum": "Microsoft.Batch.PoolIdentityType", + "@azure/arm-batch!KnownNetworkSecurityPerimeterConfigurationProvisioningState:enum": "Azure.ResourceManager.CommonTypes.NetworkSecurityPerimeterConfigurationProvisioningState", + "@azure/arm-batch!KnownIssueType:enum": "Azure.ResourceManager.CommonTypes.IssueType", + "@azure/arm-batch!KnownSeverity:enum": "Azure.ResourceManager.CommonTypes.Severity", + "@azure/arm-batch!KnownAccessRuleDirection:enum": "Azure.ResourceManager.CommonTypes.AccessRuleDirection", + "@azure/arm-batch!KnownResourceAssociationAccessMode:enum": "Azure.ResourceManager.CommonTypes.ResourceAssociationAccessMode", + "@azure/arm-batch!KnownResourceType:enum": "Microsoft.Batch.ResourceType", + "@azure/arm-batch!KnownNameAvailabilityReason:enum": "Microsoft.Batch.NameAvailabilityReason", + "@azure/arm-batch!KnownVersions:enum": "Microsoft.Batch.Versions", + "@azure/arm-batch!BatchAccountPropertiesPublicNetworkAccess:type": "Microsoft.Batch.BatchAccountProperties.publicNetworkAccess.anonymous", + "@azure/arm-batch!BatchAccountPropertiesNetworkProfile:type": "Microsoft.Batch.BatchAccountProperties.networkProfile.anonymous", + "@azure/arm-batch!BatchAccountPropertiesPrivateEndpointConnections:type": "Microsoft.Batch.BatchAccountProperties.privateEndpointConnections.anonymous", + "@azure/arm-batch!BatchAccountPropertiesDedicatedCoreQuota:type": "Microsoft.Batch.BatchAccountProperties.dedicatedCoreQuota.anonymous", + "@azure/arm-batch!BatchAccountPropertiesLowPriorityCoreQuota:type": "Microsoft.Batch.BatchAccountProperties.lowPriorityCoreQuota.anonymous", + "@azure/arm-batch!BatchAccountPropertiesDedicatedCoreQuotaPerVmFamily:type": "Microsoft.Batch.BatchAccountProperties.dedicatedCoreQuotaPerVMFamily.anonymous", + "@azure/arm-batch!BatchAccountPropertiesAllowedAuthenticationModes:type": "Microsoft.Batch.BatchAccountProperties.allowedAuthenticationModes.anonymous", + "@azure/arm-batch!BatchAccountCreatePropertiesAllowedAuthenticationModes:type": "Microsoft.Batch.BatchAccountCreateProperties.allowedAuthenticationModes.anonymous", + "@azure/arm-batch!BatchAccountUpdatePropertiesAllowedAuthenticationModes:type": "Microsoft.Batch.BatchAccountUpdateProperties.allowedAuthenticationModes.anonymous", + "@azure/arm-batch!LocationOperations#checkNameAvailability:member": "Microsoft.Batch.LocationOperationGroup.checkNameAvailability", + "@azure/arm-batch!LocationOperations#listSupportedVirtualMachineSkus:member": "Microsoft.Batch.LocationOperationGroup.listSupportedVirtualMachineSkus", + "@azure/arm-batch!LocationOperations#getQuotas:member": "Microsoft.Batch.LocationOperationGroup.getQuotas", + "@azure/arm-batch!NetworkSecurityPerimeterOperations#reconcileConfiguration:member": "Microsoft.Batch.NetworkSecurityPerimeterConfigurations.reconcileConfiguration", + "@azure/arm-batch!NetworkSecurityPerimeterOperations#listConfigurations:member": "Microsoft.Batch.NetworkSecurityPerimeterConfigurations.listConfigurations", + "@azure/arm-batch!NetworkSecurityPerimeterOperations#getConfiguration:member": "Microsoft.Batch.NetworkSecurityPerimeterConfigurations.getConfiguration", + "@azure/arm-batch!PoolOperations#stopResize:member": "Microsoft.Batch.Pools.stopResize", + "@azure/arm-batch!PoolOperations#disableAutoScale:member": "Microsoft.Batch.Pools.disableAutoScale", + "@azure/arm-batch!PoolOperations#listByBatchAccount:member": "Microsoft.Batch.Pools.listByBatchAccount", + "@azure/arm-batch!PoolOperations#delete:member": "Microsoft.Batch.Pools.delete", + "@azure/arm-batch!PoolOperations#update:member": "Microsoft.Batch.Pools.update", + "@azure/arm-batch!PoolOperations#create:member": "Microsoft.Batch.Pools.create", + "@azure/arm-batch!PoolOperations#get:member": "Microsoft.Batch.Pools.get", + "@azure/arm-batch!PrivateEndpointConnectionOperations#listByBatchAccount:member": "Microsoft.Batch.PrivateEndpointConnections.listByBatchAccount", + "@azure/arm-batch!PrivateEndpointConnectionOperations#delete:member": "Microsoft.Batch.PrivateEndpointConnections.delete", + "@azure/arm-batch!PrivateEndpointConnectionOperations#update:member": "Microsoft.Batch.PrivateEndpointConnections.update", + "@azure/arm-batch!PrivateEndpointConnectionOperations#get:member": "Microsoft.Batch.PrivateEndpointConnections.get", + "@azure/arm-batch!PrivateLinkResourceOperations#listByBatchAccount:member": "Microsoft.Batch.PrivateLinkResources.listByBatchAccount", + "@azure/arm-batch!PrivateLinkResourceOperations#get:member": "Microsoft.Batch.PrivateLinkResources.get", + "@azure/arm-batch!ApplicationOperations#list:member": "Microsoft.Batch.Applications.list", + "@azure/arm-batch!ApplicationOperations#delete:member": "Microsoft.Batch.Applications.delete", + "@azure/arm-batch!ApplicationOperations#update:member": "Microsoft.Batch.Applications.update", + "@azure/arm-batch!ApplicationOperations#create:member": "Microsoft.Batch.Applications.create", + "@azure/arm-batch!ApplicationOperations#get:member": "Microsoft.Batch.Applications.get", + "@azure/arm-batch!ApplicationPackageOperations#activate:member": "Microsoft.Batch.ApplicationPackages.activate", + "@azure/arm-batch!ApplicationPackageOperations#list:member": "Microsoft.Batch.ApplicationPackages.list", + "@azure/arm-batch!ApplicationPackageOperations#delete:member": "Microsoft.Batch.ApplicationPackages.delete", + "@azure/arm-batch!ApplicationPackageOperations#create:member": "Microsoft.Batch.ApplicationPackages.create", + "@azure/arm-batch!ApplicationPackageOperations#get:member": "Microsoft.Batch.ApplicationPackages.get", + "@azure/arm-batch!BatchAccountOperations#listDetectors:member": "Microsoft.Batch.DetectorResponses.listDetectors", + "@azure/arm-batch!BatchAccountOperations#getDetector:member": "Microsoft.Batch.DetectorResponses.getDetector", + "@azure/arm-batch!BatchAccountOperations#listOutboundNetworkDependenciesEndpoints:member": "Microsoft.Batch.BatchAccounts.listOutboundNetworkDependenciesEndpoints", + "@azure/arm-batch!BatchAccountOperations#getKeys:member": "Microsoft.Batch.BatchAccounts.getKeys", + "@azure/arm-batch!BatchAccountOperations#regenerateKey:member": "Microsoft.Batch.BatchAccounts.regenerateKey", + "@azure/arm-batch!BatchAccountOperations#synchronizeAutoStorageKeys:member": "Microsoft.Batch.BatchAccounts.synchronizeAutoStorageKeys", + "@azure/arm-batch!BatchAccountOperations#list:member": "Microsoft.Batch.BatchAccounts.list", + "@azure/arm-batch!BatchAccountOperations#listByResourceGroup:member": "Microsoft.Batch.BatchAccounts.listByResourceGroup", + "@azure/arm-batch!BatchAccountOperations#delete:member": "Microsoft.Batch.BatchAccounts.delete", + "@azure/arm-batch!BatchAccountOperations#update:member": "Microsoft.Batch.BatchAccounts.update", + "@azure/arm-batch!BatchAccountOperations#create:member": "Microsoft.Batch.BatchAccounts.create", + "@azure/arm-batch!BatchAccountOperations#get:member": "Microsoft.Batch.BatchAccounts.get", + "@azure/arm-batch!OperationsOperations#list:member": "Azure.ResourceManager.Legacy.Operations.list" + } + } +} diff --git a/sdk/batch/arm-batch/package.json b/sdk/batch/arm-batch/package.json index bcd929a95ec4..6c05fe3f0a7a 100644 --- a/sdk/batch/arm-batch/package.json +++ b/sdk/batch/arm-batch/package.json @@ -1,118 +1,127 @@ { "name": "@azure/arm-batch", - "sdk-type": "mgmt", - "author": "Microsoft Corporation", - "description": "A generated SDK for BatchManagementClient.", "version": "10.0.2", + "description": "A generated SDK for BatchManagementClient.", "engines": { "node": ">=20.0.0" }, - "dependencies": { - "@azure/abort-controller": "^2.1.2", - "@azure/core-auth": "^1.9.0", - "@azure/core-client": "^1.9.2", - "@azure/core-lro": "^2.7.2", - "@azure/core-paging": "^1.6.2", - "@azure/core-rest-pipeline": "^1.18.1", - "tslib": "^2.8.1" + "sideEffects": false, + "autoPublish": false, + "tshy": { + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts", + "./api": "./src/api/index.ts", + "./api/location": "src/api/location/index.ts", + "./api/networkSecurityPerimeter": "src/api/networkSecurityPerimeter/index.ts", + "./api/pool": "src/api/pool/index.ts", + "./api/privateEndpointConnection": "src/api/privateEndpointConnection/index.ts", + "./api/privateLinkResource": "src/api/privateLinkResource/index.ts", + "./api/application": "src/api/application/index.ts", + "./api/applicationPackage": "src/api/applicationPackage/index.ts", + "./api/batchAccount": "src/api/batchAccount/index.ts", + "./api/operations": "src/api/operations/index.ts", + "./models": "./src/models/index.ts" + }, + "dialects": [ + "esm", + "commonjs" + ], + "esmDialects": [ + "browser", + "react-native" + ], + "selfLink": false, + "project": "../../../tsconfig.src.build.json" }, + "type": "module", + "browser": "./dist/browser/index.js", + "react-native": "./dist/react-native/index.js", "keywords": [ "node", "azure", + "cloud", "typescript", "browser", - "isomorphic", - "cloud" + "isomorphic" ], + "author": "Microsoft Corporation", "license": "MIT", - "main": "./dist/commonjs/index.js", - "module": "./dist/esm/index.js", - "types": "./dist/commonjs/index.d.ts", + "files": [ + "dist/", + "!dist/**/*.d.*ts.map", + "README.md", + "LICENSE" + ], + "sdk-type": "mgmt", + "repository": "github:Azure/azure-sdk-for-js", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/batch/arm-batch/README.md", + "prettier": "@azure/eslint-plugin-azure-sdk/prettier.json", + "//metadata": { + "constantPaths": [ + { + "path": "src/api/batchManagementContext.ts", + "prefix": "userAgentInfo" + } + ] + }, + "dependencies": { + "@azure/core-util": "^1.12.0", + "@azure-rest/core-client": "^2.3.1", + "@azure/abort-controller": "^2.1.2", + "@azure/core-auth": "^1.9.0", + "@azure/core-lro": "^3.1.0", + "@azure/core-rest-pipeline": "^1.20.0", + "@azure/logger": "^1.2.0", + "tslib": "^2.8.1" + }, "devDependencies": { "@azure-tools/test-credential": "workspace:^", "@azure-tools/test-recorder": "workspace:^", "@azure-tools/test-utils-vitest": "workspace:^", - "@azure/arm-storage": "catalog:arm", "@azure/dev-tool": "workspace:^", + "tshy": "catalog:", + "@azure/eslint-plugin-azure-sdk": "workspace:^", "@azure/identity": "catalog:internal", - "@azure/logger": "^1.1.4", "@types/node": "catalog:", + "cross-env": "catalog:", + "eslint": "catalog:", + "prettier": "catalog:", + "rimraf": "catalog:", "@vitest/browser-playwright": "catalog:testing", "@vitest/coverage-istanbul": "catalog:testing", - "cross-env": "catalog:", "dotenv": "catalog:testing", "playwright": "catalog:testing", - "rimraf": "catalog:", "typescript": "catalog:", "vitest": "catalog:testing" }, - "repository": "github:Azure/azure-sdk-for-js", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "files": [ - "dist/", - "README.md", - "LICENSE", - "review/", - "CHANGELOG.md" - ], "scripts": { - "build": "npm run clean && dev-tool run build-package && dev-tool run extract-api", - "build:samples": "tsc -p tsconfig.samples.json && dev-tool samples publish -f", - "check-format": "echo skipped", "clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", - "execute:samples": "echo skipped", - "extract-api": "dev-tool run extract-api", - "format": "echo skipped", - "lint": "echo skipped", + "extract-api": "rimraf review && dev-tool run extract-api", "pack": "pnpm pack 2>&1", + "lint": "echo skipped", + "lint:fix": "echo skipped", + "build:samples": "tsc -p tsconfig.samples.json && dev-tool samples publish -f", + "check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" \"samples-dev/*.ts\"", + "execute:samples": "dev-tool samples run samples-dev", + "format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" \"samples-dev/*.ts\"", + "generate:client": "echo skipped", + "test:browser": "dev-tool run build-test && dev-tool run test:vitest --browser", + "build": "npm run clean && dev-tool run build-package && dev-tool run extract-api", + "test:node": "dev-tool run test:vitest", + "test:node:esm": "dev-tool run test:vitest --esm", "test": "npm run test:node && npm run test:browser", - "test:browser": "echo skipped", - "test:node": "dev-tool run build-test --no-browser-test && dev-tool run test:vitest", "update-snippets": "dev-tool run update-snippets" }, - "sideEffects": false, - "//metadata": { - "constantPaths": [ - { - "path": "src/batchManagementClient.ts", - "prefix": "packageDetails" - } - ] - }, - "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/batch/arm-batch", "//sampleConfiguration": { - "productName": "", + "productName": "@azure/arm-batch", "productSlugs": [ "azure" ], "disableDocsMs": true, "apiRefLink": "https://learn.microsoft.com/javascript/api/@azure/arm-batch?view=azure-node-preview" - }, - "type": "module", - "browser": "./dist/browser/index.js", - "react-native": "./dist/react-native/index.js", - "exports": { - "./package.json": "./package.json", - ".": { - "browser": { - "types": "./dist/browser/index.d.ts", - "default": "./dist/browser/index.js" - }, - "react-native": { - "types": "./dist/react-native/index.d.ts", - "default": "./dist/react-native/index.js" - }, - "import": { - "types": "./dist/esm/index.d.ts", - "default": "./dist/esm/index.js" - }, - "require": { - "types": "./dist/commonjs/index.d.ts", - "default": "./dist/commonjs/index.js" - } - } } } diff --git a/sdk/batch/arm-batch/review/arm-batch-node.api.md b/sdk/batch/arm-batch/review/arm-batch-node.api.md deleted file mode 100644 index 5f28122b70ae..000000000000 --- a/sdk/batch/arm-batch/review/arm-batch-node.api.md +++ /dev/null @@ -1,1854 +0,0 @@ -## API Report File for "@azure/arm-batch" - -> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). - -```ts - -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 { SimplePollerLike } from '@azure/core-lro'; - -// @public -export interface AccessRule { - name?: string; - properties?: AccessRuleProperties; -} - -// @public -export type AccessRuleDirection = string; - -// @public -export interface AccessRuleProperties { - addressPrefixes?: string[]; - direction?: AccessRuleDirection; - emailAddresses?: string[]; - fullyQualifiedDomainNames?: string[]; - networkSecurityPerimeters?: NetworkSecurityPerimeter[]; - phoneNumbers?: string[]; - subscriptions?: AccessRulePropertiesSubscriptionsItem[]; -} - -// @public -export interface AccessRulePropertiesSubscriptionsItem { - id?: string; -} - -// @public -export type AccountKeyType = "Primary" | "Secondary"; - -// @public -export interface ActivateApplicationPackageParameters { - format: string; -} - -// @public -export type AllocationState = "Steady" | "Resizing" | "Stopping"; - -// @public -export interface Application extends AzureProxyResource { - allowUpdates?: boolean; - defaultVersion?: string; - displayName?: string; -} - -// @public -export interface ApplicationCreateOptionalParams extends coreClient.OperationOptions { - parameters?: Application; -} - -// @public -export type ApplicationCreateResponse = Application; - -// @public -export interface ApplicationDeleteOptionalParams extends coreClient.OperationOptions { -} - -// @public -export interface ApplicationGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type ApplicationGetResponse = Application; - -// @public -export interface ApplicationListNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type ApplicationListNextResponse = ListApplicationsResult; - -// @public -export interface ApplicationListOptionalParams extends coreClient.OperationOptions { - maxresults?: number; -} - -// @public -export type ApplicationListResponse = ListApplicationsResult; - -// @public -export interface ApplicationOperations { - create(resourceGroupName: string, accountName: string, applicationName: string, options?: ApplicationCreateOptionalParams): Promise; - delete(resourceGroupName: string, accountName: string, applicationName: string, options?: ApplicationDeleteOptionalParams): Promise; - get(resourceGroupName: string, accountName: string, applicationName: string, options?: ApplicationGetOptionalParams): Promise; - list(resourceGroupName: string, accountName: string, options?: ApplicationListOptionalParams): PagedAsyncIterableIterator; - update(resourceGroupName: string, accountName: string, applicationName: string, parameters: Application, options?: ApplicationUpdateOptionalParams): Promise; -} - -// @public -export interface ApplicationPackage extends AzureProxyResource { - readonly format?: string; - readonly lastActivationTime?: Date; - readonly state?: PackageState; - readonly storageUrl?: string; - readonly storageUrlExpiry?: Date; -} - -// @public -export interface ApplicationPackageActivateOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type ApplicationPackageActivateResponse = ApplicationPackage; - -// @public -export interface ApplicationPackageCreateOptionalParams extends coreClient.OperationOptions { - parameters?: ApplicationPackage; -} - -// @public -export type ApplicationPackageCreateResponse = ApplicationPackage; - -// @public -export interface ApplicationPackageDeleteOptionalParams extends coreClient.OperationOptions { -} - -// @public -export interface ApplicationPackageGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type ApplicationPackageGetResponse = ApplicationPackage; - -// @public -export interface ApplicationPackageListNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type ApplicationPackageListNextResponse = ListApplicationPackagesResult; - -// @public -export interface ApplicationPackageListOptionalParams extends coreClient.OperationOptions { - maxresults?: number; -} - -// @public -export type ApplicationPackageListResponse = ListApplicationPackagesResult; - -// @public -export interface ApplicationPackageOperations { - activate(resourceGroupName: string, accountName: string, applicationName: string, versionName: string, parameters: ActivateApplicationPackageParameters, options?: ApplicationPackageActivateOptionalParams): Promise; - create(resourceGroupName: string, accountName: string, applicationName: string, versionName: string, options?: ApplicationPackageCreateOptionalParams): Promise; - delete(resourceGroupName: string, accountName: string, applicationName: string, versionName: string, options?: ApplicationPackageDeleteOptionalParams): Promise; - get(resourceGroupName: string, accountName: string, applicationName: string, versionName: string, options?: ApplicationPackageGetOptionalParams): Promise; - list(resourceGroupName: string, accountName: string, applicationName: string, options?: ApplicationPackageListOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface ApplicationPackageReference { - id: string; - version?: string; -} - -// @public -export interface ApplicationUpdateOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type ApplicationUpdateResponse = Application; - -// @public -export type AuthenticationMode = "SharedKey" | "AAD" | "TaskAuthenticationToken"; - -// @public -export interface AutomaticOSUpgradePolicy { - disableAutomaticRollback?: boolean; - enableAutomaticOSUpgrade?: boolean; - osRollingUpgradeDeferral?: boolean; - useRollingUpgradePolicy?: boolean; -} - -// @public -export interface AutoScaleRun { - error?: AutoScaleRunError; - evaluationTime: Date; - results?: string; -} - -// @public -export interface AutoScaleRunError { - code: string; - details?: AutoScaleRunError[]; - message: string; -} - -// @public -export interface AutoScaleSettings { - evaluationInterval?: string; - formula: string; -} - -// @public -export type AutoStorageAuthenticationMode = "StorageKeys" | "BatchAccountManagedIdentity"; - -// @public -export interface AutoStorageBaseProperties { - authenticationMode?: AutoStorageAuthenticationMode; - nodeIdentityReference?: ComputeNodeIdentityReference; - storageAccountId: string; -} - -// @public -export interface AutoStorageProperties extends AutoStorageBaseProperties { - lastKeySync: Date; -} - -// @public -export type AutoUserScope = "Task" | "Pool"; - -// @public -export interface AutoUserSpecification { - elevationLevel?: ElevationLevel; - scope?: AutoUserScope; -} - -// @public -export interface AzureBlobFileSystemConfiguration { - accountKey?: string; - accountName: string; - blobfuseOptions?: string; - containerName: string; - identityReference?: ComputeNodeIdentityReference; - relativeMountPath: string; - sasKey?: string; -} - -// @public -export interface AzureFileShareConfiguration { - accountKey: string; - accountName: string; - azureFileUrl: string; - mountOptions?: string; - relativeMountPath: string; -} - -// @public -export interface AzureProxyResource { - readonly etag?: string; - readonly id?: string; - readonly name?: string; - tags?: { - [propertyName: string]: string; - }; - readonly type?: string; -} - -// @public -export interface AzureResource { - readonly id?: string; - readonly location?: string; - readonly name?: string; - readonly tags?: { - [propertyName: string]: string; - }; - readonly type?: string; -} - -// @public -export interface BatchAccount extends AzureResource { - readonly accountEndpoint?: string; - readonly activeJobAndJobScheduleQuota?: number; - readonly allowedAuthenticationModes?: AuthenticationMode[]; - readonly autoStorage?: AutoStorageProperties; - readonly dedicatedCoreQuota?: number; - readonly dedicatedCoreQuotaPerVMFamily?: VirtualMachineFamilyCoreQuota[]; - readonly dedicatedCoreQuotaPerVMFamilyEnforced?: boolean; - readonly encryption?: EncryptionProperties; - identity?: BatchAccountIdentity; - readonly keyVaultReference?: KeyVaultReference; - readonly lowPriorityCoreQuota?: number; - networkProfile?: NetworkProfile; - readonly nodeManagementEndpoint?: string; - readonly poolAllocationMode?: PoolAllocationMode; - readonly poolQuota?: number; - readonly privateEndpointConnections?: PrivateEndpointConnection[]; - readonly provisioningState?: ProvisioningState; - publicNetworkAccess?: PublicNetworkAccessType; -} - -// @public -export interface BatchAccountCreateHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface BatchAccountCreateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export interface BatchAccountCreateParameters { - allowedAuthenticationModes?: AuthenticationMode[]; - autoStorage?: AutoStorageBaseProperties; - encryption?: EncryptionProperties; - identity?: BatchAccountIdentity; - keyVaultReference?: KeyVaultReference; - location: string; - networkProfile?: NetworkProfile; - poolAllocationMode?: PoolAllocationMode; - publicNetworkAccess?: PublicNetworkAccessType; - tags?: { - [propertyName: string]: string; - }; -} - -// @public -export type BatchAccountCreateResponse = BatchAccount; - -// @public -export interface BatchAccountDeleteHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface BatchAccountDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export interface BatchAccountGetDetectorOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type BatchAccountGetDetectorResponse = DetectorResponse; - -// @public -export interface BatchAccountGetKeysOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type BatchAccountGetKeysResponse = BatchAccountKeys; - -// @public -export interface BatchAccountGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type BatchAccountGetResponse = BatchAccount; - -// @public -export interface BatchAccountIdentity { - readonly principalId?: string; - readonly tenantId?: string; - type: ResourceIdentityType; - userAssignedIdentities?: { - [propertyName: string]: UserAssignedIdentities; - }; -} - -// @public -export interface BatchAccountKeys { - readonly accountName?: string; - readonly primary?: string; - readonly secondary?: string; -} - -// @public -export interface BatchAccountListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type BatchAccountListByResourceGroupNextResponse = BatchAccountListResult; - -// @public -export interface BatchAccountListByResourceGroupOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type BatchAccountListByResourceGroupResponse = BatchAccountListResult; - -// @public -export interface BatchAccountListDetectorsNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type BatchAccountListDetectorsNextResponse = DetectorListResult; - -// @public -export interface BatchAccountListDetectorsOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type BatchAccountListDetectorsResponse = DetectorListResult; - -// @public -export interface BatchAccountListNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type BatchAccountListNextResponse = BatchAccountListResult; - -// @public -export interface BatchAccountListOptionalParams extends coreClient.OperationOptions { -} - -// @public -export interface BatchAccountListOutboundNetworkDependenciesEndpointsNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type BatchAccountListOutboundNetworkDependenciesEndpointsNextResponse = OutboundEnvironmentEndpointCollection; - -// @public -export interface BatchAccountListOutboundNetworkDependenciesEndpointsOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type BatchAccountListOutboundNetworkDependenciesEndpointsResponse = OutboundEnvironmentEndpointCollection; - -// @public -export type BatchAccountListResponse = BatchAccountListResult; - -// @public -export interface BatchAccountListResult { - nextLink?: string; - value?: BatchAccount[]; -} - -// @public -export interface BatchAccountOperations { - 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>>; - 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; - getKeys(resourceGroupName: string, accountName: string, options?: BatchAccountGetKeysOptionalParams): Promise; - list(options?: BatchAccountListOptionalParams): PagedAsyncIterableIterator; - listByResourceGroup(resourceGroupName: string, options?: BatchAccountListByResourceGroupOptionalParams): PagedAsyncIterableIterator; - listDetectors(resourceGroupName: string, accountName: string, options?: BatchAccountListDetectorsOptionalParams): PagedAsyncIterableIterator; - listOutboundNetworkDependenciesEndpoints(resourceGroupName: string, accountName: string, options?: BatchAccountListOutboundNetworkDependenciesEndpointsOptionalParams): PagedAsyncIterableIterator; - regenerateKey(resourceGroupName: string, accountName: string, parameters: BatchAccountRegenerateKeyParameters, options?: BatchAccountRegenerateKeyOptionalParams): Promise; - synchronizeAutoStorageKeys(resourceGroupName: string, accountName: string, options?: BatchAccountSynchronizeAutoStorageKeysOptionalParams): Promise; - update(resourceGroupName: string, accountName: string, parameters: BatchAccountUpdateParameters, options?: BatchAccountUpdateOptionalParams): Promise; -} - -// @public -export interface BatchAccountRegenerateKeyOptionalParams extends coreClient.OperationOptions { -} - -// @public -export interface BatchAccountRegenerateKeyParameters { - keyName: AccountKeyType; -} - -// @public -export type BatchAccountRegenerateKeyResponse = BatchAccountKeys; - -// @public -export interface BatchAccountSynchronizeAutoStorageKeysOptionalParams extends coreClient.OperationOptions { -} - -// @public -export interface BatchAccountUpdateOptionalParams extends coreClient.OperationOptions { -} - -// @public -export interface BatchAccountUpdateParameters { - allowedAuthenticationModes?: AuthenticationMode[]; - autoStorage?: AutoStorageBaseProperties; - encryption?: EncryptionProperties; - identity?: BatchAccountIdentity; - networkProfile?: NetworkProfile; - publicNetworkAccess?: PublicNetworkAccessType; - tags?: { - [propertyName: string]: string; - }; -} - -// @public -export type BatchAccountUpdateResponse = BatchAccount; - -// @public -export interface BatchLocationQuota { - readonly accountQuota?: number; -} - -// @public (undocumented) -export class BatchManagementClient extends coreClient.ServiceClient { - // (undocumented) - $host: string; - constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: BatchManagementClientOptionalParams); - // (undocumented) - apiVersion: string; - // (undocumented) - applicationOperations: ApplicationOperations; - // (undocumented) - applicationPackageOperations: ApplicationPackageOperations; - // (undocumented) - batchAccountOperations: BatchAccountOperations; - // (undocumented) - certificateOperations: CertificateOperations; - // (undocumented) - location: Location; - // (undocumented) - networkSecurityPerimeterOperations: NetworkSecurityPerimeterOperations; - // (undocumented) - operations: Operations; - // (undocumented) - poolOperations: PoolOperations; - // (undocumented) - privateEndpointConnectionOperations: PrivateEndpointConnectionOperations; - // (undocumented) - privateLinkResourceOperations: PrivateLinkResourceOperations; - // (undocumented) - subscriptionId: string; -} - -// @public -export interface BatchManagementClientOptionalParams extends coreClient.ServiceClientOptions { - $host?: string; - apiVersion?: string; - endpoint?: string; -} - -// @public -export interface BatchPoolIdentity { - type: PoolIdentityType; - userAssignedIdentities?: { - [propertyName: string]: UserAssignedIdentities; - }; -} - -// @public -export type CachingType = "None" | "ReadOnly" | "ReadWrite"; - -// @public -export interface Certificate extends AzureProxyResource { - readonly deleteCertificateError?: DeleteCertificateError; - format?: CertificateFormat; - readonly previousProvisioningState?: CertificateProvisioningState; - readonly previousProvisioningStateTransitionTime?: Date; - readonly provisioningState?: CertificateProvisioningState; - readonly provisioningStateTransitionTime?: Date; - readonly publicData?: string; - thumbprint?: string; - thumbprintAlgorithm?: string; -} - -// @public -export interface CertificateBaseProperties { - format?: CertificateFormat; - thumbprint?: string; - thumbprintAlgorithm?: string; -} - -// @public -export interface CertificateCancelDeletionHeaders { - eTag?: string; -} - -// @public -export interface CertificateCancelDeletionOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type CertificateCancelDeletionResponse = CertificateCancelDeletionHeaders & Certificate; - -// @public -export interface CertificateCreateHeaders { - eTag?: string; -} - -// @public -export interface CertificateCreateOptionalParams extends coreClient.OperationOptions { - ifMatch?: string; - ifNoneMatch?: string; -} - -// @public -export interface CertificateCreateOrUpdateParameters extends AzureProxyResource { - data?: string; - format?: CertificateFormat; - password?: string; - thumbprint?: string; - thumbprintAlgorithm?: string; -} - -// @public -export interface CertificateCreateOrUpdateProperties extends CertificateBaseProperties { - data: string; - password?: string; -} - -// @public -export type CertificateCreateResponse = CertificateCreateHeaders & Certificate; - -// @public -export interface CertificateDeleteHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface CertificateDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export type CertificateFormat = "Pfx" | "Cer"; - -// @public -export interface CertificateGetHeaders { - eTag?: string; -} - -// @public -export interface CertificateGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type CertificateGetResponse = CertificateGetHeaders & Certificate; - -// @public -export interface CertificateListByBatchAccountNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type CertificateListByBatchAccountNextResponse = ListCertificatesResult; - -// @public -export interface CertificateListByBatchAccountOptionalParams extends coreClient.OperationOptions { - filter?: string; - maxresults?: number; - select?: string; -} - -// @public -export type CertificateListByBatchAccountResponse = ListCertificatesResult; - -// @public -export interface CertificateOperations { - 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; - get(resourceGroupName: string, accountName: string, certificateName: string, options?: CertificateGetOptionalParams): Promise; - listByBatchAccount(resourceGroupName: string, accountName: string, options?: CertificateListByBatchAccountOptionalParams): PagedAsyncIterableIterator; - update(resourceGroupName: string, accountName: string, certificateName: string, parameters: CertificateCreateOrUpdateParameters, options?: CertificateUpdateOptionalParams): Promise; -} - -// @public -export interface CertificateProperties extends CertificateBaseProperties { - readonly deleteCertificateError?: DeleteCertificateError; - readonly previousProvisioningState?: CertificateProvisioningState; - readonly previousProvisioningStateTransitionTime?: Date; - readonly provisioningState?: CertificateProvisioningState; - readonly provisioningStateTransitionTime?: Date; - readonly publicData?: string; -} - -// @public -export type CertificateProvisioningState = "Succeeded" | "Deleting" | "Failed"; - -// @public -export interface CertificateReference { - id: string; - storeLocation?: CertificateStoreLocation; - storeName?: string; - visibility?: CertificateVisibility[]; -} - -// @public -export type CertificateStoreLocation = "CurrentUser" | "LocalMachine"; - -// @public -export interface CertificateUpdateHeaders { - eTag?: string; -} - -// @public -export interface CertificateUpdateOptionalParams extends coreClient.OperationOptions { - ifMatch?: string; -} - -// @public -export type CertificateUpdateResponse = CertificateUpdateHeaders & Certificate; - -// @public -export type CertificateVisibility = "StartTask" | "Task" | "RemoteUser"; - -// @public -export interface CheckNameAvailabilityParameters { - name: string; - type: "Microsoft.Batch/batchAccounts"; -} - -// @public -export interface CheckNameAvailabilityResult { - readonly message?: string; - readonly nameAvailable?: boolean; - readonly reason?: NameAvailabilityReason; -} - -// @public -export interface CifsMountConfiguration { - mountOptions?: string; - password: string; - relativeMountPath: string; - source: string; - userName: string; -} - -// @public -export interface CloudError { - error?: CloudErrorBody; -} - -// @public -export interface CloudErrorBody { - code?: string; - details?: CloudErrorBody[]; - message?: string; - target?: string; -} - -// @public -export type ComputeNodeDeallocationOption = "Requeue" | "Terminate" | "TaskCompletion" | "RetainedData"; - -// @public -export type ComputeNodeFillType = "Spread" | "Pack"; - -// @public -export interface ComputeNodeIdentityReference { - resourceId?: string; -} - -// @public -export interface ContainerConfiguration { - containerImageNames?: string[]; - containerRegistries?: ContainerRegistry[]; - type: ContainerType; -} - -// @public -export interface ContainerHostBatchBindMountEntry { - isReadOnly?: boolean; - source?: ContainerHostDataPath; -} - -// @public -export type ContainerHostDataPath = string; - -// @public -export interface ContainerRegistry { - identityReference?: ComputeNodeIdentityReference; - password?: string; - registryServer?: string; - userName?: string; -} - -// @public -export type ContainerType = string; - -// @public -export type ContainerWorkingDirectory = "TaskWorkingDirectory" | "ContainerImageDefault"; - -// @public -export type CreatedByType = string; - -// @public -export interface DataDisk { - caching?: CachingType; - diskSizeGB: number; - lun: number; - storageAccountType?: StorageAccountType; -} - -// @public -export interface DeleteCertificateError { - code: string; - details?: DeleteCertificateError[]; - message: string; - target?: string; -} - -// @public -export interface DeploymentConfiguration { - virtualMachineConfiguration?: VirtualMachineConfiguration; -} - -// @public -export interface DetectorListResult { - nextLink?: string; - value?: DetectorResponse[]; -} - -// @public -export interface DetectorResponse extends AzureProxyResource { - value?: string; -} - -// @public -export interface DiffDiskSettings { - placement?: "CacheDisk"; -} - -// @public -export interface DiskEncryptionConfiguration { - targets?: DiskEncryptionTarget[]; -} - -// @public -export type DiskEncryptionTarget = "OsDisk" | "TemporaryDisk"; - -// @public -export type DynamicVNetAssignmentScope = "none" | "job"; - -// @public -export type ElevationLevel = "NonAdmin" | "Admin"; - -// @public -export interface EncryptionProperties { - keySource?: KeySource; - keyVaultProperties?: KeyVaultProperties; -} - -// @public -export type EndpointAccessDefaultAction = "Allow" | "Deny"; - -// @public -export interface EndpointAccessProfile { - defaultAction: EndpointAccessDefaultAction; - ipRules?: IPRule[]; -} - -// @public -export interface EndpointDependency { - readonly description?: string; - readonly domainName?: string; - readonly endpointDetails?: EndpointDetail[]; -} - -// @public -export interface EndpointDetail { - readonly port?: number; -} - -// @public -export interface EnvironmentSetting { - name: string; - value?: string; -} - -// @public -export interface ErrorAdditionalInfo { - readonly info?: Record; - readonly type?: string; -} - -// @public -export interface ErrorDetail { - readonly additionalInfo?: ErrorAdditionalInfo[]; - readonly code?: string; - readonly details?: ErrorDetail[]; - readonly message?: string; - readonly target?: string; -} - -// @public -export interface ErrorResponse { - error?: ErrorDetail; -} - -// @public -export interface FixedScaleSettings { - nodeDeallocationOption?: ComputeNodeDeallocationOption; - resizeTimeout?: string; - targetDedicatedNodes?: number; - targetLowPriorityNodes?: number; -} - -// @public -export function getContinuationToken(page: unknown): string | undefined; - -// @public -export interface ImageReference { - communityGalleryImageId?: string; - id?: string; - offer?: string; - publisher?: string; - sharedGalleryImageId?: string; - sku?: string; - version?: string; -} - -// @public -export type InboundEndpointProtocol = "TCP" | "UDP"; - -// @public -export interface InboundNatPool { - backendPort: number; - frontendPortRangeEnd: number; - frontendPortRangeStart: number; - name: string; - networkSecurityGroupRules?: NetworkSecurityGroupRule[]; - protocol: InboundEndpointProtocol; -} - -// @public -export type InterNodeCommunicationState = "Enabled" | "Disabled"; - -// @public -export type IPAddressProvisioningType = "BatchManaged" | "UserManaged" | "NoPublicIPAddresses"; - -// @public -export interface IPRule { - action: "Allow"; - value: string; -} - -// @public -export type IssueType = string; - -// @public -export type KeySource = "Microsoft.Batch" | "Microsoft.KeyVault"; - -// @public -export interface KeyVaultProperties { - keyIdentifier?: string; -} - -// @public -export interface KeyVaultReference { - id: string; - url: string; -} - -// @public -export enum KnownAccessRuleDirection { - Inbound = "Inbound", - Outbound = "Outbound" -} - -// @public -export enum KnownContainerHostDataPath { - Applications = "Applications", - JobPrep = "JobPrep", - Shared = "Shared", - Startup = "Startup", - Task = "Task", - VfsMounts = "VfsMounts" -} - -// @public -export enum KnownContainerType { - CriCompatible = "CriCompatible", - DockerCompatible = "DockerCompatible" -} - -// @public -export enum KnownCreatedByType { - Application = "Application", - Key = "Key", - ManagedIdentity = "ManagedIdentity", - User = "User" -} - -// @public -export enum KnownIssueType { - ConfigurationPropagationFailure = "ConfigurationPropagationFailure", - MissingIdentityConfiguration = "MissingIdentityConfiguration", - MissingPerimeterConfiguration = "MissingPerimeterConfiguration", - Unknown = "Unknown" -} - -// @public -export enum KnownNetworkSecurityPerimeterConfigurationProvisioningState { - Accepted = "Accepted", - Canceled = "Canceled", - Creating = "Creating", - Deleting = "Deleting", - Failed = "Failed", - Succeeded = "Succeeded", - Updating = "Updating" -} - -// @public -export enum KnownResourceAssociationAccessMode { - Audit = "Audit", - Enforced = "Enforced", - Learning = "Learning" -} - -// @public -export enum KnownSecurityEncryptionTypes { - NonPersistedTPM = "NonPersistedTPM", - VMGuestStateOnly = "VMGuestStateOnly" -} - -// @public -export enum KnownSeverity { - Error = "Error", - Warning = "Warning" -} - -// @public -export interface LinuxUserConfiguration { - gid?: number; - sshPrivateKey?: string; - uid?: number; -} - -// @public -export interface ListApplicationPackagesResult { - nextLink?: string; - value?: ApplicationPackage[]; -} - -// @public -export interface ListApplicationsResult { - nextLink?: string; - value?: Application[]; -} - -// @public -export interface ListCertificatesResult { - nextLink?: string; - value?: Certificate[]; -} - -// @public -export interface ListPoolsResult { - nextLink?: string; - value?: Pool[]; -} - -// @public -export interface ListPrivateEndpointConnectionsResult { - nextLink?: string; - value?: PrivateEndpointConnection[]; -} - -// @public -export interface ListPrivateLinkResourcesResult { - nextLink?: string; - value?: PrivateLinkResource[]; -} - -// @public -export interface Location { - checkNameAvailability(locationName: string, parameters: CheckNameAvailabilityParameters, options?: LocationCheckNameAvailabilityOptionalParams): Promise; - getQuotas(locationName: string, options?: LocationGetQuotasOptionalParams): Promise; - listSupportedVirtualMachineSkus(locationName: string, options?: LocationListSupportedVirtualMachineSkusOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface LocationCheckNameAvailabilityOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type LocationCheckNameAvailabilityResponse = CheckNameAvailabilityResult; - -// @public -export interface LocationGetQuotasOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type LocationGetQuotasResponse = BatchLocationQuota; - -// @public -export interface LocationListSupportedVirtualMachineSkusNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type LocationListSupportedVirtualMachineSkusNextResponse = SupportedSkusResult; - -// @public -export interface LocationListSupportedVirtualMachineSkusOptionalParams extends coreClient.OperationOptions { - filter?: string; - maxresults?: number; -} - -// @public -export type LocationListSupportedVirtualMachineSkusResponse = SupportedSkusResult; - -// @public -export type LoginMode = "Batch" | "Interactive"; - -// @public (undocumented) -export interface ManagedDisk { - securityProfile?: VMDiskSecurityProfile; - storageAccountType?: StorageAccountType; -} - -// @public -export interface MetadataItem { - name: string; - value: string; -} - -// @public -export interface MountConfiguration { - azureBlobFileSystemConfiguration?: AzureBlobFileSystemConfiguration; - azureFileShareConfiguration?: AzureFileShareConfiguration; - cifsMountConfiguration?: CifsMountConfiguration; - nfsMountConfiguration?: NFSMountConfiguration; -} - -// @public -export type NameAvailabilityReason = "Invalid" | "AlreadyExists"; - -// @public -export interface NetworkConfiguration { - dynamicVnetAssignmentScope?: DynamicVNetAssignmentScope; - enableAcceleratedNetworking?: boolean; - endpointConfiguration?: PoolEndpointConfiguration; - publicIPAddressConfiguration?: PublicIPAddressConfiguration; - subnetId?: string; -} - -// @public -export interface NetworkProfile { - accountAccess?: EndpointAccessProfile; - nodeManagementAccess?: EndpointAccessProfile; -} - -// @public -export interface NetworkSecurityGroupRule { - access: NetworkSecurityGroupRuleAccess; - priority: number; - sourceAddressPrefix: string; - sourcePortRanges?: string[]; -} - -// @public -export type NetworkSecurityGroupRuleAccess = "Allow" | "Deny"; - -// @public -export interface NetworkSecurityPerimeter { - id?: string; - location?: string; - perimeterGuid?: string; -} - -// @public -export interface NetworkSecurityPerimeterConfiguration extends ProxyResource { - properties?: NetworkSecurityPerimeterConfigurationProperties; -} - -// @public -export interface NetworkSecurityPerimeterConfigurationListResult { - nextLink?: string; - value?: NetworkSecurityPerimeterConfiguration[]; -} - -// @public -export interface NetworkSecurityPerimeterConfigurationProperties { - networkSecurityPerimeter?: NetworkSecurityPerimeter; - profile?: NetworkSecurityProfile; - readonly provisioningIssues?: ProvisioningIssue[]; - readonly provisioningState?: NetworkSecurityPerimeterConfigurationProvisioningState; - resourceAssociation?: ResourceAssociation; -} - -// @public -export type NetworkSecurityPerimeterConfigurationProvisioningState = string; - -// @public -export interface NetworkSecurityPerimeterGetConfigurationOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type NetworkSecurityPerimeterGetConfigurationResponse = NetworkSecurityPerimeterConfiguration; - -// @public -export interface NetworkSecurityPerimeterListConfigurationsNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type NetworkSecurityPerimeterListConfigurationsNextResponse = NetworkSecurityPerimeterConfigurationListResult; - -// @public -export interface NetworkSecurityPerimeterListConfigurationsOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type NetworkSecurityPerimeterListConfigurationsResponse = NetworkSecurityPerimeterConfigurationListResult; - -// @public -export interface NetworkSecurityPerimeterOperations { - beginReconcileConfiguration(resourceGroupName: string, accountName: string, networkSecurityPerimeterConfigurationName: string, options?: NetworkSecurityPerimeterReconcileConfigurationOptionalParams): Promise, NetworkSecurityPerimeterReconcileConfigurationResponse>>; - beginReconcileConfigurationAndWait(resourceGroupName: string, accountName: string, networkSecurityPerimeterConfigurationName: string, options?: NetworkSecurityPerimeterReconcileConfigurationOptionalParams): Promise; - getConfiguration(resourceGroupName: string, accountName: string, networkSecurityPerimeterConfigurationName: string, options?: NetworkSecurityPerimeterGetConfigurationOptionalParams): Promise; - listConfigurations(resourceGroupName: string, accountName: string, options?: NetworkSecurityPerimeterListConfigurationsOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface NetworkSecurityPerimeterReconcileConfigurationHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface NetworkSecurityPerimeterReconcileConfigurationOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export type NetworkSecurityPerimeterReconcileConfigurationResponse = NetworkSecurityPerimeterReconcileConfigurationHeaders; - -// @public -export interface NetworkSecurityProfile { - accessRules?: AccessRule[]; - accessRulesVersion?: number; - diagnosticSettingsVersion?: number; - enabledLogCategories?: string[]; - name?: string; -} - -// @public -export interface NFSMountConfiguration { - mountOptions?: string; - relativeMountPath: string; - source: string; -} - -// @public -export type NodeCommunicationMode = "Default" | "Classic" | "Simplified"; - -// @public -export interface NodePlacementConfiguration { - policy?: NodePlacementPolicyType; -} - -// @public -export type NodePlacementPolicyType = "Regional" | "Zonal"; - -// @public -export interface Operation { - display?: OperationDisplay; - isDataAction?: boolean; - name?: string; - origin?: string; - properties?: Record; -} - -// @public -export interface OperationDisplay { - description?: string; - operation?: string; - provider?: string; - resource?: string; -} - -// @public -export interface OperationListResult { - nextLink?: string; - value?: Operation[]; -} - -// @public -export interface Operations { - list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type OperationsListNextResponse = OperationListResult; - -// @public -export interface OperationsListOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type OperationsListResponse = OperationListResult; - -// @public -export interface OSDisk { - caching?: CachingType; - diskSizeGB?: number; - ephemeralOSDiskSettings?: DiffDiskSettings; - // (undocumented) - managedDisk?: ManagedDisk; - writeAcceleratorEnabled?: boolean; -} - -// @public -export interface OutboundEnvironmentEndpoint { - readonly category?: string; - readonly endpoints?: EndpointDependency[]; -} - -// @public -export interface OutboundEnvironmentEndpointCollection { - nextLink?: string; - readonly value?: OutboundEnvironmentEndpoint[]; -} - -// @public -export type PackageState = "Pending" | "Active"; - -// @public -export interface Pool extends AzureProxyResource { - readonly allocationState?: AllocationState; - readonly allocationStateTransitionTime?: Date; - applicationLicenses?: string[]; - applicationPackages?: ApplicationPackageReference[]; - readonly autoScaleRun?: AutoScaleRun; - certificates?: CertificateReference[]; - readonly creationTime?: Date; - readonly currentDedicatedNodes?: number; - readonly currentLowPriorityNodes?: number; - readonly currentNodeCommunicationMode?: NodeCommunicationMode; - deploymentConfiguration?: DeploymentConfiguration; - displayName?: string; - identity?: BatchPoolIdentity; - interNodeCommunication?: InterNodeCommunicationState; - readonly lastModified?: Date; - metadata?: MetadataItem[]; - mountConfiguration?: MountConfiguration[]; - networkConfiguration?: NetworkConfiguration; - readonly provisioningState?: PoolProvisioningState; - readonly provisioningStateTransitionTime?: Date; - readonly resizeOperationStatus?: ResizeOperationStatus; - resourceTags?: { - [propertyName: string]: string; - }; - scaleSettings?: ScaleSettings; - startTask?: StartTask; - targetNodeCommunicationMode?: NodeCommunicationMode; - taskSchedulingPolicy?: TaskSchedulingPolicy; - taskSlotsPerNode?: number; - upgradePolicy?: UpgradePolicy; - userAccounts?: UserAccount[]; - vmSize?: string; -} - -// @public -export type PoolAllocationMode = "BatchService" | "UserSubscription"; - -// @public -export interface PoolCreateHeaders { - eTag?: string; -} - -// @public -export interface PoolCreateOptionalParams extends coreClient.OperationOptions { - ifMatch?: string; - ifNoneMatch?: string; -} - -// @public -export type PoolCreateResponse = PoolCreateHeaders & Pool; - -// @public -export interface PoolDeleteHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface PoolDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export interface PoolDisableAutoScaleHeaders { - eTag?: string; -} - -// @public -export interface PoolDisableAutoScaleOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PoolDisableAutoScaleResponse = PoolDisableAutoScaleHeaders & Pool; - -// @public -export interface PoolEndpointConfiguration { - inboundNatPools: InboundNatPool[]; -} - -// @public -export interface PoolGetHeaders { - eTag?: string; -} - -// @public -export interface PoolGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PoolGetResponse = PoolGetHeaders & Pool; - -// @public -export type PoolIdentityType = "UserAssigned" | "None"; - -// @public -export interface PoolListByBatchAccountNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PoolListByBatchAccountNextResponse = ListPoolsResult; - -// @public -export interface PoolListByBatchAccountOptionalParams extends coreClient.OperationOptions { - filter?: string; - maxresults?: number; - select?: string; -} - -// @public -export type PoolListByBatchAccountResponse = ListPoolsResult; - -// @public -export interface PoolOperations { - 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; - get(resourceGroupName: string, accountName: string, poolName: string, options?: PoolGetOptionalParams): Promise; - listByBatchAccount(resourceGroupName: string, accountName: string, options?: PoolListByBatchAccountOptionalParams): PagedAsyncIterableIterator; - stopResize(resourceGroupName: string, accountName: string, poolName: string, options?: PoolStopResizeOptionalParams): Promise; - update(resourceGroupName: string, accountName: string, poolName: string, parameters: Pool, options?: PoolUpdateOptionalParams): Promise; -} - -// @public -export type PoolProvisioningState = "Succeeded" | "Deleting"; - -// @public -export interface PoolStopResizeHeaders { - eTag?: string; -} - -// @public -export interface PoolStopResizeOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PoolStopResizeResponse = PoolStopResizeHeaders & Pool; - -// @public -export interface PoolUpdateHeaders { - eTag?: string; -} - -// @public -export interface PoolUpdateOptionalParams extends coreClient.OperationOptions { - ifMatch?: string; -} - -// @public -export type PoolUpdateResponse = PoolUpdateHeaders & Pool; - -// @public -export interface PrivateEndpoint { - readonly id?: string; -} - -// @public -export interface PrivateEndpointConnection extends AzureProxyResource { - readonly groupIds?: string[]; - readonly privateEndpoint?: PrivateEndpoint; - privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; - readonly provisioningState?: PrivateEndpointConnectionProvisioningState; -} - -// @public -export interface PrivateEndpointConnectionDeleteHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface PrivateEndpointConnectionDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export type PrivateEndpointConnectionDeleteResponse = PrivateEndpointConnectionDeleteHeaders; - -// @public -export interface PrivateEndpointConnectionGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PrivateEndpointConnectionGetResponse = PrivateEndpointConnection; - -// @public -export interface PrivateEndpointConnectionListByBatchAccountNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PrivateEndpointConnectionListByBatchAccountNextResponse = ListPrivateEndpointConnectionsResult; - -// @public -export interface PrivateEndpointConnectionListByBatchAccountOptionalParams extends coreClient.OperationOptions { - maxresults?: number; -} - -// @public -export type PrivateEndpointConnectionListByBatchAccountResponse = ListPrivateEndpointConnectionsResult; - -// @public -export interface PrivateEndpointConnectionOperations { - 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>>; - 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; -} - -// @public -export type PrivateEndpointConnectionProvisioningState = "Creating" | "Updating" | "Deleting" | "Succeeded" | "Failed" | "Cancelled"; - -// @public -export interface PrivateEndpointConnectionUpdateHeaders { - location?: string; - retryAfter?: number; -} - -// @public -export interface PrivateEndpointConnectionUpdateOptionalParams extends coreClient.OperationOptions { - ifMatch?: string; - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export type PrivateEndpointConnectionUpdateResponse = PrivateEndpointConnection; - -// @public -export interface PrivateLinkResource extends AzureProxyResource { - readonly groupId?: string; - readonly requiredMembers?: string[]; - readonly requiredZoneNames?: string[]; -} - -// @public -export interface PrivateLinkResourceGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PrivateLinkResourceGetResponse = PrivateLinkResource; - -// @public -export interface PrivateLinkResourceListByBatchAccountNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type PrivateLinkResourceListByBatchAccountNextResponse = ListPrivateLinkResourcesResult; - -// @public -export interface PrivateLinkResourceListByBatchAccountOptionalParams extends coreClient.OperationOptions { - maxresults?: number; -} - -// @public -export type PrivateLinkResourceListByBatchAccountResponse = ListPrivateLinkResourcesResult; - -// @public -export interface PrivateLinkResourceOperations { - get(resourceGroupName: string, accountName: string, privateLinkResourceName: string, options?: PrivateLinkResourceGetOptionalParams): Promise; - listByBatchAccount(resourceGroupName: string, accountName: string, options?: PrivateLinkResourceListByBatchAccountOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface PrivateLinkServiceConnectionState { - readonly actionsRequired?: string; - description?: string; - status: PrivateLinkServiceConnectionStatus; -} - -// @public -export type PrivateLinkServiceConnectionStatus = "Approved" | "Pending" | "Rejected" | "Disconnected"; - -// @public -export interface ProvisioningIssue { - readonly name?: string; - readonly properties?: ProvisioningIssueProperties; -} - -// @public -export interface ProvisioningIssueProperties { - readonly description?: string; - readonly issueType?: IssueType; - readonly severity?: Severity; - readonly suggestedAccessRules?: AccessRule[]; - readonly suggestedResourceIds?: string[]; -} - -// @public -export type ProvisioningState = "Invalid" | "Creating" | "Deleting" | "Succeeded" | "Failed" | "Cancelled"; - -// @public -export interface ProxyResource extends Resource { -} - -// @public -export interface PublicIPAddressConfiguration { - ipAddressIds?: string[]; - provision?: IPAddressProvisioningType; -} - -// @public -export type PublicNetworkAccessType = "Enabled" | "Disabled" | "SecuredByPerimeter"; - -// @public -export interface ResizeError { - code: string; - details?: ResizeError[]; - message: string; -} - -// @public -export interface ResizeOperationStatus { - errors?: ResizeError[]; - nodeDeallocationOption?: ComputeNodeDeallocationOption; - resizeTimeout?: string; - startTime?: Date; - targetDedicatedNodes?: number; - targetLowPriorityNodes?: number; -} - -// @public -export interface Resource { - readonly id?: string; - readonly name?: string; - readonly systemData?: SystemData; - readonly type?: string; -} - -// @public -export interface ResourceAssociation { - accessMode?: ResourceAssociationAccessMode; - name?: string; -} - -// @public -export type ResourceAssociationAccessMode = string; - -// @public -export interface ResourceFile { - autoStorageContainerName?: string; - blobPrefix?: string; - fileMode?: string; - filePath?: string; - httpUrl?: string; - identityReference?: ComputeNodeIdentityReference; - storageContainerUrl?: string; -} - -// @public -export type ResourceIdentityType = "SystemAssigned" | "UserAssigned" | "None"; - -// @public -export interface RollingUpgradePolicy { - enableCrossZoneUpgrade?: boolean; - maxBatchInstancePercent?: number; - maxUnhealthyInstancePercent?: number; - maxUnhealthyUpgradedInstancePercent?: number; - pauseTimeBetweenBatches?: string; - prioritizeUnhealthyInstances?: boolean; - rollbackFailedInstancesOnPolicyBreach?: boolean; -} - -// @public -export interface ScaleSettings { - autoScale?: AutoScaleSettings; - fixedScale?: FixedScaleSettings; -} - -// @public -export type SecurityEncryptionTypes = string; - -// @public -export interface SecurityProfile { - encryptionAtHost?: boolean; - securityType?: SecurityTypes; - uefiSettings?: UefiSettings; -} - -// @public -export type SecurityTypes = "trustedLaunch" | "confidentialVM"; - -// @public -export interface ServiceArtifactReference { - id: string; -} - -// @public -export type Severity = string; - -// @public -export interface SkuCapability { - readonly name?: string; - readonly value?: string; -} - -// @public -export interface StartTask { - commandLine?: string; - containerSettings?: TaskContainerSettings; - environmentSettings?: EnvironmentSetting[]; - maxTaskRetryCount?: number; - resourceFiles?: ResourceFile[]; - userIdentity?: UserIdentity; - waitForSuccess?: boolean; -} - -// @public -export type StorageAccountType = "Standard_LRS" | "Premium_LRS" | "StandardSSD_LRS"; - -// @public -export interface SupportedSku { - readonly batchSupportEndOfLife?: Date; - readonly capabilities?: SkuCapability[]; - readonly familyName?: string; - readonly name?: string; -} - -// @public -export interface SupportedSkusResult { - readonly nextLink?: string; - value: SupportedSku[]; -} - -// @public -export interface SystemData { - createdAt?: Date; - createdBy?: string; - createdByType?: CreatedByType; - lastModifiedAt?: Date; - lastModifiedBy?: string; - lastModifiedByType?: CreatedByType; -} - -// @public -export interface TaskContainerSettings { - containerHostBatchBindMounts?: ContainerHostBatchBindMountEntry[]; - containerRunOptions?: string; - imageName: string; - registry?: ContainerRegistry; - workingDirectory?: ContainerWorkingDirectory; -} - -// @public -export interface TaskSchedulingPolicy { - nodeFillType: ComputeNodeFillType; -} - -// @public -export interface UefiSettings { - secureBootEnabled?: boolean; - vTpmEnabled?: boolean; -} - -// @public -export type UpgradeMode = "automatic" | "manual" | "rolling"; - -// @public -export interface UpgradePolicy { - automaticOSUpgradePolicy?: AutomaticOSUpgradePolicy; - mode: UpgradeMode; - rollingUpgradePolicy?: RollingUpgradePolicy; -} - -// @public -export interface UserAccount { - elevationLevel?: ElevationLevel; - linuxUserConfiguration?: LinuxUserConfiguration; - name: string; - password: string; - windowsUserConfiguration?: WindowsUserConfiguration; -} - -// @public -export interface UserAssignedIdentities { - readonly clientId?: string; - readonly principalId?: string; -} - -// @public -export interface UserIdentity { - autoUser?: AutoUserSpecification; - userName?: string; -} - -// @public -export interface VirtualMachineConfiguration { - containerConfiguration?: ContainerConfiguration; - dataDisks?: DataDisk[]; - diskEncryptionConfiguration?: DiskEncryptionConfiguration; - extensions?: VMExtension[]; - imageReference: ImageReference; - licenseType?: string; - nodeAgentSkuId: string; - nodePlacementConfiguration?: NodePlacementConfiguration; - osDisk?: OSDisk; - securityProfile?: SecurityProfile; - serviceArtifactReference?: ServiceArtifactReference; - windowsConfiguration?: WindowsConfiguration; -} - -// @public -export interface VirtualMachineFamilyCoreQuota { - readonly coreQuota?: number; - readonly name?: string; -} - -// @public -export interface VMDiskSecurityProfile { - securityEncryptionType?: SecurityEncryptionTypes; -} - -// @public -export interface VMExtension { - autoUpgradeMinorVersion?: boolean; - enableAutomaticUpgrade?: boolean; - name: string; - protectedSettings?: Record; - provisionAfterExtensions?: string[]; - publisher: string; - settings?: Record; - type: string; - typeHandlerVersion?: string; -} - -// @public -export interface WindowsConfiguration { - enableAutomaticUpdates?: boolean; -} - -// @public -export interface WindowsUserConfiguration { - loginMode?: LoginMode; -} - -// (No @packageDocumentation comment for this package) - -``` diff --git a/sdk/batch/arm-batch/sample.env b/sdk/batch/arm-batch/sample.env index 672847a3fea0..508439fc7d62 100644 --- a/sdk/batch/arm-batch/sample.env +++ b/sdk/batch/arm-batch/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/sdk/batch/arm-batch/samples-dev/applicationCreateSample.ts b/sdk/batch/arm-batch/samples-dev/applicationCreateSample.ts index 36fe83e14b68..23bc161b1fd0 100644 --- a/sdk/batch/arm-batch/samples-dev/applicationCreateSample.ts +++ b/sdk/batch/arm-batch/samples-dev/applicationCreateSample.ts @@ -1,35 +1,24 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * 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/2024-07-01/examples/ApplicationCreate.json - */ - -import type { Application, ApplicationCreateOptionalParams } from "@azure/arm-batch"; import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; -import "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: 2025-06-01/ApplicationCreate.json + */ async function applicationCreate(): Promise { - 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 = { - allowUpdates: false, - displayName: "myAppName", - }; - const options: ApplicationCreateOptionalParams = { parameters }; const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.applicationOperations.create( - resourceGroupName, - accountName, - applicationName, - options, + const result = await client.application.create( + "default-azurebatch-japaneast", + "sampleacct", + "app1", + { parameters: { allowUpdates: false, displayName: "myAppName" } }, ); console.log(result); } diff --git a/sdk/batch/arm-batch/samples-dev/applicationDeleteSample.ts b/sdk/batch/arm-batch/samples-dev/applicationDeleteSample.ts index a07af73e1214..ad1d226f7424 100644 --- a/sdk/batch/arm-batch/samples-dev/applicationDeleteSample.ts +++ b/sdk/batch/arm-batch/samples-dev/applicationDeleteSample.ts @@ -1,30 +1,20 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Deletes an application. - * - * @summary Deletes an application. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-01/examples/ApplicationDelete.json - */ - import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to deletes an application. + * + * @summary deletes an application. + * x-ms-original-file: 2025-06-01/ApplicationDelete.json + */ async function applicationDelete(): Promise { - 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(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.applicationOperations.delete( - resourceGroupName, - accountName, - applicationName, - ); - console.log(result); + await client.application.delete("default-azurebatch-japaneast", "sampleacct", "app1"); } async function main(): Promise { diff --git a/sdk/batch/arm-batch/samples-dev/applicationGetSample.ts b/sdk/batch/arm-batch/samples-dev/applicationGetSample.ts index 2d945ae5129f..6c39641c05a3 100644 --- a/sdk/batch/arm-batch/samples-dev/applicationGetSample.ts +++ b/sdk/batch/arm-batch/samples-dev/applicationGetSample.ts @@ -1,29 +1,20 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * 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/2024-07-01/examples/ApplicationGet.json - */ - import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to gets information about the specified application. + * + * @summary gets information about the specified application. + * x-ms-original-file: 2025-06-01/ApplicationGet.json + */ async function applicationGet(): Promise { - 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(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.applicationOperations.get( - resourceGroupName, - accountName, - applicationName, - ); + const result = await client.application.get("default-azurebatch-japaneast", "sampleacct", "app1"); console.log(result); } diff --git a/sdk/batch/arm-batch/samples-dev/applicationListSample.ts b/sdk/batch/arm-batch/samples-dev/applicationListSample.ts index 8caf30b23ed4..1e0105b66138 100644 --- a/sdk/batch/arm-batch/samples-dev/applicationListSample.ts +++ b/sdk/batch/arm-batch/samples-dev/applicationListSample.ts @@ -1,27 +1,24 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * 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/2024-07-01/examples/ApplicationList.json - */ - import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; -import "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: 2025-06-01/ApplicationList.json + */ async function applicationList(): Promise { - 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 subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.applicationOperations.list(resourceGroupName, accountName)) { + for await (const item of client.application.list("default-azurebatch-japaneast", "sampleacct")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/batch/arm-batch/samples-dev/applicationPackageActivateSample.ts b/sdk/batch/arm-batch/samples-dev/applicationPackageActivateSample.ts index 5509dd863500..c31ab995b16f 100644 --- a/sdk/batch/arm-batch/samples-dev/applicationPackageActivateSample.ts +++ b/sdk/batch/arm-batch/samples-dev/applicationPackageActivateSample.ts @@ -1,33 +1,25 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * 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/2024-07-01/examples/ApplicationPackageActivate.json - */ - -import type { ActivateApplicationPackageParameters } from "@azure/arm-batch"; import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; -import "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: 2025-06-01/ApplicationPackageActivate.json + */ async function applicationPackageActivate(): Promise { - 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"; - const parameters: ActivateApplicationPackageParameters = { format: "zip" }; const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.applicationPackageOperations.activate( - resourceGroupName, - accountName, - applicationName, - versionName, - parameters, + const result = await client.applicationPackage.activate( + "default-azurebatch-japaneast", + "sampleacct", + "app1", + "1", + { format: "zip" }, ); console.log(result); } diff --git a/sdk/batch/arm-batch/samples-dev/applicationPackageCreateSample.ts b/sdk/batch/arm-batch/samples-dev/applicationPackageCreateSample.ts index b8cd5d5da2c0..8b0ce7b4e7a6 100644 --- a/sdk/batch/arm-batch/samples-dev/applicationPackageCreateSample.ts +++ b/sdk/batch/arm-batch/samples-dev/applicationPackageCreateSample.ts @@ -1,30 +1,24 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * 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/2024-07-01/examples/ApplicationPackageCreate.json - */ - import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; -import "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: 2025-06-01/ApplicationPackageCreate.json + */ async function applicationPackageCreate(): Promise { - 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"; const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.applicationPackageOperations.create( - resourceGroupName, - accountName, - applicationName, - versionName, + const result = await client.applicationPackage.create( + "default-azurebatch-japaneast", + "sampleacct", + "app1", + "1", ); console.log(result); } diff --git a/sdk/batch/arm-batch/samples-dev/applicationPackageDeleteSample.ts b/sdk/batch/arm-batch/samples-dev/applicationPackageDeleteSample.ts index b7b3325f57c2..3e217dcf5d50 100644 --- a/sdk/batch/arm-batch/samples-dev/applicationPackageDeleteSample.ts +++ b/sdk/batch/arm-batch/samples-dev/applicationPackageDeleteSample.ts @@ -1,32 +1,20 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * 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/2024-07-01/examples/ApplicationPackageDelete.json - */ - import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; -import "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: 2025-06-01/ApplicationPackageDelete.json + */ async function applicationPackageDelete(): Promise { - 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"; const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.applicationPackageOperations.delete( - resourceGroupName, - accountName, - applicationName, - versionName, - ); - console.log(result); + await client.applicationPackage.delete("default-azurebatch-japaneast", "sampleacct", "app1", "1"); } async function main(): Promise { diff --git a/sdk/batch/arm-batch/samples-dev/applicationPackageGetSample.ts b/sdk/batch/arm-batch/samples-dev/applicationPackageGetSample.ts index 97ab2ce16561..97ff54bf2504 100644 --- a/sdk/batch/arm-batch/samples-dev/applicationPackageGetSample.ts +++ b/sdk/batch/arm-batch/samples-dev/applicationPackageGetSample.ts @@ -1,30 +1,24 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * 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/2024-07-01/examples/ApplicationPackageGet.json - */ - import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; -import "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: 2025-06-01/ApplicationPackageGet.json + */ async function applicationPackageGet(): Promise { - 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"; const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.applicationPackageOperations.get( - resourceGroupName, - accountName, - applicationName, - versionName, + const result = await client.applicationPackage.get( + "default-azurebatch-japaneast", + "sampleacct", + "app1", + "1", ); console.log(result); } diff --git a/sdk/batch/arm-batch/samples-dev/applicationPackageListSample.ts b/sdk/batch/arm-batch/samples-dev/applicationPackageListSample.ts index 88bb5cf53c4c..18006dcdbe37 100644 --- a/sdk/batch/arm-batch/samples-dev/applicationPackageListSample.ts +++ b/sdk/batch/arm-batch/samples-dev/applicationPackageListSample.ts @@ -1,32 +1,28 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * 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/2024-07-01/examples/ApplicationPackageList.json - */ - import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; -import "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: 2025-06-01/ApplicationPackageList.json + */ async function applicationPackageList(): Promise { - 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(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.applicationPackageOperations.list( - resourceGroupName, - accountName, - applicationName, + for await (const item of client.applicationPackage.list( + "default-azurebatch-japaneast", + "sampleacct", + "app1", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/batch/arm-batch/samples-dev/applicationUpdateSample.ts b/sdk/batch/arm-batch/samples-dev/applicationUpdateSample.ts index aa2d7dfd1d01..602df6ad4be5 100644 --- a/sdk/batch/arm-batch/samples-dev/applicationUpdateSample.ts +++ b/sdk/batch/arm-batch/samples-dev/applicationUpdateSample.ts @@ -1,35 +1,24 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * 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/2024-07-01/examples/ApplicationUpdate.json - */ - -import type { Application } from "@azure/arm-batch"; import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to updates settings for the specified application. + * + * @summary updates settings for the specified application. + * x-ms-original-file: 2025-06-01/ApplicationUpdate.json + */ async function applicationUpdate(): Promise { - 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 = { - allowUpdates: true, - defaultVersion: "2", - displayName: "myAppName", - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.applicationOperations.update( - resourceGroupName, - accountName, - applicationName, - parameters, + const result = await client.application.update( + "default-azurebatch-japaneast", + "sampleacct", + "app1", + { allowUpdates: true, defaultVersion: "2", displayName: "myAppName" }, ); console.log(result); } diff --git a/sdk/batch/arm-batch/samples-dev/batchAccountCreateSample.ts b/sdk/batch/arm-batch/samples-dev/batchAccountCreateSample.ts index 0557d54a6ab5..968ef85aec29 100644 --- a/sdk/batch/arm-batch/samples-dev/batchAccountCreateSample.ts +++ b/sdk/batch/arm-batch/samples-dev/batchAccountCreateSample.ts @@ -1,162 +1,124 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * 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/2024-07-01/examples/BatchAccountCreate_BYOS.json - */ - -import type { BatchAccountCreateParameters } from "@azure/arm-batch"; import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; -import "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: 2025-06-01/BatchAccountCreate_BYOS.json + */ async function batchAccountCreateByos(): Promise { - const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; - const accountName = "sampleacct"; - const parameters: BatchAccountCreateParameters = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; + const client = new BatchManagementClient(credential, subscriptionId); + const result = await client.batchAccount.create("default-azurebatch-japaneast", "sampleacct", { + location: "japaneast", autoStorage: { storageAccountId: - "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage", + "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage", }, keyVaultReference: { - id: "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.KeyVault/vaults/sample", + id: "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.KeyVault/vaults/sample", url: "http://sample.vault.azure.net/", }, - location: "japaneast", poolAllocationMode: "UserSubscription", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.batchAccountOperations.beginCreateAndWait( - resourceGroupName, - accountName, - parameters, - ); + }); console.log(result); } /** - * 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. + * 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/2024-07-01/examples/BatchAccountCreate_Default.json + * @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: 2025-06-01/BatchAccountCreate_Default.json */ async function batchAccountCreateDefault(): Promise { - const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; - const accountName = "sampleacct"; - const parameters: BatchAccountCreateParameters = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; + const client = new BatchManagementClient(credential, subscriptionId); + const result = await client.batchAccount.create("default-azurebatch-japaneast", "sampleacct", { + location: "japaneast", autoStorage: { storageAccountId: - "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage", + "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage", }, - location: "japaneast", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.batchAccountOperations.beginCreateAndWait( - resourceGroupName, - accountName, - parameters, - ); + }); console.log(result); } /** - * 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. + * 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/2024-07-01/examples/BatchAccountCreate_SystemAssignedIdentity.json + * @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: 2025-06-01/BatchAccountCreate_SystemAssignedIdentity.json */ async function batchAccountCreateSystemAssignedIdentity(): Promise { - const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; - const accountName = "sampleacct"; - const parameters: BatchAccountCreateParameters = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; + const client = new BatchManagementClient(credential, subscriptionId); + const result = await client.batchAccount.create("default-azurebatch-japaneast", "sampleacct", { + identity: { type: "SystemAssigned" }, + location: "japaneast", autoStorage: { storageAccountId: - "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage", + "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage", }, - identity: { type: "SystemAssigned" }, - location: "japaneast", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.batchAccountOperations.beginCreateAndWait( - resourceGroupName, - accountName, - parameters, - ); + }); console.log(result); } /** - * 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. + * 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/2024-07-01/examples/BatchAccountCreate_UserAssignedIdentity.json + * @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: 2025-06-01/BatchAccountCreate_UserAssignedIdentity.json */ async function batchAccountCreateUserAssignedIdentity(): Promise { - 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: { - storageAccountId: - "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage", - }, + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; + const client = new BatchManagementClient(credential, subscriptionId); + const result = await client.batchAccount.create("default-azurebatch-japaneast", "sampleacct", { identity: { type: "UserAssigned", userAssignedIdentities: { - "/subscriptions/subid/resourceGroups/defaultAzurebatchJapaneast/providers/MicrosoftManagedIdentity/userAssignedIdentities/id1": + "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {}, }, }, location: "japaneast", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.batchAccountOperations.beginCreateAndWait( - resourceGroupName, - accountName, - parameters, - ); + autoStorage: { + storageAccountId: + "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage", + }, + }); console.log(result); } /** - * 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. + * 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/2024-07-01/examples/PrivateBatchAccountCreate.json + * @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: 2025-06-01/PrivateBatchAccountCreate.json */ async function privateBatchAccountCreate(): Promise { - const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; - const accountName = "sampleacct"; - const parameters: BatchAccountCreateParameters = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; + const client = new BatchManagementClient(credential, subscriptionId); + const result = await client.batchAccount.create("default-azurebatch-japaneast", "sampleacct", { + location: "japaneast", autoStorage: { storageAccountId: - "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage", + "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage", }, keyVaultReference: { - id: "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.KeyVault/vaults/sample", + id: "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.KeyVault/vaults/sample", url: "http://sample.vault.azure.net/", }, - location: "japaneast", publicNetworkAccess: "Disabled", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.batchAccountOperations.beginCreateAndWait( - resourceGroupName, - accountName, - parameters, - ); + }); console.log(result); } diff --git a/sdk/batch/arm-batch/samples-dev/batchAccountDeleteSample.ts b/sdk/batch/arm-batch/samples-dev/batchAccountDeleteSample.ts index 597cb30b7467..7cdb9e091cd1 100644 --- a/sdk/batch/arm-batch/samples-dev/batchAccountDeleteSample.ts +++ b/sdk/batch/arm-batch/samples-dev/batchAccountDeleteSample.ts @@ -1,28 +1,20 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * 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/2024-07-01/examples/BatchAccountDelete.json - */ - import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to deletes the specified Batch account. + * + * @summary deletes the specified Batch account. + * x-ms-original-file: 2025-06-01/BatchAccountDelete.json + */ async function batchAccountDelete(): Promise { - 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 subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.batchAccountOperations.beginDeleteAndWait( - resourceGroupName, - accountName, - ); - console.log(result); + await client.batchAccount.delete("default-azurebatch-japaneast", "sampleacct"); } async function main(): Promise { diff --git a/sdk/batch/arm-batch/samples-dev/batchAccountGetDetectorSample.ts b/sdk/batch/arm-batch/samples-dev/batchAccountGetDetectorSample.ts index 65f54305cdfa..ef8539ea96d5 100644 --- a/sdk/batch/arm-batch/samples-dev/batchAccountGetDetectorSample.ts +++ b/sdk/batch/arm-batch/samples-dev/batchAccountGetDetectorSample.ts @@ -1,28 +1,23 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * 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/2024-07-01/examples/DetectorGet.json - */ - import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; -import "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: 2025-06-01/DetectorGet.json + */ async function getDetector(): Promise { - 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(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.batchAccountOperations.getDetector( - resourceGroupName, - accountName, - detectorId, + const result = await client.batchAccount.getDetector( + "default-azurebatch-japaneast", + "sampleacct", + "poolsAndNodes", ); console.log(result); } diff --git a/sdk/batch/arm-batch/samples-dev/batchAccountGetKeysSample.ts b/sdk/batch/arm-batch/samples-dev/batchAccountGetKeysSample.ts index db1965ac2166..bcfd185ab9bc 100644 --- a/sdk/batch/arm-batch/samples-dev/batchAccountGetKeysSample.ts +++ b/sdk/batch/arm-batch/samples-dev/batchAccountGetKeysSample.ts @@ -1,24 +1,20 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * 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/2024-07-01/examples/BatchAccountGetKeys.json - */ - import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; -import "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: 2025-06-01/BatchAccountGetKeys.json + */ async function batchAccountGetKeys(): Promise { - 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 subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.batchAccountOperations.getKeys(resourceGroupName, accountName); + const result = await client.batchAccount.getKeys("default-azurebatch-japaneast", "sampleacct"); console.log(result); } diff --git a/sdk/batch/arm-batch/samples-dev/batchAccountGetSample.ts b/sdk/batch/arm-batch/samples-dev/batchAccountGetSample.ts index 7c1a9d018bb8..12b122eb019a 100644 --- a/sdk/batch/arm-batch/samples-dev/batchAccountGetSample.ts +++ b/sdk/batch/arm-batch/samples-dev/batchAccountGetSample.ts @@ -1,40 +1,34 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * 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/2024-07-01/examples/BatchAccountGet.json - */ - import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; -import "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: 2025-06-01/BatchAccountGet.json + */ async function batchAccountGet(): Promise { - 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 subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.batchAccountOperations.get(resourceGroupName, accountName); + const result = await client.batchAccount.get("default-azurebatch-japaneast", "sampleacct"); console.log(result); } /** - * This sample demonstrates how to Gets information about the specified Batch account. + * 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/2024-07-01/examples/PrivateBatchAccountGet.json + * @summary gets information about the specified Batch account. + * x-ms-original-file: 2025-06-01/PrivateBatchAccountGet.json */ async function privateBatchAccountGet(): Promise { - 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 subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.batchAccountOperations.get(resourceGroupName, accountName); + const result = await client.batchAccount.get("default-azurebatch-japaneast", "sampleacct"); console.log(result); } diff --git a/sdk/batch/arm-batch/samples-dev/batchAccountListByResourceGroupSample.ts b/sdk/batch/arm-batch/samples-dev/batchAccountListByResourceGroupSample.ts index 0c5cdc767f62..51386633fed3 100644 --- a/sdk/batch/arm-batch/samples-dev/batchAccountListByResourceGroupSample.ts +++ b/sdk/batch/arm-batch/samples-dev/batchAccountListByResourceGroupSample.ts @@ -1,26 +1,26 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * 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/2024-07-01/examples/BatchAccountListByResourceGroup.json - */ - import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; -import "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: 2025-06-01/BatchAccountListByResourceGroup.json + */ async function batchAccountListByResourceGroup(): Promise { - const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.batchAccountOperations.listByResourceGroup(resourceGroupName)) { + for await (const item of client.batchAccount.listByResourceGroup( + "default-azurebatch-japaneast", + )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/batch/arm-batch/samples-dev/batchAccountListDetectorsSample.ts b/sdk/batch/arm-batch/samples-dev/batchAccountListDetectorsSample.ts index 0d3055850976..03b5c50eb45c 100644 --- a/sdk/batch/arm-batch/samples-dev/batchAccountListDetectorsSample.ts +++ b/sdk/batch/arm-batch/samples-dev/batchAccountListDetectorsSample.ts @@ -1,30 +1,27 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * 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/2024-07-01/examples/DetectorList.json - */ - import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; -import "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: 2025-06-01/DetectorList.json + */ async function listDetectors(): Promise { - 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 subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.batchAccountOperations.listDetectors( - resourceGroupName, - accountName, + for await (const item of client.batchAccount.listDetectors( + "default-azurebatch-japaneast", + "sampleacct", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/batch/arm-batch/samples-dev/batchAccountListOutboundNetworkDependenciesEndpointsSample.ts b/sdk/batch/arm-batch/samples-dev/batchAccountListOutboundNetworkDependenciesEndpointsSample.ts index 2dea00dc0c35..70cb14afbaf6 100644 --- a/sdk/batch/arm-batch/samples-dev/batchAccountListOutboundNetworkDependenciesEndpointsSample.ts +++ b/sdk/batch/arm-batch/samples-dev/batchAccountListOutboundNetworkDependenciesEndpointsSample.ts @@ -1,30 +1,27 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * 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/azure/batch/batch-virtual-network. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-01/examples/BatchAccountListOutboundNetworkDependenciesEndpoints.json - */ - import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; -import "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://learn.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://learn.microsoft.com/azure/batch/batch-virtual-network. + * x-ms-original-file: 2025-06-01/BatchAccountListOutboundNetworkDependenciesEndpoints.json + */ async function listOutboundNetworkDependencies(): Promise { - 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 subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.batchAccountOperations.listOutboundNetworkDependenciesEndpoints( - resourceGroupName, - accountName, + for await (const item of client.batchAccount.listOutboundNetworkDependenciesEndpoints( + "default-azurebatch-japaneast", + "sampleacct", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/batch/arm-batch/samples-dev/batchAccountListSample.ts b/sdk/batch/arm-batch/samples-dev/batchAccountListSample.ts index c3c0b64a6c14..3888956695a9 100644 --- a/sdk/batch/arm-batch/samples-dev/batchAccountListSample.ts +++ b/sdk/batch/arm-batch/samples-dev/batchAccountListSample.ts @@ -1,25 +1,24 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * 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/2024-07-01/examples/BatchAccountList.json - */ - import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; -import "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: 2025-06-01/BatchAccountList.json + */ async function batchAccountList(): Promise { - const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.batchAccountOperations.list()) { + for await (const item of client.batchAccount.list()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/batch/arm-batch/samples-dev/batchAccountRegenerateKeySample.ts b/sdk/batch/arm-batch/samples-dev/batchAccountRegenerateKeySample.ts index 606d36d63ed2..019fcb0b6f87 100644 --- a/sdk/batch/arm-batch/samples-dev/batchAccountRegenerateKeySample.ts +++ b/sdk/batch/arm-batch/samples-dev/batchAccountRegenerateKeySample.ts @@ -1,31 +1,23 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * 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/2024-07-01/examples/BatchAccountRegenerateKey.json - */ - -import type { BatchAccountRegenerateKeyParameters } from "@azure/arm-batch"; import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; -import "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: 2025-06-01/BatchAccountRegenerateKey.json + */ async function batchAccountRegenerateKey(): Promise { - 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", - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.batchAccountOperations.regenerateKey( - resourceGroupName, - accountName, - parameters, + const result = await client.batchAccount.regenerateKey( + "default-azurebatch-japaneast", + "sampleacct", + { keyName: "Primary" }, ); console.log(result); } diff --git a/sdk/batch/arm-batch/samples-dev/batchAccountSynchronizeAutoStorageKeysSample.ts b/sdk/batch/arm-batch/samples-dev/batchAccountSynchronizeAutoStorageKeysSample.ts index ebc75849fa1f..f19432feb76a 100644 --- a/sdk/batch/arm-batch/samples-dev/batchAccountSynchronizeAutoStorageKeysSample.ts +++ b/sdk/batch/arm-batch/samples-dev/batchAccountSynchronizeAutoStorageKeysSample.ts @@ -1,28 +1,23 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * 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/2024-07-01/examples/BatchAccountSynchronizeAutoStorageKeys.json - */ - import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; -import "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: 2025-06-01/BatchAccountSynchronizeAutoStorageKeys.json + */ async function batchAccountSynchronizeAutoStorageKeys(): Promise { - 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 subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.batchAccountOperations.synchronizeAutoStorageKeys( - resourceGroupName, - accountName, + await client.batchAccount.synchronizeAutoStorageKeys( + "default-azurebatch-japaneast", + "sampleacct", ); - console.log(result); } async function main(): Promise { diff --git a/sdk/batch/arm-batch/samples-dev/batchAccountUpdateSample.ts b/sdk/batch/arm-batch/samples-dev/batchAccountUpdateSample.ts index 1084afa20cf0..532d1e1c857f 100644 --- a/sdk/batch/arm-batch/samples-dev/batchAccountUpdateSample.ts +++ b/sdk/batch/arm-batch/samples-dev/batchAccountUpdateSample.ts @@ -1,35 +1,25 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * 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/2024-07-01/examples/BatchAccountUpdate.json - */ - -import type { BatchAccountUpdateParameters } from "@azure/arm-batch"; import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; -import "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: 2025-06-01/BatchAccountUpdate.json + */ async function batchAccountUpdate(): Promise { - const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; - const accountName = "sampleacct"; - const parameters: BatchAccountUpdateParameters = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; + const client = new BatchManagementClient(credential, subscriptionId); + const result = await client.batchAccount.update("default-azurebatch-japaneast", "sampleacct", { autoStorage: { storageAccountId: - "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage", + "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage", }, - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.batchAccountOperations.update( - resourceGroupName, - accountName, - parameters, - ); + }); console.log(result); } diff --git a/sdk/batch/arm-batch/samples-dev/certificateCancelDeletionSample.ts b/sdk/batch/arm-batch/samples-dev/certificateCancelDeletionSample.ts deleted file mode 100644 index 39452114ffa0..000000000000 --- a/sdk/batch/arm-batch/samples-dev/certificateCancelDeletionSample.ts +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -/** - * 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. - -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 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/2024-07-01/examples/CertificateCancelDeletion.json - */ - -import { BatchManagementClient } from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -async function certificateCancelDeletion(): Promise { - 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(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.certificateOperations.cancelDeletion( - resourceGroupName, - accountName, - certificateName, - ); - console.log(result); -} - -async function main(): Promise { - await 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 deleted file mode 100644 index e9ae72caa218..000000000000 --- a/sdk/batch/arm-batch/samples-dev/certificateCreateSample.ts +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -/** - * 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/2024-07-01/examples/CertificateCreate_Full.json - */ - -import type { CertificateCreateOrUpdateParameters } from "@azure/arm-batch"; -import { BatchManagementClient } from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -async function createCertificateFull(): Promise { - 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 = { - format: "Pfx", - data: "MIIJsgIBAzCCCW4GCSqGSIb3DQE...", - password: "", - thumbprint: "0a0e4f50d51beadeac1d35afc5116098e7902e6e", - thumbprintAlgorithm: "sha1", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.certificateOperations.create( - resourceGroupName, - accountName, - certificateName, - parameters, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/CertificateCreate_MinimalCer.json - */ -async function createCertificateMinimalCer(): Promise { - 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 = { - format: "Cer", - data: "MIICrjCCAZagAwI...", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.certificateOperations.create( - resourceGroupName, - accountName, - certificateName, - parameters, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/CertificateCreate_Minimal.json - */ -async function createCertificateMinimalPfx(): Promise { - 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 = { - data: "MIIJsgIBAzCCCW4GCSqGSIb3DQE...", - password: "", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.certificateOperations.create( - resourceGroupName, - accountName, - certificateName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await createCertificateFull(); - await createCertificateMinimalCer(); - await 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 deleted file mode 100644 index 43ae9902ac04..000000000000 --- a/sdk/batch/arm-batch/samples-dev/certificateDeleteSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -/** - * 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/2024-07-01/examples/CertificateDelete.json - */ - -import { BatchManagementClient } from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -async function certificateDelete(): Promise { - 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(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.certificateOperations.beginDeleteAndWait( - resourceGroupName, - accountName, - certificateName, - ); - console.log(result); -} - -async function main(): Promise { - await 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 deleted file mode 100644 index 99db207835ff..000000000000 --- a/sdk/batch/arm-batch/samples-dev/certificateGetSample.ts +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -/** - * 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/2024-07-01/examples/CertificateGet.json - */ - -import { BatchManagementClient } from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -async function getCertificate(): Promise { - 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(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.certificateOperations.get( - resourceGroupName, - accountName, - certificateName, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/CertificateGetWithDeletionError.json - */ -async function getCertificateWithDeletionError(): Promise { - 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(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.certificateOperations.get( - resourceGroupName, - accountName, - certificateName, - ); - console.log(result); -} - -async function main(): Promise { - await getCertificate(); - await 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 deleted file mode 100644 index 8cfe41c4a150..000000000000 --- a/sdk/batch/arm-batch/samples-dev/certificateListByBatchAccountSample.ts +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -/** - * 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/2024-07-01/examples/CertificateList.json - */ - -import type { CertificateListByBatchAccountOptionalParams } from "@azure/arm-batch"; -import { BatchManagementClient } from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -async function listCertificates(): Promise { - 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); - const resArray = new Array(); - for await (const item of client.certificateOperations.listByBatchAccount( - resourceGroupName, - accountName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * 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/2024-07-01/examples/CertificateListWithFilter.json - */ -async function listCertificatesFilterAndSelect(): Promise { - 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 = - "properties/provisioningStateTransitionTime gt '2017-05-01' or properties/provisioningState eq 'Failed'"; - const options: CertificateListByBatchAccountOptionalParams = { - select, - filter, - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.certificateOperations.listByBatchAccount( - resourceGroupName, - accountName, - options, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await listCertificates(); - await 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 deleted file mode 100644 index 7a4aa1e225cf..000000000000 --- a/sdk/batch/arm-batch/samples-dev/certificateUpdateSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -/** - * 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/2024-07-01/examples/CertificateUpdate.json - */ - -import type { CertificateCreateOrUpdateParameters } from "@azure/arm-batch"; -import { BatchManagementClient } from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -async function updateCertificate(): Promise { - 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 = { - data: "MIIJsgIBAzCCCW4GCSqGSIb3DQE...", - password: "", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.certificateOperations.update( - resourceGroupName, - accountName, - certificateName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await 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 6cc53f0b2bdb..ef0bca88bd9f 100644 --- a/sdk/batch/arm-batch/samples-dev/locationCheckNameAvailabilitySample.ts +++ b/sdk/batch/arm-batch/samples-dev/locationCheckNameAvailabilitySample.ts @@ -1,47 +1,40 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * 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/2024-07-01/examples/LocationCheckNameAvailability_AlreadyExists.json - */ - -import type { CheckNameAvailabilityParameters } from "@azure/arm-batch"; import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; -import "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: 2025-06-01/LocationCheckNameAvailability_AlreadyExists.json + */ async function locationCheckNameAvailabilityAlreadyExists(): Promise { - const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; - const locationName = "japaneast"; - const parameters: CheckNameAvailabilityParameters = { - name: "existingaccountname", - type: "Microsoft.Batch/batchAccounts", - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.location.checkNameAvailability(locationName, parameters); + const result = await client.location.checkNameAvailability("japaneast", { + name: "existingaccountname", + type: "Microsoft.Batch/batchAccounts", + }); console.log(result); } /** - * This sample demonstrates how to Checks whether the Batch account name is available in the specified region. + * 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/2024-07-01/examples/LocationCheckNameAvailability_Available.json + * @summary checks whether the Batch account name is available in the specified region. + * x-ms-original-file: 2025-06-01/LocationCheckNameAvailability_Available.json */ async function locationCheckNameAvailabilityAvailable(): Promise { - const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; - const locationName = "japaneast"; - const parameters: CheckNameAvailabilityParameters = { - name: "newaccountname", - type: "Microsoft.Batch/batchAccounts", - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.location.checkNameAvailability(locationName, parameters); + const result = await client.location.checkNameAvailability("japaneast", { + name: "newaccountname", + type: "Microsoft.Batch/batchAccounts", + }); console.log(result); } diff --git a/sdk/batch/arm-batch/samples-dev/locationGetQuotasSample.ts b/sdk/batch/arm-batch/samples-dev/locationGetQuotasSample.ts index 35c57e8177e6..0effef8e2772 100644 --- a/sdk/batch/arm-batch/samples-dev/locationGetQuotasSample.ts +++ b/sdk/batch/arm-batch/samples-dev/locationGetQuotasSample.ts @@ -1,23 +1,20 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * 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/2024-07-01/examples/LocationGetQuotas.json - */ - import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; -import "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: 2025-06-01/LocationGetQuotas.json + */ async function locationGetQuotas(): Promise { - const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; - const locationName = "japaneast"; const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.location.getQuotas(locationName); + const result = await client.location.getQuotas("japaneast"); console.log(result); } diff --git a/sdk/batch/arm-batch/samples-dev/locationListSupportedVirtualMachineSkusSample.ts b/sdk/batch/arm-batch/samples-dev/locationListSupportedVirtualMachineSkusSample.ts index 1842dfe16b29..9a0d4f949c09 100644 --- a/sdk/batch/arm-batch/samples-dev/locationListSupportedVirtualMachineSkusSample.ts +++ b/sdk/batch/arm-batch/samples-dev/locationListSupportedVirtualMachineSkusSample.ts @@ -1,26 +1,24 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * 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/2024-07-01/examples/LocationListVirtualMachineSkus.json - */ - import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; -import "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: 2025-06-01/LocationListVirtualMachineSkus.json + */ async function locationListVirtualMachineSkus(): Promise { - const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; - const locationName = "japaneast"; const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.location.listSupportedVirtualMachineSkus(locationName)) { + for await (const item of client.location.listSupportedVirtualMachineSkus("japaneast")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/batch/arm-batch/samples-dev/networkSecurityPerimeterGetConfigurationSample.ts b/sdk/batch/arm-batch/samples-dev/networkSecurityPerimeterGetConfigurationSample.ts index e09a3891093d..19ed6dea75bb 100644 --- a/sdk/batch/arm-batch/samples-dev/networkSecurityPerimeterGetConfigurationSample.ts +++ b/sdk/batch/arm-batch/samples-dev/networkSecurityPerimeterGetConfigurationSample.ts @@ -1,29 +1,23 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Gets information about the specified NSP configuration. - * - * @summary Gets information about the specified NSP configuration. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-01/examples/NspConfigurationGet.json - */ - import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to gets information about the specified NSP configuration. + * + * @summary gets information about the specified NSP configuration. + * x-ms-original-file: 2025-06-01/NspConfigurationGet.json + */ async function getNspConfiguration(): Promise { - const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; - const accountName = "sampleacct"; - const networkSecurityPerimeterConfigurationName = - "00000000-0000-0000-0000-000000000000.sampleassociation"; const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.networkSecurityPerimeterOperations.getConfiguration( - resourceGroupName, - accountName, - networkSecurityPerimeterConfigurationName, + const result = await client.networkSecurityPerimeter.getConfiguration( + "default-azurebatch-japaneast", + "sampleacct", + "00000000-0000-0000-0000-000000000000.sampleassociation", ); console.log(result); } diff --git a/sdk/batch/arm-batch/samples-dev/networkSecurityPerimeterListConfigurationsSample.ts b/sdk/batch/arm-batch/samples-dev/networkSecurityPerimeterListConfigurationsSample.ts index 666f8735d686..5f683b1fa663 100644 --- a/sdk/batch/arm-batch/samples-dev/networkSecurityPerimeterListConfigurationsSample.ts +++ b/sdk/batch/arm-batch/samples-dev/networkSecurityPerimeterListConfigurationsSample.ts @@ -1,30 +1,27 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Lists all of the NSP configurations in the specified account. - * - * @summary Lists all of the NSP configurations in the specified account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-01/examples/NspConfigurationsList.json - */ - import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to lists all of the NSP configurations in the specified account. + * + * @summary lists all of the NSP configurations in the specified account. + * x-ms-original-file: 2025-06-01/NspConfigurationsList.json + */ async function listNspConfigurations(): Promise { - 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 subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.networkSecurityPerimeterOperations.listConfigurations( - resourceGroupName, - accountName, + for await (const item of client.networkSecurityPerimeter.listConfigurations( + "default-azurebatch-japaneast", + "sampleacct", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/batch/arm-batch/samples-dev/networkSecurityPerimeterReconcileConfigurationSample.ts b/sdk/batch/arm-batch/samples-dev/networkSecurityPerimeterReconcileConfigurationSample.ts index 7765c2444736..d177f2ac0c6e 100644 --- a/sdk/batch/arm-batch/samples-dev/networkSecurityPerimeterReconcileConfigurationSample.ts +++ b/sdk/batch/arm-batch/samples-dev/networkSecurityPerimeterReconcileConfigurationSample.ts @@ -1,31 +1,24 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Reconciles the specified NSP configuration. - * - * @summary Reconciles the specified NSP configuration. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-01/examples/NspConfigurationReconcile.json - */ - import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to reconciles the specified NSP configuration. + * + * @summary reconciles the specified NSP configuration. + * x-ms-original-file: 2025-06-01/NspConfigurationReconcile.json + */ async function reconcileNspConfiguration(): Promise { - const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; - const accountName = "sampleacct"; - const networkSecurityPerimeterConfigurationName = - "00000000-0000-0000-0000-000000000000.sampleassociation"; const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.networkSecurityPerimeterOperations.beginReconcileConfigurationAndWait( - resourceGroupName, - accountName, - networkSecurityPerimeterConfigurationName, + await client.networkSecurityPerimeter.reconcileConfiguration( + "default-azurebatch-japaneast", + "sampleacct", + "00000000-0000-0000-0000-000000000000.sampleassociation", ); - console.log(result); } async function main(): Promise { diff --git a/sdk/batch/arm-batch/samples-dev/operationsListSample.ts b/sdk/batch/arm-batch/samples-dev/operationsListSample.ts index e241ee365f09..fc2bbcd01e18 100644 --- a/sdk/batch/arm-batch/samples-dev/operationsListSample.ts +++ b/sdk/batch/arm-batch/samples-dev/operationsListSample.ts @@ -1,26 +1,23 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * 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/2024-07-01/examples/OperationsList.json - */ - import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; -import "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: 2025-06-01/OperationsList.json + */ async function operationsList(): Promise { - const subscriptionId = - process.env["BATCH_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); + const client = new BatchManagementClient(credential); const resArray = new Array(); for await (const item of client.operations.list()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/batch/arm-batch/samples-dev/poolCreateSample.ts b/sdk/batch/arm-batch/samples-dev/poolCreateSample.ts index c30dd2ecc8a8..4cf1813fe942 100644 --- a/sdk/batch/arm-batch/samples-dev/poolCreateSample.ts +++ b/sdk/batch/arm-batch/samples-dev/poolCreateSample.ts @@ -1,696 +1,781 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +import { BatchManagementClient } from "@azure/arm-batch"; +import { DefaultAzureCredential } from "@azure/identity"; + /** - * This sample demonstrates how to Creates a new pool inside the specified account. + * 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/2024-07-01/examples/PoolCreate_SharedImageGallery.json + * @summary creates a new pool inside the specified account. + * x-ms-original-file: 2025-06-01/PoolCreate_AcceleratedNetworking.json */ +async function createPoolAcceleratedNetworking(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; + const client = new BatchManagementClient(credential, subscriptionId); + const result = await client.pool.create( + "default-azurebatch-japaneast", + "sampleacct", + "testpool", + { + deploymentConfiguration: { + virtualMachineConfiguration: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-datacenter-smalldisk", + version: "latest", + }, + nodeAgentSkuId: "batch.node.windows amd64", + }, + }, + networkConfiguration: { + enableAcceleratedNetworking: true, + subnetId: + "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123", + }, + scaleSettings: { fixedScale: { targetDedicatedNodes: 1, targetLowPriorityNodes: 0 } }, + vmSize: "STANDARD_D1_V2", + }, + ); + console.log(result); +} -import type { Pool } from "@azure/arm-batch"; -import { BatchManagementClient } from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -async function createPoolCustomImage(): Promise { - 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: { - id: "/subscriptions/subid/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1", +/** + * 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: 2025-06-01/PoolCreate_ConfidentialDiskEncryptionSet_ForUserSubscriptionAccounts.json + */ +async function createPoolConfidentialDiskEncryptionSetForUserSubscriptionAccounts(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; + const client = new BatchManagementClient(credential, subscriptionId); + const result = await client.pool.create( + "default-azurebatch-japaneast", + "sampleacct", + "testpool", + { + vmSize: "Standard_DC2as_v5", + taskSchedulingPolicy: { nodeFillType: "Pack" }, + deploymentConfiguration: { + virtualMachineConfiguration: { + imageReference: { + publisher: "MicrosoftWindowsServer", + offer: "WindowsServer", + sku: "2019-datacenter-core-g2", + version: "latest", + }, + nodeAgentSkuId: "batch.node.windows amd64", + securityProfile: { + securityType: "confidentialVM", + encryptionAtHost: false, + uefiSettings: { vTpmEnabled: true, secureBootEnabled: true }, + }, + osDisk: { + managedDisk: { + storageAccountType: "Standard_LRS", + diskEncryptionSet: { + id: "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/diskEncryptionSets/DiskEncryptionSetId", + }, + securityProfile: { + securityEncryptionType: "DiskWithVMGuestState", + diskEncryptionSet: { + id: "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/diskEncryptionSets/ConfidentialDiskEncryptionSetId", + }, + }, + }, + }, + dataDisks: [ + { + lun: 0, + diskSizeGB: 1024, + managedDisk: { + storageAccountType: "Standard_LRS", + diskEncryptionSet: { + id: "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/diskEncryptionSets/DiskEncryptionSetId", + }, + }, + }, + ], }, - nodeAgentSkuId: "batch.node.ubuntu 18.04", }, + scaleSettings: { fixedScale: { targetDedicatedNodes: 1, resizeTimeout: "PT15M" } }, }, - vmSize: "STANDARD_D4", - }; + ); + console.log(result); +} + +/** + * 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: 2025-06-01/PoolCreate_CustomerManagedKey_ForBatchManagedAccounts.json + */ +async function createPoolCustomerManagedKeyForBatchManagedAccounts(): Promise { const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.create( - resourceGroupName, - accountName, - poolName, - parameters, + const result = await client.pool.create( + "default-azurebatch-japaneast", + "sampleacct", + "testpool", + { + vmSize: "Standard_D4ds_v5", + deploymentConfiguration: { + virtualMachineConfiguration: { + imageReference: { + sku: "2022-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", + }, + nodeAgentSkuId: "batch.node.windows amd64", + diskEncryptionConfiguration: { + targets: ["OsDisk"], + customerManagedKey: { + keyUrl: "http://sample.vault.azure.net//keys/cmk/bb60031a6d4545d3a60d3f94588538c9", + identityReference: { + resourceId: + "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1", + }, + }, + }, + }, + }, + scaleSettings: { fixedScale: { targetDedicatedNodes: 1, resizeTimeout: "PT15M" } }, + identity: { + type: "UserAssigned", + userAssignedIdentities: { + "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": + {}, + }, + }, + }, ); console.log(result); } /** - * This sample demonstrates how to Creates a new pool inside the specified account. + * 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/2024-07-01/examples/PoolCreate_VirtualMachineConfiguration.json + * @summary creates a new pool inside the specified account. + * x-ms-original-file: 2025-06-01/PoolCreate_DiskEncryptionSet_ForUserSubscriptionAccounts.json */ -async function createPoolFullVirtualMachineConfiguration(): Promise { - 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: { - dataDisks: [ - { - caching: "ReadWrite", - diskSizeGB: 30, - lun: 0, - storageAccountType: "Premium_LRS", +async function createPoolDiskEncryptionSetForUserSubscriptionAccounts(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; + const client = new BatchManagementClient(credential, subscriptionId); + const result = await client.pool.create( + "default-azurebatch-japaneast", + "sampleacct", + "testpool", + { + vmSize: "Standard_D4ds_v5", + taskSchedulingPolicy: { nodeFillType: "Pack" }, + deploymentConfiguration: { + virtualMachineConfiguration: { + imageReference: { + sku: "2022-Datacenter", + publisher: "MicrosoftWindowsServer", + version: "latest", + offer: "WindowsServer", }, - { - caching: "None", - diskSizeGB: 200, - lun: 1, - storageAccountType: "Standard_LRS", + nodeAgentSkuId: "batch.node.windows amd64", + securityProfile: { encryptionAtHost: false }, + osDisk: { + managedDisk: { + storageAccountType: "Standard_LRS", + diskEncryptionSet: { + id: "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/diskEncryptionSets/DiskEncryptionSetId", + }, + }, }, - ], - diskEncryptionConfiguration: { targets: ["OsDisk", "TemporaryDisk"] }, - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter-SmallDisk", - version: "latest", }, - licenseType: "Windows_Server", - nodeAgentSkuId: "batch.node.windows amd64", - nodePlacementConfiguration: { policy: "Zonal" }, - osDisk: { ephemeralOSDiskSettings: { placement: "CacheDisk" } }, - windowsConfiguration: { enableAutomaticUpdates: false }, }, + scaleSettings: { fixedScale: { targetDedicatedNodes: 1, resizeTimeout: "PT15M" } }, }, + ); + console.log(result); +} + +/** + * 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: 2025-06-01/PoolCreate_DualStackNetworking.json + */ +async function createPoolDualStackNetworking(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; + const client = new BatchManagementClient(credential, subscriptionId); + const result = await client.pool.create("default-azurebatch", "exampleacc", "dualstackpool", { + vmSize: "Standard_D4ds_v5", networkConfiguration: { + publicIPAddressConfiguration: { ipFamilies: ["IPv4", "IPv6"] }, endpointConfiguration: { inboundNatPools: [ { - name: "testnat", - backendPort: 12001, - frontendPortRangeEnd: 15100, - frontendPortRangeStart: 15000, + backendPort: 22, + frontendPortRangeStart: 40000, + frontendPortRangeEnd: 40500, + name: "sshpool", + protocol: "TCP", networkSecurityGroupRules: [ { access: "Allow", - priority: 150, - sourceAddressPrefix: "192.100.12.45", - sourcePortRanges: ["1", "2"], - }, - { - access: "Deny", - priority: 3500, + priority: 1000, sourceAddressPrefix: "*", sourcePortRanges: ["*"], }, ], - protocol: "TCP", }, ], }, }, - scaleSettings: { - autoScale: { - evaluationInterval: "PT5M", - formula: "$TargetDedicatedNodes=1", + deploymentConfiguration: { + virtualMachineConfiguration: { + imageReference: { publisher: "Canonical", offer: "ubuntu-24_04-lts", sku: "server" }, + nodeAgentSkuId: "batch.node.ubuntu 24.04", }, }, - vmSize: "STANDARD_D4", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.create( - resourceGroupName, - accountName, - poolName, - parameters, - ); + scaleSettings: { fixedScale: { targetDedicatedNodes: 1, targetLowPriorityNodes: 0 } }, + }); console.log(result); } /** - * This sample demonstrates how to Creates a new pool inside the specified account. + * 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/2024-07-01/examples/PoolCreate_MinimalVirtualMachineConfiguration.json + * @summary creates a new pool inside the specified account. + * x-ms-original-file: 2025-06-01/PoolCreate_MinimalVirtualMachineConfiguration.json */ async function createPoolMinimalVirtualMachineConfiguration(): Promise { - 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: "UbuntuServer", - publisher: "Canonical", - sku: "18.04-LTS", - version: "latest", + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; + const client = new BatchManagementClient(credential, subscriptionId); + const result = await client.pool.create( + "default-azurebatch-japaneast", + "sampleacct", + "testpool", + { + deploymentConfiguration: { + virtualMachineConfiguration: { + imageReference: { + offer: "UbuntuServer", + publisher: "Canonical", + sku: "18.04-LTS", + version: "latest", + }, + nodeAgentSkuId: "batch.node.ubuntu 18.04", }, - nodeAgentSkuId: "batch.node.ubuntu 18.04", }, - }, - scaleSettings: { - autoScale: { - evaluationInterval: "PT5M", - formula: "$TargetDedicatedNodes=1", + scaleSettings: { + autoScale: { evaluationInterval: "PT5M", formula: "$TargetDedicatedNodes=1" }, }, + vmSize: "STANDARD_D4", }, - vmSize: "STANDARD_D4", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.create( - resourceGroupName, - accountName, - poolName, - parameters, ); console.log(result); } /** - * This sample demonstrates how to Creates a new pool inside the specified account. + * 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/2024-07-01/examples/PoolCreate_NoPublicIPAddresses.json + * @summary creates a new pool inside the specified account. + * x-ms-original-file: 2025-06-01/PoolCreate_NoPublicIPAddresses.json */ async function createPoolNoPublicIP(): Promise { - 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: { - id: "/subscriptions/subid/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1", + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; + const client = new BatchManagementClient(credential, subscriptionId); + const result = await client.pool.create( + "default-azurebatch-japaneast", + "sampleacct", + "testpool", + { + deploymentConfiguration: { + virtualMachineConfiguration: { + imageReference: { + id: "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1", + }, + nodeAgentSkuId: "batch.node.ubuntu 18.04", }, - nodeAgentSkuId: "batch.node.ubuntu 18.04", }, + networkConfiguration: { + publicIPAddressConfiguration: { provision: "NoPublicIPAddresses" }, + subnetId: + "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123", + }, + vmSize: "STANDARD_D4", }, - networkConfiguration: { - publicIPAddressConfiguration: { provision: "NoPublicIPAddresses" }, - subnetId: - "/subscriptions/subid/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123", - }, - vmSize: "STANDARD_D4", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.create( - resourceGroupName, - accountName, - poolName, - parameters, ); console.log(result); } /** - * This sample demonstrates how to Creates a new pool inside the specified account. + * 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/2024-07-01/examples/PoolCreate_PublicIPs.json + * @summary creates a new pool inside the specified account. + * x-ms-original-file: 2025-06-01/PoolCreate_PublicIPs.json */ async function createPoolPublicIPs(): Promise { - 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: { - id: "/subscriptions/subid/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1", + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; + const client = new BatchManagementClient(credential, subscriptionId); + const result = await client.pool.create( + "default-azurebatch-japaneast", + "sampleacct", + "testpool", + { + deploymentConfiguration: { + virtualMachineConfiguration: { + imageReference: { + id: "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1", + }, + nodeAgentSkuId: "batch.node.ubuntu 18.04", }, - nodeAgentSkuId: "batch.node.ubuntu 18.04", }, - }, - networkConfiguration: { - publicIPAddressConfiguration: { - ipAddressIds: [ - "/subscriptions/subid1/resourceGroups/rg13/providers/Microsoft.Network/publicIPAddresses/ip135", - ], - provision: "UserManaged", + networkConfiguration: { + publicIPAddressConfiguration: { + ipAddressIds: [ + "/subscriptions/12345678-1234-1234-1234-1234567890121/resourceGroups/rg13/providers/Microsoft.Network/publicIPAddresses/ip135", + ], + provision: "UserManaged", + }, + subnetId: + "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123", }, - subnetId: - "/subscriptions/subid/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123", + vmSize: "STANDARD_D4", }, - vmSize: "STANDARD_D4", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.create( - resourceGroupName, - accountName, - poolName, - parameters, ); console.log(result); } /** - * This sample demonstrates how to Creates a new pool inside the specified account. + * 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/2024-07-01/examples/PoolCreate_ResourceTags.json + * @summary creates a new pool inside the specified account. + * x-ms-original-file: 2025-06-01/PoolCreate_SecurityProfile.json */ -async function createPoolResourceTags(): Promise { - 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: "UbuntuServer", - publisher: "Canonical", - sku: "18_04-lts-gen2", - version: "latest", +async function createPoolSecurityProfile(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; + const client = new BatchManagementClient(credential, subscriptionId); + const result = await client.pool.create( + "default-azurebatch-japaneast", + "sampleacct", + "testpool", + { + deploymentConfiguration: { + virtualMachineConfiguration: { + imageReference: { + offer: "UbuntuServer", + publisher: "Canonical", + sku: "18_04-lts-gen2", + version: "latest", + }, + nodeAgentSkuId: "batch.node.ubuntu 18.04", + securityProfile: { + encryptionAtHost: true, + securityType: "trustedLaunch", + uefiSettings: { vTpmEnabled: false }, + }, }, - nodeAgentSkuId: "batch.node.ubuntu 18.04", }, + scaleSettings: { fixedScale: { targetDedicatedNodes: 1, targetLowPriorityNodes: 0 } }, + vmSize: "Standard_d4s_v3", }, - resourceTags: { tagName1: "TagValue1", tagName2: "TagValue2" }, - scaleSettings: { - fixedScale: { targetDedicatedNodes: 1, targetLowPriorityNodes: 0 }, - }, - vmSize: "Standard_d4s_v3", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.create( - resourceGroupName, - accountName, - poolName, - parameters, ); console.log(result); } /** - * This sample demonstrates how to Creates a new pool inside the specified account. + * 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/2024-07-01/examples/PoolCreate_SecurityProfile.json + * @summary creates a new pool inside the specified account. + * x-ms-original-file: 2025-06-01/PoolCreate_SharedImageGallery.json */ -async function createPoolSecurityProfile(): Promise { - 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: "UbuntuServer", - publisher: "Canonical", - sku: "18_04-lts-gen2", - version: "latest", - }, - nodeAgentSkuId: "batch.node.ubuntu 18.04", - securityProfile: { - encryptionAtHost: true, - securityType: "trustedLaunch", - uefiSettings: { secureBootEnabled: undefined, vTpmEnabled: false }, +async function createPoolCustomImage(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; + const client = new BatchManagementClient(credential, subscriptionId); + const result = await client.pool.create( + "default-azurebatch-japaneast", + "sampleacct", + "testpool", + { + deploymentConfiguration: { + virtualMachineConfiguration: { + imageReference: { + id: "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1", + }, + nodeAgentSkuId: "batch.node.ubuntu 18.04", }, }, + vmSize: "STANDARD_D4", }, - scaleSettings: { - fixedScale: { targetDedicatedNodes: 1, targetLowPriorityNodes: 0 }, - }, - vmSize: "Standard_d4s_v3", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.create( - resourceGroupName, - accountName, - poolName, - parameters, ); console.log(result); } /** - * This sample demonstrates how to Creates a new pool inside the specified account. + * 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/2024-07-01/examples/PoolCreate_Tags.json + * @summary creates a new pool inside the specified account. + * x-ms-original-file: 2025-06-01/PoolCreate_Tags.json */ async function createPoolTags(): Promise { - 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: "0001-com-ubuntu-server-jammy", - publisher: "Canonical", - sku: "22_04-lts", - version: "latest", + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; + const client = new BatchManagementClient(credential, subscriptionId); + const result = await client.pool.create( + "default-azurebatch-japaneast", + "sampleacct", + "testpool", + { + deploymentConfiguration: { + virtualMachineConfiguration: { + imageReference: { + offer: "0001-com-ubuntu-server-jammy", + publisher: "Canonical", + sku: "22_04-lts", + version: "latest", + }, + nodeAgentSkuId: "batch.node.ubuntu 22.04", }, - nodeAgentSkuId: "batch.node.ubuntu 22.04", }, + scaleSettings: { fixedScale: { targetDedicatedNodes: 1, targetLowPriorityNodes: 0 } }, + vmSize: "Standard_d4s_v3", }, - scaleSettings: { - fixedScale: { targetDedicatedNodes: 1, targetLowPriorityNodes: 0 }, - }, - tags: { tagName1: "TagValue1", tagName2: "TagValue2" }, - vmSize: "Standard_d4s_v3", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.create( - resourceGroupName, - accountName, - poolName, - parameters, ); console.log(result); } /** - * This sample demonstrates how to Creates a new pool inside the specified account. + * 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/2024-07-01/examples/PoolCreate_UpgradePolicy.json + * @summary creates a new pool inside the specified account. + * x-ms-original-file: 2025-06-01/PoolCreate_UpgradePolicy.json */ async function createPoolUpgradePolicy(): Promise { - 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: "2019-datacenter-smalldisk", - version: "latest", + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; + const client = new BatchManagementClient(credential, subscriptionId); + const result = await client.pool.create( + "default-azurebatch-japaneast", + "sampleacct", + "testpool", + { + deploymentConfiguration: { + virtualMachineConfiguration: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2019-datacenter-smalldisk", + version: "latest", + }, + nodeAgentSkuId: "batch.node.windows amd64", + nodePlacementConfiguration: { policy: "Zonal" }, + windowsConfiguration: { enableAutomaticUpdates: false }, }, - nodeAgentSkuId: "batch.node.windows amd64", - nodePlacementConfiguration: { policy: "Zonal" }, - windowsConfiguration: { enableAutomaticUpdates: false }, - }, - }, - scaleSettings: { - fixedScale: { targetDedicatedNodes: 2, targetLowPriorityNodes: 0 }, - }, - upgradePolicy: { - automaticOSUpgradePolicy: { - disableAutomaticRollback: true, - enableAutomaticOSUpgrade: true, - osRollingUpgradeDeferral: true, - useRollingUpgradePolicy: true, }, - mode: "automatic", - rollingUpgradePolicy: { - enableCrossZoneUpgrade: true, - maxBatchInstancePercent: 20, - maxUnhealthyInstancePercent: 20, - maxUnhealthyUpgradedInstancePercent: 20, - pauseTimeBetweenBatches: "PT0S", - prioritizeUnhealthyInstances: false, - rollbackFailedInstancesOnPolicyBreach: false, + scaleSettings: { fixedScale: { targetDedicatedNodes: 2, targetLowPriorityNodes: 0 } }, + upgradePolicy: { + automaticOSUpgradePolicy: { + disableAutomaticRollback: true, + enableAutomaticOSUpgrade: true, + osRollingUpgradeDeferral: true, + useRollingUpgradePolicy: true, + }, + mode: "automatic", + rollingUpgradePolicy: { + enableCrossZoneUpgrade: true, + maxBatchInstancePercent: 20, + maxUnhealthyInstancePercent: 20, + maxUnhealthyUpgradedInstancePercent: 20, + pauseTimeBetweenBatches: "PT0S", + prioritizeUnhealthyInstances: false, + rollbackFailedInstancesOnPolicyBreach: false, + }, }, + vmSize: "Standard_d4s_v3", }, - vmSize: "Standard_d4s_v3", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.create( - resourceGroupName, - accountName, - poolName, - parameters, ); console.log(result); } /** - * This sample demonstrates how to Creates a new pool inside the specified account. + * 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/2024-07-01/examples/PoolCreate_UserAssignedIdentities.json + * @summary creates a new pool inside the specified account. + * x-ms-original-file: 2025-06-01/PoolCreate_UserAssignedIdentities.json */ async function createPoolUserAssignedIdentities(): Promise { - 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: "UbuntuServer", - publisher: "Canonical", - sku: "18.04-LTS", - version: "latest", + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; + const client = new BatchManagementClient(credential, subscriptionId); + const result = await client.pool.create( + "default-azurebatch-japaneast", + "sampleacct", + "testpool", + { + identity: { + type: "UserAssigned", + userAssignedIdentities: { + "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": + {}, + "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2": + {}, }, - nodeAgentSkuId: "batch.node.ubuntu 18.04", }, - }, - identity: { - type: "UserAssigned", - userAssignedIdentities: { - "/subscriptions/subid/resourceGroups/defaultAzurebatchJapaneast/providers/MicrosoftManagedIdentity/userAssignedIdentities/id1": - {}, - "/subscriptions/subid/resourceGroups/defaultAzurebatchJapaneast/providers/MicrosoftManagedIdentity/userAssignedIdentities/id2": - {}, + deploymentConfiguration: { + virtualMachineConfiguration: { + imageReference: { + offer: "UbuntuServer", + publisher: "Canonical", + sku: "18.04-LTS", + version: "latest", + }, + nodeAgentSkuId: "batch.node.ubuntu 18.04", + }, }, - }, - scaleSettings: { - autoScale: { - evaluationInterval: "PT5M", - formula: "$TargetDedicatedNodes=1", + scaleSettings: { + autoScale: { evaluationInterval: "PT5M", formula: "$TargetDedicatedNodes=1" }, }, + vmSize: "STANDARD_D4", }, - vmSize: "STANDARD_D4", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.create( - resourceGroupName, - accountName, - poolName, - parameters, ); console.log(result); } /** - * This sample demonstrates how to Creates a new pool inside the specified account. + * 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/2024-07-01/examples/PoolCreate_VirtualMachineConfiguration_Extensions.json + * @summary creates a new pool inside the specified account. + * x-ms-original-file: 2025-06-01/PoolCreate_VirtualMachineConfiguration.json */ -async function createPoolVirtualMachineConfigurationExtensions(): Promise { - 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: "0001-com-ubuntu-server-focal", - publisher: "Canonical", - sku: "20_04-lts", - }, - nodeAgentSkuId: "batch.node.ubuntu 20.04", - extensions: [ - { - name: "batchextension1", - type: "KeyVaultForLinux", - autoUpgradeMinorVersion: true, - enableAutomaticUpgrade: true, - publisher: "Microsoft.Azure.KeyVault", - settings: { - authenticationSettingsKey: "authenticationSettingsValue", - secretsManagementSettingsKey: "secretsManagementSettingsValue", +async function createPoolFullVirtualMachineConfiguration(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; + const client = new BatchManagementClient(credential, subscriptionId); + const result = await client.pool.create( + "default-azurebatch-japaneast", + "sampleacct", + "testpool", + { + deploymentConfiguration: { + virtualMachineConfiguration: { + dataDisks: [ + { + caching: "ReadWrite", + diskSizeGB: 30, + lun: 0, + managedDisk: { storageAccountType: "StandardSSD_LRS" }, + }, + { + caching: "None", + diskSizeGB: 200, + lun: 1, + managedDisk: { storageAccountType: "Premium_LRS" }, }, - typeHandlerVersion: "2.0", + ], + diskEncryptionConfiguration: { targets: ["OsDisk", "TemporaryDisk"] }, + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2016-Datacenter-SmallDisk", + version: "latest", }, - ], + licenseType: "Windows_Server", + nodeAgentSkuId: "batch.node.windows amd64", + nodePlacementConfiguration: { policy: "Zonal" }, + osDisk: { ephemeralOSDiskSettings: { placement: "CacheDisk" } }, + windowsConfiguration: { enableAutomaticUpdates: false }, + }, }, - }, - scaleSettings: { - autoScale: { - evaluationInterval: "PT5M", - formula: "$TargetDedicatedNodes=1", + networkConfiguration: { + endpointConfiguration: { + inboundNatPools: [ + { + name: "testnat", + backendPort: 12001, + frontendPortRangeEnd: 15100, + frontendPortRangeStart: 15000, + networkSecurityGroupRules: [ + { + access: "Allow", + priority: 150, + sourceAddressPrefix: "192.100.12.45", + sourcePortRanges: ["1", "2"], + }, + { + access: "Deny", + priority: 3500, + sourceAddressPrefix: "*", + sourcePortRanges: ["*"], + }, + ], + protocol: "TCP", + }, + ], + }, }, + scaleSettings: { + autoScale: { evaluationInterval: "PT5M", formula: "$TargetDedicatedNodes=1" }, + }, + vmSize: "STANDARD_D4", }, - targetNodeCommunicationMode: "Default", - vmSize: "STANDARD_D4", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.create( - resourceGroupName, - accountName, - poolName, - parameters, ); console.log(result); } /** - * This sample demonstrates how to Creates a new pool inside the specified account. + * 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/2024-07-01/examples/PoolCreate_VirtualMachineConfiguration_ManagedOSDisk.json + * @summary creates a new pool inside the specified account. + * x-ms-original-file: 2025-06-01/PoolCreate_VirtualMachineConfiguration_Extensions.json */ -async function createPoolVirtualMachineConfigurationOSDisk(): Promise { - 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: "2022-datacenter-smalldisk", - }, - nodeAgentSkuId: "batch.node.windows amd64", - osDisk: { - caching: "ReadWrite", - diskSizeGB: 100, - managedDisk: { storageAccountType: "StandardSSD_LRS" }, - writeAcceleratorEnabled: false, +async function createPoolVirtualMachineConfigurationExtensions(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; + const client = new BatchManagementClient(credential, subscriptionId); + const result = await client.pool.create( + "default-azurebatch-japaneast", + "sampleacct", + "testpool", + { + deploymentConfiguration: { + virtualMachineConfiguration: { + imageReference: { + offer: "0001-com-ubuntu-server-focal", + publisher: "Canonical", + sku: "20_04-lts", + }, + nodeAgentSkuId: "batch.node.ubuntu 20.04", + extensions: [ + { + name: "batchextension1", + type: "KeyVaultForLinux", + autoUpgradeMinorVersion: true, + enableAutomaticUpgrade: true, + publisher: "Microsoft.Azure.KeyVault", + settings: { + authenticationSettingsKey: "authenticationSettingsValue", + secretsManagementSettingsKey: "secretsManagementSettingsValue", + }, + typeHandlerVersion: "2.0", + }, + ], }, }, + scaleSettings: { + autoScale: { evaluationInterval: "PT5M", formula: "$TargetDedicatedNodes=1" }, + }, + vmSize: "STANDARD_D4", }, - scaleSettings: { - fixedScale: { targetDedicatedNodes: 1, targetLowPriorityNodes: 0 }, - }, - vmSize: "Standard_d2s_v3", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.create( - resourceGroupName, - accountName, - poolName, - parameters, ); console.log(result); } /** - * This sample demonstrates how to Creates a new pool inside the specified account. + * 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/2024-07-01/examples/PoolCreate_VirtualMachineConfiguration_ServiceArtifactReference.json + * @summary creates a new pool inside the specified account. + * x-ms-original-file: 2025-06-01/PoolCreate_VirtualMachineConfiguration_ManagedOSDisk.json */ -async function createPoolVirtualMachineConfigurationServiceArtifactReference(): Promise { - 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: "2019-datacenter-smalldisk", - version: "latest", - }, - nodeAgentSkuId: "batch.node.windows amd64", - serviceArtifactReference: { - id: "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/galleries/myGallery/serviceArtifacts/myServiceArtifact/vmArtifactsProfiles/vmArtifactsProfile", +async function createPoolVirtualMachineConfigurationOSDisk(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; + const client = new BatchManagementClient(credential, subscriptionId); + const result = await client.pool.create( + "default-azurebatch-japaneast", + "sampleacct", + "testpool", + { + deploymentConfiguration: { + virtualMachineConfiguration: { + imageReference: { + offer: "windowsserver", + publisher: "microsoftwindowsserver", + sku: "2022-datacenter-smalldisk", + }, + nodeAgentSkuId: "batch.node.windows amd64", + osDisk: { + caching: "ReadWrite", + diskSizeGB: 100, + managedDisk: { storageAccountType: "StandardSSD_LRS" }, + writeAcceleratorEnabled: false, + }, }, - windowsConfiguration: { enableAutomaticUpdates: false }, }, + scaleSettings: { fixedScale: { targetDedicatedNodes: 1, targetLowPriorityNodes: 0 } }, + vmSize: "Standard_d2s_v3", }, - scaleSettings: { - fixedScale: { targetDedicatedNodes: 2, targetLowPriorityNodes: 0 }, - }, - upgradePolicy: { - automaticOSUpgradePolicy: { enableAutomaticOSUpgrade: true }, - mode: "automatic", - }, - vmSize: "Standard_d4s_v3", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.create( - resourceGroupName, - accountName, - poolName, - parameters, ); console.log(result); } /** - * This sample demonstrates how to Creates a new pool inside the specified account. + * 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/2024-07-01/examples/PoolCreate_AcceleratedNetworking.json + * @summary creates a new pool inside the specified account. + * x-ms-original-file: 2025-06-01/PoolCreate_VirtualMachineConfiguration_ServiceArtifactReference.json */ -async function createPoolAcceleratedNetworking(): Promise { - 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", +async function createPoolVirtualMachineConfigurationServiceArtifactReference(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; + const client = new BatchManagementClient(credential, subscriptionId); + const result = await client.pool.create( + "default-azurebatch-japaneast", + "sampleacct", + "testpool", + { + deploymentConfiguration: { + virtualMachineConfiguration: { + imageReference: { + offer: "WindowsServer", + publisher: "MicrosoftWindowsServer", + sku: "2019-datacenter-smalldisk", + version: "latest", + }, + nodeAgentSkuId: "batch.node.windows amd64", + serviceArtifactReference: { + id: "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/galleries/myGallery/serviceArtifacts/myServiceArtifact/vmArtifactsProfiles/vmArtifactsProfile", + }, + windowsConfiguration: { enableAutomaticUpdates: false }, }, - nodeAgentSkuId: "batch.node.windows amd64", }, + scaleSettings: { fixedScale: { targetDedicatedNodes: 2, targetLowPriorityNodes: 0 } }, + upgradePolicy: { + automaticOSUpgradePolicy: { enableAutomaticOSUpgrade: true }, + mode: "automatic", + }, + vmSize: "Standard_d4s_v3", }, - 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(): Promise { - await createPoolCustomImage(); - await createPoolFullVirtualMachineConfiguration(); + await createPoolAcceleratedNetworking(); + await createPoolConfidentialDiskEncryptionSetForUserSubscriptionAccounts(); + await createPoolCustomerManagedKeyForBatchManagedAccounts(); + await createPoolDiskEncryptionSetForUserSubscriptionAccounts(); + await createPoolDualStackNetworking(); await createPoolMinimalVirtualMachineConfiguration(); await createPoolNoPublicIP(); await createPoolPublicIPs(); - await createPoolResourceTags(); await createPoolSecurityProfile(); + await createPoolCustomImage(); await createPoolTags(); await createPoolUpgradePolicy(); await createPoolUserAssignedIdentities(); + await createPoolFullVirtualMachineConfiguration(); await createPoolVirtualMachineConfigurationExtensions(); await createPoolVirtualMachineConfigurationOSDisk(); await createPoolVirtualMachineConfigurationServiceArtifactReference(); - await 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 ea6d56ccf2f6..4c48e35aecca 100644 --- a/sdk/batch/arm-batch/samples-dev/poolDeleteSample.ts +++ b/sdk/batch/arm-batch/samples-dev/poolDeleteSample.ts @@ -1,30 +1,20 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * 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/2024-07-01/examples/PoolDelete.json - */ - import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to deletes the specified pool. + * + * @summary deletes the specified pool. + * x-ms-original-file: 2025-06-01/PoolDelete.json + */ async function deletePool(): Promise { - 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 subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.beginDeleteAndWait( - resourceGroupName, - accountName, - poolName, - ); - console.log(result); + await client.pool.delete("default-azurebatch-japaneast", "sampleacct", "testpool"); } async function main(): Promise { diff --git a/sdk/batch/arm-batch/samples-dev/poolDisableAutoScaleSample.ts b/sdk/batch/arm-batch/samples-dev/poolDisableAutoScaleSample.ts index e8e7ff30860f..1913b53021e8 100644 --- a/sdk/batch/arm-batch/samples-dev/poolDisableAutoScaleSample.ts +++ b/sdk/batch/arm-batch/samples-dev/poolDisableAutoScaleSample.ts @@ -1,28 +1,23 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * 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/2024-07-01/examples/PoolDisableAutoScale.json - */ - import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to disables automatic scaling for a pool. + * + * @summary disables automatic scaling for a pool. + * x-ms-original-file: 2025-06-01/PoolDisableAutoScale.json + */ async function disableAutoScale(): Promise { - 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 subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.disableAutoScale( - resourceGroupName, - accountName, - poolName, + const result = await client.pool.disableAutoScale( + "default-azurebatch-japaneast", + "sampleacct", + "testpool", ); console.log(result); } diff --git a/sdk/batch/arm-batch/samples-dev/poolGetSample.ts b/sdk/batch/arm-batch/samples-dev/poolGetSample.ts index 3ba4627f6105..74401021f8b3 100644 --- a/sdk/batch/arm-batch/samples-dev/poolGetSample.ts +++ b/sdk/batch/arm-batch/samples-dev/poolGetSample.ts @@ -1,127 +1,104 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * 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/2024-07-01/examples/PoolGet.json - */ - import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to gets information about the specified pool. + * + * @summary gets information about the specified pool. + * x-ms-original-file: 2025-06-01/PoolGet.json + */ async function getPool(): Promise { - 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 subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.get(resourceGroupName, accountName, poolName); + const result = await client.pool.get("default-azurebatch-japaneast", "sampleacct", "testpool"); console.log(result); } /** - * This sample demonstrates how to Gets information about the specified pool. + * 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/2024-07-01/examples/PoolGet_AcceleratedNetworking.json + * @summary gets information about the specified pool. + * x-ms-original-file: 2025-06-01/PoolGet_AcceleratedNetworking.json */ async function getPoolAcceleratedNetworking(): Promise { - 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 subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.get(resourceGroupName, accountName, poolName); + const result = await client.pool.get("default-azurebatch-japaneast", "sampleacct", "testpool"); console.log(result); } /** - * This sample demonstrates how to Gets information about the specified pool. + * 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/2024-07-01/examples/PoolGet_SecurityProfile.json + * @summary gets information about the specified pool. + * x-ms-original-file: 2025-06-01/PoolGet_SecurityProfile.json */ async function getPoolSecurityProfile(): Promise { - 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 subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.get(resourceGroupName, accountName, poolName); + const result = await client.pool.get("default-azurebatch-japaneast", "sampleacct", "testpool"); console.log(result); } /** - * This sample demonstrates how to Gets information about the specified pool. + * 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/2024-07-01/examples/PoolGet_UpgradePolicy.json + * @summary gets information about the specified pool. + * x-ms-original-file: 2025-06-01/PoolGet_UpgradePolicy.json */ async function getPoolUpgradePolicy(): Promise { - 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 subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.get(resourceGroupName, accountName, poolName); + const result = await client.pool.get("default-azurebatch-japaneast", "sampleacct", "testpool"); console.log(result); } /** - * This sample demonstrates how to Gets information about the specified pool. + * 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/2024-07-01/examples/PoolGet_VirtualMachineConfiguration_Extensions.json + * @summary gets information about the specified pool. + * x-ms-original-file: 2025-06-01/PoolGet_VirtualMachineConfiguration_Extensions.json */ async function getPoolVirtualMachineConfigurationExtensions(): Promise { - 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 subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.get(resourceGroupName, accountName, poolName); + const result = await client.pool.get("default-azurebatch-japaneast", "sampleacct", "testpool"); console.log(result); } /** - * This sample demonstrates how to Gets information about the specified pool. + * 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/2024-07-01/examples/PoolGet_VirtualMachineConfiguration_MangedOSDisk.json + * @summary gets information about the specified pool. + * x-ms-original-file: 2025-06-01/PoolGet_VirtualMachineConfiguration_MangedOSDisk.json */ async function getPoolVirtualMachineConfigurationOSDisk(): Promise { - 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 subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.get(resourceGroupName, accountName, poolName); + const result = await client.pool.get("default-azurebatch-japaneast", "sampleacct", "testpool"); console.log(result); } /** - * This sample demonstrates how to Gets information about the specified pool. + * 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/2024-07-01/examples/PoolGet_VirtualMachineConfiguration_ServiceArtifactReference.json + * @summary gets information about the specified pool. + * x-ms-original-file: 2025-06-01/PoolGet_VirtualMachineConfiguration_ServiceArtifactReference.json */ async function getPoolVirtualMachineConfigurationServiceArtifactReference(): Promise { - 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 subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.get(resourceGroupName, accountName, poolName); + const result = await client.pool.get("default-azurebatch-japaneast", "sampleacct", "testpool"); console.log(result); } diff --git a/sdk/batch/arm-batch/samples-dev/poolListByBatchAccountSample.ts b/sdk/batch/arm-batch/samples-dev/poolListByBatchAccountSample.ts index 5cd75729e1b3..05c80817f1ec 100644 --- a/sdk/batch/arm-batch/samples-dev/poolListByBatchAccountSample.ts +++ b/sdk/batch/arm-batch/samples-dev/poolListByBatchAccountSample.ts @@ -1,59 +1,54 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * 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/2024-07-01/examples/PoolList.json - */ - -import type { PoolListByBatchAccountOptionalParams } from "@azure/arm-batch"; import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; -import "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: 2025-06-01/PoolList.json + */ async function listPool(): Promise { - 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 subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.poolOperations.listByBatchAccount( - resourceGroupName, - accountName, + for await (const item of client.pool.listByBatchAccount( + "default-azurebatch-japaneast", + "sampleacct", )) { resArray.push(item); } + console.log(resArray); } /** - * This sample demonstrates how to Lists all of the pools in the specified account. + * 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/2024-07-01/examples/PoolListWithFilter.json + * @summary lists all of the pools in the specified account. + * x-ms-original-file: 2025-06-01/PoolListWithFilter.json */ async function listPoolWithFilter(): Promise { - 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"; - const filter = - "startswith(name, 'po') or (properties/allocationState eq 'Steady' and properties/provisioningStateTransitionTime lt datetime'2017-02-02')"; - const options: PoolListByBatchAccountOptionalParams = { select, filter }; const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.poolOperations.listByBatchAccount( - resourceGroupName, - accountName, - options, + for await (const item of client.pool.listByBatchAccount( + "default-azurebatch-japaneast", + "sampleacct", + { + select: + "properties/allocationState,properties/provisioningStateTransitionTime,properties/currentDedicatedNodes,properties/currentLowPriorityNodes", + filter: + "startswith(name, 'po') or (properties/allocationState eq 'Steady' and properties/provisioningStateTransitionTime lt datetime'2017-02-02')", + }, )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/batch/arm-batch/samples-dev/poolStopResizeSample.ts b/sdk/batch/arm-batch/samples-dev/poolStopResizeSample.ts index 48f63eb6771f..63501de9f018 100644 --- a/sdk/batch/arm-batch/samples-dev/poolStopResizeSample.ts +++ b/sdk/batch/arm-batch/samples-dev/poolStopResizeSample.ts @@ -1,25 +1,24 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * 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/2024-07-01/examples/PoolStopResize.json - */ - import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; -import "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: 2025-06-01/PoolStopResize.json + */ async function stopPoolResize(): Promise { - 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 subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.stopResize(resourceGroupName, accountName, poolName); + const result = await client.pool.stopResize( + "default-azurebatch-japaneast", + "sampleacct", + "testpool", + ); console.log(result); } diff --git a/sdk/batch/arm-batch/samples-dev/poolUpdateSample.ts b/sdk/batch/arm-batch/samples-dev/poolUpdateSample.ts index 32797c910a9a..5cacf1f470f9 100644 --- a/sdk/batch/arm-batch/samples-dev/poolUpdateSample.ts +++ b/sdk/batch/arm-batch/samples-dev/poolUpdateSample.ts @@ -1,130 +1,101 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * 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/2024-07-01/examples/PoolUpdate_EnableAutoScale.json - */ - -import type { Pool } from "@azure/arm-batch"; import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; -import "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: 2025-06-01/PoolUpdate_EnableAutoScale.json + */ async function updatePoolEnableAutoscale(): Promise { - 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 = { - scaleSettings: { autoScale: { formula: "$TargetDedicatedNodes=34" } }, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.update( - resourceGroupName, - accountName, - poolName, - parameters, + const result = await client.pool.update( + "default-azurebatch-japaneast", + "sampleacct", + "testpool", + { scaleSettings: { autoScale: { formula: "$TargetDedicatedNodes=34" } } }, ); console.log(result); } /** - * This sample demonstrates how to Updates the properties of an existing pool. + * 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/2024-07-01/examples/PoolUpdate_OtherProperties.json + * @summary updates the properties of an existing pool. + * x-ms-original-file: 2025-06-01/PoolUpdate_OtherProperties.json */ async function updatePoolOtherProperties(): Promise { - 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 = { - applicationPackages: [ - { - id: "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool/applications/app_1234", - }, - { - id: "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool/applications/app_5678", - version: "1.0", - }, - ], - certificates: [ - { - id: "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool/certificates/sha1-1234567", - storeLocation: "LocalMachine", - storeName: "MY", - }, - ], - metadata: [{ name: "key1", value: "value1" }], - targetNodeCommunicationMode: "Simplified", - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.update( - resourceGroupName, - accountName, - poolName, - parameters, + const result = await client.pool.update( + "default-azurebatch-japaneast", + "sampleacct", + "testpool", + { + applicationPackages: [ + { + id: "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool/applications/app_1234", + }, + { + id: "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool/applications/app_5678", + version: "1.0", + }, + ], + metadata: [{ name: "key1", value: "value1" }], + }, ); console.log(result); } /** - * This sample demonstrates how to Updates the properties of an existing pool. + * 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/2024-07-01/examples/PoolUpdate_RemoveStartTask.json + * @summary updates the properties of an existing pool. + * x-ms-original-file: 2025-06-01/PoolUpdate_RemoveStartTask.json */ async function updatePoolRemoveStartTask(): Promise { - 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: {} }; const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.update( - resourceGroupName, - accountName, - poolName, - parameters, + const result = await client.pool.update( + "default-azurebatch-japaneast", + "sampleacct", + "testpool", + { startTask: {} }, ); console.log(result); } /** - * This sample demonstrates how to Updates the properties of an existing pool. + * 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/2024-07-01/examples/PoolUpdate_ResizePool.json + * @summary updates the properties of an existing pool. + * x-ms-original-file: 2025-06-01/PoolUpdate_ResizePool.json */ async function updatePoolResizePool(): Promise { - 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 = { - scaleSettings: { - fixedScale: { - nodeDeallocationOption: "TaskCompletion", - resizeTimeout: "PT8M", - targetDedicatedNodes: 5, - targetLowPriorityNodes: 0, - }, - }, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.update( - resourceGroupName, - accountName, - poolName, - parameters, + const result = await client.pool.update( + "default-azurebatch-japaneast", + "sampleacct", + "testpool", + { + scaleSettings: { + fixedScale: { + nodeDeallocationOption: "TaskCompletion", + resizeTimeout: "PT8M", + targetDedicatedNodes: 5, + targetLowPriorityNodes: 0, + }, + }, + }, ); console.log(result); } diff --git a/sdk/batch/arm-batch/samples-dev/privateEndpointConnectionDeleteSample.ts b/sdk/batch/arm-batch/samples-dev/privateEndpointConnectionDeleteSample.ts index 873a37a25913..ddfcd99cc0e7 100644 --- a/sdk/batch/arm-batch/samples-dev/privateEndpointConnectionDeleteSample.ts +++ b/sdk/batch/arm-batch/samples-dev/privateEndpointConnectionDeleteSample.ts @@ -1,31 +1,24 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * 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/2024-07-01/examples/PrivateEndpointConnectionDelete.json - */ - import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to deletes the specified private endpoint connection. + * + * @summary deletes the specified private endpoint connection. + * x-ms-original-file: 2025-06-01/PrivateEndpointConnectionDelete.json + */ async function privateEndpointConnectionDelete(): Promise { - 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"; const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.privateEndpointConnectionOperations.beginDeleteAndWait( - resourceGroupName, - accountName, - privateEndpointConnectionName, + await client.privateEndpointConnection.delete( + "default-azurebatch-japaneast", + "sampleacct", + "testprivateEndpointConnection5testprivateEndpointConnection5.24d6b4b5-e65c-4330-bbe9-3a290d62f8e0", ); - console.log(result); } async function main(): Promise { diff --git a/sdk/batch/arm-batch/samples-dev/privateEndpointConnectionGetSample.ts b/sdk/batch/arm-batch/samples-dev/privateEndpointConnectionGetSample.ts index cb625de35d6d..c599cc6abbdf 100644 --- a/sdk/batch/arm-batch/samples-dev/privateEndpointConnectionGetSample.ts +++ b/sdk/batch/arm-batch/samples-dev/privateEndpointConnectionGetSample.ts @@ -1,29 +1,23 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * 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/2024-07-01/examples/PrivateEndpointConnectionGet.json - */ - import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; -import "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: 2025-06-01/PrivateEndpointConnectionGet.json + */ async function getPrivateEndpointConnection(): Promise { - 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"; const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.privateEndpointConnectionOperations.get( - resourceGroupName, - accountName, - privateEndpointConnectionName, + const result = await client.privateEndpointConnection.get( + "default-azurebatch-japaneast", + "sampleacct", + "testprivateEndpointConnection5testprivateEndpointConnection5.24d6b4b5-e65c-4330-bbe9-3a290d62f8e0", ); console.log(result); } diff --git a/sdk/batch/arm-batch/samples-dev/privateEndpointConnectionListByBatchAccountSample.ts b/sdk/batch/arm-batch/samples-dev/privateEndpointConnectionListByBatchAccountSample.ts index 1a78500a5786..9e3de5887960 100644 --- a/sdk/batch/arm-batch/samples-dev/privateEndpointConnectionListByBatchAccountSample.ts +++ b/sdk/batch/arm-batch/samples-dev/privateEndpointConnectionListByBatchAccountSample.ts @@ -1,30 +1,27 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * 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/2024-07-01/examples/PrivateEndpointConnectionsList.json - */ - import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; -import "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: 2025-06-01/PrivateEndpointConnectionsList.json + */ async function listPrivateEndpointConnections(): Promise { - 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 subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.privateEndpointConnectionOperations.listByBatchAccount( - resourceGroupName, - accountName, + for await (const item of client.privateEndpointConnection.listByBatchAccount( + "default-azurebatch-japaneast", + "sampleacct", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/batch/arm-batch/samples-dev/privateEndpointConnectionUpdateSample.ts b/sdk/batch/arm-batch/samples-dev/privateEndpointConnectionUpdateSample.ts index d66ad5b9d511..c5374bf765a2 100644 --- a/sdk/batch/arm-batch/samples-dev/privateEndpointConnectionUpdateSample.ts +++ b/sdk/batch/arm-batch/samples-dev/privateEndpointConnectionUpdateSample.ts @@ -1,37 +1,29 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * 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/2024-07-01/examples/PrivateEndpointConnectionUpdate.json - */ - -import type { PrivateEndpointConnection } from "@azure/arm-batch"; import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; -import "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: 2025-06-01/PrivateEndpointConnectionUpdate.json + */ async function updatePrivateEndpointConnection(): Promise { - 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"; - const parameters: PrivateEndpointConnection = { - privateLinkServiceConnectionState: { - description: "Approved by xyz.abc@company.com", - status: "Approved", - }, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.privateEndpointConnectionOperations.beginUpdateAndWait( - resourceGroupName, - accountName, - privateEndpointConnectionName, - parameters, + const result = await client.privateEndpointConnection.update( + "default-azurebatch-japaneast", + "sampleacct", + "testprivateEndpointConnection5.24d6b4b5-e65c-4330-bbe9-3a290d62f8e0", + { + privateLinkServiceConnectionState: { + description: "Approved by xyz.abc@company.com", + status: "Approved", + }, + }, ); console.log(result); } diff --git a/sdk/batch/arm-batch/samples-dev/privateLinkResourceGetSample.ts b/sdk/batch/arm-batch/samples-dev/privateLinkResourceGetSample.ts index 7a8ff2e35068..7197014b1e9b 100644 --- a/sdk/batch/arm-batch/samples-dev/privateLinkResourceGetSample.ts +++ b/sdk/batch/arm-batch/samples-dev/privateLinkResourceGetSample.ts @@ -1,28 +1,23 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * 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/2024-07-01/examples/PrivateLinkResourceGet.json - */ - import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; -import "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: 2025-06-01/PrivateLinkResourceGet.json + */ async function getPrivateLinkResource(): Promise { - 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(); + const subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.privateLinkResourceOperations.get( - resourceGroupName, - accountName, - privateLinkResourceName, + const result = await client.privateLinkResource.get( + "default-azurebatch-japaneast", + "sampleacct", + "batchAccount", ); console.log(result); } diff --git a/sdk/batch/arm-batch/samples-dev/privateLinkResourceListByBatchAccountSample.ts b/sdk/batch/arm-batch/samples-dev/privateLinkResourceListByBatchAccountSample.ts index fb2aced2a35d..1158eb67175d 100644 --- a/sdk/batch/arm-batch/samples-dev/privateLinkResourceListByBatchAccountSample.ts +++ b/sdk/batch/arm-batch/samples-dev/privateLinkResourceListByBatchAccountSample.ts @@ -1,30 +1,27 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * 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/2024-07-01/examples/PrivateLinkResourcesList.json - */ - import { BatchManagementClient } from "@azure/arm-batch"; import { DefaultAzureCredential } from "@azure/identity"; -import "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: 2025-06-01/PrivateLinkResourcesList.json + */ async function listPrivateLinkResource(): Promise { - 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 subscriptionId = "12345678-1234-1234-1234-123456789012"; const client = new BatchManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.privateLinkResourceOperations.listByBatchAccount( - resourceGroupName, - accountName, + for await (const item of client.privateLinkResource.listByBatchAccount( + "default-azurebatch-japaneast", + "sampleacct", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/batch/arm-batch/samples/v10/javascript/README.md b/sdk/batch/arm-batch/samples/v10/javascript/README.md deleted file mode 100644 index 19079dde5356..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/README.md +++ /dev/null @@ -1,144 +0,0 @@ -# client library samples for JavaScript - -These sample programs show how to use the JavaScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| --------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [applicationCreateSample.js][applicationcreatesample] | Adds an application to the specified Batch account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-01/examples/ApplicationCreate.json | -| [applicationDeleteSample.js][applicationdeletesample] | Deletes an application. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-01/examples/ApplicationDelete.json | -| [applicationGetSample.js][applicationgetsample] | Gets information about the specified application. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-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/2024-07-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/2024-07-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/2024-07-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/2024-07-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/2024-07-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/2024-07-01/examples/ApplicationPackageList.json | -| [applicationUpdateSample.js][applicationupdatesample] | Updates settings for the specified application. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-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/2024-07-01/examples/BatchAccountCreate_BYOS.json | -| [batchAccountDeleteSample.js][batchaccountdeletesample] | Deletes the specified Batch account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-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/2024-07-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/2024-07-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/2024-07-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/2024-07-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/2024-07-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://learn.microsoft.com/azure/batch/batch-virtual-network. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-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/2024-07-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/2024-07-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/2024-07-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/2024-07-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/2024-07-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/2024-07-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/2024-07-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/2024-07-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/2024-07-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/2024-07-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/2024-07-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/2024-07-01/examples/LocationGetQuotas.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/2024-07-01/examples/LocationListVirtualMachineSkus.json | -| [networkSecurityPerimeterGetConfigurationSample.js][networksecurityperimetergetconfigurationsample] | Gets information about the specified NSP configuration. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-01/examples/NspConfigurationGet.json | -| [networkSecurityPerimeterListConfigurationsSample.js][networksecurityperimeterlistconfigurationssample] | Lists all of the NSP configurations in the specified account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-01/examples/NspConfigurationsList.json | -| [networkSecurityPerimeterReconcileConfigurationSample.js][networksecurityperimeterreconcileconfigurationsample] | Reconciles the specified NSP configuration. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-01/examples/NspConfigurationReconcile.json | -| [operationsListSample.js][operationslistsample] | Lists available operations for the Microsoft.Batch provider x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-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/2024-07-01/examples/PoolCreate_SharedImageGallery.json | -| [poolDeleteSample.js][pooldeletesample] | Deletes the specified pool. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-01/examples/PoolDelete.json | -| [poolDisableAutoScaleSample.js][pooldisableautoscalesample] | Disables automatic scaling for a pool. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-01/examples/PoolDisableAutoScale.json | -| [poolGetSample.js][poolgetsample] | Gets information about the specified pool. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-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/2024-07-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/2024-07-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/2024-07-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/2024-07-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/2024-07-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/2024-07-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/2024-07-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/2024-07-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/2024-07-01/examples/PrivateLinkResourcesList.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -3. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node 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 -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/v10/javascript/applicationCreateSample.js -[applicationdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/javascript/applicationDeleteSample.js -[applicationgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/javascript/applicationGetSample.js -[applicationlistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/javascript/applicationListSample.js -[applicationpackageactivatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/javascript/applicationPackageActivateSample.js -[applicationpackagecreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/javascript/applicationPackageCreateSample.js -[applicationpackagedeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/javascript/applicationPackageDeleteSample.js -[applicationpackagegetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/javascript/applicationPackageGetSample.js -[applicationpackagelistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/javascript/applicationPackageListSample.js -[applicationupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/javascript/applicationUpdateSample.js -[batchaccountcreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/javascript/batchAccountCreateSample.js -[batchaccountdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/javascript/batchAccountDeleteSample.js -[batchaccountgetdetectorsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/javascript/batchAccountGetDetectorSample.js -[batchaccountgetkeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/javascript/batchAccountGetKeysSample.js -[batchaccountgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/javascript/batchAccountGetSample.js -[batchaccountlistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/javascript/batchAccountListByResourceGroupSample.js -[batchaccountlistdetectorssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/javascript/batchAccountListDetectorsSample.js -[batchaccountlistoutboundnetworkdependenciesendpointssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/javascript/batchAccountListOutboundNetworkDependenciesEndpointsSample.js -[batchaccountlistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/javascript/batchAccountListSample.js -[batchaccountregeneratekeysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/javascript/batchAccountRegenerateKeySample.js -[batchaccountsynchronizeautostoragekeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/javascript/batchAccountSynchronizeAutoStorageKeysSample.js -[batchaccountupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/javascript/batchAccountUpdateSample.js -[certificatecanceldeletionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/javascript/certificateCancelDeletionSample.js -[certificatecreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/javascript/certificateCreateSample.js -[certificatedeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/javascript/certificateDeleteSample.js -[certificategetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/javascript/certificateGetSample.js -[certificatelistbybatchaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/javascript/certificateListByBatchAccountSample.js -[certificateupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/javascript/certificateUpdateSample.js -[locationchecknameavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/javascript/locationCheckNameAvailabilitySample.js -[locationgetquotassample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/javascript/locationGetQuotasSample.js -[locationlistsupportedvirtualmachineskussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/javascript/locationListSupportedVirtualMachineSkusSample.js -[networksecurityperimetergetconfigurationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/javascript/networkSecurityPerimeterGetConfigurationSample.js -[networksecurityperimeterlistconfigurationssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/javascript/networkSecurityPerimeterListConfigurationsSample.js -[networksecurityperimeterreconcileconfigurationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/javascript/networkSecurityPerimeterReconcileConfigurationSample.js -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/javascript/operationsListSample.js -[poolcreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/javascript/poolCreateSample.js -[pooldeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/javascript/poolDeleteSample.js -[pooldisableautoscalesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/javascript/poolDisableAutoScaleSample.js -[poolgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/javascript/poolGetSample.js -[poollistbybatchaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/javascript/poolListByBatchAccountSample.js -[poolstopresizesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/javascript/poolStopResizeSample.js -[poolupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/javascript/poolUpdateSample.js -[privateendpointconnectiondeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/javascript/privateEndpointConnectionDeleteSample.js -[privateendpointconnectiongetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/javascript/privateEndpointConnectionGetSample.js -[privateendpointconnectionlistbybatchaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/javascript/privateEndpointConnectionListByBatchAccountSample.js -[privateendpointconnectionupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/javascript/privateEndpointConnectionUpdateSample.js -[privatelinkresourcegetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/javascript/privateLinkResourceGetSample.js -[privatelinkresourcelistbybatchaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/javascript/privateLinkResourceListByBatchAccountSample.js -[apiref]: https://learn.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/v10/javascript/applicationCreateSample.js b/sdk/batch/arm-batch/samples/v10/javascript/applicationCreateSample.js deleted file mode 100644 index d3a5264ee28f..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/applicationCreateSample.js +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { 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/2024-07-01/examples/ApplicationCreate.json - */ -async function applicationCreate() { - 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 = { - allowUpdates: false, - displayName: "myAppName", - }; - const options = { parameters }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.applicationOperations.create( - resourceGroupName, - accountName, - applicationName, - options, - ); - console.log(result); -} - -async function main() { - applicationCreate(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/javascript/applicationDeleteSample.js b/sdk/batch/arm-batch/samples/v10/javascript/applicationDeleteSample.js deleted file mode 100644 index 3b9ad6a39cfa..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/applicationDeleteSample.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -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/2024-07-01/examples/ApplicationDelete.json - */ -async function applicationDelete() { - 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(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.applicationOperations.delete( - resourceGroupName, - accountName, - applicationName, - ); - console.log(result); -} - -async function main() { - applicationDelete(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/javascript/applicationGetSample.js b/sdk/batch/arm-batch/samples/v10/javascript/applicationGetSample.js deleted file mode 100644 index bc1e926194a6..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/applicationGetSample.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -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/2024-07-01/examples/ApplicationGet.json - */ -async function applicationGet() { - 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(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.applicationOperations.get( - resourceGroupName, - accountName, - applicationName, - ); - console.log(result); -} - -async function main() { - applicationGet(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/javascript/applicationListSample.js b/sdk/batch/arm-batch/samples/v10/javascript/applicationListSample.js deleted file mode 100644 index 950026080843..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/applicationListSample.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { 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/2024-07-01/examples/ApplicationList.json - */ -async function applicationList() { - 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); - const resArray = new Array(); - for await (let item of client.applicationOperations.list(resourceGroupName, accountName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - applicationList(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/javascript/applicationPackageActivateSample.js b/sdk/batch/arm-batch/samples/v10/javascript/applicationPackageActivateSample.js deleted file mode 100644 index 63dfcb800fba..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/applicationPackageActivateSample.js +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { 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/2024-07-01/examples/ApplicationPackageActivate.json - */ -async function applicationPackageActivate() { - 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"; - const parameters = { format: "zip" }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.applicationPackageOperations.activate( - resourceGroupName, - accountName, - applicationName, - versionName, - parameters, - ); - console.log(result); -} - -async function main() { - applicationPackageActivate(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/javascript/applicationPackageCreateSample.js b/sdk/batch/arm-batch/samples/v10/javascript/applicationPackageCreateSample.js deleted file mode 100644 index 6c2ae6ed5464..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/applicationPackageCreateSample.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { 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/2024-07-01/examples/ApplicationPackageCreate.json - */ -async function applicationPackageCreate() { - 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"; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.applicationPackageOperations.create( - resourceGroupName, - accountName, - applicationName, - versionName, - ); - console.log(result); -} - -async function main() { - applicationPackageCreate(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/javascript/applicationPackageDeleteSample.js b/sdk/batch/arm-batch/samples/v10/javascript/applicationPackageDeleteSample.js deleted file mode 100644 index 624f3585da53..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/applicationPackageDeleteSample.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { 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/2024-07-01/examples/ApplicationPackageDelete.json - */ -async function applicationPackageDelete() { - 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"; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.applicationPackageOperations.delete( - resourceGroupName, - accountName, - applicationName, - versionName, - ); - console.log(result); -} - -async function main() { - applicationPackageDelete(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/javascript/applicationPackageGetSample.js b/sdk/batch/arm-batch/samples/v10/javascript/applicationPackageGetSample.js deleted file mode 100644 index 686e241a867b..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/applicationPackageGetSample.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { 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/2024-07-01/examples/ApplicationPackageGet.json - */ -async function applicationPackageGet() { - 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"; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.applicationPackageOperations.get( - resourceGroupName, - accountName, - applicationName, - versionName, - ); - console.log(result); -} - -async function main() { - applicationPackageGet(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/javascript/applicationPackageListSample.js b/sdk/batch/arm-batch/samples/v10/javascript/applicationPackageListSample.js deleted file mode 100644 index 0e2857c23bd7..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/applicationPackageListSample.js +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -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/2024-07-01/examples/ApplicationPackageList.json - */ -async function applicationPackageList() { - 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(); - const client = new BatchManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.applicationPackageOperations.list( - resourceGroupName, - accountName, - applicationName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - applicationPackageList(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/javascript/applicationUpdateSample.js b/sdk/batch/arm-batch/samples/v10/javascript/applicationUpdateSample.js deleted file mode 100644 index 9696bc4c8a08..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/applicationUpdateSample.js +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { 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/2024-07-01/examples/ApplicationUpdate.json - */ -async function applicationUpdate() { - 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 = { - allowUpdates: true, - defaultVersion: "2", - displayName: "myAppName", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.applicationOperations.update( - resourceGroupName, - accountName, - applicationName, - parameters, - ); - console.log(result); -} - -async function main() { - applicationUpdate(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/javascript/batchAccountCreateSample.js b/sdk/batch/arm-batch/samples/v10/javascript/batchAccountCreateSample.js deleted file mode 100644 index 07af35db2886..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/batchAccountCreateSample.js +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { 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/2024-07-01/examples/BatchAccountCreate_BYOS.json - */ -async function batchAccountCreateByos() { - const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; - const accountName = "sampleacct"; - const parameters = { - autoStorage: { - storageAccountId: - "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage", - }, - keyVaultReference: { - id: "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.KeyVault/vaults/sample", - url: "http://sample.vault.azure.net/", - }, - location: "japaneast", - poolAllocationMode: "UserSubscription", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.batchAccountOperations.beginCreateAndWait( - resourceGroupName, - accountName, - parameters, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/BatchAccountCreate_Default.json - */ -async function batchAccountCreateDefault() { - const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; - const accountName = "sampleacct"; - const parameters = { - autoStorage: { - storageAccountId: - "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage", - }, - location: "japaneast", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.batchAccountOperations.beginCreateAndWait( - resourceGroupName, - accountName, - parameters, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/BatchAccountCreate_SystemAssignedIdentity.json - */ -async function batchAccountCreateSystemAssignedIdentity() { - const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; - const accountName = "sampleacct"; - const parameters = { - autoStorage: { - storageAccountId: - "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage", - }, - identity: { type: "SystemAssigned" }, - location: "japaneast", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.batchAccountOperations.beginCreateAndWait( - resourceGroupName, - accountName, - parameters, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/BatchAccountCreate_UserAssignedIdentity.json - */ -async function batchAccountCreateUserAssignedIdentity() { - const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; - const accountName = "sampleacct"; - const parameters = { - autoStorage: { - storageAccountId: - "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage", - }, - identity: { - type: "UserAssigned", - userAssignedIdentities: { - "/subscriptions/subid/resourceGroups/defaultAzurebatchJapaneast/providers/MicrosoftManagedIdentity/userAssignedIdentities/id1": - {}, - }, - }, - location: "japaneast", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.batchAccountOperations.beginCreateAndWait( - resourceGroupName, - accountName, - parameters, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/PrivateBatchAccountCreate.json - */ -async function privateBatchAccountCreate() { - const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; - const accountName = "sampleacct"; - const parameters = { - autoStorage: { - storageAccountId: - "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage", - }, - keyVaultReference: { - id: "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.KeyVault/vaults/sample", - url: "http://sample.vault.azure.net/", - }, - location: "japaneast", - publicNetworkAccess: "Disabled", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.batchAccountOperations.beginCreateAndWait( - resourceGroupName, - accountName, - parameters, - ); - console.log(result); -} - -async function main() { - batchAccountCreateByos(); - batchAccountCreateDefault(); - batchAccountCreateSystemAssignedIdentity(); - batchAccountCreateUserAssignedIdentity(); - privateBatchAccountCreate(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/javascript/batchAccountDeleteSample.js b/sdk/batch/arm-batch/samples/v10/javascript/batchAccountDeleteSample.js deleted file mode 100644 index e090321bd26b..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/batchAccountDeleteSample.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { 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/2024-07-01/examples/BatchAccountDelete.json - */ -async function batchAccountDelete() { - 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); - const result = await client.batchAccountOperations.beginDeleteAndWait( - resourceGroupName, - accountName, - ); - console.log(result); -} - -async function main() { - batchAccountDelete(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/javascript/batchAccountGetDetectorSample.js b/sdk/batch/arm-batch/samples/v10/javascript/batchAccountGetDetectorSample.js deleted file mode 100644 index ffcf18e950ef..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/batchAccountGetDetectorSample.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -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/2024-07-01/examples/DetectorGet.json - */ -async function getDetector() { - 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(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.batchAccountOperations.getDetector( - resourceGroupName, - accountName, - detectorId, - ); - console.log(result); -} - -async function main() { - getDetector(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/javascript/batchAccountGetKeysSample.js b/sdk/batch/arm-batch/samples/v10/javascript/batchAccountGetKeysSample.js deleted file mode 100644 index fab99f8c91b5..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/batchAccountGetKeysSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { 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/2024-07-01/examples/BatchAccountGetKeys.json - */ -async function batchAccountGetKeys() { - 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); - const result = await client.batchAccountOperations.getKeys(resourceGroupName, accountName); - console.log(result); -} - -async function main() { - batchAccountGetKeys(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/javascript/batchAccountGetSample.js b/sdk/batch/arm-batch/samples/v10/javascript/batchAccountGetSample.js deleted file mode 100644 index 19ce0fd2dfde..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/batchAccountGetSample.js +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { 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/2024-07-01/examples/BatchAccountGet.json - */ -async function batchAccountGet() { - 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); - const result = await client.batchAccountOperations.get(resourceGroupName, accountName); - console.log(result); -} - -/** - * 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/2024-07-01/examples/PrivateBatchAccountGet.json - */ -async function privateBatchAccountGet() { - 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); - const result = await client.batchAccountOperations.get(resourceGroupName, accountName); - console.log(result); -} - -async function main() { - batchAccountGet(); - privateBatchAccountGet(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/javascript/batchAccountListByResourceGroupSample.js b/sdk/batch/arm-batch/samples/v10/javascript/batchAccountListByResourceGroupSample.js deleted file mode 100644 index 4cb7803ed7f6..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/batchAccountListByResourceGroupSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { 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/2024-07-01/examples/BatchAccountListByResourceGroup.json - */ -async function batchAccountListByResourceGroup() { - 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(); - for await (let item of client.batchAccountOperations.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - batchAccountListByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/javascript/batchAccountListDetectorsSample.js b/sdk/batch/arm-batch/samples/v10/javascript/batchAccountListDetectorsSample.js deleted file mode 100644 index d8071a420d45..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/batchAccountListDetectorsSample.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { 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/2024-07-01/examples/DetectorList.json - */ -async function listDetectors() { - 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); - const resArray = new Array(); - for await (let item of client.batchAccountOperations.listDetectors( - resourceGroupName, - accountName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listDetectors(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/javascript/batchAccountListOutboundNetworkDependenciesEndpointsSample.js b/sdk/batch/arm-batch/samples/v10/javascript/batchAccountListOutboundNetworkDependenciesEndpointsSample.js deleted file mode 100644 index 53d347f209ec..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/batchAccountListOutboundNetworkDependenciesEndpointsSample.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { 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/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/2024-07-01/examples/BatchAccountListOutboundNetworkDependenciesEndpoints.json - */ -async function listOutboundNetworkDependencies() { - 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); - const resArray = new Array(); - for await (let item of client.batchAccountOperations.listOutboundNetworkDependenciesEndpoints( - resourceGroupName, - accountName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listOutboundNetworkDependencies(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/javascript/batchAccountListSample.js b/sdk/batch/arm-batch/samples/v10/javascript/batchAccountListSample.js deleted file mode 100644 index 1e837257ad5a..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/batchAccountListSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { 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/2024-07-01/examples/BatchAccountList.json - */ -async function batchAccountList() { - const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.batchAccountOperations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - batchAccountList(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/javascript/batchAccountRegenerateKeySample.js b/sdk/batch/arm-batch/samples/v10/javascript/batchAccountRegenerateKeySample.js deleted file mode 100644 index 4de80d303752..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/batchAccountRegenerateKeySample.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { 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/2024-07-01/examples/BatchAccountRegenerateKey.json - */ -async function batchAccountRegenerateKey() { - 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", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.batchAccountOperations.regenerateKey( - resourceGroupName, - accountName, - parameters, - ); - console.log(result); -} - -async function main() { - batchAccountRegenerateKey(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/javascript/batchAccountSynchronizeAutoStorageKeysSample.js b/sdk/batch/arm-batch/samples/v10/javascript/batchAccountSynchronizeAutoStorageKeysSample.js deleted file mode 100644 index 7834e4e35f3e..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/batchAccountSynchronizeAutoStorageKeysSample.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { 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/2024-07-01/examples/BatchAccountSynchronizeAutoStorageKeys.json - */ -async function batchAccountSynchronizeAutoStorageKeys() { - 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); - const result = await client.batchAccountOperations.synchronizeAutoStorageKeys( - resourceGroupName, - accountName, - ); - console.log(result); -} - -async function main() { - batchAccountSynchronizeAutoStorageKeys(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/javascript/batchAccountUpdateSample.js b/sdk/batch/arm-batch/samples/v10/javascript/batchAccountUpdateSample.js deleted file mode 100644 index 2a1cbd1f69d6..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/batchAccountUpdateSample.js +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { 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/2024-07-01/examples/BatchAccountUpdate.json - */ -async function batchAccountUpdate() { - const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; - const accountName = "sampleacct"; - const parameters = { - autoStorage: { - storageAccountId: - "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.batchAccountOperations.update( - resourceGroupName, - accountName, - parameters, - ); - console.log(result); -} - -async function main() { - batchAccountUpdate(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/javascript/certificateCancelDeletionSample.js b/sdk/batch/arm-batch/samples/v10/javascript/certificateCancelDeletionSample.js deleted file mode 100644 index 0dba17edab52..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/certificateCancelDeletionSample.js +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { 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. - -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 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/2024-07-01/examples/CertificateCancelDeletion.json - */ -async function certificateCancelDeletion() { - 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(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.certificateOperations.cancelDeletion( - resourceGroupName, - accountName, - certificateName, - ); - console.log(result); -} - -async function main() { - certificateCancelDeletion(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/javascript/certificateCreateSample.js b/sdk/batch/arm-batch/samples/v10/javascript/certificateCreateSample.js deleted file mode 100644 index a806965b13a0..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/certificateCreateSample.js +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { 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/2024-07-01/examples/CertificateCreate_Full.json - */ -async function createCertificateFull() { - 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 = { - format: "Pfx", - data: "MIIJsgIBAzCCCW4GCSqGSIb3DQE...", - password: "", - thumbprint: "0a0e4f50d51beadeac1d35afc5116098e7902e6e", - thumbprintAlgorithm: "sha1", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.certificateOperations.create( - resourceGroupName, - accountName, - certificateName, - parameters, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/CertificateCreate_MinimalCer.json - */ -async function createCertificateMinimalCer() { - 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 = { - format: "Cer", - data: "MIICrjCCAZagAwI...", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.certificateOperations.create( - resourceGroupName, - accountName, - certificateName, - parameters, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/CertificateCreate_Minimal.json - */ -async function createCertificateMinimalPfx() { - 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 = { - data: "MIIJsgIBAzCCCW4GCSqGSIb3DQE...", - password: "", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.certificateOperations.create( - resourceGroupName, - accountName, - certificateName, - parameters, - ); - console.log(result); -} - -async function main() { - createCertificateFull(); - createCertificateMinimalCer(); - createCertificateMinimalPfx(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/javascript/certificateDeleteSample.js b/sdk/batch/arm-batch/samples/v10/javascript/certificateDeleteSample.js deleted file mode 100644 index fafdad101c86..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/certificateDeleteSample.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -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/2024-07-01/examples/CertificateDelete.json - */ -async function certificateDelete() { - 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(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.certificateOperations.beginDeleteAndWait( - resourceGroupName, - accountName, - certificateName, - ); - console.log(result); -} - -async function main() { - certificateDelete(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/javascript/certificateGetSample.js b/sdk/batch/arm-batch/samples/v10/javascript/certificateGetSample.js deleted file mode 100644 index 0f65a507fb6a..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/certificateGetSample.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { 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/2024-07-01/examples/CertificateGet.json - */ -async function getCertificate() { - 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(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.certificateOperations.get( - resourceGroupName, - accountName, - certificateName, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/CertificateGetWithDeletionError.json - */ -async function getCertificateWithDeletionError() { - 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(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.certificateOperations.get( - resourceGroupName, - accountName, - certificateName, - ); - console.log(result); -} - -async function main() { - getCertificate(); - getCertificateWithDeletionError(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/javascript/certificateListByBatchAccountSample.js b/sdk/batch/arm-batch/samples/v10/javascript/certificateListByBatchAccountSample.js deleted file mode 100644 index 3ad545bbf6c9..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/certificateListByBatchAccountSample.js +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { 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/2024-07-01/examples/CertificateList.json - */ -async function listCertificates() { - 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); - const resArray = new Array(); - for await (let item of client.certificateOperations.listByBatchAccount( - resourceGroupName, - accountName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * 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/2024-07-01/examples/CertificateListWithFilter.json - */ -async function listCertificatesFilterAndSelect() { - 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 = - "properties/provisioningStateTransitionTime gt '2017-05-01' or properties/provisioningState eq 'Failed'"; - const options = { - select, - filter, - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.certificateOperations.listByBatchAccount( - resourceGroupName, - accountName, - options, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listCertificates(); - listCertificatesFilterAndSelect(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/javascript/certificateUpdateSample.js b/sdk/batch/arm-batch/samples/v10/javascript/certificateUpdateSample.js deleted file mode 100644 index cd766499210a..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/certificateUpdateSample.js +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { 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/2024-07-01/examples/CertificateUpdate.json - */ -async function updateCertificate() { - 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 = { - data: "MIIJsgIBAzCCCW4GCSqGSIb3DQE...", - password: "", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.certificateOperations.update( - resourceGroupName, - accountName, - certificateName, - parameters, - ); - console.log(result); -} - -async function main() { - updateCertificate(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/javascript/locationCheckNameAvailabilitySample.js b/sdk/batch/arm-batch/samples/v10/javascript/locationCheckNameAvailabilitySample.js deleted file mode 100644 index 04cc92faf086..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/locationCheckNameAvailabilitySample.js +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { 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/2024-07-01/examples/LocationCheckNameAvailability_AlreadyExists.json - */ -async function locationCheckNameAvailabilityAlreadyExists() { - const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; - const locationName = "japaneast"; - const parameters = { - name: "existingaccountname", - type: "Microsoft.Batch/batchAccounts", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.location.checkNameAvailability(locationName, parameters); - console.log(result); -} - -/** - * 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/2024-07-01/examples/LocationCheckNameAvailability_Available.json - */ -async function locationCheckNameAvailabilityAvailable() { - const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; - const locationName = "japaneast"; - const parameters = { - name: "newaccountname", - type: "Microsoft.Batch/batchAccounts", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.location.checkNameAvailability(locationName, parameters); - console.log(result); -} - -async function main() { - locationCheckNameAvailabilityAlreadyExists(); - locationCheckNameAvailabilityAvailable(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/javascript/locationGetQuotasSample.js b/sdk/batch/arm-batch/samples/v10/javascript/locationGetQuotasSample.js deleted file mode 100644 index 0c6f94937a9f..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/locationGetQuotasSample.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { 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/2024-07-01/examples/LocationGetQuotas.json - */ -async function locationGetQuotas() { - const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; - const locationName = "japaneast"; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.location.getQuotas(locationName); - console.log(result); -} - -async function main() { - locationGetQuotas(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/javascript/locationListSupportedVirtualMachineSkusSample.js b/sdk/batch/arm-batch/samples/v10/javascript/locationListSupportedVirtualMachineSkusSample.js deleted file mode 100644 index 5d43517277b8..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/locationListSupportedVirtualMachineSkusSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { 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/2024-07-01/examples/LocationListVirtualMachineSkus.json - */ -async function locationListVirtualMachineSkus() { - const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; - const locationName = "japaneast"; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.location.listSupportedVirtualMachineSkus(locationName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - locationListVirtualMachineSkus(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/javascript/networkSecurityPerimeterGetConfigurationSample.js b/sdk/batch/arm-batch/samples/v10/javascript/networkSecurityPerimeterGetConfigurationSample.js deleted file mode 100644 index 03992ddf206f..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/networkSecurityPerimeterGetConfigurationSample.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { BatchManagementClient } = require("@azure/arm-batch"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets information about the specified NSP configuration. - * - * @summary Gets information about the specified NSP configuration. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-01/examples/NspConfigurationGet.json - */ -async function getNspConfiguration() { - const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; - const accountName = "sampleacct"; - const networkSecurityPerimeterConfigurationName = - "00000000-0000-0000-0000-000000000000.sampleassociation"; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.networkSecurityPerimeterOperations.getConfiguration( - resourceGroupName, - accountName, - networkSecurityPerimeterConfigurationName, - ); - console.log(result); -} - -async function main() { - getNspConfiguration(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/javascript/networkSecurityPerimeterListConfigurationsSample.js b/sdk/batch/arm-batch/samples/v10/javascript/networkSecurityPerimeterListConfigurationsSample.js deleted file mode 100644 index c9f44e6717c3..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/networkSecurityPerimeterListConfigurationsSample.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { BatchManagementClient } = require("@azure/arm-batch"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists all of the NSP configurations in the specified account. - * - * @summary Lists all of the NSP configurations in the specified account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-01/examples/NspConfigurationsList.json - */ -async function listNspConfigurations() { - 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); - const resArray = new Array(); - for await (let item of client.networkSecurityPerimeterOperations.listConfigurations( - resourceGroupName, - accountName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listNspConfigurations(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/javascript/networkSecurityPerimeterReconcileConfigurationSample.js b/sdk/batch/arm-batch/samples/v10/javascript/networkSecurityPerimeterReconcileConfigurationSample.js deleted file mode 100644 index e67575b2561c..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/networkSecurityPerimeterReconcileConfigurationSample.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { BatchManagementClient } = require("@azure/arm-batch"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Reconciles the specified NSP configuration. - * - * @summary Reconciles the specified NSP configuration. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-01/examples/NspConfigurationReconcile.json - */ -async function reconcileNspConfiguration() { - const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; - const accountName = "sampleacct"; - const networkSecurityPerimeterConfigurationName = - "00000000-0000-0000-0000-000000000000.sampleassociation"; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.networkSecurityPerimeterOperations.beginReconcileConfigurationAndWait( - resourceGroupName, - accountName, - networkSecurityPerimeterConfigurationName, - ); - console.log(result); -} - -async function main() { - reconcileNspConfiguration(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/javascript/operationsListSample.js b/sdk/batch/arm-batch/samples/v10/javascript/operationsListSample.js deleted file mode 100644 index 211902d2cac1..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/operationsListSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { 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/2024-07-01/examples/OperationsList.json - */ -async function operationsList() { - 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(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - operationsList(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/javascript/package.json b/sdk/batch/arm-batch/samples/v10/javascript/package.json deleted file mode 100644 index 0f6b3f1c33ff..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "@azure-samples/arm-batch-js", - "private": true, - "version": "1.0.0", - "description": " client library samples for JavaScript", - "engines": { - "node": ">=20.0.0" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/batch/arm-batch" - }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], - "author": "Microsoft Corporation", - "license": "MIT", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/batch/arm-batch", - "dependencies": { - "@azure/arm-batch": "latest", - "dotenv": "latest", - "@azure/identity": "^4.2.1" - } -} diff --git a/sdk/batch/arm-batch/samples/v10/javascript/poolCreateSample.js b/sdk/batch/arm-batch/samples/v10/javascript/poolCreateSample.js deleted file mode 100644 index a3d56d2fcc41..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/poolCreateSample.js +++ /dev/null @@ -1,701 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { 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/2024-07-01/examples/PoolCreate_SharedImageGallery.json - */ -async function createPoolCustomImage() { - 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: { - id: "/subscriptions/subid/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1", - }, - nodeAgentSkuId: "batch.node.ubuntu 18.04", - }, - }, - vmSize: "STANDARD_D4", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.create( - resourceGroupName, - accountName, - poolName, - parameters, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/PoolCreate_VirtualMachineConfiguration.json - */ -async function createPoolFullVirtualMachineConfiguration() { - 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: { - dataDisks: [ - { - caching: "ReadWrite", - diskSizeGB: 30, - lun: 0, - storageAccountType: "Premium_LRS", - }, - { - caching: "None", - diskSizeGB: 200, - lun: 1, - storageAccountType: "Standard_LRS", - }, - ], - diskEncryptionConfiguration: { targets: ["OsDisk", "TemporaryDisk"] }, - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter-SmallDisk", - version: "latest", - }, - licenseType: "Windows_Server", - nodeAgentSkuId: "batch.node.windows amd64", - nodePlacementConfiguration: { policy: "Zonal" }, - osDisk: { ephemeralOSDiskSettings: { placement: "CacheDisk" } }, - windowsConfiguration: { enableAutomaticUpdates: false }, - }, - }, - networkConfiguration: { - endpointConfiguration: { - inboundNatPools: [ - { - name: "testnat", - backendPort: 12001, - frontendPortRangeEnd: 15100, - frontendPortRangeStart: 15000, - networkSecurityGroupRules: [ - { - access: "Allow", - priority: 150, - sourceAddressPrefix: "192.100.12.45", - sourcePortRanges: ["1", "2"], - }, - { - access: "Deny", - priority: 3500, - sourceAddressPrefix: "*", - sourcePortRanges: ["*"], - }, - ], - protocol: "TCP", - }, - ], - }, - }, - scaleSettings: { - autoScale: { - evaluationInterval: "PT5M", - formula: "$TargetDedicatedNodes=1", - }, - }, - vmSize: "STANDARD_D4", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.create( - resourceGroupName, - accountName, - poolName, - parameters, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/PoolCreate_MinimalVirtualMachineConfiguration.json - */ -async function createPoolMinimalVirtualMachineConfiguration() { - 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: "UbuntuServer", - publisher: "Canonical", - sku: "18.04-LTS", - version: "latest", - }, - nodeAgentSkuId: "batch.node.ubuntu 18.04", - }, - }, - scaleSettings: { - autoScale: { - evaluationInterval: "PT5M", - formula: "$TargetDedicatedNodes=1", - }, - }, - vmSize: "STANDARD_D4", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.create( - resourceGroupName, - accountName, - poolName, - parameters, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/PoolCreate_NoPublicIPAddresses.json - */ -async function createPoolNoPublicIP() { - 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: { - id: "/subscriptions/subid/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1", - }, - nodeAgentSkuId: "batch.node.ubuntu 18.04", - }, - }, - networkConfiguration: { - publicIPAddressConfiguration: { provision: "NoPublicIPAddresses" }, - subnetId: - "/subscriptions/subid/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123", - }, - vmSize: "STANDARD_D4", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.create( - resourceGroupName, - accountName, - poolName, - parameters, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/PoolCreate_PublicIPs.json - */ -async function createPoolPublicIPs() { - 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: { - id: "/subscriptions/subid/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1", - }, - nodeAgentSkuId: "batch.node.ubuntu 18.04", - }, - }, - networkConfiguration: { - publicIPAddressConfiguration: { - ipAddressIds: [ - "/subscriptions/subid1/resourceGroups/rg13/providers/Microsoft.Network/publicIPAddresses/ip135", - ], - provision: "UserManaged", - }, - subnetId: - "/subscriptions/subid/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123", - }, - vmSize: "STANDARD_D4", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.create( - resourceGroupName, - accountName, - poolName, - parameters, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/PoolCreate_ResourceTags.json - */ -async function createPoolResourceTags() { - 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: "UbuntuServer", - publisher: "Canonical", - sku: "18_04-lts-gen2", - version: "latest", - }, - nodeAgentSkuId: "batch.node.ubuntu 18.04", - }, - }, - resourceTags: { tagName1: "TagValue1", tagName2: "TagValue2" }, - scaleSettings: { - fixedScale: { targetDedicatedNodes: 1, targetLowPriorityNodes: 0 }, - }, - vmSize: "Standard_d4s_v3", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.create( - resourceGroupName, - accountName, - poolName, - parameters, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/PoolCreate_SecurityProfile.json - */ -async function createPoolSecurityProfile() { - 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: "UbuntuServer", - publisher: "Canonical", - sku: "18_04-lts-gen2", - version: "latest", - }, - nodeAgentSkuId: "batch.node.ubuntu 18.04", - securityProfile: { - encryptionAtHost: true, - securityType: "trustedLaunch", - uefiSettings: { secureBootEnabled: undefined, vTpmEnabled: false }, - }, - }, - }, - scaleSettings: { - fixedScale: { targetDedicatedNodes: 1, targetLowPriorityNodes: 0 }, - }, - vmSize: "Standard_d4s_v3", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.create( - resourceGroupName, - accountName, - poolName, - parameters, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/PoolCreate_Tags.json - */ -async function createPoolTags() { - 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: "0001-com-ubuntu-server-jammy", - publisher: "Canonical", - sku: "22_04-lts", - version: "latest", - }, - nodeAgentSkuId: "batch.node.ubuntu 22.04", - }, - }, - scaleSettings: { - fixedScale: { targetDedicatedNodes: 1, targetLowPriorityNodes: 0 }, - }, - tags: { tagName1: "TagValue1", tagName2: "TagValue2" }, - vmSize: "Standard_d4s_v3", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.create( - resourceGroupName, - accountName, - poolName, - parameters, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/PoolCreate_UpgradePolicy.json - */ -async function createPoolUpgradePolicy() { - 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: "2019-datacenter-smalldisk", - version: "latest", - }, - nodeAgentSkuId: "batch.node.windows amd64", - nodePlacementConfiguration: { policy: "Zonal" }, - windowsConfiguration: { enableAutomaticUpdates: false }, - }, - }, - scaleSettings: { - fixedScale: { targetDedicatedNodes: 2, targetLowPriorityNodes: 0 }, - }, - upgradePolicy: { - automaticOSUpgradePolicy: { - disableAutomaticRollback: true, - enableAutomaticOSUpgrade: true, - osRollingUpgradeDeferral: true, - useRollingUpgradePolicy: true, - }, - mode: "automatic", - rollingUpgradePolicy: { - enableCrossZoneUpgrade: true, - maxBatchInstancePercent: 20, - maxUnhealthyInstancePercent: 20, - maxUnhealthyUpgradedInstancePercent: 20, - pauseTimeBetweenBatches: "PT0S", - prioritizeUnhealthyInstances: false, - rollbackFailedInstancesOnPolicyBreach: false, - }, - }, - vmSize: "Standard_d4s_v3", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.create( - resourceGroupName, - accountName, - poolName, - parameters, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/PoolCreate_UserAssignedIdentities.json - */ -async function createPoolUserAssignedIdentities() { - 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: "UbuntuServer", - publisher: "Canonical", - sku: "18.04-LTS", - version: "latest", - }, - nodeAgentSkuId: "batch.node.ubuntu 18.04", - }, - }, - identity: { - type: "UserAssigned", - userAssignedIdentities: { - "/subscriptions/subid/resourceGroups/defaultAzurebatchJapaneast/providers/MicrosoftManagedIdentity/userAssignedIdentities/id1": - {}, - "/subscriptions/subid/resourceGroups/defaultAzurebatchJapaneast/providers/MicrosoftManagedIdentity/userAssignedIdentities/id2": - {}, - }, - }, - scaleSettings: { - autoScale: { - evaluationInterval: "PT5M", - formula: "$TargetDedicatedNodes=1", - }, - }, - vmSize: "STANDARD_D4", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.create( - resourceGroupName, - accountName, - poolName, - parameters, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/PoolCreate_VirtualMachineConfiguration_Extensions.json - */ -async function createPoolVirtualMachineConfigurationExtensions() { - 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: "0001-com-ubuntu-server-focal", - publisher: "Canonical", - sku: "20_04-lts", - }, - nodeAgentSkuId: "batch.node.ubuntu 20.04", - extensions: [ - { - name: "batchextension1", - type: "KeyVaultForLinux", - autoUpgradeMinorVersion: true, - enableAutomaticUpgrade: true, - publisher: "Microsoft.Azure.KeyVault", - settings: { - authenticationSettingsKey: "authenticationSettingsValue", - secretsManagementSettingsKey: "secretsManagementSettingsValue", - }, - typeHandlerVersion: "2.0", - }, - ], - }, - }, - scaleSettings: { - autoScale: { - evaluationInterval: "PT5M", - formula: "$TargetDedicatedNodes=1", - }, - }, - targetNodeCommunicationMode: "Default", - vmSize: "STANDARD_D4", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.create( - resourceGroupName, - accountName, - poolName, - parameters, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/PoolCreate_VirtualMachineConfiguration_ManagedOSDisk.json - */ -async function createPoolVirtualMachineConfigurationOSDisk() { - 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: "2022-datacenter-smalldisk", - }, - nodeAgentSkuId: "batch.node.windows amd64", - osDisk: { - caching: "ReadWrite", - diskSizeGB: 100, - managedDisk: { storageAccountType: "StandardSSD_LRS" }, - writeAcceleratorEnabled: false, - }, - }, - }, - scaleSettings: { - fixedScale: { targetDedicatedNodes: 1, targetLowPriorityNodes: 0 }, - }, - vmSize: "Standard_d2s_v3", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.create( - resourceGroupName, - accountName, - poolName, - parameters, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/PoolCreate_VirtualMachineConfiguration_ServiceArtifactReference.json - */ -async function createPoolVirtualMachineConfigurationServiceArtifactReference() { - 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: "2019-datacenter-smalldisk", - version: "latest", - }, - nodeAgentSkuId: "batch.node.windows amd64", - serviceArtifactReference: { - id: "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/galleries/myGallery/serviceArtifacts/myServiceArtifact/vmArtifactsProfiles/vmArtifactsProfile", - }, - windowsConfiguration: { enableAutomaticUpdates: false }, - }, - }, - scaleSettings: { - fixedScale: { targetDedicatedNodes: 2, targetLowPriorityNodes: 0 }, - }, - upgradePolicy: { - automaticOSUpgradePolicy: { enableAutomaticOSUpgrade: true }, - mode: "automatic", - }, - vmSize: "Standard_d4s_v3", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.create( - resourceGroupName, - accountName, - poolName, - parameters, - ); - console.log(result); -} - -/** - * 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/2024-07-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(); - createPoolFullVirtualMachineConfiguration(); - createPoolMinimalVirtualMachineConfiguration(); - createPoolNoPublicIP(); - createPoolPublicIPs(); - createPoolResourceTags(); - createPoolSecurityProfile(); - createPoolTags(); - createPoolUpgradePolicy(); - createPoolUserAssignedIdentities(); - createPoolVirtualMachineConfigurationExtensions(); - createPoolVirtualMachineConfigurationOSDisk(); - createPoolVirtualMachineConfigurationServiceArtifactReference(); - createPoolAcceleratedNetworking(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/javascript/poolDeleteSample.js b/sdk/batch/arm-batch/samples/v10/javascript/poolDeleteSample.js deleted file mode 100644 index 07814d0ade8f..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/poolDeleteSample.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -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/2024-07-01/examples/PoolDelete.json - */ -async function deletePool() { - 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.beginDeleteAndWait( - resourceGroupName, - accountName, - poolName, - ); - console.log(result); -} - -async function main() { - deletePool(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/javascript/poolDisableAutoScaleSample.js b/sdk/batch/arm-batch/samples/v10/javascript/poolDisableAutoScaleSample.js deleted file mode 100644 index 68ec1793ec3b..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/poolDisableAutoScaleSample.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -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/2024-07-01/examples/PoolDisableAutoScale.json - */ -async function disableAutoScale() { - 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.disableAutoScale( - resourceGroupName, - accountName, - poolName, - ); - console.log(result); -} - -async function main() { - disableAutoScale(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/javascript/poolGetSample.js b/sdk/batch/arm-batch/samples/v10/javascript/poolGetSample.js deleted file mode 100644 index 0f31b2a2b0a5..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/poolGetSample.js +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { 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/2024-07-01/examples/PoolGet.json - */ -async function getPool() { - 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/2024-07-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/2024-07-01/examples/PoolGet_SecurityProfile.json - */ -async function getPoolSecurityProfile() { - 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/2024-07-01/examples/PoolGet_UpgradePolicy.json - */ -async function getPoolUpgradePolicy() { - 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/2024-07-01/examples/PoolGet_VirtualMachineConfiguration_Extensions.json - */ -async function getPoolVirtualMachineConfigurationExtensions() { - 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/2024-07-01/examples/PoolGet_VirtualMachineConfiguration_MangedOSDisk.json - */ -async function getPoolVirtualMachineConfigurationOSDisk() { - 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/2024-07-01/examples/PoolGet_VirtualMachineConfiguration_ServiceArtifactReference.json - */ -async function getPoolVirtualMachineConfigurationServiceArtifactReference() { - 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); -} - -async function main() { - getPool(); - getPoolAcceleratedNetworking(); - getPoolSecurityProfile(); - getPoolUpgradePolicy(); - getPoolVirtualMachineConfigurationExtensions(); - getPoolVirtualMachineConfigurationOSDisk(); - getPoolVirtualMachineConfigurationServiceArtifactReference(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/javascript/poolListByBatchAccountSample.js b/sdk/batch/arm-batch/samples/v10/javascript/poolListByBatchAccountSample.js deleted file mode 100644 index 136766d080e2..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/poolListByBatchAccountSample.js +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { 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/2024-07-01/examples/PoolList.json - */ -async function listPool() { - 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); - const resArray = new Array(); - for await (let item of client.poolOperations.listByBatchAccount(resourceGroupName, accountName)) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * 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/2024-07-01/examples/PoolListWithFilter.json - */ -async function listPoolWithFilter() { - 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"; - const filter = - "startswith(name, 'po') or (properties/allocationState eq 'Steady' and properties/provisioningStateTransitionTime lt datetime'2017-02-02')"; - const options = { select, filter }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.poolOperations.listByBatchAccount( - resourceGroupName, - accountName, - options, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listPool(); - listPoolWithFilter(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/javascript/poolStopResizeSample.js b/sdk/batch/arm-batch/samples/v10/javascript/poolStopResizeSample.js deleted file mode 100644 index abbb6ad21d28..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/poolStopResizeSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { 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/2024-07-01/examples/PoolStopResize.json - */ -async function stopPoolResize() { - 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.stopResize(resourceGroupName, accountName, poolName); - console.log(result); -} - -async function main() { - stopPoolResize(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/javascript/poolUpdateSample.js b/sdk/batch/arm-batch/samples/v10/javascript/poolUpdateSample.js deleted file mode 100644 index 1fcf5e8e0466..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/poolUpdateSample.js +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { 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/2024-07-01/examples/PoolUpdate_EnableAutoScale.json - */ -async function updatePoolEnableAutoscale() { - 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 = { - scaleSettings: { autoScale: { formula: "$TargetDedicatedNodes=34" } }, - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.update( - resourceGroupName, - accountName, - poolName, - parameters, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/PoolUpdate_OtherProperties.json - */ -async function updatePoolOtherProperties() { - 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 = { - applicationPackages: [ - { - id: "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool/applications/app_1234", - }, - { - id: "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool/applications/app_5678", - version: "1.0", - }, - ], - certificates: [ - { - id: "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool/certificates/sha1-1234567", - storeLocation: "LocalMachine", - storeName: "MY", - }, - ], - metadata: [{ name: "key1", value: "value1" }], - targetNodeCommunicationMode: "Simplified", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.update( - resourceGroupName, - accountName, - poolName, - parameters, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/PoolUpdate_RemoveStartTask.json - */ -async function updatePoolRemoveStartTask() { - 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: {} }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.update( - resourceGroupName, - accountName, - poolName, - parameters, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/PoolUpdate_ResizePool.json - */ -async function updatePoolResizePool() { - 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 = { - scaleSettings: { - fixedScale: { - nodeDeallocationOption: "TaskCompletion", - resizeTimeout: "PT8M", - targetDedicatedNodes: 5, - targetLowPriorityNodes: 0, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.update( - resourceGroupName, - accountName, - poolName, - parameters, - ); - console.log(result); -} - -async function main() { - updatePoolEnableAutoscale(); - updatePoolOtherProperties(); - updatePoolRemoveStartTask(); - updatePoolResizePool(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/javascript/privateEndpointConnectionDeleteSample.js b/sdk/batch/arm-batch/samples/v10/javascript/privateEndpointConnectionDeleteSample.js deleted file mode 100644 index d1145da65c69..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/privateEndpointConnectionDeleteSample.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { 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/2024-07-01/examples/PrivateEndpointConnectionDelete.json - */ -async function privateEndpointConnectionDelete() { - 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"; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.privateEndpointConnectionOperations.beginDeleteAndWait( - resourceGroupName, - accountName, - privateEndpointConnectionName, - ); - console.log(result); -} - -async function main() { - privateEndpointConnectionDelete(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/javascript/privateEndpointConnectionGetSample.js b/sdk/batch/arm-batch/samples/v10/javascript/privateEndpointConnectionGetSample.js deleted file mode 100644 index 1e526e540bb1..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/privateEndpointConnectionGetSample.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { 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/2024-07-01/examples/PrivateEndpointConnectionGet.json - */ -async function getPrivateEndpointConnection() { - 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"; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.privateEndpointConnectionOperations.get( - resourceGroupName, - accountName, - privateEndpointConnectionName, - ); - console.log(result); -} - -async function main() { - getPrivateEndpointConnection(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/javascript/privateEndpointConnectionListByBatchAccountSample.js b/sdk/batch/arm-batch/samples/v10/javascript/privateEndpointConnectionListByBatchAccountSample.js deleted file mode 100644 index 407d002c6126..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/privateEndpointConnectionListByBatchAccountSample.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { 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/2024-07-01/examples/PrivateEndpointConnectionsList.json - */ -async function listPrivateEndpointConnections() { - 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); - const resArray = new Array(); - for await (let item of client.privateEndpointConnectionOperations.listByBatchAccount( - resourceGroupName, - accountName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listPrivateEndpointConnections(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/javascript/privateEndpointConnectionUpdateSample.js b/sdk/batch/arm-batch/samples/v10/javascript/privateEndpointConnectionUpdateSample.js deleted file mode 100644 index 2421baf40973..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/privateEndpointConnectionUpdateSample.js +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { 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/2024-07-01/examples/PrivateEndpointConnectionUpdate.json - */ -async function updatePrivateEndpointConnection() { - 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"; - const parameters = { - privateLinkServiceConnectionState: { - description: "Approved by xyz.abc@company.com", - status: "Approved", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.privateEndpointConnectionOperations.beginUpdateAndWait( - resourceGroupName, - accountName, - privateEndpointConnectionName, - parameters, - ); - console.log(result); -} - -async function main() { - updatePrivateEndpointConnection(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/javascript/privateLinkResourceGetSample.js b/sdk/batch/arm-batch/samples/v10/javascript/privateLinkResourceGetSample.js deleted file mode 100644 index 0f770389a842..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/privateLinkResourceGetSample.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -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/2024-07-01/examples/PrivateLinkResourceGet.json - */ -async function getPrivateLinkResource() { - 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(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.privateLinkResourceOperations.get( - resourceGroupName, - accountName, - privateLinkResourceName, - ); - console.log(result); -} - -async function main() { - getPrivateLinkResource(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/javascript/privateLinkResourceListByBatchAccountSample.js b/sdk/batch/arm-batch/samples/v10/javascript/privateLinkResourceListByBatchAccountSample.js deleted file mode 100644 index 3969257c1f2c..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/privateLinkResourceListByBatchAccountSample.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { 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/2024-07-01/examples/PrivateLinkResourcesList.json - */ -async function listPrivateLinkResource() { - 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); - const resArray = new Array(); - for await (let item of client.privateLinkResourceOperations.listByBatchAccount( - resourceGroupName, - accountName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listPrivateLinkResource(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/javascript/sample.env b/sdk/batch/arm-batch/samples/v10/javascript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/batch/arm-batch/samples/v10/javascript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/batch/arm-batch/samples/v10/typescript/README.md b/sdk/batch/arm-batch/samples/v10/typescript/README.md deleted file mode 100644 index 9bc16d7b2a46..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/README.md +++ /dev/null @@ -1,157 +0,0 @@ -# client library samples for TypeScript - -These sample programs show how to use the TypeScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| --------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [applicationCreateSample.ts][applicationcreatesample] | Adds an application to the specified Batch account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-01/examples/ApplicationCreate.json | -| [applicationDeleteSample.ts][applicationdeletesample] | Deletes an application. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-01/examples/ApplicationDelete.json | -| [applicationGetSample.ts][applicationgetsample] | Gets information about the specified application. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-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/2024-07-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/2024-07-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/2024-07-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/2024-07-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/2024-07-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/2024-07-01/examples/ApplicationPackageList.json | -| [applicationUpdateSample.ts][applicationupdatesample] | Updates settings for the specified application. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-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/2024-07-01/examples/BatchAccountCreate_BYOS.json | -| [batchAccountDeleteSample.ts][batchaccountdeletesample] | Deletes the specified Batch account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-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/2024-07-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/2024-07-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/2024-07-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/2024-07-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/2024-07-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://learn.microsoft.com/azure/batch/batch-virtual-network. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-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/2024-07-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/2024-07-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/2024-07-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/2024-07-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/2024-07-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/2024-07-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/2024-07-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/2024-07-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/2024-07-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/2024-07-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/2024-07-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/2024-07-01/examples/LocationGetQuotas.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/2024-07-01/examples/LocationListVirtualMachineSkus.json | -| [networkSecurityPerimeterGetConfigurationSample.ts][networksecurityperimetergetconfigurationsample] | Gets information about the specified NSP configuration. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-01/examples/NspConfigurationGet.json | -| [networkSecurityPerimeterListConfigurationsSample.ts][networksecurityperimeterlistconfigurationssample] | Lists all of the NSP configurations in the specified account. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-01/examples/NspConfigurationsList.json | -| [networkSecurityPerimeterReconcileConfigurationSample.ts][networksecurityperimeterreconcileconfigurationsample] | Reconciles the specified NSP configuration. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-01/examples/NspConfigurationReconcile.json | -| [operationsListSample.ts][operationslistsample] | Lists available operations for the Microsoft.Batch provider x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-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/2024-07-01/examples/PoolCreate_SharedImageGallery.json | -| [poolDeleteSample.ts][pooldeletesample] | Deletes the specified pool. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-01/examples/PoolDelete.json | -| [poolDisableAutoScaleSample.ts][pooldisableautoscalesample] | Disables automatic scaling for a pool. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-01/examples/PoolDisableAutoScale.json | -| [poolGetSample.ts][poolgetsample] | Gets information about the specified pool. x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-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/2024-07-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/2024-07-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/2024-07-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/2024-07-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/2024-07-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/2024-07-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/2024-07-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/2024-07-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/2024-07-01/examples/PrivateLinkResourcesList.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: - -```bash -npm install -g typescript -``` - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Compile the samples: - -```bash -npm run build -``` - -3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -4. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node dist/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 -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/v10/typescript/src/applicationCreateSample.ts -[applicationdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/typescript/src/applicationDeleteSample.ts -[applicationgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/typescript/src/applicationGetSample.ts -[applicationlistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/typescript/src/applicationListSample.ts -[applicationpackageactivatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/typescript/src/applicationPackageActivateSample.ts -[applicationpackagecreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/typescript/src/applicationPackageCreateSample.ts -[applicationpackagedeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/typescript/src/applicationPackageDeleteSample.ts -[applicationpackagegetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/typescript/src/applicationPackageGetSample.ts -[applicationpackagelistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/typescript/src/applicationPackageListSample.ts -[applicationupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/typescript/src/applicationUpdateSample.ts -[batchaccountcreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountCreateSample.ts -[batchaccountdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountDeleteSample.ts -[batchaccountgetdetectorsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountGetDetectorSample.ts -[batchaccountgetkeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountGetKeysSample.ts -[batchaccountgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountGetSample.ts -[batchaccountlistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountListByResourceGroupSample.ts -[batchaccountlistdetectorssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountListDetectorsSample.ts -[batchaccountlistoutboundnetworkdependenciesendpointssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountListOutboundNetworkDependenciesEndpointsSample.ts -[batchaccountlistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountListSample.ts -[batchaccountregeneratekeysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountRegenerateKeySample.ts -[batchaccountsynchronizeautostoragekeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountSynchronizeAutoStorageKeysSample.ts -[batchaccountupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountUpdateSample.ts -[certificatecanceldeletionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/typescript/src/certificateCancelDeletionSample.ts -[certificatecreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/typescript/src/certificateCreateSample.ts -[certificatedeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/typescript/src/certificateDeleteSample.ts -[certificategetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/typescript/src/certificateGetSample.ts -[certificatelistbybatchaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/typescript/src/certificateListByBatchAccountSample.ts -[certificateupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/typescript/src/certificateUpdateSample.ts -[locationchecknameavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/typescript/src/locationCheckNameAvailabilitySample.ts -[locationgetquotassample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/typescript/src/locationGetQuotasSample.ts -[locationlistsupportedvirtualmachineskussample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/typescript/src/locationListSupportedVirtualMachineSkusSample.ts -[networksecurityperimetergetconfigurationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/typescript/src/networkSecurityPerimeterGetConfigurationSample.ts -[networksecurityperimeterlistconfigurationssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/typescript/src/networkSecurityPerimeterListConfigurationsSample.ts -[networksecurityperimeterreconcileconfigurationsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/typescript/src/networkSecurityPerimeterReconcileConfigurationSample.ts -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/typescript/src/operationsListSample.ts -[poolcreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/typescript/src/poolCreateSample.ts -[pooldeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/typescript/src/poolDeleteSample.ts -[pooldisableautoscalesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/typescript/src/poolDisableAutoScaleSample.ts -[poolgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/typescript/src/poolGetSample.ts -[poollistbybatchaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/typescript/src/poolListByBatchAccountSample.ts -[poolstopresizesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/typescript/src/poolStopResizeSample.ts -[poolupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/typescript/src/poolUpdateSample.ts -[privateendpointconnectiondeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/typescript/src/privateEndpointConnectionDeleteSample.ts -[privateendpointconnectiongetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/typescript/src/privateEndpointConnectionGetSample.ts -[privateendpointconnectionlistbybatchaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/typescript/src/privateEndpointConnectionListByBatchAccountSample.ts -[privateendpointconnectionupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/typescript/src/privateEndpointConnectionUpdateSample.ts -[privatelinkresourcegetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/typescript/src/privateLinkResourceGetSample.ts -[privatelinkresourcelistbybatchaccountsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/arm-batch/samples/v10/typescript/src/privateLinkResourceListByBatchAccountSample.ts -[apiref]: https://learn.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 -[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/batch/arm-batch/samples/v10/typescript/package.json b/sdk/batch/arm-batch/samples/v10/typescript/package.json deleted file mode 100644 index 6e2f186e26a0..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "@azure-samples/arm-batch-ts", - "private": true, - "version": "1.0.0", - "description": " client library samples for TypeScript", - "engines": { - "node": ">=20.0.0" - }, - "scripts": { - "build": "tsc", - "prebuild": "rimraf dist/" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/batch/arm-batch" - }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], - "author": "Microsoft Corporation", - "license": "MIT", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/batch/arm-batch", - "dependencies": { - "@azure/arm-batch": "latest", - "dotenv": "latest", - "@azure/identity": "^4.2.1" - }, - "devDependencies": { - "@types/node": "^20.0.0", - "typescript": "~5.8.2", - "rimraf": "latest" - } -} diff --git a/sdk/batch/arm-batch/samples/v10/typescript/sample.env b/sdk/batch/arm-batch/samples/v10/typescript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/batch/arm-batch/samples/v10/typescript/src/applicationCreateSample.ts b/sdk/batch/arm-batch/samples/v10/typescript/src/applicationCreateSample.ts deleted file mode 100644 index 7afb73867e3b..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/src/applicationCreateSample.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { - Application, - ApplicationCreateOptionalParams, - BatchManagementClient, -} from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2024-07-01/examples/ApplicationCreate.json - */ -async function applicationCreate() { - 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 = { - allowUpdates: false, - displayName: "myAppName", - }; - const options: ApplicationCreateOptionalParams = { parameters }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.applicationOperations.create( - resourceGroupName, - accountName, - applicationName, - options, - ); - console.log(result); -} - -async function main() { - applicationCreate(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/typescript/src/applicationDeleteSample.ts b/sdk/batch/arm-batch/samples/v10/typescript/src/applicationDeleteSample.ts deleted file mode 100644 index 1a64b1e7025f..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/src/applicationDeleteSample.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { BatchManagementClient } from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2024-07-01/examples/ApplicationDelete.json - */ -async function applicationDelete() { - 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(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.applicationOperations.delete( - resourceGroupName, - accountName, - applicationName, - ); - console.log(result); -} - -async function main() { - applicationDelete(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/typescript/src/applicationGetSample.ts b/sdk/batch/arm-batch/samples/v10/typescript/src/applicationGetSample.ts deleted file mode 100644 index d59fa57d8d5b..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/src/applicationGetSample.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { BatchManagementClient } from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2024-07-01/examples/ApplicationGet.json - */ -async function applicationGet() { - 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(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.applicationOperations.get( - resourceGroupName, - accountName, - applicationName, - ); - console.log(result); -} - -async function main() { - applicationGet(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/typescript/src/applicationListSample.ts b/sdk/batch/arm-batch/samples/v10/typescript/src/applicationListSample.ts deleted file mode 100644 index 2fa43d49e049..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/src/applicationListSample.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { BatchManagementClient } from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2024-07-01/examples/ApplicationList.json - */ -async function applicationList() { - 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); - const resArray = new Array(); - for await (let item of client.applicationOperations.list( - resourceGroupName, - accountName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - applicationList(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/typescript/src/applicationPackageActivateSample.ts b/sdk/batch/arm-batch/samples/v10/typescript/src/applicationPackageActivateSample.ts deleted file mode 100644 index 5e5dcd5a2804..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/src/applicationPackageActivateSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { - ActivateApplicationPackageParameters, - BatchManagementClient, -} from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2024-07-01/examples/ApplicationPackageActivate.json - */ -async function applicationPackageActivate() { - 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"; - const parameters: ActivateApplicationPackageParameters = { format: "zip" }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.applicationPackageOperations.activate( - resourceGroupName, - accountName, - applicationName, - versionName, - parameters, - ); - console.log(result); -} - -async function main() { - applicationPackageActivate(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/typescript/src/applicationPackageCreateSample.ts b/sdk/batch/arm-batch/samples/v10/typescript/src/applicationPackageCreateSample.ts deleted file mode 100644 index 4c7e68972023..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/src/applicationPackageCreateSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { BatchManagementClient } from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2024-07-01/examples/ApplicationPackageCreate.json - */ -async function applicationPackageCreate() { - 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"; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.applicationPackageOperations.create( - resourceGroupName, - accountName, - applicationName, - versionName, - ); - console.log(result); -} - -async function main() { - applicationPackageCreate(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/typescript/src/applicationPackageDeleteSample.ts b/sdk/batch/arm-batch/samples/v10/typescript/src/applicationPackageDeleteSample.ts deleted file mode 100644 index cb2a3dfa7f82..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/src/applicationPackageDeleteSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { BatchManagementClient } from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2024-07-01/examples/ApplicationPackageDelete.json - */ -async function applicationPackageDelete() { - 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"; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.applicationPackageOperations.delete( - resourceGroupName, - accountName, - applicationName, - versionName, - ); - console.log(result); -} - -async function main() { - applicationPackageDelete(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/typescript/src/applicationPackageGetSample.ts b/sdk/batch/arm-batch/samples/v10/typescript/src/applicationPackageGetSample.ts deleted file mode 100644 index 7616b8f94915..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/src/applicationPackageGetSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { BatchManagementClient } from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2024-07-01/examples/ApplicationPackageGet.json - */ -async function applicationPackageGet() { - 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"; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.applicationPackageOperations.get( - resourceGroupName, - accountName, - applicationName, - versionName, - ); - console.log(result); -} - -async function main() { - applicationPackageGet(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/typescript/src/applicationPackageListSample.ts b/sdk/batch/arm-batch/samples/v10/typescript/src/applicationPackageListSample.ts deleted file mode 100644 index f829763a0668..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/src/applicationPackageListSample.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { BatchManagementClient } from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2024-07-01/examples/ApplicationPackageList.json - */ -async function applicationPackageList() { - 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(); - const client = new BatchManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.applicationPackageOperations.list( - resourceGroupName, - accountName, - applicationName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - applicationPackageList(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/typescript/src/applicationUpdateSample.ts b/sdk/batch/arm-batch/samples/v10/typescript/src/applicationUpdateSample.ts deleted file mode 100644 index 33a1f6951a99..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/src/applicationUpdateSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { Application, BatchManagementClient } from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2024-07-01/examples/ApplicationUpdate.json - */ -async function applicationUpdate() { - 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 = { - allowUpdates: true, - defaultVersion: "2", - displayName: "myAppName", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.applicationOperations.update( - resourceGroupName, - accountName, - applicationName, - parameters, - ); - console.log(result); -} - -async function main() { - applicationUpdate(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountCreateSample.ts b/sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountCreateSample.ts deleted file mode 100644 index 76b8676e2220..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountCreateSample.ts +++ /dev/null @@ -1,181 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { - BatchAccountCreateParameters, - BatchManagementClient, -} from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2024-07-01/examples/BatchAccountCreate_BYOS.json - */ -async function batchAccountCreateByos() { - 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: { - storageAccountId: - "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage", - }, - keyVaultReference: { - id: "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.KeyVault/vaults/sample", - url: "http://sample.vault.azure.net/", - }, - location: "japaneast", - poolAllocationMode: "UserSubscription", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.batchAccountOperations.beginCreateAndWait( - resourceGroupName, - accountName, - parameters, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/BatchAccountCreate_Default.json - */ -async function batchAccountCreateDefault() { - 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: { - storageAccountId: - "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage", - }, - location: "japaneast", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.batchAccountOperations.beginCreateAndWait( - resourceGroupName, - accountName, - parameters, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/BatchAccountCreate_SystemAssignedIdentity.json - */ -async function batchAccountCreateSystemAssignedIdentity() { - 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: { - storageAccountId: - "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage", - }, - identity: { type: "SystemAssigned" }, - location: "japaneast", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.batchAccountOperations.beginCreateAndWait( - resourceGroupName, - accountName, - parameters, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/BatchAccountCreate_UserAssignedIdentity.json - */ -async function batchAccountCreateUserAssignedIdentity() { - 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: { - storageAccountId: - "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage", - }, - identity: { - type: "UserAssigned", - userAssignedIdentities: { - "/subscriptions/subid/resourceGroups/defaultAzurebatchJapaneast/providers/MicrosoftManagedIdentity/userAssignedIdentities/id1": - {}, - }, - }, - location: "japaneast", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.batchAccountOperations.beginCreateAndWait( - resourceGroupName, - accountName, - parameters, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/PrivateBatchAccountCreate.json - */ -async function privateBatchAccountCreate() { - 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: { - storageAccountId: - "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage", - }, - keyVaultReference: { - id: "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.KeyVault/vaults/sample", - url: "http://sample.vault.azure.net/", - }, - location: "japaneast", - publicNetworkAccess: "Disabled", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.batchAccountOperations.beginCreateAndWait( - resourceGroupName, - accountName, - parameters, - ); - console.log(result); -} - -async function main() { - batchAccountCreateByos(); - batchAccountCreateDefault(); - batchAccountCreateSystemAssignedIdentity(); - batchAccountCreateUserAssignedIdentity(); - privateBatchAccountCreate(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountDeleteSample.ts b/sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountDeleteSample.ts deleted file mode 100644 index 377ee7a39ea6..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountDeleteSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { BatchManagementClient } from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2024-07-01/examples/BatchAccountDelete.json - */ -async function batchAccountDelete() { - 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); - const result = await client.batchAccountOperations.beginDeleteAndWait( - resourceGroupName, - accountName, - ); - console.log(result); -} - -async function main() { - batchAccountDelete(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountGetDetectorSample.ts b/sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountGetDetectorSample.ts deleted file mode 100644 index 24e23bb069a2..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountGetDetectorSample.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { BatchManagementClient } from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2024-07-01/examples/DetectorGet.json - */ -async function getDetector() { - 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(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.batchAccountOperations.getDetector( - resourceGroupName, - accountName, - detectorId, - ); - console.log(result); -} - -async function main() { - getDetector(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountGetKeysSample.ts b/sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountGetKeysSample.ts deleted file mode 100644 index cff0827bf99c..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountGetKeysSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { BatchManagementClient } from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2024-07-01/examples/BatchAccountGetKeys.json - */ -async function batchAccountGetKeys() { - 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); - const result = await client.batchAccountOperations.getKeys( - resourceGroupName, - accountName, - ); - console.log(result); -} - -async function main() { - batchAccountGetKeys(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountGetSample.ts b/sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountGetSample.ts deleted file mode 100644 index 96298c3c7268..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountGetSample.ts +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { BatchManagementClient } from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2024-07-01/examples/BatchAccountGet.json - */ -async function batchAccountGet() { - 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); - const result = await client.batchAccountOperations.get( - resourceGroupName, - accountName, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/PrivateBatchAccountGet.json - */ -async function privateBatchAccountGet() { - 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); - const result = await client.batchAccountOperations.get( - resourceGroupName, - accountName, - ); - console.log(result); -} - -async function main() { - batchAccountGet(); - privateBatchAccountGet(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountListByResourceGroupSample.ts b/sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountListByResourceGroupSample.ts deleted file mode 100644 index 45981b88a99e..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountListByResourceGroupSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { BatchManagementClient } from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2024-07-01/examples/BatchAccountListByResourceGroup.json - */ -async function batchAccountListByResourceGroup() { - 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(); - for await (let item of client.batchAccountOperations.listByResourceGroup( - resourceGroupName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - batchAccountListByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountListDetectorsSample.ts b/sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountListDetectorsSample.ts deleted file mode 100644 index 84f586076206..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountListDetectorsSample.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { BatchManagementClient } from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2024-07-01/examples/DetectorList.json - */ -async function listDetectors() { - 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); - const resArray = new Array(); - for await (let item of client.batchAccountOperations.listDetectors( - resourceGroupName, - accountName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listDetectors(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountListOutboundNetworkDependenciesEndpointsSample.ts b/sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountListOutboundNetworkDependenciesEndpointsSample.ts deleted file mode 100644 index 64fb868855d8..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountListOutboundNetworkDependenciesEndpointsSample.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { BatchManagementClient } from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/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/2024-07-01/examples/BatchAccountListOutboundNetworkDependenciesEndpoints.json - */ -async function listOutboundNetworkDependencies() { - 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); - const resArray = new Array(); - for await (let item of client.batchAccountOperations.listOutboundNetworkDependenciesEndpoints( - resourceGroupName, - accountName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listOutboundNetworkDependencies(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountListSample.ts b/sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountListSample.ts deleted file mode 100644 index bdb1381f69ba..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountListSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { BatchManagementClient } from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2024-07-01/examples/BatchAccountList.json - */ -async function batchAccountList() { - const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.batchAccountOperations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - batchAccountList(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountRegenerateKeySample.ts b/sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountRegenerateKeySample.ts deleted file mode 100644 index df172909e9dd..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountRegenerateKeySample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { - BatchAccountRegenerateKeyParameters, - BatchManagementClient, -} from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2024-07-01/examples/BatchAccountRegenerateKey.json - */ -async function batchAccountRegenerateKey() { - 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", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.batchAccountOperations.regenerateKey( - resourceGroupName, - accountName, - parameters, - ); - console.log(result); -} - -async function main() { - batchAccountRegenerateKey(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountSynchronizeAutoStorageKeysSample.ts b/sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountSynchronizeAutoStorageKeysSample.ts deleted file mode 100644 index 8a9e19929d1e..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountSynchronizeAutoStorageKeysSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { BatchManagementClient } from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2024-07-01/examples/BatchAccountSynchronizeAutoStorageKeys.json - */ -async function batchAccountSynchronizeAutoStorageKeys() { - 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); - const result = await client.batchAccountOperations.synchronizeAutoStorageKeys( - resourceGroupName, - accountName, - ); - console.log(result); -} - -async function main() { - batchAccountSynchronizeAutoStorageKeys(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountUpdateSample.ts b/sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountUpdateSample.ts deleted file mode 100644 index 7392c9f472a6..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/src/batchAccountUpdateSample.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { - BatchAccountUpdateParameters, - BatchManagementClient, -} from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2024-07-01/examples/BatchAccountUpdate.json - */ -async function batchAccountUpdate() { - 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: { - storageAccountId: - "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.batchAccountOperations.update( - resourceGroupName, - accountName, - parameters, - ); - console.log(result); -} - -async function main() { - batchAccountUpdate(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/typescript/src/certificateCancelDeletionSample.ts b/sdk/batch/arm-batch/samples/v10/typescript/src/certificateCancelDeletionSample.ts deleted file mode 100644 index 6debb5753703..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/src/certificateCancelDeletionSample.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { BatchManagementClient } from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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. - -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 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/2024-07-01/examples/CertificateCancelDeletion.json - */ -async function certificateCancelDeletion() { - 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(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.certificateOperations.cancelDeletion( - resourceGroupName, - accountName, - certificateName, - ); - console.log(result); -} - -async function main() { - certificateCancelDeletion(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/typescript/src/certificateCreateSample.ts b/sdk/batch/arm-batch/samples/v10/typescript/src/certificateCreateSample.ts deleted file mode 100644 index d349fcec39a9..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/src/certificateCreateSample.ts +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { - CertificateCreateOrUpdateParameters, - BatchManagementClient, -} from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2024-07-01/examples/CertificateCreate_Full.json - */ -async function createCertificateFull() { - 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 = { - format: "Pfx", - data: "MIIJsgIBAzCCCW4GCSqGSIb3DQE...", - password: "", - thumbprint: "0a0e4f50d51beadeac1d35afc5116098e7902e6e", - thumbprintAlgorithm: "sha1", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.certificateOperations.create( - resourceGroupName, - accountName, - certificateName, - parameters, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/CertificateCreate_MinimalCer.json - */ -async function createCertificateMinimalCer() { - 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 = { - format: "Cer", - data: "MIICrjCCAZagAwI...", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.certificateOperations.create( - resourceGroupName, - accountName, - certificateName, - parameters, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/CertificateCreate_Minimal.json - */ -async function createCertificateMinimalPfx() { - 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 = { - data: "MIIJsgIBAzCCCW4GCSqGSIb3DQE...", - password: "", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.certificateOperations.create( - resourceGroupName, - accountName, - certificateName, - parameters, - ); - console.log(result); -} - -async function main() { - createCertificateFull(); - createCertificateMinimalCer(); - createCertificateMinimalPfx(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/typescript/src/certificateDeleteSample.ts b/sdk/batch/arm-batch/samples/v10/typescript/src/certificateDeleteSample.ts deleted file mode 100644 index 10941b00ec33..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/src/certificateDeleteSample.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { BatchManagementClient } from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2024-07-01/examples/CertificateDelete.json - */ -async function certificateDelete() { - 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(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.certificateOperations.beginDeleteAndWait( - resourceGroupName, - accountName, - certificateName, - ); - console.log(result); -} - -async function main() { - certificateDelete(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/typescript/src/certificateGetSample.ts b/sdk/batch/arm-batch/samples/v10/typescript/src/certificateGetSample.ts deleted file mode 100644 index b2893b3143cb..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/src/certificateGetSample.ts +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { BatchManagementClient } from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2024-07-01/examples/CertificateGet.json - */ -async function getCertificate() { - 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(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.certificateOperations.get( - resourceGroupName, - accountName, - certificateName, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/CertificateGetWithDeletionError.json - */ -async function getCertificateWithDeletionError() { - 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(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.certificateOperations.get( - resourceGroupName, - accountName, - certificateName, - ); - console.log(result); -} - -async function main() { - getCertificate(); - getCertificateWithDeletionError(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/typescript/src/certificateListByBatchAccountSample.ts b/sdk/batch/arm-batch/samples/v10/typescript/src/certificateListByBatchAccountSample.ts deleted file mode 100644 index 018a128bd1ad..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/src/certificateListByBatchAccountSample.ts +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { - CertificateListByBatchAccountOptionalParams, - BatchManagementClient, -} from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2024-07-01/examples/CertificateList.json - */ -async function listCertificates() { - 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); - const resArray = new Array(); - for await (let item of client.certificateOperations.listByBatchAccount( - resourceGroupName, - accountName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * 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/2024-07-01/examples/CertificateListWithFilter.json - */ -async function listCertificatesFilterAndSelect() { - 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 = - "properties/provisioningStateTransitionTime gt '2017-05-01' or properties/provisioningState eq 'Failed'"; - const options: CertificateListByBatchAccountOptionalParams = { - select, - filter, - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.certificateOperations.listByBatchAccount( - resourceGroupName, - accountName, - options, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listCertificates(); - listCertificatesFilterAndSelect(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/typescript/src/certificateUpdateSample.ts b/sdk/batch/arm-batch/samples/v10/typescript/src/certificateUpdateSample.ts deleted file mode 100644 index cdbdf6614f8b..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/src/certificateUpdateSample.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { - CertificateCreateOrUpdateParameters, - BatchManagementClient, -} from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2024-07-01/examples/CertificateUpdate.json - */ -async function updateCertificate() { - 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 = { - data: "MIIJsgIBAzCCCW4GCSqGSIb3DQE...", - password: "", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.certificateOperations.update( - resourceGroupName, - accountName, - certificateName, - parameters, - ); - console.log(result); -} - -async function main() { - updateCertificate(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/typescript/src/locationCheckNameAvailabilitySample.ts b/sdk/batch/arm-batch/samples/v10/typescript/src/locationCheckNameAvailabilitySample.ts deleted file mode 100644 index 36b4d605ce83..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/src/locationCheckNameAvailabilitySample.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { - CheckNameAvailabilityParameters, - BatchManagementClient, -} from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2024-07-01/examples/LocationCheckNameAvailability_AlreadyExists.json - */ -async function locationCheckNameAvailabilityAlreadyExists() { - const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; - const locationName = "japaneast"; - const parameters: CheckNameAvailabilityParameters = { - name: "existingaccountname", - type: "Microsoft.Batch/batchAccounts", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.location.checkNameAvailability( - locationName, - parameters, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/LocationCheckNameAvailability_Available.json - */ -async function locationCheckNameAvailabilityAvailable() { - const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; - const locationName = "japaneast"; - const parameters: CheckNameAvailabilityParameters = { - name: "newaccountname", - type: "Microsoft.Batch/batchAccounts", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.location.checkNameAvailability( - locationName, - parameters, - ); - console.log(result); -} - -async function main() { - locationCheckNameAvailabilityAlreadyExists(); - locationCheckNameAvailabilityAvailable(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/typescript/src/locationGetQuotasSample.ts b/sdk/batch/arm-batch/samples/v10/typescript/src/locationGetQuotasSample.ts deleted file mode 100644 index 4d4177322755..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/src/locationGetQuotasSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { BatchManagementClient } from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2024-07-01/examples/LocationGetQuotas.json - */ -async function locationGetQuotas() { - const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; - const locationName = "japaneast"; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.location.getQuotas(locationName); - console.log(result); -} - -async function main() { - locationGetQuotas(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/typescript/src/locationListSupportedVirtualMachineSkusSample.ts b/sdk/batch/arm-batch/samples/v10/typescript/src/locationListSupportedVirtualMachineSkusSample.ts deleted file mode 100644 index f445f2ad3f57..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/src/locationListSupportedVirtualMachineSkusSample.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { BatchManagementClient } from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2024-07-01/examples/LocationListVirtualMachineSkus.json - */ -async function locationListVirtualMachineSkus() { - const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; - const locationName = "japaneast"; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.location.listSupportedVirtualMachineSkus( - locationName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - locationListVirtualMachineSkus(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/typescript/src/networkSecurityPerimeterGetConfigurationSample.ts b/sdk/batch/arm-batch/samples/v10/typescript/src/networkSecurityPerimeterGetConfigurationSample.ts deleted file mode 100644 index 58a5f048f5fa..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/src/networkSecurityPerimeterGetConfigurationSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { BatchManagementClient } from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets information about the specified NSP configuration. - * - * @summary Gets information about the specified NSP configuration. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-01/examples/NspConfigurationGet.json - */ -async function getNspConfiguration() { - const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = - process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; - const accountName = "sampleacct"; - const networkSecurityPerimeterConfigurationName = - "00000000-0000-0000-0000-000000000000.sampleassociation"; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = - await client.networkSecurityPerimeterOperations.getConfiguration( - resourceGroupName, - accountName, - networkSecurityPerimeterConfigurationName, - ); - console.log(result); -} - -async function main() { - getNspConfiguration(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/typescript/src/networkSecurityPerimeterListConfigurationsSample.ts b/sdk/batch/arm-batch/samples/v10/typescript/src/networkSecurityPerimeterListConfigurationsSample.ts deleted file mode 100644 index 908e991f7b62..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/src/networkSecurityPerimeterListConfigurationsSample.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { BatchManagementClient } from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Lists all of the NSP configurations in the specified account. - * - * @summary Lists all of the NSP configurations in the specified account. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-01/examples/NspConfigurationsList.json - */ -async function listNspConfigurations() { - 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); - const resArray = new Array(); - for await (let item of client.networkSecurityPerimeterOperations.listConfigurations( - resourceGroupName, - accountName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listNspConfigurations(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/typescript/src/networkSecurityPerimeterReconcileConfigurationSample.ts b/sdk/batch/arm-batch/samples/v10/typescript/src/networkSecurityPerimeterReconcileConfigurationSample.ts deleted file mode 100644 index ba3ba0ee0e07..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/src/networkSecurityPerimeterReconcileConfigurationSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { BatchManagementClient } from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Reconciles the specified NSP configuration. - * - * @summary Reconciles the specified NSP configuration. - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-01/examples/NspConfigurationReconcile.json - */ -async function reconcileNspConfiguration() { - const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = - process.env["BATCH_RESOURCE_GROUP"] || "default-azurebatch-japaneast"; - const accountName = "sampleacct"; - const networkSecurityPerimeterConfigurationName = - "00000000-0000-0000-0000-000000000000.sampleassociation"; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = - await client.networkSecurityPerimeterOperations.beginReconcileConfigurationAndWait( - resourceGroupName, - accountName, - networkSecurityPerimeterConfigurationName, - ); - console.log(result); -} - -async function main() { - reconcileNspConfiguration(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/typescript/src/operationsListSample.ts b/sdk/batch/arm-batch/samples/v10/typescript/src/operationsListSample.ts deleted file mode 100644 index 81e9bc7237a6..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/src/operationsListSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { BatchManagementClient } from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2024-07-01/examples/OperationsList.json - */ -async function operationsList() { - 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(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - operationsList(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/typescript/src/poolCreateSample.ts b/sdk/batch/arm-batch/samples/v10/typescript/src/poolCreateSample.ts deleted file mode 100644 index 3fd81059b86c..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/src/poolCreateSample.ts +++ /dev/null @@ -1,712 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { Pool, BatchManagementClient } from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2024-07-01/examples/PoolCreate_SharedImageGallery.json - */ -async function createPoolCustomImage() { - 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: { - id: "/subscriptions/subid/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1", - }, - nodeAgentSkuId: "batch.node.ubuntu 18.04", - }, - }, - vmSize: "STANDARD_D4", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.create( - resourceGroupName, - accountName, - poolName, - parameters, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/PoolCreate_VirtualMachineConfiguration.json - */ -async function createPoolFullVirtualMachineConfiguration() { - 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: { - dataDisks: [ - { - caching: "ReadWrite", - diskSizeGB: 30, - lun: 0, - storageAccountType: "Premium_LRS", - }, - { - caching: "None", - diskSizeGB: 200, - lun: 1, - storageAccountType: "Standard_LRS", - }, - ], - diskEncryptionConfiguration: { targets: ["OsDisk", "TemporaryDisk"] }, - imageReference: { - offer: "WindowsServer", - publisher: "MicrosoftWindowsServer", - sku: "2016-Datacenter-SmallDisk", - version: "latest", - }, - licenseType: "Windows_Server", - nodeAgentSkuId: "batch.node.windows amd64", - nodePlacementConfiguration: { policy: "Zonal" }, - osDisk: { ephemeralOSDiskSettings: { placement: "CacheDisk" } }, - windowsConfiguration: { enableAutomaticUpdates: false }, - }, - }, - networkConfiguration: { - endpointConfiguration: { - inboundNatPools: [ - { - name: "testnat", - backendPort: 12001, - frontendPortRangeEnd: 15100, - frontendPortRangeStart: 15000, - networkSecurityGroupRules: [ - { - access: "Allow", - priority: 150, - sourceAddressPrefix: "192.100.12.45", - sourcePortRanges: ["1", "2"], - }, - { - access: "Deny", - priority: 3500, - sourceAddressPrefix: "*", - sourcePortRanges: ["*"], - }, - ], - protocol: "TCP", - }, - ], - }, - }, - scaleSettings: { - autoScale: { - evaluationInterval: "PT5M", - formula: "$TargetDedicatedNodes=1", - }, - }, - vmSize: "STANDARD_D4", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.create( - resourceGroupName, - accountName, - poolName, - parameters, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/PoolCreate_MinimalVirtualMachineConfiguration.json - */ -async function createPoolMinimalVirtualMachineConfiguration() { - 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: "UbuntuServer", - publisher: "Canonical", - sku: "18.04-LTS", - version: "latest", - }, - nodeAgentSkuId: "batch.node.ubuntu 18.04", - }, - }, - scaleSettings: { - autoScale: { - evaluationInterval: "PT5M", - formula: "$TargetDedicatedNodes=1", - }, - }, - vmSize: "STANDARD_D4", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.create( - resourceGroupName, - accountName, - poolName, - parameters, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/PoolCreate_NoPublicIPAddresses.json - */ -async function createPoolNoPublicIP() { - 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: { - id: "/subscriptions/subid/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1", - }, - nodeAgentSkuId: "batch.node.ubuntu 18.04", - }, - }, - networkConfiguration: { - publicIPAddressConfiguration: { provision: "NoPublicIPAddresses" }, - subnetId: - "/subscriptions/subid/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123", - }, - vmSize: "STANDARD_D4", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.create( - resourceGroupName, - accountName, - poolName, - parameters, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/PoolCreate_PublicIPs.json - */ -async function createPoolPublicIPs() { - 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: { - id: "/subscriptions/subid/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1", - }, - nodeAgentSkuId: "batch.node.ubuntu 18.04", - }, - }, - networkConfiguration: { - publicIPAddressConfiguration: { - ipAddressIds: [ - "/subscriptions/subid1/resourceGroups/rg13/providers/Microsoft.Network/publicIPAddresses/ip135", - ], - provision: "UserManaged", - }, - subnetId: - "/subscriptions/subid/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123", - }, - vmSize: "STANDARD_D4", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.create( - resourceGroupName, - accountName, - poolName, - parameters, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/PoolCreate_ResourceTags.json - */ -async function createPoolResourceTags() { - 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: "UbuntuServer", - publisher: "Canonical", - sku: "18_04-lts-gen2", - version: "latest", - }, - nodeAgentSkuId: "batch.node.ubuntu 18.04", - }, - }, - resourceTags: { tagName1: "TagValue1", tagName2: "TagValue2" }, - scaleSettings: { - fixedScale: { targetDedicatedNodes: 1, targetLowPriorityNodes: 0 }, - }, - vmSize: "Standard_d4s_v3", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.create( - resourceGroupName, - accountName, - poolName, - parameters, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/PoolCreate_SecurityProfile.json - */ -async function createPoolSecurityProfile() { - 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: "UbuntuServer", - publisher: "Canonical", - sku: "18_04-lts-gen2", - version: "latest", - }, - nodeAgentSkuId: "batch.node.ubuntu 18.04", - securityProfile: { - encryptionAtHost: true, - securityType: "trustedLaunch", - uefiSettings: { secureBootEnabled: undefined, vTpmEnabled: false }, - }, - }, - }, - scaleSettings: { - fixedScale: { targetDedicatedNodes: 1, targetLowPriorityNodes: 0 }, - }, - vmSize: "Standard_d4s_v3", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.create( - resourceGroupName, - accountName, - poolName, - parameters, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/PoolCreate_Tags.json - */ -async function createPoolTags() { - 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: "0001-com-ubuntu-server-jammy", - publisher: "Canonical", - sku: "22_04-lts", - version: "latest", - }, - nodeAgentSkuId: "batch.node.ubuntu 22.04", - }, - }, - scaleSettings: { - fixedScale: { targetDedicatedNodes: 1, targetLowPriorityNodes: 0 }, - }, - tags: { tagName1: "TagValue1", tagName2: "TagValue2" }, - vmSize: "Standard_d4s_v3", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.create( - resourceGroupName, - accountName, - poolName, - parameters, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/PoolCreate_UpgradePolicy.json - */ -async function createPoolUpgradePolicy() { - 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: "2019-datacenter-smalldisk", - version: "latest", - }, - nodeAgentSkuId: "batch.node.windows amd64", - nodePlacementConfiguration: { policy: "Zonal" }, - windowsConfiguration: { enableAutomaticUpdates: false }, - }, - }, - scaleSettings: { - fixedScale: { targetDedicatedNodes: 2, targetLowPriorityNodes: 0 }, - }, - upgradePolicy: { - automaticOSUpgradePolicy: { - disableAutomaticRollback: true, - enableAutomaticOSUpgrade: true, - osRollingUpgradeDeferral: true, - useRollingUpgradePolicy: true, - }, - mode: "automatic", - rollingUpgradePolicy: { - enableCrossZoneUpgrade: true, - maxBatchInstancePercent: 20, - maxUnhealthyInstancePercent: 20, - maxUnhealthyUpgradedInstancePercent: 20, - pauseTimeBetweenBatches: "PT0S", - prioritizeUnhealthyInstances: false, - rollbackFailedInstancesOnPolicyBreach: false, - }, - }, - vmSize: "Standard_d4s_v3", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.create( - resourceGroupName, - accountName, - poolName, - parameters, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/PoolCreate_UserAssignedIdentities.json - */ -async function createPoolUserAssignedIdentities() { - 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: "UbuntuServer", - publisher: "Canonical", - sku: "18.04-LTS", - version: "latest", - }, - nodeAgentSkuId: "batch.node.ubuntu 18.04", - }, - }, - identity: { - type: "UserAssigned", - userAssignedIdentities: { - "/subscriptions/subid/resourceGroups/defaultAzurebatchJapaneast/providers/MicrosoftManagedIdentity/userAssignedIdentities/id1": - {}, - "/subscriptions/subid/resourceGroups/defaultAzurebatchJapaneast/providers/MicrosoftManagedIdentity/userAssignedIdentities/id2": - {}, - }, - }, - scaleSettings: { - autoScale: { - evaluationInterval: "PT5M", - formula: "$TargetDedicatedNodes=1", - }, - }, - vmSize: "STANDARD_D4", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.create( - resourceGroupName, - accountName, - poolName, - parameters, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/PoolCreate_VirtualMachineConfiguration_Extensions.json - */ -async function createPoolVirtualMachineConfigurationExtensions() { - 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: "0001-com-ubuntu-server-focal", - publisher: "Canonical", - sku: "20_04-lts", - }, - nodeAgentSkuId: "batch.node.ubuntu 20.04", - extensions: [ - { - name: "batchextension1", - type: "KeyVaultForLinux", - autoUpgradeMinorVersion: true, - enableAutomaticUpgrade: true, - publisher: "Microsoft.Azure.KeyVault", - settings: { - authenticationSettingsKey: "authenticationSettingsValue", - secretsManagementSettingsKey: "secretsManagementSettingsValue", - }, - typeHandlerVersion: "2.0", - }, - ], - }, - }, - scaleSettings: { - autoScale: { - evaluationInterval: "PT5M", - formula: "$TargetDedicatedNodes=1", - }, - }, - targetNodeCommunicationMode: "Default", - vmSize: "STANDARD_D4", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.create( - resourceGroupName, - accountName, - poolName, - parameters, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/PoolCreate_VirtualMachineConfiguration_ManagedOSDisk.json - */ -async function createPoolVirtualMachineConfigurationOSDisk() { - 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: "2022-datacenter-smalldisk", - }, - nodeAgentSkuId: "batch.node.windows amd64", - osDisk: { - caching: "ReadWrite", - diskSizeGB: 100, - managedDisk: { storageAccountType: "StandardSSD_LRS" }, - writeAcceleratorEnabled: false, - }, - }, - }, - scaleSettings: { - fixedScale: { targetDedicatedNodes: 1, targetLowPriorityNodes: 0 }, - }, - vmSize: "Standard_d2s_v3", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.create( - resourceGroupName, - accountName, - poolName, - parameters, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/PoolCreate_VirtualMachineConfiguration_ServiceArtifactReference.json - */ -async function createPoolVirtualMachineConfigurationServiceArtifactReference() { - 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: "2019-datacenter-smalldisk", - version: "latest", - }, - nodeAgentSkuId: "batch.node.windows amd64", - serviceArtifactReference: { - id: "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/galleries/myGallery/serviceArtifacts/myServiceArtifact/vmArtifactsProfiles/vmArtifactsProfile", - }, - windowsConfiguration: { enableAutomaticUpdates: false }, - }, - }, - scaleSettings: { - fixedScale: { targetDedicatedNodes: 2, targetLowPriorityNodes: 0 }, - }, - upgradePolicy: { - automaticOSUpgradePolicy: { enableAutomaticOSUpgrade: true }, - mode: "automatic", - }, - vmSize: "Standard_d4s_v3", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.create( - resourceGroupName, - accountName, - poolName, - parameters, - ); - console.log(result); -} - -/** - * 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/2024-07-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(); - createPoolFullVirtualMachineConfiguration(); - createPoolMinimalVirtualMachineConfiguration(); - createPoolNoPublicIP(); - createPoolPublicIPs(); - createPoolResourceTags(); - createPoolSecurityProfile(); - createPoolTags(); - createPoolUpgradePolicy(); - createPoolUserAssignedIdentities(); - createPoolVirtualMachineConfigurationExtensions(); - createPoolVirtualMachineConfigurationOSDisk(); - createPoolVirtualMachineConfigurationServiceArtifactReference(); - createPoolAcceleratedNetworking(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/typescript/src/poolDeleteSample.ts b/sdk/batch/arm-batch/samples/v10/typescript/src/poolDeleteSample.ts deleted file mode 100644 index f3965919b7ef..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/src/poolDeleteSample.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { BatchManagementClient } from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2024-07-01/examples/PoolDelete.json - */ -async function deletePool() { - 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.beginDeleteAndWait( - resourceGroupName, - accountName, - poolName, - ); - console.log(result); -} - -async function main() { - deletePool(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/typescript/src/poolDisableAutoScaleSample.ts b/sdk/batch/arm-batch/samples/v10/typescript/src/poolDisableAutoScaleSample.ts deleted file mode 100644 index 652506af98a2..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/src/poolDisableAutoScaleSample.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { BatchManagementClient } from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2024-07-01/examples/PoolDisableAutoScale.json - */ -async function disableAutoScale() { - 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.disableAutoScale( - resourceGroupName, - accountName, - poolName, - ); - console.log(result); -} - -async function main() { - disableAutoScale(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/typescript/src/poolGetSample.ts b/sdk/batch/arm-batch/samples/v10/typescript/src/poolGetSample.ts deleted file mode 100644 index 286c0bbc5691..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/src/poolGetSample.ts +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { BatchManagementClient } from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2024-07-01/examples/PoolGet.json - */ -async function getPool() { - 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/2024-07-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/2024-07-01/examples/PoolGet_SecurityProfile.json - */ -async function getPoolSecurityProfile() { - 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/2024-07-01/examples/PoolGet_UpgradePolicy.json - */ -async function getPoolUpgradePolicy() { - 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/2024-07-01/examples/PoolGet_VirtualMachineConfiguration_Extensions.json - */ -async function getPoolVirtualMachineConfigurationExtensions() { - 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/2024-07-01/examples/PoolGet_VirtualMachineConfiguration_MangedOSDisk.json - */ -async function getPoolVirtualMachineConfigurationOSDisk() { - 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/2024-07-01/examples/PoolGet_VirtualMachineConfiguration_ServiceArtifactReference.json - */ -async function getPoolVirtualMachineConfigurationServiceArtifactReference() { - 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); -} - -async function main() { - getPool(); - getPoolAcceleratedNetworking(); - getPoolSecurityProfile(); - getPoolUpgradePolicy(); - getPoolVirtualMachineConfigurationExtensions(); - getPoolVirtualMachineConfigurationOSDisk(); - getPoolVirtualMachineConfigurationServiceArtifactReference(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/typescript/src/poolListByBatchAccountSample.ts b/sdk/batch/arm-batch/samples/v10/typescript/src/poolListByBatchAccountSample.ts deleted file mode 100644 index aa2ba49d729f..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/src/poolListByBatchAccountSample.ts +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { - PoolListByBatchAccountOptionalParams, - BatchManagementClient, -} from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2024-07-01/examples/PoolList.json - */ -async function listPool() { - 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); - const resArray = new Array(); - for await (let item of client.poolOperations.listByBatchAccount( - resourceGroupName, - accountName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -/** - * 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/2024-07-01/examples/PoolListWithFilter.json - */ -async function listPoolWithFilter() { - 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"; - const filter = - "startswith(name, 'po') or (properties/allocationState eq 'Steady' and properties/provisioningStateTransitionTime lt datetime'2017-02-02')"; - const options: PoolListByBatchAccountOptionalParams = { select, filter }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.poolOperations.listByBatchAccount( - resourceGroupName, - accountName, - options, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listPool(); - listPoolWithFilter(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/typescript/src/poolStopResizeSample.ts b/sdk/batch/arm-batch/samples/v10/typescript/src/poolStopResizeSample.ts deleted file mode 100644 index a090419df671..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/src/poolStopResizeSample.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { BatchManagementClient } from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2024-07-01/examples/PoolStopResize.json - */ -async function stopPoolResize() { - 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.stopResize( - resourceGroupName, - accountName, - poolName, - ); - console.log(result); -} - -async function main() { - stopPoolResize(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/typescript/src/poolUpdateSample.ts b/sdk/batch/arm-batch/samples/v10/typescript/src/poolUpdateSample.ts deleted file mode 100644 index 37fc3bc89e46..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/src/poolUpdateSample.ts +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { Pool, BatchManagementClient } from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2024-07-01/examples/PoolUpdate_EnableAutoScale.json - */ -async function updatePoolEnableAutoscale() { - 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 = { - scaleSettings: { autoScale: { formula: "$TargetDedicatedNodes=34" } }, - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.update( - resourceGroupName, - accountName, - poolName, - parameters, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/PoolUpdate_OtherProperties.json - */ -async function updatePoolOtherProperties() { - 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 = { - applicationPackages: [ - { - id: "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool/applications/app_1234", - }, - { - id: "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool/applications/app_5678", - version: "1.0", - }, - ], - certificates: [ - { - id: "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool/certificates/sha1-1234567", - storeLocation: "LocalMachine", - storeName: "MY", - }, - ], - metadata: [{ name: "key1", value: "value1" }], - targetNodeCommunicationMode: "Simplified", - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.update( - resourceGroupName, - accountName, - poolName, - parameters, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/PoolUpdate_RemoveStartTask.json - */ -async function updatePoolRemoveStartTask() { - 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: {} }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.update( - resourceGroupName, - accountName, - poolName, - parameters, - ); - console.log(result); -} - -/** - * 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/2024-07-01/examples/PoolUpdate_ResizePool.json - */ -async function updatePoolResizePool() { - 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 = { - scaleSettings: { - fixedScale: { - nodeDeallocationOption: "TaskCompletion", - resizeTimeout: "PT8M", - targetDedicatedNodes: 5, - targetLowPriorityNodes: 0, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.poolOperations.update( - resourceGroupName, - accountName, - poolName, - parameters, - ); - console.log(result); -} - -async function main() { - updatePoolEnableAutoscale(); - updatePoolOtherProperties(); - updatePoolRemoveStartTask(); - updatePoolResizePool(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/typescript/src/privateEndpointConnectionDeleteSample.ts b/sdk/batch/arm-batch/samples/v10/typescript/src/privateEndpointConnectionDeleteSample.ts deleted file mode 100644 index 1e57a2aa0812..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/src/privateEndpointConnectionDeleteSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { BatchManagementClient } from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2024-07-01/examples/PrivateEndpointConnectionDelete.json - */ -async function privateEndpointConnectionDelete() { - 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"; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = - await client.privateEndpointConnectionOperations.beginDeleteAndWait( - resourceGroupName, - accountName, - privateEndpointConnectionName, - ); - console.log(result); -} - -async function main() { - privateEndpointConnectionDelete(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/typescript/src/privateEndpointConnectionGetSample.ts b/sdk/batch/arm-batch/samples/v10/typescript/src/privateEndpointConnectionGetSample.ts deleted file mode 100644 index 18f8e38f1467..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/src/privateEndpointConnectionGetSample.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { BatchManagementClient } from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2024-07-01/examples/PrivateEndpointConnectionGet.json - */ -async function getPrivateEndpointConnection() { - 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"; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.privateEndpointConnectionOperations.get( - resourceGroupName, - accountName, - privateEndpointConnectionName, - ); - console.log(result); -} - -async function main() { - getPrivateEndpointConnection(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/typescript/src/privateEndpointConnectionListByBatchAccountSample.ts b/sdk/batch/arm-batch/samples/v10/typescript/src/privateEndpointConnectionListByBatchAccountSample.ts deleted file mode 100644 index 2218d29e0a83..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/src/privateEndpointConnectionListByBatchAccountSample.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { BatchManagementClient } from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2024-07-01/examples/PrivateEndpointConnectionsList.json - */ -async function listPrivateEndpointConnections() { - 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); - const resArray = new Array(); - for await (let item of client.privateEndpointConnectionOperations.listByBatchAccount( - resourceGroupName, - accountName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listPrivateEndpointConnections(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/typescript/src/privateEndpointConnectionUpdateSample.ts b/sdk/batch/arm-batch/samples/v10/typescript/src/privateEndpointConnectionUpdateSample.ts deleted file mode 100644 index 71dc25eef1fd..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/src/privateEndpointConnectionUpdateSample.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { - PrivateEndpointConnection, - BatchManagementClient, -} from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2024-07-01/examples/PrivateEndpointConnectionUpdate.json - */ -async function updatePrivateEndpointConnection() { - 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"; - const parameters: PrivateEndpointConnection = { - privateLinkServiceConnectionState: { - description: "Approved by xyz.abc@company.com", - status: "Approved", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = - await client.privateEndpointConnectionOperations.beginUpdateAndWait( - resourceGroupName, - accountName, - privateEndpointConnectionName, - parameters, - ); - console.log(result); -} - -async function main() { - updatePrivateEndpointConnection(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/typescript/src/privateLinkResourceGetSample.ts b/sdk/batch/arm-batch/samples/v10/typescript/src/privateLinkResourceGetSample.ts deleted file mode 100644 index 850cab61eadc..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/src/privateLinkResourceGetSample.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { BatchManagementClient } from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2024-07-01/examples/PrivateLinkResourceGet.json - */ -async function getPrivateLinkResource() { - 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(); - const client = new BatchManagementClient(credential, subscriptionId); - const result = await client.privateLinkResourceOperations.get( - resourceGroupName, - accountName, - privateLinkResourceName, - ); - console.log(result); -} - -async function main() { - getPrivateLinkResource(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/typescript/src/privateLinkResourceListByBatchAccountSample.ts b/sdk/batch/arm-batch/samples/v10/typescript/src/privateLinkResourceListByBatchAccountSample.ts deleted file mode 100644 index 1810a2eee9a9..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/src/privateLinkResourceListByBatchAccountSample.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { BatchManagementClient } from "@azure/arm-batch"; -import { DefaultAzureCredential } from "@azure/identity"; -import "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/2024-07-01/examples/PrivateLinkResourcesList.json - */ -async function listPrivateLinkResource() { - 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); - const resArray = new Array(); - for await (let item of client.privateLinkResourceOperations.listByBatchAccount( - resourceGroupName, - accountName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - listPrivateLinkResource(); -} - -main().catch(console.error); diff --git a/sdk/batch/arm-batch/samples/v10/typescript/tsconfig.json b/sdk/batch/arm-batch/samples/v10/typescript/tsconfig.json deleted file mode 100644 index 984eed535aa8..000000000000 --- a/sdk/batch/arm-batch/samples/v10/typescript/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2020", - "module": "commonjs", - "moduleResolution": "node", - "resolveJsonModule": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "strict": true, - "alwaysStrict": true, - "outDir": "dist", - "rootDir": "src" - }, - "include": [ - "src/**/*.ts" - ] -} diff --git a/sdk/batch/arm-batch/src/api/application/index.ts b/sdk/batch/arm-batch/src/api/application/index.ts new file mode 100644 index 000000000000..8bdb71c1279d --- /dev/null +++ b/sdk/batch/arm-batch/src/api/application/index.ts @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { list, $delete, update, create, get } from "./operations.js"; +export { + ApplicationListOptionalParams, + ApplicationDeleteOptionalParams, + ApplicationUpdateOptionalParams, + ApplicationCreateOptionalParams, + ApplicationGetOptionalParams, +} from "./options.js"; diff --git a/sdk/batch/arm-batch/src/api/application/operations.ts b/sdk/batch/arm-batch/src/api/application/operations.ts new file mode 100644 index 000000000000..dcb44307f86d --- /dev/null +++ b/sdk/batch/arm-batch/src/api/application/operations.ts @@ -0,0 +1,322 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BatchManagementContext as Client } from "../index.js"; +import { + cloudErrorDeserializer, + Application, + applicationSerializer, + applicationDeserializer, + _ListApplicationsResult, + _listApplicationsResultDeserializer, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + ApplicationListOptionalParams, + ApplicationDeleteOptionalParams, + ApplicationUpdateOptionalParams, + ApplicationCreateOptionalParams, + ApplicationGetOptionalParams, +} from "./options.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; + +export function _listSend( + context: Client, + resourceGroupName: string, + accountName: string, + options: ApplicationListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications{?api%2Dversion,maxresults}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + accountName: accountName, + "api%2Dversion": context.apiVersion ?? "2025-06-01", + maxresults: options?.maxresults, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listDeserialize( + result: PathUncheckedResponse, +): Promise<_ListApplicationsResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _listApplicationsResultDeserializer(result.body); +} + +/** Lists all of the applications in the specified account. */ +export function list( + context: Client, + resourceGroupName: string, + accountName: string, + options: ApplicationListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, resourceGroupName, accountName, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-06-01" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + accountName: string, + applicationName: string, + options: ApplicationDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + accountName: accountName, + applicationName: applicationName, + "api%2Dversion": context.apiVersion ?? "2025-06-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Deletes an application. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export async function $delete( + context: Client, + resourceGroupName: string, + accountName: string, + applicationName: string, + options: ApplicationDeleteOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _$deleteSend( + context, + resourceGroupName, + accountName, + applicationName, + options, + ); + return _$deleteDeserialize(result); +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + accountName: string, + applicationName: string, + parameters: Application, + options: ApplicationUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + accountName: accountName, + applicationName: applicationName, + "api%2Dversion": context.apiVersion ?? "2025-06-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: applicationSerializer(parameters), + }); +} + +export async function _updateDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return applicationDeserializer(result.body); +} + +/** Updates settings for the specified application. */ +export async function update( + context: Client, + resourceGroupName: string, + accountName: string, + applicationName: string, + parameters: Application, + options: ApplicationUpdateOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _updateSend( + context, + resourceGroupName, + accountName, + applicationName, + parameters, + options, + ); + return _updateDeserialize(result); +} + +export function _createSend( + context: Client, + resourceGroupName: string, + accountName: string, + applicationName: string, + options: ApplicationCreateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + accountName: accountName, + applicationName: applicationName, + "api%2Dversion": context.apiVersion ?? "2025-06-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: !options["parameters"] + ? options["parameters"] + : applicationSerializer(options["parameters"]), + }); +} + +export async function _createDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return applicationDeserializer(result.body); +} + +/** Adds an application to the specified Batch account. */ +export async function create( + context: Client, + resourceGroupName: string, + accountName: string, + applicationName: string, + options: ApplicationCreateOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _createSend( + context, + resourceGroupName, + accountName, + applicationName, + options, + ); + return _createDeserialize(result); +} + +export function _getSend( + context: Client, + resourceGroupName: string, + accountName: string, + applicationName: string, + options: ApplicationGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + accountName: accountName, + applicationName: applicationName, + "api%2Dversion": context.apiVersion ?? "2025-06-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return applicationDeserializer(result.body); +} + +/** Gets information about the specified application. */ +export async function get( + context: Client, + resourceGroupName: string, + accountName: string, + applicationName: string, + options: ApplicationGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceGroupName, accountName, applicationName, options); + return _getDeserialize(result); +} diff --git a/sdk/batch/arm-batch/src/api/application/options.ts b/sdk/batch/arm-batch/src/api/application/options.ts new file mode 100644 index 000000000000..158ec1db1c36 --- /dev/null +++ b/sdk/batch/arm-batch/src/api/application/options.ts @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { Application } from "../../models/models.js"; +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface ApplicationListOptionalParams extends OperationOptions { + /** The maximum number of items to return in the response. */ + maxresults?: number; +} + +/** Optional parameters. */ +export interface ApplicationDeleteOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface ApplicationUpdateOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface ApplicationCreateOptionalParams extends OperationOptions { + /** The parameters for the request. */ + parameters?: Application; +} + +/** Optional parameters. */ +export interface ApplicationGetOptionalParams extends OperationOptions {} diff --git a/sdk/batch/arm-batch/src/api/applicationPackage/index.ts b/sdk/batch/arm-batch/src/api/applicationPackage/index.ts new file mode 100644 index 000000000000..f1f17bdc1b81 --- /dev/null +++ b/sdk/batch/arm-batch/src/api/applicationPackage/index.ts @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { activate, list, $delete, create, get } from "./operations.js"; +export { + ApplicationPackageActivateOptionalParams, + ApplicationPackageListOptionalParams, + ApplicationPackageDeleteOptionalParams, + ApplicationPackageCreateOptionalParams, + ApplicationPackageGetOptionalParams, +} from "./options.js"; diff --git a/sdk/batch/arm-batch/src/api/applicationPackage/operations.ts b/sdk/batch/arm-batch/src/api/applicationPackage/operations.ts new file mode 100644 index 000000000000..e4ab68d80f4e --- /dev/null +++ b/sdk/batch/arm-batch/src/api/applicationPackage/operations.ts @@ -0,0 +1,353 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BatchManagementContext as Client } from "../index.js"; +import { + cloudErrorDeserializer, + ApplicationPackage, + applicationPackageSerializer, + applicationPackageDeserializer, + _ListApplicationPackagesResult, + _listApplicationPackagesResultDeserializer, + ActivateApplicationPackageParameters, + activateApplicationPackageParametersSerializer, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + ApplicationPackageActivateOptionalParams, + ApplicationPackageListOptionalParams, + ApplicationPackageDeleteOptionalParams, + ApplicationPackageCreateOptionalParams, + ApplicationPackageGetOptionalParams, +} from "./options.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; + +export function _activateSend( + context: Client, + resourceGroupName: string, + accountName: string, + applicationName: string, + versionName: string, + parameters: ActivateApplicationPackageParameters, + options: ApplicationPackageActivateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}/versions/{versionName}/activate{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + accountName: accountName, + applicationName: applicationName, + versionName: versionName, + "api%2Dversion": context.apiVersion ?? "2025-06-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: activateApplicationPackageParametersSerializer(parameters), + }); +} + +export async function _activateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return applicationPackageDeserializer(result.body); +} + +/** 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. */ +export async function activate( + context: Client, + resourceGroupName: string, + accountName: string, + applicationName: string, + versionName: string, + parameters: ActivateApplicationPackageParameters, + options: ApplicationPackageActivateOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _activateSend( + context, + resourceGroupName, + accountName, + applicationName, + versionName, + parameters, + options, + ); + return _activateDeserialize(result); +} + +export function _listSend( + context: Client, + resourceGroupName: string, + accountName: string, + applicationName: string, + options: ApplicationPackageListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}/versions{?api%2Dversion,maxresults}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + accountName: accountName, + applicationName: applicationName, + "api%2Dversion": context.apiVersion ?? "2025-06-01", + maxresults: options?.maxresults, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listDeserialize( + result: PathUncheckedResponse, +): Promise<_ListApplicationPackagesResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _listApplicationPackagesResultDeserializer(result.body); +} + +/** Lists all of the application packages in the specified application. */ +export function list( + context: Client, + resourceGroupName: string, + accountName: string, + applicationName: string, + options: ApplicationPackageListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, resourceGroupName, accountName, applicationName, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-06-01" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + accountName: string, + applicationName: string, + versionName: string, + options: ApplicationPackageDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}/versions/{versionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + accountName: accountName, + applicationName: applicationName, + versionName: versionName, + "api%2Dversion": context.apiVersion ?? "2025-06-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Deletes an application package record and its associated binary file. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export async function $delete( + context: Client, + resourceGroupName: string, + accountName: string, + applicationName: string, + versionName: string, + options: ApplicationPackageDeleteOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _$deleteSend( + context, + resourceGroupName, + accountName, + applicationName, + versionName, + options, + ); + return _$deleteDeserialize(result); +} + +export function _createSend( + context: Client, + resourceGroupName: string, + accountName: string, + applicationName: string, + versionName: string, + options: ApplicationPackageCreateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}/versions/{versionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + accountName: accountName, + applicationName: applicationName, + versionName: versionName, + "api%2Dversion": context.apiVersion ?? "2025-06-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: !options["parameters"] + ? options["parameters"] + : applicationPackageSerializer(options["parameters"]), + }); +} + +export async function _createDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return applicationPackageDeserializer(result.body); +} + +/** 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. */ +export async function create( + context: Client, + resourceGroupName: string, + accountName: string, + applicationName: string, + versionName: string, + options: ApplicationPackageCreateOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _createSend( + context, + resourceGroupName, + accountName, + applicationName, + versionName, + options, + ); + return _createDeserialize(result); +} + +export function _getSend( + context: Client, + resourceGroupName: string, + accountName: string, + applicationName: string, + versionName: string, + options: ApplicationPackageGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}/versions/{versionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + accountName: accountName, + applicationName: applicationName, + versionName: versionName, + "api%2Dversion": context.apiVersion ?? "2025-06-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return applicationPackageDeserializer(result.body); +} + +/** Gets information about the specified application package. */ +export async function get( + context: Client, + resourceGroupName: string, + accountName: string, + applicationName: string, + versionName: string, + options: ApplicationPackageGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend( + context, + resourceGroupName, + accountName, + applicationName, + versionName, + options, + ); + return _getDeserialize(result); +} diff --git a/sdk/batch/arm-batch/src/api/applicationPackage/options.ts b/sdk/batch/arm-batch/src/api/applicationPackage/options.ts new file mode 100644 index 000000000000..7ea770491344 --- /dev/null +++ b/sdk/batch/arm-batch/src/api/applicationPackage/options.ts @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { ApplicationPackage } from "../../models/models.js"; +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface ApplicationPackageActivateOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface ApplicationPackageListOptionalParams extends OperationOptions { + /** The maximum number of items to return in the response. */ + maxresults?: number; +} + +/** Optional parameters. */ +export interface ApplicationPackageDeleteOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface ApplicationPackageCreateOptionalParams extends OperationOptions { + /** The parameters for the request. */ + parameters?: ApplicationPackage; +} + +/** Optional parameters. */ +export interface ApplicationPackageGetOptionalParams extends OperationOptions {} diff --git a/sdk/batch/arm-batch/src/api/batchAccount/index.ts b/sdk/batch/arm-batch/src/api/batchAccount/index.ts new file mode 100644 index 000000000000..76c746be2699 --- /dev/null +++ b/sdk/batch/arm-batch/src/api/batchAccount/index.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + listDetectors, + getDetector, + listOutboundNetworkDependenciesEndpoints, + getKeys, + regenerateKey, + synchronizeAutoStorageKeys, + list, + listByResourceGroup, + $delete, + update, + create, + get, +} from "./operations.js"; +export { + BatchAccountListDetectorsOptionalParams, + BatchAccountGetDetectorOptionalParams, + BatchAccountListOutboundNetworkDependenciesEndpointsOptionalParams, + BatchAccountGetKeysOptionalParams, + BatchAccountRegenerateKeyOptionalParams, + BatchAccountSynchronizeAutoStorageKeysOptionalParams, + BatchAccountListOptionalParams, + BatchAccountListByResourceGroupOptionalParams, + BatchAccountDeleteOptionalParams, + BatchAccountUpdateOptionalParams, + BatchAccountCreateOptionalParams, + BatchAccountGetOptionalParams, +} from "./options.js"; diff --git a/sdk/batch/arm-batch/src/api/batchAccount/operations.ts b/sdk/batch/arm-batch/src/api/batchAccount/operations.ts new file mode 100644 index 000000000000..aa8ba4d1b988 --- /dev/null +++ b/sdk/batch/arm-batch/src/api/batchAccount/operations.ts @@ -0,0 +1,716 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BatchManagementContext as Client } from "../index.js"; +import { + cloudErrorDeserializer, + BatchAccount, + batchAccountDeserializer, + BatchAccountCreateParameters, + batchAccountCreateParametersSerializer, + BatchAccountUpdateParameters, + batchAccountUpdateParametersSerializer, + _BatchAccountListResult, + _batchAccountListResultDeserializer, + BatchAccountRegenerateKeyParameters, + batchAccountRegenerateKeyParametersSerializer, + BatchAccountKeys, + batchAccountKeysDeserializer, + _OutboundEnvironmentEndpointCollection, + _outboundEnvironmentEndpointCollectionDeserializer, + OutboundEnvironmentEndpoint, + DetectorResponse, + detectorResponseDeserializer, + _DetectorListResult, + _detectorListResultDeserializer, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + BatchAccountListDetectorsOptionalParams, + BatchAccountGetDetectorOptionalParams, + BatchAccountListOutboundNetworkDependenciesEndpointsOptionalParams, + BatchAccountGetKeysOptionalParams, + BatchAccountRegenerateKeyOptionalParams, + BatchAccountSynchronizeAutoStorageKeysOptionalParams, + BatchAccountListOptionalParams, + BatchAccountListByResourceGroupOptionalParams, + BatchAccountDeleteOptionalParams, + BatchAccountUpdateOptionalParams, + BatchAccountCreateOptionalParams, + BatchAccountGetOptionalParams, +} from "./options.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +export function _listDetectorsSend( + context: Client, + resourceGroupName: string, + accountName: string, + options: BatchAccountListDetectorsOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/detectors{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + accountName: accountName, + "api%2Dversion": context.apiVersion ?? "2025-06-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listDetectorsDeserialize( + result: PathUncheckedResponse, +): Promise<_DetectorListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _detectorListResultDeserializer(result.body); +} + +/** Gets information about the detectors available for a given Batch account. */ +export function listDetectors( + context: Client, + resourceGroupName: string, + accountName: string, + options: BatchAccountListDetectorsOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listDetectorsSend(context, resourceGroupName, accountName, options), + _listDetectorsDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-06-01" }, + ); +} + +export function _getDetectorSend( + context: Client, + resourceGroupName: string, + accountName: string, + detectorId: string, + options: BatchAccountGetDetectorOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/detectors/{detectorId}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + accountName: accountName, + detectorId: detectorId, + "api%2Dversion": context.apiVersion ?? "2025-06-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getDetectorDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return detectorResponseDeserializer(result.body); +} + +/** Gets information about the given detector for a given Batch account. */ +export async function getDetector( + context: Client, + resourceGroupName: string, + accountName: string, + detectorId: string, + options: BatchAccountGetDetectorOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getDetectorSend( + context, + resourceGroupName, + accountName, + detectorId, + options, + ); + return _getDetectorDeserialize(result); +} + +export function _listOutboundNetworkDependenciesEndpointsSend( + context: Client, + resourceGroupName: string, + accountName: string, + options: BatchAccountListOutboundNetworkDependenciesEndpointsOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/outboundNetworkDependenciesEndpoints{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + accountName: accountName, + "api%2Dversion": context.apiVersion ?? "2025-06-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listOutboundNetworkDependenciesEndpointsDeserialize( + result: PathUncheckedResponse, +): Promise<_OutboundEnvironmentEndpointCollection> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _outboundEnvironmentEndpointCollectionDeserializer(result.body); +} + +/** 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://learn.microsoft.com/azure/batch/batch-virtual-network. */ +export function listOutboundNetworkDependenciesEndpoints( + context: Client, + resourceGroupName: string, + accountName: string, + options: BatchAccountListOutboundNetworkDependenciesEndpointsOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => + _listOutboundNetworkDependenciesEndpointsSend( + context, + resourceGroupName, + accountName, + options, + ), + _listOutboundNetworkDependenciesEndpointsDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-06-01" }, + ); +} + +export function _getKeysSend( + context: Client, + resourceGroupName: string, + accountName: string, + options: BatchAccountGetKeysOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/listKeys{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + accountName: accountName, + "api%2Dversion": context.apiVersion ?? "2025-06-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .post({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getKeysDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return batchAccountKeysDeserializer(result.body); +} + +/** 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. */ +export async function getKeys( + context: Client, + resourceGroupName: string, + accountName: string, + options: BatchAccountGetKeysOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getKeysSend(context, resourceGroupName, accountName, options); + return _getKeysDeserialize(result); +} + +export function _regenerateKeySend( + context: Client, + resourceGroupName: string, + accountName: string, + parameters: BatchAccountRegenerateKeyParameters, + options: BatchAccountRegenerateKeyOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/regenerateKeys{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + accountName: accountName, + "api%2Dversion": context.apiVersion ?? "2025-06-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: batchAccountRegenerateKeyParametersSerializer(parameters), + }); +} + +export async function _regenerateKeyDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return batchAccountKeysDeserializer(result.body); +} + +/** 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. */ +export async function regenerateKey( + context: Client, + resourceGroupName: string, + accountName: string, + parameters: BatchAccountRegenerateKeyParameters, + options: BatchAccountRegenerateKeyOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _regenerateKeySend( + context, + resourceGroupName, + accountName, + parameters, + options, + ); + return _regenerateKeyDeserialize(result); +} + +export function _synchronizeAutoStorageKeysSend( + context: Client, + resourceGroupName: string, + accountName: string, + options: BatchAccountSynchronizeAutoStorageKeysOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/syncAutoStorageKeys{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + accountName: accountName, + "api%2Dversion": context.apiVersion ?? "2025-06-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _synchronizeAutoStorageKeysDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Synchronizes access keys for the auto-storage account configured for the specified Batch account, only if storage key authentication is being used. */ +export async function synchronizeAutoStorageKeys( + context: Client, + resourceGroupName: string, + accountName: string, + options: BatchAccountSynchronizeAutoStorageKeysOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _synchronizeAutoStorageKeysSend( + context, + resourceGroupName, + accountName, + options, + ); + return _synchronizeAutoStorageKeysDeserialize(result); +} + +export function _listSend( + context: Client, + options: BatchAccountListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Batch/batchAccounts{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion ?? "2025-06-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listDeserialize( + result: PathUncheckedResponse, +): Promise<_BatchAccountListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _batchAccountListResultDeserializer(result.body); +} + +/** Gets information about the Batch accounts associated with the subscription. */ +export function list( + context: Client, + options: BatchAccountListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-06-01" }, + ); +} + +export function _listByResourceGroupSend( + context: Client, + resourceGroupName: string, + options: BatchAccountListByResourceGroupOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + "api%2Dversion": context.apiVersion ?? "2025-06-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listByResourceGroupDeserialize( + result: PathUncheckedResponse, +): Promise<_BatchAccountListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _batchAccountListResultDeserializer(result.body); +} + +/** Gets information about the Batch accounts associated with the specified resource group. */ +export function listByResourceGroup( + context: Client, + resourceGroupName: string, + options: BatchAccountListByResourceGroupOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByResourceGroupSend(context, resourceGroupName, options), + _listByResourceGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-06-01" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + accountName: string, + options: BatchAccountDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + accountName: accountName, + "api%2Dversion": context.apiVersion ?? "2025-06-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Deletes the specified Batch account. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export function $delete( + context: Client, + resourceGroupName: string, + accountName: string, + options: BatchAccountDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["200", "202", "204"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _$deleteSend(context, resourceGroupName, accountName, options), + resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2025-06-01", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + accountName: string, + parameters: BatchAccountUpdateParameters, + options: BatchAccountUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + accountName: accountName, + "api%2Dversion": context.apiVersion ?? "2025-06-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: batchAccountUpdateParametersSerializer(parameters), + }); +} + +export async function _updateDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return batchAccountDeserializer(result.body); +} + +/** Updates the properties of an existing Batch account. */ +export async function update( + context: Client, + resourceGroupName: string, + accountName: string, + parameters: BatchAccountUpdateParameters, + options: BatchAccountUpdateOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _updateSend(context, resourceGroupName, accountName, parameters, options); + return _updateDeserialize(result); +} + +export function _createSend( + context: Client, + resourceGroupName: string, + accountName: string, + parameters: BatchAccountCreateParameters, + options: BatchAccountCreateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + accountName: accountName, + "api%2Dversion": context.apiVersion ?? "2025-06-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: batchAccountCreateParametersSerializer(parameters), + }); +} + +export async function _createDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return batchAccountDeserializer(result.body); +} + +/** 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. */ +export function create( + context: Client, + resourceGroupName: string, + accountName: string, + parameters: BatchAccountCreateParameters, + options: BatchAccountCreateOptionalParams = { requestOptions: {} }, +): PollerLike, BatchAccount> { + return getLongRunningPoller(context, _createDeserialize, ["200", "202", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createSend(context, resourceGroupName, accountName, parameters, options), + resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2025-06-01", + }) as PollerLike, BatchAccount>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + accountName: string, + options: BatchAccountGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + accountName: accountName, + "api%2Dversion": context.apiVersion ?? "2025-06-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return batchAccountDeserializer(result.body); +} + +/** Gets information about the specified Batch account. */ +export async function get( + context: Client, + resourceGroupName: string, + accountName: string, + options: BatchAccountGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceGroupName, accountName, options); + return _getDeserialize(result); +} diff --git a/sdk/batch/arm-batch/src/api/batchAccount/options.ts b/sdk/batch/arm-batch/src/api/batchAccount/options.ts new file mode 100644 index 000000000000..13a812036b77 --- /dev/null +++ b/sdk/batch/arm-batch/src/api/batchAccount/options.ts @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface BatchAccountListDetectorsOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface BatchAccountGetDetectorOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface BatchAccountListOutboundNetworkDependenciesEndpointsOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface BatchAccountGetKeysOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface BatchAccountRegenerateKeyOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface BatchAccountSynchronizeAutoStorageKeysOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface BatchAccountListOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface BatchAccountListByResourceGroupOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface BatchAccountDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface BatchAccountUpdateOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface BatchAccountCreateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface BatchAccountGetOptionalParams extends OperationOptions {} diff --git a/sdk/batch/arm-batch/src/api/batchManagementContext.ts b/sdk/batch/arm-batch/src/api/batchManagementContext.ts new file mode 100644 index 000000000000..550366c9a0ef --- /dev/null +++ b/sdk/batch/arm-batch/src/api/batchManagementContext.ts @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { logger } from "../logger.js"; +import { KnownVersions } from "../models/models.js"; +import { AzureSupportedClouds, getArmEndpoint } from "../static-helpers/cloudSettingHelpers.js"; +import { Client, ClientOptions, getClient } from "@azure-rest/core-client"; +import { TokenCredential } from "@azure/core-auth"; + +/** The Batch Management Client. */ +export interface BatchManagementContext extends Client { + /** The ID of the target subscription. The value must be an UUID. */ + subscriptionId: string; + /** The API version to use for this operation. */ + /** Known values of {@link KnownVersions} that the service accepts. */ + apiVersion?: string; +} + +/** Optional parameters for the client. */ +export interface BatchManagementClientOptionalParams extends ClientOptions { + /** The API version to use for this operation. */ + /** Known values of {@link KnownVersions} that the service accepts. */ + apiVersion?: string; + /** Specifies the Azure cloud environment for the client. */ + cloudSetting?: AzureSupportedClouds; +} + +/** The Batch Management Client. */ +export function createBatchManagement( + credential: TokenCredential, + subscriptionId: string, + options: BatchManagementClientOptionalParams = {}, +): BatchManagementContext { + const endpointUrl = + options.endpoint ?? getArmEndpoint(options.cloudSetting) ?? "https://management.azure.com"; + const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix; + const userAgentInfo = `azsdk-js-arm-batch/1.0.0-beta.1`; + const userAgentPrefix = prefixFromOptions + ? `${prefixFromOptions} azsdk-js-api ${userAgentInfo}` + : `azsdk-js-api ${userAgentInfo}`; + const { apiVersion: _, ...updatedOptions } = { + ...options, + userAgentOptions: { userAgentPrefix }, + loggingOptions: { logger: options.loggingOptions?.logger ?? logger.info }, + credentials: { scopes: options.credentials?.scopes ?? [`${endpointUrl}/.default`] }, + }; + const clientContext = getClient(endpointUrl, credential, updatedOptions); + const apiVersion = options.apiVersion; + return { ...clientContext, apiVersion, subscriptionId } as BatchManagementContext; +} diff --git a/sdk/batch/arm-batch/src/api/index.ts b/sdk/batch/arm-batch/src/api/index.ts new file mode 100644 index 000000000000..dd322b223413 --- /dev/null +++ b/sdk/batch/arm-batch/src/api/index.ts @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + createBatchManagement, + BatchManagementContext, + BatchManagementClientOptionalParams, +} from "./batchManagementContext.js"; diff --git a/sdk/batch/arm-batch/src/api/location/index.ts b/sdk/batch/arm-batch/src/api/location/index.ts new file mode 100644 index 000000000000..715327284bd6 --- /dev/null +++ b/sdk/batch/arm-batch/src/api/location/index.ts @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { checkNameAvailability, listSupportedVirtualMachineSkus, getQuotas } from "./operations.js"; +export { + LocationCheckNameAvailabilityOptionalParams, + LocationListSupportedVirtualMachineSkusOptionalParams, + LocationGetQuotasOptionalParams, +} from "./options.js"; diff --git a/sdk/batch/arm-batch/src/api/location/operations.ts b/sdk/batch/arm-batch/src/api/location/operations.ts new file mode 100644 index 000000000000..91512cbba927 --- /dev/null +++ b/sdk/batch/arm-batch/src/api/location/operations.ts @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BatchManagementContext as Client } from "../index.js"; +import { + cloudErrorDeserializer, + BatchLocationQuota, + batchLocationQuotaDeserializer, + _SupportedSkusResult, + _supportedSkusResultDeserializer, + SupportedSku, + CheckNameAvailabilityParameters, + checkNameAvailabilityParametersSerializer, + CheckNameAvailabilityResult, + checkNameAvailabilityResultDeserializer, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + LocationCheckNameAvailabilityOptionalParams, + LocationListSupportedVirtualMachineSkusOptionalParams, + LocationGetQuotasOptionalParams, +} from "./options.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; + +export function _checkNameAvailabilitySend( + context: Client, + locationName: string, + parameters: CheckNameAvailabilityParameters, + options: LocationCheckNameAvailabilityOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Batch/locations/{locationName}/checkNameAvailability{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + locationName: locationName, + "api%2Dversion": context.apiVersion ?? "2025-06-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: checkNameAvailabilityParametersSerializer(parameters), + }); +} + +export async function _checkNameAvailabilityDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return checkNameAvailabilityResultDeserializer(result.body); +} + +/** Checks whether the Batch account name is available in the specified region. */ +export async function checkNameAvailability( + context: Client, + locationName: string, + parameters: CheckNameAvailabilityParameters, + options: LocationCheckNameAvailabilityOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _checkNameAvailabilitySend(context, locationName, parameters, options); + return _checkNameAvailabilityDeserialize(result); +} + +export function _listSupportedVirtualMachineSkusSend( + context: Client, + locationName: string, + options: LocationListSupportedVirtualMachineSkusOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Batch/locations/{locationName}/virtualMachineSkus{?api%2Dversion,maxresults,%24filter}", + { + subscriptionId: context.subscriptionId, + locationName: locationName, + "api%2Dversion": context.apiVersion ?? "2025-06-01", + maxresults: options?.maxresults, + "%24filter": options?.filter, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listSupportedVirtualMachineSkusDeserialize( + result: PathUncheckedResponse, +): Promise<_SupportedSkusResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _supportedSkusResultDeserializer(result.body); +} + +/** Gets the list of Batch supported Virtual Machine VM sizes available at the given location. */ +export function listSupportedVirtualMachineSkus( + context: Client, + locationName: string, + options: LocationListSupportedVirtualMachineSkusOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSupportedVirtualMachineSkusSend(context, locationName, options), + _listSupportedVirtualMachineSkusDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-06-01" }, + ); +} + +export function _getQuotasSend( + context: Client, + locationName: string, + options: LocationGetQuotasOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Batch/locations/{locationName}/quotas{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + locationName: locationName, + "api%2Dversion": context.apiVersion ?? "2025-06-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getQuotasDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return batchLocationQuotaDeserializer(result.body); +} + +/** Gets the Batch service quotas for the specified subscription at the given location. */ +export async function getQuotas( + context: Client, + locationName: string, + options: LocationGetQuotasOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getQuotasSend(context, locationName, options); + return _getQuotasDeserialize(result); +} diff --git a/sdk/batch/arm-batch/src/api/location/options.ts b/sdk/batch/arm-batch/src/api/location/options.ts new file mode 100644 index 000000000000..71129187a026 --- /dev/null +++ b/sdk/batch/arm-batch/src/api/location/options.ts @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface LocationCheckNameAvailabilityOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface LocationListSupportedVirtualMachineSkusOptionalParams extends OperationOptions { + /** The maximum number of items to return in the response. */ + maxresults?: number; + /** OData filter expression. Valid properties for filtering are "familyName". */ + filter?: string; +} + +/** Optional parameters. */ +export interface LocationGetQuotasOptionalParams extends OperationOptions {} diff --git a/sdk/batch/arm-batch/src/api/networkSecurityPerimeter/index.ts b/sdk/batch/arm-batch/src/api/networkSecurityPerimeter/index.ts new file mode 100644 index 000000000000..f3e0a15d4238 --- /dev/null +++ b/sdk/batch/arm-batch/src/api/networkSecurityPerimeter/index.ts @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { reconcileConfiguration, listConfigurations, getConfiguration } from "./operations.js"; +export { + NetworkSecurityPerimeterReconcileConfigurationOptionalParams, + NetworkSecurityPerimeterListConfigurationsOptionalParams, + NetworkSecurityPerimeterGetConfigurationOptionalParams, +} from "./options.js"; diff --git a/sdk/batch/arm-batch/src/api/networkSecurityPerimeter/operations.ts b/sdk/batch/arm-batch/src/api/networkSecurityPerimeter/operations.ts new file mode 100644 index 000000000000..f9cb841904a2 --- /dev/null +++ b/sdk/batch/arm-batch/src/api/networkSecurityPerimeter/operations.ts @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BatchManagementContext as Client } from "../index.js"; +import { + cloudErrorDeserializer, + NetworkSecurityPerimeterConfiguration, + networkSecurityPerimeterConfigurationDeserializer, + _NetworkSecurityPerimeterConfigurationListResult, + _networkSecurityPerimeterConfigurationListResultDeserializer, + errorResponseDeserializer, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + NetworkSecurityPerimeterReconcileConfigurationOptionalParams, + NetworkSecurityPerimeterListConfigurationsOptionalParams, + NetworkSecurityPerimeterGetConfigurationOptionalParams, +} from "./options.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +export function _reconcileConfigurationSend( + context: Client, + resourceGroupName: string, + accountName: string, + networkSecurityPerimeterConfigurationName: string, + options: NetworkSecurityPerimeterReconcileConfigurationOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}/reconcile{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + accountName: accountName, + networkSecurityPerimeterConfigurationName: networkSecurityPerimeterConfigurationName, + "api%2Dversion": context.apiVersion ?? "2025-06-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _reconcileConfigurationDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["202", "200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + + throw error; + } + + return; +} + +/** Reconciles the specified NSP configuration. */ +export function reconcileConfiguration( + context: Client, + resourceGroupName: string, + accountName: string, + networkSecurityPerimeterConfigurationName: string, + options: NetworkSecurityPerimeterReconcileConfigurationOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _reconcileConfigurationDeserialize, ["202", "200", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _reconcileConfigurationSend( + context, + resourceGroupName, + accountName, + networkSecurityPerimeterConfigurationName, + options, + ), + resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2025-06-01", + }) as PollerLike, void>; +} + +export function _listConfigurationsSend( + context: Client, + resourceGroupName: string, + accountName: string, + options: NetworkSecurityPerimeterListConfigurationsOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/networkSecurityPerimeterConfigurations{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + accountName: accountName, + "api%2Dversion": context.apiVersion ?? "2025-06-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listConfigurationsDeserialize( + result: PathUncheckedResponse, +): Promise<_NetworkSecurityPerimeterConfigurationListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _networkSecurityPerimeterConfigurationListResultDeserializer(result.body); +} + +/** Lists all of the NSP configurations in the specified account. */ +export function listConfigurations( + context: Client, + resourceGroupName: string, + accountName: string, + options: NetworkSecurityPerimeterListConfigurationsOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listConfigurationsSend(context, resourceGroupName, accountName, options), + _listConfigurationsDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-06-01" }, + ); +} + +export function _getConfigurationSend( + context: Client, + resourceGroupName: string, + accountName: string, + networkSecurityPerimeterConfigurationName: string, + options: NetworkSecurityPerimeterGetConfigurationOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + accountName: accountName, + networkSecurityPerimeterConfigurationName: networkSecurityPerimeterConfigurationName, + "api%2Dversion": context.apiVersion ?? "2025-06-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getConfigurationDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return networkSecurityPerimeterConfigurationDeserializer(result.body); +} + +/** Gets information about the specified NSP configuration. */ +export async function getConfiguration( + context: Client, + resourceGroupName: string, + accountName: string, + networkSecurityPerimeterConfigurationName: string, + options: NetworkSecurityPerimeterGetConfigurationOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getConfigurationSend( + context, + resourceGroupName, + accountName, + networkSecurityPerimeterConfigurationName, + options, + ); + return _getConfigurationDeserialize(result); +} diff --git a/sdk/batch/arm-batch/src/api/networkSecurityPerimeter/options.ts b/sdk/batch/arm-batch/src/api/networkSecurityPerimeter/options.ts new file mode 100644 index 000000000000..94f46a0cc525 --- /dev/null +++ b/sdk/batch/arm-batch/src/api/networkSecurityPerimeter/options.ts @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface NetworkSecurityPerimeterReconcileConfigurationOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface NetworkSecurityPerimeterListConfigurationsOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface NetworkSecurityPerimeterGetConfigurationOptionalParams extends OperationOptions {} diff --git a/sdk/batch/arm-batch/src/api/operations/index.ts b/sdk/batch/arm-batch/src/api/operations/index.ts new file mode 100644 index 000000000000..24a804d14fcf --- /dev/null +++ b/sdk/batch/arm-batch/src/api/operations/index.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { list } from "./operations.js"; +export { OperationsListOptionalParams } from "./options.js"; diff --git a/sdk/batch/arm-batch/src/api/operations/operations.ts b/sdk/batch/arm-batch/src/api/operations/operations.ts new file mode 100644 index 000000000000..9cb8873e96c2 --- /dev/null +++ b/sdk/batch/arm-batch/src/api/operations/operations.ts @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BatchManagementContext as Client } from "../index.js"; +import { + _OperationListResult, + _operationListResultDeserializer, + Operation, + cloudErrorDeserializer, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { OperationsListOptionalParams } from "./options.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; + +export function _listSend( + context: Client, + options: OperationsListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/providers/Microsoft.Batch/operations{?api%2Dversion}", + { + "api%2Dversion": context.apiVersion ?? "2025-06-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listDeserialize( + result: PathUncheckedResponse, +): Promise<_OperationListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _operationListResultDeserializer(result.body); +} + +/** Lists available operations for the Microsoft.Batch provider */ +export function list( + context: Client, + options: OperationsListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-06-01" }, + ); +} diff --git a/sdk/batch/arm-batch/src/api/operations/options.ts b/sdk/batch/arm-batch/src/api/operations/options.ts new file mode 100644 index 000000000000..c461016ad1c5 --- /dev/null +++ b/sdk/batch/arm-batch/src/api/operations/options.ts @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface OperationsListOptionalParams extends OperationOptions {} diff --git a/sdk/batch/arm-batch/src/api/pool/index.ts b/sdk/batch/arm-batch/src/api/pool/index.ts new file mode 100644 index 000000000000..b5bcfbdb2ddd --- /dev/null +++ b/sdk/batch/arm-batch/src/api/pool/index.ts @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + stopResize, + disableAutoScale, + listByBatchAccount, + $delete, + update, + create, + get, +} from "./operations.js"; +export { + PoolStopResizeOptionalParams, + PoolDisableAutoScaleOptionalParams, + PoolListByBatchAccountOptionalParams, + PoolDeleteOptionalParams, + PoolUpdateOptionalParams, + PoolCreateOptionalParams, + PoolGetOptionalParams, +} from "./options.js"; diff --git a/sdk/batch/arm-batch/src/api/pool/operations.ts b/sdk/batch/arm-batch/src/api/pool/operations.ts new file mode 100644 index 000000000000..66373a9123c8 --- /dev/null +++ b/sdk/batch/arm-batch/src/api/pool/operations.ts @@ -0,0 +1,448 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BatchManagementContext as Client } from "../index.js"; +import { + cloudErrorDeserializer, + Pool, + poolSerializer, + poolDeserializer, + _ListPoolsResult, + _listPoolsResultDeserializer, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + PoolStopResizeOptionalParams, + PoolDisableAutoScaleOptionalParams, + PoolListByBatchAccountOptionalParams, + PoolDeleteOptionalParams, + PoolUpdateOptionalParams, + PoolCreateOptionalParams, + PoolGetOptionalParams, +} from "./options.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +export function _stopResizeSend( + context: Client, + resourceGroupName: string, + accountName: string, + poolName: string, + options: PoolStopResizeOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName}/stopResize{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + accountName: accountName, + poolName: poolName, + "api%2Dversion": context.apiVersion ?? "2025-06-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .post({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _stopResizeDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return poolDeserializer(result.body); +} + +/** 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. */ +export async function stopResize( + context: Client, + resourceGroupName: string, + accountName: string, + poolName: string, + options: PoolStopResizeOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _stopResizeSend(context, resourceGroupName, accountName, poolName, options); + return _stopResizeDeserialize(result); +} + +export function _disableAutoScaleSend( + context: Client, + resourceGroupName: string, + accountName: string, + poolName: string, + options: PoolDisableAutoScaleOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName}/disableAutoScale{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + accountName: accountName, + poolName: poolName, + "api%2Dversion": context.apiVersion ?? "2025-06-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .post({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _disableAutoScaleDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return poolDeserializer(result.body); +} + +/** Disables automatic scaling for a pool. */ +export async function disableAutoScale( + context: Client, + resourceGroupName: string, + accountName: string, + poolName: string, + options: PoolDisableAutoScaleOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _disableAutoScaleSend( + context, + resourceGroupName, + accountName, + poolName, + options, + ); + return _disableAutoScaleDeserialize(result); +} + +export function _listByBatchAccountSend( + context: Client, + resourceGroupName: string, + accountName: string, + options: PoolListByBatchAccountOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools{?api%2Dversion,maxresults,%24select,%24filter}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + accountName: accountName, + "api%2Dversion": context.apiVersion ?? "2025-06-01", + maxresults: options?.maxresults, + "%24select": options?.select, + "%24filter": options?.filter, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listByBatchAccountDeserialize( + result: PathUncheckedResponse, +): Promise<_ListPoolsResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _listPoolsResultDeserializer(result.body); +} + +/** Lists all of the pools in the specified account. */ +export function listByBatchAccount( + context: Client, + resourceGroupName: string, + accountName: string, + options: PoolListByBatchAccountOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByBatchAccountSend(context, resourceGroupName, accountName, options), + _listByBatchAccountDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-06-01" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + accountName: string, + poolName: string, + options: PoolDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + accountName: accountName, + poolName: poolName, + "api%2Dversion": context.apiVersion ?? "2025-06-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Deletes the specified pool. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export function $delete( + context: Client, + resourceGroupName: string, + accountName: string, + poolName: string, + options: PoolDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["200", "202", "204"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend(context, resourceGroupName, accountName, poolName, options), + resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2025-06-01", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + accountName: string, + poolName: string, + parameters: Pool, + options: PoolUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + accountName: accountName, + poolName: poolName, + "api%2Dversion": context.apiVersion ?? "2025-06-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + ...(options?.ifMatch !== undefined ? { "if-match": options?.ifMatch } : {}), + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: poolSerializer(parameters), + }); +} + +export async function _updateDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return poolDeserializer(result.body); +} + +/** Updates the properties of an existing pool. */ +export async function update( + context: Client, + resourceGroupName: string, + accountName: string, + poolName: string, + parameters: Pool, + options: PoolUpdateOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _updateSend( + context, + resourceGroupName, + accountName, + poolName, + parameters, + options, + ); + return _updateDeserialize(result); +} + +export function _createSend( + context: Client, + resourceGroupName: string, + accountName: string, + poolName: string, + parameters: Pool, + options: PoolCreateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + accountName: accountName, + poolName: poolName, + "api%2Dversion": context.apiVersion ?? "2025-06-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + ...(options?.ifMatch !== undefined ? { "if-match": options?.ifMatch } : {}), + ...(options?.ifNoneMatch !== undefined ? { "if-none-match": options?.ifNoneMatch } : {}), + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: poolSerializer(parameters), + }); +} + +export async function _createDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return poolDeserializer(result.body); +} + +/** Creates a new pool inside the specified account. */ +export async function create( + context: Client, + resourceGroupName: string, + accountName: string, + poolName: string, + parameters: Pool, + options: PoolCreateOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _createSend( + context, + resourceGroupName, + accountName, + poolName, + parameters, + options, + ); + return _createDeserialize(result); +} + +export function _getSend( + context: Client, + resourceGroupName: string, + accountName: string, + poolName: string, + options: PoolGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + accountName: accountName, + poolName: poolName, + "api%2Dversion": context.apiVersion ?? "2025-06-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return poolDeserializer(result.body); +} + +/** Gets information about the specified pool. */ +export async function get( + context: Client, + resourceGroupName: string, + accountName: string, + poolName: string, + options: PoolGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceGroupName, accountName, poolName, options); + return _getDeserialize(result); +} diff --git a/sdk/batch/arm-batch/src/api/pool/options.ts b/sdk/batch/arm-batch/src/api/pool/options.ts new file mode 100644 index 000000000000..d58da669bf4f --- /dev/null +++ b/sdk/batch/arm-batch/src/api/pool/options.ts @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface PoolStopResizeOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface PoolDisableAutoScaleOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface PoolListByBatchAccountOptionalParams extends OperationOptions { + /** The maximum number of items to return in the response. */ + maxresults?: number; + /** 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; + /** + * 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; +} + +/** Optional parameters. */ +export interface PoolDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface PoolUpdateOptionalParams extends OperationOptions { + /** The entity state (ETag) version of the pool to update. This value can be omitted or set to "*" to apply the operation unconditionally. */ + ifMatch?: string; +} + +/** Optional parameters. */ +export interface PoolCreateOptionalParams extends OperationOptions { + /** The entity state (ETag) version of the pool to update. A value of "*" can be used to apply the operation only if the pool already exists. If omitted, this operation will always be applied. */ + ifMatch?: string; + /** Set to '*' to allow a new pool to be created, but to prevent updating an existing pool. Other values will be ignored. */ + ifNoneMatch?: string; +} + +/** Optional parameters. */ +export interface PoolGetOptionalParams extends OperationOptions {} diff --git a/sdk/batch/arm-batch/src/api/privateEndpointConnection/index.ts b/sdk/batch/arm-batch/src/api/privateEndpointConnection/index.ts new file mode 100644 index 000000000000..edda135e0c3b --- /dev/null +++ b/sdk/batch/arm-batch/src/api/privateEndpointConnection/index.ts @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { listByBatchAccount, $delete, update, get } from "./operations.js"; +export { + PrivateEndpointConnectionListByBatchAccountOptionalParams, + PrivateEndpointConnectionDeleteOptionalParams, + PrivateEndpointConnectionUpdateOptionalParams, + PrivateEndpointConnectionGetOptionalParams, +} from "./options.js"; diff --git a/sdk/batch/arm-batch/src/api/privateEndpointConnection/operations.ts b/sdk/batch/arm-batch/src/api/privateEndpointConnection/operations.ts new file mode 100644 index 000000000000..ea642d81aaf0 --- /dev/null +++ b/sdk/batch/arm-batch/src/api/privateEndpointConnection/operations.ts @@ -0,0 +1,281 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BatchManagementContext as Client } from "../index.js"; +import { + cloudErrorDeserializer, + PrivateEndpointConnection, + privateEndpointConnectionSerializer, + privateEndpointConnectionDeserializer, + _ListPrivateEndpointConnectionsResult, + _listPrivateEndpointConnectionsResultDeserializer, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + PrivateEndpointConnectionListByBatchAccountOptionalParams, + PrivateEndpointConnectionDeleteOptionalParams, + PrivateEndpointConnectionUpdateOptionalParams, + PrivateEndpointConnectionGetOptionalParams, +} from "./options.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +export function _listByBatchAccountSend( + context: Client, + resourceGroupName: string, + accountName: string, + options: PrivateEndpointConnectionListByBatchAccountOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/privateEndpointConnections{?api%2Dversion,maxresults}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + accountName: accountName, + "api%2Dversion": context.apiVersion ?? "2025-06-01", + maxresults: options?.maxresults, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listByBatchAccountDeserialize( + result: PathUncheckedResponse, +): Promise<_ListPrivateEndpointConnectionsResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _listPrivateEndpointConnectionsResultDeserializer(result.body); +} + +/** Lists all of the private endpoint connections in the specified account. */ +export function listByBatchAccount( + context: Client, + resourceGroupName: string, + accountName: string, + options: PrivateEndpointConnectionListByBatchAccountOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByBatchAccountSend(context, resourceGroupName, accountName, options), + _listByBatchAccountDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-06-01" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + accountName: string, + privateEndpointConnectionName: string, + options: PrivateEndpointConnectionDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + accountName: accountName, + privateEndpointConnectionName: privateEndpointConnectionName, + "api%2Dversion": context.apiVersion ?? "2025-06-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "204", "200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return; +} + +/** Deletes the specified private endpoint connection. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export function $delete( + context: Client, + resourceGroupName: string, + accountName: string, + privateEndpointConnectionName: string, + options: PrivateEndpointConnectionDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["202", "204", "200"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend(context, resourceGroupName, accountName, privateEndpointConnectionName, options), + resourceLocationConfig: "azure-async-operation", + apiVersion: context.apiVersion ?? "2025-06-01", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + accountName: string, + privateEndpointConnectionName: string, + parameters: PrivateEndpointConnection, + options: PrivateEndpointConnectionUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + accountName: accountName, + privateEndpointConnectionName: privateEndpointConnectionName, + "api%2Dversion": context.apiVersion ?? "2025-06-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + ...(options?.ifMatch !== undefined ? { "if-match": options?.ifMatch } : {}), + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: privateEndpointConnectionSerializer(parameters), + }); +} + +export async function _updateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "202", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return privateEndpointConnectionDeserializer(result.body); +} + +/** Updates the properties of an existing private endpoint connection. */ +export function update( + context: Client, + resourceGroupName: string, + accountName: string, + privateEndpointConnectionName: string, + parameters: PrivateEndpointConnection, + options: PrivateEndpointConnectionUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, PrivateEndpointConnection> { + return getLongRunningPoller(context, _updateDeserialize, ["200", "202", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _updateSend( + context, + resourceGroupName, + accountName, + privateEndpointConnectionName, + parameters, + options, + ), + resourceLocationConfig: "azure-async-operation", + apiVersion: context.apiVersion ?? "2025-06-01", + }) as PollerLike, PrivateEndpointConnection>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + accountName: string, + privateEndpointConnectionName: string, + options: PrivateEndpointConnectionGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + accountName: accountName, + privateEndpointConnectionName: privateEndpointConnectionName, + "api%2Dversion": context.apiVersion ?? "2025-06-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return privateEndpointConnectionDeserializer(result.body); +} + +/** Gets information about the specified private endpoint connection. */ +export async function get( + context: Client, + resourceGroupName: string, + accountName: string, + privateEndpointConnectionName: string, + options: PrivateEndpointConnectionGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend( + context, + resourceGroupName, + accountName, + privateEndpointConnectionName, + options, + ); + return _getDeserialize(result); +} diff --git a/sdk/batch/arm-batch/src/api/privateEndpointConnection/options.ts b/sdk/batch/arm-batch/src/api/privateEndpointConnection/options.ts new file mode 100644 index 000000000000..6776ee35772f --- /dev/null +++ b/sdk/batch/arm-batch/src/api/privateEndpointConnection/options.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionListByBatchAccountOptionalParams extends OperationOptions { + /** The maximum number of items to return in the response. */ + maxresults?: number; +} + +/** Optional parameters. */ +export interface PrivateEndpointConnectionDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface PrivateEndpointConnectionUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** The state (ETag) version of the private endpoint connection to update. This value can be omitted or set to "*" to apply the operation unconditionally. */ + ifMatch?: string; +} + +/** Optional parameters. */ +export interface PrivateEndpointConnectionGetOptionalParams extends OperationOptions {} diff --git a/sdk/batch/arm-batch/src/api/privateLinkResource/index.ts b/sdk/batch/arm-batch/src/api/privateLinkResource/index.ts new file mode 100644 index 000000000000..034bd20d341f --- /dev/null +++ b/sdk/batch/arm-batch/src/api/privateLinkResource/index.ts @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { listByBatchAccount, get } from "./operations.js"; +export { + PrivateLinkResourceListByBatchAccountOptionalParams, + PrivateLinkResourceGetOptionalParams, +} from "./options.js"; diff --git a/sdk/batch/arm-batch/src/api/privateLinkResource/operations.ts b/sdk/batch/arm-batch/src/api/privateLinkResource/operations.ts new file mode 100644 index 000000000000..b3263f51a649 --- /dev/null +++ b/sdk/batch/arm-batch/src/api/privateLinkResource/operations.ts @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BatchManagementContext as Client } from "../index.js"; +import { + cloudErrorDeserializer, + PrivateLinkResource, + privateLinkResourceDeserializer, + _ListPrivateLinkResourcesResult, + _listPrivateLinkResourcesResultDeserializer, +} from "../../models/models.js"; +import { + PagedAsyncIterableIterator, + buildPagedAsyncIterator, +} from "../../static-helpers/pagingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import { + PrivateLinkResourceListByBatchAccountOptionalParams, + PrivateLinkResourceGetOptionalParams, +} from "./options.js"; +import { + StreamableMethod, + PathUncheckedResponse, + createRestError, + operationOptionsToRequestParameters, +} from "@azure-rest/core-client"; + +export function _listByBatchAccountSend( + context: Client, + resourceGroupName: string, + accountName: string, + options: PrivateLinkResourceListByBatchAccountOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/privateLinkResources{?api%2Dversion,maxresults}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + accountName: accountName, + "api%2Dversion": context.apiVersion ?? "2025-06-01", + maxresults: options?.maxresults, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listByBatchAccountDeserialize( + result: PathUncheckedResponse, +): Promise<_ListPrivateLinkResourcesResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return _listPrivateLinkResourcesResultDeserializer(result.body); +} + +/** Lists all of the private link resources in the specified account. */ +export function listByBatchAccount( + context: Client, + resourceGroupName: string, + accountName: string, + options: PrivateLinkResourceListByBatchAccountOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByBatchAccountSend(context, resourceGroupName, accountName, options), + _listByBatchAccountDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink", apiVersion: context.apiVersion ?? "2025-06-01" }, + ); +} + +export function _getSend( + context: Client, + resourceGroupName: string, + accountName: string, + privateLinkResourceName: string, + options: PrivateLinkResourceGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/privateLinkResources/{privateLinkResourceName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + accountName: accountName, + privateLinkResourceName: privateLinkResourceName, + "api%2Dversion": context.apiVersion ?? "2025-06-01", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context + .path(path) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = cloudErrorDeserializer(result.body); + + throw error; + } + + return privateLinkResourceDeserializer(result.body); +} + +/** Gets information about the specified private link resource. */ +export async function get( + context: Client, + resourceGroupName: string, + accountName: string, + privateLinkResourceName: string, + options: PrivateLinkResourceGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend( + context, + resourceGroupName, + accountName, + privateLinkResourceName, + options, + ); + return _getDeserialize(result); +} diff --git a/sdk/batch/arm-batch/src/api/privateLinkResource/options.ts b/sdk/batch/arm-batch/src/api/privateLinkResource/options.ts new file mode 100644 index 000000000000..6ab2fd7b545d --- /dev/null +++ b/sdk/batch/arm-batch/src/api/privateLinkResource/options.ts @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface PrivateLinkResourceListByBatchAccountOptionalParams extends OperationOptions { + /** The maximum number of items to return in the response. */ + maxresults?: number; +} + +/** Optional parameters. */ +export interface PrivateLinkResourceGetOptionalParams extends OperationOptions {} diff --git a/sdk/batch/arm-batch/src/batchManagementClient.ts b/sdk/batch/arm-batch/src/batchManagementClient.ts index eb6df85eb5b1..a703800bbc25 100644 --- a/sdk/batch/arm-batch/src/batchManagementClient.ts +++ b/sdk/batch/arm-batch/src/batchManagementClient.ts @@ -1,188 +1,102 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. -import * as coreClient from "@azure/core-client"; -import * as coreRestPipeline from "@azure/core-rest-pipeline"; import { - PipelineRequest, - PipelineResponse, - SendRequest, -} from "@azure/core-rest-pipeline"; -import * as coreAuth from "@azure/core-auth"; + createBatchManagement, + BatchManagementContext, + BatchManagementClientOptionalParams, +} from "./api/index.js"; +import { ApplicationOperations, _getApplicationOperations } from "./classic/application/index.js"; import { - BatchAccountOperationsImpl, - ApplicationPackageOperationsImpl, - ApplicationOperationsImpl, - LocationImpl, - OperationsImpl, - CertificateOperationsImpl, - PrivateLinkResourceOperationsImpl, - PrivateEndpointConnectionOperationsImpl, - PoolOperationsImpl, - NetworkSecurityPerimeterOperationsImpl, -} from "./operations/index.js"; + ApplicationPackageOperations, + _getApplicationPackageOperations, +} from "./classic/applicationPackage/index.js"; import { BatchAccountOperations, - ApplicationPackageOperations, - ApplicationOperations, - Location, - Operations, - CertificateOperations, - PrivateLinkResourceOperations, - PrivateEndpointConnectionOperations, - PoolOperations, + _getBatchAccountOperations, +} from "./classic/batchAccount/index.js"; +import { LocationOperations, _getLocationOperations } from "./classic/location/index.js"; +import { NetworkSecurityPerimeterOperations, -} from "./operationsInterfaces/index.js"; -import { BatchManagementClientOptionalParams } from "./models/index.js"; + _getNetworkSecurityPerimeterOperations, +} from "./classic/networkSecurityPerimeter/index.js"; +import { OperationsOperations, _getOperationsOperations } from "./classic/operations/index.js"; +import { PoolOperations, _getPoolOperations } from "./classic/pool/index.js"; +import { + PrivateEndpointConnectionOperations, + _getPrivateEndpointConnectionOperations, +} from "./classic/privateEndpointConnection/index.js"; +import { + PrivateLinkResourceOperations, + _getPrivateLinkResourceOperations, +} from "./classic/privateLinkResource/index.js"; +import { TokenCredential } from "@azure/core-auth"; +import { Pipeline } from "@azure/core-rest-pipeline"; -export class BatchManagementClient extends coreClient.ServiceClient { - $host: string; - apiVersion: string; - subscriptionId: string; +export { BatchManagementClientOptionalParams } from "./api/batchManagementContext.js"; - /** - * Initializes a new instance of the BatchManagementClient class. - * @param credentials Subscription credentials which uniquely identify client subscription. - * @param subscriptionId The Azure subscription ID. This is a GUID-formatted string (e.g. - * 00000000-0000-0000-0000-000000000000) - * @param options The parameter options - */ +export class BatchManagementClient { + private _client: BatchManagementContext; + /** The pipeline used by this client to make requests */ + public readonly pipeline: Pipeline; + + constructor(credential: TokenCredential, options?: BatchManagementClientOptionalParams); constructor( - credentials: coreAuth.TokenCredential, + credential: TokenCredential, subscriptionId: string, options?: BatchManagementClientOptionalParams, + ); + /** The Batch Management Client. */ + constructor( + credential: TokenCredential, + subscriptionIdOrOptions?: string | BatchManagementClientOptionalParams, + options?: BatchManagementClientOptionalParams, ) { - if (credentials === undefined) { - throw new Error("'credentials' cannot be null"); - } - if (subscriptionId === undefined) { - throw new Error("'subscriptionId' cannot be null"); - } + let subscriptionId: string | undefined; - // Initializing default values for options - if (!options) { - options = {}; + if (typeof subscriptionIdOrOptions === "string") { + subscriptionId = subscriptionIdOrOptions; + } else if (typeof subscriptionIdOrOptions === "object") { + options = subscriptionIdOrOptions; } - const defaults: BatchManagementClientOptionalParams = { - requestContentType: "application/json; charset=utf-8", - credential: credentials, - }; - const packageDetails = `azsdk-js-arm-batch/10.0.2`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, + options = options ?? {}; + const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix; + const userAgentPrefix = prefixFromOptions + ? `${prefixFromOptions} azsdk-js-client` + : `azsdk-js-client`; + this._client = createBatchManagement(credential, subscriptionId ?? "", { ...options, - userAgentOptions: { - userAgentPrefix, - }, - endpoint: - options.endpoint ?? options.baseUri ?? "https://management.azure.com", - }; - super(optionsWithDefaults); - - let bearerTokenAuthenticationPolicyFound: boolean = false; - if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { - const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = - options.pipeline.getOrderedPolicies(); - bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( - (pipelinePolicy) => - pipelinePolicy.name === - coreRestPipeline.bearerTokenAuthenticationPolicyName, - ); - } - if ( - !options || - !options.pipeline || - options.pipeline.getOrderedPolicies().length == 0 || - !bearerTokenAuthenticationPolicyFound - ) { - this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName, - }); - this.pipeline.addPolicy( - coreRestPipeline.bearerTokenAuthenticationPolicy({ - credential: credentials, - scopes: - optionsWithDefaults.credentialScopes ?? - `${optionsWithDefaults.endpoint}/.default`, - challengeCallbacks: { - authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge, - }, - }), - ); - } - // Parameter assignments - this.subscriptionId = subscriptionId; - - // Assigning values to Constant parameters - this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2024-07-01"; - this.batchAccountOperations = new BatchAccountOperationsImpl(this); - this.applicationPackageOperations = new ApplicationPackageOperationsImpl( - this, - ); - this.applicationOperations = new ApplicationOperationsImpl(this); - this.location = new LocationImpl(this); - this.operations = new OperationsImpl(this); - this.certificateOperations = new CertificateOperationsImpl(this); - this.privateLinkResourceOperations = new PrivateLinkResourceOperationsImpl( - this, - ); - this.privateEndpointConnectionOperations = - new PrivateEndpointConnectionOperationsImpl(this); - this.poolOperations = new PoolOperationsImpl(this); - this.networkSecurityPerimeterOperations = - new NetworkSecurityPerimeterOperationsImpl(this); - this.addCustomApiVersionPolicy(options.apiVersion); - } - - /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */ - private addCustomApiVersionPolicy(apiVersion?: string) { - if (!apiVersion) { - return; - } - const apiVersionPolicy = { - name: "CustomApiVersionPolicy", - async sendRequest( - request: PipelineRequest, - next: SendRequest, - ): Promise { - const param = request.url.split("?"); - if (param.length > 1) { - const newParams = param[1].split("&").map((item) => { - if (item.indexOf("api-version") > -1) { - return "api-version=" + apiVersion; - } else { - return item; - } - }); - request.url = param[0] + "?" + newParams.join("&"); - } - return next(request); - }, - }; - this.pipeline.addPolicy(apiVersionPolicy); + userAgentOptions: { userAgentPrefix }, + }); + this.pipeline = this._client.pipeline; + this.location = _getLocationOperations(this._client); + this.networkSecurityPerimeter = _getNetworkSecurityPerimeterOperations(this._client); + this.pool = _getPoolOperations(this._client); + this.privateEndpointConnection = _getPrivateEndpointConnectionOperations(this._client); + this.privateLinkResource = _getPrivateLinkResourceOperations(this._client); + this.application = _getApplicationOperations(this._client); + this.applicationPackage = _getApplicationPackageOperations(this._client); + this.batchAccount = _getBatchAccountOperations(this._client); + this.operations = _getOperationsOperations(this._client); } - batchAccountOperations: BatchAccountOperations; - applicationPackageOperations: ApplicationPackageOperations; - applicationOperations: ApplicationOperations; - location: Location; - operations: Operations; - certificateOperations: CertificateOperations; - privateLinkResourceOperations: PrivateLinkResourceOperations; - privateEndpointConnectionOperations: PrivateEndpointConnectionOperations; - poolOperations: PoolOperations; - networkSecurityPerimeterOperations: NetworkSecurityPerimeterOperations; + /** The operation groups for location */ + public readonly location: LocationOperations; + /** The operation groups for networkSecurityPerimeter */ + public readonly networkSecurityPerimeter: NetworkSecurityPerimeterOperations; + /** The operation groups for pool */ + public readonly pool: PoolOperations; + /** The operation groups for privateEndpointConnection */ + public readonly privateEndpointConnection: PrivateEndpointConnectionOperations; + /** The operation groups for privateLinkResource */ + public readonly privateLinkResource: PrivateLinkResourceOperations; + /** The operation groups for application */ + public readonly application: ApplicationOperations; + /** The operation groups for applicationPackage */ + public readonly applicationPackage: ApplicationPackageOperations; + /** The operation groups for batchAccount */ + public readonly batchAccount: BatchAccountOperations; + /** The operation groups for operations */ + public readonly operations: OperationsOperations; } diff --git a/sdk/batch/arm-batch/src/classic/application/index.ts b/sdk/batch/arm-batch/src/classic/application/index.ts new file mode 100644 index 000000000000..a404de63a94b --- /dev/null +++ b/sdk/batch/arm-batch/src/classic/application/index.ts @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BatchManagementContext } from "../../api/batchManagementContext.js"; +import { list, $delete, update, create, get } from "../../api/application/operations.js"; +import { + ApplicationListOptionalParams, + ApplicationDeleteOptionalParams, + ApplicationUpdateOptionalParams, + ApplicationCreateOptionalParams, + ApplicationGetOptionalParams, +} from "../../api/application/options.js"; +import { Application } from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a Application operations. */ +export interface ApplicationOperations { + /** Lists all of the applications in the specified account. */ + list: ( + resourceGroupName: string, + accountName: string, + options?: ApplicationListOptionalParams, + ) => PagedAsyncIterableIterator; + /** Deletes an application. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + accountName: string, + applicationName: string, + options?: ApplicationDeleteOptionalParams, + ) => Promise; + /** Updates settings for the specified application. */ + update: ( + resourceGroupName: string, + accountName: string, + applicationName: string, + parameters: Application, + options?: ApplicationUpdateOptionalParams, + ) => Promise; + /** Adds an application to the specified Batch account. */ + create: ( + resourceGroupName: string, + accountName: string, + applicationName: string, + options?: ApplicationCreateOptionalParams, + ) => Promise; + /** Gets information about the specified application. */ + get: ( + resourceGroupName: string, + accountName: string, + applicationName: string, + options?: ApplicationGetOptionalParams, + ) => Promise; +} + +function _getApplication(context: BatchManagementContext) { + return { + list: ( + resourceGroupName: string, + accountName: string, + options?: ApplicationListOptionalParams, + ) => list(context, resourceGroupName, accountName, options), + delete: ( + resourceGroupName: string, + accountName: string, + applicationName: string, + options?: ApplicationDeleteOptionalParams, + ) => $delete(context, resourceGroupName, accountName, applicationName, options), + update: ( + resourceGroupName: string, + accountName: string, + applicationName: string, + parameters: Application, + options?: ApplicationUpdateOptionalParams, + ) => update(context, resourceGroupName, accountName, applicationName, parameters, options), + create: ( + resourceGroupName: string, + accountName: string, + applicationName: string, + options?: ApplicationCreateOptionalParams, + ) => create(context, resourceGroupName, accountName, applicationName, options), + get: ( + resourceGroupName: string, + accountName: string, + applicationName: string, + options?: ApplicationGetOptionalParams, + ) => get(context, resourceGroupName, accountName, applicationName, options), + }; +} + +export function _getApplicationOperations(context: BatchManagementContext): ApplicationOperations { + return { + ..._getApplication(context), + }; +} diff --git a/sdk/batch/arm-batch/src/classic/applicationPackage/index.ts b/sdk/batch/arm-batch/src/classic/applicationPackage/index.ts new file mode 100644 index 000000000000..2eaf71f17f97 --- /dev/null +++ b/sdk/batch/arm-batch/src/classic/applicationPackage/index.ts @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BatchManagementContext } from "../../api/batchManagementContext.js"; +import { activate, list, $delete, create, get } from "../../api/applicationPackage/operations.js"; +import { + ApplicationPackageActivateOptionalParams, + ApplicationPackageListOptionalParams, + ApplicationPackageDeleteOptionalParams, + ApplicationPackageCreateOptionalParams, + ApplicationPackageGetOptionalParams, +} from "../../api/applicationPackage/options.js"; +import { ApplicationPackage, ActivateApplicationPackageParameters } from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a ApplicationPackage operations. */ +export interface ApplicationPackageOperations { + /** 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. */ + activate: ( + resourceGroupName: string, + accountName: string, + applicationName: string, + versionName: string, + parameters: ActivateApplicationPackageParameters, + options?: ApplicationPackageActivateOptionalParams, + ) => Promise; + /** Lists all of the application packages in the specified application. */ + list: ( + resourceGroupName: string, + accountName: string, + applicationName: string, + options?: ApplicationPackageListOptionalParams, + ) => PagedAsyncIterableIterator; + /** Deletes an application package record and its associated binary file. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + accountName: string, + applicationName: string, + versionName: string, + options?: ApplicationPackageDeleteOptionalParams, + ) => Promise; + /** 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. */ + create: ( + resourceGroupName: string, + accountName: string, + applicationName: string, + versionName: string, + options?: ApplicationPackageCreateOptionalParams, + ) => Promise; + /** Gets information about the specified application package. */ + get: ( + resourceGroupName: string, + accountName: string, + applicationName: string, + versionName: string, + options?: ApplicationPackageGetOptionalParams, + ) => Promise; +} + +function _getApplicationPackage(context: BatchManagementContext) { + return { + activate: ( + resourceGroupName: string, + accountName: string, + applicationName: string, + versionName: string, + parameters: ActivateApplicationPackageParameters, + options?: ApplicationPackageActivateOptionalParams, + ) => + activate( + context, + resourceGroupName, + accountName, + applicationName, + versionName, + parameters, + options, + ), + list: ( + resourceGroupName: string, + accountName: string, + applicationName: string, + options?: ApplicationPackageListOptionalParams, + ) => list(context, resourceGroupName, accountName, applicationName, options), + delete: ( + resourceGroupName: string, + accountName: string, + applicationName: string, + versionName: string, + options?: ApplicationPackageDeleteOptionalParams, + ) => $delete(context, resourceGroupName, accountName, applicationName, versionName, options), + create: ( + resourceGroupName: string, + accountName: string, + applicationName: string, + versionName: string, + options?: ApplicationPackageCreateOptionalParams, + ) => create(context, resourceGroupName, accountName, applicationName, versionName, options), + get: ( + resourceGroupName: string, + accountName: string, + applicationName: string, + versionName: string, + options?: ApplicationPackageGetOptionalParams, + ) => get(context, resourceGroupName, accountName, applicationName, versionName, options), + }; +} + +export function _getApplicationPackageOperations( + context: BatchManagementContext, +): ApplicationPackageOperations { + return { + ..._getApplicationPackage(context), + }; +} diff --git a/sdk/batch/arm-batch/src/classic/batchAccount/index.ts b/sdk/batch/arm-batch/src/classic/batchAccount/index.ts new file mode 100644 index 000000000000..0dec7e4e03ff --- /dev/null +++ b/sdk/batch/arm-batch/src/classic/batchAccount/index.ts @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BatchManagementContext } from "../../api/batchManagementContext.js"; +import { + listDetectors, + getDetector, + listOutboundNetworkDependenciesEndpoints, + getKeys, + regenerateKey, + synchronizeAutoStorageKeys, + list, + listByResourceGroup, + $delete, + update, + create, + get, +} from "../../api/batchAccount/operations.js"; +import { + BatchAccountListDetectorsOptionalParams, + BatchAccountGetDetectorOptionalParams, + BatchAccountListOutboundNetworkDependenciesEndpointsOptionalParams, + BatchAccountGetKeysOptionalParams, + BatchAccountRegenerateKeyOptionalParams, + BatchAccountSynchronizeAutoStorageKeysOptionalParams, + BatchAccountListOptionalParams, + BatchAccountListByResourceGroupOptionalParams, + BatchAccountDeleteOptionalParams, + BatchAccountUpdateOptionalParams, + BatchAccountCreateOptionalParams, + BatchAccountGetOptionalParams, +} from "../../api/batchAccount/options.js"; +import { + BatchAccount, + BatchAccountCreateParameters, + BatchAccountUpdateParameters, + BatchAccountRegenerateKeyParameters, + BatchAccountKeys, + OutboundEnvironmentEndpoint, + DetectorResponse, +} from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { SimplePollerLike, getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a BatchAccount operations. */ +export interface BatchAccountOperations { + /** Gets information about the detectors available for a given Batch account. */ + listDetectors: ( + resourceGroupName: string, + accountName: string, + options?: BatchAccountListDetectorsOptionalParams, + ) => PagedAsyncIterableIterator; + /** Gets information about the given detector for a given Batch account. */ + getDetector: ( + resourceGroupName: string, + accountName: string, + detectorId: string, + options?: BatchAccountGetDetectorOptionalParams, + ) => Promise; + /** 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://learn.microsoft.com/azure/batch/batch-virtual-network. */ + listOutboundNetworkDependenciesEndpoints: ( + resourceGroupName: string, + accountName: string, + options?: BatchAccountListOutboundNetworkDependenciesEndpointsOptionalParams, + ) => PagedAsyncIterableIterator; + /** 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. */ + getKeys: ( + resourceGroupName: string, + accountName: string, + options?: BatchAccountGetKeysOptionalParams, + ) => Promise; + /** 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. */ + regenerateKey: ( + resourceGroupName: string, + accountName: string, + parameters: BatchAccountRegenerateKeyParameters, + options?: BatchAccountRegenerateKeyOptionalParams, + ) => Promise; + /** Synchronizes access keys for the auto-storage account configured for the specified Batch account, only if storage key authentication is being used. */ + synchronizeAutoStorageKeys: ( + resourceGroupName: string, + accountName: string, + options?: BatchAccountSynchronizeAutoStorageKeysOptionalParams, + ) => Promise; + /** Gets information about the Batch accounts associated with the subscription. */ + list: (options?: BatchAccountListOptionalParams) => PagedAsyncIterableIterator; + /** Gets information about the Batch accounts associated with the specified resource group. */ + listByResourceGroup: ( + resourceGroupName: string, + options?: BatchAccountListByResourceGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** Deletes the specified Batch account. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + accountName: string, + options?: BatchAccountDeleteOptionalParams, + ) => PollerLike, void>; + /** @deprecated use delete instead */ + beginDelete: ( + resourceGroupName: string, + accountName: string, + options?: BatchAccountDeleteOptionalParams, + ) => Promise, void>>; + /** @deprecated use delete instead */ + beginDeleteAndWait: ( + resourceGroupName: string, + accountName: string, + options?: BatchAccountDeleteOptionalParams, + ) => Promise; + /** Updates the properties of an existing Batch account. */ + update: ( + resourceGroupName: string, + accountName: string, + parameters: BatchAccountUpdateParameters, + options?: BatchAccountUpdateOptionalParams, + ) => Promise; + /** 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. */ + create: ( + resourceGroupName: string, + accountName: string, + parameters: BatchAccountCreateParameters, + options?: BatchAccountCreateOptionalParams, + ) => PollerLike, BatchAccount>; + /** @deprecated use create instead */ + beginCreate: ( + resourceGroupName: string, + accountName: string, + parameters: BatchAccountCreateParameters, + options?: BatchAccountCreateOptionalParams, + ) => Promise, BatchAccount>>; + /** @deprecated use create instead */ + beginCreateAndWait: ( + resourceGroupName: string, + accountName: string, + parameters: BatchAccountCreateParameters, + options?: BatchAccountCreateOptionalParams, + ) => Promise; + /** Gets information about the specified Batch account. */ + get: ( + resourceGroupName: string, + accountName: string, + options?: BatchAccountGetOptionalParams, + ) => Promise; +} + +function _getBatchAccount(context: BatchManagementContext) { + return { + listDetectors: ( + resourceGroupName: string, + accountName: string, + options?: BatchAccountListDetectorsOptionalParams, + ) => listDetectors(context, resourceGroupName, accountName, options), + getDetector: ( + resourceGroupName: string, + accountName: string, + detectorId: string, + options?: BatchAccountGetDetectorOptionalParams, + ) => getDetector(context, resourceGroupName, accountName, detectorId, options), + listOutboundNetworkDependenciesEndpoints: ( + resourceGroupName: string, + accountName: string, + options?: BatchAccountListOutboundNetworkDependenciesEndpointsOptionalParams, + ) => listOutboundNetworkDependenciesEndpoints(context, resourceGroupName, accountName, options), + getKeys: ( + resourceGroupName: string, + accountName: string, + options?: BatchAccountGetKeysOptionalParams, + ) => getKeys(context, resourceGroupName, accountName, options), + regenerateKey: ( + resourceGroupName: string, + accountName: string, + parameters: BatchAccountRegenerateKeyParameters, + options?: BatchAccountRegenerateKeyOptionalParams, + ) => regenerateKey(context, resourceGroupName, accountName, parameters, options), + synchronizeAutoStorageKeys: ( + resourceGroupName: string, + accountName: string, + options?: BatchAccountSynchronizeAutoStorageKeysOptionalParams, + ) => synchronizeAutoStorageKeys(context, resourceGroupName, accountName, options), + list: (options?: BatchAccountListOptionalParams) => list(context, options), + listByResourceGroup: ( + resourceGroupName: string, + options?: BatchAccountListByResourceGroupOptionalParams, + ) => listByResourceGroup(context, resourceGroupName, options), + delete: ( + resourceGroupName: string, + accountName: string, + options?: BatchAccountDeleteOptionalParams, + ) => $delete(context, resourceGroupName, accountName, options), + beginDelete: async ( + resourceGroupName: string, + accountName: string, + options?: BatchAccountDeleteOptionalParams, + ) => { + const poller = $delete(context, resourceGroupName, accountName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteAndWait: async ( + resourceGroupName: string, + accountName: string, + options?: BatchAccountDeleteOptionalParams, + ) => { + return await $delete(context, resourceGroupName, accountName, options); + }, + update: ( + resourceGroupName: string, + accountName: string, + parameters: BatchAccountUpdateParameters, + options?: BatchAccountUpdateOptionalParams, + ) => update(context, resourceGroupName, accountName, parameters, options), + create: ( + resourceGroupName: string, + accountName: string, + parameters: BatchAccountCreateParameters, + options?: BatchAccountCreateOptionalParams, + ) => create(context, resourceGroupName, accountName, parameters, options), + beginCreate: async ( + resourceGroupName: string, + accountName: string, + parameters: BatchAccountCreateParameters, + options?: BatchAccountCreateOptionalParams, + ) => { + const poller = create(context, resourceGroupName, accountName, parameters, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginCreateAndWait: async ( + resourceGroupName: string, + accountName: string, + parameters: BatchAccountCreateParameters, + options?: BatchAccountCreateOptionalParams, + ) => { + return await create(context, resourceGroupName, accountName, parameters, options); + }, + get: ( + resourceGroupName: string, + accountName: string, + options?: BatchAccountGetOptionalParams, + ) => get(context, resourceGroupName, accountName, options), + }; +} + +export function _getBatchAccountOperations( + context: BatchManagementContext, +): BatchAccountOperations { + return { + ..._getBatchAccount(context), + }; +} diff --git a/sdk/batch/arm-batch/src/classic/index.ts b/sdk/batch/arm-batch/src/classic/index.ts new file mode 100644 index 000000000000..d67f4a6b49f2 --- /dev/null +++ b/sdk/batch/arm-batch/src/classic/index.ts @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { ApplicationOperations } from "./application/index.js"; +export { ApplicationPackageOperations } from "./applicationPackage/index.js"; +export { BatchAccountOperations } from "./batchAccount/index.js"; +export { LocationOperations } from "./location/index.js"; +export { NetworkSecurityPerimeterOperations } from "./networkSecurityPerimeter/index.js"; +export { OperationsOperations } from "./operations/index.js"; +export { PoolOperations } from "./pool/index.js"; +export { PrivateEndpointConnectionOperations } from "./privateEndpointConnection/index.js"; +export { PrivateLinkResourceOperations } from "./privateLinkResource/index.js"; diff --git a/sdk/batch/arm-batch/src/classic/location/index.ts b/sdk/batch/arm-batch/src/classic/location/index.ts new file mode 100644 index 000000000000..ed0745475a96 --- /dev/null +++ b/sdk/batch/arm-batch/src/classic/location/index.ts @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BatchManagementContext } from "../../api/batchManagementContext.js"; +import { + checkNameAvailability, + listSupportedVirtualMachineSkus, + getQuotas, +} from "../../api/location/operations.js"; +import { + LocationCheckNameAvailabilityOptionalParams, + LocationListSupportedVirtualMachineSkusOptionalParams, + LocationGetQuotasOptionalParams, +} from "../../api/location/options.js"; +import { + BatchLocationQuota, + SupportedSku, + CheckNameAvailabilityParameters, + CheckNameAvailabilityResult, +} from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a Location operations. */ +export interface LocationOperations { + /** Checks whether the Batch account name is available in the specified region. */ + checkNameAvailability: ( + locationName: string, + parameters: CheckNameAvailabilityParameters, + options?: LocationCheckNameAvailabilityOptionalParams, + ) => Promise; + /** Gets the list of Batch supported Virtual Machine VM sizes available at the given location. */ + listSupportedVirtualMachineSkus: ( + locationName: string, + options?: LocationListSupportedVirtualMachineSkusOptionalParams, + ) => PagedAsyncIterableIterator; + /** Gets the Batch service quotas for the specified subscription at the given location. */ + getQuotas: ( + locationName: string, + options?: LocationGetQuotasOptionalParams, + ) => Promise; +} + +function _getLocation(context: BatchManagementContext) { + return { + checkNameAvailability: ( + locationName: string, + parameters: CheckNameAvailabilityParameters, + options?: LocationCheckNameAvailabilityOptionalParams, + ) => checkNameAvailability(context, locationName, parameters, options), + listSupportedVirtualMachineSkus: ( + locationName: string, + options?: LocationListSupportedVirtualMachineSkusOptionalParams, + ) => listSupportedVirtualMachineSkus(context, locationName, options), + getQuotas: (locationName: string, options?: LocationGetQuotasOptionalParams) => + getQuotas(context, locationName, options), + }; +} + +export function _getLocationOperations(context: BatchManagementContext): LocationOperations { + return { + ..._getLocation(context), + }; +} diff --git a/sdk/batch/arm-batch/src/classic/networkSecurityPerimeter/index.ts b/sdk/batch/arm-batch/src/classic/networkSecurityPerimeter/index.ts new file mode 100644 index 000000000000..5d1b8bbb1343 --- /dev/null +++ b/sdk/batch/arm-batch/src/classic/networkSecurityPerimeter/index.ts @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BatchManagementContext } from "../../api/batchManagementContext.js"; +import { + reconcileConfiguration, + listConfigurations, + getConfiguration, +} from "../../api/networkSecurityPerimeter/operations.js"; +import { + NetworkSecurityPerimeterReconcileConfigurationOptionalParams, + NetworkSecurityPerimeterListConfigurationsOptionalParams, + NetworkSecurityPerimeterGetConfigurationOptionalParams, +} from "../../api/networkSecurityPerimeter/options.js"; +import { NetworkSecurityPerimeterConfiguration } from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { SimplePollerLike, getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a NetworkSecurityPerimeter operations. */ +export interface NetworkSecurityPerimeterOperations { + /** Reconciles the specified NSP configuration. */ + reconcileConfiguration: ( + resourceGroupName: string, + accountName: string, + networkSecurityPerimeterConfigurationName: string, + options?: NetworkSecurityPerimeterReconcileConfigurationOptionalParams, + ) => PollerLike, void>; + /** @deprecated use reconcileConfiguration instead */ + beginReconcileConfiguration: ( + resourceGroupName: string, + accountName: string, + networkSecurityPerimeterConfigurationName: string, + options?: NetworkSecurityPerimeterReconcileConfigurationOptionalParams, + ) => Promise, void>>; + /** @deprecated use reconcileConfiguration instead */ + beginReconcileConfigurationAndWait: ( + resourceGroupName: string, + accountName: string, + networkSecurityPerimeterConfigurationName: string, + options?: NetworkSecurityPerimeterReconcileConfigurationOptionalParams, + ) => Promise; + /** Lists all of the NSP configurations in the specified account. */ + listConfigurations: ( + resourceGroupName: string, + accountName: string, + options?: NetworkSecurityPerimeterListConfigurationsOptionalParams, + ) => PagedAsyncIterableIterator; + /** Gets information about the specified NSP configuration. */ + getConfiguration: ( + resourceGroupName: string, + accountName: string, + networkSecurityPerimeterConfigurationName: string, + options?: NetworkSecurityPerimeterGetConfigurationOptionalParams, + ) => Promise; +} + +function _getNetworkSecurityPerimeter(context: BatchManagementContext) { + return { + reconcileConfiguration: ( + resourceGroupName: string, + accountName: string, + networkSecurityPerimeterConfigurationName: string, + options?: NetworkSecurityPerimeterReconcileConfigurationOptionalParams, + ) => + reconcileConfiguration( + context, + resourceGroupName, + accountName, + networkSecurityPerimeterConfigurationName, + options, + ), + beginReconcileConfiguration: async ( + resourceGroupName: string, + accountName: string, + networkSecurityPerimeterConfigurationName: string, + options?: NetworkSecurityPerimeterReconcileConfigurationOptionalParams, + ) => { + const poller = reconcileConfiguration( + context, + resourceGroupName, + accountName, + networkSecurityPerimeterConfigurationName, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginReconcileConfigurationAndWait: async ( + resourceGroupName: string, + accountName: string, + networkSecurityPerimeterConfigurationName: string, + options?: NetworkSecurityPerimeterReconcileConfigurationOptionalParams, + ) => { + return await reconcileConfiguration( + context, + resourceGroupName, + accountName, + networkSecurityPerimeterConfigurationName, + options, + ); + }, + listConfigurations: ( + resourceGroupName: string, + accountName: string, + options?: NetworkSecurityPerimeterListConfigurationsOptionalParams, + ) => listConfigurations(context, resourceGroupName, accountName, options), + getConfiguration: ( + resourceGroupName: string, + accountName: string, + networkSecurityPerimeterConfigurationName: string, + options?: NetworkSecurityPerimeterGetConfigurationOptionalParams, + ) => + getConfiguration( + context, + resourceGroupName, + accountName, + networkSecurityPerimeterConfigurationName, + options, + ), + }; +} + +export function _getNetworkSecurityPerimeterOperations( + context: BatchManagementContext, +): NetworkSecurityPerimeterOperations { + return { + ..._getNetworkSecurityPerimeter(context), + }; +} diff --git a/sdk/batch/arm-batch/src/classic/operations/index.ts b/sdk/batch/arm-batch/src/classic/operations/index.ts new file mode 100644 index 000000000000..8b0701e268bb --- /dev/null +++ b/sdk/batch/arm-batch/src/classic/operations/index.ts @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BatchManagementContext } from "../../api/batchManagementContext.js"; +import { list } from "../../api/operations/operations.js"; +import { OperationsListOptionalParams } from "../../api/operations/options.js"; +import { Operation } from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a Operations operations. */ +export interface OperationsOperations { + /** Lists available operations for the Microsoft.Batch provider */ + list: (options?: OperationsListOptionalParams) => PagedAsyncIterableIterator; +} + +function _getOperations(context: BatchManagementContext) { + return { + list: (options?: OperationsListOptionalParams) => list(context, options), + }; +} + +export function _getOperationsOperations(context: BatchManagementContext): OperationsOperations { + return { + ..._getOperations(context), + }; +} diff --git a/sdk/batch/arm-batch/src/classic/pool/index.ts b/sdk/batch/arm-batch/src/classic/pool/index.ts new file mode 100644 index 000000000000..d8f4efe83762 --- /dev/null +++ b/sdk/batch/arm-batch/src/classic/pool/index.ts @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BatchManagementContext } from "../../api/batchManagementContext.js"; +import { + stopResize, + disableAutoScale, + listByBatchAccount, + $delete, + update, + create, + get, +} from "../../api/pool/operations.js"; +import { + PoolStopResizeOptionalParams, + PoolDisableAutoScaleOptionalParams, + PoolListByBatchAccountOptionalParams, + PoolDeleteOptionalParams, + PoolUpdateOptionalParams, + PoolCreateOptionalParams, + PoolGetOptionalParams, +} from "../../api/pool/options.js"; +import { Pool } from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { SimplePollerLike, getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a Pool operations. */ +export interface PoolOperations { + /** 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. */ + stopResize: ( + resourceGroupName: string, + accountName: string, + poolName: string, + options?: PoolStopResizeOptionalParams, + ) => Promise; + /** Disables automatic scaling for a pool. */ + disableAutoScale: ( + resourceGroupName: string, + accountName: string, + poolName: string, + options?: PoolDisableAutoScaleOptionalParams, + ) => Promise; + /** Lists all of the pools in the specified account. */ + listByBatchAccount: ( + resourceGroupName: string, + accountName: string, + options?: PoolListByBatchAccountOptionalParams, + ) => PagedAsyncIterableIterator; + /** Deletes the specified pool. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + accountName: string, + poolName: string, + options?: PoolDeleteOptionalParams, + ) => PollerLike, void>; + /** @deprecated use delete instead */ + beginDelete: ( + resourceGroupName: string, + accountName: string, + poolName: string, + options?: PoolDeleteOptionalParams, + ) => Promise, void>>; + /** @deprecated use delete instead */ + beginDeleteAndWait: ( + resourceGroupName: string, + accountName: string, + poolName: string, + options?: PoolDeleteOptionalParams, + ) => Promise; + /** Updates the properties of an existing pool. */ + update: ( + resourceGroupName: string, + accountName: string, + poolName: string, + parameters: Pool, + options?: PoolUpdateOptionalParams, + ) => Promise; + /** Creates a new pool inside the specified account. */ + create: ( + resourceGroupName: string, + accountName: string, + poolName: string, + parameters: Pool, + options?: PoolCreateOptionalParams, + ) => Promise; + /** Gets information about the specified pool. */ + get: ( + resourceGroupName: string, + accountName: string, + poolName: string, + options?: PoolGetOptionalParams, + ) => Promise; +} + +function _getPool(context: BatchManagementContext) { + return { + stopResize: ( + resourceGroupName: string, + accountName: string, + poolName: string, + options?: PoolStopResizeOptionalParams, + ) => stopResize(context, resourceGroupName, accountName, poolName, options), + disableAutoScale: ( + resourceGroupName: string, + accountName: string, + poolName: string, + options?: PoolDisableAutoScaleOptionalParams, + ) => disableAutoScale(context, resourceGroupName, accountName, poolName, options), + listByBatchAccount: ( + resourceGroupName: string, + accountName: string, + options?: PoolListByBatchAccountOptionalParams, + ) => listByBatchAccount(context, resourceGroupName, accountName, options), + delete: ( + resourceGroupName: string, + accountName: string, + poolName: string, + options?: PoolDeleteOptionalParams, + ) => $delete(context, resourceGroupName, accountName, poolName, options), + beginDelete: async ( + resourceGroupName: string, + accountName: string, + poolName: string, + options?: PoolDeleteOptionalParams, + ) => { + const poller = $delete(context, resourceGroupName, accountName, poolName, options); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteAndWait: async ( + resourceGroupName: string, + accountName: string, + poolName: string, + options?: PoolDeleteOptionalParams, + ) => { + return await $delete(context, resourceGroupName, accountName, poolName, options); + }, + update: ( + resourceGroupName: string, + accountName: string, + poolName: string, + parameters: Pool, + options?: PoolUpdateOptionalParams, + ) => update(context, resourceGroupName, accountName, poolName, parameters, options), + create: ( + resourceGroupName: string, + accountName: string, + poolName: string, + parameters: Pool, + options?: PoolCreateOptionalParams, + ) => create(context, resourceGroupName, accountName, poolName, parameters, options), + get: ( + resourceGroupName: string, + accountName: string, + poolName: string, + options?: PoolGetOptionalParams, + ) => get(context, resourceGroupName, accountName, poolName, options), + }; +} + +export function _getPoolOperations(context: BatchManagementContext): PoolOperations { + return { + ..._getPool(context), + }; +} diff --git a/sdk/batch/arm-batch/src/classic/privateEndpointConnection/index.ts b/sdk/batch/arm-batch/src/classic/privateEndpointConnection/index.ts new file mode 100644 index 000000000000..8549cb46040e --- /dev/null +++ b/sdk/batch/arm-batch/src/classic/privateEndpointConnection/index.ts @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BatchManagementContext } from "../../api/batchManagementContext.js"; +import { + listByBatchAccount, + $delete, + update, + get, +} from "../../api/privateEndpointConnection/operations.js"; +import { + PrivateEndpointConnectionListByBatchAccountOptionalParams, + PrivateEndpointConnectionDeleteOptionalParams, + PrivateEndpointConnectionUpdateOptionalParams, + PrivateEndpointConnectionGetOptionalParams, +} from "../../api/privateEndpointConnection/options.js"; +import { PrivateEndpointConnection } from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { SimplePollerLike, getSimplePoller } from "../../static-helpers/simplePollerHelpers.js"; +import { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a PrivateEndpointConnection operations. */ +export interface PrivateEndpointConnectionOperations { + /** Lists all of the private endpoint connections in the specified account. */ + listByBatchAccount: ( + resourceGroupName: string, + accountName: string, + options?: PrivateEndpointConnectionListByBatchAccountOptionalParams, + ) => PagedAsyncIterableIterator; + /** Deletes the specified private endpoint connection. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + accountName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionDeleteOptionalParams, + ) => PollerLike, void>; + /** @deprecated use delete instead */ + beginDelete: ( + resourceGroupName: string, + accountName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionDeleteOptionalParams, + ) => Promise, void>>; + /** @deprecated use delete instead */ + beginDeleteAndWait: ( + resourceGroupName: string, + accountName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionDeleteOptionalParams, + ) => Promise; + /** Updates the properties of an existing private endpoint connection. */ + update: ( + resourceGroupName: string, + accountName: string, + privateEndpointConnectionName: string, + parameters: PrivateEndpointConnection, + options?: PrivateEndpointConnectionUpdateOptionalParams, + ) => PollerLike, PrivateEndpointConnection>; + /** @deprecated use update instead */ + beginUpdate: ( + resourceGroupName: string, + accountName: string, + privateEndpointConnectionName: string, + parameters: PrivateEndpointConnection, + options?: PrivateEndpointConnectionUpdateOptionalParams, + ) => Promise< + SimplePollerLike, PrivateEndpointConnection> + >; + /** @deprecated use update instead */ + beginUpdateAndWait: ( + resourceGroupName: string, + accountName: string, + privateEndpointConnectionName: string, + parameters: PrivateEndpointConnection, + options?: PrivateEndpointConnectionUpdateOptionalParams, + ) => Promise; + /** Gets information about the specified private endpoint connection. */ + get: ( + resourceGroupName: string, + accountName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionGetOptionalParams, + ) => Promise; +} + +function _getPrivateEndpointConnection(context: BatchManagementContext) { + return { + listByBatchAccount: ( + resourceGroupName: string, + accountName: string, + options?: PrivateEndpointConnectionListByBatchAccountOptionalParams, + ) => listByBatchAccount(context, resourceGroupName, accountName, options), + delete: ( + resourceGroupName: string, + accountName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionDeleteOptionalParams, + ) => $delete(context, resourceGroupName, accountName, privateEndpointConnectionName, options), + beginDelete: async ( + resourceGroupName: string, + accountName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionDeleteOptionalParams, + ) => { + const poller = $delete( + context, + resourceGroupName, + accountName, + privateEndpointConnectionName, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginDeleteAndWait: async ( + resourceGroupName: string, + accountName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionDeleteOptionalParams, + ) => { + return await $delete( + context, + resourceGroupName, + accountName, + privateEndpointConnectionName, + options, + ); + }, + update: ( + resourceGroupName: string, + accountName: string, + privateEndpointConnectionName: string, + parameters: PrivateEndpointConnection, + options?: PrivateEndpointConnectionUpdateOptionalParams, + ) => + update( + context, + resourceGroupName, + accountName, + privateEndpointConnectionName, + parameters, + options, + ), + beginUpdate: async ( + resourceGroupName: string, + accountName: string, + privateEndpointConnectionName: string, + parameters: PrivateEndpointConnection, + options?: PrivateEndpointConnectionUpdateOptionalParams, + ) => { + const poller = update( + context, + resourceGroupName, + accountName, + privateEndpointConnectionName, + parameters, + options, + ); + await poller.submitted(); + return getSimplePoller(poller); + }, + beginUpdateAndWait: async ( + resourceGroupName: string, + accountName: string, + privateEndpointConnectionName: string, + parameters: PrivateEndpointConnection, + options?: PrivateEndpointConnectionUpdateOptionalParams, + ) => { + return await update( + context, + resourceGroupName, + accountName, + privateEndpointConnectionName, + parameters, + options, + ); + }, + get: ( + resourceGroupName: string, + accountName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionGetOptionalParams, + ) => get(context, resourceGroupName, accountName, privateEndpointConnectionName, options), + }; +} + +export function _getPrivateEndpointConnectionOperations( + context: BatchManagementContext, +): PrivateEndpointConnectionOperations { + return { + ..._getPrivateEndpointConnection(context), + }; +} diff --git a/sdk/batch/arm-batch/src/classic/privateLinkResource/index.ts b/sdk/batch/arm-batch/src/classic/privateLinkResource/index.ts new file mode 100644 index 000000000000..654454e8f0fb --- /dev/null +++ b/sdk/batch/arm-batch/src/classic/privateLinkResource/index.ts @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BatchManagementContext } from "../../api/batchManagementContext.js"; +import { listByBatchAccount, get } from "../../api/privateLinkResource/operations.js"; +import { + PrivateLinkResourceListByBatchAccountOptionalParams, + PrivateLinkResourceGetOptionalParams, +} from "../../api/privateLinkResource/options.js"; +import { PrivateLinkResource } from "../../models/models.js"; +import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a PrivateLinkResource operations. */ +export interface PrivateLinkResourceOperations { + /** Lists all of the private link resources in the specified account. */ + listByBatchAccount: ( + resourceGroupName: string, + accountName: string, + options?: PrivateLinkResourceListByBatchAccountOptionalParams, + ) => PagedAsyncIterableIterator; + /** Gets information about the specified private link resource. */ + get: ( + resourceGroupName: string, + accountName: string, + privateLinkResourceName: string, + options?: PrivateLinkResourceGetOptionalParams, + ) => Promise; +} + +function _getPrivateLinkResource(context: BatchManagementContext) { + return { + listByBatchAccount: ( + resourceGroupName: string, + accountName: string, + options?: PrivateLinkResourceListByBatchAccountOptionalParams, + ) => listByBatchAccount(context, resourceGroupName, accountName, options), + get: ( + resourceGroupName: string, + accountName: string, + privateLinkResourceName: string, + options?: PrivateLinkResourceGetOptionalParams, + ) => get(context, resourceGroupName, accountName, privateLinkResourceName, options), + }; +} + +export function _getPrivateLinkResourceOperations( + context: BatchManagementContext, +): PrivateLinkResourceOperations { + return { + ..._getPrivateLinkResource(context), + }; +} diff --git a/sdk/batch/arm-batch/src/index.ts b/sdk/batch/arm-batch/src/index.ts index 05bc29a213b6..61fc9e77cc8b 100644 --- a/sdk/batch/arm-batch/src/index.ts +++ b/sdk/batch/arm-batch/src/index.ts @@ -1,13 +1,267 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureClouds, AzureSupportedClouds } from "./static-helpers/cloudSettingHelpers.js"; +import { + PageSettings, + ContinuablePage, + PagedAsyncIterableIterator, +} from "./static-helpers/pagingHelpers.js"; -/// -export { getContinuationToken } from "./pagingHelper.js"; -export * from "./models/index.js"; export { BatchManagementClient } from "./batchManagementClient.js"; -export * from "./operationsInterfaces/index.js"; +export { SimplePollerLike } from "./static-helpers/simplePollerHelpers.js"; +export { restorePoller, RestorePollerOptions } from "./restorePollerHelpers.js"; +export { + Operation, + OperationDisplay, + CloudError, + CloudErrorBody, + BatchAccount, + BatchAccountProperties, + ProvisioningState, + PoolAllocationMode, + KeyVaultReference, + PublicNetworkAccessType, + NetworkProfile, + EndpointAccessProfile, + EndpointAccessDefaultAction, + IPRule, + IPRuleAction, + PrivateEndpointConnection, + PrivateEndpointConnectionProperties, + PrivateEndpointConnectionProvisioningState, + PrivateEndpoint, + PrivateLinkServiceConnectionState, + PrivateLinkServiceConnectionStatus, + AutoStorageProperties, + EncryptionProperties, + KeySource, + KeyVaultProperties, + VirtualMachineFamilyCoreQuota, + AuthenticationMode, + BatchAccountIdentity, + ResourceIdentityType, + UserAssignedIdentities, + ProxyResource, + Resource, + SystemData, + KnownCreatedByType, + CreatedByType, + AutoStorageBaseProperties, + AutoStorageAuthenticationMode, + ComputeNodeIdentityReference, + TrackedResource, + BatchAccountCreateParameters, + BatchAccountCreateProperties, + ErrorDetail, + ErrorAdditionalInfo, + BatchAccountUpdateParameters, + BatchAccountUpdateProperties, + BatchAccountRegenerateKeyParameters, + AccountKeyType, + BatchAccountKeys, + OutboundEnvironmentEndpoint, + EndpointDependency, + EndpointDetail, + DetectorResponse, + DetectorResponseProperties, + ApplicationPackage, + ApplicationPackageProperties, + PackageState, + ActivateApplicationPackageParameters, + Application, + ApplicationProperties, + PrivateLinkResource, + PrivateLinkResourceProperties, + Pool, + PoolProperties, + PoolProvisioningState, + AllocationState, + DeploymentConfiguration, + VirtualMachineConfiguration, + ImageReference, + WindowsConfiguration, + DataDisk, + CachingType, + ManagedDisk, + StorageAccountType, + VMDiskSecurityProfile, + KnownSecurityEncryptionTypes, + SecurityEncryptionTypes, + DiskEncryptionSetParameters, + ContainerConfiguration, + KnownContainerType, + ContainerType, + ContainerRegistry, + DiskEncryptionConfiguration, + DiskEncryptionTarget, + DiskCustomerManagedKey, + NodePlacementConfiguration, + NodePlacementPolicyType, + VMExtension, + OSDisk, + DiffDiskSettings, + DiffDiskPlacement, + SecurityProfile, + SecurityTypes, + UefiSettings, + ProxyAgentSettings, + HostEndpointSettings, + KnownHostEndpointSettingsModeTypes, + HostEndpointSettingsModeTypes, + ServiceArtifactReference, + ScaleSettings, + FixedScaleSettings, + ComputeNodeDeallocationOption, + AutoScaleSettings, + AutoScaleRun, + AutoScaleRunError, + InterNodeCommunicationState, + NetworkConfiguration, + DynamicVNetAssignmentScope, + PoolEndpointConfiguration, + InboundNatPool, + InboundEndpointProtocol, + NetworkSecurityGroupRule, + NetworkSecurityGroupRuleAccess, + PublicIPAddressConfiguration, + IPAddressProvisioningType, + KnownIPFamily, + IPFamily, + IPTag, + TaskSchedulingPolicy, + KnownJobDefaultOrder, + JobDefaultOrder, + ComputeNodeFillType, + UserAccount, + ElevationLevel, + LinuxUserConfiguration, + WindowsUserConfiguration, + LoginMode, + MetadataItem, + StartTask, + ResourceFile, + EnvironmentSetting, + UserIdentity, + AutoUserSpecification, + AutoUserScope, + TaskContainerSettings, + ContainerWorkingDirectory, + ContainerHostBatchBindMountEntry, + KnownContainerHostDataPath, + ContainerHostDataPath, + ApplicationPackageReference, + ResizeOperationStatus, + ResizeError, + MountConfiguration, + AzureBlobFileSystemConfiguration, + NFSMountConfiguration, + CifsMountConfiguration, + AzureFileShareConfiguration, + UpgradePolicy, + UpgradeMode, + AutomaticOSUpgradePolicy, + RollingUpgradePolicy, + BatchPoolIdentity, + PoolIdentityType, + NetworkSecurityPerimeterConfiguration, + NetworkSecurityPerimeterConfigurationProperties, + KnownNetworkSecurityPerimeterConfigurationProvisioningState, + NetworkSecurityPerimeterConfigurationProvisioningState, + ProvisioningIssue, + ProvisioningIssueProperties, + KnownIssueType, + IssueType, + KnownSeverity, + Severity, + AccessRule, + AccessRuleProperties, + KnownAccessRuleDirection, + AccessRuleDirection, + NetworkSecurityPerimeter, + ResourceAssociation, + KnownResourceAssociationAccessMode, + ResourceAssociationAccessMode, + NetworkSecurityProfile, + ErrorResponse, + BatchLocationQuota, + SupportedSku, + SkuCapability, + CheckNameAvailabilityParameters, + ResourceType, + CheckNameAvailabilityResult, + NameAvailabilityReason, + KnownVersions, +} from "./models/index.js"; +export { BatchManagementClientOptionalParams } from "./api/index.js"; +export { + ApplicationListOptionalParams, + ApplicationDeleteOptionalParams, + ApplicationUpdateOptionalParams, + ApplicationCreateOptionalParams, + ApplicationGetOptionalParams, +} from "./api/application/index.js"; +export { + ApplicationPackageActivateOptionalParams, + ApplicationPackageListOptionalParams, + ApplicationPackageDeleteOptionalParams, + ApplicationPackageCreateOptionalParams, + ApplicationPackageGetOptionalParams, +} from "./api/applicationPackage/index.js"; +export { + BatchAccountListDetectorsOptionalParams, + BatchAccountGetDetectorOptionalParams, + BatchAccountListOutboundNetworkDependenciesEndpointsOptionalParams, + BatchAccountGetKeysOptionalParams, + BatchAccountRegenerateKeyOptionalParams, + BatchAccountSynchronizeAutoStorageKeysOptionalParams, + BatchAccountListOptionalParams, + BatchAccountListByResourceGroupOptionalParams, + BatchAccountDeleteOptionalParams, + BatchAccountUpdateOptionalParams, + BatchAccountCreateOptionalParams, + BatchAccountGetOptionalParams, +} from "./api/batchAccount/index.js"; +export { + LocationCheckNameAvailabilityOptionalParams, + LocationListSupportedVirtualMachineSkusOptionalParams, + LocationGetQuotasOptionalParams, +} from "./api/location/index.js"; +export { + NetworkSecurityPerimeterReconcileConfigurationOptionalParams, + NetworkSecurityPerimeterListConfigurationsOptionalParams, + NetworkSecurityPerimeterGetConfigurationOptionalParams, +} from "./api/networkSecurityPerimeter/index.js"; +export { OperationsListOptionalParams } from "./api/operations/index.js"; +export { + PoolStopResizeOptionalParams, + PoolDisableAutoScaleOptionalParams, + PoolListByBatchAccountOptionalParams, + PoolDeleteOptionalParams, + PoolUpdateOptionalParams, + PoolCreateOptionalParams, + PoolGetOptionalParams, +} from "./api/pool/index.js"; +export { + PrivateEndpointConnectionListByBatchAccountOptionalParams, + PrivateEndpointConnectionDeleteOptionalParams, + PrivateEndpointConnectionUpdateOptionalParams, + PrivateEndpointConnectionGetOptionalParams, +} from "./api/privateEndpointConnection/index.js"; +export { + PrivateLinkResourceListByBatchAccountOptionalParams, + PrivateLinkResourceGetOptionalParams, +} from "./api/privateLinkResource/index.js"; +export { + ApplicationOperations, + ApplicationPackageOperations, + BatchAccountOperations, + LocationOperations, + NetworkSecurityPerimeterOperations, + OperationsOperations, + PoolOperations, + PrivateEndpointConnectionOperations, + PrivateLinkResourceOperations, +} from "./classic/index.js"; +export { PageSettings, ContinuablePage, PagedAsyncIterableIterator }; +export { AzureClouds, AzureSupportedClouds }; diff --git a/sdk/batch/arm-batch/src/logger.ts b/sdk/batch/arm-batch/src/logger.ts new file mode 100644 index 000000000000..d3331649feaa --- /dev/null +++ b/sdk/batch/arm-batch/src/logger.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { createClientLogger } from "@azure/logger"; +export const logger = createClientLogger("arm-batch"); diff --git a/sdk/batch/arm-batch/src/lroImpl.ts b/sdk/batch/arm-batch/src/lroImpl.ts deleted file mode 100644 index d8bc98987053..000000000000 --- a/sdk/batch/arm-batch/src/lroImpl.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { AbortSignalLike } from "@azure/abort-controller"; -import { LongRunningOperation, LroResponse } from "@azure/core-lro"; - -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 2378f28b57ea..07513a5fb30f 100644 --- a/sdk/batch/arm-batch/src/models/index.ts +++ b/sdk/batch/arm-batch/src/models/index.ts @@ -1,2705 +1,185 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; - -/** Parameters supplied to the Create operation. */ -export interface BatchAccountCreateParameters { - /** The region in which to create the account. */ - location: string; - /** The user-specified tags associated with the account. */ - tags?: { [propertyName: string]: string }; - /** The identity of the Batch account. */ - identity?: BatchAccountIdentity; - /** The properties related to the auto-storage account. */ - autoStorage?: AutoStorageBaseProperties; - /** The pool allocation mode also affects how clients may authenticate to the Batch Service API. If the mode is BatchService, clients may authenticate using access keys or Microsoft Entra ID. If the mode is UserSubscription, clients must use Microsoft Entra ID. The default is BatchService. */ - poolAllocationMode?: PoolAllocationMode; - /** A reference to the Azure key vault associated with the Batch account. */ - keyVaultReference?: KeyVaultReference; - /** If not specified, the default value is 'enabled'. */ - publicNetworkAccess?: PublicNetworkAccessType; - /** The network profile only takes effect when publicNetworkAccess is enabled. */ - networkProfile?: NetworkProfile; - /** Configures how customer data is encrypted inside the Batch account. By default, accounts are encrypted using a Microsoft managed key. For additional control, a customer-managed key can be used instead. */ - encryption?: EncryptionProperties; - /** List of allowed authentication modes for the Batch account that can be used to authenticate with the data plane. This does not affect authentication with the control plane. */ - allowedAuthenticationModes?: AuthenticationMode[]; -} - -/** The properties related to the auto-storage account. */ -export interface AutoStorageBaseProperties { - /** The resource ID of the storage account to be used for auto-storage account. */ - storageAccountId: string; - /** The authentication mode which the Batch service will use to manage the auto-storage account. */ - authenticationMode?: AutoStorageAuthenticationMode; - /** The identity referenced here must be assigned to pools which have compute nodes that need access to auto-storage. */ - nodeIdentityReference?: ComputeNodeIdentityReference; -} - -/** The reference to a user assigned identity associated with the Batch pool which a compute node will use. */ -export interface ComputeNodeIdentityReference { - /** The ARM resource id of the user assigned identity. */ - resourceId?: string; -} - -/** Identifies the Azure key vault associated with a Batch account. */ -export interface KeyVaultReference { - /** The resource ID of the Azure key vault associated with the Batch account. */ - id: string; - /** The URL of the Azure key vault associated with the Batch account. */ - url: string; -} - -/** Network profile for Batch account, which contains network rule settings for each endpoint. */ -export interface NetworkProfile { - /** Network access profile for batchAccount endpoint (Batch account data plane API). */ - accountAccess?: EndpointAccessProfile; - /** Network access profile for nodeManagement endpoint (Batch service managing compute nodes for Batch pools). */ - nodeManagementAccess?: EndpointAccessProfile; -} - -/** Network access profile for Batch endpoint. */ -export interface EndpointAccessProfile { - /** Default action for endpoint access. It is only applicable when publicNetworkAccess is enabled. */ - defaultAction: EndpointAccessDefaultAction; - /** Array of IP ranges to filter client IP address. */ - ipRules?: IPRule[]; -} - -/** Rule to filter client IP address. */ -export interface IPRule { - /** Action when client IP address is matched. */ - action: "Allow"; - /** IPv4 address, or IPv4 address range in CIDR format. */ - value: string; -} - -/** Configures how customer data is encrypted inside the Batch account. By default, accounts are encrypted using a Microsoft managed key. For additional control, a customer-managed key can be used instead. */ -export interface EncryptionProperties { - /** Type of the key source. */ - keySource?: KeySource; - /** Additional details when using Microsoft.KeyVault */ - keyVaultProperties?: KeyVaultProperties; -} - -/** KeyVault configuration when using an encryption KeySource of Microsoft.KeyVault. */ -export interface KeyVaultProperties { - /** - * 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 - * The KeyVault has soft-delete and purge protection enabled - */ - keyIdentifier?: string; -} - -/** The identity of the Batch account, if configured. This is used when the user specifies 'Microsoft.KeyVault' as their Batch account encryption configuration or when `ManagedIdentity` is selected as the auto-storage authentication mode. */ -export interface BatchAccountIdentity { - /** - * The principal id of the Batch account. This property will only be provided for a system assigned identity. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly principalId?: string; - /** - * The tenant id associated with the Batch account. This property will only be provided for a system assigned identity. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly tenantId?: string; - /** The type of identity used for the Batch account. */ - type: ResourceIdentityType; - /** The list of user identities associated with the Batch account. */ - userAssignedIdentities?: { [propertyName: string]: UserAssignedIdentities }; -} - -/** The list of associated user identities. */ -export interface UserAssignedIdentities { - /** - * The principal id of user assigned identity. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly principalId?: string; - /** - * The client id of user assigned identity. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly clientId?: string; -} - -/** The private endpoint of the private endpoint connection. */ -export interface PrivateEndpoint { - /** - * The ARM resource identifier of the private endpoint. This is of the form /subscriptions/{subscription}/resourceGroups/{group}/providers/Microsoft.Network/privateEndpoints/{privateEndpoint}. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; -} - -/** The private link service connection state of the private endpoint connection */ -export interface PrivateLinkServiceConnectionState { - /** The status of the Batch private endpoint connection */ - status: PrivateLinkServiceConnectionStatus; - /** Description of the private Connection state */ - description?: string; - /** - * Action required on the private connection state - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly actionsRequired?: string; -} - -/** A definition of an Azure resource. */ -export interface AzureProxyResource { - /** - * The ID of the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * The name of the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * The type of the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** - * The ETag of the resource, used for concurrency statements. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly etag?: string; - /** The tags of the resource. */ - tags?: { [propertyName: string]: string }; -} - -/** A VM Family and its associated core quota for the Batch account. */ -export interface VirtualMachineFamilyCoreQuota { - /** - * The Virtual Machine family name. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * The core quota for the VM family for the Batch account. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly coreQuota?: number; -} - -/** A definition of an Azure resource. */ -export interface AzureResource { - /** - * The ID of the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * The name of the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * The type of the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** - * The location of the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly location?: string; - /** - * The tags of the resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly tags?: { [propertyName: string]: string }; -} - -/** An error response from the Batch service. */ -export interface CloudError { - /** The body of the error response. */ - error?: CloudErrorBody; -} - -/** An error response from the Batch service. */ -export interface CloudErrorBody { - /** An identifier for the error. Codes are invariant and are intended to be consumed programmatically. */ - code?: string; - /** A message describing the error, intended to be suitable for display in a user interface. */ - message?: string; - /** The target of the particular error. For example, the name of the property in error. */ - target?: string; - /** A list of additional details about the error. */ - details?: CloudErrorBody[]; -} - -/** Parameters for updating an Azure Batch account. */ -export interface BatchAccountUpdateParameters { - /** The user-specified tags associated with the account. */ - tags?: { [propertyName: string]: string }; - /** The identity of the Batch account. */ - identity?: BatchAccountIdentity; - /** The properties related to the auto-storage account. */ - autoStorage?: AutoStorageBaseProperties; - /** Configures how customer data is encrypted inside the Batch account. By default, accounts are encrypted using a Microsoft managed key. For additional control, a customer-managed key can be used instead. */ - encryption?: EncryptionProperties; - /** List of allowed authentication modes for the Batch account that can be used to authenticate with the data plane. This does not affect authentication with the control plane. */ - allowedAuthenticationModes?: AuthenticationMode[]; - /** If not specified, the default value is 'enabled'. */ - publicNetworkAccess?: PublicNetworkAccessType; - /** The network profile only takes effect when publicNetworkAccess is enabled. */ - networkProfile?: NetworkProfile; -} - -/** Values returned by the List operation. */ -export interface BatchAccountListResult { - /** The collection of Batch accounts returned by the listing operation. */ - value?: BatchAccount[]; - /** The continuation token. */ - nextLink?: string; -} - -/** Parameters supplied to the RegenerateKey operation. */ -export interface BatchAccountRegenerateKeyParameters { - /** The type of account key to regenerate. */ - keyName: AccountKeyType; -} - -/** A set of Azure Batch account keys. */ -export interface BatchAccountKeys { - /** - * The Batch account name. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly accountName?: string; - /** - * The primary key associated with the account. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly primary?: string; - /** - * The secondary key associated with the account. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly secondary?: string; -} - -/** Parameters for an activating an application package. */ -export interface ActivateApplicationPackageParameters { - /** The format of the application package binary file. */ - format: string; -} - -/** The result of performing list applications. */ -export interface ListApplicationsResult { - /** The list of applications. */ - value?: Application[]; - /** The URL to get the next set of results. */ - nextLink?: string; -} - -/** The result of performing list application packages. */ -export interface ListApplicationPackagesResult { - /** The list of application packages. */ - value?: ApplicationPackage[]; - /** The URL to get the next set of results. */ - nextLink?: string; -} - -/** Quotas associated with a Batch region for a particular subscription. */ -export interface BatchLocationQuota { - /** - * The number of Batch accounts that may be created under the subscription in the specified region. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly accountQuota?: number; -} - -/** The Batch List supported SKUs operation response. */ -export interface SupportedSkusResult { - /** The list of SKUs available for the Batch service in the location. */ - value: SupportedSku[]; - /** - * The URL to use for getting the next set of results. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nextLink?: string; -} - -/** Describes a Batch supported SKU. */ -export interface SupportedSku { - /** - * The name of the SKU. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * The family name of the SKU. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly familyName?: string; - /** - * A collection of capabilities which this SKU supports. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly capabilities?: SkuCapability[]; - /** - * The time when Azure Batch service will retire this SKU. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly batchSupportEndOfLife?: Date; -} - -/** A SKU capability, such as the number of cores. */ -export interface SkuCapability { - /** - * The name of the feature. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * The value of the feature. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly value?: string; -} - -/** Result of the request to list REST API operations. It contains a list of operations and a URL nextLink to get the next set of results. */ -export interface OperationListResult { - /** The list of operations supported by the resource provider. */ - value?: Operation[]; - /** The URL to get the next set of operation list results if there are any. */ - nextLink?: string; -} - -/** A REST API operation */ -export interface Operation { - /** This is of the format {provider}/{resource}/{operation} */ - name?: string; - /** Indicates whether the operation is a data action */ - isDataAction?: boolean; - /** The object that describes the operation. */ - display?: OperationDisplay; - /** The intended executor of the operation. */ - origin?: string; - /** Properties of the operation. */ - properties?: Record; -} - -/** The object that describes the operation. */ -export interface OperationDisplay { - /** Friendly name of the resource provider. */ - provider?: string; - /** For example: read, write, delete, or listKeys/action */ - operation?: string; - /** The resource type on which the operation is performed. */ - resource?: string; - /** The friendly name of the operation */ - description?: string; -} - -/** Parameters for a check name availability request. */ -export interface CheckNameAvailabilityParameters { - /** The name to check for availability */ - name: string; - /** The resource type. */ - type: "Microsoft.Batch/batchAccounts"; -} - -/** The CheckNameAvailability operation response. */ -export interface CheckNameAvailabilityResult { - /** - * Gets a boolean value that indicates whether the name is available for you to use. If true, the name is available. If false, the name has already been taken or invalid and cannot be used. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nameAvailable?: boolean; - /** - * Gets the reason that a Batch account name could not be used. The Reason element is only returned if NameAvailable is false. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly reason?: NameAvailabilityReason; - /** - * Gets an error message explaining the Reason value in more detail. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly message?: string; -} - -/** Values returned by the List operation. */ -export interface ListCertificatesResult { - /** The collection of returned certificates. */ - value?: Certificate[]; - /** The continuation token. */ - nextLink?: string; -} - -/** An error response from the Batch service. */ -export interface DeleteCertificateError { - /** An identifier for the error. Codes are invariant and are intended to be consumed programmatically. */ - code: string; - /** A message describing the error, intended to be suitable for display in a user interface. */ - message: string; - /** The target of the particular error. For example, the name of the property in error. */ - target?: string; - /** A list of additional details about the error. */ - details?: DeleteCertificateError[]; -} - -/** Base certificate properties. */ -export interface CertificateBaseProperties { - /** This must match the first portion of the certificate name. Currently required to be 'SHA1'. */ - thumbprintAlgorithm?: string; - /** This must match the thumbprint from the name. */ - thumbprint?: string; - /** The format of the certificate - either Pfx or Cer. If omitted, the default is Pfx. */ - format?: CertificateFormat; -} - -/** Values returned by the List operation. */ -export interface DetectorListResult { - /** The collection of Batch account detectors returned by the listing operation. */ - value?: DetectorResponse[]; - /** The URL to get the next set of results. */ - nextLink?: string; -} - -/** Values returned by the List operation. */ -export interface ListPrivateLinkResourcesResult { - /** The collection of returned private link resources. */ - value?: PrivateLinkResource[]; - /** The continuation token. */ - nextLink?: string; -} - -/** Values returned by the List operation. */ -export interface ListPrivateEndpointConnectionsResult { - /** The collection of returned private endpoint connection. */ - value?: PrivateEndpointConnection[]; - /** The continuation token. */ - nextLink?: string; -} - -/** Values returned by the List operation. */ -export interface ListPoolsResult { - /** The collection of returned pools. */ - value?: Pool[]; - /** The continuation token. */ - nextLink?: string; -} - -/** Deployment configuration properties. */ -export interface DeploymentConfiguration { - /** The configuration for compute nodes in a pool based on the Azure Virtual Machines infrastructure. */ - virtualMachineConfiguration?: VirtualMachineConfiguration; -} - -/** The configuration for compute nodes in a pool based on the Azure Virtual Machines infrastructure. */ -export interface VirtualMachineConfiguration { - /** A reference to an Azure Virtual Machines Marketplace image or the Azure Image resource of a custom Virtual Machine. To get the list of all imageReferences verified by Azure Batch, see the 'List supported node agent SKUs' operation. */ - imageReference: ImageReference; - /** The Batch node agent is a program that runs on each node in the pool, and provides the command-and-control interface between the node and the Batch service. There are different implementations of the node agent, known as SKUs, for different operating systems. You must specify a node agent SKU which matches the selected image reference. To get the list of supported node agent SKUs along with their list of verified image references, see the 'List supported node agent SKUs' operation. */ - nodeAgentSkuId: string; - /** This property must not be specified if the imageReference specifies a Linux OS image. */ - windowsConfiguration?: WindowsConfiguration; - /** This property must be specified if the compute nodes in the pool need to have empty data disks attached to them. */ - dataDisks?: DataDisk[]; - /** - * This only applies to images that contain the Windows operating system, and should only be used when you hold valid on-premises licenses for the nodes which will be deployed. If omitted, no on-premises licensing discount is applied. Values are: - * - * Windows_Server - The on-premises license is for Windows Server. - * Windows_Client - The on-premises license is for Windows Client. - * - */ - licenseType?: string; - /** If specified, setup is performed on each node in the pool to allow tasks to run in containers. All regular tasks and job manager tasks run on this pool must specify the containerSettings property, and all other tasks may specify it. */ - containerConfiguration?: ContainerConfiguration; - /** If specified, encryption is performed on each node in the pool during node provisioning. */ - diskEncryptionConfiguration?: DiskEncryptionConfiguration; - /** This configuration will specify rules on how nodes in the pool will be physically allocated. */ - nodePlacementConfiguration?: NodePlacementConfiguration; - /** If specified, the extensions mentioned in this configuration will be installed on each node. */ - extensions?: VMExtension[]; - /** Contains configuration for ephemeral OSDisk settings. */ - osDisk?: OSDisk; - /** Specifies the security profile settings for the virtual machine or virtual machine scale set. */ - securityProfile?: SecurityProfile; - /** The service artifact reference id in the form of /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactName}/vmArtifactsProfiles/{vmArtifactsProfilesName} */ - serviceArtifactReference?: ServiceArtifactReference; -} - -/** A reference to an Azure Virtual Machines Marketplace image or the Azure Image resource of a custom Virtual Machine. To get the list of all imageReferences verified by Azure Batch, see the 'List supported node agent SKUs' operation. */ -export interface ImageReference { - /** For example, Canonical or MicrosoftWindowsServer. */ - publisher?: string; - /** For example, UbuntuServer or WindowsServer. */ - offer?: string; - /** For example, 18.04-LTS or 2022-datacenter. */ - sku?: string; - /** A value of 'latest' can be specified to select the latest version of an image. If omitted, the default is 'latest'. */ - version?: string; - /** This property is mutually exclusive with other properties. The Azure Compute Gallery Image must have replicas in the same region as the Azure Batch account. For information about the firewall settings for the Batch node agent to communicate with the Batch service see https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. */ - id?: string; - /** This property is mutually exclusive with other properties and can be fetched from shared gallery image GET call. */ - sharedGalleryImageId?: string; - /** This property is mutually exclusive with other properties and can be fetched from community gallery image GET call. */ - communityGalleryImageId?: string; -} - -/** Windows operating system settings to apply to the virtual machine. */ -export interface WindowsConfiguration { - /** If omitted, the default value is true. */ - enableAutomaticUpdates?: boolean; -} - -/** Settings which will be used by the data disks associated to Compute Nodes in the Pool. When using attached data disks, you need to mount and format the disks from within a VM to use them. */ -export interface DataDisk { - /** The lun is used to uniquely identify each data disk. If attaching multiple disks, each should have a distinct lun. The value must be between 0 and 63, inclusive. */ - lun: number; - /** - * Values are: - * - * none - The caching mode for the disk is not enabled. - * readOnly - The caching mode for the disk is read only. - * readWrite - The caching mode for the disk is read and write. - * - * The default value for caching is none. For information about the caching options see: https://blogs.msdn.microsoft.com/windowsazurestorage/2012/06/27/exploring-windows-azure-drives-disks-and-images/. - */ - caching?: CachingType; - /** The initial disk size in GB when creating new data disk. */ - diskSizeGB: number; - /** - * If omitted, the default is "Standard_LRS". Values are: - * - * Standard_LRS - The data disk should use standard locally redundant storage. - * Premium_LRS - The data disk should use premium locally redundant storage. - */ - storageAccountType?: StorageAccountType; -} - -/** The configuration for container-enabled pools. */ -export interface ContainerConfiguration { - /** The container technology to be used. */ - 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. */ - containerRegistries?: ContainerRegistry[]; -} - -/** A private container registry. */ -export interface ContainerRegistry { - /** The user name to log into the registry server. */ - userName?: string; - /** The password to log into the registry server. */ - password?: string; - /** If omitted, the default is "docker.io". */ - registryServer?: string; - /** The reference to a user assigned identity associated with the Batch pool which a compute node will use. */ - identityReference?: ComputeNodeIdentityReference; -} - -/** The disk encryption configuration applied on compute nodes in the pool. Disk encryption configuration is not supported on Linux pool created with Virtual Machine Image or Azure Compute Gallery Image. */ -export interface DiskEncryptionConfiguration { - /** On Linux pool, only "TemporaryDisk" is supported; on Windows pool, "OsDisk" and "TemporaryDisk" must be specified. */ - targets?: DiskEncryptionTarget[]; -} - -/** Allocation configuration used by Batch Service to provision the nodes. */ -export interface NodePlacementConfiguration { - /** Allocation policy used by Batch Service to provision the nodes. If not specified, Batch will use the regional policy. */ - policy?: NodePlacementPolicyType; -} - -/** The configuration for virtual machine extensions. */ -export interface VMExtension { - /** The name of the virtual machine extension. */ - name: string; - /** The name of the extension handler publisher. */ - publisher: string; - /** The type of the extensions. */ - type: string; - /** The version of script handler. */ - 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. */ - protectedSettings?: Record; - /** Collection of extension names after which this extension needs to be provisioned. */ - provisionAfterExtensions?: string[]; -} - -/** Settings for the operating system disk of the virtual machine. */ -export interface OSDisk { - /** Specifies the ephemeral Disk Settings for the operating system disk used by the virtual machine. */ - ephemeralOSDiskSettings?: DiffDiskSettings; - /** The type of caching to enable for the disk. */ - caching?: CachingType; - managedDisk?: ManagedDisk; - /** The initial disk size in GB when creating new OS disk. */ - diskSizeGB?: number; - /** Specifies whether writeAccelerator should be enabled or disabled on the disk. */ - writeAcceleratorEnabled?: boolean; -} - -/** Specifies the ephemeral Disk Settings for the operating system disk used by the virtual machine. */ -export interface DiffDiskSettings { - /** This property can be used by user in the request to choose which location the operating system should be in. e.g., cache disk space for Ephemeral OS disk provisioning. For more information on Ephemeral OS disk size requirements, please refer to Ephemeral OS disk size requirements for Windows VMs at https://docs.microsoft.com/en-us/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements and Linux VMs at https://docs.microsoft.com/en-us/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements. */ - placement?: "CacheDisk"; -} - -export interface ManagedDisk { - /** The storage account type for use in creating data disks or OS disk. */ - storageAccountType?: StorageAccountType; - /** Specifies the security profile settings for the managed disk. **Note**: It can only be set for Confidential VMs and is required when using Confidential VMs. */ - securityProfile?: VMDiskSecurityProfile; -} - -/** Specifies the security profile settings for the managed disk. **Note**: It can only be set for Confidential VMs and is required when using Confidential VMs. */ -export interface VMDiskSecurityProfile { - /** Specifies the EncryptionType of the managed disk. It is set to VMGuestStateOnly for encryption of just the VMGuestState blob, and NonPersistedTPM for not persisting firmware state in the VMGuestState blob. **Note**: It can be set for only Confidential VMs and required when using Confidential VMs. */ - securityEncryptionType?: SecurityEncryptionTypes; -} - -/** Specifies the security profile settings for the virtual machine or virtual machine scale set. */ -export interface SecurityProfile { - /** Specifies the SecurityType of the virtual machine. It has to be set to any specified value to enable UefiSettings. */ - securityType?: SecurityTypes; - /** This property can be used by user in the request to enable or disable the Host Encryption for the virtual machine or virtual machine scale set. This will enable the encryption for all the disks including Resource/Temp disk at host itself. */ - encryptionAtHost?: boolean; - /** Specifies the security settings like secure boot and vTPM used while creating the virtual machine. */ - uefiSettings?: UefiSettings; -} - -/** Specifies the security settings like secure boot and vTPM used while creating the virtual machine. */ -export interface UefiSettings { - /** Specifies whether secure boot should be enabled on the virtual machine. */ - secureBootEnabled?: boolean; - /** Specifies whether vTPM should be enabled on the virtual machine. */ - vTpmEnabled?: boolean; -} - -/** Specifies the service artifact reference id used to set same image version for all virtual machines in the scale set when using 'latest' image version. */ -export interface ServiceArtifactReference { - /** The service artifact reference id in the form of /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactName}/vmArtifactsProfiles/{vmArtifactsProfilesName} */ - id: string; -} - -/** Defines the desired size of the pool. This can either be 'fixedScale' where the requested targetDedicatedNodes is specified, or 'autoScale' which defines a formula which is periodically reevaluated. If this property is not specified, the pool will have a fixed scale with 0 targetDedicatedNodes. */ -export interface ScaleSettings { - /** This property and autoScale are mutually exclusive and one of the properties must be specified. */ - fixedScale?: FixedScaleSettings; - /** This property and fixedScale are mutually exclusive and one of the properties must be specified. */ - autoScale?: AutoScaleSettings; -} - -/** Fixed scale settings for the pool. */ -export interface FixedScaleSettings { - /** The default value is 15 minutes. Timeout values use ISO 8601 format. For example, use PT10M for 10 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service rejects the request with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). */ - resizeTimeout?: string; - /** At least one of targetDedicatedNodes, targetLowPriorityNodes must be set. */ - targetDedicatedNodes?: number; - /** At least one of targetDedicatedNodes, targetLowPriorityNodes must be set. */ - targetLowPriorityNodes?: number; - /** If omitted, the default value is Requeue. */ - nodeDeallocationOption?: ComputeNodeDeallocationOption; -} - -/** AutoScale settings for the pool. */ -export interface AutoScaleSettings { - /** A formula for the desired number of compute nodes in the pool. */ - formula: string; - /** If omitted, the default value is 15 minutes (PT15M). */ - evaluationInterval?: string; -} - -/** The results and errors from an execution of a pool autoscale formula. */ -export interface AutoScaleRun { - /** The time at which the autoscale formula was last evaluated. */ - evaluationTime: Date; - /** Each variable value is returned in the form $variable=value, and variables are separated by semicolons. */ - results?: string; - /** An error that occurred when autoscaling a pool. */ - error?: AutoScaleRunError; -} - -/** An error that occurred when autoscaling a pool. */ -export interface AutoScaleRunError { - /** An identifier for the error. Codes are invariant and are intended to be consumed programmatically. */ - code: string; - /** A message describing the error, intended to be suitable for display in a user interface. */ - message: string; - /** Additional details about the error. */ - details?: AutoScaleRunError[]; -} - -/** The network configuration for a pool. */ -export interface NetworkConfiguration { - /** The virtual network must be in the same region and subscription as the Azure Batch account. The specified subnet should have enough free IP addresses to accommodate the number of nodes in the pool. If the subnet doesn't have enough free IP addresses, the pool will partially allocate compute nodes and a resize error will occur. The 'MicrosoftAzureBatch' service principal must have the 'Classic Virtual Machine Contributor' Role-Based Access Control (RBAC) role for the specified VNet. The specified subnet must allow communication from the Azure Batch service to be able to schedule tasks on the compute nodes. This can be verified by checking if the specified VNet has any associated Network Security Groups (NSG). If communication to the compute nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the compute nodes to unusable. If the specified VNet has any associated Network Security Groups (NSG), then a few reserved system ports must be enabled for inbound communication. Enable ports 29876 and 29877, as well as port 22 for Linux and port 3389 for Windows. Also enable outbound connections to Azure Storage on port 443. For more details see: https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration */ - subnetId?: string; - /** The scope of dynamic vnet assignment. */ - dynamicVnetAssignmentScope?: DynamicVNetAssignmentScope; - /** The endpoint configuration for a pool. */ - endpointConfiguration?: PoolEndpointConfiguration; - /** The public IP Address configuration of the networking configuration of a Pool. */ - 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. */ -export interface PoolEndpointConfiguration { - /** The maximum number of inbound NAT pools per Batch pool is 5. If the maximum number of inbound NAT pools is exceeded the request fails with HTTP status code 400. This cannot be specified if the IPAddressProvisioningType is NoPublicIPAddresses. */ - inboundNatPools: InboundNatPool[]; -} - -/** A inbound NAT pool that can be used to address specific ports on compute nodes in a Batch pool externally. */ -export interface InboundNatPool { - /** The name must be unique within a Batch pool, can contain letters, numbers, underscores, periods, and hyphens. Names must start with a letter or number, must end with a letter, number, or underscore, and cannot exceed 77 characters. If any invalid values are provided the request fails with HTTP status code 400. */ - name: string; - /** The protocol of the endpoint. */ - protocol: InboundEndpointProtocol; - /** This must be unique within a Batch pool. Acceptable values are between 1 and 65535 except for 22, 3389, 29876 and 29877 as these are reserved. If any reserved values are provided the request fails with HTTP status code 400. */ - backendPort: number; - /** Acceptable values range between 1 and 65534 except ports from 50000 to 55000 which are reserved. All ranges within a pool must be distinct and cannot overlap. If any reserved or overlapping values are provided the request fails with HTTP status code 400. */ - frontendPortRangeStart: number; - /** Acceptable values range between 1 and 65534 except ports from 50000 to 55000 which are reserved by the Batch service. All ranges within a pool must be distinct and cannot overlap. If any reserved or overlapping values are provided the request fails with HTTP status code 400. */ - frontendPortRangeEnd: number; - /** The maximum number of rules that can be specified across all the endpoints on a Batch pool is 25. If no network security group rules are specified, a default rule will be created to allow inbound access to the specified backendPort. If the maximum number of network security group rules is exceeded the request fails with HTTP status code 400. */ - networkSecurityGroupRules?: NetworkSecurityGroupRule[]; -} - -/** A network security group rule to apply to an inbound endpoint. */ -export interface NetworkSecurityGroupRule { - /** Priorities within a pool must be unique and are evaluated in order of priority. The lower the number the higher the priority. For example, rules could be specified with order numbers of 150, 250, and 350. The rule with the order number of 150 takes precedence over the rule that has an order of 250. Allowed priorities are 150 to 4096. If any reserved or duplicate values are provided the request fails with HTTP status code 400. */ - priority: number; - /** The action that should be taken for a specified IP address, subnet range or tag. */ - access: NetworkSecurityGroupRuleAccess; - /** Valid values are a single IP address (i.e. 10.10.10.10), IP subnet (i.e. 192.168.1.0/24), default tag, or * (for all addresses). If any other values are provided the request fails with HTTP status code 400. */ - sourceAddressPrefix: string; - /** Valid values are '*' (for all ports 0 - 65535) or arrays of ports or port ranges (i.e. 100-200). The ports should in the range of 0 to 65535 and the port ranges or ports can't overlap. If any other values are provided the request fails with HTTP status code 400. Default value will be *. */ - sourcePortRanges?: string[]; -} - -/** The public IP Address configuration of the networking configuration of a Pool. */ -export interface PublicIPAddressConfiguration { - /** The default value is BatchManaged */ - provision?: IPAddressProvisioningType; - /** The number of IPs specified here limits the maximum size of the Pool - 100 dedicated nodes or 100 Spot/low-priority nodes can be allocated for each public IP. For example, a pool needing 250 dedicated VMs would need at least 3 public IPs specified. Each element of this collection is of the form: /subscriptions/{subscription}/resourceGroups/{group}/providers/Microsoft.Network/publicIPAddresses/{ip}. */ - ipAddressIds?: string[]; -} - -/** Specifies how tasks should be distributed across compute nodes. */ -export interface TaskSchedulingPolicy { - /** How tasks should be distributed across compute nodes. */ - nodeFillType: ComputeNodeFillType; -} - -/** Properties used to create a user on an Azure Batch node. */ -export interface UserAccount { - /** The name of the user account. Names can contain any Unicode characters up to a maximum length of 20. */ - name: string; - /** The password for the user account. */ - password: string; - /** nonAdmin - The auto user is a standard user without elevated access. admin - The auto user is a user with elevated access and operates with full Administrator permissions. The default value is nonAdmin. */ - elevationLevel?: ElevationLevel; - /** This property is ignored if specified on a Windows pool. If not specified, the user is created with the default options. */ - linuxUserConfiguration?: LinuxUserConfiguration; - /** This property can only be specified if the user is on a Windows pool. If not specified and on a Windows pool, the user is created with the default options. */ - windowsUserConfiguration?: WindowsUserConfiguration; -} - -/** Properties used to create a user account on a Linux node. */ -export interface LinuxUserConfiguration { - /** The uid and gid properties must be specified together or not at all. If not specified the underlying operating system picks the uid. */ - uid?: number; - /** The uid and gid properties must be specified together or not at all. If not specified the underlying operating system picks the gid. */ - gid?: number; - /** The private key must not be password protected. The private key is used to automatically configure asymmetric-key based authentication for SSH between nodes in a Linux pool when the pool's enableInterNodeCommunication property is true (it is ignored if enableInterNodeCommunication is false). It does this by placing the key pair into the user's .ssh directory. If not specified, password-less SSH is not configured between nodes (no modification of the user's .ssh directory is done). */ - sshPrivateKey?: string; -} - -/** Properties used to create a user account on a Windows node. */ -export interface WindowsUserConfiguration { - /** Specifies login mode for the user. The default value is Interactive. */ - loginMode?: LoginMode; -} - -/** The Batch service does not assign any meaning to this metadata; it is solely for the use of user code. */ -export interface MetadataItem { - /** The name of the metadata item. */ - name: string; - /** The value of the metadata item. */ - value: string; -} - -/** In some cases the start task may be re-run even though the node was not rebooted. Due to this, start tasks should be idempotent and exit gracefully if the setup they're performing has already been done. Special care should be taken to avoid start tasks which create breakaway process or install/launch services from the start task working directory, as this will block Batch from being able to re-run the start task. */ -export interface StartTask { - /** The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. Required if any other properties of the startTask are specified. */ - commandLine?: string; - /** A list of files that the Batch service will download to the compute node before running the command line. */ - resourceFiles?: ResourceFile[]; - /** A list of environment variable settings for the start task. */ - environmentSettings?: EnvironmentSetting[]; - /** If omitted, the task runs as a non-administrative user unique to the task. */ - userIdentity?: UserIdentity; - /** The Batch service retries a task if its exit code is nonzero. Note that this value specifically controls the number of retries. The Batch service will try the task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries the task up to 4 times (one initial try and 3 retries). If the maximum retry count is 0, the Batch service does not retry the task. If the maximum retry count is -1, the Batch service retries the task without limit. Default is 0 */ - maxTaskRetryCount?: number; - /** If true and the start task fails on a compute node, the Batch service retries the start task up to its maximum retry count (maxTaskRetryCount). If the task has still not completed successfully after all retries, then the Batch service marks the compute node unusable, and will not schedule tasks to it. This condition can be detected via the node state and scheduling error detail. If false, the Batch service will not wait for the start task to complete. In this case, other tasks can start executing on the compute node while the start task is still running; and even if the start task fails, new tasks will continue to be scheduled on the node. The default is true. */ - waitForSuccess?: boolean; - /** When this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all task environment variables are mapped into the container, and the task command line is executed in the container. */ - containerSettings?: TaskContainerSettings; -} - -/** A single file or multiple files to be downloaded to a compute node. */ -export interface ResourceFile { - /** The autoStorageContainerName, storageContainerUrl and httpUrl properties are mutually exclusive and one of them must be specified. */ - autoStorageContainerName?: string; - /** The autoStorageContainerName, storageContainerUrl and httpUrl properties are mutually exclusive and one of them must be specified. This URL must be readable and listable from compute nodes. There are three ways to get such a URL for a container in Azure storage: include a Shared Access Signature (SAS) granting read and list permissions on the container, use a managed identity with read and list permissions, or set the ACL for the container to allow public access. */ - storageContainerUrl?: string; - /** The autoStorageContainerName, storageContainerUrl and httpUrl properties are mutually exclusive and one of them must be specified. If the URL points to Azure Blob Storage, it must be readable from compute nodes. There are three ways to get such a URL for a blob in Azure storage: include a Shared Access Signature (SAS) granting read permissions on the blob, use a managed identity with read permission, or set the ACL for the blob or its container to allow public access. */ - httpUrl?: string; - /** The property is valid only when autoStorageContainerName or storageContainerUrl is used. This prefix can be a partial filename or a subdirectory. If a prefix is not specified, all the files in the container will be downloaded. */ - blobPrefix?: string; - /** If the httpUrl property is specified, the filePath is required and describes the path which the file will be downloaded to, including the filename. Otherwise, if the autoStorageContainerName or storageContainerUrl property is specified, filePath is optional and is the directory to download the files to. In the case where filePath is used as a directory, any directory structure already associated with the input data will be retained in full and appended to the specified filePath directory. The specified relative path cannot break out of the task's working directory (for example by using '..'). */ - filePath?: string; - /** This property applies only to files being downloaded to Linux compute nodes. It will be ignored if it is specified for a resourceFile which will be downloaded to a Windows node. If this property is not specified for a Linux node, then a default value of 0770 is applied to the file. */ - fileMode?: string; - /** The reference to a user assigned identity associated with the Batch pool which a compute node will use. */ - identityReference?: ComputeNodeIdentityReference; -} - -/** An environment variable to be set on a task process. */ -export interface EnvironmentSetting { - /** The name of the environment variable. */ - name: string; - /** The value of the environment variable. */ - value?: string; -} - -/** Specify either the userName or autoUser property, but not both. */ -export interface UserIdentity { - /** The userName and autoUser properties are mutually exclusive; you must specify one but not both. */ - userName?: string; - /** The userName and autoUser properties are mutually exclusive; you must specify one but not both. */ - autoUser?: AutoUserSpecification; -} - -/** Specifies the parameters for the auto user that runs a task on the Batch service. */ -export interface AutoUserSpecification { - /** The default value is Pool. If the pool is running Windows a value of Task should be specified if stricter isolation between tasks is required. For example, if the task mutates the registry in a way which could impact other tasks, or if certificates have been specified on the pool which should not be accessible by normal tasks but should be accessible by start tasks. */ - scope?: AutoUserScope; - /** The default value is nonAdmin. */ - elevationLevel?: ElevationLevel; -} - -/** The container settings for a task. */ -export interface TaskContainerSettings { - /** These additional options are supplied as arguments to the "docker create" command, in addition to those controlled by the Batch Service. */ - containerRunOptions?: string; - /** This is the full image reference, as would be specified to "docker pull". If no tag is provided as part of the image name, the tag ":latest" is used as a default. */ - imageName: string; - /** This setting can be omitted if was already provided at pool creation. */ - registry?: ContainerRegistry; - /** A flag to indicate where the container task working directory is. The default is 'taskWorkingDirectory'. */ - workingDirectory?: ContainerWorkingDirectory; - /** If this array is null or be not present, container task will mount entire temporary disk drive in windows (or AZ_BATCH_NODE_ROOT_DIR in Linux). It won't' mount any data paths into container if this array is set as empty. */ - containerHostBatchBindMounts?: ContainerHostBatchBindMountEntry[]; -} - -/** The entry of path and mount mode you want to mount into task container. */ -export interface ContainerHostBatchBindMountEntry { - /** The paths which will be mounted to container task's container. */ - source?: ContainerHostDataPath; - /** For Linux, if you mount this path as a read/write mode, this does not mean that all users in container have the read/write access for the path, it depends on the access in host VM. If this path is mounted read-only, all users within the container will not be able to modify the path. */ - isReadOnly?: boolean; -} - -/** Warning: This object 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. */ -export interface CertificateReference { - /** The fully qualified ID of the certificate to install on the pool. This must be inside the same batch account as the pool. */ - id: string; - /** The default value is currentUser. This property is applicable only for pools configured with Windows compute nodes. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory. */ - storeLocation?: CertificateStoreLocation; - /** This property is applicable only for pools configured with Windows compute nodes. Common store names include: My, Root, CA, Trust, Disallowed, TrustedPeople, TrustedPublisher, AuthRoot, AddressBook, but any custom store name can also be used. The default value is My. */ - storeName?: string; - /** Which user accounts on the compute node should have access to the private data of the certificate. */ - visibility?: CertificateVisibility[]; -} - -/** Link to an application package inside the batch account */ -export interface ApplicationPackageReference { - /** The ID of the application package to install. This must be inside the same batch account as the pool. This can either be a reference to a specific version or the default version if one exists. */ - id: string; - /** If this is omitted, and no default version is specified for this application, the request fails with the error code InvalidApplicationPackageReferences. If you are calling the REST API directly, the HTTP status code is 409. */ - version?: string; -} - -/** Describes either the current operation (if the pool AllocationState is Resizing) or the previously completed operation (if the AllocationState is Steady). */ -export interface ResizeOperationStatus { - /** The desired number of dedicated compute nodes in the pool. */ - targetDedicatedNodes?: number; - /** The desired number of Spot/low-priority compute nodes in the pool. */ - targetLowPriorityNodes?: number; - /** The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). */ - resizeTimeout?: string; - /** The default value is requeue. */ - nodeDeallocationOption?: ComputeNodeDeallocationOption; - /** The time when this resize operation was started. */ - startTime?: Date; - /** This property is set only if an error occurred during the last pool resize, and only when the pool allocationState is Steady. */ - errors?: ResizeError[]; -} - -/** An error that occurred when resizing a pool. */ -export interface ResizeError { - /** An identifier for the error. Codes are invariant and are intended to be consumed programmatically. */ - code: string; - /** A message describing the error, intended to be suitable for display in a user interface. */ - message: string; - /** Additional details about the error. */ - details?: ResizeError[]; -} - -/** The file system to mount on each node. */ -export interface MountConfiguration { - /** This property is mutually exclusive with all other properties. */ - azureBlobFileSystemConfiguration?: AzureBlobFileSystemConfiguration; - /** This property is mutually exclusive with all other properties. */ - nfsMountConfiguration?: NFSMountConfiguration; - /** This property is mutually exclusive with all other properties. */ - cifsMountConfiguration?: CifsMountConfiguration; - /** This property is mutually exclusive with all other properties. */ - azureFileShareConfiguration?: AzureFileShareConfiguration; -} - -/** Information used to connect to an Azure Storage Container using Blobfuse. */ -export interface AzureBlobFileSystemConfiguration { - /** The Azure Storage Account name. */ - accountName: string; - /** The Azure Blob Storage Container name. */ - containerName: string; - /** This property is mutually exclusive with both sasKey and identity; exactly one must be specified. */ - accountKey?: string; - /** This property is mutually exclusive with both accountKey and identity; exactly one must be specified. */ - sasKey?: string; - /** These are 'net use' options in Windows and 'mount' options in Linux. */ - blobfuseOptions?: string; - /** All file systems are mounted relative to the Batch mounts directory, accessible via the AZ_BATCH_NODE_MOUNTS_DIR environment variable. */ - relativeMountPath: string; - /** This property is mutually exclusive with both accountKey and sasKey; exactly one must be specified. */ - identityReference?: ComputeNodeIdentityReference; -} - -/** Information used to connect to an NFS file system. */ -export interface NFSMountConfiguration { - /** The URI of the file system to mount. */ - source: string; - /** All file systems are mounted relative to the Batch mounts directory, accessible via the AZ_BATCH_NODE_MOUNTS_DIR environment variable. */ - relativeMountPath: string; - /** These are 'net use' options in Windows and 'mount' options in Linux. */ - mountOptions?: string; -} - -/** Information used to connect to a CIFS file system. */ -export interface CifsMountConfiguration { - /** The user to use for authentication against the CIFS file system. */ - userName: string; - /** The URI of the file system to mount. */ - source: string; - /** All file systems are mounted relative to the Batch mounts directory, accessible via the AZ_BATCH_NODE_MOUNTS_DIR environment variable. */ - relativeMountPath: string; - /** These are 'net use' options in Windows and 'mount' options in Linux. */ - mountOptions?: string; - /** The password to use for authentication against the CIFS file system. */ - password: string; -} - -/** Information used to connect to an Azure Fileshare. */ -export interface AzureFileShareConfiguration { - /** The Azure Storage account name. */ - accountName: string; - /** This is of the form 'https://{account}.file.core.windows.net/'. */ - azureFileUrl: string; - /** The Azure Storage account key. */ - accountKey: string; - /** All file systems are mounted relative to the Batch mounts directory, accessible via the AZ_BATCH_NODE_MOUNTS_DIR environment variable. */ - relativeMountPath: string; - /** These are 'net use' options in Windows and 'mount' options in Linux. */ - mountOptions?: string; -} - -/** Describes an upgrade policy - automatic, manual, or rolling. */ -export interface UpgradePolicy { - /** Specifies the mode of an upgrade to virtual machines in the scale set.

Possible values are:

**Manual** - You control the application of updates to virtual machines in the scale set. You do this by using the manualUpgrade action.

**Automatic** - All virtual machines in the scale set are automatically updated at the same time.

**Rolling** - Scale set performs updates in batches with an optional pause time in between. */ - mode: UpgradeMode; - /** The configuration parameters used for performing automatic OS upgrade. */ - automaticOSUpgradePolicy?: AutomaticOSUpgradePolicy; - /** The configuration parameters used while performing a rolling upgrade. */ - rollingUpgradePolicy?: RollingUpgradePolicy; -} - -/** The configuration parameters used for performing automatic OS upgrade. */ -export interface AutomaticOSUpgradePolicy { - /** Whether OS image rollback feature should be disabled. */ - disableAutomaticRollback?: boolean; - /** Indicates whether OS upgrades should automatically be applied to scale set instances in a rolling fashion when a newer version of the OS image becomes available.

If this is set to true for Windows based pools, [WindowsConfiguration.enableAutomaticUpdates](https://learn.microsoft.com/en-us/rest/api/batchmanagement/pool/create?tabs=HTTP#windowsconfiguration) cannot be set to true. */ - enableAutomaticOSUpgrade?: boolean; - /** Indicates whether rolling upgrade policy should be used during Auto OS Upgrade. Auto OS Upgrade will fallback to the default policy if no policy is defined on the VMSS. */ - useRollingUpgradePolicy?: boolean; - /** Defer OS upgrades on the TVMs if they are running tasks. */ - osRollingUpgradeDeferral?: boolean; -} - -/** The configuration parameters used while performing a rolling upgrade. */ -export interface RollingUpgradePolicy { - /** Allow VMSS to ignore AZ boundaries when constructing upgrade batches. Take into consideration the Update Domain and maxBatchInstancePercent to determine the batch size. If this field is not set, Azure Azure Batch will not set its default value. The value of enableCrossZoneUpgrade on the created VirtualMachineScaleSet will be decided by the default configurations on VirtualMachineScaleSet. This field is able to be set to true or false only when using NodePlacementConfiguration as Zonal. */ - enableCrossZoneUpgrade?: boolean; - /** The maximum percent of total virtual machine instances that will be upgraded simultaneously by the rolling upgrade in one batch. As this is a maximum, unhealthy instances in previous or future batches can cause the percentage of instances in a batch to decrease to ensure higher reliability. The value of this field should be between 5 and 100, inclusive. If both maxBatchInstancePercent and maxUnhealthyInstancePercent are assigned with value, the value of maxBatchInstancePercent should not be more than maxUnhealthyInstancePercent. */ - maxBatchInstancePercent?: number; - /** The maximum percentage of the total virtual machine instances in the scale set that can be simultaneously unhealthy, either as a result of being upgraded, or by being found in an unhealthy state by the virtual machine health checks before the rolling upgrade aborts. This constraint will be checked prior to starting any batch. The value of this field should be between 5 and 100, inclusive. If both maxBatchInstancePercent and maxUnhealthyInstancePercent are assigned with value, the value of maxBatchInstancePercent should not be more than maxUnhealthyInstancePercent. */ - maxUnhealthyInstancePercent?: number; - /** The maximum percentage of upgraded virtual machine instances that can be found to be in an unhealthy state. This check will happen after each batch is upgraded. If this percentage is ever exceeded, the rolling update aborts. The value of this field should be between 0 and 100, inclusive. */ - maxUnhealthyUpgradedInstancePercent?: number; - /** The wait time between completing the update for all virtual machines in one batch and starting the next batch. The time duration should be specified in ISO 8601 format. */ - pauseTimeBetweenBatches?: string; - /** Upgrade all unhealthy instances in a scale set before any healthy instances. */ - prioritizeUnhealthyInstances?: boolean; - /** Rollback failed instances to previous model if the Rolling Upgrade policy is violated. */ - rollbackFailedInstancesOnPolicyBreach?: boolean; -} - -/** The identity of the Batch pool, if configured. If the pool identity is updated during update an existing pool, only the new vms which are created after the pool shrinks to 0 will have the updated identities */ -export interface BatchPoolIdentity { - /** The type of identity used for the Batch Pool. */ - type: PoolIdentityType; - /** The list of user identities associated with the Batch pool. */ - userAssignedIdentities?: { [propertyName: string]: UserAssignedIdentities }; -} - -/** Values returned by the List operation. */ -export interface OutboundEnvironmentEndpointCollection { - /** - * The collection of outbound network dependency endpoints returned by the listing operation. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly value?: OutboundEnvironmentEndpoint[]; - /** The continuation token. */ - nextLink?: string; -} - -/** A collection of related endpoints from the same service for which the Batch service requires outbound access. */ -export interface OutboundEnvironmentEndpoint { - /** - * The type of service that the Batch service connects to. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly category?: string; - /** - * The endpoints for this service to which the Batch service makes outbound calls. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly endpoints?: EndpointDependency[]; -} - -/** A domain name and connection details used to access a dependency. */ -export interface EndpointDependency { - /** - * The domain name of the dependency. Domain names may be fully qualified or may contain a * wildcard. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly domainName?: string; - /** - * Human-readable supplemental information about the dependency and when it is applicable. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly description?: string; - /** - * The list of connection details for this endpoint. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly endpointDetails?: EndpointDetail[]; -} - -/** Details about the connection between the Batch service and the endpoint. */ -export interface EndpointDetail { - /** - * The port an endpoint is connected to. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly port?: number; -} - -/** Result of a list NSP (network security perimeter) configurations request. */ -export interface NetworkSecurityPerimeterConfigurationListResult { - /** Array of network security perimeter results. */ - value?: NetworkSecurityPerimeterConfiguration[]; - /** The link used to get the next page of results. */ - nextLink?: string; -} - -/** Network security configuration properties. */ -export interface NetworkSecurityPerimeterConfigurationProperties { - /** - * Provisioning state of a network security perimeter configuration that is being created or updated. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: NetworkSecurityPerimeterConfigurationProvisioningState; - /** - * List of provisioning issues, if any - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningIssues?: ProvisioningIssue[]; - /** Information about a network security perimeter (NSP) */ - networkSecurityPerimeter?: NetworkSecurityPerimeter; - /** Information about resource association */ - resourceAssociation?: ResourceAssociation; - /** Network security perimeter configuration profile */ - profile?: NetworkSecurityProfile; -} - -/** Describes a provisioning issue for a network security perimeter configuration */ -export interface ProvisioningIssue { - /** - * Name of the issue - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * Details of a provisioning issue for a network security perimeter (NSP) configuration. Resource providers should generate separate provisioning issue elements for each separate issue detected, and include a meaningful and distinctive description, as well as any appropriate suggestedResourceIds and suggestedAccessRules - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly properties?: ProvisioningIssueProperties; -} - -/** Details of a provisioning issue for a network security perimeter (NSP) configuration. Resource providers should generate separate provisioning issue elements for each separate issue detected, and include a meaningful and distinctive description, as well as any appropriate suggestedResourceIds and suggestedAccessRules */ -export interface ProvisioningIssueProperties { - /** - * Type of issue - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly issueType?: IssueType; - /** - * Severity of the issue. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly severity?: Severity; - /** - * Description of the issue - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly description?: string; - /** - * Fully qualified resource IDs of suggested resources that can be associated to the network security perimeter (NSP) to remediate the issue. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly suggestedResourceIds?: string[]; - /** - * Access rules that can be added to the network security profile (NSP) to remediate the issue. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly suggestedAccessRules?: AccessRule[]; -} - -/** Access rule in a network security perimeter configuration profile */ -export interface AccessRule { - /** Name of the access rule */ - name?: string; - /** Properties of Access Rule */ - properties?: AccessRuleProperties; -} - -/** Properties of Access Rule */ -export interface AccessRuleProperties { - /** Direction of Access Rule */ - direction?: AccessRuleDirection; - /** Address prefixes in the CIDR format for inbound rules */ - addressPrefixes?: string[]; - /** Subscriptions for inbound rules */ - subscriptions?: AccessRulePropertiesSubscriptionsItem[]; - /** Network security perimeters for inbound rules */ - networkSecurityPerimeters?: NetworkSecurityPerimeter[]; - /** Fully qualified domain names (FQDN) for outbound rules */ - fullyQualifiedDomainNames?: string[]; - /** Email addresses for outbound rules */ - emailAddresses?: string[]; - /** Phone numbers for outbound rules */ - phoneNumbers?: string[]; -} - -/** Subscription identifiers */ -export interface AccessRulePropertiesSubscriptionsItem { - /** The fully qualified Azure resource ID of the subscription e.g. ('/subscriptions/00000000-0000-0000-0000-000000000000') */ - id?: string; -} - -/** Information about a network security perimeter (NSP) */ -export interface NetworkSecurityPerimeter { - /** Fully qualified Azure resource ID of the NSP resource */ - id?: string; - /** Universal unique ID (UUID) of the network security perimeter */ - perimeterGuid?: string; - /** Location of the network security perimeter */ - location?: string; -} - -/** Information about resource association */ -export interface ResourceAssociation { - /** Name of the resource association */ - name?: string; - /** Access mode of the resource association */ - accessMode?: ResourceAssociationAccessMode; -} - -/** Network security perimeter configuration profile */ -export interface NetworkSecurityProfile { - /** Name of the profile */ - name?: string; - /** Current access rules version */ - accessRulesVersion?: number; - /** List of Access Rules */ - accessRules?: AccessRule[]; - /** Current diagnostic settings version */ - diagnosticSettingsVersion?: number; - /** List of log categories that are enabled */ - enabledLogCategories?: string[]; -} - -/** Common fields that are returned in the response for all Azure Resource Manager resources */ -export interface Resource { - /** - * Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * The name of the resource - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly systemData?: SystemData; -} - -/** Metadata pertaining to creation and last modification of the resource. */ -export interface SystemData { - /** The identity that created the resource. */ - createdBy?: string; - /** The type of identity that created the resource. */ - createdByType?: CreatedByType; - /** The timestamp of resource creation (UTC). */ - createdAt?: Date; - /** The identity that last modified the resource. */ - lastModifiedBy?: string; - /** The type of identity that last modified the resource. */ - lastModifiedByType?: CreatedByType; - /** The timestamp of resource last modification (UTC) */ - lastModifiedAt?: Date; -} - -/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ -export interface ErrorResponse { - /** The error object. */ - error?: ErrorDetail; -} - -/** The error detail. */ -export interface ErrorDetail { - /** - * The error code. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly code?: string; - /** - * The error message. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly message?: string; - /** - * The error target. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly target?: string; - /** - * The error details. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly details?: ErrorDetail[]; - /** - * The error additional info. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly additionalInfo?: ErrorAdditionalInfo[]; -} - -/** The resource management error additional info. */ -export interface ErrorAdditionalInfo { - /** - * The additional info type. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** - * The additional info. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly info?: Record; -} - -/** Contains information about the auto-storage account associated with a Batch account. */ -export interface AutoStorageProperties extends AutoStorageBaseProperties { - /** The UTC time at which storage keys were last synchronized with the Batch account. */ - lastKeySync: Date; -} - -/** Contains information about a private link resource. */ -export interface PrivateEndpointConnection extends AzureProxyResource { - /** - * The provisioning state of the private endpoint connection. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: PrivateEndpointConnectionProvisioningState; - /** - * The private endpoint of the private endpoint connection. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly privateEndpoint?: PrivateEndpoint; - /** - * The value has one and only one group id. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly groupIds?: string[]; - /** The private link service connection state of the private endpoint connection */ - privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; -} - -/** An application package which represents a particular version of an application. */ -export interface ApplicationPackage extends AzureProxyResource { - /** - * The current state of the application package. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly state?: PackageState; - /** - * The format of the application package, if the package is active. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly format?: string; - /** - * The URL for the application package in Azure Storage. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly storageUrl?: string; - /** - * The UTC time at which the Azure Storage URL will expire. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly storageUrlExpiry?: Date; - /** - * The time at which the package was last activated, if the package is active. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly lastActivationTime?: Date; -} - -/** Contains information about an application in a Batch account. */ -export interface Application extends AzureProxyResource { - /** The display name for the application. */ - displayName?: string; - /** A value indicating whether packages within the application may be overwritten using the same version string. */ - allowUpdates?: boolean; - /** The package to use if a client requests the application but does not specify a version. This property can only be set to the name of an existing package. */ - defaultVersion?: string; -} - -/** Contains information about a certificate. */ -export interface Certificate extends AzureProxyResource { - /** This must match the first portion of the certificate name. Currently required to be 'SHA1'. */ - thumbprintAlgorithm?: string; - /** This must match the thumbprint from the name. */ - thumbprint?: string; - /** The format of the certificate - either Pfx or Cer. If omitted, the default is Pfx. */ - format?: CertificateFormat; - /** NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly provisioningState?: CertificateProvisioningState; - /** - * The time at which the certificate entered its current state. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningStateTransitionTime?: Date; - /** - * The previous provisioned state of the resource - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly previousProvisioningState?: CertificateProvisioningState; - /** - * The time at which the certificate entered its previous state. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly previousProvisioningStateTransitionTime?: Date; - /** - * The public key of the certificate. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly publicData?: string; - /** - * This is only returned when the certificate provisioningState is 'Failed'. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly deleteCertificateError?: DeleteCertificateError; -} - -/** Contains information about a certificate. */ -export interface CertificateCreateOrUpdateParameters - extends AzureProxyResource { - /** This must match the first portion of the certificate name. Currently required to be 'SHA1'. */ - thumbprintAlgorithm?: string; - /** This must match the thumbprint from the name. */ - thumbprint?: string; - /** The format of the certificate - either Pfx or Cer. If omitted, the default is Pfx. */ - format?: CertificateFormat; - /** The maximum size is 10KB. */ - data?: string; - /** This must not be specified if the certificate format is Cer. */ - password?: string; -} - -/** Contains the information for a detector. */ -export interface DetectorResponse extends AzureProxyResource { - /** A base64 encoded string that represents the content of a detector. */ - value?: string; -} - -/** Contains information about a private link resource. */ -export interface PrivateLinkResource extends AzureProxyResource { - /** - * The group id is used to establish the private link connection. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly groupId?: string; - /** - * The list of required members that are used to establish the private link connection. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly requiredMembers?: string[]; - /** - * The list of required zone names for the private DNS resource name - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly requiredZoneNames?: string[]; -} - -/** Contains information about a pool. */ -export interface Pool extends AzureProxyResource { - /** The type of identity used for the Batch Pool. */ - identity?: BatchPoolIdentity; - /** The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. */ - displayName?: string; - /** - * This is the last time at which the pool level data, such as the targetDedicatedNodes or autoScaleSettings, changed. It does not factor in node-level changes such as a compute node changing state. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly lastModified?: Date; - /** - * The creation time of the pool. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly creationTime?: Date; - /** - * The current state of the pool. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: PoolProvisioningState; - /** - * The time at which the pool entered its current state. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningStateTransitionTime?: Date; - /** - * Whether the pool is resizing. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly allocationState?: AllocationState; - /** - * The time at which the pool entered its current allocation state. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly allocationStateTransitionTime?: Date; - /** For information about available VM sizes, see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). */ - vmSize?: string; - /** Deployment configuration properties. */ - deploymentConfiguration?: DeploymentConfiguration; - /** - * The number of dedicated compute nodes currently in the pool. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly currentDedicatedNodes?: number; - /** - * The number of Spot/low-priority compute nodes currently in the pool. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly currentLowPriorityNodes?: number; - /** Defines the desired size of the pool. This can either be 'fixedScale' where the requested targetDedicatedNodes is specified, or 'autoScale' which defines a formula which is periodically reevaluated. If this property is not specified, the pool will have a fixed scale with 0 targetDedicatedNodes. */ - scaleSettings?: ScaleSettings; - /** - * This property is set only if the pool automatically scales, i.e. autoScaleSettings are used. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly autoScaleRun?: AutoScaleRun; - /** This imposes restrictions on which nodes can be assigned to the pool. Enabling this value can reduce the chance of the requested number of nodes to be allocated in the pool. If not specified, this value defaults to 'Disabled'. */ - interNodeCommunication?: InterNodeCommunicationState; - /** The network configuration for a pool. */ - networkConfiguration?: NetworkConfiguration; - /** The default value is 1. The maximum value is the smaller of 4 times the number of cores of the vmSize of the pool or 256. */ - taskSlotsPerNode?: number; - /** If not specified, the default is spread. */ - taskSchedulingPolicy?: TaskSchedulingPolicy; - /** The list of user accounts to be created on each node in the pool. */ - userAccounts?: UserAccount[]; - /** The Batch service does not assign any meaning to metadata; it is solely for the use of user code. */ - metadata?: MetadataItem[]; - /** In an PATCH (update) operation, this property can be set to an empty object to remove the start task from the pool. */ - startTask?: StartTask; - /** - * For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory. - * - * Warning: This property 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. - */ - certificates?: CertificateReference[]; - /** Changes to application package references affect all new compute nodes joining the pool, but do not affect compute nodes that are already in the pool until they are rebooted or reimaged. There is a maximum of 10 application package references on any given pool. */ - applicationPackages?: ApplicationPackageReference[]; - /** The list of application licenses must be a subset of available Batch service application licenses. If a license is requested which is not supported, pool creation will fail. */ - applicationLicenses?: string[]; - /** - * Describes either the current operation (if the pool AllocationState is Resizing) or the previously completed operation (if the AllocationState is Steady). - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly resizeOperationStatus?: ResizeOperationStatus; - /** This supports Azure Files, NFS, CIFS/SMB, and Blobfuse. */ - mountConfiguration?: MountConfiguration[]; - /** If omitted, the default value is Default. */ - targetNodeCommunicationMode?: NodeCommunicationMode; - /** - * Determines how a pool communicates with the Batch service. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly currentNodeCommunicationMode?: NodeCommunicationMode; - /** Describes an upgrade policy - automatic, manual, or rolling. */ - upgradePolicy?: UpgradePolicy; - /** The user-defined tags to be associated with the Azure Batch Pool. When specified, these tags are propagated to the backing Azure resources associated with the pool. This property can only be specified when the Batch account was created with the poolAllocationMode property set to 'UserSubscription'. */ - resourceTags?: { [propertyName: string]: string }; -} - -/** Contains information about an Azure Batch account. */ -export interface BatchAccount extends AzureResource { - /** The identity of the Batch account. */ - identity?: BatchAccountIdentity; - /** - * The account endpoint used to interact with the Batch service. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly accountEndpoint?: string; - /** - * The endpoint used by compute node to connect to the Batch node management service. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nodeManagementEndpoint?: string; - /** - * The provisioned state of the resource - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: ProvisioningState; - /** - * The allocation mode for creating pools in the Batch account. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly poolAllocationMode?: PoolAllocationMode; - /** - * Identifies the Azure key vault associated with a Batch account. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly keyVaultReference?: KeyVaultReference; - /** If not specified, the default value is 'enabled'. */ - publicNetworkAccess?: PublicNetworkAccessType; - /** The network profile only takes effect when publicNetworkAccess is enabled. */ - networkProfile?: NetworkProfile; - /** - * List of private endpoint connections associated with the Batch account - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly privateEndpointConnections?: PrivateEndpointConnection[]; - /** - * Contains information about the auto-storage account associated with a Batch account. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly autoStorage?: AutoStorageProperties; - /** - * Configures how customer data is encrypted inside the Batch account. By default, accounts are encrypted using a Microsoft managed key. For additional control, a customer-managed key can be used instead. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly encryption?: EncryptionProperties; - /** - * For accounts with PoolAllocationMode set to UserSubscription, quota is managed on the subscription so this value is not returned. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly dedicatedCoreQuota?: number; - /** - * For accounts with PoolAllocationMode set to UserSubscription, quota is managed on the subscription so this value is not returned. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly lowPriorityCoreQuota?: number; - /** - * A list of the dedicated core quota per Virtual Machine family for the Batch account. For accounts with PoolAllocationMode set to UserSubscription, quota is managed on the subscription so this value is not returned. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly dedicatedCoreQuotaPerVMFamily?: VirtualMachineFamilyCoreQuota[]; - /** - * If this flag is true, dedicated core quota is enforced via both the dedicatedCoreQuotaPerVMFamily and dedicatedCoreQuota properties on the account. If this flag is false, dedicated core quota is enforced only via the dedicatedCoreQuota property on the account and does not consider Virtual Machine family. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly dedicatedCoreQuotaPerVMFamilyEnforced?: boolean; - /** - * The pool quota for the Batch account. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly poolQuota?: number; - /** - * The active job and job schedule quota for the Batch account. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly activeJobAndJobScheduleQuota?: number; - /** - * List of allowed authentication modes for the Batch account that can be used to authenticate with the data plane. This does not affect authentication with the control plane. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly allowedAuthenticationModes?: AuthenticationMode[]; -} - -/** Certificate properties. */ -export interface CertificateProperties extends CertificateBaseProperties { - /** NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly provisioningState?: CertificateProvisioningState; - /** - * The time at which the certificate entered its current state. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningStateTransitionTime?: Date; - /** - * The previous provisioned state of the resource - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly previousProvisioningState?: CertificateProvisioningState; - /** - * The time at which the certificate entered its previous state. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly previousProvisioningStateTransitionTime?: Date; - /** - * The public key of the certificate. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly publicData?: string; - /** - * This is only returned when the certificate provisioningState is 'Failed'. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly deleteCertificateError?: DeleteCertificateError; -} - -/** Certificate properties for create operations */ -export interface CertificateCreateOrUpdateProperties - extends CertificateBaseProperties { - /** The maximum size is 10KB. */ - data: string; - /** This must not be specified if the certificate format is Cer. */ - password?: string; -} - -/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ -export interface ProxyResource extends Resource {} - -/** Network security perimeter (NSP) configuration resource */ -export interface NetworkSecurityPerimeterConfiguration extends ProxyResource { - /** Network security configuration properties. */ - properties?: NetworkSecurityPerimeterConfigurationProperties; -} - -/** Defines headers for BatchAccount_create operation. */ -export interface BatchAccountCreateHeaders { - /** The URL of the resource used to check the status of the asynchronous operation. */ - location?: string; - /** Suggested delay to check the status of the asynchronous operation. The value is an integer that specifies the delay in seconds. */ - retryAfter?: number; -} - -/** Defines headers for BatchAccount_delete operation. */ -export interface BatchAccountDeleteHeaders { - /** The URL of the resource used to check the status of the asynchronous operation. */ - location?: string; - /** Suggested delay to check the status of the asynchronous operation. The value is an integer that specifies the delay in seconds. */ - retryAfter?: number; -} - -/** Defines headers for Certificate_create operation. */ -export interface CertificateCreateHeaders { - /** The ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. */ - eTag?: string; -} - -/** Defines headers for Certificate_update operation. */ -export interface CertificateUpdateHeaders { - /** The ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. */ - eTag?: string; -} - -/** Defines headers for Certificate_delete operation. */ -export interface CertificateDeleteHeaders { - /** The URL of the resource used to check the status of the asynchronous operation. */ - location?: string; - /** Suggested delay to check the status of the asynchronous operation. The value is an integer that represents the seconds. */ - retryAfter?: number; -} - -/** Defines headers for Certificate_get operation. */ -export interface CertificateGetHeaders { - /** The ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. */ - eTag?: string; -} - -/** Defines headers for Certificate_cancelDeletion operation. */ -export interface CertificateCancelDeletionHeaders { - /** The ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. */ - eTag?: string; -} - -/** Defines headers for PrivateEndpointConnection_update operation. */ -export interface PrivateEndpointConnectionUpdateHeaders { - /** The URL of the resource used to check the status of the asynchronous operation. */ - location?: string; - /** Suggested delay to check the status of the asynchronous operation. The value is an integer that represents the seconds. */ - retryAfter?: number; -} - -/** Defines headers for PrivateEndpointConnection_delete operation. */ -export interface PrivateEndpointConnectionDeleteHeaders { - /** The URL of the resource used to check the status of the asynchronous operation. */ - location?: string; - /** Suggested delay to check the status of the asynchronous operation. The value is an integer that specifies the delay in seconds. */ - retryAfter?: number; -} - -/** Defines headers for Pool_create operation. */ -export interface PoolCreateHeaders { - /** The ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. */ - eTag?: string; -} - -/** Defines headers for Pool_update operation. */ -export interface PoolUpdateHeaders { - /** The ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. */ - eTag?: string; -} - -/** Defines headers for Pool_delete operation. */ -export interface PoolDeleteHeaders { - /** The URL of the resource used to check the status of the asynchronous operation. */ - location?: string; - /** Suggested delay to check the status of the asynchronous operation. The value is an integer that represents the seconds. */ - retryAfter?: number; -} - -/** Defines headers for Pool_get operation. */ -export interface PoolGetHeaders { - /** The ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. */ - eTag?: string; -} - -/** Defines headers for Pool_disableAutoScale operation. */ -export interface PoolDisableAutoScaleHeaders { - /** The ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. */ - eTag?: string; -} - -/** Defines headers for Pool_stopResize operation. */ -export interface PoolStopResizeHeaders { - /** The ETag HTTP response header. This is an opaque string. You can use it to detect whether the resource has changed between requests. In particular, you can pass the ETag to one of the If-Match or If-None-Match headers. */ - eTag?: string; -} - -/** Defines headers for NetworkSecurityPerimeter_reconcileConfiguration operation. */ -export interface NetworkSecurityPerimeterReconcileConfigurationHeaders { - /** The URL of the resource used to check the status of the asynchronous operation. */ - location?: string; - /** Suggested delay to check the status of the asynchronous operation. The value is an integer that specifies the delay in seconds. */ - retryAfter?: number; -} - -/** 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; - -/** Known values of {@link SecurityEncryptionTypes} that the service accepts. */ -export enum KnownSecurityEncryptionTypes { - /** NonPersistedTPM */ - NonPersistedTPM = "NonPersistedTPM", - /** VMGuestStateOnly */ - VMGuestStateOnly = "VMGuestStateOnly", -} - -/** - * Defines values for SecurityEncryptionTypes. \ - * {@link KnownSecurityEncryptionTypes} can be used interchangeably with SecurityEncryptionTypes, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **NonPersistedTPM** \ - * **VMGuestStateOnly** - */ -export type SecurityEncryptionTypes = string; - -/** Known values of {@link ContainerHostDataPath} that the service accepts. */ -export enum KnownContainerHostDataPath { - /** The path for multi-instances task to shared their files. */ - Shared = "Shared", - /** The path for start task. */ - Startup = "Startup", - /** The path contains all virtual file systems are mounted on this node. */ - VfsMounts = "VfsMounts", - /** The task path. */ - Task = "Task", - /** The job-prep task path. */ - JobPrep = "JobPrep", - /** The applications path. */ - Applications = "Applications", -} - -/** - * Defines values for ContainerHostDataPath. \ - * {@link KnownContainerHostDataPath} can be used interchangeably with ContainerHostDataPath, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Shared**: The path for multi-instances task to shared their files. \ - * **Startup**: The path for start task. \ - * **VfsMounts**: The path contains all virtual file systems are mounted on this node. \ - * **Task**: The task path. \ - * **JobPrep**: The job-prep task path. \ - * **Applications**: The applications path. - */ -export type ContainerHostDataPath = string; - -/** Known values of {@link NetworkSecurityPerimeterConfigurationProvisioningState} that the service accepts. */ -export enum KnownNetworkSecurityPerimeterConfigurationProvisioningState { - /** Succeeded */ - Succeeded = "Succeeded", - /** Creating */ - Creating = "Creating", - /** Updating */ - Updating = "Updating", - /** Deleting */ - Deleting = "Deleting", - /** Accepted */ - Accepted = "Accepted", - /** Failed */ - Failed = "Failed", - /** Canceled */ - Canceled = "Canceled", -} - -/** - * Defines values for NetworkSecurityPerimeterConfigurationProvisioningState. \ - * {@link KnownNetworkSecurityPerimeterConfigurationProvisioningState} can be used interchangeably with NetworkSecurityPerimeterConfigurationProvisioningState, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Succeeded** \ - * **Creating** \ - * **Updating** \ - * **Deleting** \ - * **Accepted** \ - * **Failed** \ - * **Canceled** - */ -export type NetworkSecurityPerimeterConfigurationProvisioningState = string; - -/** Known values of {@link IssueType} that the service accepts. */ -export enum KnownIssueType { - /** Unknown issue type */ - Unknown = "Unknown", - /** An error occurred while applying the network security perimeter (NSP) configuration. */ - ConfigurationPropagationFailure = "ConfigurationPropagationFailure", - /** A network connectivity issue is happening on the resource which could be addressed either by adding new resources to the network security perimeter (NSP) or by modifying access rules. */ - MissingPerimeterConfiguration = "MissingPerimeterConfiguration", - /** An managed identity hasn't been associated with the resource. The resource will still be able to validate inbound traffic from the network security perimeter (NSP) or matching inbound access rules, but it won't be able to perform outbound access as a member of the NSP. */ - MissingIdentityConfiguration = "MissingIdentityConfiguration", -} - -/** - * Defines values for IssueType. \ - * {@link KnownIssueType} can be used interchangeably with IssueType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Unknown**: Unknown issue type \ - * **ConfigurationPropagationFailure**: An error occurred while applying the network security perimeter (NSP) configuration. \ - * **MissingPerimeterConfiguration**: A network connectivity issue is happening on the resource which could be addressed either by adding new resources to the network security perimeter (NSP) or by modifying access rules. \ - * **MissingIdentityConfiguration**: An managed identity hasn't been associated with the resource. The resource will still be able to validate inbound traffic from the network security perimeter (NSP) or matching inbound access rules, but it won't be able to perform outbound access as a member of the NSP. - */ -export type IssueType = string; - -/** Known values of {@link Severity} that the service accepts. */ -export enum KnownSeverity { - /** Warning */ - Warning = "Warning", - /** Error */ - Error = "Error", -} - -/** - * Defines values for Severity. \ - * {@link KnownSeverity} can be used interchangeably with Severity, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Warning** \ - * **Error** - */ -export type Severity = string; - -/** Known values of {@link AccessRuleDirection} that the service accepts. */ -export enum KnownAccessRuleDirection { - /** Applies to inbound network traffic to the secured resources. */ - Inbound = "Inbound", - /** Applies to outbound network traffic from the secured resources */ - Outbound = "Outbound", -} - -/** - * Defines values for AccessRuleDirection. \ - * {@link KnownAccessRuleDirection} can be used interchangeably with AccessRuleDirection, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Inbound**: Applies to inbound network traffic to the secured resources. \ - * **Outbound**: Applies to outbound network traffic from the secured resources - */ -export type AccessRuleDirection = string; - -/** Known values of {@link ResourceAssociationAccessMode} that the service accepts. */ -export enum KnownResourceAssociationAccessMode { - /** Enforced access mode - traffic to the resource that failed access checks is blocked */ - Enforced = "Enforced", - /** Learning access mode - traffic to the resource is enabled for analysis but not blocked */ - Learning = "Learning", - /** Audit access mode - traffic to the resource that fails access checks is logged but not blocked */ - Audit = "Audit", -} - -/** - * Defines values for ResourceAssociationAccessMode. \ - * {@link KnownResourceAssociationAccessMode} can be used interchangeably with ResourceAssociationAccessMode, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Enforced**: Enforced access mode - traffic to the resource that failed access checks is blocked \ - * **Learning**: Learning access mode - traffic to the resource is enabled for analysis but not blocked \ - * **Audit**: Audit access mode - traffic to the resource that fails access checks is logged but not blocked - */ -export type ResourceAssociationAccessMode = string; - -/** Known values of {@link CreatedByType} that the service accepts. */ -export enum KnownCreatedByType { - /** User */ - User = "User", - /** Application */ - Application = "Application", - /** ManagedIdentity */ - ManagedIdentity = "ManagedIdentity", - /** Key */ - Key = "Key", -} - -/** - * Defines values for CreatedByType. \ - * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **User** \ - * **Application** \ - * **ManagedIdentity** \ - * **Key** - */ -export type CreatedByType = string; -/** Defines values for AutoStorageAuthenticationMode. */ -export type AutoStorageAuthenticationMode = - | "StorageKeys" - | "BatchAccountManagedIdentity"; -/** Defines values for PoolAllocationMode. */ -export type PoolAllocationMode = "BatchService" | "UserSubscription"; -/** Defines values for PublicNetworkAccessType. */ -export type PublicNetworkAccessType = - | "Enabled" - | "Disabled" - | "SecuredByPerimeter"; -/** Defines values for EndpointAccessDefaultAction. */ -export type EndpointAccessDefaultAction = "Allow" | "Deny"; -/** Defines values for KeySource. */ -export type KeySource = "Microsoft.Batch" | "Microsoft.KeyVault"; -/** Defines values for AuthenticationMode. */ -export type AuthenticationMode = - | "SharedKey" - | "AAD" - | "TaskAuthenticationToken"; -/** Defines values for ResourceIdentityType. */ -export type ResourceIdentityType = "SystemAssigned" | "UserAssigned" | "None"; -/** Defines values for ProvisioningState. */ -export type ProvisioningState = - | "Invalid" - | "Creating" - | "Deleting" - | "Succeeded" - | "Failed" - | "Cancelled"; -/** Defines values for PrivateEndpointConnectionProvisioningState. */ -export type PrivateEndpointConnectionProvisioningState = - | "Creating" - | "Updating" - | "Deleting" - | "Succeeded" - | "Failed" - | "Cancelled"; -/** Defines values for PrivateLinkServiceConnectionStatus. */ -export type PrivateLinkServiceConnectionStatus = - | "Approved" - | "Pending" - | "Rejected" - | "Disconnected"; -/** Defines values for AccountKeyType. */ -export type AccountKeyType = "Primary" | "Secondary"; -/** Defines values for PackageState. */ -export type PackageState = "Pending" | "Active"; -/** Defines values for NameAvailabilityReason. */ -export type NameAvailabilityReason = "Invalid" | "AlreadyExists"; -/** Defines values for CertificateProvisioningState. */ -export type CertificateProvisioningState = "Succeeded" | "Deleting" | "Failed"; -/** Defines values for CertificateFormat. */ -export type CertificateFormat = "Pfx" | "Cer"; -/** Defines values for PoolProvisioningState. */ -export type PoolProvisioningState = "Succeeded" | "Deleting"; -/** Defines values for AllocationState. */ -export type AllocationState = "Steady" | "Resizing" | "Stopping"; -/** Defines values for CachingType. */ -export type CachingType = "None" | "ReadOnly" | "ReadWrite"; -/** Defines values for StorageAccountType. */ -export type StorageAccountType = - | "Standard_LRS" - | "Premium_LRS" - | "StandardSSD_LRS"; -/** Defines values for DiskEncryptionTarget. */ -export type DiskEncryptionTarget = "OsDisk" | "TemporaryDisk"; -/** Defines values for NodePlacementPolicyType. */ -export type NodePlacementPolicyType = "Regional" | "Zonal"; -/** Defines values for SecurityTypes. */ -export type SecurityTypes = "trustedLaunch" | "confidentialVM"; -/** Defines values for ComputeNodeDeallocationOption. */ -export type ComputeNodeDeallocationOption = - | "Requeue" - | "Terminate" - | "TaskCompletion" - | "RetainedData"; -/** Defines values for InterNodeCommunicationState. */ -export type InterNodeCommunicationState = "Enabled" | "Disabled"; -/** Defines values for DynamicVNetAssignmentScope. */ -export type DynamicVNetAssignmentScope = "none" | "job"; -/** Defines values for InboundEndpointProtocol. */ -export type InboundEndpointProtocol = "TCP" | "UDP"; -/** Defines values for NetworkSecurityGroupRuleAccess. */ -export type NetworkSecurityGroupRuleAccess = "Allow" | "Deny"; -/** Defines values for IPAddressProvisioningType. */ -export type IPAddressProvisioningType = - | "BatchManaged" - | "UserManaged" - | "NoPublicIPAddresses"; -/** Defines values for ComputeNodeFillType. */ -export type ComputeNodeFillType = "Spread" | "Pack"; -/** Defines values for ElevationLevel. */ -export type ElevationLevel = "NonAdmin" | "Admin"; -/** Defines values for LoginMode. */ -export type LoginMode = "Batch" | "Interactive"; -/** Defines values for AutoUserScope. */ -export type AutoUserScope = "Task" | "Pool"; -/** Defines values for ContainerWorkingDirectory. */ -export type ContainerWorkingDirectory = - | "TaskWorkingDirectory" - | "ContainerImageDefault"; -/** Defines values for CertificateStoreLocation. */ -export type CertificateStoreLocation = "CurrentUser" | "LocalMachine"; -/** Defines values for CertificateVisibility. */ -export type CertificateVisibility = "StartTask" | "Task" | "RemoteUser"; -/** Defines values for NodeCommunicationMode. */ -export type NodeCommunicationMode = "Default" | "Classic" | "Simplified"; -/** Defines values for UpgradeMode. */ -export type UpgradeMode = "automatic" | "manual" | "rolling"; -/** Defines values for PoolIdentityType. */ -export type PoolIdentityType = "UserAssigned" | "None"; - -/** Optional parameters. */ -export interface BatchAccountCreateOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the create operation. */ -export type BatchAccountCreateResponse = BatchAccount; - -/** Optional parameters. */ -export interface BatchAccountUpdateOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the update operation. */ -export type BatchAccountUpdateResponse = BatchAccount; - -/** Optional parameters. */ -export interface BatchAccountDeleteOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface BatchAccountGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type BatchAccountGetResponse = BatchAccount; - -/** Optional parameters. */ -export interface BatchAccountListOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type BatchAccountListResponse = BatchAccountListResult; - -/** Optional parameters. */ -export interface BatchAccountListByResourceGroupOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroup operation. */ -export type BatchAccountListByResourceGroupResponse = BatchAccountListResult; - -/** Optional parameters. */ -export interface BatchAccountSynchronizeAutoStorageKeysOptionalParams - extends coreClient.OperationOptions {} - -/** Optional parameters. */ -export interface BatchAccountRegenerateKeyOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the regenerateKey operation. */ -export type BatchAccountRegenerateKeyResponse = BatchAccountKeys; - -/** Optional parameters. */ -export interface BatchAccountGetKeysOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the getKeys operation. */ -export type BatchAccountGetKeysResponse = BatchAccountKeys; - -/** Optional parameters. */ -export interface BatchAccountListDetectorsOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listDetectors operation. */ -export type BatchAccountListDetectorsResponse = DetectorListResult; - -/** Optional parameters. */ -export interface BatchAccountGetDetectorOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the getDetector operation. */ -export type BatchAccountGetDetectorResponse = DetectorResponse; - -/** Optional parameters. */ -export interface BatchAccountListOutboundNetworkDependenciesEndpointsOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listOutboundNetworkDependenciesEndpoints operation. */ -export type BatchAccountListOutboundNetworkDependenciesEndpointsResponse = - OutboundEnvironmentEndpointCollection; - -/** Optional parameters. */ -export interface BatchAccountListNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type BatchAccountListNextResponse = BatchAccountListResult; - -/** Optional parameters. */ -export interface BatchAccountListByResourceGroupNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroupNext operation. */ -export type BatchAccountListByResourceGroupNextResponse = - BatchAccountListResult; - -/** Optional parameters. */ -export interface BatchAccountListDetectorsNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listDetectorsNext operation. */ -export type BatchAccountListDetectorsNextResponse = DetectorListResult; - -/** Optional parameters. */ -export interface BatchAccountListOutboundNetworkDependenciesEndpointsNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listOutboundNetworkDependenciesEndpointsNext operation. */ -export type BatchAccountListOutboundNetworkDependenciesEndpointsNextResponse = - OutboundEnvironmentEndpointCollection; - -/** Optional parameters. */ -export interface ApplicationPackageActivateOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the activate operation. */ -export type ApplicationPackageActivateResponse = ApplicationPackage; - -/** Optional parameters. */ -export interface ApplicationPackageCreateOptionalParams - extends coreClient.OperationOptions { - /** The parameters for the request. */ - parameters?: ApplicationPackage; -} - -/** Contains response data for the create operation. */ -export type ApplicationPackageCreateResponse = ApplicationPackage; - -/** Optional parameters. */ -export interface ApplicationPackageDeleteOptionalParams - extends coreClient.OperationOptions {} - -/** Optional parameters. */ -export interface ApplicationPackageGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type ApplicationPackageGetResponse = ApplicationPackage; - -/** Optional parameters. */ -export interface ApplicationPackageListOptionalParams - extends coreClient.OperationOptions { - /** The maximum number of items to return in the response. */ - maxresults?: number; -} - -/** Contains response data for the list operation. */ -export type ApplicationPackageListResponse = ListApplicationPackagesResult; - -/** Optional parameters. */ -export interface ApplicationPackageListNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type ApplicationPackageListNextResponse = ListApplicationPackagesResult; - -/** Optional parameters. */ -export interface ApplicationCreateOptionalParams - extends coreClient.OperationOptions { - /** The parameters for the request. */ - parameters?: Application; -} - -/** Contains response data for the create operation. */ -export type ApplicationCreateResponse = Application; - -/** Optional parameters. */ -export interface ApplicationDeleteOptionalParams - extends coreClient.OperationOptions {} - -/** Optional parameters. */ -export interface ApplicationGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type ApplicationGetResponse = Application; - -/** Optional parameters. */ -export interface ApplicationUpdateOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the update operation. */ -export type ApplicationUpdateResponse = Application; - -/** Optional parameters. */ -export interface ApplicationListOptionalParams - extends coreClient.OperationOptions { - /** The maximum number of items to return in the response. */ - maxresults?: number; -} - -/** Contains response data for the list operation. */ -export type ApplicationListResponse = ListApplicationsResult; - -/** Optional parameters. */ -export interface ApplicationListNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type ApplicationListNextResponse = ListApplicationsResult; - -/** Optional parameters. */ -export interface LocationGetQuotasOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the getQuotas operation. */ -export type LocationGetQuotasResponse = BatchLocationQuota; - -/** Optional parameters. */ -export interface LocationListSupportedVirtualMachineSkusOptionalParams - 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; -} - -/** Contains response data for the listSupportedVirtualMachineSkus operation. */ -export type LocationListSupportedVirtualMachineSkusResponse = - SupportedSkusResult; - -/** Optional parameters. */ -export interface LocationCheckNameAvailabilityOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the checkNameAvailability operation. */ -export type LocationCheckNameAvailabilityResponse = CheckNameAvailabilityResult; - -/** Optional parameters. */ -export interface LocationListSupportedVirtualMachineSkusNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listSupportedVirtualMachineSkusNext operation. */ -export type LocationListSupportedVirtualMachineSkusNextResponse = - SupportedSkusResult; - -/** Optional parameters. */ -export interface OperationsListOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type OperationsListResponse = OperationListResult; - -/** Optional parameters. */ -export interface OperationsListNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type OperationsListNextResponse = OperationListResult; - -/** Optional parameters. */ -export interface CertificateListByBatchAccountOptionalParams - 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; -} - -/** Contains response data for the listByBatchAccount operation. */ -export type CertificateListByBatchAccountResponse = ListCertificatesResult; - -/** Optional parameters. */ -export interface CertificateCreateOptionalParams - extends coreClient.OperationOptions { - /** The entity state (ETag) version of the certificate to update. A value of "*" can be used to apply the operation only if the certificate already exists. If omitted, this operation will always be applied. */ - ifMatch?: string; - /** Set to '*' to allow a new certificate to be created, but to prevent updating an existing certificate. Other values will be ignored. */ - ifNoneMatch?: string; -} - -/** Contains response data for the create operation. */ -export type CertificateCreateResponse = CertificateCreateHeaders & Certificate; - -/** Optional parameters. */ -export interface CertificateUpdateOptionalParams - extends coreClient.OperationOptions { - /** The entity state (ETag) version of the certificate to update. This value can be omitted or set to "*" to apply the operation unconditionally. */ - ifMatch?: string; -} - -/** Contains response data for the update operation. */ -export type CertificateUpdateResponse = CertificateUpdateHeaders & Certificate; - -/** Optional parameters. */ -export interface CertificateDeleteOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface CertificateGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type CertificateGetResponse = CertificateGetHeaders & Certificate; - -/** Optional parameters. */ -export interface CertificateCancelDeletionOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the cancelDeletion operation. */ -export type CertificateCancelDeletionResponse = - CertificateCancelDeletionHeaders & Certificate; - -/** Optional parameters. */ -export interface CertificateListByBatchAccountNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByBatchAccountNext operation. */ -export type CertificateListByBatchAccountNextResponse = ListCertificatesResult; - -/** Optional parameters. */ -export interface PrivateLinkResourceListByBatchAccountOptionalParams - extends coreClient.OperationOptions { - /** The maximum number of items to return in the response. */ - maxresults?: number; -} - -/** Contains response data for the listByBatchAccount operation. */ -export type PrivateLinkResourceListByBatchAccountResponse = - ListPrivateLinkResourcesResult; - -/** Optional parameters. */ -export interface PrivateLinkResourceGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type PrivateLinkResourceGetResponse = PrivateLinkResource; - -/** Optional parameters. */ -export interface PrivateLinkResourceListByBatchAccountNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByBatchAccountNext operation. */ -export type PrivateLinkResourceListByBatchAccountNextResponse = - ListPrivateLinkResourcesResult; - -/** Optional parameters. */ -export interface PrivateEndpointConnectionListByBatchAccountOptionalParams - extends coreClient.OperationOptions { - /** The maximum number of items to return in the response. */ - maxresults?: number; -} - -/** Contains response data for the listByBatchAccount operation. */ -export type PrivateEndpointConnectionListByBatchAccountResponse = - ListPrivateEndpointConnectionsResult; - -/** Optional parameters. */ -export interface PrivateEndpointConnectionGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type PrivateEndpointConnectionGetResponse = PrivateEndpointConnection; - -/** Optional parameters. */ -export interface PrivateEndpointConnectionUpdateOptionalParams - extends coreClient.OperationOptions { - /** The state (ETag) version of the private endpoint connection to update. This value can be omitted or set to "*" to apply the operation unconditionally. */ - ifMatch?: string; - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the update operation. */ -export type PrivateEndpointConnectionUpdateResponse = PrivateEndpointConnection; - -/** Optional parameters. */ -export interface PrivateEndpointConnectionDeleteOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the delete operation. */ -export type PrivateEndpointConnectionDeleteResponse = - PrivateEndpointConnectionDeleteHeaders; - -/** Optional parameters. */ -export interface PrivateEndpointConnectionListByBatchAccountNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByBatchAccountNext operation. */ -export type PrivateEndpointConnectionListByBatchAccountNextResponse = - ListPrivateEndpointConnectionsResult; - -/** Optional parameters. */ -export interface PoolListByBatchAccountOptionalParams - 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; -} - -/** Contains response data for the listByBatchAccount operation. */ -export type PoolListByBatchAccountResponse = ListPoolsResult; - -/** Optional parameters. */ -export interface PoolCreateOptionalParams extends coreClient.OperationOptions { - /** The entity state (ETag) version of the pool to update. A value of "*" can be used to apply the operation only if the pool already exists. If omitted, this operation will always be applied. */ - ifMatch?: string; - /** Set to '*' to allow a new pool to be created, but to prevent updating an existing pool. Other values will be ignored. */ - ifNoneMatch?: string; -} - -/** Contains response data for the create operation. */ -export type PoolCreateResponse = PoolCreateHeaders & Pool; - -/** Optional parameters. */ -export interface PoolUpdateOptionalParams extends coreClient.OperationOptions { - /** The entity state (ETag) version of the pool to update. This value can be omitted or set to "*" to apply the operation unconditionally. */ - ifMatch?: string; -} - -/** Contains response data for the update operation. */ -export type PoolUpdateResponse = PoolUpdateHeaders & Pool; - -/** Optional parameters. */ -export interface PoolDeleteOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface PoolGetOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type PoolGetResponse = PoolGetHeaders & Pool; - -/** Optional parameters. */ -export interface PoolDisableAutoScaleOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the disableAutoScale operation. */ -export type PoolDisableAutoScaleResponse = PoolDisableAutoScaleHeaders & Pool; - -/** Optional parameters. */ -export interface PoolStopResizeOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the stopResize operation. */ -export type PoolStopResizeResponse = PoolStopResizeHeaders & Pool; - -/** Optional parameters. */ -export interface PoolListByBatchAccountNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByBatchAccountNext operation. */ -export type PoolListByBatchAccountNextResponse = ListPoolsResult; - -/** Optional parameters. */ -export interface NetworkSecurityPerimeterListConfigurationsOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listConfigurations operation. */ -export type NetworkSecurityPerimeterListConfigurationsResponse = - NetworkSecurityPerimeterConfigurationListResult; - -/** Optional parameters. */ -export interface NetworkSecurityPerimeterGetConfigurationOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the getConfiguration operation. */ -export type NetworkSecurityPerimeterGetConfigurationResponse = - NetworkSecurityPerimeterConfiguration; - -/** Optional parameters. */ -export interface NetworkSecurityPerimeterReconcileConfigurationOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the reconcileConfiguration operation. */ -export type NetworkSecurityPerimeterReconcileConfigurationResponse = - NetworkSecurityPerimeterReconcileConfigurationHeaders; - -/** Optional parameters. */ -export interface NetworkSecurityPerimeterListConfigurationsNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listConfigurationsNext operation. */ -export type NetworkSecurityPerimeterListConfigurationsNextResponse = - NetworkSecurityPerimeterConfigurationListResult; - -/** Optional parameters. */ -export interface BatchManagementClientOptionalParams - extends coreClient.ServiceClientOptions { - /** server parameter */ - $host?: string; - /** Api Version */ - apiVersion?: string; - /** Overrides client endpoint. */ - endpoint?: string; -} +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + Operation, + OperationDisplay, + CloudError, + CloudErrorBody, + BatchAccount, + BatchAccountProperties, + ProvisioningState, + PoolAllocationMode, + KeyVaultReference, + PublicNetworkAccessType, + NetworkProfile, + EndpointAccessProfile, + EndpointAccessDefaultAction, + IPRule, + IPRuleAction, + PrivateEndpointConnection, + PrivateEndpointConnectionProperties, + PrivateEndpointConnectionProvisioningState, + PrivateEndpoint, + PrivateLinkServiceConnectionState, + PrivateLinkServiceConnectionStatus, + AutoStorageProperties, + EncryptionProperties, + KeySource, + KeyVaultProperties, + VirtualMachineFamilyCoreQuota, + AuthenticationMode, + BatchAccountIdentity, + ResourceIdentityType, + UserAssignedIdentities, + ProxyResource, + Resource, + SystemData, + KnownCreatedByType, + CreatedByType, + AutoStorageBaseProperties, + AutoStorageAuthenticationMode, + ComputeNodeIdentityReference, + TrackedResource, + BatchAccountCreateParameters, + BatchAccountCreateProperties, + ErrorDetail, + ErrorAdditionalInfo, + BatchAccountUpdateParameters, + BatchAccountUpdateProperties, + BatchAccountRegenerateKeyParameters, + AccountKeyType, + BatchAccountKeys, + OutboundEnvironmentEndpoint, + EndpointDependency, + EndpointDetail, + DetectorResponse, + DetectorResponseProperties, + ApplicationPackage, + ApplicationPackageProperties, + PackageState, + ActivateApplicationPackageParameters, + Application, + ApplicationProperties, + PrivateLinkResource, + PrivateLinkResourceProperties, + Pool, + PoolProperties, + PoolProvisioningState, + AllocationState, + DeploymentConfiguration, + VirtualMachineConfiguration, + ImageReference, + WindowsConfiguration, + DataDisk, + CachingType, + ManagedDisk, + StorageAccountType, + VMDiskSecurityProfile, + KnownSecurityEncryptionTypes, + SecurityEncryptionTypes, + DiskEncryptionSetParameters, + ContainerConfiguration, + KnownContainerType, + ContainerType, + ContainerRegistry, + DiskEncryptionConfiguration, + DiskEncryptionTarget, + DiskCustomerManagedKey, + NodePlacementConfiguration, + NodePlacementPolicyType, + VMExtension, + OSDisk, + DiffDiskSettings, + DiffDiskPlacement, + SecurityProfile, + SecurityTypes, + UefiSettings, + ProxyAgentSettings, + HostEndpointSettings, + KnownHostEndpointSettingsModeTypes, + HostEndpointSettingsModeTypes, + ServiceArtifactReference, + ScaleSettings, + FixedScaleSettings, + ComputeNodeDeallocationOption, + AutoScaleSettings, + AutoScaleRun, + AutoScaleRunError, + InterNodeCommunicationState, + NetworkConfiguration, + DynamicVNetAssignmentScope, + PoolEndpointConfiguration, + InboundNatPool, + InboundEndpointProtocol, + NetworkSecurityGroupRule, + NetworkSecurityGroupRuleAccess, + PublicIPAddressConfiguration, + IPAddressProvisioningType, + KnownIPFamily, + IPFamily, + IPTag, + TaskSchedulingPolicy, + KnownJobDefaultOrder, + JobDefaultOrder, + ComputeNodeFillType, + UserAccount, + ElevationLevel, + LinuxUserConfiguration, + WindowsUserConfiguration, + LoginMode, + MetadataItem, + StartTask, + ResourceFile, + EnvironmentSetting, + UserIdentity, + AutoUserSpecification, + AutoUserScope, + TaskContainerSettings, + ContainerWorkingDirectory, + ContainerHostBatchBindMountEntry, + KnownContainerHostDataPath, + ContainerHostDataPath, + ApplicationPackageReference, + ResizeOperationStatus, + ResizeError, + MountConfiguration, + AzureBlobFileSystemConfiguration, + NFSMountConfiguration, + CifsMountConfiguration, + AzureFileShareConfiguration, + UpgradePolicy, + UpgradeMode, + AutomaticOSUpgradePolicy, + RollingUpgradePolicy, + BatchPoolIdentity, + PoolIdentityType, + NetworkSecurityPerimeterConfiguration, + NetworkSecurityPerimeterConfigurationProperties, + KnownNetworkSecurityPerimeterConfigurationProvisioningState, + NetworkSecurityPerimeterConfigurationProvisioningState, + ProvisioningIssue, + ProvisioningIssueProperties, + KnownIssueType, + IssueType, + KnownSeverity, + Severity, + AccessRule, + AccessRuleProperties, + KnownAccessRuleDirection, + AccessRuleDirection, + NetworkSecurityPerimeter, + ResourceAssociation, + KnownResourceAssociationAccessMode, + ResourceAssociationAccessMode, + NetworkSecurityProfile, + ErrorResponse, + BatchLocationQuota, + SupportedSku, + SkuCapability, + CheckNameAvailabilityParameters, + ResourceType, + CheckNameAvailabilityResult, + NameAvailabilityReason, + KnownVersions, +} from "./models.js"; diff --git a/sdk/batch/arm-batch/src/models/mappers.ts b/sdk/batch/arm-batch/src/models/mappers.ts deleted file mode 100644 index a0d28830f1d9..000000000000 --- a/sdk/batch/arm-batch/src/models/mappers.ts +++ /dev/null @@ -1,4828 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; - -export const BatchAccountCreateParameters: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "BatchAccountCreateParameters", - modelProperties: { - location: { - serializedName: "location", - required: true, - type: { - name: "String", - }, - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - identity: { - serializedName: "identity", - type: { - name: "Composite", - className: "BatchAccountIdentity", - }, - }, - autoStorage: { - serializedName: "properties.autoStorage", - type: { - name: "Composite", - className: "AutoStorageBaseProperties", - }, - }, - poolAllocationMode: { - serializedName: "properties.poolAllocationMode", - type: { - name: "Enum", - allowedValues: ["BatchService", "UserSubscription"], - }, - }, - keyVaultReference: { - serializedName: "properties.keyVaultReference", - type: { - name: "Composite", - className: "KeyVaultReference", - }, - }, - publicNetworkAccess: { - defaultValue: "Enabled", - serializedName: "properties.publicNetworkAccess", - type: { - name: "Enum", - allowedValues: ["Enabled", "Disabled", "SecuredByPerimeter"], - }, - }, - networkProfile: { - serializedName: "properties.networkProfile", - type: { - name: "Composite", - className: "NetworkProfile", - }, - }, - encryption: { - serializedName: "properties.encryption", - type: { - name: "Composite", - className: "EncryptionProperties", - }, - }, - allowedAuthenticationModes: { - serializedName: "properties.allowedAuthenticationModes", - nullable: true, - type: { - name: "Sequence", - element: { - type: { - name: "Enum", - allowedValues: ["SharedKey", "AAD", "TaskAuthenticationToken"], - }, - }, - }, - }, - }, - }, -}; - -export const AutoStorageBaseProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AutoStorageBaseProperties", - modelProperties: { - storageAccountId: { - serializedName: "storageAccountId", - required: true, - type: { - name: "String", - }, - }, - authenticationMode: { - defaultValue: "StorageKeys", - serializedName: "authenticationMode", - type: { - name: "Enum", - allowedValues: ["StorageKeys", "BatchAccountManagedIdentity"], - }, - }, - nodeIdentityReference: { - serializedName: "nodeIdentityReference", - type: { - name: "Composite", - className: "ComputeNodeIdentityReference", - }, - }, - }, - }, -}; - -export const ComputeNodeIdentityReference: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ComputeNodeIdentityReference", - modelProperties: { - resourceId: { - serializedName: "resourceId", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const KeyVaultReference: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "KeyVaultReference", - modelProperties: { - id: { - serializedName: "id", - required: true, - type: { - name: "String", - }, - }, - url: { - serializedName: "url", - required: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const NetworkProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "NetworkProfile", - modelProperties: { - accountAccess: { - serializedName: "accountAccess", - type: { - name: "Composite", - className: "EndpointAccessProfile", - }, - }, - nodeManagementAccess: { - serializedName: "nodeManagementAccess", - type: { - name: "Composite", - className: "EndpointAccessProfile", - }, - }, - }, - }, -}; - -export const EndpointAccessProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "EndpointAccessProfile", - modelProperties: { - defaultAction: { - serializedName: "defaultAction", - required: true, - type: { - name: "Enum", - allowedValues: ["Allow", "Deny"], - }, - }, - ipRules: { - serializedName: "ipRules", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "IPRule", - }, - }, - }, - }, - }, - }, -}; - -export const IPRule: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "IPRule", - modelProperties: { - action: { - defaultValue: "Allow", - isConstant: true, - serializedName: "action", - type: { - name: "String", - }, - }, - value: { - serializedName: "value", - required: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const EncryptionProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "EncryptionProperties", - modelProperties: { - keySource: { - serializedName: "keySource", - type: { - name: "Enum", - allowedValues: ["Microsoft.Batch", "Microsoft.KeyVault"], - }, - }, - keyVaultProperties: { - serializedName: "keyVaultProperties", - type: { - name: "Composite", - className: "KeyVaultProperties", - }, - }, - }, - }, -}; - -export const KeyVaultProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "KeyVaultProperties", - modelProperties: { - keyIdentifier: { - serializedName: "keyIdentifier", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const BatchAccountIdentity: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "BatchAccountIdentity", - modelProperties: { - principalId: { - serializedName: "principalId", - readOnly: true, - type: { - name: "String", - }, - }, - tenantId: { - serializedName: "tenantId", - readOnly: true, - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - required: true, - type: { - name: "Enum", - allowedValues: ["SystemAssigned", "UserAssigned", "None"], - }, - }, - userAssignedIdentities: { - serializedName: "userAssignedIdentities", - type: { - name: "Dictionary", - value: { - type: { name: "Composite", className: "UserAssignedIdentities" }, - }, - }, - }, - }, - }, -}; - -export const UserAssignedIdentities: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "UserAssignedIdentities", - modelProperties: { - principalId: { - serializedName: "principalId", - readOnly: true, - type: { - name: "String", - }, - }, - clientId: { - serializedName: "clientId", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const PrivateEndpoint: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateEndpoint", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const PrivateLinkServiceConnectionState: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateLinkServiceConnectionState", - modelProperties: { - status: { - serializedName: "status", - required: true, - type: { - name: "Enum", - allowedValues: ["Approved", "Pending", "Rejected", "Disconnected"], - }, - }, - description: { - serializedName: "description", - type: { - name: "String", - }, - }, - actionsRequired: { - serializedName: "actionsRequired", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const AzureProxyResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AzureProxyResource", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String", - }, - }, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String", - }, - }, - etag: { - serializedName: "etag", - readOnly: true, - type: { - name: "String", - }, - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - }, - }, -}; - -export const VirtualMachineFamilyCoreQuota: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineFamilyCoreQuota", - modelProperties: { - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - coreQuota: { - serializedName: "coreQuota", - readOnly: true, - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const AzureResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AzureResource", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String", - }, - }, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String", - }, - }, - location: { - serializedName: "location", - readOnly: true, - type: { - name: "String", - }, - }, - tags: { - serializedName: "tags", - readOnly: true, - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - }, - }, -}; - -export const CloudError: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CloudError", - modelProperties: { - error: { - serializedName: "error", - type: { - name: "Composite", - className: "CloudErrorBody", - }, - }, - }, - }, -}; - -export const CloudErrorBody: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CloudErrorBody", - modelProperties: { - code: { - serializedName: "code", - type: { - name: "String", - }, - }, - message: { - serializedName: "message", - type: { - name: "String", - }, - }, - target: { - serializedName: "target", - type: { - name: "String", - }, - }, - details: { - serializedName: "details", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "CloudErrorBody", - }, - }, - }, - }, - }, - }, -}; - -export const BatchAccountUpdateParameters: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "BatchAccountUpdateParameters", - modelProperties: { - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - identity: { - serializedName: "identity", - type: { - name: "Composite", - className: "BatchAccountIdentity", - }, - }, - autoStorage: { - serializedName: "properties.autoStorage", - type: { - name: "Composite", - className: "AutoStorageBaseProperties", - }, - }, - encryption: { - serializedName: "properties.encryption", - type: { - name: "Composite", - className: "EncryptionProperties", - }, - }, - allowedAuthenticationModes: { - serializedName: "properties.allowedAuthenticationModes", - nullable: true, - type: { - name: "Sequence", - element: { - type: { - name: "Enum", - allowedValues: ["SharedKey", "AAD", "TaskAuthenticationToken"], - }, - }, - }, - }, - publicNetworkAccess: { - defaultValue: "Enabled", - serializedName: "properties.publicNetworkAccess", - type: { - name: "Enum", - allowedValues: ["Enabled", "Disabled", "SecuredByPerimeter"], - }, - }, - networkProfile: { - serializedName: "properties.networkProfile", - type: { - name: "Composite", - className: "NetworkProfile", - }, - }, - }, - }, -}; - -export const BatchAccountListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "BatchAccountListResult", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BatchAccount", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const BatchAccountRegenerateKeyParameters: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "BatchAccountRegenerateKeyParameters", - modelProperties: { - keyName: { - serializedName: "keyName", - required: true, - type: { - name: "Enum", - allowedValues: ["Primary", "Secondary"], - }, - }, - }, - }, -}; - -export const BatchAccountKeys: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "BatchAccountKeys", - modelProperties: { - accountName: { - serializedName: "accountName", - readOnly: true, - type: { - name: "String", - }, - }, - primary: { - serializedName: "primary", - readOnly: true, - type: { - name: "String", - }, - }, - secondary: { - serializedName: "secondary", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ActivateApplicationPackageParameters: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "ActivateApplicationPackageParameters", - modelProperties: { - format: { - serializedName: "format", - required: true, - type: { - name: "String", - }, - }, - }, - }, - }; - -export const ListApplicationsResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ListApplicationsResult", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Application", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ListApplicationPackagesResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ListApplicationPackagesResult", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ApplicationPackage", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const BatchLocationQuota: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "BatchLocationQuota", - modelProperties: { - accountQuota: { - serializedName: "accountQuota", - readOnly: true, - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const SupportedSkusResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SupportedSkusResult", - modelProperties: { - value: { - serializedName: "value", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SupportedSku", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const SupportedSku: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SupportedSku", - modelProperties: { - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - familyName: { - serializedName: "familyName", - readOnly: true, - type: { - name: "String", - }, - }, - capabilities: { - serializedName: "capabilities", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SkuCapability", - }, - }, - }, - }, - batchSupportEndOfLife: { - serializedName: "batchSupportEndOfLife", - readOnly: true, - type: { - name: "DateTime", - }, - }, - }, - }, -}; - -export const SkuCapability: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SkuCapability", - modelProperties: { - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - value: { - serializedName: "value", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const OperationListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OperationListResult", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Operation", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const Operation: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Operation", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - isDataAction: { - serializedName: "isDataAction", - type: { - name: "Boolean", - }, - }, - display: { - serializedName: "display", - type: { - name: "Composite", - className: "OperationDisplay", - }, - }, - origin: { - serializedName: "origin", - type: { - name: "String", - }, - }, - properties: { - serializedName: "properties", - type: { - name: "Dictionary", - value: { type: { name: "any" } }, - }, - }, - }, - }, -}; - -export const OperationDisplay: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OperationDisplay", - modelProperties: { - provider: { - serializedName: "provider", - type: { - name: "String", - }, - }, - operation: { - serializedName: "operation", - type: { - name: "String", - }, - }, - resource: { - serializedName: "resource", - type: { - name: "String", - }, - }, - description: { - serializedName: "description", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const CheckNameAvailabilityParameters: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CheckNameAvailabilityParameters", - modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String", - }, - }, - type: { - defaultValue: "Microsoft.Batch/batchAccounts", - isConstant: true, - serializedName: "type", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const CheckNameAvailabilityResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CheckNameAvailabilityResult", - modelProperties: { - nameAvailable: { - serializedName: "nameAvailable", - readOnly: true, - type: { - name: "Boolean", - }, - }, - reason: { - serializedName: "reason", - readOnly: true, - type: { - name: "Enum", - allowedValues: ["Invalid", "AlreadyExists"], - }, - }, - message: { - serializedName: "message", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ListCertificatesResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ListCertificatesResult", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Certificate", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const DeleteCertificateError: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DeleteCertificateError", - modelProperties: { - code: { - serializedName: "code", - required: true, - type: { - name: "String", - }, - }, - message: { - serializedName: "message", - required: true, - type: { - name: "String", - }, - }, - target: { - serializedName: "target", - type: { - name: "String", - }, - }, - details: { - serializedName: "details", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DeleteCertificateError", - }, - }, - }, - }, - }, - }, -}; - -export const CertificateBaseProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CertificateBaseProperties", - modelProperties: { - thumbprintAlgorithm: { - serializedName: "thumbprintAlgorithm", - type: { - name: "String", - }, - }, - thumbprint: { - serializedName: "thumbprint", - type: { - name: "String", - }, - }, - format: { - serializedName: "format", - type: { - name: "Enum", - allowedValues: ["Pfx", "Cer"], - }, - }, - }, - }, -}; - -export const DetectorListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DetectorListResult", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DetectorResponse", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ListPrivateLinkResourcesResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ListPrivateLinkResourcesResult", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PrivateLinkResource", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ListPrivateEndpointConnectionsResult: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "ListPrivateEndpointConnectionsResult", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PrivateEndpointConnection", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, - }; - -export const ListPoolsResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ListPoolsResult", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Pool", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const DeploymentConfiguration: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DeploymentConfiguration", - modelProperties: { - virtualMachineConfiguration: { - serializedName: "virtualMachineConfiguration", - type: { - name: "Composite", - className: "VirtualMachineConfiguration", - }, - }, - }, - }, -}; - -export const VirtualMachineConfiguration: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VirtualMachineConfiguration", - modelProperties: { - imageReference: { - serializedName: "imageReference", - type: { - name: "Composite", - className: "ImageReference", - }, - }, - nodeAgentSkuId: { - serializedName: "nodeAgentSkuId", - required: true, - type: { - name: "String", - }, - }, - windowsConfiguration: { - serializedName: "windowsConfiguration", - type: { - name: "Composite", - className: "WindowsConfiguration", - }, - }, - dataDisks: { - serializedName: "dataDisks", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "DataDisk", - }, - }, - }, - }, - licenseType: { - serializedName: "licenseType", - type: { - name: "String", - }, - }, - containerConfiguration: { - serializedName: "containerConfiguration", - type: { - name: "Composite", - className: "ContainerConfiguration", - }, - }, - diskEncryptionConfiguration: { - serializedName: "diskEncryptionConfiguration", - type: { - name: "Composite", - className: "DiskEncryptionConfiguration", - }, - }, - nodePlacementConfiguration: { - serializedName: "nodePlacementConfiguration", - type: { - name: "Composite", - className: "NodePlacementConfiguration", - }, - }, - extensions: { - serializedName: "extensions", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VMExtension", - }, - }, - }, - }, - osDisk: { - serializedName: "osDisk", - type: { - name: "Composite", - className: "OSDisk", - }, - }, - securityProfile: { - serializedName: "securityProfile", - type: { - name: "Composite", - className: "SecurityProfile", - }, - }, - serviceArtifactReference: { - serializedName: "serviceArtifactReference", - type: { - name: "Composite", - className: "ServiceArtifactReference", - }, - }, - }, - }, -}; - -export const ImageReference: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ImageReference", - modelProperties: { - publisher: { - serializedName: "publisher", - type: { - name: "String", - }, - }, - offer: { - serializedName: "offer", - type: { - name: "String", - }, - }, - sku: { - serializedName: "sku", - type: { - name: "String", - }, - }, - version: { - serializedName: "version", - type: { - name: "String", - }, - }, - id: { - serializedName: "id", - type: { - name: "String", - }, - }, - sharedGalleryImageId: { - serializedName: "sharedGalleryImageId", - type: { - name: "String", - }, - }, - communityGalleryImageId: { - serializedName: "communityGalleryImageId", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const WindowsConfiguration: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "WindowsConfiguration", - modelProperties: { - enableAutomaticUpdates: { - serializedName: "enableAutomaticUpdates", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const DataDisk: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DataDisk", - modelProperties: { - lun: { - serializedName: "lun", - required: true, - type: { - name: "Number", - }, - }, - caching: { - serializedName: "caching", - type: { - name: "Enum", - allowedValues: ["None", "ReadOnly", "ReadWrite"], - }, - }, - diskSizeGB: { - serializedName: "diskSizeGB", - required: true, - type: { - name: "Number", - }, - }, - storageAccountType: { - serializedName: "storageAccountType", - type: { - name: "Enum", - allowedValues: ["Standard_LRS", "Premium_LRS", "StandardSSD_LRS"], - }, - }, - }, - }, -}; - -export const ContainerConfiguration: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ContainerConfiguration", - modelProperties: { - type: { - serializedName: "type", - required: true, - type: { - name: "String", - }, - }, - containerImageNames: { - serializedName: "containerImageNames", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - containerRegistries: { - serializedName: "containerRegistries", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ContainerRegistry", - }, - }, - }, - }, - }, - }, -}; - -export const ContainerRegistry: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ContainerRegistry", - modelProperties: { - userName: { - serializedName: "username", - type: { - name: "String", - }, - }, - password: { - serializedName: "password", - type: { - name: "String", - }, - }, - registryServer: { - serializedName: "registryServer", - type: { - name: "String", - }, - }, - identityReference: { - serializedName: "identityReference", - type: { - name: "Composite", - className: "ComputeNodeIdentityReference", - }, - }, - }, - }, -}; - -export const DiskEncryptionConfiguration: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DiskEncryptionConfiguration", - modelProperties: { - targets: { - serializedName: "targets", - type: { - name: "Sequence", - element: { - type: { - name: "Enum", - allowedValues: ["OsDisk", "TemporaryDisk"], - }, - }, - }, - }, - }, - }, -}; - -export const NodePlacementConfiguration: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "NodePlacementConfiguration", - modelProperties: { - policy: { - serializedName: "policy", - type: { - name: "Enum", - allowedValues: ["Regional", "Zonal"], - }, - }, - }, - }, -}; - -export const VMExtension: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VMExtension", - modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String", - }, - }, - publisher: { - serializedName: "publisher", - required: true, - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - required: true, - type: { - name: "String", - }, - }, - typeHandlerVersion: { - serializedName: "typeHandlerVersion", - type: { - name: "String", - }, - }, - autoUpgradeMinorVersion: { - serializedName: "autoUpgradeMinorVersion", - type: { - name: "Boolean", - }, - }, - enableAutomaticUpgrade: { - serializedName: "enableAutomaticUpgrade", - type: { - name: "Boolean", - }, - }, - settings: { - serializedName: "settings", - type: { - name: "Dictionary", - value: { type: { name: "any" } }, - }, - }, - protectedSettings: { - serializedName: "protectedSettings", - type: { - name: "Dictionary", - value: { type: { name: "any" } }, - }, - }, - provisionAfterExtensions: { - serializedName: "provisionAfterExtensions", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - -export const OSDisk: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OSDisk", - modelProperties: { - ephemeralOSDiskSettings: { - serializedName: "ephemeralOSDiskSettings", - type: { - name: "Composite", - className: "DiffDiskSettings", - }, - }, - caching: { - serializedName: "caching", - type: { - name: "Enum", - allowedValues: ["None", "ReadOnly", "ReadWrite"], - }, - }, - managedDisk: { - serializedName: "managedDisk", - type: { - name: "Composite", - className: "ManagedDisk", - }, - }, - diskSizeGB: { - serializedName: "diskSizeGB", - type: { - name: "Number", - }, - }, - writeAcceleratorEnabled: { - serializedName: "writeAcceleratorEnabled", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const DiffDiskSettings: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DiffDiskSettings", - modelProperties: { - placement: { - defaultValue: "CacheDisk", - isConstant: true, - serializedName: "placement", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ManagedDisk: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ManagedDisk", - modelProperties: { - storageAccountType: { - serializedName: "storageAccountType", - type: { - name: "Enum", - allowedValues: ["Standard_LRS", "Premium_LRS", "StandardSSD_LRS"], - }, - }, - securityProfile: { - serializedName: "securityProfile", - type: { - name: "Composite", - className: "VMDiskSecurityProfile", - }, - }, - }, - }, -}; - -export const VMDiskSecurityProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "VMDiskSecurityProfile", - modelProperties: { - securityEncryptionType: { - serializedName: "securityEncryptionType", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const SecurityProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SecurityProfile", - modelProperties: { - securityType: { - serializedName: "securityType", - type: { - name: "Enum", - allowedValues: ["trustedLaunch", "confidentialVM"], - }, - }, - encryptionAtHost: { - serializedName: "encryptionAtHost", - type: { - name: "Boolean", - }, - }, - uefiSettings: { - serializedName: "uefiSettings", - type: { - name: "Composite", - className: "UefiSettings", - }, - }, - }, - }, -}; - -export const UefiSettings: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "UefiSettings", - modelProperties: { - secureBootEnabled: { - serializedName: "secureBootEnabled", - type: { - name: "Boolean", - }, - }, - vTpmEnabled: { - serializedName: "vTpmEnabled", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const ServiceArtifactReference: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ServiceArtifactReference", - modelProperties: { - id: { - serializedName: "id", - required: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ScaleSettings: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ScaleSettings", - modelProperties: { - fixedScale: { - serializedName: "fixedScale", - type: { - name: "Composite", - className: "FixedScaleSettings", - }, - }, - autoScale: { - serializedName: "autoScale", - type: { - name: "Composite", - className: "AutoScaleSettings", - }, - }, - }, - }, -}; - -export const FixedScaleSettings: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "FixedScaleSettings", - modelProperties: { - resizeTimeout: { - defaultValue: "PT15M", - serializedName: "resizeTimeout", - type: { - name: "TimeSpan", - }, - }, - targetDedicatedNodes: { - serializedName: "targetDedicatedNodes", - type: { - name: "Number", - }, - }, - targetLowPriorityNodes: { - serializedName: "targetLowPriorityNodes", - type: { - name: "Number", - }, - }, - nodeDeallocationOption: { - serializedName: "nodeDeallocationOption", - type: { - name: "Enum", - allowedValues: [ - "Requeue", - "Terminate", - "TaskCompletion", - "RetainedData", - ], - }, - }, - }, - }, -}; - -export const AutoScaleSettings: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AutoScaleSettings", - modelProperties: { - formula: { - serializedName: "formula", - required: true, - type: { - name: "String", - }, - }, - evaluationInterval: { - serializedName: "evaluationInterval", - type: { - name: "TimeSpan", - }, - }, - }, - }, -}; - -export const AutoScaleRun: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AutoScaleRun", - modelProperties: { - evaluationTime: { - serializedName: "evaluationTime", - required: true, - type: { - name: "DateTime", - }, - }, - results: { - serializedName: "results", - type: { - name: "String", - }, - }, - error: { - serializedName: "error", - type: { - name: "Composite", - className: "AutoScaleRunError", - }, - }, - }, - }, -}; - -export const AutoScaleRunError: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AutoScaleRunError", - modelProperties: { - code: { - serializedName: "code", - required: true, - type: { - name: "String", - }, - }, - message: { - serializedName: "message", - required: true, - type: { - name: "String", - }, - }, - details: { - serializedName: "details", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AutoScaleRunError", - }, - }, - }, - }, - }, - }, -}; - -export const NetworkConfiguration: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "NetworkConfiguration", - modelProperties: { - subnetId: { - serializedName: "subnetId", - type: { - name: "String", - }, - }, - dynamicVnetAssignmentScope: { - defaultValue: "none", - serializedName: "dynamicVnetAssignmentScope", - type: { - name: "Enum", - allowedValues: ["none", "job"], - }, - }, - endpointConfiguration: { - serializedName: "endpointConfiguration", - type: { - name: "Composite", - className: "PoolEndpointConfiguration", - }, - }, - publicIPAddressConfiguration: { - serializedName: "publicIPAddressConfiguration", - type: { - name: "Composite", - className: "PublicIPAddressConfiguration", - }, - }, - enableAcceleratedNetworking: { - serializedName: "enableAcceleratedNetworking", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const PoolEndpointConfiguration: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PoolEndpointConfiguration", - modelProperties: { - inboundNatPools: { - serializedName: "inboundNatPools", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "InboundNatPool", - }, - }, - }, - }, - }, - }, -}; - -export const InboundNatPool: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "InboundNatPool", - modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String", - }, - }, - protocol: { - serializedName: "protocol", - required: true, - type: { - name: "Enum", - allowedValues: ["TCP", "UDP"], - }, - }, - backendPort: { - serializedName: "backendPort", - required: true, - type: { - name: "Number", - }, - }, - frontendPortRangeStart: { - serializedName: "frontendPortRangeStart", - required: true, - type: { - name: "Number", - }, - }, - frontendPortRangeEnd: { - serializedName: "frontendPortRangeEnd", - required: true, - type: { - name: "Number", - }, - }, - networkSecurityGroupRules: { - serializedName: "networkSecurityGroupRules", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "NetworkSecurityGroupRule", - }, - }, - }, - }, - }, - }, -}; - -export const NetworkSecurityGroupRule: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "NetworkSecurityGroupRule", - modelProperties: { - priority: { - serializedName: "priority", - required: true, - type: { - name: "Number", - }, - }, - access: { - serializedName: "access", - required: true, - type: { - name: "Enum", - allowedValues: ["Allow", "Deny"], - }, - }, - sourceAddressPrefix: { - serializedName: "sourceAddressPrefix", - required: true, - type: { - name: "String", - }, - }, - sourcePortRanges: { - serializedName: "sourcePortRanges", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - -export const PublicIPAddressConfiguration: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PublicIPAddressConfiguration", - modelProperties: { - provision: { - serializedName: "provision", - type: { - name: "Enum", - allowedValues: ["BatchManaged", "UserManaged", "NoPublicIPAddresses"], - }, - }, - ipAddressIds: { - serializedName: "ipAddressIds", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - -export const TaskSchedulingPolicy: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "TaskSchedulingPolicy", - modelProperties: { - nodeFillType: { - defaultValue: "Spread", - serializedName: "nodeFillType", - required: true, - type: { - name: "Enum", - allowedValues: ["Spread", "Pack"], - }, - }, - }, - }, -}; - -export const UserAccount: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "UserAccount", - modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String", - }, - }, - password: { - serializedName: "password", - required: true, - type: { - name: "String", - }, - }, - elevationLevel: { - serializedName: "elevationLevel", - type: { - name: "Enum", - allowedValues: ["NonAdmin", "Admin"], - }, - }, - linuxUserConfiguration: { - serializedName: "linuxUserConfiguration", - type: { - name: "Composite", - className: "LinuxUserConfiguration", - }, - }, - windowsUserConfiguration: { - serializedName: "windowsUserConfiguration", - type: { - name: "Composite", - className: "WindowsUserConfiguration", - }, - }, - }, - }, -}; - -export const LinuxUserConfiguration: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "LinuxUserConfiguration", - modelProperties: { - uid: { - serializedName: "uid", - type: { - name: "Number", - }, - }, - gid: { - serializedName: "gid", - type: { - name: "Number", - }, - }, - sshPrivateKey: { - serializedName: "sshPrivateKey", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const WindowsUserConfiguration: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "WindowsUserConfiguration", - modelProperties: { - loginMode: { - serializedName: "loginMode", - type: { - name: "Enum", - allowedValues: ["Batch", "Interactive"], - }, - }, - }, - }, -}; - -export const MetadataItem: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "MetadataItem", - modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String", - }, - }, - value: { - serializedName: "value", - required: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const StartTask: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "StartTask", - modelProperties: { - commandLine: { - serializedName: "commandLine", - type: { - name: "String", - }, - }, - resourceFiles: { - serializedName: "resourceFiles", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ResourceFile", - }, - }, - }, - }, - environmentSettings: { - serializedName: "environmentSettings", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "EnvironmentSetting", - }, - }, - }, - }, - userIdentity: { - serializedName: "userIdentity", - type: { - name: "Composite", - className: "UserIdentity", - }, - }, - maxTaskRetryCount: { - defaultValue: 0, - serializedName: "maxTaskRetryCount", - type: { - name: "Number", - }, - }, - waitForSuccess: { - serializedName: "waitForSuccess", - type: { - name: "Boolean", - }, - }, - containerSettings: { - serializedName: "containerSettings", - type: { - name: "Composite", - className: "TaskContainerSettings", - }, - }, - }, - }, -}; - -export const ResourceFile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResourceFile", - modelProperties: { - autoStorageContainerName: { - serializedName: "autoStorageContainerName", - type: { - name: "String", - }, - }, - storageContainerUrl: { - serializedName: "storageContainerUrl", - type: { - name: "String", - }, - }, - httpUrl: { - serializedName: "httpUrl", - type: { - name: "String", - }, - }, - blobPrefix: { - serializedName: "blobPrefix", - type: { - name: "String", - }, - }, - filePath: { - serializedName: "filePath", - type: { - name: "String", - }, - }, - fileMode: { - serializedName: "fileMode", - type: { - name: "String", - }, - }, - identityReference: { - serializedName: "identityReference", - type: { - name: "Composite", - className: "ComputeNodeIdentityReference", - }, - }, - }, - }, -}; - -export const EnvironmentSetting: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "EnvironmentSetting", - modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String", - }, - }, - value: { - serializedName: "value", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const UserIdentity: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "UserIdentity", - modelProperties: { - userName: { - serializedName: "userName", - type: { - name: "String", - }, - }, - autoUser: { - serializedName: "autoUser", - type: { - name: "Composite", - className: "AutoUserSpecification", - }, - }, - }, - }, -}; - -export const AutoUserSpecification: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AutoUserSpecification", - modelProperties: { - scope: { - serializedName: "scope", - type: { - name: "Enum", - allowedValues: ["Task", "Pool"], - }, - }, - elevationLevel: { - serializedName: "elevationLevel", - type: { - name: "Enum", - allowedValues: ["NonAdmin", "Admin"], - }, - }, - }, - }, -}; - -export const TaskContainerSettings: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "TaskContainerSettings", - modelProperties: { - containerRunOptions: { - serializedName: "containerRunOptions", - type: { - name: "String", - }, - }, - imageName: { - serializedName: "imageName", - required: true, - type: { - name: "String", - }, - }, - registry: { - serializedName: "registry", - type: { - name: "Composite", - className: "ContainerRegistry", - }, - }, - workingDirectory: { - serializedName: "workingDirectory", - type: { - name: "Enum", - allowedValues: ["TaskWorkingDirectory", "ContainerImageDefault"], - }, - }, - containerHostBatchBindMounts: { - serializedName: "containerHostBatchBindMounts", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ContainerHostBatchBindMountEntry", - }, - }, - }, - }, - }, - }, -}; - -export const ContainerHostBatchBindMountEntry: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ContainerHostBatchBindMountEntry", - modelProperties: { - source: { - serializedName: "source", - type: { - name: "String", - }, - }, - isReadOnly: { - serializedName: "isReadOnly", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const CertificateReference: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CertificateReference", - modelProperties: { - id: { - serializedName: "id", - required: true, - type: { - name: "String", - }, - }, - storeLocation: { - serializedName: "storeLocation", - type: { - name: "Enum", - allowedValues: ["CurrentUser", "LocalMachine"], - }, - }, - storeName: { - serializedName: "storeName", - type: { - name: "String", - }, - }, - visibility: { - serializedName: "visibility", - type: { - name: "Sequence", - element: { - type: { - name: "Enum", - allowedValues: ["StartTask", "Task", "RemoteUser"], - }, - }, - }, - }, - }, - }, -}; - -export const ApplicationPackageReference: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ApplicationPackageReference", - modelProperties: { - id: { - serializedName: "id", - required: true, - type: { - name: "String", - }, - }, - version: { - serializedName: "version", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ResizeOperationStatus: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResizeOperationStatus", - modelProperties: { - targetDedicatedNodes: { - serializedName: "targetDedicatedNodes", - type: { - name: "Number", - }, - }, - targetLowPriorityNodes: { - serializedName: "targetLowPriorityNodes", - type: { - name: "Number", - }, - }, - resizeTimeout: { - serializedName: "resizeTimeout", - type: { - name: "TimeSpan", - }, - }, - nodeDeallocationOption: { - serializedName: "nodeDeallocationOption", - type: { - name: "Enum", - allowedValues: [ - "Requeue", - "Terminate", - "TaskCompletion", - "RetainedData", - ], - }, - }, - startTime: { - serializedName: "startTime", - type: { - name: "DateTime", - }, - }, - errors: { - serializedName: "errors", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ResizeError", - }, - }, - }, - }, - }, - }, -}; - -export const ResizeError: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResizeError", - modelProperties: { - code: { - serializedName: "code", - required: true, - type: { - name: "String", - }, - }, - message: { - serializedName: "message", - required: true, - type: { - name: "String", - }, - }, - details: { - serializedName: "details", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ResizeError", - }, - }, - }, - }, - }, - }, -}; - -export const MountConfiguration: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "MountConfiguration", - modelProperties: { - azureBlobFileSystemConfiguration: { - serializedName: "azureBlobFileSystemConfiguration", - type: { - name: "Composite", - className: "AzureBlobFileSystemConfiguration", - }, - }, - nfsMountConfiguration: { - serializedName: "nfsMountConfiguration", - type: { - name: "Composite", - className: "NFSMountConfiguration", - }, - }, - cifsMountConfiguration: { - serializedName: "cifsMountConfiguration", - type: { - name: "Composite", - className: "CifsMountConfiguration", - }, - }, - azureFileShareConfiguration: { - serializedName: "azureFileShareConfiguration", - type: { - name: "Composite", - className: "AzureFileShareConfiguration", - }, - }, - }, - }, -}; - -export const AzureBlobFileSystemConfiguration: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AzureBlobFileSystemConfiguration", - modelProperties: { - accountName: { - serializedName: "accountName", - required: true, - type: { - name: "String", - }, - }, - containerName: { - serializedName: "containerName", - required: true, - type: { - name: "String", - }, - }, - accountKey: { - serializedName: "accountKey", - type: { - name: "String", - }, - }, - sasKey: { - serializedName: "sasKey", - type: { - name: "String", - }, - }, - blobfuseOptions: { - serializedName: "blobfuseOptions", - type: { - name: "String", - }, - }, - relativeMountPath: { - serializedName: "relativeMountPath", - required: true, - type: { - name: "String", - }, - }, - identityReference: { - serializedName: "identityReference", - type: { - name: "Composite", - className: "ComputeNodeIdentityReference", - }, - }, - }, - }, -}; - -export const NFSMountConfiguration: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "NFSMountConfiguration", - modelProperties: { - source: { - serializedName: "source", - required: true, - type: { - name: "String", - }, - }, - relativeMountPath: { - serializedName: "relativeMountPath", - required: true, - type: { - name: "String", - }, - }, - mountOptions: { - serializedName: "mountOptions", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const CifsMountConfiguration: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CifsMountConfiguration", - modelProperties: { - userName: { - serializedName: "userName", - required: true, - type: { - name: "String", - }, - }, - source: { - serializedName: "source", - required: true, - type: { - name: "String", - }, - }, - relativeMountPath: { - serializedName: "relativeMountPath", - required: true, - type: { - name: "String", - }, - }, - mountOptions: { - serializedName: "mountOptions", - type: { - name: "String", - }, - }, - password: { - serializedName: "password", - required: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const AzureFileShareConfiguration: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AzureFileShareConfiguration", - modelProperties: { - accountName: { - serializedName: "accountName", - required: true, - type: { - name: "String", - }, - }, - azureFileUrl: { - serializedName: "azureFileUrl", - required: true, - type: { - name: "String", - }, - }, - accountKey: { - serializedName: "accountKey", - required: true, - type: { - name: "String", - }, - }, - relativeMountPath: { - serializedName: "relativeMountPath", - required: true, - type: { - name: "String", - }, - }, - mountOptions: { - serializedName: "mountOptions", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const UpgradePolicy: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "UpgradePolicy", - modelProperties: { - mode: { - serializedName: "mode", - required: true, - type: { - name: "Enum", - allowedValues: ["automatic", "manual", "rolling"], - }, - }, - automaticOSUpgradePolicy: { - serializedName: "automaticOSUpgradePolicy", - type: { - name: "Composite", - className: "AutomaticOSUpgradePolicy", - }, - }, - rollingUpgradePolicy: { - serializedName: "rollingUpgradePolicy", - type: { - name: "Composite", - className: "RollingUpgradePolicy", - }, - }, - }, - }, -}; - -export const AutomaticOSUpgradePolicy: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AutomaticOSUpgradePolicy", - modelProperties: { - disableAutomaticRollback: { - serializedName: "disableAutomaticRollback", - type: { - name: "Boolean", - }, - }, - enableAutomaticOSUpgrade: { - serializedName: "enableAutomaticOSUpgrade", - type: { - name: "Boolean", - }, - }, - useRollingUpgradePolicy: { - serializedName: "useRollingUpgradePolicy", - type: { - name: "Boolean", - }, - }, - osRollingUpgradeDeferral: { - serializedName: "osRollingUpgradeDeferral", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const RollingUpgradePolicy: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RollingUpgradePolicy", - modelProperties: { - enableCrossZoneUpgrade: { - serializedName: "enableCrossZoneUpgrade", - type: { - name: "Boolean", - }, - }, - maxBatchInstancePercent: { - constraints: { - InclusiveMaximum: 100, - InclusiveMinimum: 5, - }, - serializedName: "maxBatchInstancePercent", - type: { - name: "Number", - }, - }, - maxUnhealthyInstancePercent: { - constraints: { - InclusiveMaximum: 100, - InclusiveMinimum: 5, - }, - serializedName: "maxUnhealthyInstancePercent", - type: { - name: "Number", - }, - }, - maxUnhealthyUpgradedInstancePercent: { - constraints: { - InclusiveMaximum: 100, - InclusiveMinimum: 0, - }, - serializedName: "maxUnhealthyUpgradedInstancePercent", - type: { - name: "Number", - }, - }, - pauseTimeBetweenBatches: { - serializedName: "pauseTimeBetweenBatches", - type: { - name: "String", - }, - }, - prioritizeUnhealthyInstances: { - serializedName: "prioritizeUnhealthyInstances", - type: { - name: "Boolean", - }, - }, - rollbackFailedInstancesOnPolicyBreach: { - serializedName: "rollbackFailedInstancesOnPolicyBreach", - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const BatchPoolIdentity: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "BatchPoolIdentity", - modelProperties: { - type: { - serializedName: "type", - required: true, - type: { - name: "Enum", - allowedValues: ["UserAssigned", "None"], - }, - }, - userAssignedIdentities: { - serializedName: "userAssignedIdentities", - type: { - name: "Dictionary", - value: { - type: { name: "Composite", className: "UserAssignedIdentities" }, - }, - }, - }, - }, - }, -}; - -export const OutboundEnvironmentEndpointCollection: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "OutboundEnvironmentEndpointCollection", - modelProperties: { - value: { - serializedName: "value", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "OutboundEnvironmentEndpoint", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, - }; - -export const OutboundEnvironmentEndpoint: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OutboundEnvironmentEndpoint", - modelProperties: { - category: { - serializedName: "category", - readOnly: true, - type: { - name: "String", - }, - }, - endpoints: { - serializedName: "endpoints", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "EndpointDependency", - }, - }, - }, - }, - }, - }, -}; - -export const EndpointDependency: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "EndpointDependency", - modelProperties: { - domainName: { - serializedName: "domainName", - readOnly: true, - type: { - name: "String", - }, - }, - description: { - serializedName: "description", - readOnly: true, - type: { - name: "String", - }, - }, - endpointDetails: { - serializedName: "endpointDetails", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "EndpointDetail", - }, - }, - }, - }, - }, - }, -}; - -export const EndpointDetail: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "EndpointDetail", - modelProperties: { - port: { - serializedName: "port", - readOnly: true, - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const NetworkSecurityPerimeterConfigurationListResult: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "NetworkSecurityPerimeterConfigurationListResult", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "NetworkSecurityPerimeterConfiguration", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - type: { - name: "String", - }, - }, - }, - }, - }; - -export const NetworkSecurityPerimeterConfigurationProperties: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "NetworkSecurityPerimeterConfigurationProperties", - modelProperties: { - provisioningState: { - serializedName: "provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - provisioningIssues: { - serializedName: "provisioningIssues", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ProvisioningIssue", - }, - }, - }, - }, - networkSecurityPerimeter: { - serializedName: "networkSecurityPerimeter", - type: { - name: "Composite", - className: "NetworkSecurityPerimeter", - }, - }, - resourceAssociation: { - serializedName: "resourceAssociation", - type: { - name: "Composite", - className: "ResourceAssociation", - }, - }, - profile: { - serializedName: "profile", - type: { - name: "Composite", - className: "NetworkSecurityProfile", - }, - }, - }, - }, - }; - -export const ProvisioningIssue: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ProvisioningIssue", - modelProperties: { - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "ProvisioningIssueProperties", - }, - }, - }, - }, -}; - -export const ProvisioningIssueProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ProvisioningIssueProperties", - modelProperties: { - issueType: { - serializedName: "issueType", - readOnly: true, - type: { - name: "String", - }, - }, - severity: { - serializedName: "severity", - readOnly: true, - type: { - name: "String", - }, - }, - description: { - serializedName: "description", - readOnly: true, - type: { - name: "String", - }, - }, - suggestedResourceIds: { - serializedName: "suggestedResourceIds", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - suggestedAccessRules: { - serializedName: "suggestedAccessRules", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AccessRule", - }, - }, - }, - }, - }, - }, -}; - -export const AccessRule: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AccessRule", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "AccessRuleProperties", - }, - }, - }, - }, -}; - -export const AccessRuleProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AccessRuleProperties", - modelProperties: { - direction: { - serializedName: "direction", - type: { - name: "String", - }, - }, - addressPrefixes: { - serializedName: "addressPrefixes", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - subscriptions: { - serializedName: "subscriptions", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AccessRulePropertiesSubscriptionsItem", - }, - }, - }, - }, - networkSecurityPerimeters: { - serializedName: "networkSecurityPerimeters", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "NetworkSecurityPerimeter", - }, - }, - }, - }, - fullyQualifiedDomainNames: { - serializedName: "fullyQualifiedDomainNames", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - emailAddresses: { - serializedName: "emailAddresses", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - phoneNumbers: { - serializedName: "phoneNumbers", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - -export const AccessRulePropertiesSubscriptionsItem: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "AccessRulePropertiesSubscriptionsItem", - modelProperties: { - id: { - serializedName: "id", - type: { - name: "String", - }, - }, - }, - }, - }; - -export const NetworkSecurityPerimeter: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "NetworkSecurityPerimeter", - modelProperties: { - id: { - serializedName: "id", - type: { - name: "String", - }, - }, - perimeterGuid: { - serializedName: "perimeterGuid", - type: { - name: "Uuid", - }, - }, - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ResourceAssociation: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResourceAssociation", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - accessMode: { - serializedName: "accessMode", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const NetworkSecurityProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "NetworkSecurityProfile", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - accessRulesVersion: { - serializedName: "accessRulesVersion", - type: { - name: "Number", - }, - }, - accessRules: { - serializedName: "accessRules", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AccessRule", - }, - }, - }, - }, - diagnosticSettingsVersion: { - serializedName: "diagnosticSettingsVersion", - type: { - name: "Number", - }, - }, - enabledLogCategories: { - serializedName: "enabledLogCategories", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - -export const Resource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Resource", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String", - }, - }, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String", - }, - }, - systemData: { - serializedName: "systemData", - type: { - name: "Composite", - className: "SystemData", - }, - }, - }, - }, -}; - -export const SystemData: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SystemData", - modelProperties: { - createdBy: { - serializedName: "createdBy", - type: { - name: "String", - }, - }, - createdByType: { - serializedName: "createdByType", - type: { - name: "String", - }, - }, - createdAt: { - serializedName: "createdAt", - type: { - name: "DateTime", - }, - }, - lastModifiedBy: { - serializedName: "lastModifiedBy", - type: { - name: "String", - }, - }, - lastModifiedByType: { - serializedName: "lastModifiedByType", - type: { - name: "String", - }, - }, - lastModifiedAt: { - serializedName: "lastModifiedAt", - type: { - name: "DateTime", - }, - }, - }, - }, -}; - -export const ErrorResponse: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorResponse", - modelProperties: { - error: { - serializedName: "error", - type: { - name: "Composite", - className: "ErrorDetail", - }, - }, - }, - }, -}; - -export const ErrorDetail: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorDetail", - modelProperties: { - code: { - serializedName: "code", - readOnly: true, - type: { - name: "String", - }, - }, - message: { - serializedName: "message", - readOnly: true, - type: { - name: "String", - }, - }, - target: { - serializedName: "target", - readOnly: true, - type: { - name: "String", - }, - }, - details: { - serializedName: "details", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorDetail", - }, - }, - }, - }, - additionalInfo: { - serializedName: "additionalInfo", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorAdditionalInfo", - }, - }, - }, - }, - }, - }, -}; - -export const ErrorAdditionalInfo: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorAdditionalInfo", - modelProperties: { - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String", - }, - }, - info: { - serializedName: "info", - readOnly: true, - type: { - name: "Dictionary", - value: { type: { name: "any" } }, - }, - }, - }, - }, -}; - -export const AutoStorageProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AutoStorageProperties", - modelProperties: { - ...AutoStorageBaseProperties.type.modelProperties, - lastKeySync: { - serializedName: "lastKeySync", - required: true, - type: { - name: "DateTime", - }, - }, - }, - }, -}; - -export const PrivateEndpointConnection: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateEndpointConnection", - modelProperties: { - ...AzureProxyResource.type.modelProperties, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "Enum", - allowedValues: [ - "Creating", - "Updating", - "Deleting", - "Succeeded", - "Failed", - "Cancelled", - ], - }, - }, - privateEndpoint: { - serializedName: "properties.privateEndpoint", - type: { - name: "Composite", - className: "PrivateEndpoint", - }, - }, - groupIds: { - serializedName: "properties.groupIds", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - privateLinkServiceConnectionState: { - serializedName: "properties.privateLinkServiceConnectionState", - type: { - name: "Composite", - className: "PrivateLinkServiceConnectionState", - }, - }, - }, - }, -}; - -export const ApplicationPackage: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ApplicationPackage", - modelProperties: { - ...AzureProxyResource.type.modelProperties, - state: { - serializedName: "properties.state", - readOnly: true, - type: { - name: "Enum", - allowedValues: ["Pending", "Active"], - }, - }, - format: { - serializedName: "properties.format", - readOnly: true, - type: { - name: "String", - }, - }, - storageUrl: { - serializedName: "properties.storageUrl", - readOnly: true, - type: { - name: "String", - }, - }, - storageUrlExpiry: { - serializedName: "properties.storageUrlExpiry", - readOnly: true, - type: { - name: "DateTime", - }, - }, - lastActivationTime: { - serializedName: "properties.lastActivationTime", - readOnly: true, - type: { - name: "DateTime", - }, - }, - }, - }, -}; - -export const Application: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Application", - modelProperties: { - ...AzureProxyResource.type.modelProperties, - displayName: { - serializedName: "properties.displayName", - type: { - name: "String", - }, - }, - allowUpdates: { - serializedName: "properties.allowUpdates", - type: { - name: "Boolean", - }, - }, - defaultVersion: { - serializedName: "properties.defaultVersion", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const Certificate: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Certificate", - modelProperties: { - ...AzureProxyResource.type.modelProperties, - thumbprintAlgorithm: { - serializedName: "properties.thumbprintAlgorithm", - type: { - name: "String", - }, - }, - thumbprint: { - serializedName: "properties.thumbprint", - type: { - name: "String", - }, - }, - format: { - serializedName: "properties.format", - type: { - name: "Enum", - allowedValues: ["Pfx", "Cer"], - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "Enum", - allowedValues: ["Succeeded", "Deleting", "Failed"], - }, - }, - provisioningStateTransitionTime: { - serializedName: "properties.provisioningStateTransitionTime", - readOnly: true, - type: { - name: "DateTime", - }, - }, - previousProvisioningState: { - serializedName: "properties.previousProvisioningState", - readOnly: true, - type: { - name: "Enum", - allowedValues: ["Succeeded", "Deleting", "Failed"], - }, - }, - previousProvisioningStateTransitionTime: { - serializedName: "properties.previousProvisioningStateTransitionTime", - readOnly: true, - type: { - name: "DateTime", - }, - }, - publicData: { - serializedName: "properties.publicData", - readOnly: true, - type: { - name: "String", - }, - }, - deleteCertificateError: { - serializedName: "properties.deleteCertificateError", - type: { - name: "Composite", - className: "DeleteCertificateError", - }, - }, - }, - }, -}; - -export const CertificateCreateOrUpdateParameters: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CertificateCreateOrUpdateParameters", - modelProperties: { - ...AzureProxyResource.type.modelProperties, - thumbprintAlgorithm: { - serializedName: "properties.thumbprintAlgorithm", - type: { - name: "String", - }, - }, - thumbprint: { - serializedName: "properties.thumbprint", - type: { - name: "String", - }, - }, - format: { - serializedName: "properties.format", - type: { - name: "Enum", - allowedValues: ["Pfx", "Cer"], - }, - }, - data: { - serializedName: "properties.data", - type: { - name: "String", - }, - }, - password: { - serializedName: "properties.password", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const DetectorResponse: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "DetectorResponse", - modelProperties: { - ...AzureProxyResource.type.modelProperties, - value: { - serializedName: "properties.value", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const PrivateLinkResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateLinkResource", - modelProperties: { - ...AzureProxyResource.type.modelProperties, - groupId: { - serializedName: "properties.groupId", - readOnly: true, - type: { - name: "String", - }, - }, - requiredMembers: { - serializedName: "properties.requiredMembers", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - requiredZoneNames: { - serializedName: "properties.requiredZoneNames", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - -export const Pool: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Pool", - modelProperties: { - ...AzureProxyResource.type.modelProperties, - identity: { - serializedName: "identity", - type: { - name: "Composite", - className: "BatchPoolIdentity", - }, - }, - displayName: { - serializedName: "properties.displayName", - type: { - name: "String", - }, - }, - lastModified: { - serializedName: "properties.lastModified", - readOnly: true, - type: { - name: "DateTime", - }, - }, - creationTime: { - serializedName: "properties.creationTime", - readOnly: true, - type: { - name: "DateTime", - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "Enum", - allowedValues: ["Succeeded", "Deleting"], - }, - }, - provisioningStateTransitionTime: { - serializedName: "properties.provisioningStateTransitionTime", - readOnly: true, - type: { - name: "DateTime", - }, - }, - allocationState: { - serializedName: "properties.allocationState", - readOnly: true, - type: { - name: "Enum", - allowedValues: ["Steady", "Resizing", "Stopping"], - }, - }, - allocationStateTransitionTime: { - serializedName: "properties.allocationStateTransitionTime", - readOnly: true, - type: { - name: "DateTime", - }, - }, - vmSize: { - serializedName: "properties.vmSize", - type: { - name: "String", - }, - }, - deploymentConfiguration: { - serializedName: "properties.deploymentConfiguration", - type: { - name: "Composite", - className: "DeploymentConfiguration", - }, - }, - currentDedicatedNodes: { - serializedName: "properties.currentDedicatedNodes", - readOnly: true, - type: { - name: "Number", - }, - }, - currentLowPriorityNodes: { - serializedName: "properties.currentLowPriorityNodes", - readOnly: true, - type: { - name: "Number", - }, - }, - scaleSettings: { - serializedName: "properties.scaleSettings", - type: { - name: "Composite", - className: "ScaleSettings", - }, - }, - autoScaleRun: { - serializedName: "properties.autoScaleRun", - type: { - name: "Composite", - className: "AutoScaleRun", - }, - }, - interNodeCommunication: { - serializedName: "properties.interNodeCommunication", - type: { - name: "Enum", - allowedValues: ["Enabled", "Disabled"], - }, - }, - networkConfiguration: { - serializedName: "properties.networkConfiguration", - type: { - name: "Composite", - className: "NetworkConfiguration", - }, - }, - taskSlotsPerNode: { - defaultValue: 1, - serializedName: "properties.taskSlotsPerNode", - type: { - name: "Number", - }, - }, - taskSchedulingPolicy: { - serializedName: "properties.taskSchedulingPolicy", - type: { - name: "Composite", - className: "TaskSchedulingPolicy", - }, - }, - userAccounts: { - serializedName: "properties.userAccounts", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "UserAccount", - }, - }, - }, - }, - metadata: { - serializedName: "properties.metadata", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "MetadataItem", - }, - }, - }, - }, - startTask: { - serializedName: "properties.startTask", - type: { - name: "Composite", - className: "StartTask", - }, - }, - certificates: { - serializedName: "properties.certificates", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "CertificateReference", - }, - }, - }, - }, - applicationPackages: { - serializedName: "properties.applicationPackages", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ApplicationPackageReference", - }, - }, - }, - }, - applicationLicenses: { - serializedName: "properties.applicationLicenses", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - resizeOperationStatus: { - serializedName: "properties.resizeOperationStatus", - type: { - name: "Composite", - className: "ResizeOperationStatus", - }, - }, - mountConfiguration: { - serializedName: "properties.mountConfiguration", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "MountConfiguration", - }, - }, - }, - }, - targetNodeCommunicationMode: { - serializedName: "properties.targetNodeCommunicationMode", - type: { - name: "Enum", - allowedValues: ["Default", "Classic", "Simplified"], - }, - }, - currentNodeCommunicationMode: { - serializedName: "properties.currentNodeCommunicationMode", - readOnly: true, - nullable: true, - type: { - name: "Enum", - allowedValues: ["Default", "Classic", "Simplified"], - }, - }, - upgradePolicy: { - serializedName: "properties.upgradePolicy", - type: { - name: "Composite", - className: "UpgradePolicy", - }, - }, - resourceTags: { - serializedName: "properties.resourceTags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - }, - }, -}; - -export const BatchAccount: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "BatchAccount", - modelProperties: { - ...AzureResource.type.modelProperties, - identity: { - serializedName: "identity", - type: { - name: "Composite", - className: "BatchAccountIdentity", - }, - }, - accountEndpoint: { - serializedName: "properties.accountEndpoint", - readOnly: true, - type: { - name: "String", - }, - }, - nodeManagementEndpoint: { - serializedName: "properties.nodeManagementEndpoint", - readOnly: true, - type: { - name: "String", - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "Enum", - allowedValues: [ - "Invalid", - "Creating", - "Deleting", - "Succeeded", - "Failed", - "Cancelled", - ], - }, - }, - poolAllocationMode: { - serializedName: "properties.poolAllocationMode", - readOnly: true, - type: { - name: "Enum", - allowedValues: ["BatchService", "UserSubscription"], - }, - }, - keyVaultReference: { - serializedName: "properties.keyVaultReference", - type: { - name: "Composite", - className: "KeyVaultReference", - }, - }, - publicNetworkAccess: { - defaultValue: "Enabled", - serializedName: "properties.publicNetworkAccess", - nullable: true, - type: { - name: "Enum", - allowedValues: ["Enabled", "Disabled", "SecuredByPerimeter"], - }, - }, - networkProfile: { - serializedName: "properties.networkProfile", - type: { - name: "Composite", - className: "NetworkProfile", - }, - }, - privateEndpointConnections: { - serializedName: "properties.privateEndpointConnections", - readOnly: true, - nullable: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PrivateEndpointConnection", - }, - }, - }, - }, - autoStorage: { - serializedName: "properties.autoStorage", - type: { - name: "Composite", - className: "AutoStorageProperties", - }, - }, - encryption: { - serializedName: "properties.encryption", - type: { - name: "Composite", - className: "EncryptionProperties", - }, - }, - dedicatedCoreQuota: { - serializedName: "properties.dedicatedCoreQuota", - readOnly: true, - nullable: true, - type: { - name: "Number", - }, - }, - lowPriorityCoreQuota: { - serializedName: "properties.lowPriorityCoreQuota", - readOnly: true, - nullable: true, - type: { - name: "Number", - }, - }, - dedicatedCoreQuotaPerVMFamily: { - serializedName: "properties.dedicatedCoreQuotaPerVMFamily", - readOnly: true, - nullable: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "VirtualMachineFamilyCoreQuota", - }, - }, - }, - }, - dedicatedCoreQuotaPerVMFamilyEnforced: { - serializedName: "properties.dedicatedCoreQuotaPerVMFamilyEnforced", - readOnly: true, - type: { - name: "Boolean", - }, - }, - poolQuota: { - serializedName: "properties.poolQuota", - readOnly: true, - type: { - name: "Number", - }, - }, - activeJobAndJobScheduleQuota: { - serializedName: "properties.activeJobAndJobScheduleQuota", - readOnly: true, - type: { - name: "Number", - }, - }, - allowedAuthenticationModes: { - serializedName: "properties.allowedAuthenticationModes", - readOnly: true, - nullable: true, - type: { - name: "Sequence", - element: { - type: { - name: "Enum", - allowedValues: ["SharedKey", "AAD", "TaskAuthenticationToken"], - }, - }, - }, - }, - }, - }, -}; - -export const CertificateProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CertificateProperties", - modelProperties: { - ...CertificateBaseProperties.type.modelProperties, - provisioningState: { - serializedName: "provisioningState", - readOnly: true, - type: { - name: "Enum", - allowedValues: ["Succeeded", "Deleting", "Failed"], - }, - }, - provisioningStateTransitionTime: { - serializedName: "provisioningStateTransitionTime", - readOnly: true, - type: { - name: "DateTime", - }, - }, - previousProvisioningState: { - serializedName: "previousProvisioningState", - readOnly: true, - type: { - name: "Enum", - allowedValues: ["Succeeded", "Deleting", "Failed"], - }, - }, - previousProvisioningStateTransitionTime: { - serializedName: "previousProvisioningStateTransitionTime", - readOnly: true, - type: { - name: "DateTime", - }, - }, - publicData: { - serializedName: "publicData", - readOnly: true, - type: { - name: "String", - }, - }, - deleteCertificateError: { - serializedName: "deleteCertificateError", - type: { - name: "Composite", - className: "DeleteCertificateError", - }, - }, - }, - }, -}; - -export const CertificateCreateOrUpdateProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CertificateCreateOrUpdateProperties", - modelProperties: { - ...CertificateBaseProperties.type.modelProperties, - data: { - serializedName: "data", - required: true, - type: { - name: "String", - }, - }, - password: { - serializedName: "password", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ProxyResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ProxyResource", - modelProperties: { - ...Resource.type.modelProperties, - }, - }, -}; - -export const NetworkSecurityPerimeterConfiguration: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "NetworkSecurityPerimeterConfiguration", - modelProperties: { - ...ProxyResource.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "NetworkSecurityPerimeterConfigurationProperties", - }, - }, - }, - }, - }; - -export const BatchAccountCreateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "BatchAccountCreateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const BatchAccountDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "BatchAccountDeleteHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const CertificateCreateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CertificateCreateHeaders", - modelProperties: { - eTag: { - serializedName: "etag", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const CertificateUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CertificateUpdateHeaders", - modelProperties: { - eTag: { - serializedName: "etag", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const CertificateDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CertificateDeleteHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const CertificateGetHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CertificateGetHeaders", - modelProperties: { - eTag: { - serializedName: "etag", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const CertificateCancelDeletionHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CertificateCancelDeletionHeaders", - modelProperties: { - eTag: { - serializedName: "etag", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const PrivateEndpointConnectionUpdateHeaders: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "PrivateEndpointConnectionUpdateHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, - }; - -export const PrivateEndpointConnectionDeleteHeaders: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "PrivateEndpointConnectionDeleteHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, - }; - -export const PoolCreateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PoolCreateHeaders", - modelProperties: { - eTag: { - serializedName: "etag", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const PoolUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PoolUpdateHeaders", - modelProperties: { - eTag: { - serializedName: "etag", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const PoolDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PoolDeleteHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const PoolGetHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PoolGetHeaders", - modelProperties: { - eTag: { - serializedName: "etag", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const PoolDisableAutoScaleHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PoolDisableAutoScaleHeaders", - modelProperties: { - eTag: { - serializedName: "etag", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const PoolStopResizeHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PoolStopResizeHeaders", - modelProperties: { - eTag: { - serializedName: "etag", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const NetworkSecurityPerimeterReconcileConfigurationHeaders: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "NetworkSecurityPerimeterReconcileConfigurationHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - }, - }, - }; diff --git a/sdk/batch/arm-batch/src/models/models.ts b/sdk/batch/arm-batch/src/models/models.ts new file mode 100644 index 000000000000..6ac4810eae27 --- /dev/null +++ b/sdk/batch/arm-batch/src/models/models.ts @@ -0,0 +1,4781 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { areAllPropsUndefined } from "../static-helpers/serialization/check-prop-undefined.js"; + +/** + * This file contains only generated model types and their (de)serializers. + * Disable the following rules for internal models with '_' prefix and deserializers which require 'any' for raw JSON input. + */ +/* eslint-disable @typescript-eslint/naming-convention */ +/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ +/** Paged collection of Operation items */ +export interface _OperationListResult { + /** The Operation items on this page */ + value: Operation[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _operationListResultDeserializer(item: any): _OperationListResult { + return { + value: operationArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function operationArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return operationDeserializer(item); + }); +} + +/** A REST API operation */ +export interface Operation { + /** This is of the format {provider}/{resource}/{operation} */ + name?: string; + /** Indicates whether the operation is a data action */ + isDataAction?: boolean; + /** The object that describes the operation. */ + display?: OperationDisplay; + /** The intended executor of the operation. */ + origin?: string; + /** Properties of the operation. */ + properties?: any; +} + +export function operationDeserializer(item: any): Operation { + return { + name: item["name"], + isDataAction: item["isDataAction"], + display: !item["display"] ? item["display"] : operationDisplayDeserializer(item["display"]), + origin: item["origin"], + properties: item["properties"], + }; +} + +/** The object that describes the operation. */ +export interface OperationDisplay { + /** Friendly name of the resource provider. */ + provider?: string; + /** For example: read, write, delete, or listKeys/action */ + operation?: string; + /** The resource type on which the operation is performed. */ + resource?: string; + /** The friendly name of the operation */ + description?: string; +} + +export function operationDisplayDeserializer(item: any): OperationDisplay { + return { + provider: item["provider"], + operation: item["operation"], + resource: item["resource"], + description: item["description"], + }; +} + +/** An error response from the Batch service. */ +export interface CloudError { + /** The body of the error response. */ + error?: CloudErrorBody; +} + +export function cloudErrorDeserializer(item: any): CloudError { + return { + error: !item["error"] ? item["error"] : cloudErrorBodyDeserializer(item["error"]), + }; +} + +/** An error response from the Batch service. */ +export interface CloudErrorBody { + /** An identifier for the error. Codes are invariant and are intended to be consumed programmatically. */ + code?: string; + /** A message describing the error, intended to be suitable for display in a user interface. */ + message?: string; + /** The target of the particular error. For example, the name of the property in error. */ + target?: string; + /** A list of additional details about the error. */ + details?: CloudErrorBody[]; +} + +export function cloudErrorBodyDeserializer(item: any): CloudErrorBody { + return { + code: item["code"], + message: item["message"], + target: item["target"], + details: !item["details"] ? item["details"] : cloudErrorBodyArrayDeserializer(item["details"]), + }; +} + +export function cloudErrorBodyArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return cloudErrorBodyDeserializer(item); + }); +} + +/** Contains information about an Azure Batch account. */ +export interface BatchAccount extends TrackedResource { + /** The identity of the Batch account. */ + identity?: BatchAccountIdentity; + /** The account endpoint used to interact with the Batch service. */ + readonly accountEndpoint?: string; + /** The endpoint used by compute node to connect to the Batch node management service. */ + readonly nodeManagementEndpoint?: string; + /** The provisioned state of the resource */ + readonly provisioningState?: ProvisioningState; + /** The allocation mode for creating pools in the Batch account. */ + readonly poolAllocationMode?: PoolAllocationMode; + /** Identifies the Azure key vault associated with a Batch account. */ + readonly keyVaultReference?: KeyVaultReference; + /** The network access type for operating on the resources in the Batch account. */ + publicNetworkAccess?: PublicNetworkAccessType; + /** The network profile only takes effect when publicNetworkAccess is enabled. */ + networkProfile?: NetworkProfile; + /** List of private endpoint connections associated with the Batch account */ + readonly privateEndpointConnections?: PrivateEndpointConnection[]; + /** Contains information about the auto-storage account associated with a Batch account. */ + readonly autoStorage?: AutoStorageProperties; + /** Configures how customer data is encrypted inside the Batch account. By default, accounts are encrypted using a Microsoft managed key. For additional control, a customer-managed key can be used instead. */ + readonly encryption?: EncryptionProperties; + /** For accounts with PoolAllocationMode set to UserSubscription, quota is managed on the subscription so this value is not returned. */ + readonly dedicatedCoreQuota?: number; + /** For accounts with PoolAllocationMode set to UserSubscription, quota is managed on the subscription so this value is not returned. */ + readonly lowPriorityCoreQuota?: number; + /** A list of the dedicated core quota per Virtual Machine family for the Batch account. For accounts with PoolAllocationMode set to UserSubscription, quota is managed on the subscription so this value is not returned. */ + readonly dedicatedCoreQuotaPerVMFamily?: VirtualMachineFamilyCoreQuota[]; + /** If this flag is true, dedicated core quota is enforced via both the dedicatedCoreQuotaPerVMFamily and dedicatedCoreQuota properties on the account. If this flag is false, dedicated core quota is enforced only via the dedicatedCoreQuota property on the account and does not consider Virtual Machine family. */ + readonly dedicatedCoreQuotaPerVMFamilyEnforced?: boolean; + /** The pool quota for the Batch account. */ + readonly poolQuota?: number; + /** The active job and job schedule quota for the Batch account. */ + readonly activeJobAndJobScheduleQuota?: number; + /** List of allowed authentication modes for the Batch account that can be used to authenticate with the data plane. This does not affect authentication with the control plane. */ + readonly allowedAuthenticationModes?: AuthenticationMode[]; +} + +export function batchAccountDeserializer(item: any): BatchAccount { + return { + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + ...(!item["properties"] + ? item["properties"] + : _batchAccountPropertiesDeserializer(item["properties"])), + identity: !item["identity"] + ? item["identity"] + : batchAccountIdentityDeserializer(item["identity"]), + }; +} + +/** Account specific properties. */ +export interface BatchAccountProperties { + /** The account endpoint used to interact with the Batch service. */ + readonly accountEndpoint?: string; + /** The endpoint used by compute node to connect to the Batch node management service. */ + readonly nodeManagementEndpoint?: string; + /** The provisioned state of the resource */ + readonly provisioningState?: ProvisioningState; + /** The allocation mode for creating pools in the Batch account. */ + readonly poolAllocationMode?: PoolAllocationMode; + /** Identifies the Azure key vault associated with a Batch account. */ + readonly keyVaultReference?: KeyVaultReference; + /** The network access type for operating on the resources in the Batch account. */ + publicNetworkAccess?: PublicNetworkAccessType; + /** The network profile only takes effect when publicNetworkAccess is enabled. */ + networkProfile?: NetworkProfile; + /** List of private endpoint connections associated with the Batch account */ + readonly privateEndpointConnections?: PrivateEndpointConnection[]; + /** Contains information about the auto-storage account associated with a Batch account. */ + readonly autoStorage?: AutoStorageProperties; + /** Configures how customer data is encrypted inside the Batch account. By default, accounts are encrypted using a Microsoft managed key. For additional control, a customer-managed key can be used instead. */ + readonly encryption?: EncryptionProperties; + /** For accounts with PoolAllocationMode set to UserSubscription, quota is managed on the subscription so this value is not returned. */ + readonly dedicatedCoreQuota?: number; + /** For accounts with PoolAllocationMode set to UserSubscription, quota is managed on the subscription so this value is not returned. */ + readonly lowPriorityCoreQuota?: number; + /** A list of the dedicated core quota per Virtual Machine family for the Batch account. For accounts with PoolAllocationMode set to UserSubscription, quota is managed on the subscription so this value is not returned. */ + readonly dedicatedCoreQuotaPerVMFamily?: VirtualMachineFamilyCoreQuota[]; + /** If this flag is true, dedicated core quota is enforced via both the dedicatedCoreQuotaPerVMFamily and dedicatedCoreQuota properties on the account. If this flag is false, dedicated core quota is enforced only via the dedicatedCoreQuota property on the account and does not consider Virtual Machine family. */ + readonly dedicatedCoreQuotaPerVMFamilyEnforced?: boolean; + /** The pool quota for the Batch account. */ + readonly poolQuota?: number; + /** The active job and job schedule quota for the Batch account. */ + readonly activeJobAndJobScheduleQuota?: number; + /** List of allowed authentication modes for the Batch account that can be used to authenticate with the data plane. This does not affect authentication with the control plane. */ + readonly allowedAuthenticationModes?: AuthenticationMode[]; +} + +export function batchAccountPropertiesDeserializer(item: any): BatchAccountProperties { + return { + accountEndpoint: item["accountEndpoint"], + nodeManagementEndpoint: item["nodeManagementEndpoint"], + provisioningState: item["provisioningState"], + poolAllocationMode: item["poolAllocationMode"], + keyVaultReference: !item["keyVaultReference"] + ? item["keyVaultReference"] + : keyVaultReferenceDeserializer(item["keyVaultReference"]), + publicNetworkAccess: item["publicNetworkAccess"], + networkProfile: !item["networkProfile"] + ? item["networkProfile"] + : networkProfileDeserializer(item["networkProfile"]), + privateEndpointConnections: !item["privateEndpointConnections"] + ? item["privateEndpointConnections"] + : privateEndpointConnectionArrayDeserializer(item["privateEndpointConnections"]), + autoStorage: !item["autoStorage"] + ? item["autoStorage"] + : autoStoragePropertiesDeserializer(item["autoStorage"]), + encryption: !item["encryption"] + ? item["encryption"] + : encryptionPropertiesDeserializer(item["encryption"]), + dedicatedCoreQuota: item["dedicatedCoreQuota"], + lowPriorityCoreQuota: item["lowPriorityCoreQuota"], + dedicatedCoreQuotaPerVMFamily: !item["dedicatedCoreQuotaPerVMFamily"] + ? item["dedicatedCoreQuotaPerVMFamily"] + : virtualMachineFamilyCoreQuotaArrayDeserializer(item["dedicatedCoreQuotaPerVMFamily"]), + dedicatedCoreQuotaPerVMFamilyEnforced: item["dedicatedCoreQuotaPerVMFamilyEnforced"], + poolQuota: item["poolQuota"], + activeJobAndJobScheduleQuota: item["activeJobAndJobScheduleQuota"], + allowedAuthenticationModes: !item["allowedAuthenticationModes"] + ? item["allowedAuthenticationModes"] + : item["allowedAuthenticationModes"].map((p1: any) => { + return p1; + }), + }; +} + +/** The provisioned state of the resource */ +export type ProvisioningState = + | "Invalid" + | "Creating" + | "Deleting" + | "Succeeded" + | "Failed" + | "Cancelled"; +/** The allocation mode for creating pools in the Batch account. */ +export type PoolAllocationMode = "BatchService" | "UserSubscription"; + +/** Identifies the Azure key vault associated with a Batch account. */ +export interface KeyVaultReference { + /** The resource ID of the Azure key vault associated with the Batch account. */ + id: string; + /** The URL of the Azure key vault associated with the Batch account. */ + url: string; +} + +export function keyVaultReferenceSerializer(item: KeyVaultReference): any { + return { id: item["id"], url: item["url"] }; +} + +export function keyVaultReferenceDeserializer(item: any): KeyVaultReference { + return { + id: item["id"], + url: item["url"], + }; +} + +/** The network access type for operating on the resources in the Batch account. */ +export type PublicNetworkAccessType = "Enabled" | "Disabled" | "SecuredByPerimeter"; + +/** Network profile for Batch account, which contains network rule settings for each endpoint. */ +export interface NetworkProfile { + /** Network access profile for batchAccount endpoint (Batch account data plane API). */ + accountAccess?: EndpointAccessProfile; + /** Network access profile for nodeManagement endpoint (Batch service managing compute nodes for Batch pools). */ + nodeManagementAccess?: EndpointAccessProfile; +} + +export function networkProfileSerializer(item: NetworkProfile): any { + return { + accountAccess: !item["accountAccess"] + ? item["accountAccess"] + : endpointAccessProfileSerializer(item["accountAccess"]), + nodeManagementAccess: !item["nodeManagementAccess"] + ? item["nodeManagementAccess"] + : endpointAccessProfileSerializer(item["nodeManagementAccess"]), + }; +} + +export function networkProfileDeserializer(item: any): NetworkProfile { + return { + accountAccess: !item["accountAccess"] + ? item["accountAccess"] + : endpointAccessProfileDeserializer(item["accountAccess"]), + nodeManagementAccess: !item["nodeManagementAccess"] + ? item["nodeManagementAccess"] + : endpointAccessProfileDeserializer(item["nodeManagementAccess"]), + }; +} + +/** Network access profile for Batch endpoint. */ +export interface EndpointAccessProfile { + /** Default action for endpoint access. It is only applicable when publicNetworkAccess is enabled. */ + defaultAction: EndpointAccessDefaultAction; + /** Array of IP ranges to filter client IP address. */ + ipRules?: IPRule[]; +} + +export function endpointAccessProfileSerializer(item: EndpointAccessProfile): any { + return { + defaultAction: item["defaultAction"], + ipRules: !item["ipRules"] ? item["ipRules"] : ipRuleArraySerializer(item["ipRules"]), + }; +} + +export function endpointAccessProfileDeserializer(item: any): EndpointAccessProfile { + return { + defaultAction: item["defaultAction"], + ipRules: !item["ipRules"] ? item["ipRules"] : ipRuleArrayDeserializer(item["ipRules"]), + }; +} + +/** Default action for endpoint access. It is only applicable when publicNetworkAccess is enabled. */ +export type EndpointAccessDefaultAction = "Allow" | "Deny"; + +export function ipRuleArraySerializer(result: Array): any[] { + return result.map((item) => { + return ipRuleSerializer(item); + }); +} + +export function ipRuleArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return ipRuleDeserializer(item); + }); +} + +/** Rule to filter client IP address. */ +export interface IPRule { + /** Action when client IP address is matched. */ + action: IPRuleAction; + /** IPv4 address, or IPv4 address range in CIDR format. */ + value: string; +} + +export function ipRuleSerializer(item: IPRule): any { + return { action: item["action"], value: item["value"] }; +} + +export function ipRuleDeserializer(item: any): IPRule { + return { + action: item["action"], + value: item["value"], + }; +} + +/** The action when client IP address is matched. */ +export type IPRuleAction = "Allow"; + +export function privateEndpointConnectionArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return privateEndpointConnectionSerializer(item); + }); +} + +export function privateEndpointConnectionArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return privateEndpointConnectionDeserializer(item); + }); +} + +/** Contains information about a private link resource. */ +export interface PrivateEndpointConnection extends ProxyResource { + /** The ETag of the resource, used for concurrency statements. */ + readonly etag?: string; + /** The tags of the resource. */ + tags?: Record; + /** The provisioning state of the private endpoint connection. */ + readonly provisioningState?: PrivateEndpointConnectionProvisioningState; + /** The private endpoint of the private endpoint connection. */ + readonly privateEndpoint?: PrivateEndpoint; + /** The value has one and only one group id. */ + readonly groupIds?: string[]; + /** The private link service connection state of the private endpoint connection. */ + privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; +} + +export function privateEndpointConnectionSerializer(item: PrivateEndpointConnection): any { + return { + properties: areAllPropsUndefined(item, ["privateLinkServiceConnectionState"]) + ? undefined + : _privateEndpointConnectionPropertiesSerializer(item), + tags: item["tags"], + }; +} + +export function privateEndpointConnectionDeserializer(item: any): PrivateEndpointConnection { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + ...(!item["properties"] + ? item["properties"] + : _privateEndpointConnectionPropertiesDeserializer(item["properties"])), + etag: item["etag"], + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + }; +} + +/** Private endpoint connection properties. */ +export interface PrivateEndpointConnectionProperties { + /** The provisioning state of the private endpoint connection. */ + readonly provisioningState?: PrivateEndpointConnectionProvisioningState; + /** The private endpoint of the private endpoint connection. */ + readonly privateEndpoint?: PrivateEndpoint; + /** The value has one and only one group id. */ + readonly groupIds?: string[]; + /** The private link service connection state of the private endpoint connection. */ + privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; +} + +export function privateEndpointConnectionPropertiesSerializer( + item: PrivateEndpointConnectionProperties, +): any { + return { + privateLinkServiceConnectionState: !item["privateLinkServiceConnectionState"] + ? item["privateLinkServiceConnectionState"] + : privateLinkServiceConnectionStateSerializer(item["privateLinkServiceConnectionState"]), + }; +} + +export function privateEndpointConnectionPropertiesDeserializer( + item: any, +): PrivateEndpointConnectionProperties { + return { + provisioningState: item["provisioningState"], + privateEndpoint: !item["privateEndpoint"] + ? item["privateEndpoint"] + : privateEndpointDeserializer(item["privateEndpoint"]), + groupIds: !item["groupIds"] + ? item["groupIds"] + : item["groupIds"].map((p: any) => { + return p; + }), + privateLinkServiceConnectionState: !item["privateLinkServiceConnectionState"] + ? item["privateLinkServiceConnectionState"] + : privateLinkServiceConnectionStateDeserializer(item["privateLinkServiceConnectionState"]), + }; +} + +/** The provisioning state of the private endpoint connection. */ +export type PrivateEndpointConnectionProvisioningState = + | "Creating" + | "Updating" + | "Deleting" + | "Succeeded" + | "Failed" + | "Cancelled"; + +/** The private endpoint of the private endpoint connection. */ +export interface PrivateEndpoint { + /** The ARM resource identifier of the private endpoint. This is of the form /subscriptions/{subscription}/resourceGroups/{group}/providers/Microsoft.Network/privateEndpoints/{privateEndpoint}. */ + readonly id?: string; +} + +export function privateEndpointDeserializer(item: any): PrivateEndpoint { + return { + id: item["id"], + }; +} + +/** The private link service connection state of the private endpoint connection */ +export interface PrivateLinkServiceConnectionState { + /** The status of the Batch private endpoint connection */ + status: PrivateLinkServiceConnectionStatus; + /** Description of the private Connection state */ + description?: string; + /** Action required on the private connection state */ + readonly actionsRequired?: string; +} + +export function privateLinkServiceConnectionStateSerializer( + item: PrivateLinkServiceConnectionState, +): any { + return { status: item["status"], description: item["description"] }; +} + +export function privateLinkServiceConnectionStateDeserializer( + item: any, +): PrivateLinkServiceConnectionState { + return { + status: item["status"], + description: item["description"], + actionsRequired: item["actionsRequired"], + }; +} + +/** The status of the Batch private endpoint connection */ +export type PrivateLinkServiceConnectionStatus = + | "Approved" + | "Pending" + | "Rejected" + | "Disconnected"; + +/** Contains information about the auto-storage account associated with a Batch account. */ +export interface AutoStorageProperties extends AutoStorageBaseProperties { + /** The UTC time at which storage keys were last synchronized with the Batch account. */ + lastKeySync: Date; +} + +export function autoStoragePropertiesDeserializer(item: any): AutoStorageProperties { + return { + storageAccountId: item["storageAccountId"], + authenticationMode: item["authenticationMode"], + nodeIdentityReference: !item["nodeIdentityReference"] + ? item["nodeIdentityReference"] + : computeNodeIdentityReferenceDeserializer(item["nodeIdentityReference"]), + lastKeySync: new Date(item["lastKeySync"]), + }; +} + +/** Configures how customer data is encrypted inside the Batch account. By default, accounts are encrypted using a Microsoft managed key. For additional control, a customer-managed key can be used instead. */ +export interface EncryptionProperties { + /** Type of the key source. */ + keySource?: KeySource; + /** Additional details when using Microsoft.KeyVault */ + keyVaultProperties?: KeyVaultProperties; +} + +export function encryptionPropertiesSerializer(item: EncryptionProperties): any { + return { + keySource: item["keySource"], + keyVaultProperties: !item["keyVaultProperties"] + ? item["keyVaultProperties"] + : keyVaultPropertiesSerializer(item["keyVaultProperties"]), + }; +} + +export function encryptionPropertiesDeserializer(item: any): EncryptionProperties { + return { + keySource: item["keySource"], + keyVaultProperties: !item["keyVaultProperties"] + ? item["keyVaultProperties"] + : keyVaultPropertiesDeserializer(item["keyVaultProperties"]), + }; +} + +/** Type of the key source. */ +export type KeySource = "Microsoft.Batch" | "Microsoft.KeyVault"; + +/** KeyVault configuration when using an encryption KeySource of Microsoft.KeyVault. */ +export interface KeyVaultProperties { + /** + * 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 + * The KeyVault has soft-delete and purge protection enabled + */ + keyIdentifier?: string; +} + +export function keyVaultPropertiesSerializer(item: KeyVaultProperties): any { + return { keyIdentifier: item["keyIdentifier"] }; +} + +export function keyVaultPropertiesDeserializer(item: any): KeyVaultProperties { + return { + keyIdentifier: item["keyIdentifier"], + }; +} + +export function virtualMachineFamilyCoreQuotaArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return virtualMachineFamilyCoreQuotaDeserializer(item); + }); +} + +/** A VM Family and its associated core quota for the Batch account. */ +export interface VirtualMachineFamilyCoreQuota { + /** The Virtual Machine family name. */ + readonly name?: string; + /** The core quota for the VM family for the Batch account. */ + readonly coreQuota?: number; +} + +export function virtualMachineFamilyCoreQuotaDeserializer( + item: any, +): VirtualMachineFamilyCoreQuota { + return { + name: item["name"], + coreQuota: item["coreQuota"], + }; +} + +/** The authentication mode for the Batch account. */ +export type AuthenticationMode = "SharedKey" | "AAD" | "TaskAuthenticationToken"; + +/** The identity of the Batch account, if configured. This is used when the user specifies 'Microsoft.KeyVault' as their Batch account encryption configuration or when `ManagedIdentity` is selected as the auto-storage authentication mode. */ +export interface BatchAccountIdentity { + /** The principal id of the Batch account. This property will only be provided for a system assigned identity. */ + readonly principalId?: string; + /** The tenant id associated with the Batch account. This property will only be provided for a system assigned identity. */ + readonly tenantId?: string; + /** The type of identity used for the Batch account. */ + type: ResourceIdentityType; + /** The list of user identities associated with the Batch account. */ + userAssignedIdentities?: Record; +} + +export function batchAccountIdentitySerializer(item: BatchAccountIdentity): any { + return { + type: item["type"], + userAssignedIdentities: !item["userAssignedIdentities"] + ? item["userAssignedIdentities"] + : userAssignedIdentitiesRecordSerializer(item["userAssignedIdentities"]), + }; +} + +export function batchAccountIdentityDeserializer(item: any): BatchAccountIdentity { + return { + principalId: item["principalId"], + tenantId: item["tenantId"], + type: item["type"], + userAssignedIdentities: !item["userAssignedIdentities"] + ? item["userAssignedIdentities"] + : userAssignedIdentitiesRecordDeserializer(item["userAssignedIdentities"]), + }; +} + +/** The type of identity used for the Batch account. */ +export type ResourceIdentityType = "SystemAssigned" | "UserAssigned" | "None"; + +export function userAssignedIdentitiesRecordSerializer( + item: Record, +): Record { + const result: Record = {}; + Object.keys(item).map((key) => { + result[key] = !item[key] ? item[key] : userAssignedIdentitiesSerializer(item[key]); + }); + return result; +} + +export function userAssignedIdentitiesRecordDeserializer( + item: Record, +): Record { + const result: Record = {}; + Object.keys(item).map((key) => { + result[key] = !item[key] ? item[key] : userAssignedIdentitiesDeserializer(item[key]); + }); + return result; +} + +/** The list of associated user identities. */ +export interface UserAssignedIdentities { + /** The principal id of user assigned identity. */ + readonly principalId?: string; + /** The client id of user assigned identity. */ + readonly clientId?: string; +} + +export function userAssignedIdentitiesSerializer(item: UserAssignedIdentities): any { + return item; +} + +export function userAssignedIdentitiesDeserializer(item: any): UserAssignedIdentities { + return { + principalId: item["principalId"], + clientId: item["clientId"], + }; +} + +/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ +export interface ProxyResource extends Resource {} + +export function proxyResourceSerializer(item: ProxyResource): any { + return item; +} + +export function proxyResourceDeserializer(item: any): ProxyResource { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + }; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { + /** Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} */ + readonly id?: string; + /** The name of the resource */ + readonly name?: string; + /** The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" */ + readonly type?: string; + /** Azure Resource Manager metadata containing createdBy and modifiedBy information. */ + readonly systemData?: SystemData; +} + +export function resourceSerializer(item: Resource): any { + return item; +} + +export function resourceDeserializer(item: any): Resource { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + }; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; +} + +export function systemDataDeserializer(item: any): SystemData { + return { + createdBy: item["createdBy"], + createdByType: item["createdByType"], + createdAt: !item["createdAt"] ? item["createdAt"] : new Date(item["createdAt"]), + lastModifiedBy: item["lastModifiedBy"], + lastModifiedByType: item["lastModifiedByType"], + lastModifiedAt: !item["lastModifiedAt"] + ? item["lastModifiedAt"] + : new Date(item["lastModifiedAt"]), + }; +} + +/** The kind of entity that created the resource. */ +export enum KnownCreatedByType { + /** The entity was created by a user. */ + User = "User", + /** The entity was created by an application. */ + Application = "Application", + /** The entity was created by a managed identity. */ + ManagedIdentity = "ManagedIdentity", + /** The entity was created by a key. */ + Key = "Key", +} + +/** + * The kind of entity that created the resource. \ + * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **User**: The entity was created by a user. \ + * **Application**: The entity was created by an application. \ + * **ManagedIdentity**: The entity was created by a managed identity. \ + * **Key**: The entity was created by a key. + */ +export type CreatedByType = string; + +/** The properties related to the auto-storage account. */ +export interface AutoStorageBaseProperties { + /** The resource ID of the storage account to be used for auto-storage account. */ + storageAccountId: string; + /** The authentication mode which the Batch service will use to manage the auto-storage account. */ + authenticationMode?: AutoStorageAuthenticationMode; + /** The identity referenced here must be assigned to pools which have compute nodes that need access to auto-storage. */ + nodeIdentityReference?: ComputeNodeIdentityReference; +} + +export function autoStorageBasePropertiesSerializer(item: AutoStorageBaseProperties): any { + return { + storageAccountId: item["storageAccountId"], + authenticationMode: item["authenticationMode"], + nodeIdentityReference: !item["nodeIdentityReference"] + ? item["nodeIdentityReference"] + : computeNodeIdentityReferenceSerializer(item["nodeIdentityReference"]), + }; +} + +export function autoStorageBasePropertiesDeserializer(item: any): AutoStorageBaseProperties { + return { + storageAccountId: item["storageAccountId"], + authenticationMode: item["authenticationMode"], + nodeIdentityReference: !item["nodeIdentityReference"] + ? item["nodeIdentityReference"] + : computeNodeIdentityReferenceDeserializer(item["nodeIdentityReference"]), + }; +} + +/** The authentication mode which the Batch service will use to manage the auto-storage account. */ +export type AutoStorageAuthenticationMode = "StorageKeys" | "BatchAccountManagedIdentity"; + +/** The reference to a user assigned identity associated with the Batch pool which a compute node will use. */ +export interface ComputeNodeIdentityReference { + /** The ARM resource id of the user assigned identity. */ + resourceId?: string; +} + +export function computeNodeIdentityReferenceSerializer(item: ComputeNodeIdentityReference): any { + return { resourceId: item["resourceId"] }; +} + +export function computeNodeIdentityReferenceDeserializer(item: any): ComputeNodeIdentityReference { + return { + resourceId: item["resourceId"], + }; +} + +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export interface TrackedResource extends Resource { + /** Resource tags. */ + tags?: Record; + /** The geo-location where the resource lives */ + location: string; +} + +export function trackedResourceDeserializer(item: any): TrackedResource { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + }; +} + +/** Parameters supplied to the Create operation. */ +export interface BatchAccountCreateParameters { + /** The region in which to create the account. */ + location: string; + /** The user-specified tags associated with the account. */ + tags?: Record; + /** The identity of the Batch account. */ + identity?: BatchAccountIdentity; + /** The properties related to the auto-storage account. */ + autoStorage?: AutoStorageBaseProperties; + /** The pool allocation mode also affects how clients may authenticate to the Batch Service API. If the mode is BatchService, clients may authenticate using access keys or Microsoft Entra ID. If the mode is UserSubscription, clients must use Microsoft Entra ID. The default is BatchService. */ + poolAllocationMode?: PoolAllocationMode; + /** A reference to the Azure key vault associated with the Batch account. */ + keyVaultReference?: KeyVaultReference; + /** The network access type for operating on the resources in the Batch account. */ + publicNetworkAccess?: PublicNetworkAccessType; + /** The network profile only takes effect when publicNetworkAccess is enabled. */ + networkProfile?: NetworkProfile; + /** Configures how customer data is encrypted inside the Batch account. By default, accounts are encrypted using a Microsoft managed key. For additional control, a customer-managed key can be used instead. */ + encryption?: EncryptionProperties; + /** List of allowed authentication modes for the Batch account that can be used to authenticate with the data plane. This does not affect authentication with the control plane. */ + allowedAuthenticationModes?: AuthenticationMode[]; +} + +export function batchAccountCreateParametersSerializer(item: BatchAccountCreateParameters): any { + return { + location: item["location"], + tags: item["tags"], + properties: areAllPropsUndefined(item, [ + "autoStorage", + "poolAllocationMode", + "keyVaultReference", + "publicNetworkAccess", + "networkProfile", + "encryption", + "allowedAuthenticationModes", + ]) + ? undefined + : _batchAccountCreateParametersPropertiesSerializer(item), + identity: !item["identity"] + ? item["identity"] + : batchAccountIdentitySerializer(item["identity"]), + }; +} + +/** The properties of a Batch account. */ +export interface BatchAccountCreateProperties { + /** The properties related to the auto-storage account. */ + autoStorage?: AutoStorageBaseProperties; + /** The pool allocation mode also affects how clients may authenticate to the Batch Service API. If the mode is BatchService, clients may authenticate using access keys or Microsoft Entra ID. If the mode is UserSubscription, clients must use Microsoft Entra ID. The default is BatchService. */ + poolAllocationMode?: PoolAllocationMode; + /** A reference to the Azure key vault associated with the Batch account. */ + keyVaultReference?: KeyVaultReference; + /** The network access type for operating on the resources in the Batch account. */ + publicNetworkAccess?: PublicNetworkAccessType; + /** The network profile only takes effect when publicNetworkAccess is enabled. */ + networkProfile?: NetworkProfile; + /** Configures how customer data is encrypted inside the Batch account. By default, accounts are encrypted using a Microsoft managed key. For additional control, a customer-managed key can be used instead. */ + encryption?: EncryptionProperties; + /** List of allowed authentication modes for the Batch account that can be used to authenticate with the data plane. This does not affect authentication with the control plane. */ + allowedAuthenticationModes?: AuthenticationMode[]; +} + +export function batchAccountCreatePropertiesSerializer(item: BatchAccountCreateProperties): any { + return { + autoStorage: !item["autoStorage"] + ? item["autoStorage"] + : autoStorageBasePropertiesSerializer(item["autoStorage"]), + poolAllocationMode: item["poolAllocationMode"], + keyVaultReference: !item["keyVaultReference"] + ? item["keyVaultReference"] + : keyVaultReferenceSerializer(item["keyVaultReference"]), + publicNetworkAccess: item["publicNetworkAccess"], + networkProfile: !item["networkProfile"] + ? item["networkProfile"] + : networkProfileSerializer(item["networkProfile"]), + encryption: !item["encryption"] + ? item["encryption"] + : encryptionPropertiesSerializer(item["encryption"]), + allowedAuthenticationModes: !item["allowedAuthenticationModes"] + ? item["allowedAuthenticationModes"] + : item["allowedAuthenticationModes"].map((p: any) => { + return p; + }), + }; +} + +/** The error detail. */ +export interface ErrorDetail { + /** The error code. */ + readonly code?: string; + /** The error message. */ + readonly message?: string; + /** The error target. */ + readonly target?: string; + /** The error details. */ + readonly details?: ErrorDetail[]; + /** The error additional info. */ + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + +export function errorDetailDeserializer(item: any): ErrorDetail { + return { + code: item["code"], + message: item["message"], + target: item["target"], + details: !item["details"] ? item["details"] : errorDetailArrayDeserializer(item["details"]), + additionalInfo: !item["additionalInfo"] + ? item["additionalInfo"] + : errorAdditionalInfoArrayDeserializer(item["additionalInfo"]), + }; +} + +export function errorDetailArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return errorDetailDeserializer(item); + }); +} + +export function errorAdditionalInfoArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return errorAdditionalInfoDeserializer(item); + }); +} + +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { + /** The additional info type. */ + readonly type?: string; + /** The additional info. */ + readonly info?: any; +} + +export function errorAdditionalInfoDeserializer(item: any): ErrorAdditionalInfo { + return { + type: item["type"], + info: item["info"], + }; +} + +/** Parameters for updating an Azure Batch account. */ +export interface BatchAccountUpdateParameters { + /** The user-specified tags associated with the account. */ + tags?: Record; + /** The identity of the Batch account. */ + identity?: BatchAccountIdentity; + /** The properties related to the auto-storage account. */ + autoStorage?: AutoStorageBaseProperties; + /** Configures how customer data is encrypted inside the Batch account. By default, accounts are encrypted using a Microsoft managed key. For additional control, a customer-managed key can be used instead. */ + encryption?: EncryptionProperties; + /** List of allowed authentication modes for the Batch account that can be used to authenticate with the data plane. This does not affect authentication with the control plane. */ + allowedAuthenticationModes?: AuthenticationMode[]; + /** The network access type for operating on the resources in the Batch account. */ + publicNetworkAccess?: PublicNetworkAccessType; + /** The network profile only takes effect when publicNetworkAccess is enabled. */ + networkProfile?: NetworkProfile; +} + +export function batchAccountUpdateParametersSerializer(item: BatchAccountUpdateParameters): any { + return { + tags: item["tags"], + properties: areAllPropsUndefined(item, [ + "autoStorage", + "encryption", + "allowedAuthenticationModes", + "publicNetworkAccess", + "networkProfile", + ]) + ? undefined + : _batchAccountUpdateParametersPropertiesSerializer(item), + identity: !item["identity"] + ? item["identity"] + : batchAccountIdentitySerializer(item["identity"]), + }; +} + +/** The properties of a Batch account. */ +export interface BatchAccountUpdateProperties { + /** The properties related to the auto-storage account. */ + autoStorage?: AutoStorageBaseProperties; + /** Configures how customer data is encrypted inside the Batch account. By default, accounts are encrypted using a Microsoft managed key. For additional control, a customer-managed key can be used instead. */ + encryption?: EncryptionProperties; + /** List of allowed authentication modes for the Batch account that can be used to authenticate with the data plane. This does not affect authentication with the control plane. */ + allowedAuthenticationModes?: AuthenticationMode[]; + /** The network access type for operating on the resources in the Batch account. */ + publicNetworkAccess?: PublicNetworkAccessType; + /** The network profile only takes effect when publicNetworkAccess is enabled. */ + networkProfile?: NetworkProfile; +} + +export function batchAccountUpdatePropertiesSerializer(item: BatchAccountUpdateProperties): any { + return { + autoStorage: !item["autoStorage"] + ? item["autoStorage"] + : autoStorageBasePropertiesSerializer(item["autoStorage"]), + encryption: !item["encryption"] + ? item["encryption"] + : encryptionPropertiesSerializer(item["encryption"]), + allowedAuthenticationModes: !item["allowedAuthenticationModes"] + ? item["allowedAuthenticationModes"] + : item["allowedAuthenticationModes"].map((p: any) => { + return p; + }), + publicNetworkAccess: item["publicNetworkAccess"], + networkProfile: !item["networkProfile"] + ? item["networkProfile"] + : networkProfileSerializer(item["networkProfile"]), + }; +} + +/** Paged collection of BatchAccount items */ +export interface _BatchAccountListResult { + /** The BatchAccount items on this page */ + value: BatchAccount[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _batchAccountListResultDeserializer(item: any): _BatchAccountListResult { + return { + value: batchAccountArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function batchAccountArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return batchAccountDeserializer(item); + }); +} + +/** Parameters supplied to the RegenerateKey operation. */ +export interface BatchAccountRegenerateKeyParameters { + /** The type of account key to regenerate. */ + keyName: AccountKeyType; +} + +export function batchAccountRegenerateKeyParametersSerializer( + item: BatchAccountRegenerateKeyParameters, +): any { + return { keyName: item["keyName"] }; +} + +/** The type of account key to regenerate. */ +export type AccountKeyType = "Primary" | "Secondary"; + +/** A set of Azure Batch account keys. */ +export interface BatchAccountKeys { + /** The Batch account name. */ + readonly accountName?: string; + /** The primary key associated with the account. */ + readonly primary?: string; + /** The secondary key associated with the account. */ + readonly secondary?: string; +} + +export function batchAccountKeysDeserializer(item: any): BatchAccountKeys { + return { + accountName: item["accountName"], + primary: item["primary"], + secondary: item["secondary"], + }; +} + +/** Values returned by the List operation. */ +export interface _OutboundEnvironmentEndpointCollection { + /** The OutboundEnvironmentEndpoint items on this page */ + readonly value: OutboundEnvironmentEndpoint[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _outboundEnvironmentEndpointCollectionDeserializer( + item: any, +): _OutboundEnvironmentEndpointCollection { + return { + value: outboundEnvironmentEndpointArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function outboundEnvironmentEndpointArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return outboundEnvironmentEndpointDeserializer(item); + }); +} + +/** A collection of related endpoints from the same service for which the Batch service requires outbound access. */ +export interface OutboundEnvironmentEndpoint { + /** The type of service that the Batch service connects to. */ + readonly category?: string; + /** The endpoints for this service to which the Batch service makes outbound calls. */ + readonly endpoints?: EndpointDependency[]; +} + +export function outboundEnvironmentEndpointDeserializer(item: any): OutboundEnvironmentEndpoint { + return { + category: item["category"], + endpoints: !item["endpoints"] + ? item["endpoints"] + : endpointDependencyArrayDeserializer(item["endpoints"]), + }; +} + +export function endpointDependencyArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return endpointDependencyDeserializer(item); + }); +} + +/** A domain name and connection details used to access a dependency. */ +export interface EndpointDependency { + /** The domain name of the dependency. Domain names may be fully qualified or may contain a * wildcard. */ + readonly domainName?: string; + /** Human-readable supplemental information about the dependency and when it is applicable. */ + readonly description?: string; + /** The list of connection details for this endpoint. */ + readonly endpointDetails?: EndpointDetail[]; +} + +export function endpointDependencyDeserializer(item: any): EndpointDependency { + return { + domainName: item["domainName"], + description: item["description"], + endpointDetails: !item["endpointDetails"] + ? item["endpointDetails"] + : endpointDetailArrayDeserializer(item["endpointDetails"]), + }; +} + +export function endpointDetailArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return endpointDetailDeserializer(item); + }); +} + +/** Details about the connection between the Batch service and the endpoint. */ +export interface EndpointDetail { + /** The port an endpoint is connected to. */ + readonly port?: number; +} + +export function endpointDetailDeserializer(item: any): EndpointDetail { + return { + port: item["port"], + }; +} + +/** Contains the information for a detector. */ +export interface DetectorResponse extends ProxyResource { + /** The ETag of the resource, used for concurrency statements. */ + readonly etag?: string; + /** The tags of the resource. */ + tags?: Record; + /** A base64 encoded string that represents the content of a detector. */ + value?: string; +} + +export function detectorResponseDeserializer(item: any): DetectorResponse { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + ...(!item["properties"] + ? item["properties"] + : _detectorResponsePropertiesDeserializer(item["properties"])), + etag: item["etag"], + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + }; +} + +/** Detector response properties. */ +export interface DetectorResponseProperties { + /** A base64 encoded string that represents the content of a detector. */ + value?: string; +} + +export function detectorResponsePropertiesDeserializer(item: any): DetectorResponseProperties { + return { + value: item["value"], + }; +} + +/** Paged collection of DetectorResponse items */ +export interface _DetectorListResult { + /** The DetectorResponse items on this page */ + value: DetectorResponse[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _detectorListResultDeserializer(item: any): _DetectorListResult { + return { + value: detectorResponseArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function detectorResponseArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return detectorResponseDeserializer(item); + }); +} + +/** An application package which represents a particular version of an application. */ +export interface ApplicationPackage extends ProxyResource { + /** The ETag of the resource, used for concurrency statements. */ + readonly etag?: string; + /** The tags of the resource. */ + tags?: Record; + /** The current state of the application package. */ + readonly state?: PackageState; + /** The format of the application package, if the package is active. */ + readonly format?: string; + /** The URL for the application package in Azure Storage. */ + readonly storageUrl?: string; + /** The UTC time at which the Azure Storage URL will expire. */ + readonly storageUrlExpiry?: Date; + /** The time at which the package was last activated, if the package is active. */ + readonly lastActivationTime?: Date; +} + +export function applicationPackageSerializer(item: ApplicationPackage): any { + return { + properties: areAllPropsUndefined(item, []) + ? undefined + : _applicationPackagePropertiesSerializer(item), + tags: item["tags"], + }; +} + +export function applicationPackageDeserializer(item: any): ApplicationPackage { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + ...(!item["properties"] + ? item["properties"] + : _applicationPackagePropertiesDeserializer(item["properties"])), + etag: item["etag"], + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + }; +} + +/** Properties of an application package */ +export interface ApplicationPackageProperties { + /** The current state of the application package. */ + readonly state?: PackageState; + /** The format of the application package, if the package is active. */ + readonly format?: string; + /** The URL for the application package in Azure Storage. */ + readonly storageUrl?: string; + /** The UTC time at which the Azure Storage URL will expire. */ + readonly storageUrlExpiry?: Date; + /** The time at which the package was last activated, if the package is active. */ + readonly lastActivationTime?: Date; +} + +export function applicationPackagePropertiesSerializer(item: ApplicationPackageProperties): any { + return item; +} + +export function applicationPackagePropertiesDeserializer(item: any): ApplicationPackageProperties { + return { + state: item["state"], + format: item["format"], + storageUrl: item["storageUrl"], + storageUrlExpiry: !item["storageUrlExpiry"] + ? item["storageUrlExpiry"] + : new Date(item["storageUrlExpiry"]), + lastActivationTime: !item["lastActivationTime"] + ? item["lastActivationTime"] + : new Date(item["lastActivationTime"]), + }; +} + +/** The current state of the application package. */ +export type PackageState = "Pending" | "Active"; + +/** The result of performing list application packages. */ +export interface _ListApplicationPackagesResult { + /** The ApplicationPackage items on this page */ + value: ApplicationPackage[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _listApplicationPackagesResultDeserializer( + item: any, +): _ListApplicationPackagesResult { + return { + value: applicationPackageArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function applicationPackageArraySerializer(result: Array): any[] { + return result.map((item) => { + return applicationPackageSerializer(item); + }); +} + +export function applicationPackageArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return applicationPackageDeserializer(item); + }); +} + +/** Parameters for an activating an application package. */ +export interface ActivateApplicationPackageParameters { + /** The format of the application package binary file. */ + format: string; +} + +export function activateApplicationPackageParametersSerializer( + item: ActivateApplicationPackageParameters, +): any { + return { format: item["format"] }; +} + +/** Contains information about an application in a Batch account. */ +export interface Application extends ProxyResource { + /** The ETag of the resource, used for concurrency statements. */ + readonly etag?: string; + /** The tags of the resource. */ + tags?: Record; + /** The display name for the application. */ + displayName?: string; + /** A value indicating whether packages within the application may be overwritten using the same version string. */ + allowUpdates?: boolean; + /** The package to use if a client requests the application but does not specify a version. This property can only be set to the name of an existing package. */ + defaultVersion?: string; +} + +export function applicationSerializer(item: Application): any { + return { + properties: areAllPropsUndefined(item, ["displayName", "allowUpdates", "defaultVersion"]) + ? undefined + : _applicationPropertiesSerializer(item), + tags: item["tags"], + }; +} + +export function applicationDeserializer(item: any): Application { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + ...(!item["properties"] + ? item["properties"] + : _applicationPropertiesDeserializer(item["properties"])), + etag: item["etag"], + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + }; +} + +/** The properties associated with the Application. */ +export interface ApplicationProperties { + /** The display name for the application. */ + displayName?: string; + /** A value indicating whether packages within the application may be overwritten using the same version string. */ + allowUpdates?: boolean; + /** The package to use if a client requests the application but does not specify a version. This property can only be set to the name of an existing package. */ + defaultVersion?: string; +} + +export function applicationPropertiesSerializer(item: ApplicationProperties): any { + return { + displayName: item["displayName"], + allowUpdates: item["allowUpdates"], + defaultVersion: item["defaultVersion"], + }; +} + +export function applicationPropertiesDeserializer(item: any): ApplicationProperties { + return { + displayName: item["displayName"], + allowUpdates: item["allowUpdates"], + defaultVersion: item["defaultVersion"], + }; +} + +/** The result of performing list applications. */ +export interface _ListApplicationsResult { + /** The Application items on this page */ + value: Application[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _listApplicationsResultDeserializer(item: any): _ListApplicationsResult { + return { + value: applicationArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function applicationArraySerializer(result: Array): any[] { + return result.map((item) => { + return applicationSerializer(item); + }); +} + +export function applicationArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return applicationDeserializer(item); + }); +} + +/** Contains information about a private link resource. */ +export interface PrivateLinkResource extends ProxyResource { + /** The ETag of the resource, used for concurrency statements. */ + readonly etag?: string; + /** The tags of the resource. */ + tags?: Record; + /** The group id is used to establish the private link connection. */ + readonly groupId?: string; + /** The list of required members that are used to establish the private link connection. */ + readonly requiredMembers?: string[]; + /** The list of required zone names for the private DNS resource name */ + readonly requiredZoneNames?: string[]; +} + +export function privateLinkResourceDeserializer(item: any): PrivateLinkResource { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + ...(!item["properties"] + ? item["properties"] + : _privateLinkResourcePropertiesDeserializer(item["properties"])), + etag: item["etag"], + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + }; +} + +/** Private link resource properties. */ +export interface PrivateLinkResourceProperties { + /** The group id is used to establish the private link connection. */ + readonly groupId?: string; + /** The list of required members that are used to establish the private link connection. */ + readonly requiredMembers?: string[]; + /** The list of required zone names for the private DNS resource name */ + readonly requiredZoneNames?: string[]; +} + +export function privateLinkResourcePropertiesDeserializer( + item: any, +): PrivateLinkResourceProperties { + return { + groupId: item["groupId"], + requiredMembers: !item["requiredMembers"] + ? item["requiredMembers"] + : item["requiredMembers"].map((p: any) => { + return p; + }), + requiredZoneNames: !item["requiredZoneNames"] + ? item["requiredZoneNames"] + : item["requiredZoneNames"].map((p: any) => { + return p; + }), + }; +} + +/** Values returned by the List operation. */ +export interface _ListPrivateLinkResourcesResult { + /** The PrivateLinkResource items on this page */ + value: PrivateLinkResource[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _listPrivateLinkResourcesResultDeserializer( + item: any, +): _ListPrivateLinkResourcesResult { + return { + value: privateLinkResourceArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function privateLinkResourceArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return privateLinkResourceDeserializer(item); + }); +} + +/** Values returned by the List operation. */ +export interface _ListPrivateEndpointConnectionsResult { + /** The PrivateEndpointConnection items on this page */ + value: PrivateEndpointConnection[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _listPrivateEndpointConnectionsResultDeserializer( + item: any, +): _ListPrivateEndpointConnectionsResult { + return { + value: privateEndpointConnectionArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +/** Contains information about a pool. */ +export interface Pool extends ProxyResource { + /** The type of identity used for the Batch Pool. */ + identity?: BatchPoolIdentity; + /** The ETag of the resource, used for concurrency statements. */ + readonly etag?: string; + /** The tags of the resource. */ + tags?: Record; + /** The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. */ + displayName?: string; + /** This is the last time at which the pool level data, such as the targetDedicatedNodes or autoScaleSettings, changed. It does not factor in node-level changes such as a compute node changing state. */ + readonly lastModified?: Date; + /** The creation time of the pool. */ + readonly creationTime?: Date; + /** The current state of the pool. */ + readonly provisioningState?: PoolProvisioningState; + /** The time at which the pool entered its current state. */ + readonly provisioningStateTransitionTime?: Date; + /** Whether the pool is resizing. */ + readonly allocationState?: AllocationState; + /** The time at which the pool entered its current allocation state. */ + readonly allocationStateTransitionTime?: Date; + /** For information about available VM sizes, see Sizes for Virtual Machines in Azure (https://learn.microsoft.com/azure/virtual-machines/sizes/overview). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). */ + vmSize?: string; + /** Deployment configuration properties. */ + deploymentConfiguration?: DeploymentConfiguration; + /** The number of dedicated compute nodes currently in the pool. */ + readonly currentDedicatedNodes?: number; + /** The number of Spot/low-priority compute nodes currently in the pool. */ + readonly currentLowPriorityNodes?: number; + /** Defines the desired size of the pool. This can either be 'fixedScale' where the requested targetDedicatedNodes is specified, or 'autoScale' which defines a formula which is periodically reevaluated. If this property is not specified, the pool will have a fixed scale with 0 targetDedicatedNodes. */ + scaleSettings?: ScaleSettings; + /** This property is set only if the pool automatically scales, i.e. autoScaleSettings are used. */ + readonly autoScaleRun?: AutoScaleRun; + /** This imposes restrictions on which nodes can be assigned to the pool. Enabling this value can reduce the chance of the requested number of nodes to be allocated in the pool. If not specified, this value defaults to 'Disabled'. */ + interNodeCommunication?: InterNodeCommunicationState; + /** The network configuration for a pool. */ + networkConfiguration?: NetworkConfiguration; + /** The default value is 1. The maximum value is the smaller of 4 times the number of cores of the vmSize of the pool or 256. */ + taskSlotsPerNode?: number; + /** If not specified, the default is spread. */ + taskSchedulingPolicy?: TaskSchedulingPolicy; + /** The list of user accounts to be created on each node in the pool. */ + userAccounts?: UserAccount[]; + /** The Batch service does not assign any meaning to metadata; it is solely for the use of user code. */ + metadata?: MetadataItem[]; + /** In an PATCH (update) operation, this property can be set to an empty object to remove the start task from the pool. */ + startTask?: StartTask; + /** Changes to application package references affect all new compute nodes joining the pool, but do not affect compute nodes that are already in the pool until they are rebooted or reimaged. There is a maximum of 10 application package references on any given pool. */ + applicationPackages?: ApplicationPackageReference[]; + /** Describes either the current operation (if the pool AllocationState is Resizing) or the previously completed operation (if the AllocationState is Steady). */ + readonly resizeOperationStatus?: ResizeOperationStatus; + /** This supports Azure Files, NFS, CIFS/SMB, and Blobfuse. */ + mountConfiguration?: MountConfiguration[]; + /** Describes an upgrade policy - automatic, manual, or rolling. */ + upgradePolicy?: UpgradePolicy; +} + +export function poolSerializer(item: Pool): any { + return { + properties: areAllPropsUndefined(item, [ + "displayName", + "vmSize", + "deploymentConfiguration", + "scaleSettings", + "interNodeCommunication", + "networkConfiguration", + "taskSlotsPerNode", + "taskSchedulingPolicy", + "userAccounts", + "metadata", + "startTask", + "applicationPackages", + "mountConfiguration", + "upgradePolicy", + ]) + ? undefined + : _poolPropertiesSerializer(item), + identity: !item["identity"] ? item["identity"] : batchPoolIdentitySerializer(item["identity"]), + tags: item["tags"], + }; +} + +export function poolDeserializer(item: any): Pool { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + ...(!item["properties"] ? item["properties"] : _poolPropertiesDeserializer(item["properties"])), + identity: !item["identity"] + ? item["identity"] + : batchPoolIdentityDeserializer(item["identity"]), + etag: item["etag"], + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + }; +} + +/** Pool properties. */ +export interface PoolProperties { + /** The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. */ + displayName?: string; + /** This is the last time at which the pool level data, such as the targetDedicatedNodes or autoScaleSettings, changed. It does not factor in node-level changes such as a compute node changing state. */ + readonly lastModified?: Date; + /** The creation time of the pool. */ + readonly creationTime?: Date; + /** The current state of the pool. */ + readonly provisioningState?: PoolProvisioningState; + /** The time at which the pool entered its current state. */ + readonly provisioningStateTransitionTime?: Date; + /** Whether the pool is resizing. */ + readonly allocationState?: AllocationState; + /** The time at which the pool entered its current allocation state. */ + readonly allocationStateTransitionTime?: Date; + /** For information about available VM sizes, see Sizes for Virtual Machines in Azure (https://learn.microsoft.com/azure/virtual-machines/sizes/overview). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). */ + vmSize?: string; + /** Deployment configuration properties. */ + deploymentConfiguration?: DeploymentConfiguration; + /** The number of dedicated compute nodes currently in the pool. */ + readonly currentDedicatedNodes?: number; + /** The number of Spot/low-priority compute nodes currently in the pool. */ + readonly currentLowPriorityNodes?: number; + /** Defines the desired size of the pool. This can either be 'fixedScale' where the requested targetDedicatedNodes is specified, or 'autoScale' which defines a formula which is periodically reevaluated. If this property is not specified, the pool will have a fixed scale with 0 targetDedicatedNodes. */ + scaleSettings?: ScaleSettings; + /** This property is set only if the pool automatically scales, i.e. autoScaleSettings are used. */ + readonly autoScaleRun?: AutoScaleRun; + /** This imposes restrictions on which nodes can be assigned to the pool. Enabling this value can reduce the chance of the requested number of nodes to be allocated in the pool. If not specified, this value defaults to 'Disabled'. */ + interNodeCommunication?: InterNodeCommunicationState; + /** The network configuration for a pool. */ + networkConfiguration?: NetworkConfiguration; + /** The default value is 1. The maximum value is the smaller of 4 times the number of cores of the vmSize of the pool or 256. */ + taskSlotsPerNode?: number; + /** If not specified, the default is spread. */ + taskSchedulingPolicy?: TaskSchedulingPolicy; + /** The list of user accounts to be created on each node in the pool. */ + userAccounts?: UserAccount[]; + /** The Batch service does not assign any meaning to metadata; it is solely for the use of user code. */ + metadata?: MetadataItem[]; + /** In an PATCH (update) operation, this property can be set to an empty object to remove the start task from the pool. */ + startTask?: StartTask; + /** Changes to application package references affect all new compute nodes joining the pool, but do not affect compute nodes that are already in the pool until they are rebooted or reimaged. There is a maximum of 10 application package references on any given pool. */ + applicationPackages?: ApplicationPackageReference[]; + /** Describes either the current operation (if the pool AllocationState is Resizing) or the previously completed operation (if the AllocationState is Steady). */ + readonly resizeOperationStatus?: ResizeOperationStatus; + /** This supports Azure Files, NFS, CIFS/SMB, and Blobfuse. */ + mountConfiguration?: MountConfiguration[]; + /** Describes an upgrade policy - automatic, manual, or rolling. */ + upgradePolicy?: UpgradePolicy; +} + +export function poolPropertiesSerializer(item: PoolProperties): any { + return { + displayName: item["displayName"], + vmSize: item["vmSize"], + deploymentConfiguration: !item["deploymentConfiguration"] + ? item["deploymentConfiguration"] + : deploymentConfigurationSerializer(item["deploymentConfiguration"]), + scaleSettings: !item["scaleSettings"] + ? item["scaleSettings"] + : scaleSettingsSerializer(item["scaleSettings"]), + interNodeCommunication: item["interNodeCommunication"], + networkConfiguration: !item["networkConfiguration"] + ? item["networkConfiguration"] + : networkConfigurationSerializer(item["networkConfiguration"]), + taskSlotsPerNode: item["taskSlotsPerNode"], + taskSchedulingPolicy: !item["taskSchedulingPolicy"] + ? item["taskSchedulingPolicy"] + : taskSchedulingPolicySerializer(item["taskSchedulingPolicy"]), + userAccounts: !item["userAccounts"] + ? item["userAccounts"] + : userAccountArraySerializer(item["userAccounts"]), + metadata: !item["metadata"] ? item["metadata"] : metadataItemArraySerializer(item["metadata"]), + startTask: !item["startTask"] ? item["startTask"] : startTaskSerializer(item["startTask"]), + applicationPackages: !item["applicationPackages"] + ? item["applicationPackages"] + : applicationPackageReferenceArraySerializer(item["applicationPackages"]), + mountConfiguration: !item["mountConfiguration"] + ? item["mountConfiguration"] + : mountConfigurationArraySerializer(item["mountConfiguration"]), + upgradePolicy: !item["upgradePolicy"] + ? item["upgradePolicy"] + : upgradePolicySerializer(item["upgradePolicy"]), + }; +} + +export function poolPropertiesDeserializer(item: any): PoolProperties { + return { + displayName: item["displayName"], + lastModified: !item["lastModified"] ? item["lastModified"] : new Date(item["lastModified"]), + creationTime: !item["creationTime"] ? item["creationTime"] : new Date(item["creationTime"]), + provisioningState: item["provisioningState"], + provisioningStateTransitionTime: !item["provisioningStateTransitionTime"] + ? item["provisioningStateTransitionTime"] + : new Date(item["provisioningStateTransitionTime"]), + allocationState: item["allocationState"], + allocationStateTransitionTime: !item["allocationStateTransitionTime"] + ? item["allocationStateTransitionTime"] + : new Date(item["allocationStateTransitionTime"]), + vmSize: item["vmSize"], + deploymentConfiguration: !item["deploymentConfiguration"] + ? item["deploymentConfiguration"] + : deploymentConfigurationDeserializer(item["deploymentConfiguration"]), + currentDedicatedNodes: item["currentDedicatedNodes"], + currentLowPriorityNodes: item["currentLowPriorityNodes"], + scaleSettings: !item["scaleSettings"] + ? item["scaleSettings"] + : scaleSettingsDeserializer(item["scaleSettings"]), + autoScaleRun: !item["autoScaleRun"] + ? item["autoScaleRun"] + : autoScaleRunDeserializer(item["autoScaleRun"]), + interNodeCommunication: item["interNodeCommunication"], + networkConfiguration: !item["networkConfiguration"] + ? item["networkConfiguration"] + : networkConfigurationDeserializer(item["networkConfiguration"]), + taskSlotsPerNode: item["taskSlotsPerNode"], + taskSchedulingPolicy: !item["taskSchedulingPolicy"] + ? item["taskSchedulingPolicy"] + : taskSchedulingPolicyDeserializer(item["taskSchedulingPolicy"]), + userAccounts: !item["userAccounts"] + ? item["userAccounts"] + : userAccountArrayDeserializer(item["userAccounts"]), + metadata: !item["metadata"] + ? item["metadata"] + : metadataItemArrayDeserializer(item["metadata"]), + startTask: !item["startTask"] ? item["startTask"] : startTaskDeserializer(item["startTask"]), + applicationPackages: !item["applicationPackages"] + ? item["applicationPackages"] + : applicationPackageReferenceArrayDeserializer(item["applicationPackages"]), + resizeOperationStatus: !item["resizeOperationStatus"] + ? item["resizeOperationStatus"] + : resizeOperationStatusDeserializer(item["resizeOperationStatus"]), + mountConfiguration: !item["mountConfiguration"] + ? item["mountConfiguration"] + : mountConfigurationArrayDeserializer(item["mountConfiguration"]), + upgradePolicy: !item["upgradePolicy"] + ? item["upgradePolicy"] + : upgradePolicyDeserializer(item["upgradePolicy"]), + }; +} + +/** The current state of the pool. */ +export type PoolProvisioningState = "Succeeded" | "Deleting"; +/** Whether the pool is resizing. */ +export type AllocationState = "Steady" | "Resizing" | "Stopping"; + +/** Deployment configuration properties. */ +export interface DeploymentConfiguration { + /** The configuration for compute nodes in a pool based on the Azure Virtual Machines infrastructure. */ + virtualMachineConfiguration?: VirtualMachineConfiguration; +} + +export function deploymentConfigurationSerializer(item: DeploymentConfiguration): any { + return { + virtualMachineConfiguration: !item["virtualMachineConfiguration"] + ? item["virtualMachineConfiguration"] + : virtualMachineConfigurationSerializer(item["virtualMachineConfiguration"]), + }; +} + +export function deploymentConfigurationDeserializer(item: any): DeploymentConfiguration { + return { + virtualMachineConfiguration: !item["virtualMachineConfiguration"] + ? item["virtualMachineConfiguration"] + : virtualMachineConfigurationDeserializer(item["virtualMachineConfiguration"]), + }; +} + +/** The configuration for compute nodes in a pool based on the Azure Virtual Machines infrastructure. */ +export interface VirtualMachineConfiguration { + /** A reference to an Azure Virtual Machines Marketplace image or the Azure Image resource of a custom Virtual Machine. To get the list of all imageReferences verified by Azure Batch, see the 'List supported node agent SKUs' operation. */ + imageReference: ImageReference; + /** The Batch node agent is a program that runs on each node in the pool, and provides the command-and-control interface between the node and the Batch service. There are different implementations of the node agent, known as SKUs, for different operating systems. You must specify a node agent SKU which matches the selected image reference. To get the list of supported node agent SKUs along with their list of verified image references, see the 'List supported node agent SKUs' operation. */ + nodeAgentSkuId: string; + /** This property must not be specified if the imageReference specifies a Linux OS image. */ + windowsConfiguration?: WindowsConfiguration; + /** This property must be specified if the compute nodes in the pool need to have empty data disks attached to them. */ + dataDisks?: DataDisk[]; + /** + * This only applies to images that contain the Windows operating system, and should only be used when you hold valid on-premises licenses for the nodes which will be deployed. If omitted, no on-premises licensing discount is applied. Values are: + * + * Windows_Server - The on-premises license is for Windows Server. + * Windows_Client - The on-premises license is for Windows Client. + */ + licenseType?: string; + /** If specified, setup is performed on each node in the pool to allow tasks to run in containers. All regular tasks and job manager tasks run on this pool must specify the containerSettings property, and all other tasks may specify it. */ + containerConfiguration?: ContainerConfiguration; + /** If specified, encryption is performed on each node in the pool during node provisioning. */ + diskEncryptionConfiguration?: DiskEncryptionConfiguration; + /** This configuration will specify rules on how nodes in the pool will be physically allocated. */ + nodePlacementConfiguration?: NodePlacementConfiguration; + /** If specified, the extensions mentioned in this configuration will be installed on each node. */ + extensions?: VMExtension[]; + /** Contains configuration for ephemeral OSDisk settings. */ + osDisk?: OSDisk; + /** Specifies the security profile settings for the virtual machine or virtual machine scale set. */ + securityProfile?: SecurityProfile; + /** The service artifact reference id in the form of /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactName}/vmArtifactsProfiles/{vmArtifactsProfilesName} */ + serviceArtifactReference?: ServiceArtifactReference; +} + +export function virtualMachineConfigurationSerializer(item: VirtualMachineConfiguration): any { + return { + imageReference: imageReferenceSerializer(item["imageReference"]), + nodeAgentSkuId: item["nodeAgentSkuId"], + windowsConfiguration: !item["windowsConfiguration"] + ? item["windowsConfiguration"] + : windowsConfigurationSerializer(item["windowsConfiguration"]), + dataDisks: !item["dataDisks"] ? item["dataDisks"] : dataDiskArraySerializer(item["dataDisks"]), + licenseType: item["licenseType"], + containerConfiguration: !item["containerConfiguration"] + ? item["containerConfiguration"] + : containerConfigurationSerializer(item["containerConfiguration"]), + diskEncryptionConfiguration: !item["diskEncryptionConfiguration"] + ? item["diskEncryptionConfiguration"] + : diskEncryptionConfigurationSerializer(item["diskEncryptionConfiguration"]), + nodePlacementConfiguration: !item["nodePlacementConfiguration"] + ? item["nodePlacementConfiguration"] + : nodePlacementConfigurationSerializer(item["nodePlacementConfiguration"]), + extensions: !item["extensions"] + ? item["extensions"] + : vmExtensionArraySerializer(item["extensions"]), + osDisk: !item["osDisk"] ? item["osDisk"] : osDiskSerializer(item["osDisk"]), + securityProfile: !item["securityProfile"] + ? item["securityProfile"] + : securityProfileSerializer(item["securityProfile"]), + serviceArtifactReference: !item["serviceArtifactReference"] + ? item["serviceArtifactReference"] + : serviceArtifactReferenceSerializer(item["serviceArtifactReference"]), + }; +} + +export function virtualMachineConfigurationDeserializer(item: any): VirtualMachineConfiguration { + return { + imageReference: imageReferenceDeserializer(item["imageReference"]), + nodeAgentSkuId: item["nodeAgentSkuId"], + windowsConfiguration: !item["windowsConfiguration"] + ? item["windowsConfiguration"] + : windowsConfigurationDeserializer(item["windowsConfiguration"]), + dataDisks: !item["dataDisks"] + ? item["dataDisks"] + : dataDiskArrayDeserializer(item["dataDisks"]), + licenseType: item["licenseType"], + containerConfiguration: !item["containerConfiguration"] + ? item["containerConfiguration"] + : containerConfigurationDeserializer(item["containerConfiguration"]), + diskEncryptionConfiguration: !item["diskEncryptionConfiguration"] + ? item["diskEncryptionConfiguration"] + : diskEncryptionConfigurationDeserializer(item["diskEncryptionConfiguration"]), + nodePlacementConfiguration: !item["nodePlacementConfiguration"] + ? item["nodePlacementConfiguration"] + : nodePlacementConfigurationDeserializer(item["nodePlacementConfiguration"]), + extensions: !item["extensions"] + ? item["extensions"] + : vmExtensionArrayDeserializer(item["extensions"]), + osDisk: !item["osDisk"] ? item["osDisk"] : osDiskDeserializer(item["osDisk"]), + securityProfile: !item["securityProfile"] + ? item["securityProfile"] + : securityProfileDeserializer(item["securityProfile"]), + serviceArtifactReference: !item["serviceArtifactReference"] + ? item["serviceArtifactReference"] + : serviceArtifactReferenceDeserializer(item["serviceArtifactReference"]), + }; +} + +/** A reference to an Azure Virtual Machines Marketplace image or the Azure Image resource of a custom Virtual Machine. To get the list of all imageReferences verified by Azure Batch, see the 'List supported node agent SKUs' operation. */ +export interface ImageReference { + /** For example, Canonical or MicrosoftWindowsServer. */ + publisher?: string; + /** For example, UbuntuServer or WindowsServer. */ + offer?: string; + /** For example, 18.04-LTS or 2022-datacenter. */ + sku?: string; + /** A value of 'latest' can be specified to select the latest version of an image. If omitted, the default is 'latest'. */ + version?: string; + /** This property is mutually exclusive with other properties. The Azure Compute Gallery Image must have replicas in the same region as the Azure Batch account. For information about the firewall settings for the Batch node agent to communicate with the Batch service see https://learn.microsoft.com/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. */ + id?: string; + /** This property is mutually exclusive with other properties and can be fetched from shared gallery image GET call. */ + sharedGalleryImageId?: string; + /** This property is mutually exclusive with other properties and can be fetched from community gallery image GET call. */ + communityGalleryImageId?: string; +} + +export function imageReferenceSerializer(item: ImageReference): any { + return { + publisher: item["publisher"], + offer: item["offer"], + sku: item["sku"], + version: item["version"], + id: item["id"], + sharedGalleryImageId: item["sharedGalleryImageId"], + communityGalleryImageId: item["communityGalleryImageId"], + }; +} + +export function imageReferenceDeserializer(item: any): ImageReference { + return { + publisher: item["publisher"], + offer: item["offer"], + sku: item["sku"], + version: item["version"], + id: item["id"], + sharedGalleryImageId: item["sharedGalleryImageId"], + communityGalleryImageId: item["communityGalleryImageId"], + }; +} + +/** Windows operating system settings to apply to the virtual machine. */ +export interface WindowsConfiguration { + /** If omitted, the default value is true. */ + enableAutomaticUpdates?: boolean; +} + +export function windowsConfigurationSerializer(item: WindowsConfiguration): any { + return { enableAutomaticUpdates: item["enableAutomaticUpdates"] }; +} + +export function windowsConfigurationDeserializer(item: any): WindowsConfiguration { + return { + enableAutomaticUpdates: item["enableAutomaticUpdates"], + }; +} + +export function dataDiskArraySerializer(result: Array): any[] { + return result.map((item) => { + return dataDiskSerializer(item); + }); +} + +export function dataDiskArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return dataDiskDeserializer(item); + }); +} + +/** Settings which will be used by the data disks associated to Compute Nodes in the Pool. When using attached data disks, you need to mount and format the disks from within a VM to use them. */ +export interface DataDisk { + /** The lun is used to uniquely identify each data disk. If attaching multiple disks, each should have a distinct lun. The value must be between 0 and 63, inclusive. */ + lun: number; + /** + * Values are: + * + * none - The caching mode for the disk is not enabled. + * readOnly - The caching mode for the disk is read only. + * readWrite - The caching mode for the disk is read and write. + * + * The default value for caching is none. For information about the caching options see: https://blogs.msdn.microsoft.com/windowsazurestorage/2012/06/27/exploring-windows-azure-drives-disks-and-images/. + */ + caching?: CachingType; + /** The initial disk size in GB when creating new data disk. */ + diskSizeGB: number; + /** The managed disk parameters. */ + managedDisk?: ManagedDisk; +} + +export function dataDiskSerializer(item: DataDisk): any { + return { + lun: item["lun"], + caching: item["caching"], + diskSizeGB: item["diskSizeGB"], + managedDisk: !item["managedDisk"] + ? item["managedDisk"] + : managedDiskSerializer(item["managedDisk"]), + }; +} + +export function dataDiskDeserializer(item: any): DataDisk { + return { + lun: item["lun"], + caching: item["caching"], + diskSizeGB: item["diskSizeGB"], + managedDisk: !item["managedDisk"] + ? item["managedDisk"] + : managedDiskDeserializer(item["managedDisk"]), + }; +} + +/** The type of caching to enable for the disk. */ +export type CachingType = "None" | "ReadOnly" | "ReadWrite"; + +/** The managed disk parameters. */ +export interface ManagedDisk { + /** The storage account type for use in creating data disks or OS disk. */ + storageAccountType?: StorageAccountType; + /** Specifies the security profile settings for the managed disk. **Note**: It can only be set for Confidential VMs and is required when using Confidential VMs. */ + securityProfile?: VMDiskSecurityProfile; + /** Specifies the customer managed disk encryption set resource id for the managed disk. It can be set only in UserSubscription mode. */ + diskEncryptionSet?: DiskEncryptionSetParameters; +} + +export function managedDiskSerializer(item: ManagedDisk): any { + return { + storageAccountType: item["storageAccountType"], + securityProfile: !item["securityProfile"] + ? item["securityProfile"] + : vmDiskSecurityProfileSerializer(item["securityProfile"]), + diskEncryptionSet: !item["diskEncryptionSet"] + ? item["diskEncryptionSet"] + : diskEncryptionSetParametersSerializer(item["diskEncryptionSet"]), + }; +} + +export function managedDiskDeserializer(item: any): ManagedDisk { + return { + storageAccountType: item["storageAccountType"], + securityProfile: !item["securityProfile"] + ? item["securityProfile"] + : vmDiskSecurityProfileDeserializer(item["securityProfile"]), + diskEncryptionSet: !item["diskEncryptionSet"] + ? item["diskEncryptionSet"] + : diskEncryptionSetParametersDeserializer(item["diskEncryptionSet"]), + }; +} + +/** The storage account type for use in creating data disks or OS disk. */ +export type StorageAccountType = "Standard_LRS" | "Premium_LRS" | "StandardSSD_LRS"; + +/** Specifies the security profile settings for the managed disk. **Note**: It can only be set for Confidential VMs and is required when using Confidential VMs. */ +export interface VMDiskSecurityProfile { + /** Specifies the EncryptionType of the managed disk. It is set to VMGuestStateOnly for encryption of just the VMGuestState blob, and NonPersistedTPM for not persisting firmware state in the VMGuestState blob. **Note**: It can be set for only Confidential VMs and required when using Confidential VMs. */ + securityEncryptionType?: SecurityEncryptionTypes; + /** Specifies the customer managed disk encryption set resource id for the managed disk that is used for Customer Managed Key encrypted ConfidentialVM OS Disk and VMGuest blob. It can be set only in UserSubscription mode. */ + diskEncryptionSet?: DiskEncryptionSetParameters; +} + +export function vmDiskSecurityProfileSerializer(item: VMDiskSecurityProfile): any { + return { + securityEncryptionType: item["securityEncryptionType"], + diskEncryptionSet: !item["diskEncryptionSet"] + ? item["diskEncryptionSet"] + : diskEncryptionSetParametersSerializer(item["diskEncryptionSet"]), + }; +} + +export function vmDiskSecurityProfileDeserializer(item: any): VMDiskSecurityProfile { + return { + securityEncryptionType: item["securityEncryptionType"], + diskEncryptionSet: !item["diskEncryptionSet"] + ? item["diskEncryptionSet"] + : diskEncryptionSetParametersDeserializer(item["diskEncryptionSet"]), + }; +} + +/** Specifies the EncryptionType of the managed disk. It is set to DiskWithVMGuestState for encryption of the managed disk along with VMGuestState blob, VMGuestStateOnly for encryption of just the VMGuestState blob, and NonPersistedTPM for not persisting firmware state in the VMGuestState blob. **Note**: It can be set for only Confidential VMs and required when using Confidential VMs. */ +export enum KnownSecurityEncryptionTypes { + /** EncryptionType of the managed disk is set to NonPersistedTPM for not persisting firmware state in the VMGuestState blob. */ + NonPersistedTPM = "NonPersistedTPM", + /** EncryptionType of the managed disk is set to VMGuestStateOnly for encryption of just the VMGuestState blob. */ + VMGuestStateOnly = "VMGuestStateOnly", + /** EncryptionType of the managed disk is set to DiskWithVMGuestState for encryption of the managed disk along with VMGuestState blob. It is not supported in data disks. */ + DiskWithVMGuestState = "DiskWithVMGuestState", +} + +/** + * Specifies the EncryptionType of the managed disk. It is set to DiskWithVMGuestState for encryption of the managed disk along with VMGuestState blob, VMGuestStateOnly for encryption of just the VMGuestState blob, and NonPersistedTPM for not persisting firmware state in the VMGuestState blob. **Note**: It can be set for only Confidential VMs and required when using Confidential VMs. \ + * {@link KnownSecurityEncryptionTypes} can be used interchangeably with SecurityEncryptionTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **NonPersistedTPM**: EncryptionType of the managed disk is set to NonPersistedTPM for not persisting firmware state in the VMGuestState blob. \ + * **VMGuestStateOnly**: EncryptionType of the managed disk is set to VMGuestStateOnly for encryption of just the VMGuestState blob. \ + * **DiskWithVMGuestState**: EncryptionType of the managed disk is set to DiskWithVMGuestState for encryption of the managed disk along with VMGuestState blob. It is not supported in data disks. + */ +export type SecurityEncryptionTypes = string; + +/** The ARM resource id of the disk encryption set. */ +export interface DiskEncryptionSetParameters { + /** The ARM resource id of the disk encryption set. The resource should be in the same subscription as the Batch account. */ + id: string; +} + +export function diskEncryptionSetParametersSerializer(item: DiskEncryptionSetParameters): any { + return { id: item["id"] }; +} + +export function diskEncryptionSetParametersDeserializer(item: any): DiskEncryptionSetParameters { + return { + id: item["id"], + }; +} + +/** The configuration for container-enabled pools. */ +export interface ContainerConfiguration { + /** The container technology to be used. */ + 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. */ + containerRegistries?: ContainerRegistry[]; +} + +export function containerConfigurationSerializer(item: ContainerConfiguration): any { + return { + type: item["type"], + containerImageNames: !item["containerImageNames"] + ? item["containerImageNames"] + : item["containerImageNames"].map((p: any) => { + return p; + }), + containerRegistries: !item["containerRegistries"] + ? item["containerRegistries"] + : containerRegistryArraySerializer(item["containerRegistries"]), + }; +} + +export function containerConfigurationDeserializer(item: any): ContainerConfiguration { + return { + type: item["type"], + containerImageNames: !item["containerImageNames"] + ? item["containerImageNames"] + : item["containerImageNames"].map((p: any) => { + return p; + }), + containerRegistries: !item["containerRegistries"] + ? item["containerRegistries"] + : containerRegistryArrayDeserializer(item["containerRegistries"]), + }; +} + +/** The container technology to be used. */ +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", +} + +/** + * The container technology to be used. \ + * {@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; + +export function containerRegistryArraySerializer(result: Array): any[] { + return result.map((item) => { + return containerRegistrySerializer(item); + }); +} + +export function containerRegistryArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return containerRegistryDeserializer(item); + }); +} + +/** A private container registry. */ +export interface ContainerRegistry { + /** The user name to log into the registry server. */ + userName?: string; + /** The password to log into the registry server. */ + password?: string; + /** If omitted, the default is "docker.io". */ + registryServer?: string; + /** The reference to a user assigned identity associated with the Batch pool which a compute node will use. */ + identityReference?: ComputeNodeIdentityReference; +} + +export function containerRegistrySerializer(item: ContainerRegistry): any { + return { + username: item["userName"], + password: item["password"], + registryServer: item["registryServer"], + identityReference: !item["identityReference"] + ? item["identityReference"] + : computeNodeIdentityReferenceSerializer(item["identityReference"]), + }; +} + +export function containerRegistryDeserializer(item: any): ContainerRegistry { + return { + userName: item["username"], + password: item["password"], + registryServer: item["registryServer"], + identityReference: !item["identityReference"] + ? item["identityReference"] + : computeNodeIdentityReferenceDeserializer(item["identityReference"]), + }; +} + +/** The disk encryption configuration applied on compute nodes in the pool. Disk encryption configuration is not supported on Linux pool created with Virtual Machine Image or Azure Compute Gallery Image. */ +export interface DiskEncryptionConfiguration { + /** On Linux pool, only "TemporaryDisk" is supported; on Windows pool, "OsDisk" and "TemporaryDisk" must be specified. */ + targets?: DiskEncryptionTarget[]; + /** Customer Managed Key will encrypt OS Disk by EncryptionAtRest, and by default we will encrypt the data disk as well. It can be used only when the pool is configured with an identity and OsDisk is set as one of the targets of DiskEncryption. */ + customerManagedKey?: DiskCustomerManagedKey; +} + +export function diskEncryptionConfigurationSerializer(item: DiskEncryptionConfiguration): any { + return { + targets: !item["targets"] + ? item["targets"] + : item["targets"].map((p: any) => { + return p; + }), + customerManagedKey: !item["customerManagedKey"] + ? item["customerManagedKey"] + : diskCustomerManagedKeySerializer(item["customerManagedKey"]), + }; +} + +export function diskEncryptionConfigurationDeserializer(item: any): DiskEncryptionConfiguration { + return { + targets: !item["targets"] + ? item["targets"] + : item["targets"].map((p: any) => { + return p; + }), + customerManagedKey: !item["customerManagedKey"] + ? item["customerManagedKey"] + : diskCustomerManagedKeyDeserializer(item["customerManagedKey"]), + }; +} + +/** If omitted, no disks on the compute nodes in the pool will be encrypted. */ +export type DiskEncryptionTarget = "OsDisk" | "TemporaryDisk"; + +/** The Customer Managed Key reference to encrypt the Disk. */ +export interface DiskCustomerManagedKey { + /** Fully versioned Key Url pointing to a key in KeyVault. Version segment of the Url is required regardless of rotationToLatestKeyVersionEnabled value. */ + keyUrl?: string; + /** Set this flag to true to enable auto-updating of the Disk Encryption to the latest key version. Default is false. */ + rotationToLatestKeyVersionEnabled?: boolean; + /** The reference of one of the pool identities to encrypt Disk. This identity will be used to access the KeyVault. */ + identityReference?: ComputeNodeIdentityReference; +} + +export function diskCustomerManagedKeySerializer(item: DiskCustomerManagedKey): any { + return { + keyUrl: item["keyUrl"], + rotationToLatestKeyVersionEnabled: item["rotationToLatestKeyVersionEnabled"], + identityReference: !item["identityReference"] + ? item["identityReference"] + : computeNodeIdentityReferenceSerializer(item["identityReference"]), + }; +} + +export function diskCustomerManagedKeyDeserializer(item: any): DiskCustomerManagedKey { + return { + keyUrl: item["keyUrl"], + rotationToLatestKeyVersionEnabled: item["rotationToLatestKeyVersionEnabled"], + identityReference: !item["identityReference"] + ? item["identityReference"] + : computeNodeIdentityReferenceDeserializer(item["identityReference"]), + }; +} + +/** Allocation configuration used by Batch Service to provision the nodes. */ +export interface NodePlacementConfiguration { + /** Allocation policy used by Batch Service to provision the nodes. If not specified, Batch will use the regional policy. */ + policy?: NodePlacementPolicyType; +} + +export function nodePlacementConfigurationSerializer(item: NodePlacementConfiguration): any { + return { policy: item["policy"] }; +} + +export function nodePlacementConfigurationDeserializer(item: any): NodePlacementConfiguration { + return { + policy: item["policy"], + }; +} + +/** The default value is regional. */ +export type NodePlacementPolicyType = "Regional" | "Zonal"; + +export function vmExtensionArraySerializer(result: Array): any[] { + return result.map((item) => { + return vmExtensionSerializer(item); + }); +} + +export function vmExtensionArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return vmExtensionDeserializer(item); + }); +} + +/** The configuration for virtual machine extensions. */ +export interface VMExtension { + /** The name of the virtual machine extension. */ + name: string; + /** The name of the extension handler publisher. */ + publisher: string; + /** The type of the extensions. */ + type: string; + /** The version of script handler. */ + 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?: any; + /** The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. */ + protectedSettings?: any; + /** Collection of extension names after which this extension needs to be provisioned. */ + provisionAfterExtensions?: string[]; +} + +export function vmExtensionSerializer(item: VMExtension): any { + return { + name: item["name"], + publisher: item["publisher"], + type: item["type"], + typeHandlerVersion: item["typeHandlerVersion"], + autoUpgradeMinorVersion: item["autoUpgradeMinorVersion"], + enableAutomaticUpgrade: item["enableAutomaticUpgrade"], + settings: item["settings"], + protectedSettings: item["protectedSettings"], + provisionAfterExtensions: !item["provisionAfterExtensions"] + ? item["provisionAfterExtensions"] + : item["provisionAfterExtensions"].map((p: any) => { + return p; + }), + }; +} + +export function vmExtensionDeserializer(item: any): VMExtension { + return { + name: item["name"], + publisher: item["publisher"], + type: item["type"], + typeHandlerVersion: item["typeHandlerVersion"], + autoUpgradeMinorVersion: item["autoUpgradeMinorVersion"], + enableAutomaticUpgrade: item["enableAutomaticUpgrade"], + settings: item["settings"], + protectedSettings: item["protectedSettings"], + provisionAfterExtensions: !item["provisionAfterExtensions"] + ? item["provisionAfterExtensions"] + : item["provisionAfterExtensions"].map((p: any) => { + return p; + }), + }; +} + +/** Settings for the operating system disk of the virtual machine. */ +export interface OSDisk { + /** Specifies the ephemeral Disk Settings for the operating system disk used by the virtual machine. */ + ephemeralOSDiskSettings?: DiffDiskSettings; + /** The type of caching to enable for the disk. */ + caching?: CachingType; + /** The managed disk parameters. */ + managedDisk?: ManagedDisk; + /** The initial disk size in GB when creating new OS disk. */ + diskSizeGB?: number; + /** Specifies whether writeAccelerator should be enabled or disabled on the disk. */ + writeAcceleratorEnabled?: boolean; +} + +export function osDiskSerializer(item: OSDisk): any { + return { + ephemeralOSDiskSettings: !item["ephemeralOSDiskSettings"] + ? item["ephemeralOSDiskSettings"] + : diffDiskSettingsSerializer(item["ephemeralOSDiskSettings"]), + caching: item["caching"], + managedDisk: !item["managedDisk"] + ? item["managedDisk"] + : managedDiskSerializer(item["managedDisk"]), + diskSizeGB: item["diskSizeGB"], + writeAcceleratorEnabled: item["writeAcceleratorEnabled"], + }; +} + +export function osDiskDeserializer(item: any): OSDisk { + return { + ephemeralOSDiskSettings: !item["ephemeralOSDiskSettings"] + ? item["ephemeralOSDiskSettings"] + : diffDiskSettingsDeserializer(item["ephemeralOSDiskSettings"]), + caching: item["caching"], + managedDisk: !item["managedDisk"] + ? item["managedDisk"] + : managedDiskDeserializer(item["managedDisk"]), + diskSizeGB: item["diskSizeGB"], + writeAcceleratorEnabled: item["writeAcceleratorEnabled"], + }; +} + +/** Specifies the ephemeral Disk Settings for the operating system disk used by the virtual machine. */ +export interface DiffDiskSettings { + /** This property can be used by user in the request to choose which location the operating system should be in. e.g., cache disk space for Ephemeral OS disk provisioning. For more information on Ephemeral OS disk size requirements, please refer to Ephemeral OS disk size requirements for Windows VMs at https://learn.microsoft.com/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements and Linux VMs at https://learn.microsoft.com/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements. */ + placement?: DiffDiskPlacement; +} + +export function diffDiskSettingsSerializer(item: DiffDiskSettings): any { + return { placement: item["placement"] }; +} + +export function diffDiskSettingsDeserializer(item: any): DiffDiskSettings { + return { + placement: item["placement"], + }; +} + +/** The location where the OS disk should be placed. */ +export type DiffDiskPlacement = "CacheDisk"; + +/** Specifies the security profile settings for the virtual machine or virtual machine scale set. */ +export interface SecurityProfile { + /** Specifies the SecurityType of the virtual machine. It has to be set to any specified value to enable UefiSettings. */ + securityType?: SecurityTypes; + /** This property can be used by user in the request to enable or disable the Host Encryption for the virtual machine or virtual machine scale set. This will enable the encryption for all the disks including Resource/Temp disk at host itself. */ + encryptionAtHost?: boolean; + /** Specifies the security settings like secure boot and vTPM used while creating the virtual machine. */ + uefiSettings?: UefiSettings; + /** Specifies ProxyAgent settings while creating the virtual machine. */ + proxyAgentSettings?: ProxyAgentSettings; +} + +export function securityProfileSerializer(item: SecurityProfile): any { + return { + securityType: item["securityType"], + encryptionAtHost: item["encryptionAtHost"], + uefiSettings: !item["uefiSettings"] + ? item["uefiSettings"] + : uefiSettingsSerializer(item["uefiSettings"]), + proxyAgentSettings: !item["proxyAgentSettings"] + ? item["proxyAgentSettings"] + : proxyAgentSettingsSerializer(item["proxyAgentSettings"]), + }; +} + +export function securityProfileDeserializer(item: any): SecurityProfile { + return { + securityType: item["securityType"], + encryptionAtHost: item["encryptionAtHost"], + uefiSettings: !item["uefiSettings"] + ? item["uefiSettings"] + : uefiSettingsDeserializer(item["uefiSettings"]), + proxyAgentSettings: !item["proxyAgentSettings"] + ? item["proxyAgentSettings"] + : proxyAgentSettingsDeserializer(item["proxyAgentSettings"]), + }; +} + +/** Specifies the SecurityType of the virtual machine. It has to be set to any specified value to enable UefiSettings. */ +export type SecurityTypes = "trustedLaunch" | "confidentialVM"; + +/** Specifies the security settings like secure boot and vTPM used while creating the virtual machine. */ +export interface UefiSettings { + /** Specifies whether secure boot should be enabled on the virtual machine. */ + secureBootEnabled?: boolean; + /** Specifies whether vTPM should be enabled on the virtual machine. */ + vTpmEnabled?: boolean; +} + +export function uefiSettingsSerializer(item: UefiSettings): any { + return { secureBootEnabled: item["secureBootEnabled"], vTpmEnabled: item["vTpmEnabled"] }; +} + +export function uefiSettingsDeserializer(item: any): UefiSettings { + return { + secureBootEnabled: item["secureBootEnabled"], + vTpmEnabled: item["vTpmEnabled"], + }; +} + +/** Specifies ProxyAgent settings while creating the virtual machine. */ +export interface ProxyAgentSettings { + /** Specifies whether Metadata Security Protocol feature should be enabled on the virtual machine or virtual machine scale set. Default is False. */ + enabled?: boolean; + /** Settings for the IMDS endpoint. */ + imds?: HostEndpointSettings; + /** Settings for the WireServer endpoint. */ + wireServer?: HostEndpointSettings; +} + +export function proxyAgentSettingsSerializer(item: ProxyAgentSettings): any { + return { + enabled: item["enabled"], + imds: !item["imds"] ? item["imds"] : hostEndpointSettingsSerializer(item["imds"]), + wireServer: !item["wireServer"] + ? item["wireServer"] + : hostEndpointSettingsSerializer(item["wireServer"]), + }; +} + +export function proxyAgentSettingsDeserializer(item: any): ProxyAgentSettings { + return { + enabled: item["enabled"], + imds: !item["imds"] ? item["imds"] : hostEndpointSettingsDeserializer(item["imds"]), + wireServer: !item["wireServer"] + ? item["wireServer"] + : hostEndpointSettingsDeserializer(item["wireServer"]), + }; +} + +/** Specifies particular host endpoint settings. */ +export interface HostEndpointSettings { + /** Specifies the access control policy execution mode. */ + mode?: HostEndpointSettingsModeTypes; + /** Specifies the reference to the InVMAccessControlProfileVersion resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{profile}/versions/{version}. */ + inVMAccessControlProfileReferenceId?: string; +} + +export function hostEndpointSettingsSerializer(item: HostEndpointSettings): any { + return { + mode: item["mode"], + inVMAccessControlProfileReferenceId: item["inVMAccessControlProfileReferenceId"], + }; +} + +export function hostEndpointSettingsDeserializer(item: any): HostEndpointSettings { + return { + mode: item["mode"], + inVMAccessControlProfileReferenceId: item["inVMAccessControlProfileReferenceId"], + }; +} + +/** Specifies the access control policy execution mode. */ +export enum KnownHostEndpointSettingsModeTypes { + /** In Audit mode, the system acts as if it is enforcing the access control policy, including emitting access denial entries in the logs but it does not actually deny any requests to host endpoints. */ + Audit = "Audit", + /** Enforce mode is the recommended mode of operation and system will enforce the access control policy. This property cannot be used together with 'inVMAccessControlProfileReferenceId'. */ + Enforce = "Enforce", +} + +/** + * Specifies the access control policy execution mode. \ + * {@link KnownHostEndpointSettingsModeTypes} can be used interchangeably with HostEndpointSettingsModeTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Audit**: In Audit mode, the system acts as if it is enforcing the access control policy, including emitting access denial entries in the logs but it does not actually deny any requests to host endpoints. \ + * **Enforce**: Enforce mode is the recommended mode of operation and system will enforce the access control policy. This property cannot be used together with 'inVMAccessControlProfileReferenceId'. + */ +export type HostEndpointSettingsModeTypes = string; + +/** Specifies the service artifact reference id used to set same image version for all virtual machines in the scale set when using 'latest' image version. */ +export interface ServiceArtifactReference { + /** The service artifact reference id in the form of /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactName}/vmArtifactsProfiles/{vmArtifactsProfilesName} */ + id: string; +} + +export function serviceArtifactReferenceSerializer(item: ServiceArtifactReference): any { + return { id: item["id"] }; +} + +export function serviceArtifactReferenceDeserializer(item: any): ServiceArtifactReference { + return { + id: item["id"], + }; +} + +/** Defines the desired size of the pool. This can either be 'fixedScale' where the requested targetDedicatedNodes is specified, or 'autoScale' which defines a formula which is periodically reevaluated. If this property is not specified, the pool will have a fixed scale with 0 targetDedicatedNodes. */ +export interface ScaleSettings { + /** This property and autoScale are mutually exclusive and one of the properties must be specified. */ + fixedScale?: FixedScaleSettings; + /** This property and fixedScale are mutually exclusive and one of the properties must be specified. */ + autoScale?: AutoScaleSettings; +} + +export function scaleSettingsSerializer(item: ScaleSettings): any { + return { + fixedScale: !item["fixedScale"] + ? item["fixedScale"] + : fixedScaleSettingsSerializer(item["fixedScale"]), + autoScale: !item["autoScale"] + ? item["autoScale"] + : autoScaleSettingsSerializer(item["autoScale"]), + }; +} + +export function scaleSettingsDeserializer(item: any): ScaleSettings { + return { + fixedScale: !item["fixedScale"] + ? item["fixedScale"] + : fixedScaleSettingsDeserializer(item["fixedScale"]), + autoScale: !item["autoScale"] + ? item["autoScale"] + : autoScaleSettingsDeserializer(item["autoScale"]), + }; +} + +/** Fixed scale settings for the pool. */ +export interface FixedScaleSettings { + /** The default value is 15 minutes. Timeout values use ISO 8601 format. For example, use PT10M for 10 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service rejects the request with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). */ + resizeTimeout?: string; + /** At least one of targetDedicatedNodes, targetLowPriorityNodes must be set. */ + targetDedicatedNodes?: number; + /** At least one of targetDedicatedNodes, targetLowPriorityNodes must be set. */ + targetLowPriorityNodes?: number; + /** If omitted, the default value is Requeue. */ + nodeDeallocationOption?: ComputeNodeDeallocationOption; +} + +export function fixedScaleSettingsSerializer(item: FixedScaleSettings): any { + return { + resizeTimeout: item["resizeTimeout"], + targetDedicatedNodes: item["targetDedicatedNodes"], + targetLowPriorityNodes: item["targetLowPriorityNodes"], + nodeDeallocationOption: item["nodeDeallocationOption"], + }; +} + +export function fixedScaleSettingsDeserializer(item: any): FixedScaleSettings { + return { + resizeTimeout: item["resizeTimeout"], + targetDedicatedNodes: item["targetDedicatedNodes"], + targetLowPriorityNodes: item["targetLowPriorityNodes"], + nodeDeallocationOption: item["nodeDeallocationOption"], + }; +} + +/** Determines what to do with a node and its running task(s) after it has been selected for deallocation. */ +export type ComputeNodeDeallocationOption = + | "Requeue" + | "Terminate" + | "TaskCompletion" + | "RetainedData"; + +/** AutoScale settings for the pool. */ +export interface AutoScaleSettings { + /** A formula for the desired number of compute nodes in the pool. */ + formula: string; + /** If omitted, the default value is 15 minutes (PT15M). */ + evaluationInterval?: string; +} + +export function autoScaleSettingsSerializer(item: AutoScaleSettings): any { + return { formula: item["formula"], evaluationInterval: item["evaluationInterval"] }; +} + +export function autoScaleSettingsDeserializer(item: any): AutoScaleSettings { + return { + formula: item["formula"], + evaluationInterval: item["evaluationInterval"], + }; +} + +/** The results and errors from an execution of a pool autoscale formula. */ +export interface AutoScaleRun { + /** The time at which the autoscale formula was last evaluated. */ + evaluationTime: Date; + /** Each variable value is returned in the form $variable=value, and variables are separated by semicolons. */ + results?: string; + /** An error that occurred when autoscaling a pool. */ + error?: AutoScaleRunError; +} + +export function autoScaleRunDeserializer(item: any): AutoScaleRun { + return { + evaluationTime: new Date(item["evaluationTime"]), + results: item["results"], + error: !item["error"] ? item["error"] : autoScaleRunErrorDeserializer(item["error"]), + }; +} + +/** An error that occurred when autoscaling a pool. */ +export interface AutoScaleRunError { + /** An identifier for the error. Codes are invariant and are intended to be consumed programmatically. */ + code: string; + /** A message describing the error, intended to be suitable for display in a user interface. */ + message: string; + /** Additional details about the error. */ + details?: AutoScaleRunError[]; +} + +export function autoScaleRunErrorDeserializer(item: any): AutoScaleRunError { + return { + code: item["code"], + message: item["message"], + details: !item["details"] + ? item["details"] + : autoScaleRunErrorArrayDeserializer(item["details"]), + }; +} + +export function autoScaleRunErrorArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return autoScaleRunErrorDeserializer(item); + }); +} + +/** This imposes restrictions on which nodes can be assigned to the pool. Enabling this value can reduce the chance of the requested number of nodes to be allocated in the pool. If not specified, this value defaults to 'Disabled'. */ +export type InterNodeCommunicationState = "Enabled" | "Disabled"; + +/** The network configuration for a pool. */ +export interface NetworkConfiguration { + /** The virtual network must be in the same region and subscription as the Azure Batch account. The specified subnet should have enough free IP addresses to accommodate the number of nodes in the pool. If the subnet doesn't have enough free IP addresses, the pool will partially allocate compute nodes and a resize error will occur. The 'MicrosoftAzureBatch' service principal must have the 'Classic Virtual Machine Contributor' Role-Based Access Control (RBAC) role for the specified VNet. The specified subnet must allow communication from the Azure Batch service to be able to schedule tasks on the compute nodes. This can be verified by checking if the specified VNet has any associated Network Security Groups (NSG). If communication to the compute nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the compute nodes to unusable. If the specified VNet has any associated Network Security Groups (NSG), then a few reserved system ports must be enabled for inbound communication,including ports 29876 and 29877. Also enable outbound connections to Azure Storage on port 443. For more details see: https://learn.microsoft.com/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration */ + subnetId?: string; + /** The scope of dynamic vnet assignment. */ + dynamicVnetAssignmentScope?: DynamicVNetAssignmentScope; + /** The endpoint configuration for a pool. */ + endpointConfiguration?: PoolEndpointConfiguration; + /** The public IP Address configuration of the networking configuration of a Pool. */ + 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; +} + +export function networkConfigurationSerializer(item: NetworkConfiguration): any { + return { + subnetId: item["subnetId"], + dynamicVnetAssignmentScope: item["dynamicVnetAssignmentScope"], + endpointConfiguration: !item["endpointConfiguration"] + ? item["endpointConfiguration"] + : poolEndpointConfigurationSerializer(item["endpointConfiguration"]), + publicIPAddressConfiguration: !item["publicIPAddressConfiguration"] + ? item["publicIPAddressConfiguration"] + : publicIPAddressConfigurationSerializer(item["publicIPAddressConfiguration"]), + enableAcceleratedNetworking: item["enableAcceleratedNetworking"], + }; +} + +export function networkConfigurationDeserializer(item: any): NetworkConfiguration { + return { + subnetId: item["subnetId"], + dynamicVnetAssignmentScope: item["dynamicVnetAssignmentScope"], + endpointConfiguration: !item["endpointConfiguration"] + ? item["endpointConfiguration"] + : poolEndpointConfigurationDeserializer(item["endpointConfiguration"]), + publicIPAddressConfiguration: !item["publicIPAddressConfiguration"] + ? item["publicIPAddressConfiguration"] + : publicIPAddressConfigurationDeserializer(item["publicIPAddressConfiguration"]), + enableAcceleratedNetworking: item["enableAcceleratedNetworking"], + }; +} + +/** The scope of dynamic vnet assignment. */ +export type DynamicVNetAssignmentScope = "none" | "job"; + +/** The endpoint configuration for a pool. */ +export interface PoolEndpointConfiguration { + /** The maximum number of inbound NAT pools per Batch pool is 5. If the maximum number of inbound NAT pools is exceeded the request fails with HTTP status code 400. This cannot be specified if the IPAddressProvisioningType is NoPublicIPAddresses. */ + inboundNatPools: InboundNatPool[]; +} + +export function poolEndpointConfigurationSerializer(item: PoolEndpointConfiguration): any { + return { inboundNatPools: inboundNatPoolArraySerializer(item["inboundNatPools"]) }; +} + +export function poolEndpointConfigurationDeserializer(item: any): PoolEndpointConfiguration { + return { + inboundNatPools: inboundNatPoolArrayDeserializer(item["inboundNatPools"]), + }; +} + +export function inboundNatPoolArraySerializer(result: Array): any[] { + return result.map((item) => { + return inboundNatPoolSerializer(item); + }); +} + +export function inboundNatPoolArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return inboundNatPoolDeserializer(item); + }); +} + +/** A inbound NAT pool that can be used to address specific ports on compute nodes in a Batch pool externally. */ +export interface InboundNatPool { + /** The name must be unique within a Batch pool, can contain letters, numbers, underscores, periods, and hyphens. Names must start with a letter or number, must end with a letter, number, or underscore, and cannot exceed 77 characters. If any invalid values are provided the request fails with HTTP status code 400. */ + name: string; + /** The protocol of the endpoint. */ + protocol: InboundEndpointProtocol; + /** This must be unique within a Batch pool. Acceptable values are between 1 and 65535 except for 29876 and 29877 as these are reserved. If any reserved values are provided the request fails with HTTP status code 400. */ + backendPort: number; + /** Acceptable values range between 1 and 65534 except ports from 50000 to 55000 which are reserved. All ranges within a pool must be distinct and cannot overlap. If any reserved or overlapping values are provided the request fails with HTTP status code 400. */ + frontendPortRangeStart: number; + /** Acceptable values range between 1 and 65534 except ports from 50000 to 55000 which are reserved by the Batch service. All ranges within a pool must be distinct and cannot overlap. If any reserved or overlapping values are provided the request fails with HTTP status code 400. */ + frontendPortRangeEnd: number; + /** The maximum number of rules that can be specified across all the endpoints on a Batch pool is 25. If no network security group rules are specified, a default rule will be created to allow inbound access to the specified backendPort. If the maximum number of network security group rules is exceeded the request fails with HTTP status code 400. */ + networkSecurityGroupRules?: NetworkSecurityGroupRule[]; +} + +export function inboundNatPoolSerializer(item: InboundNatPool): any { + return { + name: item["name"], + protocol: item["protocol"], + backendPort: item["backendPort"], + frontendPortRangeStart: item["frontendPortRangeStart"], + frontendPortRangeEnd: item["frontendPortRangeEnd"], + networkSecurityGroupRules: !item["networkSecurityGroupRules"] + ? item["networkSecurityGroupRules"] + : networkSecurityGroupRuleArraySerializer(item["networkSecurityGroupRules"]), + }; +} + +export function inboundNatPoolDeserializer(item: any): InboundNatPool { + return { + name: item["name"], + protocol: item["protocol"], + backendPort: item["backendPort"], + frontendPortRangeStart: item["frontendPortRangeStart"], + frontendPortRangeEnd: item["frontendPortRangeEnd"], + networkSecurityGroupRules: !item["networkSecurityGroupRules"] + ? item["networkSecurityGroupRules"] + : networkSecurityGroupRuleArrayDeserializer(item["networkSecurityGroupRules"]), + }; +} + +/** The protocol of the endpoint. */ +export type InboundEndpointProtocol = "TCP" | "UDP"; + +export function networkSecurityGroupRuleArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return networkSecurityGroupRuleSerializer(item); + }); +} + +export function networkSecurityGroupRuleArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return networkSecurityGroupRuleDeserializer(item); + }); +} + +/** A network security group rule to apply to an inbound endpoint. */ +export interface NetworkSecurityGroupRule { + /** Priorities within a pool must be unique and are evaluated in order of priority. The lower the number the higher the priority. For example, rules could be specified with order numbers of 150, 250, and 350. The rule with the order number of 150 takes precedence over the rule that has an order of 250. Allowed priorities are 150 to 4096. If any reserved or duplicate values are provided the request fails with HTTP status code 400. */ + priority: number; + /** The action that should be taken for a specified IP address, subnet range or tag. */ + access: NetworkSecurityGroupRuleAccess; + /** Valid values are a single IP address (i.e. 10.10.10.10), IP subnet (i.e. 192.168.1.0/24), default tag, or * (for all addresses). If any other values are provided the request fails with HTTP status code 400. */ + sourceAddressPrefix: string; + /** Valid values are '*' (for all ports 0 - 65535) or arrays of ports or port ranges (i.e. 100-200). The ports should in the range of 0 to 65535 and the port ranges or ports can't overlap. If any other values are provided the request fails with HTTP status code 400. Default value will be *. */ + sourcePortRanges?: string[]; +} + +export function networkSecurityGroupRuleSerializer(item: NetworkSecurityGroupRule): any { + return { + priority: item["priority"], + access: item["access"], + sourceAddressPrefix: item["sourceAddressPrefix"], + sourcePortRanges: !item["sourcePortRanges"] + ? item["sourcePortRanges"] + : item["sourcePortRanges"].map((p: any) => { + return p; + }), + }; +} + +export function networkSecurityGroupRuleDeserializer(item: any): NetworkSecurityGroupRule { + return { + priority: item["priority"], + access: item["access"], + sourceAddressPrefix: item["sourceAddressPrefix"], + sourcePortRanges: !item["sourcePortRanges"] + ? item["sourcePortRanges"] + : item["sourcePortRanges"].map((p: any) => { + return p; + }), + }; +} + +/** The action that should be taken for a specified IP address, subnet range or tag. */ +export type NetworkSecurityGroupRuleAccess = "Allow" | "Deny"; + +/** The public IP Address configuration of the networking configuration of a Pool. */ +export interface PublicIPAddressConfiguration { + /** The default value is BatchManaged */ + provision?: IPAddressProvisioningType; + /** The number of IPs specified here limits the maximum size of the Pool - 100 dedicated nodes or 100 Spot/low-priority nodes can be allocated for each public IP. For example, a pool needing 250 dedicated VMs would need at least 3 public IPs specified. Each element of this collection is of the form: /subscriptions/{subscription}/resourceGroups/{group}/providers/Microsoft.Network/publicIPAddresses/{ip}. */ + ipAddressIds?: string[]; + /** IP families are used to determine single-stack or dual-stack pools. For single-stack, the expected value is IPv4. For dual-stack, the expected values are IPv4 and IPv6. */ + ipFamilies?: IPFamily[]; + /** IP Tags that will applied to new Public IPs that Batch creates. */ + ipTags?: IPTag[]; +} + +export function publicIPAddressConfigurationSerializer(item: PublicIPAddressConfiguration): any { + return { + provision: item["provision"], + ipAddressIds: !item["ipAddressIds"] + ? item["ipAddressIds"] + : item["ipAddressIds"].map((p: any) => { + return p; + }), + ipFamilies: !item["ipFamilies"] + ? item["ipFamilies"] + : item["ipFamilies"].map((p: any) => { + return p; + }), + ipTags: !item["ipTags"] ? item["ipTags"] : ipTagArraySerializer(item["ipTags"]), + }; +} + +export function publicIPAddressConfigurationDeserializer(item: any): PublicIPAddressConfiguration { + return { + provision: item["provision"], + ipAddressIds: !item["ipAddressIds"] + ? item["ipAddressIds"] + : item["ipAddressIds"].map((p: any) => { + return p; + }), + ipFamilies: !item["ipFamilies"] + ? item["ipFamilies"] + : item["ipFamilies"].map((p: any) => { + return p; + }), + ipTags: !item["ipTags"] ? item["ipTags"] : ipTagArrayDeserializer(item["ipTags"]), + }; +} + +/** The provisioning type for Public IP Addresses for the Batch Pool. */ +export type IPAddressProvisioningType = "BatchManaged" | "UserManaged" | "NoPublicIPAddresses"; + +/** The IP families used to specify IP versions available to the pool. */ +export enum KnownIPFamily { + /** IPv4 is available to the pool. */ + IPv4 = "IPv4", + /** IPv6 is available to the pool. */ + IPv6 = "IPv6", +} + +/** + * The IP families used to specify IP versions available to the pool. \ + * {@link KnownIPFamily} can be used interchangeably with IPFamily, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **IPv4**: IPv4 is available to the pool. \ + * **IPv6**: IPv6 is available to the pool. + */ +export type IPFamily = string; + +export function ipTagArraySerializer(result: Array): any[] { + return result.map((item) => { + return ipTagSerializer(item); + }); +} + +export function ipTagArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return ipTagDeserializer(item); + }); +} + +/** Specifies how tasks should be distributed across compute nodes. */ +export interface IPTag { + /** Example: FirstPartyUsage. */ + ipTagType?: string; + /** Example: SQL. */ + tag?: string; +} + +export function ipTagSerializer(item: IPTag): any { + return { ipTagType: item["ipTagType"], tag: item["tag"] }; +} + +export function ipTagDeserializer(item: any): IPTag { + return { + ipTagType: item["ipTagType"], + tag: item["tag"], + }; +} + +/** Specifies how tasks should be distributed across compute nodes. */ +export interface TaskSchedulingPolicy { + /** The order for scheduling tasks from different jobs with the same priority. */ + jobDefaultOrder?: JobDefaultOrder; + /** How tasks should be distributed across compute nodes. */ + nodeFillType: ComputeNodeFillType; +} + +export function taskSchedulingPolicySerializer(item: TaskSchedulingPolicy): any { + return { jobDefaultOrder: item["jobDefaultOrder"], nodeFillType: item["nodeFillType"] }; +} + +export function taskSchedulingPolicyDeserializer(item: any): TaskSchedulingPolicy { + return { + jobDefaultOrder: item["jobDefaultOrder"], + nodeFillType: item["nodeFillType"], + }; +} + +/** The order for scheduling tasks from different jobs with the same priority. */ +export enum KnownJobDefaultOrder { + /** Tasks should be scheduled uniformly from all equal-priority jobs for the pool. */ + None = "None", + /** If jobs have equal priority, tasks from jobs that were created earlier should be scheduled first. */ + CreationTime = "CreationTime", +} + +/** + * The order for scheduling tasks from different jobs with the same priority. \ + * {@link KnownJobDefaultOrder} can be used interchangeably with JobDefaultOrder, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None**: Tasks should be scheduled uniformly from all equal-priority jobs for the pool. \ + * **CreationTime**: If jobs have equal priority, tasks from jobs that were created earlier should be scheduled first. + */ +export type JobDefaultOrder = string; +/** How tasks should be distributed across compute nodes. */ +export type ComputeNodeFillType = "Spread" | "Pack"; + +export function userAccountArraySerializer(result: Array): any[] { + return result.map((item) => { + return userAccountSerializer(item); + }); +} + +export function userAccountArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return userAccountDeserializer(item); + }); +} + +/** Properties used to create a user on an Azure Batch node. */ +export interface UserAccount { + /** The name of the user account. Names can contain any Unicode characters up to a maximum length of 20. */ + name: string; + /** The password for the user account. */ + password: string; + /** nonAdmin - The auto user is a standard user without elevated access. admin - The auto user is a user with elevated access and operates with full Administrator permissions. The default value is nonAdmin. */ + elevationLevel?: ElevationLevel; + /** This property is ignored if specified on a Windows pool. If not specified, the user is created with the default options. */ + linuxUserConfiguration?: LinuxUserConfiguration; + /** This property can only be specified if the user is on a Windows pool. If not specified and on a Windows pool, the user is created with the default options. */ + windowsUserConfiguration?: WindowsUserConfiguration; +} + +export function userAccountSerializer(item: UserAccount): any { + return { + name: item["name"], + password: item["password"], + elevationLevel: item["elevationLevel"], + linuxUserConfiguration: !item["linuxUserConfiguration"] + ? item["linuxUserConfiguration"] + : linuxUserConfigurationSerializer(item["linuxUserConfiguration"]), + windowsUserConfiguration: !item["windowsUserConfiguration"] + ? item["windowsUserConfiguration"] + : windowsUserConfigurationSerializer(item["windowsUserConfiguration"]), + }; +} + +export function userAccountDeserializer(item: any): UserAccount { + return { + name: item["name"], + password: item["password"], + elevationLevel: item["elevationLevel"], + linuxUserConfiguration: !item["linuxUserConfiguration"] + ? item["linuxUserConfiguration"] + : linuxUserConfigurationDeserializer(item["linuxUserConfiguration"]), + windowsUserConfiguration: !item["windowsUserConfiguration"] + ? item["windowsUserConfiguration"] + : windowsUserConfigurationDeserializer(item["windowsUserConfiguration"]), + }; +} + +/** The elevation level of the user. */ +export type ElevationLevel = "NonAdmin" | "Admin"; + +/** Properties used to create a user account on a Linux node. */ +export interface LinuxUserConfiguration { + /** The uid and gid properties must be specified together or not at all. If not specified the underlying operating system picks the uid. */ + uid?: number; + /** The uid and gid properties must be specified together or not at all. If not specified the underlying operating system picks the gid. */ + gid?: number; + /** The private key must not be password protected. The private key is used to automatically configure asymmetric-key based authentication for SSH between nodes in a Linux pool when the pool's enableInterNodeCommunication property is true (it is ignored if enableInterNodeCommunication is false). It does this by placing the key pair into the user's .ssh directory. If not specified, password-less SSH is not configured between nodes (no modification of the user's .ssh directory is done). */ + sshPrivateKey?: string; +} + +export function linuxUserConfigurationSerializer(item: LinuxUserConfiguration): any { + return { uid: item["uid"], gid: item["gid"], sshPrivateKey: item["sshPrivateKey"] }; +} + +export function linuxUserConfigurationDeserializer(item: any): LinuxUserConfiguration { + return { + uid: item["uid"], + gid: item["gid"], + sshPrivateKey: item["sshPrivateKey"], + }; +} + +/** Properties used to create a user account on a Windows node. */ +export interface WindowsUserConfiguration { + /** Specifies login mode for the user. The default value is Interactive. */ + loginMode?: LoginMode; +} + +export function windowsUserConfigurationSerializer(item: WindowsUserConfiguration): any { + return { loginMode: item["loginMode"] }; +} + +export function windowsUserConfigurationDeserializer(item: any): WindowsUserConfiguration { + return { + loginMode: item["loginMode"], + }; +} + +/** Specifies login mode for the user. The default value is Interactive. */ +export type LoginMode = "Batch" | "Interactive"; + +export function metadataItemArraySerializer(result: Array): any[] { + return result.map((item) => { + return metadataItemSerializer(item); + }); +} + +export function metadataItemArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return metadataItemDeserializer(item); + }); +} + +/** The Batch service does not assign any meaning to this metadata; it is solely for the use of user code. */ +export interface MetadataItem { + /** The name of the metadata item. */ + name: string; + /** The value of the metadata item. */ + value: string; +} + +export function metadataItemSerializer(item: MetadataItem): any { + return { name: item["name"], value: item["value"] }; +} + +export function metadataItemDeserializer(item: any): MetadataItem { + return { + name: item["name"], + value: item["value"], + }; +} + +/** In some cases the start task may be re-run even though the node was not rebooted. Due to this, start tasks should be idempotent and exit gracefully if the setup they're performing has already been done. Special care should be taken to avoid start tasks which create breakaway process or install/launch services from the start task working directory, as this will block Batch from being able to re-run the start task. */ +export interface StartTask { + /** The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux. Required if any other properties of the startTask are specified. */ + commandLine?: string; + /** A list of files that the Batch service will download to the compute node before running the command line. */ + resourceFiles?: ResourceFile[]; + /** A list of environment variable settings for the start task. */ + environmentSettings?: EnvironmentSetting[]; + /** If omitted, the task runs as a non-administrative user unique to the task. */ + userIdentity?: UserIdentity; + /** The Batch service retries a task if its exit code is nonzero. Note that this value specifically controls the number of retries. The Batch service will try the task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries the task up to 4 times (one initial try and 3 retries). If the maximum retry count is 0, the Batch service does not retry the task. If the maximum retry count is -1, the Batch service retries the task without limit. Default is 0 */ + maxTaskRetryCount?: number; + /** If true and the start task fails on a compute node, the Batch service retries the start task up to its maximum retry count (maxTaskRetryCount). If the task has still not completed successfully after all retries, then the Batch service marks the compute node unusable, and will not schedule tasks to it. This condition can be detected via the node state and scheduling error detail. If false, the Batch service will not wait for the start task to complete. In this case, other tasks can start executing on the compute node while the start task is still running; and even if the start task fails, new tasks will continue to be scheduled on the node. The default is true. */ + waitForSuccess?: boolean; + /** When this is specified, all directories recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch directories on the node) are mapped into the container, all task environment variables are mapped into the container, and the task command line is executed in the container. */ + containerSettings?: TaskContainerSettings; +} + +export function startTaskSerializer(item: StartTask): any { + return { + commandLine: item["commandLine"], + resourceFiles: !item["resourceFiles"] + ? item["resourceFiles"] + : resourceFileArraySerializer(item["resourceFiles"]), + environmentSettings: !item["environmentSettings"] + ? item["environmentSettings"] + : environmentSettingArraySerializer(item["environmentSettings"]), + userIdentity: !item["userIdentity"] + ? item["userIdentity"] + : userIdentitySerializer(item["userIdentity"]), + maxTaskRetryCount: item["maxTaskRetryCount"], + waitForSuccess: item["waitForSuccess"], + containerSettings: !item["containerSettings"] + ? item["containerSettings"] + : taskContainerSettingsSerializer(item["containerSettings"]), + }; +} + +export function startTaskDeserializer(item: any): StartTask { + return { + commandLine: item["commandLine"], + resourceFiles: !item["resourceFiles"] + ? item["resourceFiles"] + : resourceFileArrayDeserializer(item["resourceFiles"]), + environmentSettings: !item["environmentSettings"] + ? item["environmentSettings"] + : environmentSettingArrayDeserializer(item["environmentSettings"]), + userIdentity: !item["userIdentity"] + ? item["userIdentity"] + : userIdentityDeserializer(item["userIdentity"]), + maxTaskRetryCount: item["maxTaskRetryCount"], + waitForSuccess: item["waitForSuccess"], + containerSettings: !item["containerSettings"] + ? item["containerSettings"] + : taskContainerSettingsDeserializer(item["containerSettings"]), + }; +} + +export function resourceFileArraySerializer(result: Array): any[] { + return result.map((item) => { + return resourceFileSerializer(item); + }); +} + +export function resourceFileArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return resourceFileDeserializer(item); + }); +} + +/** A single file or multiple files to be downloaded to a compute node. */ +export interface ResourceFile { + /** The autoStorageContainerName, storageContainerUrl and httpUrl properties are mutually exclusive and one of them must be specified. */ + autoStorageContainerName?: string; + /** The autoStorageContainerName, storageContainerUrl and httpUrl properties are mutually exclusive and one of them must be specified. This URL must be readable and listable from compute nodes. There are three ways to get such a URL for a container in Azure storage: include a Shared Access Signature (SAS) granting read and list permissions on the container, use a managed identity with read and list permissions, or set the ACL for the container to allow public access. */ + storageContainerUrl?: string; + /** The autoStorageContainerName, storageContainerUrl and httpUrl properties are mutually exclusive and one of them must be specified. If the URL points to Azure Blob Storage, it must be readable from compute nodes. There are three ways to get such a URL for a blob in Azure storage: include a Shared Access Signature (SAS) granting read permissions on the blob, use a managed identity with read permission, or set the ACL for the blob or its container to allow public access. */ + httpUrl?: string; + /** The property is valid only when autoStorageContainerName or storageContainerUrl is used. This prefix can be a partial filename or a subdirectory. If a prefix is not specified, all the files in the container will be downloaded. */ + blobPrefix?: string; + /** If the httpUrl property is specified, the filePath is required and describes the path which the file will be downloaded to, including the filename. Otherwise, if the autoStorageContainerName or storageContainerUrl property is specified, filePath is optional and is the directory to download the files to. In the case where filePath is used as a directory, any directory structure already associated with the input data will be retained in full and appended to the specified filePath directory. The specified relative path cannot break out of the task's working directory (for example by using '..'). */ + filePath?: string; + /** This property applies only to files being downloaded to Linux compute nodes. It will be ignored if it is specified for a resourceFile which will be downloaded to a Windows node. If this property is not specified for a Linux node, then a default value of 0770 is applied to the file. */ + fileMode?: string; + /** The reference to a user assigned identity associated with the Batch pool which a compute node will use. */ + identityReference?: ComputeNodeIdentityReference; +} + +export function resourceFileSerializer(item: ResourceFile): any { + return { + autoStorageContainerName: item["autoStorageContainerName"], + storageContainerUrl: item["storageContainerUrl"], + httpUrl: item["httpUrl"], + blobPrefix: item["blobPrefix"], + filePath: item["filePath"], + fileMode: item["fileMode"], + identityReference: !item["identityReference"] + ? item["identityReference"] + : computeNodeIdentityReferenceSerializer(item["identityReference"]), + }; +} + +export function resourceFileDeserializer(item: any): ResourceFile { + return { + autoStorageContainerName: item["autoStorageContainerName"], + storageContainerUrl: item["storageContainerUrl"], + httpUrl: item["httpUrl"], + blobPrefix: item["blobPrefix"], + filePath: item["filePath"], + fileMode: item["fileMode"], + identityReference: !item["identityReference"] + ? item["identityReference"] + : computeNodeIdentityReferenceDeserializer(item["identityReference"]), + }; +} + +export function environmentSettingArraySerializer(result: Array): any[] { + return result.map((item) => { + return environmentSettingSerializer(item); + }); +} + +export function environmentSettingArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return environmentSettingDeserializer(item); + }); +} + +/** An environment variable to be set on a task process. */ +export interface EnvironmentSetting { + /** The name of the environment variable. */ + name: string; + /** The value of the environment variable. */ + value?: string; +} + +export function environmentSettingSerializer(item: EnvironmentSetting): any { + return { name: item["name"], value: item["value"] }; +} + +export function environmentSettingDeserializer(item: any): EnvironmentSetting { + return { + name: item["name"], + value: item["value"], + }; +} + +/** Specify either the userName or autoUser property, but not both. */ +export interface UserIdentity { + /** The userName and autoUser properties are mutually exclusive; you must specify one but not both. */ + userName?: string; + /** The userName and autoUser properties are mutually exclusive; you must specify one but not both. */ + autoUser?: AutoUserSpecification; +} + +export function userIdentitySerializer(item: UserIdentity): any { + return { + userName: item["userName"], + autoUser: !item["autoUser"] + ? item["autoUser"] + : autoUserSpecificationSerializer(item["autoUser"]), + }; +} + +export function userIdentityDeserializer(item: any): UserIdentity { + return { + userName: item["userName"], + autoUser: !item["autoUser"] + ? item["autoUser"] + : autoUserSpecificationDeserializer(item["autoUser"]), + }; +} + +/** Specifies the parameters for the auto user that runs a task on the Batch service. */ +export interface AutoUserSpecification { + /** The default value is Pool. If the pool is running Windows a value of Task should be specified if stricter isolation between tasks is required. For example, if the task mutates the registry in a way which could impact other tasks, or if certificates have been specified on the pool which should not be accessible by normal tasks but should be accessible by start tasks. */ + scope?: AutoUserScope; + /** The default value is nonAdmin. */ + elevationLevel?: ElevationLevel; +} + +export function autoUserSpecificationSerializer(item: AutoUserSpecification): any { + return { scope: item["scope"], elevationLevel: item["elevationLevel"] }; +} + +export function autoUserSpecificationDeserializer(item: any): AutoUserSpecification { + return { + scope: item["scope"], + elevationLevel: item["elevationLevel"], + }; +} + +/** The default value is Pool. If the pool is running Windows a value of Task should be specified if stricter isolation between tasks is required. For example, if the task mutates the registry in a way which could impact other tasks. */ +export type AutoUserScope = "Task" | "Pool"; + +/** The container settings for a task. */ +export interface TaskContainerSettings { + /** These additional options are supplied as arguments to the "docker create" command, in addition to those controlled by the Batch Service. */ + containerRunOptions?: string; + /** This is the full image reference, as would be specified to "docker pull". If no tag is provided as part of the image name, the tag ":latest" is used as a default. */ + imageName: string; + /** This setting can be omitted if was already provided at pool creation. */ + registry?: ContainerRegistry; + /** A flag to indicate where the container task working directory is. The default is 'taskWorkingDirectory'. */ + workingDirectory?: ContainerWorkingDirectory; + /** If this array is null or be not present, container task will mount entire temporary disk drive in windows (or AZ_BATCH_NODE_ROOT_DIR in Linux). It won't' mount any data paths into container if this array is set as empty. */ + containerHostBatchBindMounts?: ContainerHostBatchBindMountEntry[]; +} + +export function taskContainerSettingsSerializer(item: TaskContainerSettings): any { + return { + containerRunOptions: item["containerRunOptions"], + imageName: item["imageName"], + registry: !item["registry"] ? item["registry"] : containerRegistrySerializer(item["registry"]), + workingDirectory: item["workingDirectory"], + containerHostBatchBindMounts: !item["containerHostBatchBindMounts"] + ? item["containerHostBatchBindMounts"] + : containerHostBatchBindMountEntryArraySerializer(item["containerHostBatchBindMounts"]), + }; +} + +export function taskContainerSettingsDeserializer(item: any): TaskContainerSettings { + return { + containerRunOptions: item["containerRunOptions"], + imageName: item["imageName"], + registry: !item["registry"] + ? item["registry"] + : containerRegistryDeserializer(item["registry"]), + workingDirectory: item["workingDirectory"], + containerHostBatchBindMounts: !item["containerHostBatchBindMounts"] + ? item["containerHostBatchBindMounts"] + : containerHostBatchBindMountEntryArrayDeserializer(item["containerHostBatchBindMounts"]), + }; +} + +/** A flag to indicate where the container task working directory is. The default is 'taskWorkingDirectory'. */ +export type ContainerWorkingDirectory = "TaskWorkingDirectory" | "ContainerImageDefault"; + +export function containerHostBatchBindMountEntryArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return containerHostBatchBindMountEntrySerializer(item); + }); +} + +export function containerHostBatchBindMountEntryArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return containerHostBatchBindMountEntryDeserializer(item); + }); +} + +/** The entry of path and mount mode you want to mount into task container. */ +export interface ContainerHostBatchBindMountEntry { + /** The paths which will be mounted to container task's container. */ + source?: ContainerHostDataPath; + /** For Linux, if you mount this path as a read/write mode, this does not mean that all users in container have the read/write access for the path, it depends on the access in host VM. If this path is mounted read-only, all users within the container will not be able to modify the path. */ + isReadOnly?: boolean; +} + +export function containerHostBatchBindMountEntrySerializer( + item: ContainerHostBatchBindMountEntry, +): any { + return { source: item["source"], isReadOnly: item["isReadOnly"] }; +} + +export function containerHostBatchBindMountEntryDeserializer( + item: any, +): ContainerHostBatchBindMountEntry { + return { + source: item["source"], + isReadOnly: item["isReadOnly"], + }; +} + +/** The paths which will be mounted to container task's container. */ +export enum KnownContainerHostDataPath { + /** The path for multi-instances task to shared their files. */ + Shared = "Shared", + /** The path for start task. */ + Startup = "Startup", + /** The path contains all virtual file systems are mounted on this node. */ + VfsMounts = "VfsMounts", + /** The task path. */ + Task = "Task", + /** The job-prep task path. */ + JobPrep = "JobPrep", + /** The applications path. */ + Applications = "Applications", +} + +/** + * The paths which will be mounted to container task's container. \ + * {@link KnownContainerHostDataPath} can be used interchangeably with ContainerHostDataPath, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Shared**: The path for multi-instances task to shared their files. \ + * **Startup**: The path for start task. \ + * **VfsMounts**: The path contains all virtual file systems are mounted on this node. \ + * **Task**: The task path. \ + * **JobPrep**: The job-prep task path. \ + * **Applications**: The applications path. + */ +export type ContainerHostDataPath = string; + +export function applicationPackageReferenceArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return applicationPackageReferenceSerializer(item); + }); +} + +export function applicationPackageReferenceArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return applicationPackageReferenceDeserializer(item); + }); +} + +/** Link to an application package inside the batch account */ +export interface ApplicationPackageReference { + /** The ID of the application package to install. This must be inside the same batch account as the pool. This can either be a reference to a specific version or the default version if one exists. */ + id: string; + /** If this is omitted, and no default version is specified for this application, the request fails with the error code InvalidApplicationPackageReferences. If you are calling the REST API directly, the HTTP status code is 409. */ + version?: string; +} + +export function applicationPackageReferenceSerializer(item: ApplicationPackageReference): any { + return { id: item["id"], version: item["version"] }; +} + +export function applicationPackageReferenceDeserializer(item: any): ApplicationPackageReference { + return { + id: item["id"], + version: item["version"], + }; +} + +/** Describes either the current operation (if the pool AllocationState is Resizing) or the previously completed operation (if the AllocationState is Steady). */ +export interface ResizeOperationStatus { + /** The desired number of dedicated compute nodes in the pool. */ + targetDedicatedNodes?: number; + /** The desired number of Spot/low-priority compute nodes in the pool. */ + targetLowPriorityNodes?: number; + /** The default value is 15 minutes. The minimum value is 5 minutes. If you specify a value less than 5 minutes, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). */ + resizeTimeout?: string; + /** The default value is requeue. */ + nodeDeallocationOption?: ComputeNodeDeallocationOption; + /** The time when this resize operation was started. */ + startTime?: Date; + /** This property is set only if an error occurred during the last pool resize, and only when the pool allocationState is Steady. */ + errors?: ResizeError[]; +} + +export function resizeOperationStatusDeserializer(item: any): ResizeOperationStatus { + return { + targetDedicatedNodes: item["targetDedicatedNodes"], + targetLowPriorityNodes: item["targetLowPriorityNodes"], + resizeTimeout: item["resizeTimeout"], + nodeDeallocationOption: item["nodeDeallocationOption"], + startTime: !item["startTime"] ? item["startTime"] : new Date(item["startTime"]), + errors: !item["errors"] ? item["errors"] : resizeErrorArrayDeserializer(item["errors"]), + }; +} + +export function resizeErrorArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return resizeErrorDeserializer(item); + }); +} + +/** An error that occurred when resizing a pool. */ +export interface ResizeError { + /** An identifier for the error. Codes are invariant and are intended to be consumed programmatically. */ + code: string; + /** A message describing the error, intended to be suitable for display in a user interface. */ + message: string; + /** Additional details about the error. */ + details?: ResizeError[]; +} + +export function resizeErrorDeserializer(item: any): ResizeError { + return { + code: item["code"], + message: item["message"], + details: !item["details"] ? item["details"] : resizeErrorArrayDeserializer(item["details"]), + }; +} + +export function mountConfigurationArraySerializer(result: Array): any[] { + return result.map((item) => { + return mountConfigurationSerializer(item); + }); +} + +export function mountConfigurationArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return mountConfigurationDeserializer(item); + }); +} + +/** The file system to mount on each node. */ +export interface MountConfiguration { + /** This property is mutually exclusive with all other properties. */ + azureBlobFileSystemConfiguration?: AzureBlobFileSystemConfiguration; + /** This property is mutually exclusive with all other properties. */ + nfsMountConfiguration?: NFSMountConfiguration; + /** This property is mutually exclusive with all other properties. */ + cifsMountConfiguration?: CifsMountConfiguration; + /** This property is mutually exclusive with all other properties. */ + azureFileShareConfiguration?: AzureFileShareConfiguration; +} + +export function mountConfigurationSerializer(item: MountConfiguration): any { + return { + azureBlobFileSystemConfiguration: !item["azureBlobFileSystemConfiguration"] + ? item["azureBlobFileSystemConfiguration"] + : azureBlobFileSystemConfigurationSerializer(item["azureBlobFileSystemConfiguration"]), + nfsMountConfiguration: !item["nfsMountConfiguration"] + ? item["nfsMountConfiguration"] + : nfsMountConfigurationSerializer(item["nfsMountConfiguration"]), + cifsMountConfiguration: !item["cifsMountConfiguration"] + ? item["cifsMountConfiguration"] + : cifsMountConfigurationSerializer(item["cifsMountConfiguration"]), + azureFileShareConfiguration: !item["azureFileShareConfiguration"] + ? item["azureFileShareConfiguration"] + : azureFileShareConfigurationSerializer(item["azureFileShareConfiguration"]), + }; +} + +export function mountConfigurationDeserializer(item: any): MountConfiguration { + return { + azureBlobFileSystemConfiguration: !item["azureBlobFileSystemConfiguration"] + ? item["azureBlobFileSystemConfiguration"] + : azureBlobFileSystemConfigurationDeserializer(item["azureBlobFileSystemConfiguration"]), + nfsMountConfiguration: !item["nfsMountConfiguration"] + ? item["nfsMountConfiguration"] + : nfsMountConfigurationDeserializer(item["nfsMountConfiguration"]), + cifsMountConfiguration: !item["cifsMountConfiguration"] + ? item["cifsMountConfiguration"] + : cifsMountConfigurationDeserializer(item["cifsMountConfiguration"]), + azureFileShareConfiguration: !item["azureFileShareConfiguration"] + ? item["azureFileShareConfiguration"] + : azureFileShareConfigurationDeserializer(item["azureFileShareConfiguration"]), + }; +} + +/** Information used to connect to an Azure Storage Container using Blobfuse. */ +export interface AzureBlobFileSystemConfiguration { + /** The Azure Storage Account name. */ + accountName: string; + /** The Azure Blob Storage Container name. */ + containerName: string; + /** This property is mutually exclusive with both sasKey and identity; exactly one must be specified. */ + accountKey?: string; + /** This property is mutually exclusive with both accountKey and identity; exactly one must be specified. */ + sasKey?: string; + /** These are 'net use' options in Windows and 'mount' options in Linux. */ + blobfuseOptions?: string; + /** All file systems are mounted relative to the Batch mounts directory, accessible via the AZ_BATCH_NODE_MOUNTS_DIR environment variable. */ + relativeMountPath: string; + /** This property is mutually exclusive with both accountKey and sasKey; exactly one must be specified. */ + identityReference?: ComputeNodeIdentityReference; +} + +export function azureBlobFileSystemConfigurationSerializer( + item: AzureBlobFileSystemConfiguration, +): any { + return { + accountName: item["accountName"], + containerName: item["containerName"], + accountKey: item["accountKey"], + sasKey: item["sasKey"], + blobfuseOptions: item["blobfuseOptions"], + relativeMountPath: item["relativeMountPath"], + identityReference: !item["identityReference"] + ? item["identityReference"] + : computeNodeIdentityReferenceSerializer(item["identityReference"]), + }; +} + +export function azureBlobFileSystemConfigurationDeserializer( + item: any, +): AzureBlobFileSystemConfiguration { + return { + accountName: item["accountName"], + containerName: item["containerName"], + accountKey: item["accountKey"], + sasKey: item["sasKey"], + blobfuseOptions: item["blobfuseOptions"], + relativeMountPath: item["relativeMountPath"], + identityReference: !item["identityReference"] + ? item["identityReference"] + : computeNodeIdentityReferenceDeserializer(item["identityReference"]), + }; +} + +/** Information used to connect to an NFS file system. */ +export interface NFSMountConfiguration { + /** The URI of the file system to mount. */ + source: string; + /** All file systems are mounted relative to the Batch mounts directory, accessible via the AZ_BATCH_NODE_MOUNTS_DIR environment variable. */ + relativeMountPath: string; + /** These are 'net use' options in Windows and 'mount' options in Linux. */ + mountOptions?: string; +} + +export function nfsMountConfigurationSerializer(item: NFSMountConfiguration): any { + return { + source: item["source"], + relativeMountPath: item["relativeMountPath"], + mountOptions: item["mountOptions"], + }; +} + +export function nfsMountConfigurationDeserializer(item: any): NFSMountConfiguration { + return { + source: item["source"], + relativeMountPath: item["relativeMountPath"], + mountOptions: item["mountOptions"], + }; +} + +/** Information used to connect to a CIFS file system. */ +export interface CifsMountConfiguration { + /** The user to use for authentication against the CIFS file system. */ + userName: string; + /** The URI of the file system to mount. */ + source: string; + /** All file systems are mounted relative to the Batch mounts directory, accessible via the AZ_BATCH_NODE_MOUNTS_DIR environment variable. */ + relativeMountPath: string; + /** These are 'net use' options in Windows and 'mount' options in Linux. */ + mountOptions?: string; + /** The password to use for authentication against the CIFS file system. */ + password: string; +} + +export function cifsMountConfigurationSerializer(item: CifsMountConfiguration): any { + return { + userName: item["userName"], + source: item["source"], + relativeMountPath: item["relativeMountPath"], + mountOptions: item["mountOptions"], + password: item["password"], + }; +} + +export function cifsMountConfigurationDeserializer(item: any): CifsMountConfiguration { + return { + userName: item["userName"], + source: item["source"], + relativeMountPath: item["relativeMountPath"], + mountOptions: item["mountOptions"], + password: item["password"], + }; +} + +/** Information used to connect to an Azure Fileshare. */ +export interface AzureFileShareConfiguration { + /** The Azure Storage account name. */ + accountName: string; + /** This is of the form 'https://{account}.file.core.windows.net/'. */ + azureFileUrl: string; + /** The Azure Storage account key. */ + accountKey: string; + /** All file systems are mounted relative to the Batch mounts directory, accessible via the AZ_BATCH_NODE_MOUNTS_DIR environment variable. */ + relativeMountPath: string; + /** These are 'net use' options in Windows and 'mount' options in Linux. */ + mountOptions?: string; +} + +export function azureFileShareConfigurationSerializer(item: AzureFileShareConfiguration): any { + return { + accountName: item["accountName"], + azureFileUrl: item["azureFileUrl"], + accountKey: item["accountKey"], + relativeMountPath: item["relativeMountPath"], + mountOptions: item["mountOptions"], + }; +} + +export function azureFileShareConfigurationDeserializer(item: any): AzureFileShareConfiguration { + return { + accountName: item["accountName"], + azureFileUrl: item["azureFileUrl"], + accountKey: item["accountKey"], + relativeMountPath: item["relativeMountPath"], + mountOptions: item["mountOptions"], + }; +} + +/** Describes an upgrade policy - automatic, manual, or rolling. */ +export interface UpgradePolicy { + /** Specifies the mode of an upgrade to virtual machines in the scale set.

Possible values are:

**Manual** - You control the application of updates to virtual machines in the scale set. You do this by using the manualUpgrade action.

**Automatic** - All virtual machines in the scale set are automatically updated at the same time.

**Rolling** - Scale set performs updates in batches with an optional pause time in between. */ + mode: UpgradeMode; + /** The configuration parameters used for performing automatic OS upgrade. */ + automaticOSUpgradePolicy?: AutomaticOSUpgradePolicy; + /** The configuration parameters used while performing a rolling upgrade. */ + rollingUpgradePolicy?: RollingUpgradePolicy; +} + +export function upgradePolicySerializer(item: UpgradePolicy): any { + return { + mode: item["mode"], + automaticOSUpgradePolicy: !item["automaticOSUpgradePolicy"] + ? item["automaticOSUpgradePolicy"] + : automaticOSUpgradePolicySerializer(item["automaticOSUpgradePolicy"]), + rollingUpgradePolicy: !item["rollingUpgradePolicy"] + ? item["rollingUpgradePolicy"] + : rollingUpgradePolicySerializer(item["rollingUpgradePolicy"]), + }; +} + +export function upgradePolicyDeserializer(item: any): UpgradePolicy { + return { + mode: item["mode"], + automaticOSUpgradePolicy: !item["automaticOSUpgradePolicy"] + ? item["automaticOSUpgradePolicy"] + : automaticOSUpgradePolicyDeserializer(item["automaticOSUpgradePolicy"]), + rollingUpgradePolicy: !item["rollingUpgradePolicy"] + ? item["rollingUpgradePolicy"] + : rollingUpgradePolicyDeserializer(item["rollingUpgradePolicy"]), + }; +} + +/** Specifies the mode of an upgrade to virtual machines in the scale set.

Possible values are:

**Manual** - You control the application of updates to virtual machines in the scale set. You do this by using the manualUpgrade action.

**Automatic** - All virtual machines in the scale set are automatically updated at the same time.

**Rolling** - Scale set performs updates in batches with an optional pause time in between. */ +export type UpgradeMode = "automatic" | "manual" | "rolling"; + +/** The configuration parameters used for performing automatic OS upgrade. */ +export interface AutomaticOSUpgradePolicy { + /** Whether OS image rollback feature should be disabled. */ + disableAutomaticRollback?: boolean; + /** Indicates whether OS upgrades should automatically be applied to scale set instances in a rolling fashion when a newer version of the OS image becomes available.

If this is set to true for Windows based pools, [WindowsConfiguration.enableAutomaticUpdates](https://learn.microsoft.com/rest/api/batchmanagement/pool/create?tabs=HTTP#windowsconfiguration) cannot be set to true. */ + enableAutomaticOSUpgrade?: boolean; + /** Indicates whether rolling upgrade policy should be used during Auto OS Upgrade. Auto OS Upgrade will fallback to the default policy if no policy is defined on the VMSS. */ + useRollingUpgradePolicy?: boolean; + /** Defer OS upgrades on the TVMs if they are running tasks. */ + osRollingUpgradeDeferral?: boolean; +} + +export function automaticOSUpgradePolicySerializer(item: AutomaticOSUpgradePolicy): any { + return { + disableAutomaticRollback: item["disableAutomaticRollback"], + enableAutomaticOSUpgrade: item["enableAutomaticOSUpgrade"], + useRollingUpgradePolicy: item["useRollingUpgradePolicy"], + osRollingUpgradeDeferral: item["osRollingUpgradeDeferral"], + }; +} + +export function automaticOSUpgradePolicyDeserializer(item: any): AutomaticOSUpgradePolicy { + return { + disableAutomaticRollback: item["disableAutomaticRollback"], + enableAutomaticOSUpgrade: item["enableAutomaticOSUpgrade"], + useRollingUpgradePolicy: item["useRollingUpgradePolicy"], + osRollingUpgradeDeferral: item["osRollingUpgradeDeferral"], + }; +} + +/** The configuration parameters used while performing a rolling upgrade. */ +export interface RollingUpgradePolicy { + /** Allow VMSS to ignore AZ boundaries when constructing upgrade batches. Take into consideration the Update Domain and maxBatchInstancePercent to determine the batch size. If this field is not set, Azure Azure Batch will not set its default value. The value of enableCrossZoneUpgrade on the created VirtualMachineScaleSet will be decided by the default configurations on VirtualMachineScaleSet. This field is able to be set to true or false only when using NodePlacementConfiguration as Zonal. */ + enableCrossZoneUpgrade?: boolean; + /** The maximum percent of total virtual machine instances that will be upgraded simultaneously by the rolling upgrade in one batch. As this is a maximum, unhealthy instances in previous or future batches can cause the percentage of instances in a batch to decrease to ensure higher reliability. The value of this field should be between 5 and 100, inclusive. If both maxBatchInstancePercent and maxUnhealthyInstancePercent are assigned with value, the value of maxBatchInstancePercent should not be more than maxUnhealthyInstancePercent. */ + maxBatchInstancePercent?: number; + /** The maximum percentage of the total virtual machine instances in the scale set that can be simultaneously unhealthy, either as a result of being upgraded, or by being found in an unhealthy state by the virtual machine health checks before the rolling upgrade aborts. This constraint will be checked prior to starting any batch. The value of this field should be between 5 and 100, inclusive. If both maxBatchInstancePercent and maxUnhealthyInstancePercent are assigned with value, the value of maxBatchInstancePercent should not be more than maxUnhealthyInstancePercent. */ + maxUnhealthyInstancePercent?: number; + /** The maximum percentage of upgraded virtual machine instances that can be found to be in an unhealthy state. This check will happen after each batch is upgraded. If this percentage is ever exceeded, the rolling update aborts. The value of this field should be between 0 and 100, inclusive. */ + maxUnhealthyUpgradedInstancePercent?: number; + /** The wait time between completing the update for all virtual machines in one batch and starting the next batch. The time duration should be specified in ISO 8601 format. */ + pauseTimeBetweenBatches?: string; + /** Upgrade all unhealthy instances in a scale set before any healthy instances. */ + prioritizeUnhealthyInstances?: boolean; + /** Rollback failed instances to previous model if the Rolling Upgrade policy is violated. */ + rollbackFailedInstancesOnPolicyBreach?: boolean; +} + +export function rollingUpgradePolicySerializer(item: RollingUpgradePolicy): any { + return { + enableCrossZoneUpgrade: item["enableCrossZoneUpgrade"], + maxBatchInstancePercent: item["maxBatchInstancePercent"], + maxUnhealthyInstancePercent: item["maxUnhealthyInstancePercent"], + maxUnhealthyUpgradedInstancePercent: item["maxUnhealthyUpgradedInstancePercent"], + pauseTimeBetweenBatches: item["pauseTimeBetweenBatches"], + prioritizeUnhealthyInstances: item["prioritizeUnhealthyInstances"], + rollbackFailedInstancesOnPolicyBreach: item["rollbackFailedInstancesOnPolicyBreach"], + }; +} + +export function rollingUpgradePolicyDeserializer(item: any): RollingUpgradePolicy { + return { + enableCrossZoneUpgrade: item["enableCrossZoneUpgrade"], + maxBatchInstancePercent: item["maxBatchInstancePercent"], + maxUnhealthyInstancePercent: item["maxUnhealthyInstancePercent"], + maxUnhealthyUpgradedInstancePercent: item["maxUnhealthyUpgradedInstancePercent"], + pauseTimeBetweenBatches: item["pauseTimeBetweenBatches"], + prioritizeUnhealthyInstances: item["prioritizeUnhealthyInstances"], + rollbackFailedInstancesOnPolicyBreach: item["rollbackFailedInstancesOnPolicyBreach"], + }; +} + +/** The identity of the Batch pool, if configured. If the pool identity is updated during update an existing pool, only the new vms which are created after the pool shrinks to 0 will have the updated identities */ +export interface BatchPoolIdentity { + /** The type of identity used for the Batch Pool. */ + type: PoolIdentityType; + /** The list of user identities associated with the Batch pool. */ + userAssignedIdentities?: Record; +} + +export function batchPoolIdentitySerializer(item: BatchPoolIdentity): any { + return { + type: item["type"], + userAssignedIdentities: !item["userAssignedIdentities"] + ? item["userAssignedIdentities"] + : userAssignedIdentitiesRecordSerializer(item["userAssignedIdentities"]), + }; +} + +export function batchPoolIdentityDeserializer(item: any): BatchPoolIdentity { + return { + type: item["type"], + userAssignedIdentities: !item["userAssignedIdentities"] + ? item["userAssignedIdentities"] + : userAssignedIdentitiesRecordDeserializer(item["userAssignedIdentities"]), + }; +} + +/** The type of identity used for the Batch Pool. */ +export type PoolIdentityType = "UserAssigned" | "None"; + +/** Values returned by the List operation. */ +export interface _ListPoolsResult { + /** The Pool items on this page */ + value: Pool[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _listPoolsResultDeserializer(item: any): _ListPoolsResult { + return { + value: poolArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function poolArraySerializer(result: Array): any[] { + return result.map((item) => { + return poolSerializer(item); + }); +} + +export function poolArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return poolDeserializer(item); + }); +} + +/** Network security perimeter (NSP) configuration resource */ +export interface NetworkSecurityPerimeterConfiguration extends ProxyResource { + properties?: NetworkSecurityPerimeterConfigurationProperties; +} + +export function networkSecurityPerimeterConfigurationDeserializer( + item: any, +): NetworkSecurityPerimeterConfiguration { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : networkSecurityPerimeterConfigurationPropertiesDeserializer(item["properties"]), + }; +} + +/** Network security configuration properties. */ +export interface NetworkSecurityPerimeterConfigurationProperties { + readonly provisioningState?: NetworkSecurityPerimeterConfigurationProvisioningState; + /** List of provisioning issues, if any */ + readonly provisioningIssues?: ProvisioningIssue[]; + networkSecurityPerimeter?: NetworkSecurityPerimeter; + resourceAssociation?: ResourceAssociation; + profile?: NetworkSecurityProfile; +} + +export function networkSecurityPerimeterConfigurationPropertiesDeserializer( + item: any, +): NetworkSecurityPerimeterConfigurationProperties { + return { + provisioningState: item["provisioningState"], + provisioningIssues: !item["provisioningIssues"] + ? item["provisioningIssues"] + : provisioningIssueArrayDeserializer(item["provisioningIssues"]), + networkSecurityPerimeter: !item["networkSecurityPerimeter"] + ? item["networkSecurityPerimeter"] + : networkSecurityPerimeterDeserializer(item["networkSecurityPerimeter"]), + resourceAssociation: !item["resourceAssociation"] + ? item["resourceAssociation"] + : resourceAssociationDeserializer(item["resourceAssociation"]), + profile: !item["profile"] + ? item["profile"] + : networkSecurityProfileDeserializer(item["profile"]), + }; +} + +/** Provisioning state of a network security perimeter configuration that is being created or updated. */ +export enum KnownNetworkSecurityPerimeterConfigurationProvisioningState { + /** Succeeded */ + Succeeded = "Succeeded", + /** Creating */ + Creating = "Creating", + /** Updating */ + Updating = "Updating", + /** Deleting */ + Deleting = "Deleting", + /** Accepted */ + Accepted = "Accepted", + /** Failed */ + Failed = "Failed", + /** Canceled */ + Canceled = "Canceled", +} + +/** + * Provisioning state of a network security perimeter configuration that is being created or updated. \ + * {@link KnownNetworkSecurityPerimeterConfigurationProvisioningState} can be used interchangeably with NetworkSecurityPerimeterConfigurationProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded** \ + * **Creating** \ + * **Updating** \ + * **Deleting** \ + * **Accepted** \ + * **Failed** \ + * **Canceled** + */ +export type NetworkSecurityPerimeterConfigurationProvisioningState = string; + +export function provisioningIssueArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return provisioningIssueDeserializer(item); + }); +} + +/** Describes a provisioning issue for a network security perimeter configuration */ +export interface ProvisioningIssue { + /** Name of the issue */ + readonly name?: string; + readonly properties?: ProvisioningIssueProperties; +} + +export function provisioningIssueDeserializer(item: any): ProvisioningIssue { + return { + name: item["name"], + properties: !item["properties"] + ? item["properties"] + : provisioningIssuePropertiesDeserializer(item["properties"]), + }; +} + +/** Details of a provisioning issue for a network security perimeter (NSP) configuration. Resource providers should generate separate provisioning issue elements for each separate issue detected, and include a meaningful and distinctive description, as well as any appropriate suggestedResourceIds and suggestedAccessRules */ +export interface ProvisioningIssueProperties { + /** Type of issue */ + readonly issueType?: IssueType; + /** Severity of the issue. */ + readonly severity?: Severity; + /** Description of the issue */ + readonly description?: string; + /** Fully qualified resource IDs of suggested resources that can be associated to the network security perimeter (NSP) to remediate the issue. */ + readonly suggestedResourceIds?: string[]; + /** Access rules that can be added to the network security profile (NSP) to remediate the issue. */ + readonly suggestedAccessRules?: AccessRule[]; +} + +export function provisioningIssuePropertiesDeserializer(item: any): ProvisioningIssueProperties { + return { + issueType: item["issueType"], + severity: item["severity"], + description: item["description"], + suggestedResourceIds: !item["suggestedResourceIds"] + ? item["suggestedResourceIds"] + : item["suggestedResourceIds"].map((p: any) => { + return p; + }), + suggestedAccessRules: !item["suggestedAccessRules"] + ? item["suggestedAccessRules"] + : accessRuleArrayDeserializer(item["suggestedAccessRules"]), + }; +} + +/** Type of issue */ +export enum KnownIssueType { + /** Unknown issue type */ + Unknown = "Unknown", + /** An error occurred while applying the network security perimeter (NSP) configuration. */ + ConfigurationPropagationFailure = "ConfigurationPropagationFailure", + /** A network connectivity issue is happening on the resource which could be addressed either by adding new resources to the network security perimeter (NSP) or by modifying access rules. */ + MissingPerimeterConfiguration = "MissingPerimeterConfiguration", + /** An managed identity hasn't been associated with the resource. The resource will still be able to validate inbound traffic from the network security perimeter (NSP) or matching inbound access rules, but it won't be able to perform outbound access as a member of the NSP. */ + MissingIdentityConfiguration = "MissingIdentityConfiguration", +} + +/** + * Type of issue \ + * {@link KnownIssueType} can be used interchangeably with IssueType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Unknown**: Unknown issue type \ + * **ConfigurationPropagationFailure**: An error occurred while applying the network security perimeter (NSP) configuration. \ + * **MissingPerimeterConfiguration**: A network connectivity issue is happening on the resource which could be addressed either by adding new resources to the network security perimeter (NSP) or by modifying access rules. \ + * **MissingIdentityConfiguration**: An managed identity hasn't been associated with the resource. The resource will still be able to validate inbound traffic from the network security perimeter (NSP) or matching inbound access rules, but it won't be able to perform outbound access as a member of the NSP. + */ +export type IssueType = string; + +/** Severity of the issue. */ +export enum KnownSeverity { + /** Warning */ + Warning = "Warning", + /** Error */ + Error = "Error", +} + +/** + * Severity of the issue. \ + * {@link KnownSeverity} can be used interchangeably with Severity, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Warning** \ + * **Error** + */ +export type Severity = string; + +export function accessRuleArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return accessRuleDeserializer(item); + }); +} + +/** Access rule in a network security perimeter configuration profile */ +export interface AccessRule { + /** Name of the access rule */ + name?: string; + properties?: AccessRuleProperties; +} + +export function accessRuleDeserializer(item: any): AccessRule { + return { + name: item["name"], + properties: !item["properties"] + ? item["properties"] + : accessRulePropertiesDeserializer(item["properties"]), + }; +} + +/** Properties of Access Rule */ +export interface AccessRuleProperties { + direction?: AccessRuleDirection; + /** Address prefixes in the CIDR format for inbound rules */ + addressPrefixes?: string[]; + /** Subscriptions for inbound rules */ + subscriptions?: { + id?: string; + }[]; + /** Network security perimeters for inbound rules */ + networkSecurityPerimeters?: NetworkSecurityPerimeter[]; + /** Fully qualified domain names (FQDN) for outbound rules */ + fullyQualifiedDomainNames?: string[]; + /** Email addresses for outbound rules */ + emailAddresses?: string[]; + /** Phone numbers for outbound rules */ + phoneNumbers?: string[]; +} + +export function accessRulePropertiesDeserializer(item: any): AccessRuleProperties { + return { + direction: item["direction"], + addressPrefixes: !item["addressPrefixes"] + ? item["addressPrefixes"] + : item["addressPrefixes"].map((p: any) => { + return p; + }), + subscriptions: !item["subscriptions"] + ? item["subscriptions"] + : _accessRulePropertiesSubscriptionArrayDeserializer(item["subscriptions"]), + networkSecurityPerimeters: !item["networkSecurityPerimeters"] + ? item["networkSecurityPerimeters"] + : networkSecurityPerimeterArrayDeserializer(item["networkSecurityPerimeters"]), + fullyQualifiedDomainNames: !item["fullyQualifiedDomainNames"] + ? item["fullyQualifiedDomainNames"] + : item["fullyQualifiedDomainNames"].map((p: any) => { + return p; + }), + emailAddresses: !item["emailAddresses"] + ? item["emailAddresses"] + : item["emailAddresses"].map((p: any) => { + return p; + }), + phoneNumbers: !item["phoneNumbers"] + ? item["phoneNumbers"] + : item["phoneNumbers"].map((p: any) => { + return p; + }), + }; +} + +/** Direction of Access Rule */ +export enum KnownAccessRuleDirection { + /** Applies to inbound network traffic to the secured resources. */ + Inbound = "Inbound", + /** Applies to outbound network traffic from the secured resources */ + Outbound = "Outbound", +} + +/** + * Direction of Access Rule \ + * {@link KnownAccessRuleDirection} can be used interchangeably with AccessRuleDirection, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Inbound**: Applies to inbound network traffic to the secured resources. \ + * **Outbound**: Applies to outbound network traffic from the secured resources + */ +export type AccessRuleDirection = string; + +export function _accessRulePropertiesSubscriptionArrayDeserializer( + result: Array<_AccessRulePropertiesSubscription>, +): any[] { + return result.map((item) => { + return _accessRulePropertiesSubscriptionDeserializer(item); + }); +} + +/** model interface _AccessRulePropertiesSubscription */ +export interface _AccessRulePropertiesSubscription { + /** The fully qualified Azure resource ID of the subscription e.g. ('/subscriptions/00000000-0000-0000-0000-000000000000') */ + id?: string; +} + +export function _accessRulePropertiesSubscriptionDeserializer( + item: any, +): _AccessRulePropertiesSubscription { + return { + id: item["id"], + }; +} + +export function networkSecurityPerimeterArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return networkSecurityPerimeterDeserializer(item); + }); +} + +/** Information about a network security perimeter (NSP) */ +export interface NetworkSecurityPerimeter { + /** Fully qualified Azure resource ID of the NSP resource */ + id?: string; + /** Universal unique ID (UUID) of the network security perimeter */ + perimeterGuid?: string; + /** Location of the network security perimeter */ + location?: string; +} + +export function networkSecurityPerimeterDeserializer(item: any): NetworkSecurityPerimeter { + return { + id: item["id"], + perimeterGuid: item["perimeterGuid"], + location: item["location"], + }; +} + +/** Information about resource association */ +export interface ResourceAssociation { + /** Name of the resource association */ + name?: string; + accessMode?: ResourceAssociationAccessMode; +} + +export function resourceAssociationDeserializer(item: any): ResourceAssociation { + return { + name: item["name"], + accessMode: item["accessMode"], + }; +} + +/** Access mode of the resource association */ +export enum KnownResourceAssociationAccessMode { + /** Enforced access mode - traffic to the resource that failed access checks is blocked */ + Enforced = "Enforced", + /** Learning access mode - traffic to the resource is enabled for analysis but not blocked */ + Learning = "Learning", + /** Audit access mode - traffic to the resource that fails access checks is logged but not blocked */ + Audit = "Audit", +} + +/** + * Access mode of the resource association \ + * {@link KnownResourceAssociationAccessMode} can be used interchangeably with ResourceAssociationAccessMode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enforced**: Enforced access mode - traffic to the resource that failed access checks is blocked \ + * **Learning**: Learning access mode - traffic to the resource is enabled for analysis but not blocked \ + * **Audit**: Audit access mode - traffic to the resource that fails access checks is logged but not blocked + */ +export type ResourceAssociationAccessMode = string; + +/** Network security perimeter configuration profile */ +export interface NetworkSecurityProfile { + /** Name of the profile */ + name?: string; + /** Current access rules version */ + accessRulesVersion?: number; + /** List of Access Rules */ + accessRules?: AccessRule[]; + /** Current diagnostic settings version */ + diagnosticSettingsVersion?: number; + /** List of log categories that are enabled */ + enabledLogCategories?: string[]; +} + +export function networkSecurityProfileDeserializer(item: any): NetworkSecurityProfile { + return { + name: item["name"], + accessRulesVersion: item["accessRulesVersion"], + accessRules: !item["accessRules"] + ? item["accessRules"] + : accessRuleArrayDeserializer(item["accessRules"]), + diagnosticSettingsVersion: item["diagnosticSettingsVersion"], + enabledLogCategories: !item["enabledLogCategories"] + ? item["enabledLogCategories"] + : item["enabledLogCategories"].map((p: any) => { + return p; + }), + }; +} + +/** Result of a list NSP (network security perimeter) configurations request. */ +export interface _NetworkSecurityPerimeterConfigurationListResult { + /** Array of network security perimeter results. */ + value?: NetworkSecurityPerimeterConfiguration[]; + /** The link used to get the next page of results. */ + nextLink?: string; +} + +export function _networkSecurityPerimeterConfigurationListResultDeserializer( + item: any, +): _NetworkSecurityPerimeterConfigurationListResult { + return { + value: !item["value"] + ? item["value"] + : networkSecurityPerimeterConfigurationArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function networkSecurityPerimeterConfigurationArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return networkSecurityPerimeterConfigurationDeserializer(item); + }); +} + +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. */ +export interface ErrorResponse { + /** The error object. */ + error?: ErrorDetail; +} + +export function errorResponseDeserializer(item: any): ErrorResponse { + return { + error: !item["error"] ? item["error"] : errorDetailDeserializer(item["error"]), + }; +} + +/** Quotas associated with a Batch region for a particular subscription. */ +export interface BatchLocationQuota { + /** The number of Batch accounts that may be created under the subscription in the specified region. */ + readonly accountQuota?: number; +} + +export function batchLocationQuotaDeserializer(item: any): BatchLocationQuota { + return { + accountQuota: item["accountQuota"], + }; +} + +/** The Batch List supported SKUs operation response. */ +export interface _SupportedSkusResult { + /** The SupportedSku items on this page */ + value: SupportedSku[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _supportedSkusResultDeserializer(item: any): _SupportedSkusResult { + return { + value: supportedSkuArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function supportedSkuArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return supportedSkuDeserializer(item); + }); +} + +/** Describes a Batch supported SKU. */ +export interface SupportedSku { + /** The name of the SKU. */ + readonly name?: string; + /** The family name of the SKU. */ + readonly familyName?: string; + /** A collection of capabilities which this SKU supports. */ + readonly capabilities?: SkuCapability[]; + /** The time when Azure Batch service will retire this SKU. */ + readonly batchSupportEndOfLife?: Date; +} + +export function supportedSkuDeserializer(item: any): SupportedSku { + return { + name: item["name"], + familyName: item["familyName"], + capabilities: !item["capabilities"] + ? item["capabilities"] + : skuCapabilityArrayDeserializer(item["capabilities"]), + batchSupportEndOfLife: !item["batchSupportEndOfLife"] + ? item["batchSupportEndOfLife"] + : new Date(item["batchSupportEndOfLife"]), + }; +} + +export function skuCapabilityArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return skuCapabilityDeserializer(item); + }); +} + +/** A SKU capability, such as the number of cores. */ +export interface SkuCapability { + /** The name of the feature. */ + readonly name?: string; + /** The value of the feature. */ + readonly value?: string; +} + +export function skuCapabilityDeserializer(item: any): SkuCapability { + return { + name: item["name"], + value: item["value"], + }; +} + +/** Parameters for a check name availability request. */ +export interface CheckNameAvailabilityParameters { + /** The name to check for availability */ + name: string; + /** The resource type. */ + type: ResourceType; +} + +export function checkNameAvailabilityParametersSerializer( + item: CheckNameAvailabilityParameters, +): any { + return { name: item["name"], type: item["type"] }; +} + +/** The result of the request to list operations. */ +export type ResourceType = "Microsoft.Batch/batchAccounts"; + +/** The CheckNameAvailability operation response. */ +export interface CheckNameAvailabilityResult { + /** Gets a boolean value that indicates whether the name is available for you to use. If true, the name is available. If false, the name has already been taken or invalid and cannot be used. */ + readonly nameAvailable?: boolean; + /** Gets the reason that a Batch account name could not be used. The Reason element is only returned if NameAvailable is false. */ + readonly reason?: NameAvailabilityReason; + /** Gets an error message explaining the Reason value in more detail. */ + readonly message?: string; +} + +export function checkNameAvailabilityResultDeserializer(item: any): CheckNameAvailabilityResult { + return { + nameAvailable: item["nameAvailable"], + reason: item["reason"], + message: item["message"], + }; +} + +/** Gets the reason that a Batch account name could not be used. The Reason element is only returned if NameAvailable is false. */ +export type NameAvailabilityReason = "Invalid" | "AlreadyExists"; + +/** The available API versions. */ +export enum KnownVersions { + /** The 2024-07-01 API version. */ + V20240701 = "2024-07-01", + /** The 2025-06-01 API version. */ + V20250601 = "2025-06-01", +} + +export function _privateEndpointConnectionPropertiesSerializer( + item: PrivateEndpointConnection, +): any { + return { + privateLinkServiceConnectionState: !item["privateLinkServiceConnectionState"] + ? item["privateLinkServiceConnectionState"] + : privateLinkServiceConnectionStateSerializer(item["privateLinkServiceConnectionState"]), + }; +} + +export function _privateEndpointConnectionPropertiesDeserializer(item: any) { + return { + provisioningState: item["provisioningState"], + privateEndpoint: !item["privateEndpoint"] + ? item["privateEndpoint"] + : privateEndpointDeserializer(item["privateEndpoint"]), + groupIds: !item["groupIds"] + ? item["groupIds"] + : item["groupIds"].map((p: any) => { + return p; + }), + privateLinkServiceConnectionState: !item["privateLinkServiceConnectionState"] + ? item["privateLinkServiceConnectionState"] + : privateLinkServiceConnectionStateDeserializer(item["privateLinkServiceConnectionState"]), + }; +} + +export function _batchAccountPropertiesDeserializer(item: any) { + return { + accountEndpoint: item["accountEndpoint"], + nodeManagementEndpoint: item["nodeManagementEndpoint"], + provisioningState: item["provisioningState"], + poolAllocationMode: item["poolAllocationMode"], + keyVaultReference: !item["keyVaultReference"] + ? item["keyVaultReference"] + : keyVaultReferenceDeserializer(item["keyVaultReference"]), + publicNetworkAccess: item["publicNetworkAccess"], + networkProfile: !item["networkProfile"] + ? item["networkProfile"] + : networkProfileDeserializer(item["networkProfile"]), + privateEndpointConnections: !item["privateEndpointConnections"] + ? item["privateEndpointConnections"] + : privateEndpointConnectionArrayDeserializer(item["privateEndpointConnections"]), + autoStorage: !item["autoStorage"] + ? item["autoStorage"] + : autoStoragePropertiesDeserializer(item["autoStorage"]), + encryption: !item["encryption"] + ? item["encryption"] + : encryptionPropertiesDeserializer(item["encryption"]), + dedicatedCoreQuota: item["dedicatedCoreQuota"], + lowPriorityCoreQuota: item["lowPriorityCoreQuota"], + dedicatedCoreQuotaPerVMFamily: !item["dedicatedCoreQuotaPerVMFamily"] + ? item["dedicatedCoreQuotaPerVMFamily"] + : virtualMachineFamilyCoreQuotaArrayDeserializer(item["dedicatedCoreQuotaPerVMFamily"]), + dedicatedCoreQuotaPerVMFamilyEnforced: item["dedicatedCoreQuotaPerVMFamilyEnforced"], + poolQuota: item["poolQuota"], + activeJobAndJobScheduleQuota: item["activeJobAndJobScheduleQuota"], + allowedAuthenticationModes: !item["allowedAuthenticationModes"] + ? item["allowedAuthenticationModes"] + : item["allowedAuthenticationModes"].map((p1: any) => { + return p1; + }), + }; +} + +export function _batchAccountCreateParametersPropertiesSerializer( + item: BatchAccountCreateParameters, +): any { + return { + autoStorage: !item["autoStorage"] + ? item["autoStorage"] + : autoStorageBasePropertiesSerializer(item["autoStorage"]), + poolAllocationMode: item["poolAllocationMode"], + keyVaultReference: !item["keyVaultReference"] + ? item["keyVaultReference"] + : keyVaultReferenceSerializer(item["keyVaultReference"]), + publicNetworkAccess: item["publicNetworkAccess"], + networkProfile: !item["networkProfile"] + ? item["networkProfile"] + : networkProfileSerializer(item["networkProfile"]), + encryption: !item["encryption"] + ? item["encryption"] + : encryptionPropertiesSerializer(item["encryption"]), + allowedAuthenticationModes: !item["allowedAuthenticationModes"] + ? item["allowedAuthenticationModes"] + : item["allowedAuthenticationModes"].map((p: any) => { + return p; + }), + }; +} + +export function _batchAccountUpdateParametersPropertiesSerializer( + item: BatchAccountUpdateParameters, +): any { + return { + autoStorage: !item["autoStorage"] + ? item["autoStorage"] + : autoStorageBasePropertiesSerializer(item["autoStorage"]), + encryption: !item["encryption"] + ? item["encryption"] + : encryptionPropertiesSerializer(item["encryption"]), + allowedAuthenticationModes: !item["allowedAuthenticationModes"] + ? item["allowedAuthenticationModes"] + : item["allowedAuthenticationModes"].map((p: any) => { + return p; + }), + publicNetworkAccess: item["publicNetworkAccess"], + networkProfile: !item["networkProfile"] + ? item["networkProfile"] + : networkProfileSerializer(item["networkProfile"]), + }; +} + +export function _detectorResponsePropertiesDeserializer(item: any) { + return { + value: item["value"], + }; +} + +export function _applicationPackagePropertiesSerializer(item: ApplicationPackage): any { + return item; +} + +export function _applicationPackagePropertiesDeserializer(item: any) { + return { + state: item["state"], + format: item["format"], + storageUrl: item["storageUrl"], + storageUrlExpiry: !item["storageUrlExpiry"] + ? item["storageUrlExpiry"] + : new Date(item["storageUrlExpiry"]), + lastActivationTime: !item["lastActivationTime"] + ? item["lastActivationTime"] + : new Date(item["lastActivationTime"]), + }; +} + +export function _applicationPropertiesSerializer(item: Application): any { + return { + displayName: item["displayName"], + allowUpdates: item["allowUpdates"], + defaultVersion: item["defaultVersion"], + }; +} + +export function _applicationPropertiesDeserializer(item: any) { + return { + displayName: item["displayName"], + allowUpdates: item["allowUpdates"], + defaultVersion: item["defaultVersion"], + }; +} + +export function _privateLinkResourcePropertiesDeserializer(item: any) { + return { + groupId: item["groupId"], + requiredMembers: !item["requiredMembers"] + ? item["requiredMembers"] + : item["requiredMembers"].map((p: any) => { + return p; + }), + requiredZoneNames: !item["requiredZoneNames"] + ? item["requiredZoneNames"] + : item["requiredZoneNames"].map((p: any) => { + return p; + }), + }; +} + +export function _poolPropertiesSerializer(item: Pool): any { + return { + displayName: item["displayName"], + vmSize: item["vmSize"], + deploymentConfiguration: !item["deploymentConfiguration"] + ? item["deploymentConfiguration"] + : deploymentConfigurationSerializer(item["deploymentConfiguration"]), + scaleSettings: !item["scaleSettings"] + ? item["scaleSettings"] + : scaleSettingsSerializer(item["scaleSettings"]), + interNodeCommunication: item["interNodeCommunication"], + networkConfiguration: !item["networkConfiguration"] + ? item["networkConfiguration"] + : networkConfigurationSerializer(item["networkConfiguration"]), + taskSlotsPerNode: item["taskSlotsPerNode"], + taskSchedulingPolicy: !item["taskSchedulingPolicy"] + ? item["taskSchedulingPolicy"] + : taskSchedulingPolicySerializer(item["taskSchedulingPolicy"]), + userAccounts: !item["userAccounts"] + ? item["userAccounts"] + : userAccountArraySerializer(item["userAccounts"]), + metadata: !item["metadata"] ? item["metadata"] : metadataItemArraySerializer(item["metadata"]), + startTask: !item["startTask"] ? item["startTask"] : startTaskSerializer(item["startTask"]), + applicationPackages: !item["applicationPackages"] + ? item["applicationPackages"] + : applicationPackageReferenceArraySerializer(item["applicationPackages"]), + mountConfiguration: !item["mountConfiguration"] + ? item["mountConfiguration"] + : mountConfigurationArraySerializer(item["mountConfiguration"]), + upgradePolicy: !item["upgradePolicy"] + ? item["upgradePolicy"] + : upgradePolicySerializer(item["upgradePolicy"]), + }; +} + +export function _poolPropertiesDeserializer(item: any) { + return { + displayName: item["displayName"], + lastModified: !item["lastModified"] ? item["lastModified"] : new Date(item["lastModified"]), + creationTime: !item["creationTime"] ? item["creationTime"] : new Date(item["creationTime"]), + provisioningState: item["provisioningState"], + provisioningStateTransitionTime: !item["provisioningStateTransitionTime"] + ? item["provisioningStateTransitionTime"] + : new Date(item["provisioningStateTransitionTime"]), + allocationState: item["allocationState"], + allocationStateTransitionTime: !item["allocationStateTransitionTime"] + ? item["allocationStateTransitionTime"] + : new Date(item["allocationStateTransitionTime"]), + vmSize: item["vmSize"], + deploymentConfiguration: !item["deploymentConfiguration"] + ? item["deploymentConfiguration"] + : deploymentConfigurationDeserializer(item["deploymentConfiguration"]), + currentDedicatedNodes: item["currentDedicatedNodes"], + currentLowPriorityNodes: item["currentLowPriorityNodes"], + scaleSettings: !item["scaleSettings"] + ? item["scaleSettings"] + : scaleSettingsDeserializer(item["scaleSettings"]), + autoScaleRun: !item["autoScaleRun"] + ? item["autoScaleRun"] + : autoScaleRunDeserializer(item["autoScaleRun"]), + interNodeCommunication: item["interNodeCommunication"], + networkConfiguration: !item["networkConfiguration"] + ? item["networkConfiguration"] + : networkConfigurationDeserializer(item["networkConfiguration"]), + taskSlotsPerNode: item["taskSlotsPerNode"], + taskSchedulingPolicy: !item["taskSchedulingPolicy"] + ? item["taskSchedulingPolicy"] + : taskSchedulingPolicyDeserializer(item["taskSchedulingPolicy"]), + userAccounts: !item["userAccounts"] + ? item["userAccounts"] + : userAccountArrayDeserializer(item["userAccounts"]), + metadata: !item["metadata"] + ? item["metadata"] + : metadataItemArrayDeserializer(item["metadata"]), + startTask: !item["startTask"] ? item["startTask"] : startTaskDeserializer(item["startTask"]), + applicationPackages: !item["applicationPackages"] + ? item["applicationPackages"] + : applicationPackageReferenceArrayDeserializer(item["applicationPackages"]), + resizeOperationStatus: !item["resizeOperationStatus"] + ? item["resizeOperationStatus"] + : resizeOperationStatusDeserializer(item["resizeOperationStatus"]), + mountConfiguration: !item["mountConfiguration"] + ? item["mountConfiguration"] + : mountConfigurationArrayDeserializer(item["mountConfiguration"]), + upgradePolicy: !item["upgradePolicy"] + ? item["upgradePolicy"] + : upgradePolicyDeserializer(item["upgradePolicy"]), + }; +} diff --git a/sdk/batch/arm-batch/src/models/parameters.ts b/sdk/batch/arm-batch/src/models/parameters.ts deleted file mode 100644 index b75f773b4ff5..000000000000 --- a/sdk/batch/arm-batch/src/models/parameters.ts +++ /dev/null @@ -1,377 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { - OperationParameter, - OperationURLParameter, - OperationQueryParameter, -} from "@azure/core-client"; -import { - BatchAccountCreateParameters as BatchAccountCreateParametersMapper, - BatchAccountUpdateParameters as BatchAccountUpdateParametersMapper, - BatchAccountRegenerateKeyParameters as BatchAccountRegenerateKeyParametersMapper, - ActivateApplicationPackageParameters as ActivateApplicationPackageParametersMapper, - ApplicationPackage as ApplicationPackageMapper, - Application as ApplicationMapper, - CheckNameAvailabilityParameters as CheckNameAvailabilityParametersMapper, - CertificateCreateOrUpdateParameters as CertificateCreateOrUpdateParametersMapper, - PrivateEndpointConnection as PrivateEndpointConnectionMapper, - Pool as PoolMapper, -} from "../models/mappers.js"; - -export const contentType: OperationParameter = { - parameterPath: ["options", "contentType"], - mapper: { - defaultValue: "application/json", - isConstant: true, - serializedName: "Content-Type", - type: { - name: "String", - }, - }, -}; - -export const parameters: OperationParameter = { - parameterPath: "parameters", - mapper: BatchAccountCreateParametersMapper, -}; - -export const accept: OperationParameter = { - parameterPath: "accept", - mapper: { - defaultValue: "application/json", - isConstant: true, - serializedName: "Accept", - type: { - name: "String", - }, - }, -}; - -export const $host: OperationURLParameter = { - parameterPath: "$host", - mapper: { - serializedName: "$host", - required: true, - type: { - name: "String", - }, - }, - skipEncoding: true, -}; - -export const resourceGroupName: OperationURLParameter = { - parameterPath: "resourceGroupName", - mapper: { - serializedName: "resourceGroupName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const accountName: OperationURLParameter = { - parameterPath: "accountName", - mapper: { - constraints: { - Pattern: new RegExp("^[a-z0-9]+$"), - MaxLength: 24, - MinLength: 3, - }, - serializedName: "accountName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const apiVersion: OperationQueryParameter = { - parameterPath: "apiVersion", - mapper: { - defaultValue: "2024-07-01", - isConstant: true, - serializedName: "api-version", - type: { - name: "String", - }, - }, -}; - -export const subscriptionId: OperationURLParameter = { - parameterPath: "subscriptionId", - mapper: { - serializedName: "subscriptionId", - required: true, - type: { - name: "String", - }, - }, -}; - -export const parameters1: OperationParameter = { - parameterPath: "parameters", - mapper: BatchAccountUpdateParametersMapper, -}; - -export const accountName1: OperationURLParameter = { - parameterPath: "accountName", - mapper: { - constraints: { - Pattern: new RegExp("^[a-zA-Z0-9]+$"), - MaxLength: 24, - MinLength: 3, - }, - serializedName: "accountName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const parameters2: OperationParameter = { - parameterPath: "parameters", - mapper: BatchAccountRegenerateKeyParametersMapper, -}; - -export const detectorId: OperationURLParameter = { - parameterPath: "detectorId", - mapper: { - serializedName: "detectorId", - required: true, - type: { - name: "String", - }, - }, -}; - -export const nextLink: OperationURLParameter = { - parameterPath: "nextLink", - mapper: { - serializedName: "nextLink", - required: true, - type: { - name: "String", - }, - }, - skipEncoding: true, -}; - -export const parameters3: OperationParameter = { - parameterPath: "parameters", - mapper: ActivateApplicationPackageParametersMapper, -}; - -export const applicationName: OperationURLParameter = { - parameterPath: "applicationName", - mapper: { - constraints: { - Pattern: new RegExp("^[a-zA-Z0-9_-]+$"), - MaxLength: 64, - MinLength: 1, - }, - serializedName: "applicationName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const versionName: OperationURLParameter = { - parameterPath: "versionName", - mapper: { - constraints: { - Pattern: new RegExp("^[a-zA-Z0-9_-][a-zA-Z0-9_.-]*$"), - MaxLength: 64, - MinLength: 1, - }, - serializedName: "versionName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const parameters4: OperationParameter = { - parameterPath: ["options", "parameters"], - mapper: ApplicationPackageMapper, -}; - -export const maxresults: OperationQueryParameter = { - parameterPath: ["options", "maxresults"], - mapper: { - serializedName: "maxresults", - type: { - name: "Number", - }, - }, -}; - -export const parameters5: OperationParameter = { - parameterPath: ["options", "parameters"], - mapper: ApplicationMapper, -}; - -export const parameters6: OperationParameter = { - parameterPath: "parameters", - mapper: ApplicationMapper, -}; - -export const locationName: OperationURLParameter = { - parameterPath: "locationName", - mapper: { - serializedName: "locationName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const filter: OperationQueryParameter = { - parameterPath: ["options", "filter"], - mapper: { - serializedName: "$filter", - type: { - name: "String", - }, - }, -}; - -export const parameters7: OperationParameter = { - parameterPath: "parameters", - mapper: CheckNameAvailabilityParametersMapper, -}; - -export const select: OperationQueryParameter = { - parameterPath: ["options", "select"], - mapper: { - serializedName: "$select", - type: { - name: "String", - }, - }, -}; - -export const parameters8: OperationParameter = { - parameterPath: "parameters", - mapper: CertificateCreateOrUpdateParametersMapper, -}; - -export const certificateName: OperationURLParameter = { - parameterPath: "certificateName", - mapper: { - constraints: { - Pattern: new RegExp("^[\\w]+-[\\w]+$"), - MaxLength: 45, - MinLength: 5, - }, - serializedName: "certificateName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const ifMatch: OperationParameter = { - parameterPath: ["options", "ifMatch"], - mapper: { - serializedName: "If-Match", - type: { - name: "String", - }, - }, -}; - -export const ifNoneMatch: OperationParameter = { - parameterPath: ["options", "ifNoneMatch"], - mapper: { - serializedName: "If-None-Match", - type: { - name: "String", - }, - }, -}; - -export const privateLinkResourceName: OperationURLParameter = { - parameterPath: "privateLinkResourceName", - mapper: { - constraints: { - Pattern: new RegExp("^[a-zA-Z0-9_-]+\\.?[a-fA-F0-9-]*$"), - MaxLength: 101, - MinLength: 1, - }, - serializedName: "privateLinkResourceName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const privateEndpointConnectionName: OperationURLParameter = { - parameterPath: "privateEndpointConnectionName", - mapper: { - constraints: { - Pattern: new RegExp("^[a-zA-Z0-9_-]+\\.?[a-fA-F0-9-]*$"), - MaxLength: 101, - MinLength: 1, - }, - serializedName: "privateEndpointConnectionName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const parameters9: OperationParameter = { - parameterPath: "parameters", - mapper: PrivateEndpointConnectionMapper, -}; - -export const parameters10: OperationParameter = { - parameterPath: "parameters", - mapper: PoolMapper, -}; - -export const poolName: OperationURLParameter = { - parameterPath: "poolName", - mapper: { - constraints: { - Pattern: new RegExp("^[a-zA-Z0-9_-]+$"), - MaxLength: 64, - MinLength: 1, - }, - serializedName: "poolName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const networkSecurityPerimeterConfigurationName: OperationURLParameter = - { - parameterPath: "networkSecurityPerimeterConfigurationName", - mapper: { - constraints: { - Pattern: new RegExp("^.*$"), - }, - serializedName: "networkSecurityPerimeterConfigurationName", - required: true, - type: { - name: "String", - }, - }, - }; diff --git a/sdk/batch/arm-batch/src/operations/applicationOperations.ts b/sdk/batch/arm-batch/src/operations/applicationOperations.ts deleted file mode 100644 index 8d5c419aba5c..000000000000 --- a/sdk/batch/arm-batch/src/operations/applicationOperations.ts +++ /dev/null @@ -1,369 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import { ApplicationOperations } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { BatchManagementClient } from "../batchManagementClient.js"; -import { - Application, - ApplicationListNextOptionalParams, - ApplicationListOptionalParams, - ApplicationListResponse, - ApplicationCreateOptionalParams, - ApplicationCreateResponse, - ApplicationDeleteOptionalParams, - ApplicationGetOptionalParams, - ApplicationGetResponse, - ApplicationUpdateOptionalParams, - ApplicationUpdateResponse, - ApplicationListNextResponse, -} from "../models/index.js"; - -/// -/** Class containing ApplicationOperations operations. */ -export class ApplicationOperationsImpl implements ApplicationOperations { - private readonly client: BatchManagementClient; - - /** - * Initialize a new instance of the class ApplicationOperations class. - * @param client Reference to the service client - */ - constructor(client: BatchManagementClient) { - this.client = client; - } - - /** - * Lists all of the applications in the specified account. - * @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. - */ - public list( - resourceGroupName: string, - accountName: string, - options?: ApplicationListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(resourceGroupName, accountName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage( - resourceGroupName, - accountName, - options, - settings, - ); - }, - }; - } - - private async *listPagingPage( - resourceGroupName: string, - accountName: string, - options?: ApplicationListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: ApplicationListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(resourceGroupName, accountName, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext( - resourceGroupName, - accountName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - resourceGroupName: string, - accountName: string, - options?: ApplicationListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage( - resourceGroupName, - accountName, - options, - )) { - yield* page; - } - } - - /** - * Adds an application to the specified Batch account. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param applicationName The name of the application. This must be unique within the account. - * @param options The options parameters. - */ - create( - resourceGroupName: string, - accountName: string, - applicationName: string, - options?: ApplicationCreateOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, accountName, applicationName, options }, - createOperationSpec, - ); - } - - /** - * Deletes an application. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param applicationName The name of the application. This must be unique within the account. - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - accountName: string, - applicationName: string, - options?: ApplicationDeleteOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, accountName, applicationName, options }, - deleteOperationSpec, - ); - } - - /** - * Gets information about the specified application. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param applicationName The name of the application. This must be unique within the account. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - accountName: string, - applicationName: string, - options?: ApplicationGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, accountName, applicationName, options }, - getOperationSpec, - ); - } - - /** - * Updates settings for the specified application. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param applicationName The name of the application. This must be unique within the account. - * @param parameters The parameters for the request. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - accountName: string, - applicationName: string, - parameters: Application, - options?: ApplicationUpdateOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, accountName, applicationName, parameters, options }, - updateOperationSpec, - ); - } - - /** - * Lists all of the applications in the specified account. - * @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. - */ - private _list( - resourceGroupName: string, - accountName: string, - options?: ApplicationListOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, accountName, options }, - listOperationSpec, - ); - } - - /** - * ListNext - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - resourceGroupName: string, - accountName: string, - nextLink: string, - options?: ApplicationListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, accountName, nextLink, options }, - listNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const createOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.Application, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters5, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - Parameters.applicationName, - ], - headerParameters: [Parameters.contentType, Parameters.accept], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - Parameters.applicationName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.Application, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - Parameters.applicationName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.Application, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters6, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - Parameters.applicationName, - ], - headerParameters: [Parameters.contentType, Parameters.accept], - mediaType: "json", - serializer, -}; -const listOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ListApplicationsResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.maxresults], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ListApplicationsResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - Parameters.nextLink, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/batch/arm-batch/src/operations/applicationPackageOperations.ts b/sdk/batch/arm-batch/src/operations/applicationPackageOperations.ts deleted file mode 100644 index 21cc4dc4721d..000000000000 --- a/sdk/batch/arm-batch/src/operations/applicationPackageOperations.ts +++ /dev/null @@ -1,419 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import { ApplicationPackageOperations } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { BatchManagementClient } from "../batchManagementClient.js"; -import { - ApplicationPackage, - ApplicationPackageListNextOptionalParams, - ApplicationPackageListOptionalParams, - ApplicationPackageListResponse, - ActivateApplicationPackageParameters, - ApplicationPackageActivateOptionalParams, - ApplicationPackageActivateResponse, - ApplicationPackageCreateOptionalParams, - ApplicationPackageCreateResponse, - ApplicationPackageDeleteOptionalParams, - ApplicationPackageGetOptionalParams, - ApplicationPackageGetResponse, - ApplicationPackageListNextResponse, -} from "../models/index.js"; - -/// -/** Class containing ApplicationPackageOperations operations. */ -export class ApplicationPackageOperationsImpl - implements ApplicationPackageOperations -{ - private readonly client: BatchManagementClient; - - /** - * Initialize a new instance of the class ApplicationPackageOperations class. - * @param client Reference to the service client - */ - constructor(client: BatchManagementClient) { - this.client = client; - } - - /** - * Lists all of the application packages in the specified application. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param applicationName The name of the application. This must be unique within the account. - * @param options The options parameters. - */ - public list( - resourceGroupName: string, - accountName: string, - applicationName: string, - options?: ApplicationPackageListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll( - resourceGroupName, - accountName, - applicationName, - options, - ); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage( - resourceGroupName, - accountName, - applicationName, - options, - settings, - ); - }, - }; - } - - private async *listPagingPage( - resourceGroupName: string, - accountName: string, - applicationName: string, - options?: ApplicationPackageListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: ApplicationPackageListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list( - resourceGroupName, - accountName, - applicationName, - options, - ); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext( - resourceGroupName, - accountName, - applicationName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - resourceGroupName: string, - accountName: string, - applicationName: string, - options?: ApplicationPackageListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage( - resourceGroupName, - accountName, - applicationName, - options, - )) { - yield* page; - } - } - - /** - * 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. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param applicationName The name of the application. This must be unique within the account. - * @param versionName The version of the application. - * @param parameters The parameters for the request. - * @param options The options parameters. - */ - activate( - resourceGroupName: string, - accountName: string, - applicationName: string, - versionName: string, - parameters: ActivateApplicationPackageParameters, - options?: ApplicationPackageActivateOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - accountName, - applicationName, - versionName, - parameters, - options, - }, - activateOperationSpec, - ); - } - - /** - * 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. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param applicationName The name of the application. This must be unique within the account. - * @param versionName The version of the application. - * @param options The options parameters. - */ - create( - resourceGroupName: string, - accountName: string, - applicationName: string, - versionName: string, - options?: ApplicationPackageCreateOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, accountName, applicationName, versionName, options }, - createOperationSpec, - ); - } - - /** - * Deletes an application package record and its associated binary file. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param applicationName The name of the application. This must be unique within the account. - * @param versionName The version of the application. - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - accountName: string, - applicationName: string, - versionName: string, - options?: ApplicationPackageDeleteOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, accountName, applicationName, versionName, options }, - deleteOperationSpec, - ); - } - - /** - * Gets information about the specified application package. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param applicationName The name of the application. This must be unique within the account. - * @param versionName The version of the application. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - accountName: string, - applicationName: string, - versionName: string, - options?: ApplicationPackageGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, accountName, applicationName, versionName, options }, - getOperationSpec, - ); - } - - /** - * Lists all of the application packages in the specified application. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param applicationName The name of the application. This must be unique within the account. - * @param options The options parameters. - */ - private _list( - resourceGroupName: string, - accountName: string, - applicationName: string, - options?: ApplicationPackageListOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, accountName, applicationName, options }, - listOperationSpec, - ); - } - - /** - * ListNext - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param applicationName The name of the application. This must be unique within the account. - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - resourceGroupName: string, - accountName: string, - applicationName: string, - nextLink: string, - options?: ApplicationPackageListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, accountName, applicationName, nextLink, options }, - listNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const activateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}/versions/{versionName}/activate", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.ApplicationPackage, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters3, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - Parameters.applicationName, - Parameters.versionName, - ], - headerParameters: [Parameters.contentType, Parameters.accept], - mediaType: "json", - serializer, -}; -const createOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}/versions/{versionName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.ApplicationPackage, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters4, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - Parameters.applicationName, - Parameters.versionName, - ], - headerParameters: [Parameters.contentType, Parameters.accept], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}/versions/{versionName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - Parameters.applicationName, - Parameters.versionName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}/versions/{versionName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ApplicationPackage, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - Parameters.applicationName, - Parameters.versionName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}/versions", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ListApplicationPackagesResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.maxresults], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - Parameters.applicationName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ListApplicationPackagesResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - Parameters.nextLink, - Parameters.applicationName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/batch/arm-batch/src/operations/batchAccountOperations.ts b/sdk/batch/arm-batch/src/operations/batchAccountOperations.ts deleted file mode 100644 index 3c248e097b7c..000000000000 --- a/sdk/batch/arm-batch/src/operations/batchAccountOperations.ts +++ /dev/null @@ -1,1151 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import { BatchAccountOperations } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { BatchManagementClient } from "../batchManagementClient.js"; -import { - SimplePollerLike, - OperationState, - createHttpPoller, -} from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import { - BatchAccount, - BatchAccountListNextOptionalParams, - BatchAccountListOptionalParams, - BatchAccountListResponse, - BatchAccountListByResourceGroupNextOptionalParams, - BatchAccountListByResourceGroupOptionalParams, - BatchAccountListByResourceGroupResponse, - DetectorResponse, - BatchAccountListDetectorsNextOptionalParams, - BatchAccountListDetectorsOptionalParams, - BatchAccountListDetectorsResponse, - OutboundEnvironmentEndpoint, - BatchAccountListOutboundNetworkDependenciesEndpointsNextOptionalParams, - BatchAccountListOutboundNetworkDependenciesEndpointsOptionalParams, - BatchAccountListOutboundNetworkDependenciesEndpointsResponse, - BatchAccountCreateParameters, - BatchAccountCreateOptionalParams, - BatchAccountCreateResponse, - BatchAccountUpdateParameters, - BatchAccountUpdateOptionalParams, - BatchAccountUpdateResponse, - BatchAccountDeleteOptionalParams, - BatchAccountGetOptionalParams, - BatchAccountGetResponse, - BatchAccountSynchronizeAutoStorageKeysOptionalParams, - BatchAccountRegenerateKeyParameters, - BatchAccountRegenerateKeyOptionalParams, - BatchAccountRegenerateKeyResponse, - BatchAccountGetKeysOptionalParams, - BatchAccountGetKeysResponse, - BatchAccountGetDetectorOptionalParams, - BatchAccountGetDetectorResponse, - BatchAccountListNextResponse, - BatchAccountListByResourceGroupNextResponse, - BatchAccountListDetectorsNextResponse, - BatchAccountListOutboundNetworkDependenciesEndpointsNextResponse, -} from "../models/index.js"; - -/// -/** Class containing BatchAccountOperations operations. */ -export class BatchAccountOperationsImpl implements BatchAccountOperations { - private readonly client: BatchManagementClient; - - /** - * Initialize a new instance of the class BatchAccountOperations class. - * @param client Reference to the service client - */ - constructor(client: BatchManagementClient) { - this.client = client; - } - - /** - * Gets information about the Batch accounts associated with the subscription. - * @param options The options parameters. - */ - public list( - options?: BatchAccountListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage(options, settings); - }, - }; - } - - private async *listPagingPage( - options?: BatchAccountListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: BatchAccountListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext(continuationToken, options); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - options?: BatchAccountListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { - yield* page; - } - } - - /** - * Gets information about the Batch accounts associated with the specified resource group. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param options The options parameters. - */ - public listByResourceGroup( - resourceGroupName: string, - options?: BatchAccountListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByResourceGroupPagingPage( - resourceGroupName, - options, - settings, - ); - }, - }; - } - - private async *listByResourceGroupPagingPage( - resourceGroupName: string, - options?: BatchAccountListByResourceGroupOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: BatchAccountListByResourceGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByResourceGroup(resourceGroupName, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByResourceGroupNext( - resourceGroupName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByResourceGroupPagingAll( - resourceGroupName: string, - options?: BatchAccountListByResourceGroupOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByResourceGroupPagingPage( - resourceGroupName, - options, - )) { - yield* page; - } - } - - /** - * Gets information about the detectors available for a given Batch account. - * @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. - */ - public listDetectors( - resourceGroupName: string, - accountName: string, - options?: BatchAccountListDetectorsOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listDetectorsPagingAll( - resourceGroupName, - accountName, - options, - ); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listDetectorsPagingPage( - resourceGroupName, - accountName, - options, - settings, - ); - }, - }; - } - - private async *listDetectorsPagingPage( - resourceGroupName: string, - accountName: string, - options?: BatchAccountListDetectorsOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: BatchAccountListDetectorsResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listDetectors( - resourceGroupName, - accountName, - options, - ); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listDetectorsNext( - resourceGroupName, - accountName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listDetectorsPagingAll( - resourceGroupName: string, - accountName: string, - options?: BatchAccountListDetectorsOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listDetectorsPagingPage( - resourceGroupName, - accountName, - options, - )) { - yield* page; - } - } - - /** - * 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. - * @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. - */ - public listOutboundNetworkDependenciesEndpoints( - resourceGroupName: string, - accountName: string, - options?: BatchAccountListOutboundNetworkDependenciesEndpointsOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listOutboundNetworkDependenciesEndpointsPagingAll( - resourceGroupName, - accountName, - options, - ); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listOutboundNetworkDependenciesEndpointsPagingPage( - resourceGroupName, - accountName, - options, - settings, - ); - }, - }; - } - - private async *listOutboundNetworkDependenciesEndpointsPagingPage( - resourceGroupName: string, - accountName: string, - options?: BatchAccountListOutboundNetworkDependenciesEndpointsOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: BatchAccountListOutboundNetworkDependenciesEndpointsResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listOutboundNetworkDependenciesEndpoints( - resourceGroupName, - accountName, - options, - ); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listOutboundNetworkDependenciesEndpointsNext( - resourceGroupName, - accountName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listOutboundNetworkDependenciesEndpointsPagingAll( - resourceGroupName: string, - accountName: string, - options?: BatchAccountListOutboundNetworkDependenciesEndpointsOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listOutboundNetworkDependenciesEndpointsPagingPage( - resourceGroupName, - accountName, - options, - )) { - yield* page; - } - } - - /** - * 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. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName A name for the Batch account which must be unique within the region. Batch - * account names must be between 3 and 24 characters in length and must use only numbers and lowercase - * letters. This name is used as part of the DNS name that is used to access the Batch service in the - * region in which the account is created. For example: http://accountname.region.batch.azure.com/. - * @param parameters Additional parameters for account creation. - * @param options The options parameters. - */ - async beginCreate( - resourceGroupName: string, - accountName: string, - parameters: BatchAccountCreateParameters, - options?: BatchAccountCreateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - BatchAccountCreateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = - undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, accountName, parameters, options }, - spec: createOperationSpec, - }); - const poller = await createHttpPoller< - BatchAccountCreateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * 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. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName A name for the Batch account which must be unique within the region. Batch - * account names must be between 3 and 24 characters in length and must use only numbers and lowercase - * letters. This name is used as part of the DNS name that is used to access the Batch service in the - * region in which the account is created. For example: http://accountname.region.batch.azure.com/. - * @param parameters Additional parameters for account creation. - * @param options The options parameters. - */ - async beginCreateAndWait( - resourceGroupName: string, - accountName: string, - parameters: BatchAccountCreateParameters, - options?: BatchAccountCreateOptionalParams, - ): Promise { - const poller = await this.beginCreate( - resourceGroupName, - accountName, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Updates the properties of an existing Batch account. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param parameters Additional parameters for account update. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - accountName: string, - parameters: BatchAccountUpdateParameters, - options?: BatchAccountUpdateOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, accountName, parameters, options }, - updateOperationSpec, - ); - } - - /** - * Deletes the specified Batch account. - * @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. - */ - async beginDelete( - resourceGroupName: string, - accountName: string, - options?: BatchAccountDeleteOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = - undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, accountName, options }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Deletes the specified Batch account. - * @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. - */ - async beginDeleteAndWait( - resourceGroupName: string, - accountName: string, - options?: BatchAccountDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete( - resourceGroupName, - accountName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Gets information about the specified Batch account. - * @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. - */ - get( - resourceGroupName: string, - accountName: string, - options?: BatchAccountGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, accountName, options }, - getOperationSpec, - ); - } - - /** - * Gets information about the Batch accounts associated with the subscription. - * @param options The options parameters. - */ - private _list( - options?: BatchAccountListOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); - } - - /** - * Gets information about the Batch accounts associated with the specified resource group. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param options The options parameters. - */ - private _listByResourceGroup( - resourceGroupName: string, - options?: BatchAccountListByResourceGroupOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, options }, - listByResourceGroupOperationSpec, - ); - } - - /** - * Synchronizes access keys for the auto-storage account configured for the specified Batch account, - * only if storage key authentication is being used. - * @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. - */ - synchronizeAutoStorageKeys( - resourceGroupName: string, - accountName: string, - options?: BatchAccountSynchronizeAutoStorageKeysOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, accountName, options }, - synchronizeAutoStorageKeysOperationSpec, - ); - } - - /** - * 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. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param parameters The type of key to regenerate. - * @param options The options parameters. - */ - regenerateKey( - resourceGroupName: string, - accountName: string, - parameters: BatchAccountRegenerateKeyParameters, - options?: BatchAccountRegenerateKeyOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, accountName, parameters, options }, - regenerateKeyOperationSpec, - ); - } - - /** - * 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. - * @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. - */ - getKeys( - resourceGroupName: string, - accountName: string, - options?: BatchAccountGetKeysOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, accountName, options }, - getKeysOperationSpec, - ); - } - - /** - * Gets information about the detectors available for a given Batch account. - * @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. - */ - private _listDetectors( - resourceGroupName: string, - accountName: string, - options?: BatchAccountListDetectorsOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, accountName, options }, - listDetectorsOperationSpec, - ); - } - - /** - * Gets information about the given detector for a given Batch account. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param detectorId The name of the detector. - * @param options The options parameters. - */ - getDetector( - resourceGroupName: string, - accountName: string, - detectorId: string, - options?: BatchAccountGetDetectorOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, accountName, detectorId, options }, - getDetectorOperationSpec, - ); - } - - /** - * 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. - * @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. - */ - private _listOutboundNetworkDependenciesEndpoints( - resourceGroupName: string, - accountName: string, - options?: BatchAccountListOutboundNetworkDependenciesEndpointsOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, accountName, options }, - listOutboundNetworkDependenciesEndpointsOperationSpec, - ); - } - - /** - * ListNext - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - nextLink: string, - options?: BatchAccountListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listNextOperationSpec, - ); - } - - /** - * ListByResourceGroupNext - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. - * @param options The options parameters. - */ - private _listByResourceGroupNext( - resourceGroupName: string, - nextLink: string, - options?: BatchAccountListByResourceGroupNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, nextLink, options }, - listByResourceGroupNextOperationSpec, - ); - } - - /** - * ListDetectorsNext - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param nextLink The nextLink from the previous successful call to the ListDetectors method. - * @param options The options parameters. - */ - private _listDetectorsNext( - resourceGroupName: string, - accountName: string, - nextLink: string, - options?: BatchAccountListDetectorsNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, accountName, nextLink, options }, - listDetectorsNextOperationSpec, - ); - } - - /** - * ListOutboundNetworkDependenciesEndpointsNext - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param nextLink The nextLink from the previous successful call to the - * ListOutboundNetworkDependenciesEndpoints method. - * @param options The options parameters. - */ - private _listOutboundNetworkDependenciesEndpointsNext( - resourceGroupName: string, - accountName: string, - nextLink: string, - options?: BatchAccountListOutboundNetworkDependenciesEndpointsNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, accountName, nextLink, options }, - listOutboundNetworkDependenciesEndpointsNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const createOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.BatchAccount, - }, - 201: { - bodyMapper: Mappers.BatchAccount, - }, - 202: { - bodyMapper: Mappers.BatchAccount, - }, - 204: { - bodyMapper: Mappers.BatchAccount, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.accountName, - Parameters.subscriptionId, - ], - headerParameters: [Parameters.contentType, Parameters.accept], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.BatchAccount, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters1, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - ], - headerParameters: [Parameters.contentType, Parameters.accept], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.BatchAccount, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Batch/batchAccounts", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.BatchAccountListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; -const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.BatchAccountListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const synchronizeAutoStorageKeysOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/syncAutoStorageKeys", - httpMethod: "POST", - responses: { - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const regenerateKeyOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/regenerateKeys", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.BatchAccountKeys, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters2, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - ], - headerParameters: [Parameters.contentType, Parameters.accept], - mediaType: "json", - serializer, -}; -const getKeysOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/listKeys", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.BatchAccountKeys, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listDetectorsOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/detectors", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DetectorListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getDetectorOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/detectors/{detectorId}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DetectorResponse, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - Parameters.detectorId, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listOutboundNetworkDependenciesEndpointsOperationSpec: coreClient.OperationSpec = -{ - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/outboundNetworkDependenciesEndpoints", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.OutboundEnvironmentEndpointCollection, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.BatchAccountListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.nextLink, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.BatchAccountListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.nextLink, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listDetectorsNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.DetectorListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - Parameters.nextLink, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listOutboundNetworkDependenciesEndpointsNextOperationSpec: coreClient.OperationSpec = -{ - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.OutboundEnvironmentEndpointCollection, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - Parameters.nextLink, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/batch/arm-batch/src/operations/certificateOperations.ts b/sdk/batch/arm-batch/src/operations/certificateOperations.ts deleted file mode 100644 index cfbfd9f60aa8..000000000000 --- a/sdk/batch/arm-batch/src/operations/certificateOperations.ts +++ /dev/null @@ -1,552 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import { CertificateOperations } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { BatchManagementClient } from "../batchManagementClient.js"; -import { - SimplePollerLike, - OperationState, - createHttpPoller, -} from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import { - Certificate, - CertificateListByBatchAccountNextOptionalParams, - CertificateListByBatchAccountOptionalParams, - CertificateListByBatchAccountResponse, - CertificateCreateOrUpdateParameters, - CertificateCreateOptionalParams, - CertificateCreateResponse, - CertificateUpdateOptionalParams, - CertificateUpdateResponse, - CertificateDeleteOptionalParams, - CertificateGetOptionalParams, - CertificateGetResponse, - CertificateCancelDeletionOptionalParams, - CertificateCancelDeletionResponse, - CertificateListByBatchAccountNextResponse, -} from "../models/index.js"; - -/// -/** Class containing CertificateOperations operations. */ -export class CertificateOperationsImpl implements CertificateOperations { - private readonly client: BatchManagementClient; - - /** - * Initialize a new instance of the class CertificateOperations class. - * @param client Reference to the service client - */ - constructor(client: BatchManagementClient) { - this.client = client; - } - - /** - * 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. - * @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. - */ - public listByBatchAccount( - resourceGroupName: string, - accountName: string, - options?: CertificateListByBatchAccountOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByBatchAccountPagingAll( - resourceGroupName, - accountName, - options, - ); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByBatchAccountPagingPage( - resourceGroupName, - accountName, - options, - settings, - ); - }, - }; - } - - private async *listByBatchAccountPagingPage( - resourceGroupName: string, - accountName: string, - options?: CertificateListByBatchAccountOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: CertificateListByBatchAccountResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByBatchAccount( - resourceGroupName, - accountName, - options, - ); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByBatchAccountNext( - resourceGroupName, - accountName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByBatchAccountPagingAll( - resourceGroupName: string, - accountName: string, - options?: CertificateListByBatchAccountOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByBatchAccountPagingPage( - resourceGroupName, - accountName, - options, - )) { - yield* page; - } - } - - /** - * 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. - * @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. - */ - private _listByBatchAccount( - resourceGroupName: string, - accountName: string, - options?: CertificateListByBatchAccountOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, accountName, options }, - listByBatchAccountOperationSpec, - ); - } - - /** - * 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. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param certificateName The identifier for the certificate. This must be made up of algorithm and - * thumbprint separated by a dash, and must match the certificate data in the request. For example - * SHA1-a3d1c5. - * @param parameters Additional parameters for certificate creation. - * @param options The options parameters. - */ - create( - resourceGroupName: string, - accountName: string, - certificateName: string, - parameters: CertificateCreateOrUpdateParameters, - options?: CertificateCreateOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, accountName, certificateName, parameters, options }, - createOperationSpec, - ); - } - - /** - * 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. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param certificateName The identifier for the certificate. This must be made up of algorithm and - * thumbprint separated by a dash, and must match the certificate data in the request. For example - * SHA1-a3d1c5. - * @param parameters Certificate entity to update. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - accountName: string, - certificateName: string, - parameters: CertificateCreateOrUpdateParameters, - options?: CertificateUpdateOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, accountName, certificateName, parameters, options }, - updateOperationSpec, - ); - } - - /** - * 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. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param certificateName The identifier for the certificate. This must be made up of algorithm and - * thumbprint separated by a dash, and must match the certificate data in the request. For example - * SHA1-a3d1c5. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - accountName: string, - certificateName: string, - options?: CertificateDeleteOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = - undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, accountName, certificateName, options }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * 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. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param certificateName The identifier for the certificate. This must be made up of algorithm and - * thumbprint separated by a dash, and must match the certificate data in the request. For example - * SHA1-a3d1c5. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - accountName: string, - certificateName: string, - options?: CertificateDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete( - resourceGroupName, - accountName, - certificateName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * 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. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param certificateName The identifier for the certificate. This must be made up of algorithm and - * thumbprint separated by a dash, and must match the certificate data in the request. For example - * SHA1-a3d1c5. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - accountName: string, - certificateName: string, - options?: CertificateGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, accountName, certificateName, options }, - getOperationSpec, - ); - } - - /** - * 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. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param certificateName The identifier for the certificate. This must be made up of algorithm and - * thumbprint separated by a dash, and must match the certificate data in the request. For example - * SHA1-a3d1c5. - * @param options The options parameters. - */ - cancelDeletion( - resourceGroupName: string, - accountName: string, - certificateName: string, - options?: CertificateCancelDeletionOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, accountName, certificateName, options }, - cancelDeletionOperationSpec, - ); - } - - /** - * ListByBatchAccountNext - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param nextLink The nextLink from the previous successful call to the ListByBatchAccount method. - * @param options The options parameters. - */ - private _listByBatchAccountNext( - resourceGroupName: string, - accountName: string, - nextLink: string, - options?: CertificateListByBatchAccountNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, accountName, nextLink, options }, - listByBatchAccountNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listByBatchAccountOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ListCertificatesResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [ - Parameters.apiVersion, - Parameters.maxresults, - Parameters.filter, - Parameters.select, - ], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates/{certificateName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.Certificate, - headersMapper: Mappers.CertificateCreateHeaders, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters8, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - Parameters.certificateName, - ], - headerParameters: [ - Parameters.contentType, - Parameters.accept, - Parameters.ifMatch, - Parameters.ifNoneMatch, - ], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates/{certificateName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.Certificate, - headersMapper: Mappers.CertificateUpdateHeaders, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters8, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - Parameters.certificateName, - ], - headerParameters: [ - Parameters.contentType, - Parameters.accept, - Parameters.ifMatch, - ], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates/{certificateName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - Parameters.certificateName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates/{certificateName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.Certificate, - headersMapper: Mappers.CertificateGetHeaders, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - Parameters.certificateName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const cancelDeletionOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates/{certificateName}/cancelDelete", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.Certificate, - headersMapper: Mappers.CertificateCancelDeletionHeaders, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - Parameters.certificateName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByBatchAccountNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ListCertificatesResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - Parameters.nextLink, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/batch/arm-batch/src/operations/index.ts b/sdk/batch/arm-batch/src/operations/index.ts deleted file mode 100644 index 1ed08c05a609..000000000000 --- a/sdk/batch/arm-batch/src/operations/index.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export * from "./batchAccountOperations.js"; -export * from "./applicationPackageOperations.js"; -export * from "./applicationOperations.js"; -export * from "./location.js"; -export * from "./operations.js"; -export * from "./certificateOperations.js"; -export * from "./privateLinkResourceOperations.js"; -export * from "./privateEndpointConnectionOperations.js"; -export * from "./poolOperations.js"; -export * from "./networkSecurityPerimeterOperations.js"; diff --git a/sdk/batch/arm-batch/src/operations/location.ts b/sdk/batch/arm-batch/src/operations/location.ts deleted file mode 100644 index b5e52f1f63a4..000000000000 --- a/sdk/batch/arm-batch/src/operations/location.ts +++ /dev/null @@ -1,271 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import { Location } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { BatchManagementClient } from "../batchManagementClient.js"; -import { - SupportedSku, - LocationListSupportedVirtualMachineSkusNextOptionalParams, - LocationListSupportedVirtualMachineSkusOptionalParams, - LocationListSupportedVirtualMachineSkusResponse, - LocationGetQuotasOptionalParams, - LocationGetQuotasResponse, - CheckNameAvailabilityParameters, - LocationCheckNameAvailabilityOptionalParams, - LocationCheckNameAvailabilityResponse, - LocationListSupportedVirtualMachineSkusNextResponse, -} from "../models/index.js"; - -/// -/** Class containing Location operations. */ -export class LocationImpl implements Location { - private readonly client: BatchManagementClient; - - /** - * Initialize a new instance of the class Location class. - * @param client Reference to the service client - */ - constructor(client: BatchManagementClient) { - this.client = client; - } - - /** - * Gets the list of Batch supported Virtual Machine VM sizes available at the given location. - * @param locationName The region for which to retrieve Batch service supported SKUs. - * @param options The options parameters. - */ - public listSupportedVirtualMachineSkus( - locationName: string, - options?: LocationListSupportedVirtualMachineSkusOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listSupportedVirtualMachineSkusPagingAll( - locationName, - options, - ); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listSupportedVirtualMachineSkusPagingPage( - locationName, - options, - settings, - ); - }, - }; - } - - private async *listSupportedVirtualMachineSkusPagingPage( - locationName: string, - options?: LocationListSupportedVirtualMachineSkusOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: LocationListSupportedVirtualMachineSkusResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listSupportedVirtualMachineSkus( - locationName, - options, - ); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listSupportedVirtualMachineSkusNext( - locationName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listSupportedVirtualMachineSkusPagingAll( - locationName: string, - options?: LocationListSupportedVirtualMachineSkusOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listSupportedVirtualMachineSkusPagingPage( - locationName, - options, - )) { - yield* page; - } - } - - /** - * Gets the Batch service quotas for the specified subscription at the given location. - * @param locationName The region for which to retrieve Batch service quotas. - * @param options The options parameters. - */ - getQuotas( - locationName: string, - options?: LocationGetQuotasOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { locationName, options }, - getQuotasOperationSpec, - ); - } - - /** - * Gets the list of Batch supported Virtual Machine VM sizes available at the given location. - * @param locationName The region for which to retrieve Batch service supported SKUs. - * @param options The options parameters. - */ - private _listSupportedVirtualMachineSkus( - locationName: string, - options?: LocationListSupportedVirtualMachineSkusOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { locationName, options }, - listSupportedVirtualMachineSkusOperationSpec, - ); - } - - /** - * Checks whether the Batch account name is available in the specified region. - * @param locationName The desired region for the name check. - * @param parameters Properties needed to check the availability of a name. - * @param options The options parameters. - */ - checkNameAvailability( - locationName: string, - parameters: CheckNameAvailabilityParameters, - options?: LocationCheckNameAvailabilityOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { locationName, parameters, options }, - checkNameAvailabilityOperationSpec, - ); - } - - /** - * ListSupportedVirtualMachineSkusNext - * @param locationName The region for which to retrieve Batch service supported SKUs. - * @param nextLink The nextLink from the previous successful call to the - * ListSupportedVirtualMachineSkus method. - * @param options The options parameters. - */ - private _listSupportedVirtualMachineSkusNext( - locationName: string, - nextLink: string, - options?: LocationListSupportedVirtualMachineSkusNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { locationName, nextLink, options }, - listSupportedVirtualMachineSkusNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const getQuotasOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Batch/locations/{locationName}/quotas", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.BatchLocationQuota, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.locationName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listSupportedVirtualMachineSkusOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Batch/locations/{locationName}/virtualMachineSkus", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.SupportedSkusResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [ - Parameters.apiVersion, - Parameters.maxresults, - Parameters.filter, - ], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.locationName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const checkNameAvailabilityOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Batch/locations/{locationName}/checkNameAvailability", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.CheckNameAvailabilityResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters7, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.locationName, - ], - headerParameters: [Parameters.contentType, Parameters.accept], - mediaType: "json", - serializer, -}; -const listSupportedVirtualMachineSkusNextOperationSpec: coreClient.OperationSpec = - { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.SupportedSkusResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.nextLink, - Parameters.locationName, - ], - headerParameters: [Parameters.accept], - serializer, - }; diff --git a/sdk/batch/arm-batch/src/operations/networkSecurityPerimeterOperations.ts b/sdk/batch/arm-batch/src/operations/networkSecurityPerimeterOperations.ts deleted file mode 100644 index 8701db592a2a..000000000000 --- a/sdk/batch/arm-batch/src/operations/networkSecurityPerimeterOperations.ts +++ /dev/null @@ -1,397 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import { NetworkSecurityPerimeterOperations } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { BatchManagementClient } from "../batchManagementClient.js"; -import { - SimplePollerLike, - OperationState, - createHttpPoller, -} from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import { - NetworkSecurityPerimeterConfiguration, - NetworkSecurityPerimeterListConfigurationsNextOptionalParams, - NetworkSecurityPerimeterListConfigurationsOptionalParams, - NetworkSecurityPerimeterListConfigurationsResponse, - NetworkSecurityPerimeterGetConfigurationOptionalParams, - NetworkSecurityPerimeterGetConfigurationResponse, - NetworkSecurityPerimeterReconcileConfigurationOptionalParams, - NetworkSecurityPerimeterReconcileConfigurationResponse, - NetworkSecurityPerimeterListConfigurationsNextResponse, -} from "../models/index.js"; - -/// -/** Class containing NetworkSecurityPerimeterOperations operations. */ -export class NetworkSecurityPerimeterOperationsImpl - implements NetworkSecurityPerimeterOperations -{ - private readonly client: BatchManagementClient; - - /** - * Initialize a new instance of the class NetworkSecurityPerimeterOperations class. - * @param client Reference to the service client - */ - constructor(client: BatchManagementClient) { - this.client = client; - } - - /** - * Lists all of the NSP configurations in the specified account. - * @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. - */ - public listConfigurations( - resourceGroupName: string, - accountName: string, - options?: NetworkSecurityPerimeterListConfigurationsOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listConfigurationsPagingAll( - resourceGroupName, - accountName, - options, - ); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listConfigurationsPagingPage( - resourceGroupName, - accountName, - options, - settings, - ); - }, - }; - } - - private async *listConfigurationsPagingPage( - resourceGroupName: string, - accountName: string, - options?: NetworkSecurityPerimeterListConfigurationsOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: NetworkSecurityPerimeterListConfigurationsResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listConfigurations( - resourceGroupName, - accountName, - options, - ); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listConfigurationsNext( - resourceGroupName, - accountName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listConfigurationsPagingAll( - resourceGroupName: string, - accountName: string, - options?: NetworkSecurityPerimeterListConfigurationsOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listConfigurationsPagingPage( - resourceGroupName, - accountName, - options, - )) { - yield* page; - } - } - - /** - * Lists all of the NSP configurations in the specified account. - * @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. - */ - private _listConfigurations( - resourceGroupName: string, - accountName: string, - options?: NetworkSecurityPerimeterListConfigurationsOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, accountName, options }, - listConfigurationsOperationSpec, - ); - } - - /** - * Gets information about the specified NSP configuration. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter - * configuration - * @param options The options parameters. - */ - getConfiguration( - resourceGroupName: string, - accountName: string, - networkSecurityPerimeterConfigurationName: string, - options?: NetworkSecurityPerimeterGetConfigurationOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - accountName, - networkSecurityPerimeterConfigurationName, - options, - }, - getConfigurationOperationSpec, - ); - } - - /** - * Reconciles the specified NSP configuration. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter - * configuration - * @param options The options parameters. - */ - async beginReconcileConfiguration( - resourceGroupName: string, - accountName: string, - networkSecurityPerimeterConfigurationName: string, - options?: NetworkSecurityPerimeterReconcileConfigurationOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - NetworkSecurityPerimeterReconcileConfigurationResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = - undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - accountName, - networkSecurityPerimeterConfigurationName, - options, - }, - spec: reconcileConfigurationOperationSpec, - }); - const poller = await createHttpPoller< - NetworkSecurityPerimeterReconcileConfigurationResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Reconciles the specified NSP configuration. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter - * configuration - * @param options The options parameters. - */ - async beginReconcileConfigurationAndWait( - resourceGroupName: string, - accountName: string, - networkSecurityPerimeterConfigurationName: string, - options?: NetworkSecurityPerimeterReconcileConfigurationOptionalParams, - ): Promise { - const poller = await this.beginReconcileConfiguration( - resourceGroupName, - accountName, - networkSecurityPerimeterConfigurationName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * ListConfigurationsNext - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param nextLink The nextLink from the previous successful call to the ListConfigurations method. - * @param options The options parameters. - */ - private _listConfigurationsNext( - resourceGroupName: string, - accountName: string, - nextLink: string, - options?: NetworkSecurityPerimeterListConfigurationsNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, accountName, nextLink, options }, - listConfigurationsNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listConfigurationsOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/networkSecurityPerimeterConfigurations", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.NetworkSecurityPerimeterConfigurationListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getConfigurationOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.NetworkSecurityPerimeterConfiguration, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - Parameters.networkSecurityPerimeterConfigurationName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const reconcileConfigurationOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}/reconcile", - httpMethod: "POST", - responses: { - 200: { - headersMapper: - Mappers.NetworkSecurityPerimeterReconcileConfigurationHeaders, - }, - 201: { - headersMapper: - Mappers.NetworkSecurityPerimeterReconcileConfigurationHeaders, - }, - 202: { - headersMapper: - Mappers.NetworkSecurityPerimeterReconcileConfigurationHeaders, - }, - 204: { - headersMapper: - Mappers.NetworkSecurityPerimeterReconcileConfigurationHeaders, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - Parameters.networkSecurityPerimeterConfigurationName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listConfigurationsNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.NetworkSecurityPerimeterConfigurationListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - Parameters.nextLink, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/batch/arm-batch/src/operations/operations.ts b/sdk/batch/arm-batch/src/operations/operations.ts deleted file mode 100644 index e88bbde3a59d..000000000000 --- a/sdk/batch/arm-batch/src/operations/operations.ts +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import { Operations } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { BatchManagementClient } from "../batchManagementClient.js"; -import { - Operation, - OperationsListNextOptionalParams, - OperationsListOptionalParams, - OperationsListResponse, - OperationsListNextResponse, -} from "../models/index.js"; - -/// -/** Class containing Operations operations. */ -export class OperationsImpl implements Operations { - private readonly client: BatchManagementClient; - - /** - * Initialize a new instance of the class Operations class. - * @param client Reference to the service client - */ - constructor(client: BatchManagementClient) { - this.client = client; - } - - /** - * Lists available operations for the Microsoft.Batch provider - * @param options The options parameters. - */ - public list( - options?: OperationsListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage(options, settings); - }, - }; - } - - private async *listPagingPage( - options?: OperationsListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: OperationsListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext(continuationToken, options); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - options?: OperationsListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { - yield* page; - } - } - - /** - * Lists available operations for the Microsoft.Batch provider - * @param options The options parameters. - */ - private _list( - options?: OperationsListOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); - } - - /** - * ListNext - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - nextLink: string, - options?: OperationsListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Batch/operations", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.OperationListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host], - headerParameters: [Parameters.accept], - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.OperationListResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - 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 deleted file mode 100644 index 642c6acb2fdb..000000000000 --- a/sdk/batch/arm-batch/src/operations/poolOperations.ts +++ /dev/null @@ -1,566 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import { PoolOperations } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { BatchManagementClient } from "../batchManagementClient.js"; -import { - SimplePollerLike, - OperationState, - createHttpPoller, -} from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import { - Pool, - PoolListByBatchAccountNextOptionalParams, - PoolListByBatchAccountOptionalParams, - PoolListByBatchAccountResponse, - PoolCreateOptionalParams, - PoolCreateResponse, - PoolUpdateOptionalParams, - PoolUpdateResponse, - PoolDeleteOptionalParams, - PoolGetOptionalParams, - PoolGetResponse, - PoolDisableAutoScaleOptionalParams, - PoolDisableAutoScaleResponse, - PoolStopResizeOptionalParams, - PoolStopResizeResponse, - PoolListByBatchAccountNextResponse, -} from "../models/index.js"; - -/// -/** Class containing PoolOperations operations. */ -export class PoolOperationsImpl implements PoolOperations { - private readonly client: BatchManagementClient; - - /** - * Initialize a new instance of the class PoolOperations class. - * @param client Reference to the service client - */ - constructor(client: BatchManagementClient) { - this.client = client; - } - - /** - * Lists all of the pools in the specified account. - * @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. - */ - public listByBatchAccount( - resourceGroupName: string, - accountName: string, - options?: PoolListByBatchAccountOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByBatchAccountPagingAll( - resourceGroupName, - accountName, - options, - ); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByBatchAccountPagingPage( - resourceGroupName, - accountName, - options, - settings, - ); - }, - }; - } - - private async *listByBatchAccountPagingPage( - resourceGroupName: string, - accountName: string, - options?: PoolListByBatchAccountOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: PoolListByBatchAccountResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByBatchAccount( - resourceGroupName, - accountName, - options, - ); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByBatchAccountNext( - resourceGroupName, - accountName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByBatchAccountPagingAll( - resourceGroupName: string, - accountName: string, - options?: PoolListByBatchAccountOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByBatchAccountPagingPage( - resourceGroupName, - accountName, - options, - )) { - yield* page; - } - } - - /** - * Lists all of the pools in the specified account. - * @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. - */ - private _listByBatchAccount( - resourceGroupName: string, - accountName: string, - options?: PoolListByBatchAccountOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, accountName, options }, - listByBatchAccountOperationSpec, - ); - } - - /** - * Creates a new pool inside the specified account. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param poolName The pool name. This must be unique within the account. - * @param parameters Additional parameters for pool creation. - * @param options The options parameters. - */ - create( - resourceGroupName: string, - accountName: string, - poolName: string, - parameters: Pool, - options?: PoolCreateOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, accountName, poolName, parameters, options }, - createOperationSpec, - ); - } - - /** - * Updates the properties of an existing pool. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param poolName The pool name. This must be unique within the account. - * @param parameters Pool properties that should be updated. Properties that are supplied will be - * updated, any property not supplied will be unchanged. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - accountName: string, - poolName: string, - parameters: Pool, - options?: PoolUpdateOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, accountName, poolName, parameters, options }, - updateOperationSpec, - ); - } - - /** - * Deletes the specified pool. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param poolName The pool name. This must be unique within the account. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - accountName: string, - poolName: string, - options?: PoolDeleteOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = - undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, accountName, poolName, options }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Deletes the specified pool. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param poolName The pool name. This must be unique within the account. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - accountName: string, - poolName: string, - options?: PoolDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete( - resourceGroupName, - accountName, - poolName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Gets information about the specified pool. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param poolName The pool name. This must be unique within the account. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - accountName: string, - poolName: string, - options?: PoolGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, accountName, poolName, options }, - getOperationSpec, - ); - } - - /** - * Disables automatic scaling for a pool. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param poolName The pool name. This must be unique within the account. - * @param options The options parameters. - */ - disableAutoScale( - resourceGroupName: string, - accountName: string, - poolName: string, - options?: PoolDisableAutoScaleOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, accountName, poolName, options }, - disableAutoScaleOperationSpec, - ); - } - - /** - * 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. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param poolName The pool name. This must be unique within the account. - * @param options The options parameters. - */ - stopResize( - resourceGroupName: string, - accountName: string, - poolName: string, - options?: PoolStopResizeOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, accountName, poolName, options }, - stopResizeOperationSpec, - ); - } - - /** - * ListByBatchAccountNext - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param nextLink The nextLink from the previous successful call to the ListByBatchAccount method. - * @param options The options parameters. - */ - private _listByBatchAccountNext( - resourceGroupName: string, - accountName: string, - nextLink: string, - options?: PoolListByBatchAccountNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, accountName, nextLink, options }, - listByBatchAccountNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listByBatchAccountOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ListPoolsResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [ - Parameters.apiVersion, - Parameters.maxresults, - Parameters.filter, - Parameters.select, - ], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.Pool, - headersMapper: Mappers.PoolCreateHeaders, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters10, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - Parameters.poolName, - ], - headerParameters: [ - Parameters.contentType, - Parameters.accept, - Parameters.ifMatch, - Parameters.ifNoneMatch, - ], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.Pool, - headersMapper: Mappers.PoolUpdateHeaders, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters10, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - Parameters.poolName, - ], - headerParameters: [ - Parameters.contentType, - Parameters.accept, - Parameters.ifMatch, - ], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - Parameters.poolName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.Pool, - headersMapper: Mappers.PoolGetHeaders, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - Parameters.poolName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const disableAutoScaleOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName}/disableAutoScale", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.Pool, - headersMapper: Mappers.PoolDisableAutoScaleHeaders, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - Parameters.poolName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const stopResizeOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName}/stopResize", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.Pool, - headersMapper: Mappers.PoolStopResizeHeaders, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - Parameters.poolName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByBatchAccountNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ListPoolsResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - Parameters.nextLink, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/batch/arm-batch/src/operations/privateEndpointConnectionOperations.ts b/sdk/batch/arm-batch/src/operations/privateEndpointConnectionOperations.ts deleted file mode 100644 index 961e65d8c27d..000000000000 --- a/sdk/batch/arm-batch/src/operations/privateEndpointConnectionOperations.ts +++ /dev/null @@ -1,542 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import { PrivateEndpointConnectionOperations } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { BatchManagementClient } from "../batchManagementClient.js"; -import { - SimplePollerLike, - OperationState, - createHttpPoller, -} from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import { - PrivateEndpointConnection, - PrivateEndpointConnectionListByBatchAccountNextOptionalParams, - PrivateEndpointConnectionListByBatchAccountOptionalParams, - PrivateEndpointConnectionListByBatchAccountResponse, - PrivateEndpointConnectionGetOptionalParams, - PrivateEndpointConnectionGetResponse, - PrivateEndpointConnectionUpdateOptionalParams, - PrivateEndpointConnectionUpdateResponse, - PrivateEndpointConnectionDeleteOptionalParams, - PrivateEndpointConnectionDeleteResponse, - PrivateEndpointConnectionListByBatchAccountNextResponse, -} from "../models/index.js"; - -/// -/** Class containing PrivateEndpointConnectionOperations operations. */ -export class PrivateEndpointConnectionOperationsImpl - implements PrivateEndpointConnectionOperations -{ - private readonly client: BatchManagementClient; - - /** - * Initialize a new instance of the class PrivateEndpointConnectionOperations class. - * @param client Reference to the service client - */ - constructor(client: BatchManagementClient) { - this.client = client; - } - - /** - * Lists all of the private endpoint connections in the specified account. - * @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. - */ - public listByBatchAccount( - resourceGroupName: string, - accountName: string, - options?: PrivateEndpointConnectionListByBatchAccountOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByBatchAccountPagingAll( - resourceGroupName, - accountName, - options, - ); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByBatchAccountPagingPage( - resourceGroupName, - accountName, - options, - settings, - ); - }, - }; - } - - private async *listByBatchAccountPagingPage( - resourceGroupName: string, - accountName: string, - options?: PrivateEndpointConnectionListByBatchAccountOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: PrivateEndpointConnectionListByBatchAccountResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByBatchAccount( - resourceGroupName, - accountName, - options, - ); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByBatchAccountNext( - resourceGroupName, - accountName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByBatchAccountPagingAll( - resourceGroupName: string, - accountName: string, - options?: PrivateEndpointConnectionListByBatchAccountOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByBatchAccountPagingPage( - resourceGroupName, - accountName, - options, - )) { - yield* page; - } - } - - /** - * Lists all of the private endpoint connections in the specified account. - * @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. - */ - private _listByBatchAccount( - resourceGroupName: string, - accountName: string, - options?: PrivateEndpointConnectionListByBatchAccountOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, accountName, options }, - listByBatchAccountOperationSpec, - ); - } - - /** - * Gets information about the specified private endpoint connection. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param privateEndpointConnectionName The private endpoint connection name. This must be unique - * within the account. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - accountName: string, - privateEndpointConnectionName: string, - options?: PrivateEndpointConnectionGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { - resourceGroupName, - accountName, - privateEndpointConnectionName, - options, - }, - getOperationSpec, - ); - } - - /** - * Updates the properties of an existing private endpoint connection. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param privateEndpointConnectionName The private endpoint connection name. This must be unique - * within the account. - * @param parameters PrivateEndpointConnection properties that should be updated. Properties that are - * supplied will be updated, any property not supplied will be unchanged. - * @param options The options parameters. - */ - async beginUpdate( - resourceGroupName: string, - accountName: string, - privateEndpointConnectionName: string, - parameters: PrivateEndpointConnection, - options?: PrivateEndpointConnectionUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - PrivateEndpointConnectionUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = - undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - accountName, - privateEndpointConnectionName, - parameters, - options, - }, - spec: updateOperationSpec, - }); - const poller = await createHttpPoller< - PrivateEndpointConnectionUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation", - }); - await poller.poll(); - return poller; - } - - /** - * Updates the properties of an existing private endpoint connection. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param privateEndpointConnectionName The private endpoint connection name. This must be unique - * within the account. - * @param parameters PrivateEndpointConnection properties that should be updated. Properties that are - * supplied will be updated, any property not supplied will be unchanged. - * @param options The options parameters. - */ - async beginUpdateAndWait( - resourceGroupName: string, - accountName: string, - privateEndpointConnectionName: string, - parameters: PrivateEndpointConnection, - options?: PrivateEndpointConnectionUpdateOptionalParams, - ): Promise { - const poller = await this.beginUpdate( - resourceGroupName, - accountName, - privateEndpointConnectionName, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Deletes the specified private endpoint connection. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param privateEndpointConnectionName The private endpoint connection name. This must be unique - * within the account. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - accountName: string, - privateEndpointConnectionName: string, - options?: PrivateEndpointConnectionDeleteOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - PrivateEndpointConnectionDeleteResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = - undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - accountName, - privateEndpointConnectionName, - options, - }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller< - PrivateEndpointConnectionDeleteResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation", - }); - await poller.poll(); - return poller; - } - - /** - * Deletes the specified private endpoint connection. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param privateEndpointConnectionName The private endpoint connection name. This must be unique - * within the account. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - accountName: string, - privateEndpointConnectionName: string, - options?: PrivateEndpointConnectionDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete( - resourceGroupName, - accountName, - privateEndpointConnectionName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * ListByBatchAccountNext - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param nextLink The nextLink from the previous successful call to the ListByBatchAccount method. - * @param options The options parameters. - */ - private _listByBatchAccountNext( - resourceGroupName: string, - accountName: string, - nextLink: string, - options?: PrivateEndpointConnectionListByBatchAccountNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, accountName, nextLink, options }, - listByBatchAccountNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listByBatchAccountOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/privateEndpointConnections", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ListPrivateEndpointConnectionsResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.maxresults], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PrivateEndpointConnection, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - Parameters.privateEndpointConnectionName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.PrivateEndpointConnection, - }, - 201: { - bodyMapper: Mappers.PrivateEndpointConnection, - }, - 202: { - bodyMapper: Mappers.PrivateEndpointConnection, - }, - 204: { - bodyMapper: Mappers.PrivateEndpointConnection, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - requestBody: Parameters.parameters9, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - Parameters.privateEndpointConnectionName, - ], - headerParameters: [ - Parameters.contentType, - Parameters.accept, - Parameters.ifMatch, - ], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}", - httpMethod: "DELETE", - responses: { - 200: { - headersMapper: Mappers.PrivateEndpointConnectionDeleteHeaders, - }, - 201: { - headersMapper: Mappers.PrivateEndpointConnectionDeleteHeaders, - }, - 202: { - headersMapper: Mappers.PrivateEndpointConnectionDeleteHeaders, - }, - 204: { - headersMapper: Mappers.PrivateEndpointConnectionDeleteHeaders, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - Parameters.privateEndpointConnectionName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByBatchAccountNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ListPrivateEndpointConnectionsResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - Parameters.nextLink, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/batch/arm-batch/src/operations/privateLinkResourceOperations.ts b/sdk/batch/arm-batch/src/operations/privateLinkResourceOperations.ts deleted file mode 100644 index b373e1ee06e9..000000000000 --- a/sdk/batch/arm-batch/src/operations/privateLinkResourceOperations.ts +++ /dev/null @@ -1,247 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import { PrivateLinkResourceOperations } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { BatchManagementClient } from "../batchManagementClient.js"; -import { - PrivateLinkResource, - PrivateLinkResourceListByBatchAccountNextOptionalParams, - PrivateLinkResourceListByBatchAccountOptionalParams, - PrivateLinkResourceListByBatchAccountResponse, - PrivateLinkResourceGetOptionalParams, - PrivateLinkResourceGetResponse, - PrivateLinkResourceListByBatchAccountNextResponse, -} from "../models/index.js"; - -/// -/** Class containing PrivateLinkResourceOperations operations. */ -export class PrivateLinkResourceOperationsImpl - implements PrivateLinkResourceOperations -{ - private readonly client: BatchManagementClient; - - /** - * Initialize a new instance of the class PrivateLinkResourceOperations class. - * @param client Reference to the service client - */ - constructor(client: BatchManagementClient) { - this.client = client; - } - - /** - * Lists all of the private link resources in the specified account. - * @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. - */ - public listByBatchAccount( - resourceGroupName: string, - accountName: string, - options?: PrivateLinkResourceListByBatchAccountOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByBatchAccountPagingAll( - resourceGroupName, - accountName, - options, - ); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByBatchAccountPagingPage( - resourceGroupName, - accountName, - options, - settings, - ); - }, - }; - } - - private async *listByBatchAccountPagingPage( - resourceGroupName: string, - accountName: string, - options?: PrivateLinkResourceListByBatchAccountOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: PrivateLinkResourceListByBatchAccountResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByBatchAccount( - resourceGroupName, - accountName, - options, - ); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByBatchAccountNext( - resourceGroupName, - accountName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByBatchAccountPagingAll( - resourceGroupName: string, - accountName: string, - options?: PrivateLinkResourceListByBatchAccountOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByBatchAccountPagingPage( - resourceGroupName, - accountName, - options, - )) { - yield* page; - } - } - - /** - * Lists all of the private link resources in the specified account. - * @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. - */ - private _listByBatchAccount( - resourceGroupName: string, - accountName: string, - options?: PrivateLinkResourceListByBatchAccountOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, accountName, options }, - listByBatchAccountOperationSpec, - ); - } - - /** - * Gets information about the specified private link resource. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param privateLinkResourceName The private link resource name. This must be unique within the - * account. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - accountName: string, - privateLinkResourceName: string, - options?: PrivateLinkResourceGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, accountName, privateLinkResourceName, options }, - getOperationSpec, - ); - } - - /** - * ListByBatchAccountNext - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param nextLink The nextLink from the previous successful call to the ListByBatchAccount method. - * @param options The options parameters. - */ - private _listByBatchAccountNext( - resourceGroupName: string, - accountName: string, - nextLink: string, - options?: PrivateLinkResourceListByBatchAccountNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, accountName, nextLink, options }, - listByBatchAccountNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listByBatchAccountOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/privateLinkResources", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ListPrivateLinkResourcesResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.maxresults], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/privateLinkResources/{privateLinkResourceName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PrivateLinkResource, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - Parameters.privateLinkResourceName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByBatchAccountNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ListPrivateLinkResourcesResult, - }, - default: { - bodyMapper: Mappers.CloudError, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.resourceGroupName, - Parameters.subscriptionId, - Parameters.accountName1, - Parameters.nextLink, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/batch/arm-batch/src/operationsInterfaces/applicationOperations.ts b/sdk/batch/arm-batch/src/operationsInterfaces/applicationOperations.ts deleted file mode 100644 index f8269b94d074..000000000000 --- a/sdk/batch/arm-batch/src/operationsInterfaces/applicationOperations.ts +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { - Application, - ApplicationListOptionalParams, - ApplicationCreateOptionalParams, - ApplicationCreateResponse, - ApplicationDeleteOptionalParams, - ApplicationGetOptionalParams, - ApplicationGetResponse, - ApplicationUpdateOptionalParams, - ApplicationUpdateResponse, -} from "../models/index.js"; - -/// -/** Interface representing a ApplicationOperations. */ -export interface ApplicationOperations { - /** - * Lists all of the applications in the specified account. - * @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. - */ - list( - resourceGroupName: string, - accountName: string, - options?: ApplicationListOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Adds an application to the specified Batch account. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param applicationName The name of the application. This must be unique within the account. - * @param options The options parameters. - */ - create( - resourceGroupName: string, - accountName: string, - applicationName: string, - options?: ApplicationCreateOptionalParams, - ): Promise; - /** - * Deletes an application. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param applicationName The name of the application. This must be unique within the account. - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - accountName: string, - applicationName: string, - options?: ApplicationDeleteOptionalParams, - ): Promise; - /** - * Gets information about the specified application. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param applicationName The name of the application. This must be unique within the account. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - accountName: string, - applicationName: string, - options?: ApplicationGetOptionalParams, - ): Promise; - /** - * Updates settings for the specified application. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param applicationName The name of the application. This must be unique within the account. - * @param parameters The parameters for the request. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - accountName: string, - applicationName: string, - parameters: Application, - options?: ApplicationUpdateOptionalParams, - ): Promise; -} diff --git a/sdk/batch/arm-batch/src/operationsInterfaces/applicationPackageOperations.ts b/sdk/batch/arm-batch/src/operationsInterfaces/applicationPackageOperations.ts deleted file mode 100644 index 7081407b27db..000000000000 --- a/sdk/batch/arm-batch/src/operationsInterfaces/applicationPackageOperations.ts +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { - ApplicationPackage, - ApplicationPackageListOptionalParams, - ActivateApplicationPackageParameters, - ApplicationPackageActivateOptionalParams, - ApplicationPackageActivateResponse, - ApplicationPackageCreateOptionalParams, - ApplicationPackageCreateResponse, - ApplicationPackageDeleteOptionalParams, - ApplicationPackageGetOptionalParams, - ApplicationPackageGetResponse, -} from "../models/index.js"; - -/// -/** Interface representing a ApplicationPackageOperations. */ -export interface ApplicationPackageOperations { - /** - * Lists all of the application packages in the specified application. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param applicationName The name of the application. This must be unique within the account. - * @param options The options parameters. - */ - list( - resourceGroupName: string, - accountName: string, - applicationName: string, - options?: ApplicationPackageListOptionalParams, - ): PagedAsyncIterableIterator; - /** - * 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. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param applicationName The name of the application. This must be unique within the account. - * @param versionName The version of the application. - * @param parameters The parameters for the request. - * @param options The options parameters. - */ - activate( - resourceGroupName: string, - accountName: string, - applicationName: string, - versionName: string, - parameters: ActivateApplicationPackageParameters, - options?: ApplicationPackageActivateOptionalParams, - ): Promise; - /** - * 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. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param applicationName The name of the application. This must be unique within the account. - * @param versionName The version of the application. - * @param options The options parameters. - */ - create( - resourceGroupName: string, - accountName: string, - applicationName: string, - versionName: string, - options?: ApplicationPackageCreateOptionalParams, - ): Promise; - /** - * Deletes an application package record and its associated binary file. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param applicationName The name of the application. This must be unique within the account. - * @param versionName The version of the application. - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - accountName: string, - applicationName: string, - versionName: string, - options?: ApplicationPackageDeleteOptionalParams, - ): Promise; - /** - * Gets information about the specified application package. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param applicationName The name of the application. This must be unique within the account. - * @param versionName The version of the application. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - accountName: string, - applicationName: string, - versionName: string, - options?: ApplicationPackageGetOptionalParams, - ): Promise; -} diff --git a/sdk/batch/arm-batch/src/operationsInterfaces/batchAccountOperations.ts b/sdk/batch/arm-batch/src/operationsInterfaces/batchAccountOperations.ts deleted file mode 100644 index db0823dbf886..000000000000 --- a/sdk/batch/arm-batch/src/operationsInterfaces/batchAccountOperations.ts +++ /dev/null @@ -1,224 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { - BatchAccount, - BatchAccountListOptionalParams, - BatchAccountListByResourceGroupOptionalParams, - DetectorResponse, - BatchAccountListDetectorsOptionalParams, - OutboundEnvironmentEndpoint, - BatchAccountListOutboundNetworkDependenciesEndpointsOptionalParams, - BatchAccountCreateParameters, - BatchAccountCreateOptionalParams, - BatchAccountCreateResponse, - BatchAccountUpdateParameters, - BatchAccountUpdateOptionalParams, - BatchAccountUpdateResponse, - BatchAccountDeleteOptionalParams, - BatchAccountGetOptionalParams, - BatchAccountGetResponse, - BatchAccountSynchronizeAutoStorageKeysOptionalParams, - BatchAccountRegenerateKeyParameters, - BatchAccountRegenerateKeyOptionalParams, - BatchAccountRegenerateKeyResponse, - BatchAccountGetKeysOptionalParams, - BatchAccountGetKeysResponse, - BatchAccountGetDetectorOptionalParams, - BatchAccountGetDetectorResponse, -} from "../models/index.js"; - -/// -/** Interface representing a BatchAccountOperations. */ -export interface BatchAccountOperations { - /** - * Gets information about the Batch accounts associated with the subscription. - * @param options The options parameters. - */ - list( - options?: BatchAccountListOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Gets information about the Batch accounts associated with the specified resource group. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param options The options parameters. - */ - listByResourceGroup( - resourceGroupName: string, - options?: BatchAccountListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Gets information about the detectors available for a given Batch account. - * @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. - */ - listDetectors( - resourceGroupName: string, - accountName: string, - options?: BatchAccountListDetectorsOptionalParams, - ): PagedAsyncIterableIterator; - /** - * 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. - * @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. - */ - listOutboundNetworkDependenciesEndpoints( - resourceGroupName: string, - accountName: string, - options?: BatchAccountListOutboundNetworkDependenciesEndpointsOptionalParams, - ): PagedAsyncIterableIterator; - /** - * 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. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName A name for the Batch account which must be unique within the region. Batch - * account names must be between 3 and 24 characters in length and must use only numbers and lowercase - * letters. This name is used as part of the DNS name that is used to access the Batch service in the - * region in which the account is created. For example: http://accountname.region.batch.azure.com/. - * @param parameters Additional parameters for account creation. - * @param options The options parameters. - */ - beginCreate( - resourceGroupName: string, - accountName: string, - parameters: BatchAccountCreateParameters, - options?: BatchAccountCreateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - BatchAccountCreateResponse - > - >; - /** - * 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. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName A name for the Batch account which must be unique within the region. Batch - * account names must be between 3 and 24 characters in length and must use only numbers and lowercase - * letters. This name is used as part of the DNS name that is used to access the Batch service in the - * region in which the account is created. For example: http://accountname.region.batch.azure.com/. - * @param parameters Additional parameters for account creation. - * @param options The options parameters. - */ - beginCreateAndWait( - resourceGroupName: string, - accountName: string, - parameters: BatchAccountCreateParameters, - options?: BatchAccountCreateOptionalParams, - ): Promise; - /** - * Updates the properties of an existing Batch account. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param parameters Additional parameters for account update. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - accountName: string, - parameters: BatchAccountUpdateParameters, - options?: BatchAccountUpdateOptionalParams, - ): Promise; - /** - * Deletes the specified Batch account. - * @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. - */ - beginDelete( - resourceGroupName: string, - accountName: string, - options?: BatchAccountDeleteOptionalParams, - ): Promise, void>>; - /** - * Deletes the specified Batch account. - * @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. - */ - beginDeleteAndWait( - resourceGroupName: string, - accountName: string, - options?: BatchAccountDeleteOptionalParams, - ): Promise; - /** - * Gets information about the specified Batch account. - * @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. - */ - get( - resourceGroupName: string, - accountName: string, - options?: BatchAccountGetOptionalParams, - ): Promise; - /** - * Synchronizes access keys for the auto-storage account configured for the specified Batch account, - * only if storage key authentication is being used. - * @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. - */ - synchronizeAutoStorageKeys( - resourceGroupName: string, - accountName: string, - options?: BatchAccountSynchronizeAutoStorageKeysOptionalParams, - ): Promise; - /** - * 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. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param parameters The type of key to regenerate. - * @param options The options parameters. - */ - regenerateKey( - resourceGroupName: string, - accountName: string, - parameters: BatchAccountRegenerateKeyParameters, - options?: BatchAccountRegenerateKeyOptionalParams, - ): Promise; - /** - * 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. - * @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. - */ - getKeys( - resourceGroupName: string, - accountName: string, - options?: BatchAccountGetKeysOptionalParams, - ): Promise; - /** - * Gets information about the given detector for a given Batch account. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param detectorId The name of the detector. - * @param options The options parameters. - */ - getDetector( - resourceGroupName: string, - accountName: string, - detectorId: string, - options?: BatchAccountGetDetectorOptionalParams, - ): Promise; -} diff --git a/sdk/batch/arm-batch/src/operationsInterfaces/certificateOperations.ts b/sdk/batch/arm-batch/src/operationsInterfaces/certificateOperations.ts deleted file mode 100644 index 87b0a0f7feef..000000000000 --- a/sdk/batch/arm-batch/src/operationsInterfaces/certificateOperations.ts +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { - Certificate, - CertificateListByBatchAccountOptionalParams, - CertificateCreateOrUpdateParameters, - CertificateCreateOptionalParams, - CertificateCreateResponse, - CertificateUpdateOptionalParams, - CertificateUpdateResponse, - CertificateDeleteOptionalParams, - CertificateGetOptionalParams, - CertificateGetResponse, - CertificateCancelDeletionOptionalParams, - CertificateCancelDeletionResponse, -} from "../models/index.js"; - -/// -/** Interface representing a CertificateOperations. */ -export interface CertificateOperations { - /** - * 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. - * @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. - */ - listByBatchAccount( - resourceGroupName: string, - accountName: string, - options?: CertificateListByBatchAccountOptionalParams, - ): PagedAsyncIterableIterator; - /** - * 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. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param certificateName The identifier for the certificate. This must be made up of algorithm and - * thumbprint separated by a dash, and must match the certificate data in the request. For example - * SHA1-a3d1c5. - * @param parameters Additional parameters for certificate creation. - * @param options The options parameters. - */ - create( - resourceGroupName: string, - accountName: string, - certificateName: string, - parameters: CertificateCreateOrUpdateParameters, - options?: CertificateCreateOptionalParams, - ): Promise; - /** - * 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. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param certificateName The identifier for the certificate. This must be made up of algorithm and - * thumbprint separated by a dash, and must match the certificate data in the request. For example - * SHA1-a3d1c5. - * @param parameters Certificate entity to update. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - accountName: string, - certificateName: string, - parameters: CertificateCreateOrUpdateParameters, - options?: CertificateUpdateOptionalParams, - ): Promise; - /** - * 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. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param certificateName The identifier for the certificate. This must be made up of algorithm and - * thumbprint separated by a dash, and must match the certificate data in the request. For example - * SHA1-a3d1c5. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - accountName: string, - certificateName: string, - options?: CertificateDeleteOptionalParams, - ): Promise, void>>; - /** - * 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. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param certificateName The identifier for the certificate. This must be made up of algorithm and - * thumbprint separated by a dash, and must match the certificate data in the request. For example - * SHA1-a3d1c5. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - accountName: string, - certificateName: string, - options?: CertificateDeleteOptionalParams, - ): Promise; - /** - * 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. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param certificateName The identifier for the certificate. This must be made up of algorithm and - * thumbprint separated by a dash, and must match the certificate data in the request. For example - * SHA1-a3d1c5. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - accountName: string, - certificateName: string, - options?: CertificateGetOptionalParams, - ): Promise; - /** - * 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. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param certificateName The identifier for the certificate. This must be made up of algorithm and - * thumbprint separated by a dash, and must match the certificate data in the request. For example - * SHA1-a3d1c5. - * @param options The options parameters. - */ - cancelDeletion( - resourceGroupName: string, - accountName: string, - certificateName: string, - options?: CertificateCancelDeletionOptionalParams, - ): Promise; -} diff --git a/sdk/batch/arm-batch/src/operationsInterfaces/index.ts b/sdk/batch/arm-batch/src/operationsInterfaces/index.ts deleted file mode 100644 index 1ed08c05a609..000000000000 --- a/sdk/batch/arm-batch/src/operationsInterfaces/index.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export * from "./batchAccountOperations.js"; -export * from "./applicationPackageOperations.js"; -export * from "./applicationOperations.js"; -export * from "./location.js"; -export * from "./operations.js"; -export * from "./certificateOperations.js"; -export * from "./privateLinkResourceOperations.js"; -export * from "./privateEndpointConnectionOperations.js"; -export * from "./poolOperations.js"; -export * from "./networkSecurityPerimeterOperations.js"; diff --git a/sdk/batch/arm-batch/src/operationsInterfaces/location.ts b/sdk/batch/arm-batch/src/operationsInterfaces/location.ts deleted file mode 100644 index 2f1a08d65b97..000000000000 --- a/sdk/batch/arm-batch/src/operationsInterfaces/location.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { - SupportedSku, - LocationListSupportedVirtualMachineSkusOptionalParams, - LocationGetQuotasOptionalParams, - LocationGetQuotasResponse, - CheckNameAvailabilityParameters, - LocationCheckNameAvailabilityOptionalParams, - LocationCheckNameAvailabilityResponse, -} from "../models/index.js"; - -/// -/** Interface representing a Location. */ -export interface Location { - /** - * Gets the list of Batch supported Virtual Machine VM sizes available at the given location. - * @param locationName The region for which to retrieve Batch service supported SKUs. - * @param options The options parameters. - */ - listSupportedVirtualMachineSkus( - locationName: string, - options?: LocationListSupportedVirtualMachineSkusOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Gets the Batch service quotas for the specified subscription at the given location. - * @param locationName The region for which to retrieve Batch service quotas. - * @param options The options parameters. - */ - getQuotas( - locationName: string, - options?: LocationGetQuotasOptionalParams, - ): Promise; - /** - * Checks whether the Batch account name is available in the specified region. - * @param locationName The desired region for the name check. - * @param parameters Properties needed to check the availability of a name. - * @param options The options parameters. - */ - checkNameAvailability( - locationName: string, - parameters: CheckNameAvailabilityParameters, - options?: LocationCheckNameAvailabilityOptionalParams, - ): Promise; -} diff --git a/sdk/batch/arm-batch/src/operationsInterfaces/networkSecurityPerimeterOperations.ts b/sdk/batch/arm-batch/src/operationsInterfaces/networkSecurityPerimeterOperations.ts deleted file mode 100644 index 8d4622eb51d9..000000000000 --- a/sdk/batch/arm-batch/src/operationsInterfaces/networkSecurityPerimeterOperations.ts +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { - NetworkSecurityPerimeterConfiguration, - NetworkSecurityPerimeterListConfigurationsOptionalParams, - NetworkSecurityPerimeterGetConfigurationOptionalParams, - NetworkSecurityPerimeterGetConfigurationResponse, - NetworkSecurityPerimeterReconcileConfigurationOptionalParams, - NetworkSecurityPerimeterReconcileConfigurationResponse, -} from "../models/index.js"; - -/// -/** Interface representing a NetworkSecurityPerimeterOperations. */ -export interface NetworkSecurityPerimeterOperations { - /** - * Lists all of the NSP configurations in the specified account. - * @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. - */ - listConfigurations( - resourceGroupName: string, - accountName: string, - options?: NetworkSecurityPerimeterListConfigurationsOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Gets information about the specified NSP configuration. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter - * configuration - * @param options The options parameters. - */ - getConfiguration( - resourceGroupName: string, - accountName: string, - networkSecurityPerimeterConfigurationName: string, - options?: NetworkSecurityPerimeterGetConfigurationOptionalParams, - ): Promise; - /** - * Reconciles the specified NSP configuration. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter - * configuration - * @param options The options parameters. - */ - beginReconcileConfiguration( - resourceGroupName: string, - accountName: string, - networkSecurityPerimeterConfigurationName: string, - options?: NetworkSecurityPerimeterReconcileConfigurationOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - NetworkSecurityPerimeterReconcileConfigurationResponse - > - >; - /** - * Reconciles the specified NSP configuration. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter - * configuration - * @param options The options parameters. - */ - beginReconcileConfigurationAndWait( - resourceGroupName: string, - accountName: string, - networkSecurityPerimeterConfigurationName: string, - options?: NetworkSecurityPerimeterReconcileConfigurationOptionalParams, - ): Promise; -} diff --git a/sdk/batch/arm-batch/src/operationsInterfaces/operations.ts b/sdk/batch/arm-batch/src/operationsInterfaces/operations.ts deleted file mode 100644 index dd7dca3cac17..000000000000 --- a/sdk/batch/arm-batch/src/operationsInterfaces/operations.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { Operation, OperationsListOptionalParams } from "../models/index.js"; - -/// -/** Interface representing a Operations. */ -export interface Operations { - /** - * Lists available operations for the Microsoft.Batch provider - * @param options The options parameters. - */ - list( - options?: OperationsListOptionalParams, - ): PagedAsyncIterableIterator; -} diff --git a/sdk/batch/arm-batch/src/operationsInterfaces/poolOperations.ts b/sdk/batch/arm-batch/src/operationsInterfaces/poolOperations.ts deleted file mode 100644 index 2da186f6bc5d..000000000000 --- a/sdk/batch/arm-batch/src/operationsInterfaces/poolOperations.ts +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { - Pool, - PoolListByBatchAccountOptionalParams, - PoolCreateOptionalParams, - PoolCreateResponse, - PoolUpdateOptionalParams, - PoolUpdateResponse, - PoolDeleteOptionalParams, - PoolGetOptionalParams, - PoolGetResponse, - PoolDisableAutoScaleOptionalParams, - PoolDisableAutoScaleResponse, - PoolStopResizeOptionalParams, - PoolStopResizeResponse, -} from "../models/index.js"; - -/// -/** Interface representing a PoolOperations. */ -export interface PoolOperations { - /** - * Lists all of the pools in the specified account. - * @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. - */ - listByBatchAccount( - resourceGroupName: string, - accountName: string, - options?: PoolListByBatchAccountOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Creates a new pool inside the specified account. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param poolName The pool name. This must be unique within the account. - * @param parameters Additional parameters for pool creation. - * @param options The options parameters. - */ - create( - resourceGroupName: string, - accountName: string, - poolName: string, - parameters: Pool, - options?: PoolCreateOptionalParams, - ): Promise; - /** - * Updates the properties of an existing pool. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param poolName The pool name. This must be unique within the account. - * @param parameters Pool properties that should be updated. Properties that are supplied will be - * updated, any property not supplied will be unchanged. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - accountName: string, - poolName: string, - parameters: Pool, - options?: PoolUpdateOptionalParams, - ): Promise; - /** - * Deletes the specified pool. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param poolName The pool name. This must be unique within the account. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - accountName: string, - poolName: string, - options?: PoolDeleteOptionalParams, - ): Promise, void>>; - /** - * Deletes the specified pool. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param poolName The pool name. This must be unique within the account. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - accountName: string, - poolName: string, - options?: PoolDeleteOptionalParams, - ): Promise; - /** - * Gets information about the specified pool. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param poolName The pool name. This must be unique within the account. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - accountName: string, - poolName: string, - options?: PoolGetOptionalParams, - ): Promise; - /** - * Disables automatic scaling for a pool. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param poolName The pool name. This must be unique within the account. - * @param options The options parameters. - */ - disableAutoScale( - resourceGroupName: string, - accountName: string, - poolName: string, - options?: PoolDisableAutoScaleOptionalParams, - ): Promise; - /** - * 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. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param poolName The pool name. This must be unique within the account. - * @param options The options parameters. - */ - stopResize( - resourceGroupName: string, - accountName: string, - poolName: string, - options?: PoolStopResizeOptionalParams, - ): Promise; -} diff --git a/sdk/batch/arm-batch/src/operationsInterfaces/privateEndpointConnectionOperations.ts b/sdk/batch/arm-batch/src/operationsInterfaces/privateEndpointConnectionOperations.ts deleted file mode 100644 index 81241a55fd56..000000000000 --- a/sdk/batch/arm-batch/src/operationsInterfaces/privateEndpointConnectionOperations.ts +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { - PrivateEndpointConnection, - PrivateEndpointConnectionListByBatchAccountOptionalParams, - PrivateEndpointConnectionGetOptionalParams, - PrivateEndpointConnectionGetResponse, - PrivateEndpointConnectionUpdateOptionalParams, - PrivateEndpointConnectionUpdateResponse, - PrivateEndpointConnectionDeleteOptionalParams, - PrivateEndpointConnectionDeleteResponse, -} from "../models/index.js"; - -/// -/** Interface representing a PrivateEndpointConnectionOperations. */ -export interface PrivateEndpointConnectionOperations { - /** - * Lists all of the private endpoint connections in the specified account. - * @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. - */ - listByBatchAccount( - resourceGroupName: string, - accountName: string, - options?: PrivateEndpointConnectionListByBatchAccountOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Gets information about the specified private endpoint connection. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param privateEndpointConnectionName The private endpoint connection name. This must be unique - * within the account. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - accountName: string, - privateEndpointConnectionName: string, - options?: PrivateEndpointConnectionGetOptionalParams, - ): Promise; - /** - * Updates the properties of an existing private endpoint connection. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param privateEndpointConnectionName The private endpoint connection name. This must be unique - * within the account. - * @param parameters PrivateEndpointConnection properties that should be updated. Properties that are - * supplied will be updated, any property not supplied will be unchanged. - * @param options The options parameters. - */ - beginUpdate( - resourceGroupName: string, - accountName: string, - privateEndpointConnectionName: string, - parameters: PrivateEndpointConnection, - options?: PrivateEndpointConnectionUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - PrivateEndpointConnectionUpdateResponse - > - >; - /** - * Updates the properties of an existing private endpoint connection. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param privateEndpointConnectionName The private endpoint connection name. This must be unique - * within the account. - * @param parameters PrivateEndpointConnection properties that should be updated. Properties that are - * supplied will be updated, any property not supplied will be unchanged. - * @param options The options parameters. - */ - beginUpdateAndWait( - resourceGroupName: string, - accountName: string, - privateEndpointConnectionName: string, - parameters: PrivateEndpointConnection, - options?: PrivateEndpointConnectionUpdateOptionalParams, - ): Promise; - /** - * Deletes the specified private endpoint connection. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param privateEndpointConnectionName The private endpoint connection name. This must be unique - * within the account. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - accountName: string, - privateEndpointConnectionName: string, - options?: PrivateEndpointConnectionDeleteOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - PrivateEndpointConnectionDeleteResponse - > - >; - /** - * Deletes the specified private endpoint connection. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param privateEndpointConnectionName The private endpoint connection name. This must be unique - * within the account. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - accountName: string, - privateEndpointConnectionName: string, - options?: PrivateEndpointConnectionDeleteOptionalParams, - ): Promise; -} diff --git a/sdk/batch/arm-batch/src/operationsInterfaces/privateLinkResourceOperations.ts b/sdk/batch/arm-batch/src/operationsInterfaces/privateLinkResourceOperations.ts deleted file mode 100644 index ec9d2c203f11..000000000000 --- a/sdk/batch/arm-batch/src/operationsInterfaces/privateLinkResourceOperations.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { - PrivateLinkResource, - PrivateLinkResourceListByBatchAccountOptionalParams, - PrivateLinkResourceGetOptionalParams, - PrivateLinkResourceGetResponse, -} from "../models/index.js"; - -/// -/** Interface representing a PrivateLinkResourceOperations. */ -export interface PrivateLinkResourceOperations { - /** - * Lists all of the private link resources in the specified account. - * @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. - */ - listByBatchAccount( - resourceGroupName: string, - accountName: string, - options?: PrivateLinkResourceListByBatchAccountOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Gets information about the specified private link resource. - * @param resourceGroupName The name of the resource group that contains the Batch account. - * @param accountName The name of the Batch account. - * @param privateLinkResourceName The private link resource name. This must be unique within the - * account. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - accountName: string, - privateLinkResourceName: string, - options?: PrivateLinkResourceGetOptionalParams, - ): Promise; -} diff --git a/sdk/batch/arm-batch/src/pagingHelper.ts b/sdk/batch/arm-batch/src/pagingHelper.ts deleted file mode 100644 index 205cccc26592..000000000000 --- a/sdk/batch/arm-batch/src/pagingHelper.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export interface PageInfo { - continuationToken?: string; -} - -const pageMap = new WeakMap(); - -/** - * 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 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) { - return undefined; - } - return pageMap.get(page)?.continuationToken; -} - -export function setContinuationToken( - page: unknown, - continuationToken: string | undefined, -): void { - if (typeof page !== "object" || page === null || !continuationToken) { - return; - } - const pageInfo = pageMap.get(page) ?? {}; - pageInfo.continuationToken = continuationToken; - pageMap.set(page, pageInfo); -} diff --git a/sdk/batch/arm-batch/src/restorePollerHelpers.ts b/sdk/batch/arm-batch/src/restorePollerHelpers.ts new file mode 100644 index 000000000000..1d5b4520eb4b --- /dev/null +++ b/sdk/batch/arm-batch/src/restorePollerHelpers.ts @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { BatchManagementClient } from "./batchManagementClient.js"; +import { _reconcileConfigurationDeserialize } from "./api/networkSecurityPerimeter/operations.js"; +import { _$deleteDeserialize } from "./api/pool/operations.js"; +import { + _$deleteDeserialize as _$deleteDeserializePrivateEndpointConnection, + _updateDeserialize, +} from "./api/privateEndpointConnection/operations.js"; +import { + _$deleteDeserialize as _$deleteDeserializeBatchAccount, + _createDeserialize, +} from "./api/batchAccount/operations.js"; +import { getLongRunningPoller } from "./static-helpers/pollingHelpers.js"; +import { OperationOptions, PathUncheckedResponse } from "@azure-rest/core-client"; +import { AbortSignalLike } from "@azure/abort-controller"; +import { + PollerLike, + OperationState, + deserializeState, + ResourceLocationConfig, +} from "@azure/core-lro"; + +export interface RestorePollerOptions< + TResult, + TResponse extends PathUncheckedResponse = PathUncheckedResponse, +> extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** + * The signal which can be used to abort requests. + */ + abortSignal?: AbortSignalLike; + /** Deserialization function for raw response body */ + processResponseBody?: (result: TResponse) => Promise; +} + +/** + * Creates a poller from the serialized state of another poller. This can be + * useful when you want to create pollers on a different host or a poller + * needs to be constructed after the original one is not in scope. + */ +export function restorePoller( + client: BatchManagementClient, + serializedState: string, + sourceOperation: (...args: any[]) => PollerLike, TResult>, + options?: RestorePollerOptions, +): PollerLike, TResult> { + const pollerConfig = deserializeState(serializedState).config; + const { initialRequestUrl, requestMethod, metadata } = pollerConfig; + if (!initialRequestUrl || !requestMethod) { + throw new Error( + `Invalid serialized state: ${serializedState} for sourceOperation ${sourceOperation?.name}`, + ); + } + const resourceLocationConfig = metadata?.["resourceLocationConfig"] as + | ResourceLocationConfig + | undefined; + const { deserializer, expectedStatuses = [] } = + getDeserializationHelper(initialRequestUrl, requestMethod) ?? {}; + const deserializeHelper = options?.processResponseBody ?? deserializer; + if (!deserializeHelper) { + throw new Error( + `Please ensure the operation is in this client! We can't find its deserializeHelper for ${sourceOperation?.name}.`, + ); + } + const apiVersion = getApiVersionFromUrl(initialRequestUrl); + return getLongRunningPoller( + (client as any)["_client"] ?? client, + deserializeHelper as (result: TResponse) => Promise, + expectedStatuses, + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + resourceLocationConfig, + restoreFrom: serializedState, + initialRequestUrl, + apiVersion, + }, + ); +} + +interface DeserializationHelper { + deserializer: (result: PathUncheckedResponse) => Promise; + expectedStatuses: string[]; +} + +const deserializeMap: Record = { + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}/reconcile": + { deserializer: _reconcileConfigurationDeserialize, expectedStatuses: ["202", "200", "201"] }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName}": + { deserializer: _$deleteDeserialize, expectedStatuses: ["200", "202", "204"] }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}": + { + deserializer: _$deleteDeserializePrivateEndpointConnection, + expectedStatuses: ["202", "204", "200"], + }, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}": + { deserializer: _updateDeserialize, expectedStatuses: ["200", "202", "201"] }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}": + { deserializer: _$deleteDeserializeBatchAccount, expectedStatuses: ["200", "202", "204"] }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}": + { deserializer: _createDeserialize, expectedStatuses: ["200", "202", "201"] }, +}; + +function getDeserializationHelper( + urlStr: string, + method: string, +): DeserializationHelper | undefined { + const path = new URL(urlStr).pathname; + const pathParts = path.split("/"); + + // Traverse list to match the longest candidate + // matchedLen: the length of candidate path + // matchedValue: the matched status code array + let matchedLen = -1, + matchedValue: DeserializationHelper | undefined; + + // Iterate the responseMap to find a match + for (const [key, value] of Object.entries(deserializeMap)) { + // Extracting the path from the map key which is in format + // GET /path/foo + if (!key.startsWith(method)) { + continue; + } + const candidatePath = getPathFromMapKey(key); + // Get each part of the url path + const candidateParts = candidatePath.split("/"); + + // track if we have found a match to return the values found. + let found = true; + for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) { + if (candidateParts[i]?.startsWith("{") && candidateParts[i]?.indexOf("}") !== -1) { + const start = candidateParts[i]!.indexOf("}") + 1, + end = candidateParts[i]?.length; + // If the current part of the candidate is a "template" part + // Try to use the suffix of pattern to match the path + // {guid} ==> $ + // {guid}:export ==> :export$ + const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test( + pathParts[j] || "", + ); + + if (!isMatched) { + found = false; + break; + } + continue; + } + + // If the candidate part is not a template and + // the parts don't match mark the candidate as not found + // to move on with the next candidate path. + if (candidateParts[i] !== pathParts[j]) { + found = false; + break; + } + } + + // We finished evaluating the current candidate parts + // Update the matched value if and only if we found the longer pattern + if (found && candidatePath.length > matchedLen) { + matchedLen = candidatePath.length; + matchedValue = value; + } + } + + return matchedValue; +} + +function getPathFromMapKey(mapKey: string): string { + const pathStart = mapKey.indexOf("/"); + return mapKey.slice(pathStart); +} + +function getApiVersionFromUrl(urlStr: string): string | undefined { + const url = new URL(urlStr); + return url.searchParams.get("api-version") ?? undefined; +} diff --git a/sdk/batch/arm-batch/src/static-helpers/cloudSettingHelpers.ts b/sdk/batch/arm-batch/src/static-helpers/cloudSettingHelpers.ts new file mode 100644 index 000000000000..613112c6e397 --- /dev/null +++ b/sdk/batch/arm-batch/src/static-helpers/cloudSettingHelpers.ts @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * An enum to describe Azure Cloud environments. + * @enum {string} + */ +export enum AzureClouds { + /** Azure public cloud, which is the default cloud for Azure SDKs. */ + AZURE_PUBLIC_CLOUD = "AZURE_PUBLIC_CLOUD", + /** Azure China cloud */ + AZURE_CHINA_CLOUD = "AZURE_CHINA_CLOUD", + /** Azure US government cloud */ + AZURE_US_GOVERNMENT = "AZURE_US_GOVERNMENT", +} + +/** The supported values for cloud setting as a string literal type */ +export type AzureSupportedClouds = `${AzureClouds}`; + +/** + * Gets the Azure Resource Manager endpoint URL for the specified cloud setting. + * @param cloudSetting - The Azure cloud environment setting. Use one of the AzureClouds enum values. + * @returns The ARM endpoint URL for the specified cloud, or undefined if cloudSetting is undefined. + * @throws {Error} Throws an error if an unknown cloud setting is provided. + */ +export function getArmEndpoint(cloudSetting?: AzureSupportedClouds): string | undefined { + if (cloudSetting === undefined) { + return undefined; + } + const cloudEndpoints: Record = { + AZURE_CHINA_CLOUD: "https://management.chinacloudapi.cn/", + AZURE_US_GOVERNMENT: "https://management.usgovcloudapi.net/", + AZURE_PUBLIC_CLOUD: "https://management.azure.com/", + }; + if (cloudSetting in cloudEndpoints) { + return cloudEndpoints[cloudSetting]; + } else { + throw new Error( + `Unknown cloud setting: ${cloudSetting}. Please refer to the enum AzureClouds for possible values.`, + ); + } +} diff --git a/sdk/batch/arm-batch/src/static-helpers/pagingHelpers.ts b/sdk/batch/arm-batch/src/static-helpers/pagingHelpers.ts new file mode 100644 index 000000000000..8412742a9685 --- /dev/null +++ b/sdk/batch/arm-batch/src/static-helpers/pagingHelpers.ts @@ -0,0 +1,269 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { Client, createRestError, PathUncheckedResponse } from "@azure-rest/core-client"; +import { RestError } from "@azure/core-rest-pipeline"; + +/** + * Options for the byPage method + */ +export interface PageSettings { + /** + * A reference to a specific page to start iterating from. + */ + continuationToken?: string; +} + +/** + * An interface that describes a page of results. + */ +export type ContinuablePage = TPage & { + /** + * The token that keeps track of where to continue the iterator + */ + continuationToken?: string; +}; + +/** + * An interface that allows async iterable iteration both to completion and by page. + */ +export interface PagedAsyncIterableIterator< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, +> { + /** + * The next method, part of the iteration protocol + */ + next(): Promise>; + /** + * The connection to the async iterator, part of the iteration protocol + */ + [Symbol.asyncIterator](): PagedAsyncIterableIterator; + /** + * Return an AsyncIterableIterator that works a page at a time + */ + byPage: (settings?: TPageSettings) => AsyncIterableIterator>; +} + +/** + * An interface that describes how to communicate with the service. + */ +export interface PagedResult< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, +> { + /** + * Link to the first page of results. + */ + firstPageLink?: string; + /** + * A method that returns a page of results. + */ + getPage: (pageLink?: string) => Promise<{ page: TPage; nextPageLink?: string } | undefined>; + /** + * a function to implement the `byPage` method on the paged async iterator. + */ + byPage?: (settings?: TPageSettings) => AsyncIterableIterator>; + + /** + * A function to extract elements from a page. + */ + toElements?: (page: TPage) => TElement[]; +} + +/** + * Options for the paging helper + */ +export interface BuildPagedAsyncIteratorOptions { + itemName?: string; + nextLinkName?: string; + nextLinkMethod?: "GET" | "POST"; + apiVersion?: string; +} + +/** + * Helper to paginate results in a generic way and return a PagedAsyncIterableIterator + */ +export function buildPagedAsyncIterator< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, + TResponse extends PathUncheckedResponse = PathUncheckedResponse, +>( + client: Client, + getInitialResponse: () => PromiseLike, + processResponseBody: (result: TResponse) => PromiseLike, + expectedStatuses: string[], + options: BuildPagedAsyncIteratorOptions = {}, +): PagedAsyncIterableIterator { + const itemName = options.itemName ?? "value"; + const nextLinkName = options.nextLinkName ?? "nextLink"; + const nextLinkMethod = options.nextLinkMethod ?? "GET"; + const apiVersion = options.apiVersion; + const pagedResult: PagedResult = { + getPage: async (pageLink?: string) => { + let result; + if (pageLink === undefined) { + result = await getInitialResponse(); + } else { + const resolvedPageLink = apiVersion ? addApiVersionToUrl(pageLink, apiVersion) : pageLink; + result = + nextLinkMethod === "POST" + ? await client.pathUnchecked(resolvedPageLink).post() + : await client.pathUnchecked(resolvedPageLink).get(); + } + checkPagingRequest(result, expectedStatuses); + const results = await processResponseBody(result as TResponse); + const nextLink = getNextLink(results, nextLinkName); + const values = getElements(results, itemName) as TPage; + return { + page: values, + nextPageLink: nextLink, + }; + }, + byPage: (settings?: TPageSettings) => { + const { continuationToken } = settings ?? {}; + return getPageAsyncIterator(pagedResult, { + pageLink: continuationToken, + }); + }, + }; + return getPagedAsyncIterator(pagedResult); +} + +/** + * returns an async iterator that iterates over results. It also has a `byPage` + * method that returns pages of items at once. + * + * @param pagedResult - an object that specifies how to get pages. + * @returns a paged async iterator that iterates over results. + */ + +function getPagedAsyncIterator< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, +>( + pagedResult: PagedResult, +): PagedAsyncIterableIterator { + const iter = getItemAsyncIterator(pagedResult); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: + pagedResult?.byPage ?? + ((settings?: TPageSettings) => { + const { continuationToken } = settings ?? {}; + return getPageAsyncIterator(pagedResult, { + pageLink: continuationToken, + }); + }), + }; +} + +async function* getItemAsyncIterator( + pagedResult: PagedResult, +): AsyncIterableIterator { + const pages = getPageAsyncIterator(pagedResult); + for await (const page of pages) { + yield* page as unknown as TElement[]; + } +} + +async function* getPageAsyncIterator( + pagedResult: PagedResult, + options: { + pageLink?: string; + } = {}, +): AsyncIterableIterator> { + const { pageLink } = options; + let response = await pagedResult.getPage(pageLink ?? pagedResult.firstPageLink); + if (!response) { + return; + } + let result = response.page as ContinuablePage; + result.continuationToken = response.nextPageLink; + yield result; + while (response.nextPageLink) { + response = await pagedResult.getPage(response.nextPageLink); + if (!response) { + return; + } + result = response.page as ContinuablePage; + result.continuationToken = response.nextPageLink; + yield result; + } +} + +/** + * Gets for the value of nextLink in the body + */ +function getNextLink(body: unknown, nextLinkName?: string): string | undefined { + if (!nextLinkName) { + return undefined; + } + + const nextLink = (body as Record)[nextLinkName]; + + if (typeof nextLink !== "string" && typeof nextLink !== "undefined" && nextLink !== null) { + throw new RestError( + `Body Property ${nextLinkName} should be a string or undefined or null but got ${typeof nextLink}`, + ); + } + + if (nextLink === null) { + return undefined; + } + + return nextLink; +} + +/** + * Gets the elements of the current request in the body. + */ +function getElements(body: unknown, itemName: string): T[] { + const value = (body as Record)[itemName] as T[]; + if (!Array.isArray(value)) { + throw new RestError( + `Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}`, + ); + } + + return value ?? []; +} + +/** + * Checks if a request failed + */ +function checkPagingRequest(response: PathUncheckedResponse, expectedStatuses: string[]): void { + if (!expectedStatuses.includes(response.status)) { + throw createRestError( + `Pagination failed with unexpected statusCode ${response.status}`, + response, + ); + } +} + +/** + * Adds the api-version query parameter on a URL if it's not present. + * @param url - the URL to modify + * @param apiVersion - the API version to set + * @returns - the URL with the api-version query parameter set + */ +function addApiVersionToUrl(url: string, apiVersion: string): string { + // The base URL is only used for parsing and won't appear in the returned URL + const urlObj = new URL(url, "https://microsoft.com"); + if (!urlObj.searchParams.get("api-version")) { + // Append one if there is no apiVersion + return `${url}${ + Array.from(urlObj.searchParams.keys()).length > 0 ? "&" : "?" + }api-version=${apiVersion}`; + } + return url; +} diff --git a/sdk/batch/arm-batch/src/static-helpers/pollingHelpers.ts b/sdk/batch/arm-batch/src/static-helpers/pollingHelpers.ts new file mode 100644 index 000000000000..b1bb018377f6 --- /dev/null +++ b/sdk/batch/arm-batch/src/static-helpers/pollingHelpers.ts @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { + PollerLike, + OperationState, + ResourceLocationConfig, + RunningOperation, + createHttpPoller, + OperationResponse, +} from "@azure/core-lro"; + +import { Client, PathUncheckedResponse, createRestError } from "@azure-rest/core-client"; +import { AbortSignalLike } from "@azure/abort-controller"; + +export interface GetLongRunningPollerOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** + * The signal which can be used to abort requests. + */ + abortSignal?: AbortSignalLike; + /** + * The potential location of the result of the LRO if specified by the LRO extension in the swagger. + */ + resourceLocationConfig?: ResourceLocationConfig; + /** + * The original url of the LRO + * Should not be null when restoreFrom is set + */ + initialRequestUrl?: string; + /** + * A serialized poller which can be used to resume an existing paused Long-Running-Operation. + */ + restoreFrom?: string; + /** + * The function to get the initial response + */ + getInitialResponse?: () => PromiseLike; + /** + * The api-version of the LRO + */ + apiVersion?: string; +} +export function getLongRunningPoller( + client: Client, + processResponseBody: (result: TResponse) => Promise, + expectedStatuses: string[], + options: GetLongRunningPollerOptions, +): PollerLike, TResult> { + const { restoreFrom, getInitialResponse, apiVersion } = options; + if (!restoreFrom && !getInitialResponse) { + throw new Error("Either restoreFrom or getInitialResponse must be specified"); + } + let initialResponse: TResponse | undefined = undefined; + const pollAbortController = new AbortController(); + const poller: RunningOperation = { + sendInitialRequest: async () => { + if (!getInitialResponse) { + throw new Error("getInitialResponse is required when initializing a new poller"); + } + initialResponse = await getInitialResponse(); + return getLroResponse(initialResponse, expectedStatuses); + }, + sendPollRequest: async ( + path: string, + pollOptions?: { + abortSignal?: AbortSignalLike; + }, + ) => { + // The poll request would both listen to the user provided abort signal and the poller's own abort signal + function abortListener(): void { + pollAbortController.abort(); + } + const abortSignal = pollAbortController.signal; + if (options.abortSignal?.aborted) { + pollAbortController.abort(); + } else if (pollOptions?.abortSignal?.aborted) { + pollAbortController.abort(); + } else if (!abortSignal.aborted) { + options.abortSignal?.addEventListener("abort", abortListener, { + once: true, + }); + pollOptions?.abortSignal?.addEventListener("abort", abortListener, { + once: true, + }); + } + let response; + try { + const pollingPath = apiVersion ? addApiVersionToUrl(path, apiVersion) : path; + response = await client.pathUnchecked(pollingPath).get({ abortSignal }); + } finally { + options.abortSignal?.removeEventListener("abort", abortListener); + pollOptions?.abortSignal?.removeEventListener("abort", abortListener); + } + + return getLroResponse(response as TResponse, expectedStatuses); + }, + }; + return createHttpPoller(poller, { + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: options?.resourceLocationConfig, + restoreFrom: options?.restoreFrom, + processResult: (result: unknown) => { + return processResponseBody(result as TResponse); + }, + }); +} +/** + * Converts a Rest Client response to a response that the LRO implementation understands + * @param response - a rest client http response + * @param deserializeFn - deserialize function to convert Rest response to modular output + * @returns - An LRO response that the LRO implementation understands + */ +function getLroResponse( + response: TResponse, + expectedStatuses: string[], +): OperationResponse { + if (!expectedStatuses.includes(response.status)) { + throw createRestError(response); + } + + return { + flatResponse: response, + rawResponse: { + ...response, + statusCode: Number.parseInt(response.status), + body: response.body, + }, + }; +} + +/** + * Adds the api-version query parameter on a URL if it's not present. + * @param url - the URL to modify + * @param apiVersion - the API version to set + * @returns - the URL with the api-version query parameter set + */ +function addApiVersionToUrl(url: string, apiVersion: string): string { + // The base URL is only used for parsing and won't appear in the returned URL + const urlObj = new URL(url, "https://microsoft.com"); + if (!urlObj.searchParams.get("api-version")) { + // Append one if there is no apiVersion + return `${url}${ + Array.from(urlObj.searchParams.keys()).length > 0 ? "&" : "?" + }api-version=${apiVersion}`; + } + return url; +} diff --git a/sdk/batch/arm-batch/src/static-helpers/serialization/check-prop-undefined.ts b/sdk/batch/arm-batch/src/static-helpers/serialization/check-prop-undefined.ts new file mode 100644 index 000000000000..50f78829e491 --- /dev/null +++ b/sdk/batch/arm-batch/src/static-helpers/serialization/check-prop-undefined.ts @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * Returns true if all specified properties of the item are undefined. + * @param item The object to check. + * @param properties The list of property names to check on the item. + * @returns True if all specified properties are undefined, otherwise false. + */ +export function areAllPropsUndefined(item: Record, properties: string[]): boolean { + for (const property of properties) { + if (item[property] !== undefined) { + return false; + } + } + return true; +} diff --git a/sdk/batch/arm-batch/src/static-helpers/simplePollerHelpers.ts b/sdk/batch/arm-batch/src/static-helpers/simplePollerHelpers.ts new file mode 100644 index 000000000000..21c6d5eee895 --- /dev/null +++ b/sdk/batch/arm-batch/src/static-helpers/simplePollerHelpers.ts @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PollerLike, OperationState, CancelOnProgress } from "@azure/core-lro"; +import { AbortSignalLike } from "@azure/abort-controller"; + +/** + * A simple poller that can be used to poll a long running operation. + */ +export interface SimplePollerLike, TResult> { + /** + * Returns true if the poller has finished polling. + */ + isDone(): boolean; + /** + * Returns the state of the operation. + */ + getOperationState(): TState; + /** + * Returns the result value of the operation, + * regardless of the state of the poller. + * It can return undefined or an incomplete form of the final TResult value + * depending on the implementation. + */ + getResult(): TResult | undefined; + /** + * Returns a promise that will resolve once a single polling request finishes. + * It does this by calling the update method of the Poller's operation. + */ + poll(options?: { abortSignal?: AbortSignalLike }): Promise; + /** + * Returns a promise that will resolve once the underlying operation is completed. + */ + pollUntilDone(pollOptions?: { abortSignal?: AbortSignalLike }): Promise; + /** + * Invokes the provided callback after each polling is completed, + * sending the current state of the poller's operation. + * + * It returns a method that can be used to stop receiving updates on the given callback function. + */ + onProgress(callback: (state: TState) => void): CancelOnProgress; + + /** + * Returns a promise that could be used for serialized version of the poller's operation + * by invoking the operation's serialize method. + */ + serialize(): Promise; + + /** + * Wait the poller to be submitted. + */ + submitted(): Promise; + + /** + * Returns a string representation of the poller's operation. Similar to serialize but returns a string. + * @deprecated Use serialize() instead. + */ + toString(): string; + + /** + * Stops the poller from continuing to poll. Please note this will only stop the client-side polling + * @deprecated Use abortSignal to stop polling instead. + */ + stopPolling(): void; + + /** + * Returns true if the poller is stopped. + * @deprecated Use abortSignal status to track this instead. + */ + isStopped(): boolean; +} + +/** + * Create the deprecated SimplePollerLike from PollerLike + * @param poller PollerLike to convert + * @returns SimplePollerLike + */ +export function getSimplePoller( + poller: PollerLike, TResult>, +): SimplePollerLike, TResult> { + const simplePoller: SimplePollerLike, TResult> = { + isDone() { + return poller.isDone; + }, + isStopped() { + throw new Error("isStopped is deprecated. Use abortSignal status to track this instead."); + }, + getOperationState() { + if (!poller.operationState) { + throw new Error( + "Operation state is not available. The poller may not have been started and you could await submitted() before calling getOperationState().", + ); + } + return poller.operationState; + }, + getResult() { + return poller.result; + }, + toString() { + if (!poller.operationState) { + throw new Error( + "Operation state is not available. The poller may not have been started and you could await submitted() before calling getOperationState().", + ); + } + return JSON.stringify({ + state: poller.operationState, + }); + }, + stopPolling() { + throw new Error("stopPolling is deprecated. Use abortSignal to stop polling instead."); + }, + onProgress: poller.onProgress, + poll: poller.poll, + pollUntilDone: poller.pollUntilDone, + serialize: poller.serialize, + submitted: poller.submitted, + }; + return simplePoller; +} diff --git a/sdk/batch/arm-batch/src/static-helpers/urlTemplate.ts b/sdk/batch/arm-batch/src/static-helpers/urlTemplate.ts new file mode 100644 index 000000000000..e8af8cd3ab73 --- /dev/null +++ b/sdk/batch/arm-batch/src/static-helpers/urlTemplate.ts @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +// --------------------- +// interfaces +// --------------------- +interface ValueOptions { + isFirst: boolean; // is first value in the expression + op?: string; // operator + varValue?: any; // variable value + varName?: string; // variable name + modifier?: string; // modifier e.g * + reserved?: boolean; // if true we'll keep reserved words with not encoding +} + +export interface UrlTemplateOptions { + // if set to true, reserved characters will not be encoded + allowReserved?: boolean; +} + +// --------------------- +// helpers +// --------------------- +function encodeComponent(val: string, reserved?: boolean, op?: string): string { + return (reserved ?? op === "+") || op === "#" + ? encodeReservedComponent(val) + : encodeRFC3986URIComponent(val); +} + +function encodeReservedComponent(str: string): string { + return str + .split(/(%[0-9A-Fa-f]{2})/g) + .map((part) => (!/%[0-9A-Fa-f]/.test(part) ? encodeURI(part) : part)) + .join(""); +} + +function encodeRFC3986URIComponent(str: string): string { + return encodeURIComponent(str).replace( + /[!'()*]/g, + (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`, + ); +} + +function isDefined(val: any): boolean { + return val !== undefined && val !== null; +} + +function getNamedAndIfEmpty(op?: string): [boolean, string] { + return [!!op && [";", "?", "&"].includes(op), !!op && ["?", "&"].includes(op) ? "=" : ""]; +} + +function getFirstOrSep(op?: string, isFirst = false): string { + if (isFirst) { + return !op || op === "+" ? "" : op; + } else if (!op || op === "+" || op === "#") { + return ","; + } else if (op === "?") { + return "&"; + } else { + return op; + } +} + +function getExpandedValue(option: ValueOptions): string { + let isFirst = option.isFirst; + const { op, varName, varValue: value, reserved } = option; + const vals: string[] = []; + const [named, ifEmpty] = getNamedAndIfEmpty(op); + + if (Array.isArray(value)) { + for (const val of value.filter(isDefined)) { + // prepare the following parts: separator, varName, value + vals.push(`${getFirstOrSep(op, isFirst)}`); + if (named && varName) { + vals.push(`${encodeURIComponent(varName)}`); + if (val === "") { + vals.push(ifEmpty); + } else { + vals.push("="); + } + } + vals.push(encodeComponent(val, reserved, op)); + isFirst = false; + } + } else if (typeof value === "object") { + for (const key of Object.keys(value)) { + const val = value[key]; + if (!isDefined(val)) { + continue; + } + // prepare the following parts: separator, key, value + vals.push(`${getFirstOrSep(op, isFirst)}`); + if (key) { + vals.push(`${encodeURIComponent(key)}`); + if (named && val === "") { + vals.push(ifEmpty); + } else { + vals.push("="); + } + } + vals.push(encodeComponent(val, reserved, op)); + isFirst = false; + } + } + return vals.join(""); +} + +function getNonExpandedValue(option: ValueOptions): string | undefined { + const { op, varName, varValue: value, isFirst, reserved } = option; + const vals: string[] = []; + const first = getFirstOrSep(op, isFirst); + const [named, ifEmpty] = getNamedAndIfEmpty(op); + if (named && varName) { + vals.push(encodeComponent(varName, reserved, op)); + if (value === "") { + if (!ifEmpty) { + vals.push(ifEmpty); + } + return !vals.join("") ? undefined : `${first}${vals.join("")}`; + } + vals.push("="); + } + + const items = []; + if (Array.isArray(value)) { + for (const val of value.filter(isDefined)) { + items.push(encodeComponent(val, reserved, op)); + } + } else if (typeof value === "object") { + for (const key of Object.keys(value)) { + if (!isDefined(value[key])) { + continue; + } + items.push(encodeRFC3986URIComponent(key)); + items.push(encodeComponent(value[key], reserved, op)); + } + } + vals.push(items.join(",")); + return !vals.join(",") ? undefined : `${first}${vals.join("")}`; +} + +function getVarValue(option: ValueOptions): string | undefined { + const { op, varName, modifier, isFirst, reserved, varValue: value } = option; + + if (!isDefined(value)) { + return undefined; + } else if (["string", "number", "boolean"].includes(typeof value)) { + let val = value.toString(); + const [named, ifEmpty] = getNamedAndIfEmpty(op); + const vals: string[] = [getFirstOrSep(op, isFirst)]; + if (named && varName) { + // No need to encode varName considering it is already encoded + vals.push(varName); + if (val === "") { + vals.push(ifEmpty); + } else { + vals.push("="); + } + } + if (modifier && modifier !== "*") { + val = val.substring(0, parseInt(modifier, 10)); + } + vals.push(encodeComponent(val, reserved, op)); + return vals.join(""); + } else if (modifier === "*") { + return getExpandedValue(option); + } else { + return getNonExpandedValue(option); + } +} + +// --------------------------------------------------------------------------------------------------- +// This is an implementation of RFC 6570 URI Template: https://datatracker.ietf.org/doc/html/rfc6570. +// --------------------------------------------------------------------------------------------------- +export function expandUrlTemplate( + template: string, + context: Record, + option?: UrlTemplateOptions, +): string { + const result = template.replace(/\{([^{}]+)\}|([^{}]+)/g, (_, expr, text) => { + if (!expr) { + return encodeReservedComponent(text); + } + let op; + if (["+", "#", ".", "/", ";", "?", "&"].includes(expr[0])) { + op = expr[0]; + expr = expr.slice(1); + } + const varList = expr.split(/,/g); + const innerResult = []; + for (const varSpec of varList) { + const varMatch = /([^:*]*)(?::(\d+)|(\*))?/.exec(varSpec); + if (!varMatch || !varMatch[1]) { + continue; + } + const varValue = getVarValue({ + isFirst: innerResult.length === 0, + op, + varValue: context[varMatch[1]], + varName: varMatch[1], + modifier: varMatch[2] || varMatch[3], + reserved: option?.allowReserved, + }); + if (varValue) { + innerResult.push(varValue); + } + } + return innerResult.join(""); + }); + + return normalizeUnreserved(result); +} + +/** + * Normalize an expanded URI by decoding percent-encoded unreserved characters. + * RFC 3986 unreserved: "-" / "." / "~" + */ +function normalizeUnreserved(uri: string): string { + return uri.replace(/%([0-9A-Fa-f]{2})/g, (match, hex) => { + const char = String.fromCharCode(parseInt(hex, 16)); + // Decode only if it's unreserved + if (/[.~-]/.test(char)) { + return char; + } + return match; // leave other encodings intact + }); +} diff --git a/sdk/batch/arm-batch/test/snippets.spec.ts b/sdk/batch/arm-batch/test/snippets.spec.ts index c71d35975a37..19d0ab5536e3 100644 --- a/sdk/batch/arm-batch/test/snippets.spec.ts +++ b/sdk/batch/arm-batch/test/snippets.spec.ts @@ -13,11 +13,11 @@ describe("snippets", () => { }); it("ReadmeSampleCreateClient_Browser", async () => { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; const credential = new InteractiveBrowserCredential({ tenantId: "", clientId: "", }); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new BatchManagementClient(credential, subscriptionId); }); diff --git a/sdk/batch/arm-batch/tsconfig.json b/sdk/batch/arm-batch/tsconfig.json index d466f1460665..0e57dbd186e5 100644 --- a/sdk/batch/arm-batch/tsconfig.json +++ b/sdk/batch/arm-batch/tsconfig.json @@ -12,6 +12,5 @@ { "path": "./tsconfig.snippets.json" } - ], - "files": [] + ] } diff --git a/sdk/batch/arm-batch/tsconfig.samples.json b/sdk/batch/arm-batch/tsconfig.samples.json index 8cc8f319ac29..1f1923605fa1 100644 --- a/sdk/batch/arm-batch/tsconfig.samples.json +++ b/sdk/batch/arm-batch/tsconfig.samples.json @@ -2,9 +2,7 @@ "extends": "../../../tsconfig.samples.base.json", "compilerOptions": { "paths": { - "@azure/arm-batch": [ - "./dist/esm" - ] + "@azure/arm-batch": ["./dist/esm"] } } } diff --git a/sdk/batch/arm-batch/tsp-location.yaml b/sdk/batch/arm-batch/tsp-location.yaml new file mode 100644 index 000000000000..2e881502848c --- /dev/null +++ b/sdk/batch/arm-batch/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/batch/resource-manager/Microsoft.Batch/Batch +commit: 74cc90c49189a079b3cc93fde9c9ad76742f0184 +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/batch/arm-batch/vitest.esm.config.ts b/sdk/batch/arm-batch/vitest.esm.config.ts new file mode 100644 index 000000000000..5e9735e9b144 --- /dev/null +++ b/sdk/batch/arm-batch/vitest.esm.config.ts @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { mergeConfig } from "vitest/config"; +import vitestConfig from "./vitest.config.ts"; +import vitestEsmConfig from "../../../vitest.esm.shared.config.ts"; + +export default mergeConfig(vitestConfig, vitestEsmConfig); diff --git a/sdk/batch/arm-batch/warp.config.yml b/sdk/batch/arm-batch/warp.config.yml deleted file mode 100644 index f90f8c2646b0..000000000000 --- a/sdk/batch/arm-batch/warp.config.yml +++ /dev/null @@ -1,15 +0,0 @@ -exports: - "./package.json": "./package.json" - ".": "./src/index.ts" - -targets: - - name: browser - tsconfig: "../../../tsconfig.src.browser.json" - - name: react-native - tsconfig: "../../../tsconfig.src.react-native.json" - - name: esm - condition: import - tsconfig: "../../../tsconfig.src.esm.json" - - name: commonjs - condition: require - tsconfig: "../../../tsconfig.src.cjs.json"