From b3994b1eaf0d1faed612939e9afb2a36f482687a Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 27 Sep 2024 03:42:33 +0000 Subject: [PATCH] CodeGen from PR 30768 in Azure/azure-rest-api-specs Merge f857628ff2d7bfaaefb117ed52ddcd5f082fdad0 into 139840784c38414085b3d799cee5545f9b6e8dec --- common/config/rush/pnpm-lock.yaml | 23 +- sdk/batch/batch-rest/CHANGELOG.md | 8 +- sdk/batch/batch-rest/LICENSE | 21 + sdk/batch/batch-rest/README.md | 30 +- sdk/batch/batch-rest/api-extractor.json | 25 +- sdk/batch/batch-rest/assets.json | 6 - sdk/batch/batch-rest/eslint.config.mjs | 9 +- sdk/batch/batch-rest/generated/batchClient.ts | 71 - .../batch-rest/generated/clientDefinitions.ts | 1164 ------ sdk/batch/batch-rest/generated/index.ts | 15 - .../batch-rest/generated/isUnexpected.ts | 751 ---- sdk/batch/batch-rest/generated/logger.ts | 5 - sdk/batch/batch-rest/generated/models.ts | 1576 -------- .../batch-rest/generated/outputModels.ts | 2192 ---------- .../batch-rest/generated/paginateHelper.ts | 200 - sdk/batch/batch-rest/generated/parameters.ts | 3526 ----------------- sdk/batch/batch-rest/generated/responses.ts | 1673 -------- sdk/batch/batch-rest/package.json | 99 +- sdk/batch/batch-rest/review/batch.api.md | 7 +- sdk/batch/batch-rest/sample.env | 3 - .../batch-rest/samples-dev/quick-start.ts | 155 - .../samples/v1-beta/javascript/README.md | 50 - .../samples/v1-beta/javascript/package.json | 33 - .../samples/v1-beta/javascript/quick-start.js | 148 - .../samples/v1-beta/javascript/sample.env | 3 - .../samples/v1-beta/typescript/README.md | 63 - .../samples/v1-beta/typescript/package.json | 42 - .../samples/v1-beta/typescript/sample.env | 3 - .../v1-beta/typescript/src/quick-start.ts | 155 - .../samples/v1-beta/typescript/tsconfig.json | 17 - sdk/batch/batch-rest/src/batchClient.ts | 66 +- sdk/batch/batch-rest/src/clientDefinitions.ts | 276 +- .../batchSharedKeyCredentials-browser.mts | 11 - ...batchSharedKeyCredentials-react-native.mts | 11 - .../credentials/batchSharedKeyCredentials.ts | 147 - sdk/batch/batch-rest/src/index.ts | 1 - sdk/batch/batch-rest/src/isUnexpected.ts | 70 +- sdk/batch/batch-rest/src/models.ts | 246 +- sdk/batch/batch-rest/src/outputModels.ts | 354 +- sdk/batch/batch-rest/src/paginateHelper.ts | 41 +- sdk/batch/batch-rest/src/parameters.ts | 59 +- .../src/replacePoolPropertiesPolicy.ts | 36 - sdk/batch/batch-rest/src/responses.ts | 9 +- .../browser/batchSharedKeyCredentials.spec.ts | 12 - .../batch-rest/test/computeNodes.spec.ts | 267 -- .../batch-rest/test/jobSchedules.spec.ts | 232 -- sdk/batch/batch-rest/test/jobs.spec.ts | 243 -- sdk/batch/batch-rest/test/poolScaling.spec.ts | 177 - sdk/batch/batch-rest/test/pools.spec.ts | 679 ---- .../batch-rest/test/public/sampleTest.spec.ts | 21 + .../test/public/utils/recordedClient.ts | 29 + sdk/batch/batch-rest/test/tasks.spec.ts | 530 --- .../batch-rest/test/utils/env.browser.ts | 2 - sdk/batch/batch-rest/test/utils/env.ts | 6 - .../batch-rest/test/utils/fakeTestSecrets.ts | 12 - sdk/batch/batch-rest/test/utils/helpers.ts | 30 - .../batch-rest/test/utils/recordedClient.ts | 96 - sdk/batch/batch-rest/test/utils/wait.ts | 10 - sdk/batch/batch-rest/tsconfig.json | 7 +- sdk/batch/batch-rest/tsp-location.yaml | 6 +- sdk/batch/batch-rest/vitest.browser.config.ts | 23 +- sdk/batch/batch-rest/vitest.config.ts | 6 +- sdk/batch/ci.yml | 6 +- 63 files changed, 1055 insertions(+), 14739 deletions(-) create mode 100644 sdk/batch/batch-rest/LICENSE delete mode 100644 sdk/batch/batch-rest/assets.json delete mode 100644 sdk/batch/batch-rest/generated/batchClient.ts delete mode 100644 sdk/batch/batch-rest/generated/clientDefinitions.ts delete mode 100644 sdk/batch/batch-rest/generated/index.ts delete mode 100644 sdk/batch/batch-rest/generated/isUnexpected.ts delete mode 100644 sdk/batch/batch-rest/generated/logger.ts delete mode 100644 sdk/batch/batch-rest/generated/models.ts delete mode 100644 sdk/batch/batch-rest/generated/outputModels.ts delete mode 100644 sdk/batch/batch-rest/generated/paginateHelper.ts delete mode 100644 sdk/batch/batch-rest/generated/parameters.ts delete mode 100644 sdk/batch/batch-rest/generated/responses.ts delete mode 100644 sdk/batch/batch-rest/sample.env delete mode 100644 sdk/batch/batch-rest/samples-dev/quick-start.ts delete mode 100644 sdk/batch/batch-rest/samples/v1-beta/javascript/README.md delete mode 100644 sdk/batch/batch-rest/samples/v1-beta/javascript/package.json delete mode 100644 sdk/batch/batch-rest/samples/v1-beta/javascript/quick-start.js delete mode 100644 sdk/batch/batch-rest/samples/v1-beta/javascript/sample.env delete mode 100644 sdk/batch/batch-rest/samples/v1-beta/typescript/README.md delete mode 100644 sdk/batch/batch-rest/samples/v1-beta/typescript/package.json delete mode 100644 sdk/batch/batch-rest/samples/v1-beta/typescript/sample.env delete mode 100644 sdk/batch/batch-rest/samples/v1-beta/typescript/src/quick-start.ts delete mode 100644 sdk/batch/batch-rest/samples/v1-beta/typescript/tsconfig.json delete mode 100644 sdk/batch/batch-rest/src/credentials/batchSharedKeyCredentials-browser.mts delete mode 100644 sdk/batch/batch-rest/src/credentials/batchSharedKeyCredentials-react-native.mts delete mode 100644 sdk/batch/batch-rest/src/credentials/batchSharedKeyCredentials.ts delete mode 100644 sdk/batch/batch-rest/src/replacePoolPropertiesPolicy.ts delete mode 100644 sdk/batch/batch-rest/test/browser/batchSharedKeyCredentials.spec.ts delete mode 100644 sdk/batch/batch-rest/test/computeNodes.spec.ts delete mode 100644 sdk/batch/batch-rest/test/jobSchedules.spec.ts delete mode 100644 sdk/batch/batch-rest/test/jobs.spec.ts delete mode 100644 sdk/batch/batch-rest/test/poolScaling.spec.ts delete mode 100644 sdk/batch/batch-rest/test/pools.spec.ts create mode 100644 sdk/batch/batch-rest/test/public/sampleTest.spec.ts create mode 100644 sdk/batch/batch-rest/test/public/utils/recordedClient.ts delete mode 100644 sdk/batch/batch-rest/test/tasks.spec.ts delete mode 100644 sdk/batch/batch-rest/test/utils/env.browser.ts delete mode 100644 sdk/batch/batch-rest/test/utils/env.ts delete mode 100644 sdk/batch/batch-rest/test/utils/fakeTestSecrets.ts delete mode 100644 sdk/batch/batch-rest/test/utils/helpers.ts delete mode 100644 sdk/batch/batch-rest/test/utils/recordedClient.ts delete mode 100644 sdk/batch/batch-rest/test/utils/wait.ts diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 0c39bffa5ee4..2474474a4ecc 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -16732,7 +16732,7 @@ packages: dev: false file:projects/arm-mongocluster.tgz: - resolution: {integrity: sha512-5qfO0a31+swfnXGpyq3cmrbZ8Bj0tsLzx4frzixKRWNYsjpj3dbGiuLoIQDzcaw7mADeSVcXqduGOLAPxhtsdw==, tarball: file:projects/arm-mongocluster.tgz} + resolution: {integrity: sha512-EU8WPXxVnF2TP9sFdHD+Fhu0oD4WBj2gtulPY6pw393PtU2cp7IyaeETiBLyH2xxw4WRCyX1pjtNxADgOWpq1g==, tarball: file:projects/arm-mongocluster.tgz} name: '@rush-temp/arm-mongocluster' version: 0.0.0 dependencies: @@ -19822,7 +19822,7 @@ packages: dev: false file:projects/batch.tgz: - resolution: {integrity: sha512-qcejYVKun66XfHmA/hkE/MzrE/Wd7ZohaNc47LLKtziqFrTEbvhvHct55kMvhO5btpLaKyyY5h/DHxniRhBEqw==, tarball: file:projects/batch.tgz} + resolution: {integrity: sha512-qnOXW1ACDxEHILeYBqig/rZOJTSK3bUjNimsthbPk1zldY8eSa6Ke8aWkoeS1lwWYmGWpxaIw6Mh7h8MvYywmQ==, tarball: file:projects/batch.tgz} name: '@rush-temp/batch' version: 0.0.0 dependencies: @@ -19831,28 +19831,29 @@ packages: '@azure/identity': 4.4.1 '@microsoft/api-extractor': 7.47.9(@types/node@18.19.50) '@types/node': 18.19.50 - '@vitest/browser': 1.6.0(playwright@1.47.2)(vitest@1.6.0) - '@vitest/coverage-istanbul': 1.6.0(vitest@1.6.0) + '@vitest/browser': 2.1.1(playwright@1.47.2)(typescript@5.5.4)(vitest@2.1.1) + '@vitest/coverage-istanbul': 2.1.1(vitest@2.1.1) dotenv: 16.4.5 - eslint: 9.11.0 + eslint: 8.57.1 loupe: 3.1.1 - mkdirp: 2.1.6 + mkdirp: 3.0.1 moment: 2.30.1 playwright: 1.47.2 prettier: 3.3.3 rimraf: 5.0.10 - tshy: 2.0.1 + tshy: 1.18.0 tslib: 2.7.0 - typescript: 5.6.2 - vitest: 1.6.0(@types/node@18.19.50)(@vitest/browser@1.6.0) + typescript: 5.5.4 + vitest: 2.1.1(@types/node@18.19.50)(@vitest/browser@2.1.1) transitivePeerDependencies: - '@edge-runtime/vm' - '@vitest/ui' + - bufferutil - happy-dom - - jiti - jsdom - less - lightningcss + - msw - safaridriver - sass - sass-embedded @@ -19860,6 +19861,8 @@ packages: - sugarss - supports-color - terser + - utf-8-validate + - vite - webdriverio dev: false diff --git a/sdk/batch/batch-rest/CHANGELOG.md b/sdk/batch/batch-rest/CHANGELOG.md index d2d14d47afed..7aaaa82fc36a 100644 --- a/sdk/batch/batch-rest/CHANGELOG.md +++ b/sdk/batch/batch-rest/CHANGELOG.md @@ -1,7 +1,3 @@ -# Release History +## 1.0.0-beta.1 (2024-09-27) -## 1.0.0-beta.1 (2024-08-07) - -### Features Added - -- This is the initial beta release for the Azure Batch SDK, which is a common API supporting Azure Batch services. + - Initial Release diff --git a/sdk/batch/batch-rest/LICENSE b/sdk/batch/batch-rest/LICENSE new file mode 100644 index 000000000000..7d5934740965 --- /dev/null +++ b/sdk/batch/batch-rest/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2024 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +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. \ No newline at end of file diff --git a/sdk/batch/batch-rest/README.md b/sdk/batch/batch-rest/README.md index e01499f07b90..27abc762cfcf 100644 --- a/sdk/batch/batch-rest/README.md +++ b/sdk/batch/batch-rest/README.md @@ -6,7 +6,8 @@ Azure Batch provides Cloud-scale job scheduling and compute management. Key links: -TODO: Add links back when the package is published +- [Package (NPM)](https://www.npmjs.com/package/@azure-rest/batch) +- [API reference documentation](https://docs.microsoft.com/javascript/api/@azure-rest/batch?view=azure-node-preview) ## Getting started @@ -20,7 +21,7 @@ TODO: Add links back when the package is published ### Install the `@azure-rest/batch` package -Install the Azure Batch REST client library for JavaScript with `npm`: +Install the Azure Batch REST client REST client library for JavaScript with `npm`: ```bash npm install @azure-rest/batch @@ -28,38 +29,19 @@ npm install @azure-rest/batch ### Create and authenticate a `BatchClient` -Azure batch supports authentication either via Microsoft Entra ID or Shared Key. - -- [Microsoft Entra ID](#microsoft-entra-id) -- [Shared Key](#shared-key) - -#### Microsoft Entra ID - -To use an [Microsoft Entra ID token credential](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 an [Azure Active Directory (AAD) token credential](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token), provide an instance of the desired credential type obtained from the [@azure/identity](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#credentials) library. -To authenticate with Microsoft Entra ID, you must first `npm` install [`@azure/identity`](https://www.npmjs.com/package/@azure/identity) +To authenticate with AAD, you must first `npm` install [`@azure/identity`](https://www.npmjs.com/package/@azure/identity) After setup, you can choose which type of [credential](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#credentials) from `@azure/identity` to use. As an example, [DefaultAzureCredential](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential) can be used to authenticate the client. -Set the values of the client ID, tenant ID, and client secret of the Microsoft Entra ID application as environment variables: +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 -#### Shared Key - -To use shared key to authenticate, you must first `npm` install [`@azure/core-auth`](https://www.npmjs.com/package/@azure/core-auth), then provide the account name and account key to construct the an `AzureNamedKeyCredential` credential from `@azure/core-auth` - -```typescript -import { AzureNamedKeyCredential } from "@azure/core-auth"; -import createClient from "@azure-rest/batch"; - -const credential = new AzureNamedKeyCredential("", ""); -const batchClient = createClient("", credential); -``` - ## Troubleshooting ### Logging diff --git a/sdk/batch/batch-rest/api-extractor.json b/sdk/batch/batch-rest/api-extractor.json index 66e454b87cac..92f88cfb806c 100644 --- a/sdk/batch/batch-rest/api-extractor.json +++ b/sdk/batch/batch-rest/api-extractor.json @@ -1,18 +1,31 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", "mainEntryPointFilePath": "./dist/esm/index.d.ts", - "docModel": { "enabled": true }, - "apiReport": { "enabled": true, "reportFolder": "./review" }, + "docModel": { + "enabled": true + }, + "apiReport": { + "enabled": true, + "reportFolder": "./review" + }, "dtsRollup": { "enabled": true, "untrimmedFilePath": "", "publicTrimmedFilePath": "./types/batch.d.ts" }, "messages": { - "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "tsdocMessageReporting": { + "default": { + "logLevel": "none" + } + }, "extractorMessageReporting": { - "ae-missing-release-tag": { "logLevel": "none" }, - "ae-unresolved-link": { "logLevel": "none" } + "ae-missing-release-tag": { + "logLevel": "none" + }, + "ae-unresolved-link": { + "logLevel": "none" + } } } -} +} \ No newline at end of file diff --git a/sdk/batch/batch-rest/assets.json b/sdk/batch/batch-rest/assets.json deleted file mode 100644 index 9df6ed63846e..000000000000 --- a/sdk/batch/batch-rest/assets.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "AssetsRepo": "Azure/azure-sdk-assets", - "AssetsRepoPrefixPath": "js", - "TagPrefix": "js/batch/batch-rest", - "Tag": "js/batch/batch-rest_dee9657e" -} diff --git a/sdk/batch/batch-rest/eslint.config.mjs b/sdk/batch/batch-rest/eslint.config.mjs index e559ed8cb5bd..113bdc3eaf5f 100644 --- a/sdk/batch/batch-rest/eslint.config.mjs +++ b/sdk/batch/batch-rest/eslint.config.mjs @@ -8,7 +8,10 @@ export default [ "@azure/azure-sdk/ts-apiextractor-json-types": "warn", "@azure/azure-sdk/ts-package-json-types": "warn", "@azure/azure-sdk/ts-package-json-engine-is-present": "warn", - "tsdoc/syntax": "warn", - }, - }, + "@azure/azure-sdk/ts-package-json-module": "off", + "@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/batch-rest/generated/batchClient.ts b/sdk/batch/batch-rest/generated/batchClient.ts deleted file mode 100644 index 1bf6345c9680..000000000000 --- a/sdk/batch/batch-rest/generated/batchClient.ts +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { getClient, ClientOptions } from "@azure-rest/core-client"; -import { logger } from "./logger.js"; -import { TokenCredential } from "@azure/core-auth"; -import { BatchClient } from "./clientDefinitions.js"; - -/** The optional parameters for the client */ -export interface BatchClientOptions extends ClientOptions { - /** The api version option of the client */ - apiVersion?: string; -} - -/** - * Initialize a new instance of `BatchClient` - * @param endpointParam - Batch account endpoint (for example: https://batchaccount.eastus2.batch.azure.com). - * @param credentials - uniquely identify client credential - * @param options - the parameter for all optional parameters - */ -export default function createClient( - endpointParam: string, - credentials: TokenCredential, - { apiVersion = "2024-02-01.19.0", ...options }: BatchClientOptions = {}, -): BatchClient { - const endpointUrl = options.endpoint ?? options.baseUrl ?? `${endpointParam}`; - const userAgentInfo = `azsdk-js-batch-rest/1.0.0-beta.1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}` - : `${userAgentInfo}`; - options = { - ...options, - userAgentOptions: { - userAgentPrefix, - }, - loggingOptions: { - logger: options.loggingOptions?.logger ?? logger.info, - }, - telemetryOptions: { - clientRequestIdHeaderName: - options.telemetryOptions?.clientRequestIdHeaderName ?? - "client-request-id", - }, - credentials: { - scopes: options.credentials?.scopes ?? [ - "https://batch.core.windows.net//.default", - ], - }, - }; - const client = getClient(endpointUrl, credentials, options) as BatchClient; - - client.pipeline.removePolicy({ name: "ApiVersionPolicy" }); - client.pipeline.addPolicy({ - name: "ClientApiVersionPolicy", - sendRequest: (req, next) => { - // Use the apiVersion defined in request url directly - // Append one if there is no apiVersion and we have one at client options - const url = new URL(req.url); - if (!url.searchParams.get("api-version") && apiVersion) { - req.url = `${req.url}${ - Array.from(url.searchParams.keys()).length > 0 ? "&" : "?" - }api-version=${apiVersion}`; - } - - return next(req); - }, - }); - - return client; -} diff --git a/sdk/batch/batch-rest/generated/clientDefinitions.ts b/sdk/batch/batch-rest/generated/clientDefinitions.ts deleted file mode 100644 index e0a80065d2e3..000000000000 --- a/sdk/batch/batch-rest/generated/clientDefinitions.ts +++ /dev/null @@ -1,1164 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { - ListApplicationsParameters, - GetApplicationParameters, - ListPoolUsageMetricsParameters, - CreatePoolParameters, - ListPoolsParameters, - DeletePoolParameters, - PoolExistsParameters, - GetPoolParameters, - UpdatePoolParameters, - DisablePoolAutoScaleParameters, - EnablePoolAutoScaleParameters, - EvaluatePoolAutoScaleParameters, - ResizePoolParameters, - StopPoolResizeParameters, - ReplacePoolPropertiesParameters, - RemoveNodesParameters, - ListSupportedImagesParameters, - ListPoolNodeCountsParameters, - DeleteJobParameters, - GetJobParameters, - UpdateJobParameters, - ReplaceJobParameters, - DisableJobParameters, - EnableJobParameters, - TerminateJobParameters, - CreateJobParameters, - ListJobsParameters, - ListJobsFromScheduleParameters, - ListJobPreparationAndReleaseTaskStatusParameters, - GetJobTaskCountsParameters, - JobScheduleExistsParameters, - DeleteJobScheduleParameters, - GetJobScheduleParameters, - UpdateJobScheduleParameters, - ReplaceJobScheduleParameters, - DisableJobScheduleParameters, - EnableJobScheduleParameters, - TerminateJobScheduleParameters, - CreateJobScheduleParameters, - ListJobSchedulesParameters, - CreateTaskParameters, - ListTasksParameters, - CreateTaskCollectionParameters, - DeleteTaskParameters, - GetTaskParameters, - ReplaceTaskParameters, - ListSubTasksParameters, - TerminateTaskParameters, - ReactivateTaskParameters, - DeleteTaskFileParameters, - GetTaskFileParameters, - GetTaskFilePropertiesParameters, - ListTaskFilesParameters, - CreateNodeUserParameters, - DeleteNodeUserParameters, - ReplaceNodeUserParameters, - GetNodeParameters, - RebootNodeParameters, - DisableNodeSchedulingParameters, - EnableNodeSchedulingParameters, - GetNodeRemoteLoginSettingsParameters, - UploadNodeLogsParameters, - ListNodesParameters, - GetNodeExtensionParameters, - ListNodeExtensionsParameters, - DeleteNodeFileParameters, - GetNodeFileParameters, - GetNodeFilePropertiesParameters, - ListNodeFilesParameters, -} from "./parameters.js"; -import { - ListApplications200Response, - ListApplicationsDefaultResponse, - GetApplication200Response, - GetApplicationDefaultResponse, - ListPoolUsageMetrics200Response, - ListPoolUsageMetricsDefaultResponse, - CreatePool201Response, - CreatePoolDefaultResponse, - ListPools200Response, - ListPoolsDefaultResponse, - DeletePool202Response, - DeletePoolDefaultResponse, - PoolExists200Response, - PoolExists404Response, - PoolExistsDefaultResponse, - GetPool200Response, - GetPoolDefaultResponse, - UpdatePool200Response, - UpdatePoolDefaultResponse, - DisablePoolAutoScale200Response, - DisablePoolAutoScaleDefaultResponse, - EnablePoolAutoScale200Response, - EnablePoolAutoScaleDefaultResponse, - EvaluatePoolAutoScale200Response, - EvaluatePoolAutoScaleDefaultResponse, - ResizePool202Response, - ResizePoolDefaultResponse, - StopPoolResize202Response, - StopPoolResizeDefaultResponse, - ReplacePoolProperties204Response, - ReplacePoolPropertiesDefaultResponse, - RemoveNodes202Response, - RemoveNodesDefaultResponse, - ListSupportedImages200Response, - ListSupportedImagesDefaultResponse, - ListPoolNodeCounts200Response, - ListPoolNodeCountsDefaultResponse, - DeleteJob202Response, - DeleteJobDefaultResponse, - GetJob200Response, - GetJobDefaultResponse, - UpdateJob200Response, - UpdateJobDefaultResponse, - ReplaceJob200Response, - ReplaceJobDefaultResponse, - DisableJob202Response, - DisableJobDefaultResponse, - EnableJob202Response, - EnableJobDefaultResponse, - TerminateJob202Response, - TerminateJobDefaultResponse, - CreateJob201Response, - CreateJobDefaultResponse, - ListJobs200Response, - ListJobsDefaultResponse, - ListJobsFromSchedule200Response, - ListJobsFromScheduleDefaultResponse, - ListJobPreparationAndReleaseTaskStatus200Response, - ListJobPreparationAndReleaseTaskStatusDefaultResponse, - GetJobTaskCounts200Response, - GetJobTaskCountsDefaultResponse, - JobScheduleExists200Response, - JobScheduleExists404Response, - JobScheduleExistsDefaultResponse, - DeleteJobSchedule202Response, - DeleteJobScheduleDefaultResponse, - GetJobSchedule200Response, - GetJobScheduleDefaultResponse, - UpdateJobSchedule200Response, - UpdateJobScheduleDefaultResponse, - ReplaceJobSchedule200Response, - ReplaceJobScheduleDefaultResponse, - DisableJobSchedule204Response, - DisableJobScheduleDefaultResponse, - EnableJobSchedule204Response, - EnableJobScheduleDefaultResponse, - TerminateJobSchedule202Response, - TerminateJobScheduleDefaultResponse, - CreateJobSchedule201Response, - CreateJobScheduleDefaultResponse, - ListJobSchedules200Response, - ListJobSchedulesDefaultResponse, - CreateTask201Response, - CreateTaskDefaultResponse, - ListTasks200Response, - ListTasksDefaultResponse, - CreateTaskCollection200Response, - CreateTaskCollectionDefaultResponse, - DeleteTask200Response, - DeleteTaskDefaultResponse, - GetTask200Response, - GetTaskDefaultResponse, - ReplaceTask200Response, - ReplaceTaskDefaultResponse, - ListSubTasks200Response, - ListSubTasksDefaultResponse, - TerminateTask204Response, - TerminateTaskDefaultResponse, - ReactivateTask204Response, - ReactivateTaskDefaultResponse, - DeleteTaskFile200Response, - DeleteTaskFileDefaultResponse, - GetTaskFile200Response, - GetTaskFileDefaultResponse, - GetTaskFileProperties200Response, - GetTaskFilePropertiesDefaultResponse, - ListTaskFiles200Response, - ListTaskFilesDefaultResponse, - CreateNodeUser201Response, - CreateNodeUserDefaultResponse, - DeleteNodeUser200Response, - DeleteNodeUserDefaultResponse, - ReplaceNodeUser200Response, - ReplaceNodeUserDefaultResponse, - GetNode200Response, - GetNodeDefaultResponse, - RebootNode202Response, - RebootNodeDefaultResponse, - DisableNodeScheduling200Response, - DisableNodeSchedulingDefaultResponse, - EnableNodeScheduling200Response, - EnableNodeSchedulingDefaultResponse, - GetNodeRemoteLoginSettings200Response, - GetNodeRemoteLoginSettingsDefaultResponse, - UploadNodeLogs200Response, - UploadNodeLogsDefaultResponse, - ListNodes200Response, - ListNodesDefaultResponse, - GetNodeExtension200Response, - GetNodeExtensionDefaultResponse, - ListNodeExtensions200Response, - ListNodeExtensionsDefaultResponse, - DeleteNodeFile200Response, - DeleteNodeFileDefaultResponse, - GetNodeFile200Response, - GetNodeFileDefaultResponse, - GetNodeFileProperties200Response, - GetNodeFilePropertiesDefaultResponse, - ListNodeFiles200Response, - ListNodeFilesDefaultResponse, -} from "./responses.js"; -import { Client, StreamableMethod } from "@azure-rest/core-client"; - -export interface ListApplications { - /** - * This operation returns only Applications and versions that are available for - * use on Compute Nodes; that is, that can be used in an Package reference. For - * administrator information about applications and versions that are not yet - * available to Compute Nodes, use the Azure portal or the Azure Resource Manager - * API. - */ - get( - options?: ListApplicationsParameters, - ): StreamableMethod< - ListApplications200Response | ListApplicationsDefaultResponse - >; -} - -export interface GetApplication { - /** - * This operation returns only Applications and versions that are available for - * use on Compute Nodes; that is, that can be used in an Package reference. For - * administrator information about Applications and versions that are not yet - * available to Compute Nodes, use the Azure portal or the Azure Resource Manager - * API. - */ - get( - options?: GetApplicationParameters, - ): StreamableMethod< - GetApplication200Response | GetApplicationDefaultResponse - >; -} - -export interface ListPoolUsageMetrics { - /** - * If you do not specify a $filter clause including a poolId, the response - * includes all Pools that existed in the Account in the time range of the - * returned aggregation intervals. If you do not specify a $filter clause - * including a startTime or endTime these filters default to the start and end - * times of the last aggregation interval currently available; that is, only the - * last aggregation interval is returned. - */ - get( - options?: ListPoolUsageMetricsParameters, - ): StreamableMethod< - ListPoolUsageMetrics200Response | ListPoolUsageMetricsDefaultResponse - >; -} - -export interface CreatePool { - /** - * When naming Pools, avoid including sensitive information such as user names or - * secret project names. This information may appear in telemetry logs accessible - * to Microsoft Support engineers. - */ - post( - options: CreatePoolParameters, - ): StreamableMethod; - /** Lists all of the Pools in the specified Account. */ - get( - options?: ListPoolsParameters, - ): StreamableMethod; -} - -export interface DeletePool { - /** - * When you request that a Pool be deleted, the following actions occur: the Pool - * state is set to deleting; any ongoing resize operation on the Pool are stopped; - * the Batch service starts resizing the Pool to zero Compute Nodes; any Tasks - * running on existing Compute Nodes are terminated and requeued (as if a resize - * Pool operation had been requested with the default requeue option); finally, - * the Pool is removed from the system. Because running Tasks are requeued, the - * user can rerun these Tasks by updating their Job to target a different Pool. - * The Tasks can then run on the new Pool. If you want to override the requeue - * behavior, then you should call resize Pool explicitly to shrink the Pool to - * zero size before deleting the Pool. If you call an Update, Patch or Delete API - * on a Pool in the deleting state, it will fail with HTTP status code 409 with - * error code PoolBeingDeleted. - */ - delete( - options?: DeletePoolParameters, - ): StreamableMethod; - /** Gets basic properties of a Pool. */ - head( - options?: PoolExistsParameters, - ): StreamableMethod< - PoolExists200Response | PoolExists404Response | PoolExistsDefaultResponse - >; - /** Gets information about the specified Pool. */ - get( - options?: GetPoolParameters, - ): StreamableMethod; - /** - * This only replaces the Pool properties specified in the request. For example, - * if the Pool has a StartTask associated with it, and a request does not specify - * a StartTask element, then the Pool keeps the existing StartTask. - */ - patch( - options: UpdatePoolParameters, - ): StreamableMethod; -} - -export interface DisablePoolAutoScale { - /** Disables automatic scaling for a Pool. */ - post( - options?: DisablePoolAutoScaleParameters, - ): StreamableMethod< - DisablePoolAutoScale200Response | DisablePoolAutoScaleDefaultResponse - >; -} - -export interface EnablePoolAutoScale { - /** - * You cannot enable automatic scaling on a Pool if a resize operation is in - * progress on the Pool. If automatic scaling of the Pool is currently disabled, - * you must specify a valid autoscale formula as part of the request. If automatic - * scaling of the Pool is already enabled, you may specify a new autoscale formula - * and/or a new evaluation interval. You cannot call this API for the same Pool - * more than once every 30 seconds. - */ - post( - options: EnablePoolAutoScaleParameters, - ): StreamableMethod< - EnablePoolAutoScale200Response | EnablePoolAutoScaleDefaultResponse - >; -} - -export interface EvaluatePoolAutoScale { - /** - * This API is primarily for validating an autoscale formula, as it simply returns - * the result without applying the formula to the Pool. The Pool must have auto - * scaling enabled in order to evaluate a formula. - */ - post( - options: EvaluatePoolAutoScaleParameters, - ): StreamableMethod< - EvaluatePoolAutoScale200Response | EvaluatePoolAutoScaleDefaultResponse - >; -} - -export interface ResizePool { - /** - * You can only resize a Pool when its allocation state is steady. If the Pool is - * already resizing, the request fails with status code 409. When you resize a - * Pool, the Pool's allocation state changes from steady to resizing. You cannot - * resize Pools which are configured for automatic scaling. If you try to do this, - * the Batch service returns an error 409. If you resize a Pool downwards, the - * Batch service chooses which Compute Nodes to remove. To remove specific Compute - * Nodes, use the Pool remove Compute Nodes API instead. - */ - post( - options: ResizePoolParameters, - ): StreamableMethod; -} - -export interface StopPoolResize { - /** - * 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 Compute - * 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. - */ - post( - options?: StopPoolResizeParameters, - ): StreamableMethod< - StopPoolResize202Response | StopPoolResizeDefaultResponse - >; -} - -export interface ReplacePoolProperties { - /** - * This fully replaces all the updatable properties of the Pool. For example, if - * the Pool has a StartTask associated with it and if StartTask is not specified - * with this request, then the Batch service will remove the existing StartTask. - */ - post( - options: ReplacePoolPropertiesParameters, - ): StreamableMethod< - ReplacePoolProperties204Response | ReplacePoolPropertiesDefaultResponse - >; -} - -export interface RemoveNodes { - /** - * This operation can only run when the allocation state of the Pool is steady. - * When this operation runs, the allocation state changes from steady to resizing. - * Each request may remove up to 100 nodes. - */ - post( - options: RemoveNodesParameters, - ): StreamableMethod; -} - -export interface ListSupportedImages { - /** Lists all Virtual Machine Images supported by the Azure Batch service. */ - get( - options?: ListSupportedImagesParameters, - ): StreamableMethod< - ListSupportedImages200Response | ListSupportedImagesDefaultResponse - >; -} - -export interface ListPoolNodeCounts { - /** - * Gets the number of Compute Nodes in each state, grouped by Pool. Note that the - * numbers returned may not always be up to date. If you need exact node counts, - * use a list query. - */ - get( - options?: ListPoolNodeCountsParameters, - ): StreamableMethod< - ListPoolNodeCounts200Response | ListPoolNodeCountsDefaultResponse - >; -} - -export interface DeleteJob { - /** - * Deleting a Job also deletes all Tasks that are part of that Job, and all Job - * statistics. This also overrides the retention period for Task data; that is, if - * the Job contains Tasks which are still retained on Compute Nodes, the Batch - * services deletes those Tasks' working directories and all their contents. When - * a Delete Job request is received, the Batch service sets the Job to the - * deleting state. All update operations on a Job that is in deleting state will - * fail with status code 409 (Conflict), with additional information indicating - * that the Job is being deleted. - */ - delete( - options?: DeleteJobParameters, - ): StreamableMethod; - /** Gets information about the specified Job. */ - get( - options?: GetJobParameters, - ): StreamableMethod; - /** - * This replaces only the Job properties specified in the request. For example, if - * the Job has constraints, and a request does not specify the constraints - * element, then the Job keeps the existing constraints. - */ - patch( - options: UpdateJobParameters, - ): StreamableMethod; - /** - * This fully replaces all the updatable properties of the Job. For example, if - * the Job has constraints associated with it and if constraints is not specified - * with this request, then the Batch service will remove the existing constraints. - */ - put( - options: ReplaceJobParameters, - ): StreamableMethod; -} - -export interface DisableJob { - /** - * The Batch Service immediately moves the Job to the disabling state. Batch then - * uses the disableTasks parameter to determine what to do with the currently - * running Tasks of the Job. The Job remains in the disabling state until the - * disable operation is completed and all Tasks have been dealt with according to - * the disableTasks option; the Job then moves to the disabled state. No new Tasks - * are started under the Job until it moves back to active state. If you try to - * disable a Job that is in any state other than active, disabling, or disabled, - * the request fails with status code 409. - */ - post( - options: DisableJobParameters, - ): StreamableMethod; -} - -export interface EnableJob { - /** - * When you call this API, the Batch service sets a disabled Job to the enabling - * state. After the this operation is completed, the Job moves to the active - * state, and scheduling of new Tasks under the Job resumes. The Batch service - * does not allow a Task to remain in the active state for more than 180 days. - * Therefore, if you enable a Job containing active Tasks which were added more - * than 180 days ago, those Tasks will not run. - */ - post( - options?: EnableJobParameters, - ): StreamableMethod; -} - -export interface TerminateJob { - /** - * When a Terminate Job request is received, the Batch service sets the Job to the - * terminating state. The Batch service then terminates any running Tasks - * associated with the Job and runs any required Job release Tasks. Then the Job - * moves into the completed state. If there are any Tasks in the Job in the active - * state, they will remain in the active state. Once a Job is terminated, new - * Tasks cannot be added and any remaining active Tasks will not be scheduled. - */ - post( - options: TerminateJobParameters, - ): StreamableMethod; -} - -export interface CreateJob { - /** - * The Batch service supports two ways to control the work done as part of a Job. - * In the first approach, the user specifies a Job Manager Task. The Batch service - * launches this Task when it is ready to start the Job. The Job Manager Task - * controls all other Tasks that run under this Job, by using the Task APIs. In - * the second approach, the user directly controls the execution of Tasks under an - * active Job, by using the Task APIs. Also note: when naming Jobs, avoid - * including sensitive information such as user names or secret project names. - * This information may appear in telemetry logs accessible to Microsoft Support - * engineers. - */ - post( - options: CreateJobParameters, - ): StreamableMethod; - /** Lists all of the Jobs in the specified Account. */ - get( - options?: ListJobsParameters, - ): StreamableMethod; -} - -export interface ListJobsFromSchedule { - /** Lists the Jobs that have been created under the specified Job Schedule. */ - get( - options?: ListJobsFromScheduleParameters, - ): StreamableMethod< - ListJobsFromSchedule200Response | ListJobsFromScheduleDefaultResponse - >; -} - -export interface ListJobPreparationAndReleaseTaskStatus { - /** - * This API returns the Job Preparation and Job Release Task status on all Compute - * Nodes that have run the Job Preparation or Job Release Task. This includes - * Compute Nodes which have since been removed from the Pool. If this API is - * invoked on a Job which has no Job Preparation or Job Release Task, the Batch - * service returns HTTP status code 409 (Conflict) with an error code of - * JobPreparationTaskNotSpecified. - */ - get( - options?: ListJobPreparationAndReleaseTaskStatusParameters, - ): StreamableMethod< - | ListJobPreparationAndReleaseTaskStatus200Response - | ListJobPreparationAndReleaseTaskStatusDefaultResponse - >; -} - -export interface GetJobTaskCounts { - /** - * Task counts provide a count of the Tasks by active, running or completed Task - * state, and a count of Tasks which succeeded or failed. Tasks in the preparing - * state are counted as running. Note that the numbers returned may not always be - * up to date. If you need exact task counts, use a list query. - */ - get( - options?: GetJobTaskCountsParameters, - ): StreamableMethod< - GetJobTaskCounts200Response | GetJobTaskCountsDefaultResponse - >; -} - -export interface JobScheduleExists { - /** Checks the specified Job Schedule exists. */ - head( - options?: JobScheduleExistsParameters, - ): StreamableMethod< - | JobScheduleExists200Response - | JobScheduleExists404Response - | JobScheduleExistsDefaultResponse - >; - /** - * When you delete a Job Schedule, this also deletes all Jobs and Tasks under that - * schedule. When Tasks are deleted, all the files in their working directories on - * the Compute Nodes are also deleted (the retention period is ignored). The Job - * Schedule statistics are no longer accessible once the Job Schedule is deleted, - * though they are still counted towards Account lifetime statistics. - */ - delete( - options?: DeleteJobScheduleParameters, - ): StreamableMethod< - DeleteJobSchedule202Response | DeleteJobScheduleDefaultResponse - >; - /** Gets information about the specified Job Schedule. */ - get( - options?: GetJobScheduleParameters, - ): StreamableMethod< - GetJobSchedule200Response | GetJobScheduleDefaultResponse - >; - /** - * This replaces only the Job Schedule properties specified in the request. For - * example, if the schedule property is not specified with this request, then the - * Batch service will keep the existing schedule. Changes to a Job Schedule only - * impact Jobs created by the schedule after the update has taken place; currently - * running Jobs are unaffected. - */ - patch( - options: UpdateJobScheduleParameters, - ): StreamableMethod< - UpdateJobSchedule200Response | UpdateJobScheduleDefaultResponse - >; - /** - * This fully replaces all the updatable properties of the Job Schedule. For - * example, if the schedule property is not specified with this request, then the - * Batch service will remove the existing schedule. Changes to a Job Schedule only - * impact Jobs created by the schedule after the update has taken place; currently - * running Jobs are unaffected. - */ - put( - options: ReplaceJobScheduleParameters, - ): StreamableMethod< - ReplaceJobSchedule200Response | ReplaceJobScheduleDefaultResponse - >; -} - -export interface DisableJobSchedule { - /** No new Jobs will be created until the Job Schedule is enabled again. */ - post( - options?: DisableJobScheduleParameters, - ): StreamableMethod< - DisableJobSchedule204Response | DisableJobScheduleDefaultResponse - >; -} - -export interface EnableJobSchedule { - /** Enables a Job Schedule. */ - post( - options?: EnableJobScheduleParameters, - ): StreamableMethod< - EnableJobSchedule204Response | EnableJobScheduleDefaultResponse - >; -} - -export interface TerminateJobSchedule { - /** Terminates a Job Schedule. */ - post( - options?: TerminateJobScheduleParameters, - ): StreamableMethod< - TerminateJobSchedule202Response | TerminateJobScheduleDefaultResponse - >; -} - -export interface CreateJobSchedule { - /** Creates a Job Schedule to the specified Account. */ - post( - options: CreateJobScheduleParameters, - ): StreamableMethod< - CreateJobSchedule201Response | CreateJobScheduleDefaultResponse - >; - /** Lists all of the Job Schedules in the specified Account. */ - get( - options?: ListJobSchedulesParameters, - ): StreamableMethod< - ListJobSchedules200Response | ListJobSchedulesDefaultResponse - >; -} - -export interface CreateTask { - /** - * The maximum lifetime of a Task from addition to completion is 180 days. If a - * Task has not completed within 180 days of being added it will be terminated by - * the Batch service and left in whatever state it was in at that time. - */ - post( - options: CreateTaskParameters, - ): StreamableMethod; - /** - * For multi-instance Tasks, information such as affinityId, executionInfo and - * nodeInfo refer to the primary Task. Use the list subtasks API to retrieve - * information about subtasks. - */ - get( - options?: ListTasksParameters, - ): StreamableMethod; -} - -export interface CreateTaskCollection { - /** - * Note that each Task must have a unique ID. The Batch service may not return the - * results for each Task in the same order the Tasks were submitted in this - * request. If the server times out or the connection is closed during the - * request, the request may have been partially or fully processed, or not at all. - * In such cases, the user should re-issue the request. Note that it is up to the - * user to correctly handle failures when re-issuing a request. For example, you - * should use the same Task IDs during a retry so that if the prior operation - * succeeded, the retry will not create extra Tasks unexpectedly. If the response - * contains any Tasks which failed to add, a client can retry the request. In a - * retry, it is most efficient to resubmit only Tasks that failed to add, and to - * omit Tasks that were successfully added on the first attempt. The maximum - * lifetime of a Task from addition to completion is 180 days. If a Task has not - * completed within 180 days of being added it will be terminated by the Batch - * service and left in whatever state it was in at that time. - */ - post( - options: CreateTaskCollectionParameters, - ): StreamableMethod< - CreateTaskCollection200Response | CreateTaskCollectionDefaultResponse - >; -} - -export interface DeleteTask { - /** - * When a Task is deleted, all of the files in its directory on the Compute Node - * where it ran are also deleted (regardless of the retention time). For - * multi-instance Tasks, the delete Task operation applies synchronously to the - * primary task; subtasks and their files are then deleted asynchronously in the - * background. - */ - delete( - options?: DeleteTaskParameters, - ): StreamableMethod; - /** - * For multi-instance Tasks, information such as affinityId, executionInfo and - * nodeInfo refer to the primary Task. Use the list subtasks API to retrieve - * information about subtasks. - */ - get( - options?: GetTaskParameters, - ): StreamableMethod; - /** Updates the properties of the specified Task. */ - put( - options: ReplaceTaskParameters, - ): StreamableMethod; -} - -export interface ListSubTasks { - /** If the Task is not a multi-instance Task then this returns an empty collection. */ - get( - options?: ListSubTasksParameters, - ): StreamableMethod; -} - -export interface TerminateTask { - /** - * When the Task has been terminated, it moves to the completed state. For - * multi-instance Tasks, the terminate Task operation applies synchronously to the - * primary task; subtasks are then terminated asynchronously in the background. - */ - post( - options?: TerminateTaskParameters, - ): StreamableMethod; -} - -export interface ReactivateTask { - /** - * Reactivation makes a Task eligible to be retried again up to its maximum retry - * count. The Task's state is changed to active. As the Task is no longer in the - * completed state, any previous exit code or failure information is no longer - * available after reactivation. Each time a Task is reactivated, its retry count - * is reset to 0. Reactivation will fail for Tasks that are not completed or that - * previously completed successfully (with an exit code of 0). Additionally, it - * will fail if the Job has completed (or is terminating or deleting). - */ - post( - options?: ReactivateTaskParameters, - ): StreamableMethod< - ReactivateTask204Response | ReactivateTaskDefaultResponse - >; -} - -export interface DeleteTaskFile { - /** Deletes the specified Task file from the Compute Node where the Task ran. */ - delete( - options?: DeleteTaskFileParameters, - ): StreamableMethod< - DeleteTaskFile200Response | DeleteTaskFileDefaultResponse - >; - /** Returns the content of the specified Task file. */ - get( - options?: GetTaskFileParameters, - ): StreamableMethod; - /** Gets the properties of the specified Task file. */ - head( - options?: GetTaskFilePropertiesParameters, - ): StreamableMethod< - GetTaskFileProperties200Response | GetTaskFilePropertiesDefaultResponse - >; -} - -export interface ListTaskFiles { - /** Lists the files in a Task's directory on its Compute Node. */ - get( - options?: ListTaskFilesParameters, - ): StreamableMethod; -} - -export interface CreateNodeUser { - /** - * You can add a user Account to a Compute Node only when it is in the idle or - * running state. - */ - post( - options: CreateNodeUserParameters, - ): StreamableMethod< - CreateNodeUser201Response | CreateNodeUserDefaultResponse - >; -} - -export interface DeleteNodeUser { - /** - * You can delete a user Account to a Compute Node only when it is in the idle or - * running state. - */ - delete( - options?: DeleteNodeUserParameters, - ): StreamableMethod< - DeleteNodeUser200Response | DeleteNodeUserDefaultResponse - >; - /** - * This operation replaces of all the updatable properties of the Account. For - * example, if the expiryTime element is not specified, the current value is - * replaced with the default value, not left unmodified. You can update a user - * Account on a Compute Node only when it is in the idle or running state. - */ - put( - options: ReplaceNodeUserParameters, - ): StreamableMethod< - ReplaceNodeUser200Response | ReplaceNodeUserDefaultResponse - >; -} - -export interface GetNode { - /** Gets information about the specified Compute Node. */ - get( - options?: GetNodeParameters, - ): StreamableMethod; -} - -export interface RebootNode { - /** You can restart a Compute Node only if it is in an idle or running state. */ - post( - options: RebootNodeParameters, - ): StreamableMethod; -} - -export interface DisableNodeScheduling { - /** - * You can disable Task scheduling on a Compute Node only if its current - * scheduling state is enabled. - */ - post( - options: DisableNodeSchedulingParameters, - ): StreamableMethod< - DisableNodeScheduling200Response | DisableNodeSchedulingDefaultResponse - >; -} - -export interface EnableNodeScheduling { - /** - * You can enable Task scheduling on a Compute Node only if its current scheduling - * state is disabled - */ - post( - options?: EnableNodeSchedulingParameters, - ): StreamableMethod< - EnableNodeScheduling200Response | EnableNodeSchedulingDefaultResponse - >; -} - -export interface GetNodeRemoteLoginSettings { - /** - * Before you can remotely login to a Compute Node using the remote login - * settings, you must create a user Account on the Compute Node. This API can be - * invoked only on Pools created with the virtual machine configuration property. - */ - get( - options?: GetNodeRemoteLoginSettingsParameters, - ): StreamableMethod< - | GetNodeRemoteLoginSettings200Response - | GetNodeRemoteLoginSettingsDefaultResponse - >; -} - -export interface UploadNodeLogs { - /** - * This is for gathering Azure Batch service log files in an automated fashion - * from Compute Nodes if you are experiencing an error and wish to escalate to - * Azure support. The Azure Batch service log files should be shared with Azure - * support to aid in debugging issues with the Batch service. - */ - post( - options: UploadNodeLogsParameters, - ): StreamableMethod< - UploadNodeLogs200Response | UploadNodeLogsDefaultResponse - >; -} - -export interface ListNodes { - /** Lists the Compute Nodes in the specified Pool. */ - get( - options?: ListNodesParameters, - ): StreamableMethod; -} - -export interface GetNodeExtension { - /** Gets information about the specified Compute Node Extension. */ - get( - options?: GetNodeExtensionParameters, - ): StreamableMethod< - GetNodeExtension200Response | GetNodeExtensionDefaultResponse - >; -} - -export interface ListNodeExtensions { - /** Lists the Compute Nodes Extensions in the specified Pool. */ - get( - options?: ListNodeExtensionsParameters, - ): StreamableMethod< - ListNodeExtensions200Response | ListNodeExtensionsDefaultResponse - >; -} - -export interface DeleteNodeFile { - /** Deletes the specified file from the Compute Node. */ - delete( - options?: DeleteNodeFileParameters, - ): StreamableMethod< - DeleteNodeFile200Response | DeleteNodeFileDefaultResponse - >; - /** Returns the content of the specified Compute Node file. */ - get( - options?: GetNodeFileParameters, - ): StreamableMethod; - /** Gets the properties of the specified Compute Node file. */ - head( - options?: GetNodeFilePropertiesParameters, - ): StreamableMethod< - GetNodeFileProperties200Response | GetNodeFilePropertiesDefaultResponse - >; -} - -export interface ListNodeFiles { - /** Lists all of the files in Task directories on the specified Compute Node. */ - get( - options?: ListNodeFilesParameters, - ): StreamableMethod; -} - -export interface Routes { - /** Resource for '/applications' has methods for the following verbs: get */ - (path: "/applications"): ListApplications; - /** Resource for '/applications/\{applicationId\}' has methods for the following verbs: get */ - ( - path: "/applications/{applicationId}", - applicationId: string, - ): GetApplication; - /** Resource for '/poolusagemetrics' has methods for the following verbs: get */ - (path: "/poolusagemetrics"): ListPoolUsageMetrics; - /** Resource for '/pools' has methods for the following verbs: post, get */ - (path: "/pools"): CreatePool; - /** Resource for '/pools/\{poolId\}' has methods for the following verbs: delete, head, get, patch */ - (path: "/pools/{poolId}", poolId: string): DeletePool; - /** Resource for '/pools/\{poolId\}/disableautoscale' has methods for the following verbs: post */ - ( - path: "/pools/{poolId}/disableautoscale", - poolId: string, - ): DisablePoolAutoScale; - /** Resource for '/pools/\{poolId\}/enableautoscale' has methods for the following verbs: post */ - ( - path: "/pools/{poolId}/enableautoscale", - poolId: string, - ): EnablePoolAutoScale; - /** Resource for '/pools/\{poolId\}/evaluateautoscale' has methods for the following verbs: post */ - ( - path: "/pools/{poolId}/evaluateautoscale", - poolId: string, - ): EvaluatePoolAutoScale; - /** Resource for '/pools/\{poolId\}/resize' has methods for the following verbs: post */ - (path: "/pools/{poolId}/resize", poolId: string): ResizePool; - /** Resource for '/pools/\{poolId\}/stopresize' has methods for the following verbs: post */ - (path: "/pools/{poolId}/stopresize", poolId: string): StopPoolResize; - /** Resource for '/pools/\{poolId\}/updateproperties' has methods for the following verbs: post */ - ( - path: "/pools/{poolId}/updateproperties", - poolId: string, - ): ReplacePoolProperties; - /** Resource for '/pools/\{poolId\}/removenodes' has methods for the following verbs: post */ - (path: "/pools/{poolId}/removenodes", poolId: string): RemoveNodes; - /** Resource for '/supportedimages' has methods for the following verbs: get */ - (path: "/supportedimages"): ListSupportedImages; - /** Resource for '/nodecounts' has methods for the following verbs: get */ - (path: "/nodecounts"): ListPoolNodeCounts; - /** Resource for '/jobs/\{jobId\}' has methods for the following verbs: delete, get, patch, put */ - (path: "/jobs/{jobId}", jobId: string): DeleteJob; - /** Resource for '/jobs/\{jobId\}/disable' has methods for the following verbs: post */ - (path: "/jobs/{jobId}/disable", jobId: string): DisableJob; - /** Resource for '/jobs/\{jobId\}/enable' has methods for the following verbs: post */ - (path: "/jobs/{jobId}/enable", jobId: string): EnableJob; - /** Resource for '/jobs/\{jobId\}/terminate' has methods for the following verbs: post */ - (path: "/jobs/{jobId}/terminate", jobId: string): TerminateJob; - /** Resource for '/jobs' has methods for the following verbs: post, get */ - (path: "/jobs"): CreateJob; - /** Resource for '/jobschedules/\{jobScheduleId\}/jobs' has methods for the following verbs: get */ - ( - path: "/jobschedules/{jobScheduleId}/jobs", - jobScheduleId: string, - ): ListJobsFromSchedule; - /** Resource for '/jobs/\{jobId\}/jobpreparationandreleasetaskstatus' has methods for the following verbs: get */ - ( - path: "/jobs/{jobId}/jobpreparationandreleasetaskstatus", - jobId: string, - ): ListJobPreparationAndReleaseTaskStatus; - /** Resource for '/jobs/\{jobId\}/taskcounts' has methods for the following verbs: get */ - (path: "/jobs/{jobId}/taskcounts", jobId: string): GetJobTaskCounts; - /** Resource for '/jobschedules/\{jobScheduleId\}' has methods for the following verbs: head, delete, get, patch, put */ - ( - path: "/jobschedules/{jobScheduleId}", - jobScheduleId: string, - ): JobScheduleExists; - /** Resource for '/jobschedules/\{jobScheduleId\}/disable' has methods for the following verbs: post */ - ( - path: "/jobschedules/{jobScheduleId}/disable", - jobScheduleId: string, - ): DisableJobSchedule; - /** Resource for '/jobschedules/\{jobScheduleId\}/enable' has methods for the following verbs: post */ - ( - path: "/jobschedules/{jobScheduleId}/enable", - jobScheduleId: string, - ): EnableJobSchedule; - /** Resource for '/jobschedules/\{jobScheduleId\}/terminate' has methods for the following verbs: post */ - ( - path: "/jobschedules/{jobScheduleId}/terminate", - jobScheduleId: string, - ): TerminateJobSchedule; - /** Resource for '/jobschedules' has methods for the following verbs: post, get */ - (path: "/jobschedules"): CreateJobSchedule; - /** Resource for '/jobs/\{jobId\}/tasks' has methods for the following verbs: post, get */ - (path: "/jobs/{jobId}/tasks", jobId: string): CreateTask; - /** Resource for '/jobs/\{jobId\}/addtaskcollection' has methods for the following verbs: post */ - ( - path: "/jobs/{jobId}/addtaskcollection", - jobId: string, - ): CreateTaskCollection; - /** Resource for '/jobs/\{jobId\}/tasks/\{taskId\}' has methods for the following verbs: delete, get, put */ - ( - path: "/jobs/{jobId}/tasks/{taskId}", - jobId: string, - taskId: string, - ): DeleteTask; - /** Resource for '/jobs/\{jobId\}/tasks/\{taskId\}/subtasksinfo' has methods for the following verbs: get */ - ( - path: "/jobs/{jobId}/tasks/{taskId}/subtasksinfo", - jobId: string, - taskId: string, - ): ListSubTasks; - /** Resource for '/jobs/\{jobId\}/tasks/\{taskId\}/terminate' has methods for the following verbs: post */ - ( - path: "/jobs/{jobId}/tasks/{taskId}/terminate", - jobId: string, - taskId: string, - ): TerminateTask; - /** Resource for '/jobs/\{jobId\}/tasks/\{taskId\}/reactivate' has methods for the following verbs: post */ - ( - path: "/jobs/{jobId}/tasks/{taskId}/reactivate", - jobId: string, - taskId: string, - ): ReactivateTask; - /** Resource for '/jobs/\{jobId\}/tasks/\{taskId\}/files/\{filePath\}' has methods for the following verbs: delete, get, head */ - ( - path: "/jobs/{jobId}/tasks/{taskId}/files/{filePath}", - jobId: string, - taskId: string, - filePath: string, - ): DeleteTaskFile; - /** Resource for '/jobs/\{jobId\}/tasks/\{taskId\}/files' has methods for the following verbs: get */ - ( - path: "/jobs/{jobId}/tasks/{taskId}/files", - jobId: string, - taskId: string, - ): ListTaskFiles; - /** Resource for '/pools/\{poolId\}/nodes/\{nodeId\}/users' has methods for the following verbs: post */ - ( - path: "/pools/{poolId}/nodes/{nodeId}/users", - poolId: string, - nodeId: string, - ): CreateNodeUser; - /** Resource for '/pools/\{poolId\}/nodes/\{nodeId\}/users/\{userName\}' has methods for the following verbs: delete, put */ - ( - path: "/pools/{poolId}/nodes/{nodeId}/users/{userName}", - poolId: string, - nodeId: string, - userName: string, - ): DeleteNodeUser; - /** Resource for '/pools/\{poolId\}/nodes/\{nodeId\}' has methods for the following verbs: get */ - ( - path: "/pools/{poolId}/nodes/{nodeId}", - poolId: string, - nodeId: string, - ): GetNode; - /** Resource for '/pools/\{poolId\}/nodes/\{nodeId\}/reboot' has methods for the following verbs: post */ - ( - path: "/pools/{poolId}/nodes/{nodeId}/reboot", - poolId: string, - nodeId: string, - ): RebootNode; - /** Resource for '/pools/\{poolId\}/nodes/\{nodeId\}/disablescheduling' has methods for the following verbs: post */ - ( - path: "/pools/{poolId}/nodes/{nodeId}/disablescheduling", - poolId: string, - nodeId: string, - ): DisableNodeScheduling; - /** Resource for '/pools/\{poolId\}/nodes/\{nodeId\}/enablescheduling' has methods for the following verbs: post */ - ( - path: "/pools/{poolId}/nodes/{nodeId}/enablescheduling", - poolId: string, - nodeId: string, - ): EnableNodeScheduling; - /** Resource for '/pools/\{poolId\}/nodes/\{nodeId\}/remoteloginsettings' has methods for the following verbs: get */ - ( - path: "/pools/{poolId}/nodes/{nodeId}/remoteloginsettings", - poolId: string, - nodeId: string, - ): GetNodeRemoteLoginSettings; - /** Resource for '/pools/\{poolId\}/nodes/\{nodeId\}/uploadbatchservicelogs' has methods for the following verbs: post */ - ( - path: "/pools/{poolId}/nodes/{nodeId}/uploadbatchservicelogs", - poolId: string, - nodeId: string, - ): UploadNodeLogs; - /** Resource for '/pools/\{poolId\}/nodes' has methods for the following verbs: get */ - (path: "/pools/{poolId}/nodes", poolId: string): ListNodes; - /** Resource for '/pools/\{poolId\}/nodes/\{nodeId\}/extensions/\{extensionName\}' has methods for the following verbs: get */ - ( - path: "/pools/{poolId}/nodes/{nodeId}/extensions/{extensionName}", - poolId: string, - nodeId: string, - extensionName: string, - ): GetNodeExtension; - /** Resource for '/pools/\{poolId\}/nodes/\{nodeId\}/extensions' has methods for the following verbs: get */ - ( - path: "/pools/{poolId}/nodes/{nodeId}/extensions", - poolId: string, - nodeId: string, - ): ListNodeExtensions; - /** Resource for '/pools/\{poolId\}/nodes/\{nodeId\}/files/\{filePath\}' has methods for the following verbs: delete, get, head */ - ( - path: "/pools/{poolId}/nodes/{nodeId}/files/{filePath}", - poolId: string, - nodeId: string, - filePath: string, - ): DeleteNodeFile; - /** Resource for '/pools/\{poolId\}/nodes/\{nodeId\}/files' has methods for the following verbs: get */ - ( - path: "/pools/{poolId}/nodes/{nodeId}/files", - poolId: string, - nodeId: string, - ): ListNodeFiles; -} - -export type BatchClient = Client & { - path: Routes; -}; diff --git a/sdk/batch/batch-rest/generated/index.ts b/sdk/batch/batch-rest/generated/index.ts deleted file mode 100644 index 00fd811e00c7..000000000000 --- a/sdk/batch/batch-rest/generated/index.ts +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import BatchClient from "./batchClient.js"; - -export * from "./batchClient.js"; -export * from "./parameters.js"; -export * from "./responses.js"; -export * from "./clientDefinitions.js"; -export * from "./isUnexpected.js"; -export * from "./models.js"; -export * from "./outputModels.js"; -export * from "./paginateHelper.js"; - -export default BatchClient; diff --git a/sdk/batch/batch-rest/generated/isUnexpected.ts b/sdk/batch/batch-rest/generated/isUnexpected.ts deleted file mode 100644 index a4a757488320..000000000000 --- a/sdk/batch/batch-rest/generated/isUnexpected.ts +++ /dev/null @@ -1,751 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { - ListApplications200Response, - ListApplicationsDefaultResponse, - GetApplication200Response, - GetApplicationDefaultResponse, - ListPoolUsageMetrics200Response, - ListPoolUsageMetricsDefaultResponse, - CreatePool201Response, - CreatePoolDefaultResponse, - ListPools200Response, - ListPoolsDefaultResponse, - DeletePool202Response, - DeletePoolDefaultResponse, - PoolExists200Response, - PoolExists404Response, - PoolExistsDefaultResponse, - GetPool200Response, - GetPoolDefaultResponse, - UpdatePool200Response, - UpdatePoolDefaultResponse, - DisablePoolAutoScale200Response, - DisablePoolAutoScaleDefaultResponse, - EnablePoolAutoScale200Response, - EnablePoolAutoScaleDefaultResponse, - EvaluatePoolAutoScale200Response, - EvaluatePoolAutoScaleDefaultResponse, - ResizePool202Response, - ResizePoolDefaultResponse, - StopPoolResize202Response, - StopPoolResizeDefaultResponse, - ReplacePoolProperties204Response, - ReplacePoolPropertiesDefaultResponse, - RemoveNodes202Response, - RemoveNodesDefaultResponse, - ListSupportedImages200Response, - ListSupportedImagesDefaultResponse, - ListPoolNodeCounts200Response, - ListPoolNodeCountsDefaultResponse, - DeleteJob202Response, - DeleteJobDefaultResponse, - GetJob200Response, - GetJobDefaultResponse, - UpdateJob200Response, - UpdateJobDefaultResponse, - ReplaceJob200Response, - ReplaceJobDefaultResponse, - DisableJob202Response, - DisableJobDefaultResponse, - EnableJob202Response, - EnableJobDefaultResponse, - TerminateJob202Response, - TerminateJobDefaultResponse, - CreateJob201Response, - CreateJobDefaultResponse, - ListJobs200Response, - ListJobsDefaultResponse, - ListJobsFromSchedule200Response, - ListJobsFromScheduleDefaultResponse, - ListJobPreparationAndReleaseTaskStatus200Response, - ListJobPreparationAndReleaseTaskStatusDefaultResponse, - GetJobTaskCounts200Response, - GetJobTaskCountsDefaultResponse, - JobScheduleExists200Response, - JobScheduleExists404Response, - JobScheduleExistsDefaultResponse, - DeleteJobSchedule202Response, - DeleteJobScheduleDefaultResponse, - GetJobSchedule200Response, - GetJobScheduleDefaultResponse, - UpdateJobSchedule200Response, - UpdateJobScheduleDefaultResponse, - ReplaceJobSchedule200Response, - ReplaceJobScheduleDefaultResponse, - DisableJobSchedule204Response, - DisableJobScheduleDefaultResponse, - EnableJobSchedule204Response, - EnableJobScheduleDefaultResponse, - TerminateJobSchedule202Response, - TerminateJobScheduleDefaultResponse, - CreateJobSchedule201Response, - CreateJobScheduleDefaultResponse, - ListJobSchedules200Response, - ListJobSchedulesDefaultResponse, - CreateTask201Response, - CreateTaskDefaultResponse, - ListTasks200Response, - ListTasksDefaultResponse, - CreateTaskCollection200Response, - CreateTaskCollectionDefaultResponse, - DeleteTask200Response, - DeleteTaskDefaultResponse, - GetTask200Response, - GetTaskDefaultResponse, - ReplaceTask200Response, - ReplaceTaskDefaultResponse, - ListSubTasks200Response, - ListSubTasksDefaultResponse, - TerminateTask204Response, - TerminateTaskDefaultResponse, - ReactivateTask204Response, - ReactivateTaskDefaultResponse, - DeleteTaskFile200Response, - DeleteTaskFileDefaultResponse, - GetTaskFile200Response, - GetTaskFileDefaultResponse, - GetTaskFileProperties200Response, - GetTaskFilePropertiesDefaultResponse, - ListTaskFiles200Response, - ListTaskFilesDefaultResponse, - CreateNodeUser201Response, - CreateNodeUserDefaultResponse, - DeleteNodeUser200Response, - DeleteNodeUserDefaultResponse, - ReplaceNodeUser200Response, - ReplaceNodeUserDefaultResponse, - GetNode200Response, - GetNodeDefaultResponse, - RebootNode202Response, - RebootNodeDefaultResponse, - DisableNodeScheduling200Response, - DisableNodeSchedulingDefaultResponse, - EnableNodeScheduling200Response, - EnableNodeSchedulingDefaultResponse, - GetNodeRemoteLoginSettings200Response, - GetNodeRemoteLoginSettingsDefaultResponse, - UploadNodeLogs200Response, - UploadNodeLogsDefaultResponse, - ListNodes200Response, - ListNodesDefaultResponse, - GetNodeExtension200Response, - GetNodeExtensionDefaultResponse, - ListNodeExtensions200Response, - ListNodeExtensionsDefaultResponse, - DeleteNodeFile200Response, - DeleteNodeFileDefaultResponse, - GetNodeFile200Response, - GetNodeFileDefaultResponse, - GetNodeFileProperties200Response, - GetNodeFilePropertiesDefaultResponse, - ListNodeFiles200Response, - ListNodeFilesDefaultResponse, -} from "./responses.js"; - -const responseMap: Record = { - "GET /applications": ["200"], - "GET /applications/{applicationId}": ["200"], - "GET /poolusagemetrics": ["200"], - "POST /pools": ["201"], - "GET /pools": ["200"], - "DELETE /pools/{poolId}": ["202"], - "HEAD /pools/{poolId}": ["200", "404"], - "GET /pools/{poolId}": ["200"], - "PATCH /pools/{poolId}": ["200"], - "POST /pools/{poolId}/disableautoscale": ["200"], - "POST /pools/{poolId}/enableautoscale": ["200"], - "POST /pools/{poolId}/evaluateautoscale": ["200"], - "POST /pools/{poolId}/resize": ["202"], - "POST /pools/{poolId}/stopresize": ["202"], - "POST /pools/{poolId}/updateproperties": ["204"], - "POST /pools/{poolId}/removenodes": ["202"], - "GET /supportedimages": ["200"], - "GET /nodecounts": ["200"], - "DELETE /jobs/{jobId}": ["202"], - "GET /jobs/{jobId}": ["200"], - "PATCH /jobs/{jobId}": ["200"], - "PUT /jobs/{jobId}": ["200"], - "POST /jobs/{jobId}/disable": ["202"], - "POST /jobs/{jobId}/enable": ["202"], - "POST /jobs/{jobId}/terminate": ["202"], - "POST /jobs": ["201"], - "GET /jobs": ["200"], - "GET /jobschedules/{jobScheduleId}/jobs": ["200"], - "GET /jobs/{jobId}/jobpreparationandreleasetaskstatus": ["200"], - "GET /jobs/{jobId}/taskcounts": ["200"], - "HEAD /jobschedules/{jobScheduleId}": ["200", "404"], - "DELETE /jobschedules/{jobScheduleId}": ["202"], - "GET /jobschedules/{jobScheduleId}": ["200"], - "PATCH /jobschedules/{jobScheduleId}": ["200"], - "PUT /jobschedules/{jobScheduleId}": ["200"], - "POST /jobschedules/{jobScheduleId}/disable": ["204"], - "POST /jobschedules/{jobScheduleId}/enable": ["204"], - "POST /jobschedules/{jobScheduleId}/terminate": ["202"], - "POST /jobschedules": ["201"], - "GET /jobschedules": ["200"], - "POST /jobs/{jobId}/tasks": ["201"], - "GET /jobs/{jobId}/tasks": ["200"], - "POST /jobs/{jobId}/addtaskcollection": ["200"], - "DELETE /jobs/{jobId}/tasks/{taskId}": ["200"], - "GET /jobs/{jobId}/tasks/{taskId}": ["200"], - "PUT /jobs/{jobId}/tasks/{taskId}": ["200"], - "GET /jobs/{jobId}/tasks/{taskId}/subtasksinfo": ["200"], - "POST /jobs/{jobId}/tasks/{taskId}/terminate": ["204"], - "POST /jobs/{jobId}/tasks/{taskId}/reactivate": ["204"], - "DELETE /jobs/{jobId}/tasks/{taskId}/files/{filePath}": ["200"], - "GET /jobs/{jobId}/tasks/{taskId}/files/{filePath}": ["200"], - "HEAD /jobs/{jobId}/tasks/{taskId}/files/{filePath}": ["200"], - "GET /jobs/{jobId}/tasks/{taskId}/files": ["200"], - "POST /pools/{poolId}/nodes/{nodeId}/users": ["201"], - "DELETE /pools/{poolId}/nodes/{nodeId}/users/{userName}": ["200"], - "PUT /pools/{poolId}/nodes/{nodeId}/users/{userName}": ["200"], - "GET /pools/{poolId}/nodes/{nodeId}": ["200"], - "POST /pools/{poolId}/nodes/{nodeId}/reboot": ["202"], - "POST /pools/{poolId}/nodes/{nodeId}/disablescheduling": ["200"], - "POST /pools/{poolId}/nodes/{nodeId}/enablescheduling": ["200"], - "GET /pools/{poolId}/nodes/{nodeId}/remoteloginsettings": ["200"], - "POST /pools/{poolId}/nodes/{nodeId}/uploadbatchservicelogs": ["200"], - "GET /pools/{poolId}/nodes": ["200"], - "GET /pools/{poolId}/nodes/{nodeId}/extensions/{extensionName}": ["200"], - "GET /pools/{poolId}/nodes/{nodeId}/extensions": ["200"], - "DELETE /pools/{poolId}/nodes/{nodeId}/files/{filePath}": ["200"], - "GET /pools/{poolId}/nodes/{nodeId}/files/{filePath}": ["200"], - "HEAD /pools/{poolId}/nodes/{nodeId}/files/{filePath}": ["200"], - "GET /pools/{poolId}/nodes/{nodeId}/files": ["200"], -}; - -export function isUnexpected( - response: ListApplications200Response | ListApplicationsDefaultResponse, -): response is ListApplicationsDefaultResponse; -export function isUnexpected( - response: GetApplication200Response | GetApplicationDefaultResponse, -): response is GetApplicationDefaultResponse; -export function isUnexpected( - response: - | ListPoolUsageMetrics200Response - | ListPoolUsageMetricsDefaultResponse, -): response is ListPoolUsageMetricsDefaultResponse; -export function isUnexpected( - response: CreatePool201Response | CreatePoolDefaultResponse, -): response is CreatePoolDefaultResponse; -export function isUnexpected( - response: ListPools200Response | ListPoolsDefaultResponse, -): response is ListPoolsDefaultResponse; -export function isUnexpected( - response: DeletePool202Response | DeletePoolDefaultResponse, -): response is DeletePoolDefaultResponse; -export function isUnexpected( - response: - | PoolExists200Response - | PoolExists404Response - | PoolExistsDefaultResponse, -): response is PoolExistsDefaultResponse; -export function isUnexpected( - response: GetPool200Response | GetPoolDefaultResponse, -): response is GetPoolDefaultResponse; -export function isUnexpected( - response: UpdatePool200Response | UpdatePoolDefaultResponse, -): response is UpdatePoolDefaultResponse; -export function isUnexpected( - response: - | DisablePoolAutoScale200Response - | DisablePoolAutoScaleDefaultResponse, -): response is DisablePoolAutoScaleDefaultResponse; -export function isUnexpected( - response: EnablePoolAutoScale200Response | EnablePoolAutoScaleDefaultResponse, -): response is EnablePoolAutoScaleDefaultResponse; -export function isUnexpected( - response: - | EvaluatePoolAutoScale200Response - | EvaluatePoolAutoScaleDefaultResponse, -): response is EvaluatePoolAutoScaleDefaultResponse; -export function isUnexpected( - response: ResizePool202Response | ResizePoolDefaultResponse, -): response is ResizePoolDefaultResponse; -export function isUnexpected( - response: StopPoolResize202Response | StopPoolResizeDefaultResponse, -): response is StopPoolResizeDefaultResponse; -export function isUnexpected( - response: - | ReplacePoolProperties204Response - | ReplacePoolPropertiesDefaultResponse, -): response is ReplacePoolPropertiesDefaultResponse; -export function isUnexpected( - response: RemoveNodes202Response | RemoveNodesDefaultResponse, -): response is RemoveNodesDefaultResponse; -export function isUnexpected( - response: ListSupportedImages200Response | ListSupportedImagesDefaultResponse, -): response is ListSupportedImagesDefaultResponse; -export function isUnexpected( - response: ListPoolNodeCounts200Response | ListPoolNodeCountsDefaultResponse, -): response is ListPoolNodeCountsDefaultResponse; -export function isUnexpected( - response: DeleteJob202Response | DeleteJobDefaultResponse, -): response is DeleteJobDefaultResponse; -export function isUnexpected( - response: GetJob200Response | GetJobDefaultResponse, -): response is GetJobDefaultResponse; -export function isUnexpected( - response: UpdateJob200Response | UpdateJobDefaultResponse, -): response is UpdateJobDefaultResponse; -export function isUnexpected( - response: ReplaceJob200Response | ReplaceJobDefaultResponse, -): response is ReplaceJobDefaultResponse; -export function isUnexpected( - response: DisableJob202Response | DisableJobDefaultResponse, -): response is DisableJobDefaultResponse; -export function isUnexpected( - response: EnableJob202Response | EnableJobDefaultResponse, -): response is EnableJobDefaultResponse; -export function isUnexpected( - response: TerminateJob202Response | TerminateJobDefaultResponse, -): response is TerminateJobDefaultResponse; -export function isUnexpected( - response: CreateJob201Response | CreateJobDefaultResponse, -): response is CreateJobDefaultResponse; -export function isUnexpected( - response: ListJobs200Response | ListJobsDefaultResponse, -): response is ListJobsDefaultResponse; -export function isUnexpected( - response: - | ListJobsFromSchedule200Response - | ListJobsFromScheduleDefaultResponse, -): response is ListJobsFromScheduleDefaultResponse; -export function isUnexpected( - response: - | ListJobPreparationAndReleaseTaskStatus200Response - | ListJobPreparationAndReleaseTaskStatusDefaultResponse, -): response is ListJobPreparationAndReleaseTaskStatusDefaultResponse; -export function isUnexpected( - response: GetJobTaskCounts200Response | GetJobTaskCountsDefaultResponse, -): response is GetJobTaskCountsDefaultResponse; -export function isUnexpected( - response: - | JobScheduleExists200Response - | JobScheduleExists404Response - | JobScheduleExistsDefaultResponse, -): response is JobScheduleExistsDefaultResponse; -export function isUnexpected( - response: DeleteJobSchedule202Response | DeleteJobScheduleDefaultResponse, -): response is DeleteJobScheduleDefaultResponse; -export function isUnexpected( - response: GetJobSchedule200Response | GetJobScheduleDefaultResponse, -): response is GetJobScheduleDefaultResponse; -export function isUnexpected( - response: UpdateJobSchedule200Response | UpdateJobScheduleDefaultResponse, -): response is UpdateJobScheduleDefaultResponse; -export function isUnexpected( - response: ReplaceJobSchedule200Response | ReplaceJobScheduleDefaultResponse, -): response is ReplaceJobScheduleDefaultResponse; -export function isUnexpected( - response: DisableJobSchedule204Response | DisableJobScheduleDefaultResponse, -): response is DisableJobScheduleDefaultResponse; -export function isUnexpected( - response: EnableJobSchedule204Response | EnableJobScheduleDefaultResponse, -): response is EnableJobScheduleDefaultResponse; -export function isUnexpected( - response: - | TerminateJobSchedule202Response - | TerminateJobScheduleDefaultResponse, -): response is TerminateJobScheduleDefaultResponse; -export function isUnexpected( - response: CreateJobSchedule201Response | CreateJobScheduleDefaultResponse, -): response is CreateJobScheduleDefaultResponse; -export function isUnexpected( - response: ListJobSchedules200Response | ListJobSchedulesDefaultResponse, -): response is ListJobSchedulesDefaultResponse; -export function isUnexpected( - response: CreateTask201Response | CreateTaskDefaultResponse, -): response is CreateTaskDefaultResponse; -export function isUnexpected( - response: ListTasks200Response | ListTasksDefaultResponse, -): response is ListTasksDefaultResponse; -export function isUnexpected( - response: - | CreateTaskCollection200Response - | CreateTaskCollectionDefaultResponse, -): response is CreateTaskCollectionDefaultResponse; -export function isUnexpected( - response: DeleteTask200Response | DeleteTaskDefaultResponse, -): response is DeleteTaskDefaultResponse; -export function isUnexpected( - response: GetTask200Response | GetTaskDefaultResponse, -): response is GetTaskDefaultResponse; -export function isUnexpected( - response: ReplaceTask200Response | ReplaceTaskDefaultResponse, -): response is ReplaceTaskDefaultResponse; -export function isUnexpected( - response: ListSubTasks200Response | ListSubTasksDefaultResponse, -): response is ListSubTasksDefaultResponse; -export function isUnexpected( - response: TerminateTask204Response | TerminateTaskDefaultResponse, -): response is TerminateTaskDefaultResponse; -export function isUnexpected( - response: ReactivateTask204Response | ReactivateTaskDefaultResponse, -): response is ReactivateTaskDefaultResponse; -export function isUnexpected( - response: DeleteTaskFile200Response | DeleteTaskFileDefaultResponse, -): response is DeleteTaskFileDefaultResponse; -export function isUnexpected( - response: GetTaskFile200Response | GetTaskFileDefaultResponse, -): response is GetTaskFileDefaultResponse; -export function isUnexpected( - response: - | GetTaskFileProperties200Response - | GetTaskFilePropertiesDefaultResponse, -): response is GetTaskFilePropertiesDefaultResponse; -export function isUnexpected( - response: ListTaskFiles200Response | ListTaskFilesDefaultResponse, -): response is ListTaskFilesDefaultResponse; -export function isUnexpected( - response: CreateNodeUser201Response | CreateNodeUserDefaultResponse, -): response is CreateNodeUserDefaultResponse; -export function isUnexpected( - response: DeleteNodeUser200Response | DeleteNodeUserDefaultResponse, -): response is DeleteNodeUserDefaultResponse; -export function isUnexpected( - response: ReplaceNodeUser200Response | ReplaceNodeUserDefaultResponse, -): response is ReplaceNodeUserDefaultResponse; -export function isUnexpected( - response: GetNode200Response | GetNodeDefaultResponse, -): response is GetNodeDefaultResponse; -export function isUnexpected( - response: RebootNode202Response | RebootNodeDefaultResponse, -): response is RebootNodeDefaultResponse; -export function isUnexpected( - response: - | DisableNodeScheduling200Response - | DisableNodeSchedulingDefaultResponse, -): response is DisableNodeSchedulingDefaultResponse; -export function isUnexpected( - response: - | EnableNodeScheduling200Response - | EnableNodeSchedulingDefaultResponse, -): response is EnableNodeSchedulingDefaultResponse; -export function isUnexpected( - response: - | GetNodeRemoteLoginSettings200Response - | GetNodeRemoteLoginSettingsDefaultResponse, -): response is GetNodeRemoteLoginSettingsDefaultResponse; -export function isUnexpected( - response: UploadNodeLogs200Response | UploadNodeLogsDefaultResponse, -): response is UploadNodeLogsDefaultResponse; -export function isUnexpected( - response: ListNodes200Response | ListNodesDefaultResponse, -): response is ListNodesDefaultResponse; -export function isUnexpected( - response: GetNodeExtension200Response | GetNodeExtensionDefaultResponse, -): response is GetNodeExtensionDefaultResponse; -export function isUnexpected( - response: ListNodeExtensions200Response | ListNodeExtensionsDefaultResponse, -): response is ListNodeExtensionsDefaultResponse; -export function isUnexpected( - response: DeleteNodeFile200Response | DeleteNodeFileDefaultResponse, -): response is DeleteNodeFileDefaultResponse; -export function isUnexpected( - response: GetNodeFile200Response | GetNodeFileDefaultResponse, -): response is GetNodeFileDefaultResponse; -export function isUnexpected( - response: - | GetNodeFileProperties200Response - | GetNodeFilePropertiesDefaultResponse, -): response is GetNodeFilePropertiesDefaultResponse; -export function isUnexpected( - response: ListNodeFiles200Response | ListNodeFilesDefaultResponse, -): response is ListNodeFilesDefaultResponse; -export function isUnexpected( - response: - | ListApplications200Response - | ListApplicationsDefaultResponse - | GetApplication200Response - | GetApplicationDefaultResponse - | ListPoolUsageMetrics200Response - | ListPoolUsageMetricsDefaultResponse - | CreatePool201Response - | CreatePoolDefaultResponse - | ListPools200Response - | ListPoolsDefaultResponse - | DeletePool202Response - | DeletePoolDefaultResponse - | PoolExists200Response - | PoolExists404Response - | PoolExistsDefaultResponse - | GetPool200Response - | GetPoolDefaultResponse - | UpdatePool200Response - | UpdatePoolDefaultResponse - | DisablePoolAutoScale200Response - | DisablePoolAutoScaleDefaultResponse - | EnablePoolAutoScale200Response - | EnablePoolAutoScaleDefaultResponse - | EvaluatePoolAutoScale200Response - | EvaluatePoolAutoScaleDefaultResponse - | ResizePool202Response - | ResizePoolDefaultResponse - | StopPoolResize202Response - | StopPoolResizeDefaultResponse - | ReplacePoolProperties204Response - | ReplacePoolPropertiesDefaultResponse - | RemoveNodes202Response - | RemoveNodesDefaultResponse - | ListSupportedImages200Response - | ListSupportedImagesDefaultResponse - | ListPoolNodeCounts200Response - | ListPoolNodeCountsDefaultResponse - | DeleteJob202Response - | DeleteJobDefaultResponse - | GetJob200Response - | GetJobDefaultResponse - | UpdateJob200Response - | UpdateJobDefaultResponse - | ReplaceJob200Response - | ReplaceJobDefaultResponse - | DisableJob202Response - | DisableJobDefaultResponse - | EnableJob202Response - | EnableJobDefaultResponse - | TerminateJob202Response - | TerminateJobDefaultResponse - | CreateJob201Response - | CreateJobDefaultResponse - | ListJobs200Response - | ListJobsDefaultResponse - | ListJobsFromSchedule200Response - | ListJobsFromScheduleDefaultResponse - | ListJobPreparationAndReleaseTaskStatus200Response - | ListJobPreparationAndReleaseTaskStatusDefaultResponse - | GetJobTaskCounts200Response - | GetJobTaskCountsDefaultResponse - | JobScheduleExists200Response - | JobScheduleExists404Response - | JobScheduleExistsDefaultResponse - | DeleteJobSchedule202Response - | DeleteJobScheduleDefaultResponse - | GetJobSchedule200Response - | GetJobScheduleDefaultResponse - | UpdateJobSchedule200Response - | UpdateJobScheduleDefaultResponse - | ReplaceJobSchedule200Response - | ReplaceJobScheduleDefaultResponse - | DisableJobSchedule204Response - | DisableJobScheduleDefaultResponse - | EnableJobSchedule204Response - | EnableJobScheduleDefaultResponse - | TerminateJobSchedule202Response - | TerminateJobScheduleDefaultResponse - | CreateJobSchedule201Response - | CreateJobScheduleDefaultResponse - | ListJobSchedules200Response - | ListJobSchedulesDefaultResponse - | CreateTask201Response - | CreateTaskDefaultResponse - | ListTasks200Response - | ListTasksDefaultResponse - | CreateTaskCollection200Response - | CreateTaskCollectionDefaultResponse - | DeleteTask200Response - | DeleteTaskDefaultResponse - | GetTask200Response - | GetTaskDefaultResponse - | ReplaceTask200Response - | ReplaceTaskDefaultResponse - | ListSubTasks200Response - | ListSubTasksDefaultResponse - | TerminateTask204Response - | TerminateTaskDefaultResponse - | ReactivateTask204Response - | ReactivateTaskDefaultResponse - | DeleteTaskFile200Response - | DeleteTaskFileDefaultResponse - | GetTaskFile200Response - | GetTaskFileDefaultResponse - | GetTaskFileProperties200Response - | GetTaskFilePropertiesDefaultResponse - | ListTaskFiles200Response - | ListTaskFilesDefaultResponse - | CreateNodeUser201Response - | CreateNodeUserDefaultResponse - | DeleteNodeUser200Response - | DeleteNodeUserDefaultResponse - | ReplaceNodeUser200Response - | ReplaceNodeUserDefaultResponse - | GetNode200Response - | GetNodeDefaultResponse - | RebootNode202Response - | RebootNodeDefaultResponse - | DisableNodeScheduling200Response - | DisableNodeSchedulingDefaultResponse - | EnableNodeScheduling200Response - | EnableNodeSchedulingDefaultResponse - | GetNodeRemoteLoginSettings200Response - | GetNodeRemoteLoginSettingsDefaultResponse - | UploadNodeLogs200Response - | UploadNodeLogsDefaultResponse - | ListNodes200Response - | ListNodesDefaultResponse - | GetNodeExtension200Response - | GetNodeExtensionDefaultResponse - | ListNodeExtensions200Response - | ListNodeExtensionsDefaultResponse - | DeleteNodeFile200Response - | DeleteNodeFileDefaultResponse - | GetNodeFile200Response - | GetNodeFileDefaultResponse - | GetNodeFileProperties200Response - | GetNodeFilePropertiesDefaultResponse - | ListNodeFiles200Response - | ListNodeFilesDefaultResponse, -): response is - | ListApplicationsDefaultResponse - | GetApplicationDefaultResponse - | ListPoolUsageMetricsDefaultResponse - | CreatePoolDefaultResponse - | ListPoolsDefaultResponse - | DeletePoolDefaultResponse - | PoolExistsDefaultResponse - | GetPoolDefaultResponse - | UpdatePoolDefaultResponse - | DisablePoolAutoScaleDefaultResponse - | EnablePoolAutoScaleDefaultResponse - | EvaluatePoolAutoScaleDefaultResponse - | ResizePoolDefaultResponse - | StopPoolResizeDefaultResponse - | ReplacePoolPropertiesDefaultResponse - | RemoveNodesDefaultResponse - | ListSupportedImagesDefaultResponse - | ListPoolNodeCountsDefaultResponse - | DeleteJobDefaultResponse - | GetJobDefaultResponse - | UpdateJobDefaultResponse - | ReplaceJobDefaultResponse - | DisableJobDefaultResponse - | EnableJobDefaultResponse - | TerminateJobDefaultResponse - | CreateJobDefaultResponse - | ListJobsDefaultResponse - | ListJobsFromScheduleDefaultResponse - | ListJobPreparationAndReleaseTaskStatusDefaultResponse - | GetJobTaskCountsDefaultResponse - | JobScheduleExistsDefaultResponse - | DeleteJobScheduleDefaultResponse - | GetJobScheduleDefaultResponse - | UpdateJobScheduleDefaultResponse - | ReplaceJobScheduleDefaultResponse - | DisableJobScheduleDefaultResponse - | EnableJobScheduleDefaultResponse - | TerminateJobScheduleDefaultResponse - | CreateJobScheduleDefaultResponse - | ListJobSchedulesDefaultResponse - | CreateTaskDefaultResponse - | ListTasksDefaultResponse - | CreateTaskCollectionDefaultResponse - | DeleteTaskDefaultResponse - | GetTaskDefaultResponse - | ReplaceTaskDefaultResponse - | ListSubTasksDefaultResponse - | TerminateTaskDefaultResponse - | ReactivateTaskDefaultResponse - | DeleteTaskFileDefaultResponse - | GetTaskFileDefaultResponse - | GetTaskFilePropertiesDefaultResponse - | ListTaskFilesDefaultResponse - | CreateNodeUserDefaultResponse - | DeleteNodeUserDefaultResponse - | ReplaceNodeUserDefaultResponse - | GetNodeDefaultResponse - | RebootNodeDefaultResponse - | DisableNodeSchedulingDefaultResponse - | EnableNodeSchedulingDefaultResponse - | GetNodeRemoteLoginSettingsDefaultResponse - | UploadNodeLogsDefaultResponse - | ListNodesDefaultResponse - | GetNodeExtensionDefaultResponse - | ListNodeExtensionsDefaultResponse - | DeleteNodeFileDefaultResponse - | GetNodeFileDefaultResponse - | GetNodeFilePropertiesDefaultResponse - | ListNodeFilesDefaultResponse { - const lroOriginal = response.headers["x-ms-original-url"]; - const url = new URL(lroOriginal ?? response.request.url); - const method = response.request.method; - let pathDetails = responseMap[`${method} ${url.pathname}`]; - if (!pathDetails) { - pathDetails = getParametrizedPathSuccess(method, url.pathname); - } - return !pathDetails.includes(response.status); -} - -function getParametrizedPathSuccess(method: string, path: string): string[] { - 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: string[] = []; - - // Iterate the responseMap to find a match - for (const [key, value] of Object.entries(responseMap)) { - // 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); -} diff --git a/sdk/batch/batch-rest/generated/logger.ts b/sdk/batch/batch-rest/generated/logger.ts deleted file mode 100644 index 20094085989e..000000000000 --- a/sdk/batch/batch-rest/generated/logger.ts +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { createClientLogger } from "@azure/logger"; -export const logger = createClientLogger("batch"); diff --git a/sdk/batch/batch-rest/generated/models.ts b/sdk/batch/batch-rest/generated/models.ts deleted file mode 100644 index 1f444d6698a7..000000000000 --- a/sdk/batch/batch-rest/generated/models.ts +++ /dev/null @@ -1,1576 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -/** Parameters for creating an Azure Batch Pool. */ -export interface BatchPoolCreateContent { - /** A string that uniquely identifies the Pool within the Account. The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two Pool IDs within an Account that differ only by case). */ - id: string; - /** The display name for the Pool. The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. */ - displayName?: string; - /** The size of virtual machines in the Pool. All virtual machines in a Pool are the same size. For information about available VM sizes for Pools using Images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration), 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; - /** The virtual machine configuration for the Pool. This property must be specified. */ - virtualMachineConfiguration?: VirtualMachineConfiguration; - /** The timeout for allocation of Compute Nodes to the Pool. This timeout applies only to manual scaling; it has no effect when enableAutoScale is set to true. 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 user-specified tags associated with the pool. 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?: Record; - /** The desired number of dedicated Compute Nodes in the Pool. This property must not be specified if enableAutoScale is set to true. If enableAutoScale is set to false, then you must set either targetDedicatedNodes, targetLowPriorityNodes, or both. */ - targetDedicatedNodes?: number; - /** The desired number of Spot/Low-priority Compute Nodes in the Pool. This property must not be specified if enableAutoScale is set to true. If enableAutoScale is set to false, then you must set either targetDedicatedNodes, targetLowPriorityNodes, or both. */ - targetLowPriorityNodes?: number; - /** Whether the Pool size should automatically adjust over time. If false, at least one of targetDedicatedNodes and targetLowPriorityNodes must be specified. If true, the autoScaleFormula property is required and the Pool automatically resizes according to the formula. The default value is false. */ - enableAutoScale?: boolean; - /** A formula for the desired number of Compute Nodes in the Pool. This property must not be specified if enableAutoScale is set to false. It is required if enableAutoScale is set to true. The formula is checked for validity before the Pool is created. If the formula is not valid, the Batch service rejects the request with detailed error information. For more information about specifying this formula, see 'Automatically scale Compute Nodes in an Azure Batch Pool' (https://azure.microsoft.com/documentation/articles/batch-automatic-scaling/). */ - autoScaleFormula?: string; - /** The time interval at which to automatically adjust the Pool size according to the autoscale formula. The default value is 15 minutes. The minimum and maximum value are 5 minutes and 168 hours respectively. If you specify a value less than 5 minutes or greater than 168 hours, the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). */ - autoScaleEvaluationInterval?: string; - /** Whether the Pool permits direct communication between Compute Nodes. Enabling inter-node communication limits the maximum size of the Pool due to deployment restrictions on the Compute Nodes of the Pool. This may result in the Pool not reaching its desired size. The default value is false. */ - enableInterNodeCommunication?: boolean; - /** The network configuration for the Pool. */ - networkConfiguration?: NetworkConfiguration; - /** A Task specified to run on each Compute Node as it joins the Pool. The Task runs when the Compute Node is added to the Pool or when the Compute Node is restarted. */ - startTask?: BatchStartTask; - /** The list of Packages to be installed on each Compute Node in the Pool. When creating a pool, the package's application ID must be fully qualified (/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}). Changes to Package references affect all new 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 Package references on any given Pool. */ - applicationPackageReferences?: Array; - /** The number of task slots that can be used to run concurrent tasks on a single compute node in the pool. 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; - /** How Tasks are distributed across Compute Nodes in a Pool. If not specified, the default is spread. */ - taskSchedulingPolicy?: BatchTaskSchedulingPolicy; - /** The list of user Accounts to be created on each Compute Node in the Pool. */ - userAccounts?: Array; - /** A list of name-value pairs associated with the Pool as metadata. The Batch service does not assign any meaning to metadata; it is solely for the use of user code. */ - metadata?: Array; - /** Mount storage using specified file system for the entire lifetime of the pool. Mount the storage using Azure fileshare, NFS, CIFS or Blobfuse based file system. */ - mountConfiguration?: Array; - /** The desired node communication mode for the pool. If omitted, the default value is Default. */ - targetNodeCommunicationMode?: BatchNodeCommunicationMode; - /** The upgrade policy for the Pool. Describes an upgrade policy - automatic, manual, or rolling. */ - upgradePolicy?: UpgradePolicy; -} - -/** - * The configuration for Compute Nodes in a Pool based on the Azure Virtual - * Machines infrastructure. - */ -export interface VirtualMachineConfiguration { - /** A reference to the Azure Virtual Machines Marketplace Image or the custom Virtual Machine Image to use. */ - imageReference: ImageReference; - /** The SKU of the Batch Compute Node agent to be provisioned on Compute Nodes in the Pool. The Batch Compute Node agent is a program that runs on each Compute Node in the Pool, and provides the command-and-control interface between the Compute Node and the Batch service. There are different implementations of the Compute Node agent, known as SKUs, for different operating systems. You must specify a Compute Node agent SKU which matches the selected Image reference. To get the list of supported Compute Node agent SKUs along with their list of verified Image references, see the 'List supported Compute Node agent SKUs' operation. */ - nodeAgentSKUId: string; - /** Windows operating system settings on the virtual machine. This property must not be specified if the imageReference property specifies a Linux OS Image. */ - windowsConfiguration?: WindowsConfiguration; - /** The configuration for data disks attached to the Compute Nodes in the Pool. This property must be specified if the Compute Nodes in the Pool need to have empty data disks attached to them. This cannot be updated. Each Compute Node gets its own disk (the disk is not a file share). Existing disks cannot be attached, each attached disk is empty. When the Compute Node is removed from the Pool, the disk and all data associated with it is also deleted. The disk is not formatted after being attached, it must be formatted before use - for more information see https://docs.microsoft.com/en-us/azure/virtual-machines/linux/classic/attach-disk#initialize-a-new-data-disk-in-linux and https://docs.microsoft.com/en-us/azure/virtual-machines/windows/attach-disk-ps#add-an-empty-data-disk-to-a-virtual-machine. */ - dataDisks?: Array; - /** - * 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 Compute - * 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; - /** The container configuration for the Pool. If specified, setup is performed on each Compute 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; - /** The disk encryption configuration for the pool. If specified, encryption is performed on each node in the pool during node provisioning. */ - diskEncryptionConfiguration?: DiskEncryptionConfiguration; - /** The node placement configuration for the pool. This configuration will specify rules on how nodes in the pool will be physically allocated. */ - nodePlacementConfiguration?: BatchNodePlacementConfiguration; - /** The virtual machine extension for the pool. If specified, the extensions mentioned in this configuration will be installed on each node. */ - extensions?: Array; - /** Settings for the operating system disk of the Virtual Machine. */ - osDisk?: OSDisk; - /** Specifies the security profile settings for the virtual machine or virtual machine scale set. */ - securityProfile?: SecurityProfile; - /** 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. 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 a Azure Compute Gallery Image. - * To get the list of all Azure Marketplace Image references verified by Azure Batch, see the - * ' List Supported Images ' operation. - */ -export interface ImageReference { - /** The publisher of the Azure Virtual Machines Marketplace Image. For example, Canonical or MicrosoftWindowsServer. */ - publisher?: string; - /** The offer type of the Azure Virtual Machines Marketplace Image. For example, UbuntuServer or WindowsServer. */ - offer?: string; - /** The SKU of the Azure Virtual Machines Marketplace Image. For example, 18.04-LTS or 2019-Datacenter. */ - sku?: string; - /** The version of the Azure Virtual Machines Marketplace Image. A value of 'latest' can be specified to select the latest version of an Image. If omitted, the default is 'latest'. */ - version?: string; - /** The ARM resource identifier of the Azure Compute Gallery Image. Compute Nodes in the Pool will be created using this Image Id. This is of the form /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageDefinitionName}/versions/{VersionId} or /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageDefinitionName} for always defaulting to the latest image version. This property is mutually exclusive with other ImageReference properties. The Azure Compute Gallery Image must have replicas in the same region and must be in the same subscription as the Azure Batch account. If the image version is not specified in the imageId, the latest version will be used. For information about the firewall settings for the Batch Compute 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. */ - virtualMachineImageId?: string; -} - -/** Windows operating system settings to apply to the virtual machine. */ -export interface WindowsConfiguration { - /** Whether automatic updates are enabled on the virtual machine. 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 logical unit number. The logicalUnitNumber is used to uniquely identify each data disk. If attaching multiple disks, each should have a distinct logicalUnitNumber. The value must be between 0 and 63, inclusive. */ - lun: number; - /** The type of caching to be enabled for the data disks. The default value for caching is readwrite. 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 gigabytes. */ - diskSizeGB: number; - /** The storage Account type to be used for the data disk. If omitted, the default is "standard_lrs". */ - storageAccountType?: StorageAccountType; -} - -/** The configuration for container-enabled Pools. */ -export interface ContainerConfiguration { - /** The container technology to be used. */ - type: ContainerType; - /** The collection of container Image names. 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[]; - /** Additional private registries from which containers can be pulled. If any Images must be downloaded from a private registry which requires credentials, then those credentials must be provided here. */ - containerRegistries?: Array; -} - -/** A private container registry. */ -export interface ContainerRegistryReference { - /** The user name to log into the registry server. */ - username?: string; - /** The password to log into the registry server. */ - password?: string; - /** The registry URL. If omitted, the default is "docker.io". */ - registryServer?: string; - /** The reference to the user assigned identity to use to access an Azure Container Registry instead of username and password. */ - identityReference?: BatchNodeIdentityReference; -} - -/** - * The reference to a user assigned identity associated with the Batch pool which - * a compute node will use. - */ -export interface BatchNodeIdentityReference { - /** The ARM resource id of the user assigned identity. */ - resourceId?: string; -} - -/** - * The disk encryption configuration applied on compute nodes in the pool. - * Disk encryption configuration is not supported on Linux pool created with - * Azure Compute Gallery Image. - */ -export interface DiskEncryptionConfiguration { - /** The list of disk targets Batch Service will encrypt on the compute node. If omitted, no disks on the compute nodes in the pool will be encrypted. On Linux pool, only "TemporaryDisk" is supported; on Windows pool, "OsDisk" and "TemporaryDisk" must be specified. */ - targets?: DiskEncryptionTarget[]; -} - -/** - * For regional placement, nodes in the pool will be allocated in the same region. - * For zonal placement, nodes in the pool will be spread across different zones - * with best effort balancing. - */ -export interface BatchNodePlacementConfiguration { - /** Node placement Policy type on Batch Pools. Allocation policy used by Batch Service to provision the nodes. If not specified, Batch will use the regional policy. */ - policy?: BatchNodePlacementPolicyType; -} - -/** 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 extension. */ - 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; - /** The collection of extension names. Collection of extension names after which this extension needs to be provisioned. */ - provisionAfterExtensions?: string[]; -} - -/** Settings for the operating system disk of the compute node (VM). */ -export interface OSDisk { - /** Specifies the ephemeral Disk Settings for the operating system disk used by the compute node (VM). */ - ephemeralOSDiskSettings?: DiffDiskSettings; - /** Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The default values are: None for Standard storage. ReadOnly for Premium storage. */ - caching?: CachingType; - /** The initial disk size in GB when creating new OS disk. */ - diskSizeGB?: number; - /** The managed disk parameters. */ - managedDisk?: ManagedDisk; - /** 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 - * compute node (VM). - */ -export interface DiffDiskSettings { - /** Specifies the ephemeral disk placement for operating system disk for all VMs in the pool. This property can be used by user in the request to choose the location 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?: DiffDiskPlacement; -} - -/** The managed disk parameters. */ -export interface ManagedDisk { - /** The storage account type for managed disk. */ - storageAccountType: StorageAccountType; -} - -/** Specifies the security profile settings for the virtual machine or virtual machine scale set. */ -export interface SecurityProfile { - /** 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 SecurityType of the virtual machine. It has to be set to any specified value to enable UefiSettings. */ - securityType: SecurityTypes; - /** Specifies the security settings like secure boot and vTPM used while creating the virtual machine. 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 of 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; -} - -/** The network configuration for a Pool. */ -export interface NetworkConfiguration { - /** The ARM resource identifier of the virtual network subnet which the Compute Nodes of the Pool will join. This is of the form /subscriptions/{subscription}/resourceGroups/{group}/providers/{provider}/virtualNetworks/{network}/subnets/{subnet}. 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 Compute Nodes in the Pool. If the subnet doesn't have enough free IP addresses, the Pool will partially allocate 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 Nodes. This can be verified by checking if the specified VNet has any associated Network Security Groups (NSG). If communication to the Nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the Compute Nodes to unusable. For Pools created with virtualMachineConfiguration only ARM virtual networks ('Microsoft.Network/virtualNetworks') are supported. If the specified VNet has any associated Network Security Groups (NSG), then a few reserved system ports must be enabled for inbound communication. For Pools created with a virtual machine configuration, 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 configuration for endpoints on Compute Nodes in the Batch Pool. Pool endpoint configuration is only supported on Pools with the virtualMachineConfiguration property. */ - endpointConfiguration?: BatchPoolEndpointConfiguration; - /** The Public IPAddress configuration for Compute Nodes in the Batch Pool. Public IP configuration property is only supported on Pools with the virtualMachineConfiguration property. */ - publicIPAddressConfiguration?: PublicIpAddressConfiguration; - /** Whether this pool should enable accelerated networking. 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 BatchPoolEndpointConfiguration { - /** A list of inbound NAT Pools that can be used to address specific ports on an individual Compute Node externally. 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: Array; -} - -/** - * 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 of the endpoint. 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; - /** The port number on the Compute Node. 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; - /** The first port number in the range of external ports that will be used to provide inbound access to the backendPort on individual Compute Nodes. 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. Each range must contain at least 40 ports. If any reserved or overlapping values are provided the request fails with HTTP status code 400. */ - frontendPortRangeStart: number; - /** The last port number in the range of external ports that will be used to provide inbound access to the backendPort on individual Compute Nodes. 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. Each range must contain at least 40 ports. If any reserved or overlapping values are provided the request fails with HTTP status code 400. */ - frontendPortRangeEnd: number; - /** A list of network security group rules that will be applied to the endpoint. 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?: Array; -} - -/** A network security group rule to apply to an inbound endpoint. */ -export interface NetworkSecurityGroupRule { - /** The priority for this rule. 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; - /** The source address prefix or tag to match for the rule. 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; - /** The source port ranges to match for the rule. Valid values are '*' (for all ports 0 - 65535), a specific port (i.e. 22), or a port range (i.e. 100-200). The ports must be in the range of 0 to 65535. Each entry in this collection must not overlap any other entry (either a range or an individual port). If any other values are provided the request fails with HTTP status code 400. The default value is '*'. */ - sourcePortRanges?: string[]; -} - -/** The public IP Address configuration of the networking configuration of a Pool. */ -export interface PublicIpAddressConfiguration { - /** The provisioning type for Public IP Addresses for the Pool. The default value is BatchManaged. */ - provision?: IpAddressProvisioningType; - /** The list of public IPs which the Batch service will use when provisioning Compute Nodes. 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[]; -} - -/** - * Batch will retry Tasks when a recovery operation is triggered on a Node. - * Examples of recovery operations include (but are not limited to) when an - * unhealthy Node is rebooted or a Compute Node disappeared due to host failure. - * Retries due to recovery operations are independent of and are not counted - * against the maxTaskRetryCount. Even if the maxTaskRetryCount is 0, an internal - * retry due to a recovery operation may occur. Because of this, all Tasks should - * be idempotent. This means Tasks need to tolerate being interrupted and - * restarted without causing any corruption or duplicate data. The best practice - * for long running Tasks is to use some form of checkpointing. In some cases the - * StartTask may be re-run even though the Compute Node was not rebooted. Special - * care should be taken to avoid StartTasks which create breakaway process or - * install/launch services from the StartTask working directory, as this will - * block Batch from being able to re-run the StartTask. - */ -export interface BatchStartTask { - /** The command line of the 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. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables). */ - commandLine: string; - /** The settings for the container under which the StartTask runs. 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. Files produced in the container outside of AZ_BATCH_NODE_ROOT_DIR might not be reflected to the host disk, meaning that Batch file APIs will not be able to access those files. */ - containerSettings?: BatchTaskContainerSettings; - /** A list of files that the Batch service will download to the Compute Node before running the command line. There is a maximum size for the list of resource files. When the max size is exceeded, the request will fail and the response error code will be RequestEntityTooLarge. If this occurs, the collection of ResourceFiles must be reduced in size. This can be achieved using .zip files, Application Packages, or Docker Containers. Files listed under this element are located in the Task's working directory. */ - resourceFiles?: Array; - /** A list of environment variable settings for the StartTask. */ - environmentSettings?: Array; - /** The user identity under which the StartTask runs. If omitted, the Task runs as a non-administrative user unique to the Task. */ - userIdentity?: UserIdentity; - /** The maximum number of times the Task may be retried. 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, however this is not recommended for a start task or any task. The default value is 0 (no retries). */ - maxTaskRetryCount?: number; - /** Whether the Batch service should wait for the StartTask to complete successfully (that is, to exit with exit code 0) before scheduling any Tasks on the Compute Node. If true and the StartTask fails on a Node, the Batch service retries the StartTask up to its maximum retry count (maxTaskRetryCount). If the Task has still not completed successfully after all retries, then the Batch service marks the Node unusable, and will not schedule Tasks to it. This condition can be detected via the Compute Node state and failure info details. If false, the Batch service will not wait for the StartTask to complete. In this case, other Tasks can start executing on the Compute Node while the StartTask is still running; and even if the StartTask fails, new Tasks will continue to be scheduled on the Compute Node. The default is true. */ - waitForSuccess?: boolean; -} - -/** The container settings for a Task. */ -export interface BatchTaskContainerSettings { - /** Additional options to the container create command. These additional options are supplied as arguments to the "docker create" command, in addition to those controlled by the Batch Service. */ - containerRunOptions?: string; - /** The Image to use to create the container in which the Task will run. 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; - /** The private registry which contains the container Image. This setting can be omitted if was already provided at Pool creation. */ - registry?: ContainerRegistryReference; - /** The location of the container Task working directory. The default is 'taskWorkingDirectory'. */ - workingDirectory?: ContainerWorkingDirectory; -} - -/** A single file or multiple files to be downloaded to a Compute Node. */ -export interface ResourceFile { - /** The storage container name in the auto storage Account. The autoStorageContainerName, storageContainerUrl and httpUrl properties are mutually exclusive and one of them must be specified. */ - autoStorageContainerName?: string; - /** The URL of the blob container within Azure Blob Storage. 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 URL of the file to download. 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 blob prefix to use when downloading blobs from an Azure Storage container. Only the blobs whose names begin with the specified prefix will be downloaded. 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; - /** The location on the Compute Node to which to download the file(s), relative to the Task's working directory. 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; - /** The file permission mode attribute in octal format. 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 Compute Node. If this property is not specified for a Linux Compute Node, then a default value of 0770 is applied to the file. */ - fileMode?: string; - /** The reference to the user assigned identity to use to access Azure Blob Storage specified by storageContainerUrl or httpUrl. */ - identityReference?: BatchNodeIdentityReference; -} - -/** 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; -} - -/** The definition of the user identity under which the Task is run. Specify either the userName or autoUser property, but not both. */ -export interface UserIdentity { - /** The name of the user identity under which the Task is run. The userName and autoUser properties are mutually exclusive; you must specify one but not both. */ - username?: string; - /** The auto user under which the Task is run. The userName and autoUser properties are mutually exclusive; you must specify one but not both. */ - autoUser?: AutoUserSpecification; -} - -/** Specifies the options for the auto user that runs an Azure Batch Task. */ -export interface AutoUserSpecification { - /** The scope for the auto user. 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, such as if the task mutates the registry in a way which could impact other tasks. */ - scope?: AutoUserScope; - /** The elevation level of the auto user. The default value is nonAdmin. */ - elevationLevel?: ElevationLevel; -} - -/** A reference to an Package to be deployed to Compute Nodes. */ -export interface BatchApplicationPackageReference { - /** The ID of the application to deploy. When creating a pool, the package's application ID must be fully qualified (/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}). */ - applicationId: string; - /** The version of the application to deploy. If omitted, the default version is deployed. If this is omitted on a Pool, and no default version is specified for this application, the request fails with the error code InvalidApplicationPackageReferences and HTTP status code 409. If this is omitted on a Task, and no default version is specified for this application, the Task fails with a pre-processing error. */ - version?: string; -} - -/** Specifies how Tasks should be distributed across Compute Nodes. */ -export interface BatchTaskSchedulingPolicy { - /** How Tasks are distributed across Compute Nodes in a Pool. If not specified, the default is spread. */ - nodeFillType: BatchNodeFillType; -} - -/** - * Properties used to create a user used to execute Tasks on an Azure Batch - * Compute 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; - /** The elevation level of the user Account. The default value is nonAdmin. */ - elevationLevel?: ElevationLevel; - /** The Linux-specific user configuration for the user Account. This property is ignored if specified on a Windows Pool. If not specified, the user is created with the default options. */ - linuxUserConfiguration?: LinuxUserConfiguration; - /** The Windows-specific user configuration for the user Account. 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 Compute Node. */ -export interface LinuxUserConfiguration { - /** The user ID of the user Account. 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 group ID for the user Account. 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 SSH private key for the user Account. The private key must not be password protected. The private key is used to automatically configure asymmetric-key based authentication for SSH between Compute 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 Compute Nodes (no modification of the user's .ssh directory is done). */ - sshPrivateKey?: string; -} - -/** Properties used to create a user Account on a Windows Compute Node. */ -export interface WindowsUserConfiguration { - /** The login mode for the user. The default value for VirtualMachineConfiguration Pools is 'batch'. */ - 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; -} - -/** The file system to mount on each node. */ -export interface MountConfiguration { - /** The Azure Storage Container to mount using blob FUSE on each node. This property is mutually exclusive with all other properties. */ - azureBlobFileSystemConfiguration?: AzureBlobFileSystemConfiguration; - /** The NFS file system to mount on each node. This property is mutually exclusive with all other properties. */ - nfsMountConfiguration?: NfsMountConfiguration; - /** The CIFS/SMB file system to mount on each node. This property is mutually exclusive with all other properties. */ - cifsMountConfiguration?: CifsMountConfiguration; - /** The Azure File Share to mount on each node. 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; - /** The Azure Storage Account key. This property is mutually exclusive with both sasKey and identity; exactly one must be specified. */ - accountKey?: string; - /** The Azure Storage SAS token. This property is mutually exclusive with both accountKey and identity; exactly one must be specified. */ - sasKey?: string; - /** Additional command line options to pass to the mount command. These are 'net use' options in Windows and 'mount' options in Linux. */ - blobfuseOptions?: string; - /** The relative path on the compute node where the file system will be mounted. All file systems are mounted relative to the Batch mounts directory, accessible via the AZ_BATCH_NODE_MOUNTS_DIR environment variable. */ - relativeMountPath: string; - /** The reference to the user assigned identity to use to access containerName. This property is mutually exclusive with both accountKey and sasKey; exactly one must be specified. */ - identityReference?: BatchNodeIdentityReference; -} - -/** Information used to connect to an NFS file system. */ -export interface NfsMountConfiguration { - /** The URI of the file system to mount. */ - source: string; - /** The relative path on the compute node where the file system will be mounted. All file systems are mounted relative to the Batch mounts directory, accessible via the AZ_BATCH_NODE_MOUNTS_DIR environment variable. */ - relativeMountPath: string; - /** Additional command line options to pass to the mount command. 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; - /** The relative path on the compute node where the file system will be mounted. All file systems are mounted relative to the Batch mounts directory, accessible via the AZ_BATCH_NODE_MOUNTS_DIR environment variable. */ - relativeMountPath: string; - /** Additional command line options to pass to the mount command. 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; - /** The Azure Files URL. This is of the form 'https://{account}.file.core.windows.net/'. */ - azureFileUrl: string; - /** The Azure Storage account key. */ - accountKey: string; - /** The relative path on the compute node where the file system will be mounted. All file systems are mounted relative to the Batch mounts directory, accessible via the AZ_BATCH_NODE_MOUNTS_DIR environment variable. */ - relativeMountPath: string; - /** Additional command line options to pass to the mount command. 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; - /** Configuration parameters used for performing automatic OS Upgrade. The configuration parameters used for performing automatic OS upgrade. */ - automaticOSUpgradePolicy?: AutomaticOsUpgradePolicy; - /** The configuration parameters used while performing a rolling upgrade. This property is only supported on Pools with the virtualMachineConfiguration property. */ - 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/batchservice/pool/add?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. 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; -} - -/** Represents a name-value pair. */ -export interface NameValuePair { - /** The name in the name-value pair. */ - name?: string; - /** The value in the name-value pair. */ - value?: string; -} - -/** Parameters for updating an Azure Batch Pool. */ -export interface BatchPoolUpdateContent { - /** A Task to run on each Compute Node as it joins the Pool. The Task runs when the Compute Node is added to the Pool or when the Compute Node is restarted. If this element is present, it overwrites any existing StartTask. If omitted, any existing StartTask is left unchanged. */ - startTask?: BatchStartTask; - /** A list of Packages to be installed on each Compute Node in the Pool. Changes to Package references affect all new Nodes joining the Pool, but do not affect Compute Nodes that are already in the Pool until they are rebooted or reimaged. If this element is present, it replaces any existing Package references. If you specify an empty collection, then all Package references are removed from the Pool. If omitted, any existing Package references are left unchanged. */ - applicationPackageReferences?: Array; - /** A list of name-value pairs associated with the Pool as metadata. If this element is present, it replaces any existing metadata configured on the Pool. If you specify an empty collection, any metadata is removed from the Pool. If omitted, any existing metadata is left unchanged. */ - metadata?: Array; - /** The desired node communication mode for the pool. If this element is present, it replaces the existing targetNodeCommunicationMode configured on the Pool. If omitted, any existing metadata is left unchanged. */ - targetNodeCommunicationMode?: BatchNodeCommunicationMode; -} - -/** Parameters for enabling automatic scaling on an Azure Batch Pool. */ -export interface BatchPoolEnableAutoScaleContent { - /** The formula for the desired number of Compute Nodes in the Pool. The formula is checked for validity before it is applied to the Pool. If the formula is not valid, the Batch service rejects the request with detailed error information. For more information about specifying this formula, see Automatically scale Compute Nodes in an Azure Batch Pool (https://azure.microsoft.com/en-us/documentation/articles/batch-automatic-scaling). */ - autoScaleFormula?: string; - /** The time interval at which to automatically adjust the Pool size according to the autoscale formula. The default value is 15 minutes. The minimum and maximum value are 5 minutes and 168 hours respectively. If you specify a value less than 5 minutes or greater than 168 hours, the Batch service rejects the request with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). If you specify a new interval, then the existing autoscale evaluation schedule will be stopped and a new autoscale evaluation schedule will be started, with its starting time being the time when this request was issued. */ - autoScaleEvaluationInterval?: string; -} - -/** Parameters for evaluating an automatic scaling formula on an Azure Batch Pool. */ -export interface BatchPoolEvaluateAutoScaleContent { - /** The formula for the desired number of Compute Nodes in the Pool. The formula is validated and its results calculated, but it is not applied to the Pool. To apply the formula to the Pool, 'Enable automatic scaling on a Pool'. For more information about specifying this formula, see Automatically scale Compute Nodes in an Azure Batch Pool (https://azure.microsoft.com/en-us/documentation/articles/batch-automatic-scaling). */ - autoScaleFormula: string; -} - -/** Parameters for changing the size of an Azure Batch Pool. */ -export interface BatchPoolResizeContent { - /** 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 timeout for allocation of Nodes to the Pool or removal of Compute Nodes from the Pool. 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; - /** Determines what to do with a Compute Node and its running task(s) if the Pool size is decreasing. The default value is requeue. */ - nodeDeallocationOption?: BatchNodeDeallocationOption; -} - -/** Parameters for replacing properties on an Azure Batch Pool. */ -export interface BatchPoolReplaceContent { - /** A Task to run on each Compute Node as it joins the Pool. The Task runs when the Compute Node is added to the Pool or when the Compute Node is restarted. If this element is present, it overwrites any existing StartTask. If omitted, any existing StartTask is removed from the Pool. */ - startTask?: BatchStartTask; - /** The list of Application Packages to be installed on each Compute Node in the Pool. The list replaces any existing Application Package references on the Pool. 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. If omitted, or if you specify an empty collection, any existing Application Packages references are removed from the Pool. A maximum of 10 references may be specified on a given Pool. */ - applicationPackageReferences: Array; - /** A list of name-value pairs associated with the Pool as metadata. This list replaces any existing metadata configured on the Pool. If omitted, or if you specify an empty collection, any existing metadata is removed from the Pool. */ - metadata: Array; - /** The desired node communication mode for the pool. This setting replaces any existing targetNodeCommunication setting on the Pool. If omitted, the existing setting is default. */ - targetNodeCommunicationMode?: BatchNodeCommunicationMode; -} - -/** Parameters for removing nodes from an Azure Batch Pool. */ -export interface BatchNodeRemoveContent { - /** A list containing the IDs of the Compute Nodes to be removed from the specified Pool. A maximum of 100 nodes may be removed per request. */ - nodeList: string[]; - /** The timeout for removal of Compute Nodes to the Pool. 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; - /** Determines what to do with a Compute Node and its running task(s) after it has been selected for deallocation. The default value is requeue. */ - nodeDeallocationOption?: BatchNodeDeallocationOption; -} - -/** An Azure Batch Job. */ -export interface BatchJob { - /** The priority of the Job. Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0. */ - priority?: number; - /** Whether Tasks in this job can be preempted by other high priority jobs. If the value is set to True, other high priority jobs submitted to the system will take precedence and will be able requeue tasks from this job. You can update a job's allowTaskPreemption after it has been created using the update job API. */ - allowTaskPreemption?: boolean; - /** The maximum number of tasks that can be executed in parallel for the job. The value of maxParallelTasks must be -1 or greater than 0 if specified. If not specified, the default value is -1, which means there's no limit to the number of tasks that can be run at once. You can update a job's maxParallelTasks after it has been created using the update job API. */ - maxParallelTasks?: number; - /** The execution constraints for the Job. */ - constraints?: BatchJobConstraints; - /** The Pool settings associated with the Job. */ - poolInfo: BatchPoolInfo; - /** The action the Batch service should take when all Tasks in the Job are in the completed state. The default is noaction. */ - onAllTasksComplete?: OnAllBatchTasksComplete; - /** A list of name-value pairs associated with the Job as metadata. The Batch service does not assign any meaning to metadata; it is solely for the use of user code. */ - metadata?: Array; -} - -/** The execution constraints for a Job. */ -export interface BatchJobConstraints { - /** The maximum elapsed time that the Job may run, measured from the time the Job is created. If the Job does not complete within the time limit, the Batch service terminates it and any Tasks that are still running. In this case, the termination reason will be MaxWallClockTimeExpiry. If this property is not specified, there is no time limit on how long the Job may run. */ - maxWallClockTime?: string; - /** The maximum number of times each Task may be retried. 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 each Task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries a Task up to 4 times (one initial try and 3 retries). If the maximum retry count is 0, the Batch service does not retry Tasks. If the maximum retry count is -1, the Batch service retries Tasks without limit. The default value is 0 (no retries). */ - maxTaskRetryCount?: number; -} - -/** - * Specifies details of a Job Manager Task. - * The Job Manager Task is automatically started when the Job is created. The - * Batch service tries to schedule the Job Manager Task before any other Tasks in - * the Job. When shrinking a Pool, the Batch service tries to preserve Nodes where - * Job Manager Tasks are running for as long as possible (that is, Compute Nodes - * running 'normal' Tasks are removed before Compute Nodes running Job Manager - * Tasks). When a Job Manager Task fails and needs to be restarted, the system - * tries to schedule it at the highest priority. If there are no idle Compute - * Nodes available, the system may terminate one of the running Tasks in the Pool - * and return it to the queue in order to make room for the Job Manager Task to - * restart. Note that a Job Manager Task in one Job does not have priority over - * Tasks in other Jobs. Across Jobs, only Job level priorities are observed. For - * example, if a Job Manager in a priority 0 Job needs to be restarted, it will - * not displace Tasks of a priority 1 Job. Batch will retry Tasks when a recovery - * operation is triggered on a Node. Examples of recovery operations include (but - * are not limited to) when an unhealthy Node is rebooted or a Compute Node - * disappeared due to host failure. Retries due to recovery operations are - * independent of and are not counted against the maxTaskRetryCount. Even if the - * maxTaskRetryCount is 0, an internal retry due to a recovery operation may - * occur. Because of this, all Tasks should be idempotent. This means Tasks need - * to tolerate being interrupted and restarted without causing any corruption or - * duplicate data. The best practice for long running Tasks is to use some form of - * checkpointing. - */ -export interface BatchJobManagerTask { - /** A string that uniquely identifies the Job Manager Task within the Job. The ID can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. */ - id: string; - /** The display name of the Job Manager Task. It need not be unique and can contain any Unicode characters up to a maximum length of 1024. */ - displayName?: string; - /** The command line of the Job Manager Task. 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. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables). */ - commandLine: string; - /** The settings for the container under which the Job Manager Task runs. If the Pool that will run this Task has containerConfiguration set, this must be set as well. If the Pool that will run this Task doesn't have containerConfiguration set, this must not be set. 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. Files produced in the container outside of AZ_BATCH_NODE_ROOT_DIR might not be reflected to the host disk, meaning that Batch file APIs will not be able to access those files. */ - containerSettings?: BatchTaskContainerSettings; - /** A list of files that the Batch service will download to the Compute Node before running the command line. Files listed under this element are located in the Task's working directory. There is a maximum size for the list of resource files. When the max size is exceeded, the request will fail and the response error code will be RequestEntityTooLarge. If this occurs, the collection of ResourceFiles must be reduced in size. This can be achieved using .zip files, Application Packages, or Docker Containers. */ - resourceFiles?: Array; - /** A list of files that the Batch service will upload from the Compute Node after running the command line. For multi-instance Tasks, the files will only be uploaded from the Compute Node on which the primary Task is executed. */ - outputFiles?: Array; - /** A list of environment variable settings for the Job Manager Task. */ - environmentSettings?: Array; - /** Constraints that apply to the Job Manager Task. */ - constraints?: BatchTaskConstraints; - /** The number of scheduling slots that the Task requires to run. The default is 1. A Task can only be scheduled to run on a compute node if the node has enough free scheduling slots available. For multi-instance Tasks, this property is not supported and must not be specified. */ - requiredSlots?: number; - /** Whether completion of the Job Manager Task signifies completion of the entire Job. If true, when the Job Manager Task completes, the Batch service marks the Job as complete. If any Tasks are still running at this time (other than Job Release), those Tasks are terminated. If false, the completion of the Job Manager Task does not affect the Job status. In this case, you should either use the onAllTasksComplete attribute to terminate the Job, or have a client or user terminate the Job explicitly. An example of this is if the Job Manager creates a set of Tasks but then takes no further role in their execution. The default value is true. If you are using the onAllTasksComplete and onTaskFailure attributes to control Job lifetime, and using the Job Manager Task only to create the Tasks for the Job (not to monitor progress), then it is important to set killJobOnCompletion to false. */ - killJobOnCompletion?: boolean; - /** The user identity under which the Job Manager Task runs. If omitted, the Task runs as a non-administrative user unique to the Task. */ - userIdentity?: UserIdentity; - /** Whether the Job Manager Task requires exclusive use of the Compute Node where it runs. If true, no other Tasks will run on the same Node for as long as the Job Manager is running. If false, other Tasks can run simultaneously with the Job Manager on a Compute Node. The Job Manager Task counts normally against the Compute Node's concurrent Task limit, so this is only relevant if the Compute Node allows multiple concurrent Tasks. The default value is true. */ - runExclusive?: boolean; - /** - * A list of Application Packages that the Batch service will deploy to the - * Compute Node before running the command line.Application Packages are - * downloaded and deployed to a shared directory, not the Task working - * directory. Therefore, if a referenced Application Package is already - * on the Compute Node, and is up to date, then it is not re-downloaded; - * the existing copy on the Compute Node is used. If a referenced Application - * Package cannot be installed, for example because the package has been deleted - * or because download failed, the Task fails. - */ - applicationPackageReferences?: Array; - /** The settings for an authentication token that the Task can use to perform Batch service operations. If this property is set, the Batch service provides the Task with an authentication token which can be used to authenticate Batch service operations without requiring an Account access key. The token is provided via the AZ_BATCH_AUTHENTICATION_TOKEN environment variable. The operations that the Task can carry out using the token depend on the settings. For example, a Task can request Job permissions in order to add other Tasks to the Job, or check the status of the Job or of other Tasks under the Job. */ - authenticationTokenSettings?: AuthenticationTokenSettings; - /** Whether the Job Manager Task may run on a Spot/Low-priority Compute Node. The default value is true. */ - allowLowPriorityNode?: boolean; -} - -/** On every file uploads, Batch service writes two log files to the compute node, 'fileuploadout.txt' and 'fileuploaderr.txt'. These log files are used to learn more about a specific failure. */ -export interface OutputFile { - /** A pattern indicating which file(s) to upload. Both relative and absolute paths are supported. Relative paths are relative to the Task working directory. The following wildcards are supported: * matches 0 or more characters (for example pattern abc* would match abc or abcdef), ** matches any directory, ? matches any single character, [abc] matches one character in the brackets, and [a-c] matches one character in the range. Brackets can include a negation to match any character not specified (for example [!abc] matches any character but a, b, or c). If a file name starts with "." it is ignored by default but may be matched by specifying it explicitly (for example *.gif will not match .a.gif, but .*.gif will). A simple example: **\*.txt matches any file that does not start in '.' and ends with .txt in the Task working directory or any subdirectory. If the filename contains a wildcard character it can be escaped using brackets (for example abc[*] would match a file named abc*). Note that both \ and / are treated as directory separators on Windows, but only / is on Linux. Environment variables (%var% on Windows or $var on Linux) are expanded prior to the pattern being applied. */ - filePattern: string; - /** The destination for the output file(s). */ - destination: OutputFileDestination; - /** Additional options for the upload operation, including under what conditions to perform the upload. */ - uploadOptions: OutputFileUploadConfig; -} - -/** The destination to which a file should be uploaded. */ -export interface OutputFileDestination { - /** A location in Azure blob storage to which files are uploaded. */ - container?: OutputFileBlobContainerDestination; -} - -/** Specifies a file upload destination within an Azure blob storage container. */ -export interface OutputFileBlobContainerDestination { - /** The destination blob or virtual directory within the Azure Storage container. If filePattern refers to a specific file (i.e. contains no wildcards), then path is the name of the blob to which to upload that file. If filePattern contains one or more wildcards (and therefore may match multiple files), then path is the name of the blob virtual directory (which is prepended to each blob name) to which to upload the file(s). If omitted, file(s) are uploaded to the root of the container with a blob name matching their file name. */ - path?: string; - /** The URL of the container within Azure Blob Storage to which to upload the file(s). If not using a managed identity, the URL must include a Shared Access Signature (SAS) granting write permissions to the container. */ - containerUrl: string; - /** The reference to the user assigned identity to use to access Azure Blob Storage specified by containerUrl. The identity must have write access to the Azure Blob Storage container. */ - identityReference?: BatchNodeIdentityReference; - /** A list of name-value pairs for headers to be used in uploading output files. These headers will be specified when uploading files to Azure Storage. Official document on allowed headers when uploading blobs: https://docs.microsoft.com/en-us/rest/api/storageservices/put-blob#request-headers-all-blob-types. */ - uploadHeaders?: Array; -} - -/** An HTTP header name-value pair */ -export interface HttpHeader { - /** The case-insensitive name of the header to be used while uploading output files. */ - name: string; - /** The value of the header to be used while uploading output files. */ - value?: string; -} - -/** - * Options for an output file upload operation, including under what conditions - * to perform the upload. - */ -export interface OutputFileUploadConfig { - /** The conditions under which the Task output file or set of files should be uploaded. The default is taskcompletion. */ - uploadCondition: OutputFileUploadCondition; -} - -/** Execution constraints to apply to a Task. */ -export interface BatchTaskConstraints { - /** The maximum elapsed time that the Task may run, measured from the time the Task starts. If the Task does not complete within the time limit, the Batch service terminates it. If this is not specified, there is no time limit on how long the Task may run. */ - maxWallClockTime?: string; - /** The minimum time to retain the Task directory on the Compute Node where it ran, from the time it completes execution. After this time, the Batch service may delete the Task directory and all its contents. The default is 7 days, i.e. the Task directory will be retained for 7 days unless the Compute Node is removed or the Job is deleted. */ - retentionTime?: string; - /** The maximum number of times the Task may be retried. The Batch service retries a Task if its exit code is nonzero. Note that this value specifically controls the number of retries for the Task executable due to a nonzero exit code. 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 after the first attempt. If the maximum retry count is -1, the Batch service retries the Task without limit, however this is not recommended for a start task or any task. The default value is 0 (no retries). */ - maxTaskRetryCount?: number; -} - -/** - * The settings for an authentication token that the Task can use to perform Batch - * service operations. - */ -export interface AuthenticationTokenSettings { - /** The Batch resources to which the token grants access. The authentication token grants access to a limited set of Batch service operations. Currently the only supported value for the access property is 'job', which grants access to all operations related to the Job which contains the Task. */ - access?: AccessScope[]; -} - -/** - * A Job Preparation Task to run before any Tasks of the Job on any given Compute Node. - * You can use Job Preparation to prepare a Node to run Tasks for the Job. - * Activities commonly performed in Job Preparation include: Downloading common - * resource files used by all the Tasks in the Job. The Job Preparation Task can - * download these common resource files to the shared location on the Node. - * (AZ_BATCH_NODE_ROOT_DIR\shared), or starting a local service on the Node so - * that all Tasks of that Job can communicate with it. If the Job Preparation Task - * fails (that is, exhausts its retry count before exiting with exit code 0), - * Batch will not run Tasks of this Job on the Node. The Compute Node remains - * ineligible to run Tasks of this Job until it is reimaged. The Compute Node - * remains active and can be used for other Jobs. The Job Preparation Task can run - * multiple times on the same Node. Therefore, you should write the Job - * Preparation Task to handle re-execution. If the Node is rebooted, the Job - * Preparation Task is run again on the Compute Node before scheduling any other - * Task of the Job, if rerunOnNodeRebootAfterSuccess is true or if the Job - * Preparation Task did not previously complete. If the Node is reimaged, the Job - * Preparation Task is run again before scheduling any Task of the Job. Batch will - * retry Tasks when a recovery operation is triggered on a Node. Examples of - * recovery operations include (but are not limited to) when an unhealthy Node is - * rebooted or a Compute Node disappeared due to host failure. Retries due to - * recovery operations are independent of and are not counted against the - * maxTaskRetryCount. Even if the maxTaskRetryCount is 0, an internal retry due to - * a recovery operation may occur. Because of this, all Tasks should be - * idempotent. This means Tasks need to tolerate being interrupted and restarted - * without causing any corruption or duplicate data. The best practice for long - * running Tasks is to use some form of checkpointing. - */ -export interface BatchJobPreparationTask { - /** A string that uniquely identifies the Job Preparation Task within the Job. The ID can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. If you do not specify this property, the Batch service assigns a default value of 'jobpreparation'. No other Task in the Job can have the same ID as the Job Preparation Task. If you try to submit a Task with the same id, the Batch service rejects the request with error code TaskIdSameAsJobPreparationTask; if you are calling the REST API directly, the HTTP status code is 409 (Conflict). */ - id?: string; - /** The command line of the Job Preparation Task. 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. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables). */ - commandLine: string; - /** The settings for the container under which the Job Preparation Task runs. 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. Files produced in the container outside of AZ_BATCH_NODE_ROOT_DIR might not be reflected to the host disk, meaning that Batch file APIs will not be able to access those files. */ - containerSettings?: BatchTaskContainerSettings; - /** A list of files that the Batch service will download to the Compute Node before running the command line. Files listed under this element are located in the Task's working directory. There is a maximum size for the list of resource files. When the max size is exceeded, the request will fail and the response error code will be RequestEntityTooLarge. If this occurs, the collection of ResourceFiles must be reduced in size. This can be achieved using .zip files, Application Packages, or Docker Containers. */ - resourceFiles?: Array; - /** A list of environment variable settings for the Job Preparation Task. */ - environmentSettings?: Array; - /** Constraints that apply to the Job Preparation Task. */ - constraints?: BatchTaskConstraints; - /** Whether the Batch service should wait for the Job Preparation Task to complete successfully before scheduling any other Tasks of the Job on the Compute Node. A Job Preparation Task has completed successfully if it exits with exit code 0. If true and the Job Preparation Task fails on a Node, the Batch service retries the Job Preparation Task up to its maximum retry count (as specified in the constraints element). If the Task has still not completed successfully after all retries, then the Batch service will not schedule Tasks of the Job to the Node. The Node remains active and eligible to run Tasks of other Jobs. If false, the Batch service will not wait for the Job Preparation Task to complete. In this case, other Tasks of the Job can start executing on the Compute Node while the Job Preparation Task is still running; and even if the Job Preparation Task fails, new Tasks will continue to be scheduled on the Compute Node. The default value is true. */ - waitForSuccess?: boolean; - /** The user identity under which the Job Preparation Task runs. If omitted, the Task runs as a non-administrative user unique to the Task on Windows Compute Nodes, or a non-administrative user unique to the Pool on Linux Compute Nodes. */ - userIdentity?: UserIdentity; - /** Whether the Batch service should rerun the Job Preparation Task after a Compute Node reboots. The Job Preparation Task is always rerun if a Compute Node is reimaged, or if the Job Preparation Task did not complete (e.g. because the reboot occurred while the Task was running). Therefore, you should always write a Job Preparation Task to be idempotent and to behave correctly if run multiple times. The default value is true. */ - rerunOnNodeRebootAfterSuccess?: boolean; -} - -/** - * A Job Release Task to run on Job completion on any Compute Node where the Job has run. - * The Job Release Task runs when the Job ends, because of one of the following: - * The user calls the Terminate Job API, or the Delete Job API while the Job is - * still active, the Job's maximum wall clock time constraint is reached, and the - * Job is still active, or the Job's Job Manager Task completed, and the Job is - * configured to terminate when the Job Manager completes. The Job Release Task - * runs on each Node where Tasks of the Job have run and the Job Preparation Task - * ran and completed. If you reimage a Node after it has run the Job Preparation - * Task, and the Job ends without any further Tasks of the Job running on that - * Node (and hence the Job Preparation Task does not re-run), then the Job Release - * Task does not run on that Compute Node. If a Node reboots while the Job Release - * Task is still running, the Job Release Task runs again when the Compute Node - * starts up. The Job is not marked as complete until all Job Release Tasks have - * completed. The Job Release Task runs in the background. It does not occupy a - * scheduling slot; that is, it does not count towards the taskSlotsPerNode limit - * specified on the Pool. - */ -export interface BatchJobReleaseTask { - /** A string that uniquely identifies the Job Release Task within the Job. The ID can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. If you do not specify this property, the Batch service assigns a default value of 'jobrelease'. No other Task in the Job can have the same ID as the Job Release Task. If you try to submit a Task with the same id, the Batch service rejects the request with error code TaskIdSameAsJobReleaseTask; if you are calling the REST API directly, the HTTP status code is 409 (Conflict). */ - id?: string; - /** The command line of the Job Release Task. 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. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables). */ - commandLine: string; - /** The settings for the container under which the Job Release Task runs. 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. Files produced in the container outside of AZ_BATCH_NODE_ROOT_DIR might not be reflected to the host disk, meaning that Batch file APIs will not be able to access those files. */ - containerSettings?: BatchTaskContainerSettings; - /** A list of files that the Batch service will download to the Compute Node before running the command line. There is a maximum size for the list of resource files. When the max size is exceeded, the request will fail and the response error code will be RequestEntityTooLarge. If this occurs, the collection of ResourceFiles must be reduced in size. This can be achieved using .zip files, Application Packages, or Docker Containers. Files listed under this element are located in the Task's working directory. */ - resourceFiles?: Array; - /** A list of environment variable settings for the Job Release Task. */ - environmentSettings?: Array; - /** The maximum elapsed time that the Job Release Task may run on a given Compute Node, measured from the time the Task starts. If the Task does not complete within the time limit, the Batch service terminates it. The default value is 15 minutes. You may not specify a timeout longer than 15 minutes. If you do, the Batch service rejects it with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). */ - maxWallClockTime?: string; - /** The minimum time to retain the Task directory for the Job Release Task on the Compute Node. After this time, the Batch service may delete the Task directory and all its contents. The default is 7 days, i.e. the Task directory will be retained for 7 days unless the Compute Node is removed or the Job is deleted. */ - retentionTime?: string; - /** The user identity under which the Job Release Task runs. If omitted, the Task runs as a non-administrative user unique to the Task. */ - userIdentity?: UserIdentity; -} - -/** Specifies how a Job should be assigned to a Pool. */ -export interface BatchPoolInfo { - /** The ID of an existing Pool. All the Tasks of the Job will run on the specified Pool. You must ensure that the Pool referenced by this property exists. If the Pool does not exist at the time the Batch service tries to schedule a Job, no Tasks for the Job will run until you create a Pool with that id. Note that the Batch service will not reject the Job request; it will simply not run Tasks until the Pool exists. You must specify either the Pool ID or the auto Pool specification, but not both. */ - poolId?: string; - /** Characteristics for a temporary 'auto pool'. The Batch service will create this auto Pool when the Job is submitted. If auto Pool creation fails, the Batch service moves the Job to a completed state, and the Pool creation error is set in the Job's scheduling error property. The Batch service manages the lifetime (both creation and, unless keepAlive is specified, deletion) of the auto Pool. Any user actions that affect the lifetime of the auto Pool while the Job is active will result in unexpected behavior. You must specify either the Pool ID or the auto Pool specification, but not both. */ - autoPoolSpecification?: BatchAutoPoolSpecification; -} - -/** - * Specifies characteristics for a temporary 'auto pool'. The Batch service will - * create this auto Pool when the Job is submitted. - */ -export interface BatchAutoPoolSpecification { - /** A prefix to be added to the unique identifier when a Pool is automatically created. The Batch service assigns each auto Pool a unique identifier on creation. To distinguish between Pools created for different purposes, you can specify this element to add a prefix to the ID that is assigned. The prefix can be up to 20 characters long. */ - autoPoolIdPrefix?: string; - /** The minimum lifetime of created auto Pools, and how multiple Jobs on a schedule are assigned to Pools. */ - poolLifetimeOption: BatchPoolLifetimeOption; - /** Whether to keep an auto Pool alive after its lifetime expires. If false, the Batch service deletes the Pool once its lifetime (as determined by the poolLifetimeOption setting) expires; that is, when the Job or Job Schedule completes. If true, the Batch service does not delete the Pool automatically. It is up to the user to delete auto Pools created with this option. */ - keepAlive?: boolean; - /** The Pool specification for the auto Pool. */ - pool?: BatchPoolSpecification; -} - -/** Specification for creating a new Pool. */ -export interface BatchPoolSpecification { - /** The display name for the Pool. The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. */ - displayName?: string; - /** The size of the virtual machines in the Pool. All virtual machines in a Pool are the same size. For information about available sizes of virtual machines in Pools, see Choose a VM size for Compute Nodes in an Azure Batch Pool (https://docs.microsoft.com/azure/batch/batch-pool-vm-sizes). */ - vmSize: string; - /** The virtual machine configuration for the Pool. This property must be specified if the Pool needs to be created with Azure IaaS VMs. If it is not specified then the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). */ - virtualMachineConfiguration?: VirtualMachineConfiguration; - /** The number of task slots that can be used to run concurrent tasks on a single compute node in the pool. 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; - /** How Tasks are distributed across Compute Nodes in a Pool. If not specified, the default is spread. */ - taskSchedulingPolicy?: BatchTaskSchedulingPolicy; - /** The timeout for allocation of Compute Nodes to the Pool. This timeout applies only to manual scaling; it has no effect when enableAutoScale is set to true. The default value is 15 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; - /** The user-specified tags associated with the pool.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?: string; - /** The desired number of dedicated Compute Nodes in the Pool. This property must not be specified if enableAutoScale is set to true. If enableAutoScale is set to false, then you must set either targetDedicatedNodes, targetLowPriorityNodes, or both. */ - targetDedicatedNodes?: number; - /** The desired number of Spot/Low-priority Compute Nodes in the Pool. This property must not be specified if enableAutoScale is set to true. If enableAutoScale is set to false, then you must set either targetDedicatedNodes, targetLowPriorityNodes, or both. */ - targetLowPriorityNodes?: number; - /** Whether the Pool size should automatically adjust over time. If false, at least one of targetDedicatedNodes and targetLowPriorityNodes must be specified. If true, the autoScaleFormula element is required. The Pool automatically resizes according to the formula. The default value is false. */ - enableAutoScale?: boolean; - /** The formula for the desired number of Compute Nodes in the Pool. This property must not be specified if enableAutoScale is set to false. It is required if enableAutoScale is set to true. The formula is checked for validity before the Pool is created. If the formula is not valid, the Batch service rejects the request with detailed error information. */ - autoScaleFormula?: string; - /** The time interval at which to automatically adjust the Pool size according to the autoscale formula. The default value is 15 minutes. The minimum and maximum value are 5 minutes and 168 hours respectively. If you specify a value less than 5 minutes or greater than 168 hours, the Batch service rejects the request with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). */ - autoScaleEvaluationInterval?: string; - /** Whether the Pool permits direct communication between Compute Nodes. Enabling inter-node communication limits the maximum size of the Pool due to deployment restrictions on the Compute Nodes of the Pool. This may result in the Pool not reaching its desired size. The default value is false. */ - enableInterNodeCommunication?: boolean; - /** The network configuration for the Pool. */ - networkConfiguration?: NetworkConfiguration; - /** A Task to run on each Compute Node as it joins the Pool. The Task runs when the Compute Node is added to the Pool or when the Compute Node is restarted. */ - startTask?: BatchStartTask; - /** The list of Packages to be installed on each Compute Node in the Pool. When creating a pool, the package's application ID must be fully qualified (/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}). Changes to Package references affect all new 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 Package references on any given Pool. */ - applicationPackageReferences?: Array; - /** The list of user Accounts to be created on each Compute Node in the Pool. */ - userAccounts?: Array; - /** A list of name-value pairs associated with the Pool as metadata. The Batch service does not assign any meaning to metadata; it is solely for the use of user code. */ - metadata?: Array; - /** A list of file systems to mount on each node in the pool. This supports Azure Files, NFS, CIFS/SMB, and Blobfuse. */ - mountConfiguration?: Array; - /** The desired node communication mode for the pool. If omitted, the default value is Default. */ - targetNodeCommunicationMode?: BatchNodeCommunicationMode; - /** The upgrade policy for the Pool. Describes an upgrade policy - automatic, manual, or rolling. */ - upgradePolicy?: UpgradePolicy; -} - -/** The network configuration for the Job. */ -export interface BatchJobNetworkConfiguration { - /** The ARM resource identifier of the virtual network subnet which Compute Nodes running Tasks from the Job will join for the duration of the Task. This will only work with a VirtualMachineConfiguration Pool. 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 Compute Nodes which will run Tasks from the Job. This can be up to the number of Compute Nodes in the Pool. The 'MicrosoftAzureBatch' service principal must have the 'Classic Virtual Machine Contributor' Role-Based Access Control (RBAC) role for the specified VNet so that Azure Batch service can schedule Tasks on the Nodes. This can be verified by checking if the specified VNet has any associated Network Security Groups (NSG). If communication to the Nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the Compute Nodes to unusable. This is of the form /subscriptions/{subscription}/resourceGroups/{group}/providers/{provider}/virtualNetworks/{network}/subnets/{subnet}. If the specified VNet has any associated Network Security Groups (NSG), then a few reserved system ports must be enabled for inbound communication from the Azure Batch service. For Pools created with a Virtual Machine configuration, enable ports 29876 and 29877, as well as port 22 for Linux and port 3389 for Windows. Port 443 is also required to be open for outbound connections for communications to Azure Storage. For more details see: https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. */ - subnetId: string; -} - -/** Contains information about the execution of a Job in the Azure Batch service. */ -export interface BatchJobExecutionInfo { - /** The start time of the Job. This is the time at which the Job was created. */ - startTime: Date | string; - /** The completion time of the Job. This property is set only if the Job is in the completed state. */ - endTime?: Date | string; - /** The ID of the Pool to which this Job is assigned. This element contains the actual Pool where the Job is assigned. When you get Job details from the service, they also contain a poolInfo element, which contains the Pool configuration data from when the Job was added or updated. That poolInfo element may also contain a poolId element. If it does, the two IDs are the same. If it does not, it means the Job ran on an auto Pool, and this property contains the ID of that auto Pool. */ - poolId?: string; - /** Details of any error encountered by the service in starting the Job. This property is not set if there was no error starting the Job. */ - schedulingError?: BatchJobSchedulingError; - /** A string describing the reason the Job ended. This property is set only if the Job is in the completed state. If the Batch service terminates the Job, it sets the reason as follows: JMComplete - the Job Manager Task completed, and killJobOnCompletion was set to true. MaxWallClockTimeExpiry - the Job reached its maxWallClockTime constraint. TerminateJobSchedule - the Job ran as part of a schedule, and the schedule terminated. AllTasksComplete - the Job's onAllTasksComplete attribute is set to terminatejob, and all Tasks in the Job are complete. TaskFailed - the Job's onTaskFailure attribute is set to performExitOptionsJobAction, and a Task in the Job failed with an exit condition that specified a jobAction of terminatejob. Any other string is a user-defined reason specified in a call to the 'Terminate a Job' operation. */ - terminateReason?: string; -} - -/** An error encountered by the Batch service when scheduling a Job. */ -export interface BatchJobSchedulingError { - /** The category of the Job scheduling error. */ - category: ErrorCategory; - /** An identifier for the Job scheduling error. Codes are invariant and are intended to be consumed programmatically. */ - code?: string; - /** A message describing the Job scheduling error, intended to be suitable for display in a user interface. */ - message?: string; - /** A list of additional error details related to the scheduling error. */ - details?: Array; -} - -/** Resource usage statistics for a Job. */ -export interface BatchJobStatistics { - /** The URL of the statistics. */ - url: string; - /** The start time of the time range covered by the statistics. */ - startTime: Date | string; - /** The time at which the statistics were last updated. All statistics are limited to the range between startTime and lastUpdateTime. */ - lastUpdateTime: Date | string; - /** The total user mode CPU time (summed across all cores and all Compute Nodes) consumed by all Tasks in the Job. */ - userCPUTime: string; - /** The total kernel mode CPU time (summed across all cores and all Compute Nodes) consumed by all Tasks in the Job. */ - kernelCPUTime: string; - /** The total wall clock time of all Tasks in the Job. The wall clock time is the elapsed time from when the Task started running on a Compute Node to when it finished (or to the last time the statistics were updated, if the Task had not finished by then). If a Task was retried, this includes the wall clock time of all the Task retries. */ - wallClockTime: string; - /** The total number of disk read operations made by all Tasks in the Job. */ - readIOps: number; - /** The total number of disk write operations made by all Tasks in the Job. */ - writeIOps: number; - /** The total amount of data in GiB read from disk by all Tasks in the Job. */ - readIOGiB: number; - /** The total amount of data in GiB written to disk by all Tasks in the Job. */ - writeIOGiB: number; - /** The total number of Tasks successfully completed in the Job during the given time range. A Task completes successfully if it returns exit code 0. */ - numSucceededTasks: number; - /** The total number of Tasks in the Job that failed during the given time range. A Task fails if it exhausts its maximum retry count without returning exit code 0. */ - numFailedTasks: number; - /** The total number of retries on all the Tasks in the Job during the given time range. */ - numTaskRetries: number; - /** The total wait time of all Tasks in the Job. The wait time for a Task is defined as the elapsed time between the creation of the Task and the start of Task execution. (If the Task is retried due to failures, the wait time is the time to the most recent Task execution.) This value is only reported in the Account lifetime statistics; it is not included in the Job statistics. */ - waitTime: string; -} - -/** Parameters for updating an Azure Batch Job. */ -export interface BatchJobUpdateContent { - /** The priority of the Job. Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. If omitted, the priority of the Job is left unchanged. */ - priority?: number; - /** Whether Tasks in this job can be preempted by other high priority jobs. If the value is set to True, other high priority jobs submitted to the system will take precedence and will be able requeue tasks from this job. You can update a job's allowTaskPreemption after it has been created using the update job API. */ - allowTaskPreemption?: boolean; - /** The maximum number of tasks that can be executed in parallel for the job. The value of maxParallelTasks must be -1 or greater than 0 if specified. If not specified, the default value is -1, which means there's no limit to the number of tasks that can be run at once. You can update a job's maxParallelTasks after it has been created using the update job API. */ - maxParallelTasks?: number; - /** The execution constraints for the Job. If omitted, the existing execution constraints are left unchanged. */ - constraints?: BatchJobConstraints; - /** The Pool on which the Batch service runs the Job's Tasks. You may change the Pool for a Job only when the Job is disabled. The Patch Job call will fail if you include the poolInfo element and the Job is not disabled. If you specify an autoPoolSpecification in the poolInfo, only the keepAlive property of the autoPoolSpecification can be updated, and then only if the autoPoolSpecification has a poolLifetimeOption of Job (other job properties can be updated as normal). If omitted, the Job continues to run on its current Pool. */ - poolInfo?: BatchPoolInfo; - /** The action the Batch service should take when all Tasks in the Job are in the completed state. If omitted, the completion behavior is left unchanged. You may not change the value from terminatejob to noaction - that is, once you have engaged automatic Job termination, you cannot turn it off again. If you try to do this, the request fails with an 'invalid property value' error response; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). */ - onAllTasksComplete?: OnAllBatchTasksComplete; - /** A list of name-value pairs associated with the Job as metadata. If omitted, the existing Job metadata is left unchanged. */ - metadata?: Array; -} - -/** Parameters for disabling an Azure Batch Job. */ -export interface BatchJobDisableContent { - /** What to do with active Tasks associated with the Job. */ - disableTasks: DisableBatchJobOption; -} - -/** Parameters for terminating an Azure Batch Job. */ -export interface BatchJobTerminateContent { - /** The text you want to appear as the Job's TerminationReason. The default is 'UserTerminate'. */ - terminateReason?: string; -} - -/** Parameters for creating an Azure Batch Job. */ -export interface BatchJobCreateContent { - /** A string that uniquely identifies the Job within the Account. The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two IDs within an Account that differ only by case). */ - id: string; - /** The display name for the Job. The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. */ - displayName?: string; - /** Whether Tasks in the Job can define dependencies on each other. The default is false. */ - usesTaskDependencies?: boolean; - /** The priority of the Job. Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0. */ - priority?: number; - /** Whether Tasks in this job can be preempted by other high priority jobs. If the value is set to True, other high priority jobs submitted to the system will take precedence and will be able requeue tasks from this job. You can update a job's allowTaskPreemption after it has been created using the update job API. */ - allowTaskPreemption?: boolean; - /** The maximum number of tasks that can be executed in parallel for the job. The value of maxParallelTasks must be -1 or greater than 0 if specified. If not specified, the default value is -1, which means there's no limit to the number of tasks that can be run at once. You can update a job's maxParallelTasks after it has been created using the update job API. */ - maxParallelTasks?: number; - /** The execution constraints for the Job. */ - constraints?: BatchJobConstraints; - /** Details of a Job Manager Task to be launched when the Job is started. If the Job does not specify a Job Manager Task, the user must explicitly add Tasks to the Job. If the Job does specify a Job Manager Task, the Batch service creates the Job Manager Task when the Job is created, and will try to schedule the Job Manager Task before scheduling other Tasks in the Job. The Job Manager Task's typical purpose is to control and/or monitor Job execution, for example by deciding what additional Tasks to run, determining when the work is complete, etc. (However, a Job Manager Task is not restricted to these activities - it is a fully-fledged Task in the system and perform whatever actions are required for the Job.) For example, a Job Manager Task might download a file specified as a parameter, analyze the contents of that file and submit additional Tasks based on those contents. */ - jobManagerTask?: BatchJobManagerTask; - /** The Job Preparation Task. If a Job has a Job Preparation Task, the Batch service will run the Job Preparation Task on a Node before starting any Tasks of that Job on that Compute Node. */ - jobPreparationTask?: BatchJobPreparationTask; - /** The Job Release Task. A Job Release Task cannot be specified without also specifying a Job Preparation Task for the Job. The Batch service runs the Job Release Task on the Nodes that have run the Job Preparation Task. The primary purpose of the Job Release Task is to undo changes to Compute Nodes made by the Job Preparation Task. Example activities include deleting local files, or shutting down services that were started as part of Job preparation. */ - jobReleaseTask?: BatchJobReleaseTask; - /** The list of common environment variable settings. These environment variables are set for all Tasks in the Job (including the Job Manager, Job Preparation and Job Release Tasks). Individual Tasks can override an environment setting specified here by specifying the same setting name with a different value. */ - commonEnvironmentSettings?: Array; - /** The Pool on which the Batch service runs the Job's Tasks. */ - poolInfo: BatchPoolInfo; - /** The action the Batch service should take when all Tasks in the Job are in the completed state. Note that if a Job contains no Tasks, then all Tasks are considered complete. This option is therefore most commonly used with a Job Manager task; if you want to use automatic Job termination without a Job Manager, you should initially set onAllTasksComplete to noaction and update the Job properties to set onAllTasksComplete to terminatejob once you have finished adding Tasks. The default is noaction. */ - onAllTasksComplete?: OnAllBatchTasksComplete; - /** The action the Batch service should take when any Task in the Job fails. A Task is considered to have failed if has a failureInfo. A failureInfo is set if the Task completes with a non-zero exit code after exhausting its retry count, or if there was an error starting the Task, for example due to a resource file download error. The default is noaction. */ - onTaskFailure?: OnBatchTaskFailure; - /** The network configuration for the Job. */ - networkConfiguration?: BatchJobNetworkConfiguration; - /** A list of name-value pairs associated with the Job as metadata. The Batch service does not assign any meaning to metadata; it is solely for the use of user code. */ - metadata?: Array; -} - -/** Contains information about the container which a Task is executing. */ -export interface BatchTaskContainerExecutionInfo { - /** The ID of the container. */ - containerId?: string; - /** The state of the container. This is the state of the container according to the Docker service. It is equivalent to the status field returned by "docker inspect". */ - state?: string; - /** Detailed error information about the container. This is the detailed error string from the Docker service, if available. It is equivalent to the error field returned by "docker inspect". */ - error?: string; -} - -/** Information about a Task failure. */ -export interface BatchTaskFailureInfo { - /** The category of the Task error. */ - category: ErrorCategory; - /** An identifier for the Task error. Codes are invariant and are intended to be consumed programmatically. */ - code?: string; - /** A message describing the Task error, intended to be suitable for display in a user interface. */ - message?: string; - /** A list of additional details related to the error. */ - details?: Array; -} - -/** - * A Job Schedule that allows recurring Jobs by specifying when to run Jobs and a - * specification used to create each Job. - */ -export interface BatchJobSchedule { - /** The schedule according to which Jobs will be created. All times are fixed respective to UTC and are not impacted by daylight saving time. */ - schedule?: BatchJobScheduleConfiguration; - /** The details of the Jobs to be created on this schedule. */ - jobSpecification: BatchJobSpecification; - /** A list of name-value pairs associated with the schedule as metadata. The Batch service does not assign any meaning to metadata; it is solely for the use of user code. */ - metadata?: Array; -} - -/** - * The schedule according to which Jobs will be created. All times are fixed - * respective to UTC and are not impacted by daylight saving time. - */ -export interface BatchJobScheduleConfiguration { - /** The earliest time at which any Job may be created under this Job Schedule. If you do not specify a doNotRunUntil time, the schedule becomes ready to create Jobs immediately. */ - doNotRunUntil?: Date | string; - /** A time after which no Job will be created under this Job Schedule. The schedule will move to the completed state as soon as this deadline is past and there is no active Job under this Job Schedule. If you do not specify a doNotRunAfter time, and you are creating a recurring Job Schedule, the Job Schedule will remain active until you explicitly terminate it. */ - doNotRunAfter?: Date | string; - /** The time interval, starting from the time at which the schedule indicates a Job should be created, within which a Job must be created. If a Job is not created within the startWindow interval, then the 'opportunity' is lost; no Job will be created until the next recurrence of the schedule. If the schedule is recurring, and the startWindow is longer than the recurrence interval, then this is equivalent to an infinite startWindow, because the Job that is 'due' in one recurrenceInterval is not carried forward into the next recurrence interval. The default is infinite. The minimum value is 1 minute. If you specify a lower value, the Batch service rejects the schedule with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). */ - startWindow?: string; - /** The time interval between the start times of two successive Jobs under the Job Schedule. A Job Schedule can have at most one active Job under it at any given time. Because a Job Schedule can have at most one active Job under it at any given time, if it is time to create a new Job under a Job Schedule, but the previous Job is still running, the Batch service will not create the new Job until the previous Job finishes. If the previous Job does not finish within the startWindow period of the new recurrenceInterval, then no new Job will be scheduled for that interval. For recurring Jobs, you should normally specify a jobManagerTask in the jobSpecification. If you do not use jobManagerTask, you will need an external process to monitor when Jobs are created, add Tasks to the Jobs and terminate the Jobs ready for the next recurrence. The default is that the schedule does not recur: one Job is created, within the startWindow after the doNotRunUntil time, and the schedule is complete as soon as that Job finishes. The minimum value is 1 minute. If you specify a lower value, the Batch service rejects the schedule with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). */ - recurrenceInterval?: string; -} - -/** Specifies details of the Jobs to be created on a schedule. */ -export interface BatchJobSpecification { - /** The priority of Jobs created under this schedule. Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0. This priority is used as the default for all Jobs under the Job Schedule. You can update a Job's priority after it has been created using by using the update Job API. */ - priority?: number; - /** Whether Tasks in this job can be preempted by other high priority jobs. If the value is set to True, other high priority jobs submitted to the system will take precedence and will be able requeue tasks from this job. You can update a job's allowTaskPreemption after it has been created using the update job API. */ - allowTaskPreemption?: boolean; - /** The maximum number of tasks that can be executed in parallel for the job. The value of maxParallelTasks must be -1 or greater than 0 if specified. If not specified, the default value is -1, which means there's no limit to the number of tasks that can be run at once. You can update a job's maxParallelTasks after it has been created using the update job API. */ - maxParallelTasks?: number; - /** The display name for Jobs created under this schedule. The name need not be unique and can contain any Unicode characters up to a maximum length of 1024. */ - displayName?: string; - /** Whether Tasks in the Job can define dependencies on each other. The default is false. */ - usesTaskDependencies?: boolean; - /** The action the Batch service should take when all Tasks in a Job created under this schedule are in the completed state. Note that if a Job contains no Tasks, then all Tasks are considered complete. This option is therefore most commonly used with a Job Manager task; if you want to use automatic Job termination without a Job Manager, you should initially set onAllTasksComplete to noaction and update the Job properties to set onAllTasksComplete to terminatejob once you have finished adding Tasks. The default is noaction. */ - onAllTasksComplete?: OnAllBatchTasksComplete; - /** The action the Batch service should take when any Task fails in a Job created under this schedule. A Task is considered to have failed if it have failed if has a failureInfo. A failureInfo is set if the Task completes with a non-zero exit code after exhausting its retry count, or if there was an error starting the Task, for example due to a resource file download error. The default is noaction. */ - onTaskFailure?: OnBatchTaskFailure; - /** The network configuration for the Job. */ - networkConfiguration?: BatchJobNetworkConfiguration; - /** The execution constraints for Jobs created under this schedule. */ - constraints?: BatchJobConstraints; - /** The details of a Job Manager Task to be launched when a Job is started under this schedule. If the Job does not specify a Job Manager Task, the user must explicitly add Tasks to the Job using the Task API. If the Job does specify a Job Manager Task, the Batch service creates the Job Manager Task when the Job is created, and will try to schedule the Job Manager Task before scheduling other Tasks in the Job. */ - jobManagerTask?: BatchJobManagerTask; - /** The Job Preparation Task for Jobs created under this schedule. If a Job has a Job Preparation Task, the Batch service will run the Job Preparation Task on a Node before starting any Tasks of that Job on that Compute Node. */ - jobPreparationTask?: BatchJobPreparationTask; - /** The Job Release Task for Jobs created under this schedule. The primary purpose of the Job Release Task is to undo changes to Nodes made by the Job Preparation Task. Example activities include deleting local files, or shutting down services that were started as part of Job preparation. A Job Release Task cannot be specified without also specifying a Job Preparation Task for the Job. The Batch service runs the Job Release Task on the Compute Nodes that have run the Job Preparation Task. */ - jobReleaseTask?: BatchJobReleaseTask; - /** A list of common environment variable settings. These environment variables are set for all Tasks in Jobs created under this schedule (including the Job Manager, Job Preparation and Job Release Tasks). Individual Tasks can override an environment setting specified here by specifying the same setting name with a different value. */ - commonEnvironmentSettings?: Array; - /** The Pool on which the Batch service runs the Tasks of Jobs created under this schedule. */ - poolInfo: BatchPoolInfo; - /** A list of name-value pairs associated with each Job created under this schedule as metadata. The Batch service does not assign any meaning to metadata; it is solely for the use of user code. */ - metadata?: Array; -} - -/** - * Contains information about Jobs that have been and will be run under a Job - * Schedule. - */ -export interface BatchJobScheduleExecutionInfo { - /** The next time at which a Job will be created under this schedule. This property is meaningful only if the schedule is in the active state when the time comes around. For example, if the schedule is disabled, no Job will be created at nextRunTime unless the Job is enabled before then. */ - nextRunTime?: Date | string; - /** Information about the most recent Job under the Job Schedule. This property is present only if the at least one Job has run under the schedule. */ - recentJob?: RecentBatchJob; - /** The time at which the schedule ended. This property is set only if the Job Schedule is in the completed state. */ - endTime?: Date | string; -} - -/** Information about the most recent Job to run under the Job Schedule. */ -export interface RecentBatchJob { - /** The ID of the Job. */ - id?: string; - /** The URL of the Job. */ - url?: string; -} - -/** Resource usage statistics for a Job Schedule. */ -export interface BatchJobScheduleStatistics { - /** The URL of the statistics. */ - url: string; - /** The start time of the time range covered by the statistics. */ - startTime: Date | string; - /** The time at which the statistics were last updated. All statistics are limited to the range between startTime and lastUpdateTime. */ - lastUpdateTime: Date | string; - /** The total user mode CPU time (summed across all cores and all Compute Nodes) consumed by all Tasks in all Jobs created under the schedule. */ - userCPUTime: string; - /** The total kernel mode CPU time (summed across all cores and all Compute Nodes) consumed by all Tasks in all Jobs created under the schedule. */ - kernelCPUTime: string; - /** The total wall clock time of all the Tasks in all the Jobs created under the schedule. The wall clock time is the elapsed time from when the Task started running on a Compute Node to when it finished (or to the last time the statistics were updated, if the Task had not finished by then). If a Task was retried, this includes the wall clock time of all the Task retries. */ - wallClockTime: string; - /** The total number of disk read operations made by all Tasks in all Jobs created under the schedule. */ - readIOps: number; - /** The total number of disk write operations made by all Tasks in all Jobs created under the schedule. */ - writeIOps: number; - /** The total gibibytes read from disk by all Tasks in all Jobs created under the schedule. */ - readIOGiB: number; - /** The total gibibytes written to disk by all Tasks in all Jobs created under the schedule. */ - writeIOGiB: number; - /** The total number of Tasks successfully completed during the given time range in Jobs created under the schedule. A Task completes successfully if it returns exit code 0. */ - numSucceededTasks: number; - /** The total number of Tasks that failed during the given time range in Jobs created under the schedule. A Task fails if it exhausts its maximum retry count without returning exit code 0. */ - numFailedTasks: number; - /** The total number of retries during the given time range on all Tasks in all Jobs created under the schedule. */ - numTaskRetries: number; - /** The total wait time of all Tasks in all Jobs created under the schedule. The wait time for a Task is defined as the elapsed time between the creation of the Task and the start of Task execution. (If the Task is retried due to failures, the wait time is the time to the most recent Task execution.). This value is only reported in the Account lifetime statistics; it is not included in the Job statistics. */ - waitTime: string; -} - -/** Parameters for updating an Azure Batch Job Schedule. */ -export interface BatchJobScheduleUpdateContent { - /** The schedule according to which Jobs will be created. All times are fixed respective to UTC and are not impacted by daylight saving time. If you do not specify this element, the existing schedule is left unchanged. */ - schedule?: BatchJobScheduleConfiguration; - /** The details of the Jobs to be created on this schedule. Updates affect only Jobs that are started after the update has taken place. Any currently active Job continues with the older specification. */ - jobSpecification?: BatchJobSpecification; - /** A list of name-value pairs associated with the Job Schedule as metadata. If you do not specify this element, existing metadata is left unchanged. */ - metadata?: Array; -} - -/** Parameters for creating an Azure Batch Job Schedule */ -export interface BatchJobScheduleCreateContent { - /** A string that uniquely identifies the schedule within the Account. The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two IDs within an Account that differ only by case). */ - id: string; - /** The display name for the schedule. The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. */ - displayName?: string; - /** The schedule according to which Jobs will be created. All times are fixed respective to UTC and are not impacted by daylight saving time. */ - schedule: BatchJobScheduleConfiguration; - /** The details of the Jobs to be created on this schedule. */ - jobSpecification: BatchJobSpecification; - /** A list of name-value pairs associated with the schedule as metadata. The Batch service does not assign any meaning to metadata; it is solely for the use of user code. */ - metadata?: Array; -} - -/** Parameters for creating an Azure Batch Task. */ -export interface BatchTaskCreateContent { - /** A string that uniquely identifies the Task within the Job. The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two IDs within a Job that differ only by case). */ - id: string; - /** A display name for the Task. The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. */ - displayName?: string; - /** How the Batch service should respond when the Task completes. */ - exitConditions?: ExitConditions; - /** The command line of the Task. For multi-instance Tasks, the command line is executed as the primary Task, after the primary Task and all subtasks have finished executing the coordination command line. 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. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables). */ - commandLine: string; - /** The settings for the container under which the Task runs. If the Pool that will run this Task has containerConfiguration set, this must be set as well. If the Pool that will run this Task doesn't have containerConfiguration set, this must not be set. 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. Files produced in the container outside of AZ_BATCH_NODE_ROOT_DIR might not be reflected to the host disk, meaning that Batch file APIs will not be able to access those files. */ - containerSettings?: BatchTaskContainerSettings; - /** A list of files that the Batch service will download to the Compute Node before running the command line. For multi-instance Tasks, the resource files will only be downloaded to the Compute Node on which the primary Task is executed. There is a maximum size for the list of resource files. When the max size is exceeded, the request will fail and the response error code will be RequestEntityTooLarge. If this occurs, the collection of ResourceFiles must be reduced in size. This can be achieved using .zip files, Application Packages, or Docker Containers. */ - resourceFiles?: Array; - /** A list of files that the Batch service will upload from the Compute Node after running the command line. For multi-instance Tasks, the files will only be uploaded from the Compute Node on which the primary Task is executed. */ - outputFiles?: Array; - /** A list of environment variable settings for the Task. */ - environmentSettings?: Array; - /** A locality hint that can be used by the Batch service to select a Compute Node on which to start the new Task. */ - affinityInfo?: AffinityInfo; - /** The execution constraints that apply to this Task. If you do not specify constraints, the maxTaskRetryCount is the maxTaskRetryCount specified for the Job, the maxWallClockTime is infinite, and the retentionTime is 7 days. */ - constraints?: BatchTaskConstraints; - /** The number of scheduling slots that the Task required to run. The default is 1. A Task can only be scheduled to run on a compute node if the node has enough free scheduling slots available. For multi-instance Tasks, this must be 1. */ - requiredSlots?: number; - /** The user identity under which the Task runs. If omitted, the Task runs as a non-administrative user unique to the Task. */ - userIdentity?: UserIdentity; - /** An object that indicates that the Task is a multi-instance Task, and contains information about how to run the multi-instance Task. */ - multiInstanceSettings?: MultiInstanceSettings; - /** The Tasks that this Task depends on. This Task will not be scheduled until all Tasks that it depends on have completed successfully. If any of those Tasks fail and exhaust their retry counts, this Task will never be scheduled. If the Job does not have usesTaskDependencies set to true, and this element is present, the request fails with error code TaskDependenciesNotSpecifiedOnJob. */ - dependsOn?: BatchTaskDependencies; - /** A list of Packages that the Batch service will deploy to the Compute Node before running the command line. Application packages are downloaded and deployed to a shared directory, not the Task working directory. Therefore, if a referenced package is already on the Node, and is up to date, then it is not re-downloaded; the existing copy on the Compute Node is used. If a referenced Package cannot be installed, for example because the package has been deleted or because download failed, the Task fails. */ - applicationPackageReferences?: Array; - /** The settings for an authentication token that the Task can use to perform Batch service operations. If this property is set, the Batch service provides the Task with an authentication token which can be used to authenticate Batch service operations without requiring an Account access key. The token is provided via the AZ_BATCH_AUTHENTICATION_TOKEN environment variable. The operations that the Task can carry out using the token depend on the settings. For example, a Task can request Job permissions in order to add other Tasks to the Job, or check the status of the Job or of other Tasks under the Job. */ - authenticationTokenSettings?: AuthenticationTokenSettings; -} - -/** Specifies how the Batch service should respond when the Task completes. */ -export interface ExitConditions { - /** A list of individual Task exit codes and how the Batch service should respond to them. */ - exitCodes?: Array; - /** A list of Task exit code ranges and how the Batch service should respond to them. */ - exitCodeRanges?: Array; - /** How the Batch service should respond if the Task fails to start due to an error. */ - preProcessingError?: ExitOptions; - /** How the Batch service should respond if a file upload error occurs. If the Task exited with an exit code that was specified via exitCodes or exitCodeRanges, and then encountered a file upload error, then the action specified by the exit code takes precedence. */ - fileUploadError?: ExitOptions; - /** How the Batch service should respond if the Task fails with an exit condition not covered by any of the other properties. This value is used if the Task exits with any nonzero exit code not listed in the exitCodes or exitCodeRanges collection, with a pre-processing error if the preProcessingError property is not present, or with a file upload error if the fileUploadError property is not present. If you want non-default behavior on exit code 0, you must list it explicitly using the exitCodes or exitCodeRanges collection. */ - default?: ExitOptions; -} - -/** - * How the Batch service should respond if a Task exits with a particular exit - * code. - */ -export interface ExitCodeMapping { - /** A process exit code. */ - code: number; - /** How the Batch service should respond if the Task exits with this exit code. */ - exitOptions: ExitOptions; -} - -/** Specifies how the Batch service responds to a particular exit condition. */ -export interface ExitOptions { - /** An action to take on the Job containing the Task, if the Task completes with the given exit condition and the Job's onTaskFailed property is 'performExitOptionsJobAction'. The default is none for exit code 0 and terminate for all other exit conditions. If the Job's onTaskFailed property is noaction, then specifying this property returns an error and the add Task request fails with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). */ - jobAction?: BatchJobAction; - /** An action that the Batch service performs on Tasks that depend on this Task. Possible values are 'satisfy' (allowing dependent tasks to progress) and 'block' (dependent tasks continue to wait). Batch does not yet support cancellation of dependent tasks. */ - dependencyAction?: DependencyAction; -} - -/** - * A range of exit codes and how the Batch service should respond to exit codes - * within that range. - */ -export interface ExitCodeRangeMapping { - /** The first exit code in the range. */ - start: number; - /** The last exit code in the range. */ - end: number; - /** How the Batch service should respond if the Task exits with an exit code in the range start to end (inclusive). */ - exitOptions: ExitOptions; -} - -/** - * A locality hint that can be used by the Batch service to select a Compute Node - * on which to start a Task. - */ -export interface AffinityInfo { - /** An opaque string representing the location of a Compute Node or a Task that has run previously. You can pass the affinityId of a Node to indicate that this Task needs to run on that Compute Node. Note that this is just a soft affinity. If the target Compute Node is busy or unavailable at the time the Task is scheduled, then the Task will be scheduled elsewhere. */ - affinityId: string; -} - -/** - * Multi-instance Tasks are commonly used to support MPI Tasks. In the MPI case, - * if any of the subtasks fail (for example due to exiting with a non-zero exit - * code) the entire multi-instance Task fails. The multi-instance Task is then - * terminated and retried, up to its retry limit. - */ -export interface MultiInstanceSettings { - /** The number of Compute Nodes required by the Task. If omitted, the default is 1. */ - numberOfInstances?: number; - /** The command line to run on all the Compute Nodes to enable them to coordinate when the primary runs the main Task command. A typical coordination command line launches a background service and verifies that the service is ready to process inter-node messages. */ - coordinationCommandLine: string; - /** A list of files that the Batch service will download before running the coordination command line. The difference between common resource files and Task resource files is that common resource files are downloaded for all subtasks including the primary, whereas Task resource files are downloaded only for the primary. Also note that these resource files are not downloaded to the Task working directory, but instead are downloaded to the Task root directory (one directory above the working directory). There is a maximum size for the list of resource files. When the max size is exceeded, the request will fail and the response error code will be RequestEntityTooLarge. If this occurs, the collection of ResourceFiles must be reduced in size. This can be achieved using .zip files, Application Packages, or Docker Containers. */ - commonResourceFiles?: Array; -} - -/** - * Specifies any dependencies of a Task. Any Task that is explicitly specified or - * within a dependency range must complete before the dependant Task will be - * scheduled. - */ -export interface BatchTaskDependencies { - /** The list of Task IDs that this Task depends on. All Tasks in this list must complete successfully before the dependent Task can be scheduled. The taskIds collection is limited to 64000 characters total (i.e. the combined length of all Task IDs). If the taskIds collection exceeds the maximum length, the Add Task request fails with error code TaskDependencyListTooLong. In this case consider using Task ID ranges instead. */ - taskIds?: string[]; - /** The list of Task ID ranges that this Task depends on. All Tasks in all ranges must complete successfully before the dependent Task can be scheduled. */ - taskIdRanges?: Array; -} - -/** - * The start and end of the range are inclusive. For example, if a range has start - * 9 and end 12, then it represents Tasks '9', '10', '11' and '12'. - */ -export interface BatchTaskIdRange { - /** The first Task ID in the range. */ - start: number; - /** The last Task ID in the range. */ - end: number; -} - -/** - * Batch will retry Tasks when a recovery operation is triggered on a Node. - * Examples of recovery operations include (but are not limited to) when an - * unhealthy Node is rebooted or a Compute Node disappeared due to host failure. - * Retries due to recovery operations are independent of and are not counted - * against the maxTaskRetryCount. Even if the maxTaskRetryCount is 0, an internal - * retry due to a recovery operation may occur. Because of this, all Tasks should - * be idempotent. This means Tasks need to tolerate being interrupted and - * restarted without causing any corruption or duplicate data. The best practice - * for long running Tasks is to use some form of checkpointing. - */ -export interface BatchTask { - /** The execution constraints that apply to this Task. */ - constraints?: BatchTaskConstraints; -} - -/** Information about the execution of a Task. */ -export interface BatchTaskExecutionInfo { - /** The time at which the Task started running. 'Running' corresponds to the running state, so if the Task specifies resource files or Packages, then the start time reflects the time at which the Task started downloading or deploying these. If the Task has been restarted or retried, this is the most recent time at which the Task started running. This property is present only for Tasks that are in the running or completed state. */ - startTime?: Date | string; - /** The time at which the Task completed. This property is set only if the Task is in the Completed state. */ - endTime?: Date | string; - /** The exit code of the program specified on the Task command line. This property is set only if the Task is in the completed state. In general, the exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. However, if the Batch service terminates the Task (due to timeout, or user termination via the API) you may see an operating system-defined exit code. */ - exitCode?: number; - /** Information about the container under which the Task is executing. This property is set only if the Task runs in a container context. */ - containerInfo?: BatchTaskContainerExecutionInfo; - /** Information describing the Task failure, if any. This property is set only if the Task is in the completed state and encountered a failure. */ - failureInfo?: BatchTaskFailureInfo; - /** The number of times the Task has been retried by the Batch service. Task application failures (non-zero exit code) are retried, pre-processing errors (the Task could not be run) and file upload errors are not retried. The Batch service will retry the Task up to the limit specified by the constraints. */ - retryCount: number; - /** The most recent time at which a retry of the Task started running. This element is present only if the Task was retried (i.e. retryCount is nonzero). If present, this is typically the same as startTime, but may be different if the Task has been restarted for reasons other than retry; for example, if the Compute Node was rebooted during a retry, then the startTime is updated but the lastRetryTime is not. */ - lastRetryTime?: Date | string; - /** The number of times the Task has been requeued by the Batch service as the result of a user request. When the user removes Compute Nodes from a Pool (by resizing/shrinking the pool) or when the Job is being disabled, the user can specify that running Tasks on the Compute Nodes be requeued for execution. This count tracks how many times the Task has been requeued for these reasons. */ - requeueCount: number; - /** The most recent time at which the Task has been requeued by the Batch service as the result of a user request. This property is set only if the requeueCount is nonzero. */ - lastRequeueTime?: Date | string; - /** The result of the Task execution. If the value is 'failed', then the details of the failure can be found in the failureInfo property. */ - result?: BatchTaskExecutionResult; -} - -/** Information about the Compute Node on which a Task ran. */ -export interface BatchNodeInfo { - /** An identifier for the Node on which the Task ran, which can be passed when adding a Task to request that the Task be scheduled on this Compute Node. */ - affinityId?: string; - /** The URL of the Compute Node on which the Task ran. */ - nodeUrl?: string; - /** The ID of the Pool on which the Task ran. */ - poolId?: string; - /** The ID of the Compute Node on which the Task ran. */ - nodeId?: string; - /** The root directory of the Task on the Compute Node. */ - taskRootDirectory?: string; - /** The URL to the root directory of the Task on the Compute Node. */ - taskRootDirectoryUrl?: string; -} - -/** Resource usage statistics for a Task. */ -export interface BatchTaskStatistics { - /** The URL of the statistics. */ - url: string; - /** The start time of the time range covered by the statistics. */ - startTime: Date | string; - /** The time at which the statistics were last updated. All statistics are limited to the range between startTime and lastUpdateTime. */ - lastUpdateTime: Date | string; - /** The total user mode CPU time (summed across all cores and all Compute Nodes) consumed by the Task. */ - userCPUTime: string; - /** The total kernel mode CPU time (summed across all cores and all Compute Nodes) consumed by the Task. */ - kernelCPUTime: string; - /** The total wall clock time of the Task. The wall clock time is the elapsed time from when the Task started running on a Compute Node to when it finished (or to the last time the statistics were updated, if the Task had not finished by then). If the Task was retried, this includes the wall clock time of all the Task retries. */ - wallClockTime: string; - /** The total number of disk read operations made by the Task. */ - readIOps: number; - /** The total number of disk write operations made by the Task. */ - writeIOps: number; - /** The total gibibytes read from disk by the Task. */ - readIOGiB: number; - /** The total gibibytes written to disk by the Task. */ - writeIOGiB: number; - /** The total wait time of the Task. The wait time for a Task is defined as the elapsed time between the creation of the Task and the start of Task execution. (If the Task is retried due to failures, the wait time is the time to the most recent Task execution.). */ - waitTime: string; -} - -/** A collection of Azure Batch Tasks to add. */ -export interface BatchTaskGroup { - /** The collection of Tasks to add. The maximum count of Tasks is 100. The total serialized size of this collection must be less than 1MB. If it is greater than 1MB (for example if each Task has 100's of resource files or environment variables), the request will fail with code 'RequestBodyTooLarge' and should be retried again with fewer Tasks. */ - value: Array; -} - -/** Parameters for creating a user account for RDP or SSH access on an Azure Batch Compute Node. */ -export interface BatchNodeUserCreateContent { - /** The user name of the Account. */ - name: string; - /** Whether the Account should be an administrator on the Compute Node. The default value is false. */ - isAdmin?: boolean; - /** The time at which the Account should expire. If omitted, the default is 1 day from the current time. For Linux Compute Nodes, the expiryTime has a precision up to a day. */ - expiryTime?: Date | string; - /** The password of the Account. The password is required for Windows Compute Nodes (those created with 'virtualMachineConfiguration' using a Windows Image reference). For Linux Compute Nodes, the password can optionally be specified along with the sshPublicKey property. */ - password?: string; - /** The SSH public key that can be used for remote login to the Compute Node. The public key should be compatible with OpenSSH encoding and should be base 64 encoded. This property can be specified only for Linux Compute Nodes. If this is specified for a Windows Compute Node, then the Batch service rejects the request; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). */ - sshPublicKey?: string; -} - -/** Parameters for updating a user account for RDP or SSH access on an Azure Batch Compute Node. */ -export interface BatchNodeUserUpdateContent { - /** The password of the Account. The password is required for Windows Compute Nodes (those created with 'virtualMachineConfiguration' using a Windows Image reference). For Linux Compute Nodes, the password can optionally be specified along with the sshPublicKey property. If omitted, any existing password is removed. */ - password?: string; - /** The time at which the Account should expire. If omitted, the default is 1 day from the current time. For Linux Compute Nodes, the expiryTime has a precision up to a day. */ - expiryTime?: Date | string; - /** The SSH public key that can be used for remote login to the Compute Node. The public key should be compatible with OpenSSH encoding and should be base 64 encoded. This property can be specified only for Linux Compute Nodes. If this is specified for a Windows Compute Node, then the Batch service rejects the request; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). If omitted, any existing SSH public key is removed. */ - sshPublicKey?: string; -} - -/** Parameters for rebooting an Azure Batch Compute Node. */ -export interface BatchNodeRebootContent { - /** When to reboot the Compute Node and what to do with currently running Tasks. The default value is requeue. */ - nodeRebootOption?: BatchNodeRebootOption; -} - -/** Parameters for disabling scheduling on an Azure Batch Compute Node. */ -export interface BatchNodeDisableSchedulingContent { - /** What to do with currently running Tasks when disabling Task scheduling on the Compute Node. The default value is requeue. */ - nodeDisableSchedulingOption?: BatchNodeDisableSchedulingOption; -} - -/** The Azure Batch service log files upload parameters for a Compute Node. */ -export interface UploadBatchServiceLogsContent { - /** The URL of the container within Azure Blob Storage to which to upload the Batch Service log file(s). If a user assigned managed identity is not being used, the URL must include a Shared Access Signature (SAS) granting write permissions to the container. The SAS duration must allow enough time for the upload to finish. The start time for SAS is optional and recommended to not be specified. */ - containerUrl: string; - /** The start of the time range from which to upload Batch Service log file(s). Any log file containing a log message in the time range will be uploaded. This means that the operation might retrieve more logs than have been requested since the entire log file is always uploaded, but the operation should not retrieve fewer logs than have been requested. */ - startTime: Date | string; - /** The end of the time range from which to upload Batch Service log file(s). Any log file containing a log message in the time range will be uploaded. This means that the operation might retrieve more logs than have been requested since the entire log file is always uploaded, but the operation should not retrieve fewer logs than have been requested. If omitted, the default is to upload all logs available after the startTime. */ - endTime?: Date | string; - /** The reference to the user assigned identity to use to access Azure Blob Storage specified by containerUrl. The identity must have write access to the Azure Blob Storage container. */ - identityReference?: BatchNodeIdentityReference; -} - -/** Alias for CachingType */ -export type CachingType = string; -/** Alias for StorageAccountType */ -export type StorageAccountType = string; -/** Alias for ContainerType */ -export type ContainerType = string; -/** Alias for DiskEncryptionTarget */ -export type DiskEncryptionTarget = string; -/** Alias for BatchNodePlacementPolicyType */ -export type BatchNodePlacementPolicyType = string; -/** Alias for DiffDiskPlacement */ -export type DiffDiskPlacement = string; -/** Alias for SecurityTypes */ -export type SecurityTypes = string; -/** Alias for DynamicVNetAssignmentScope */ -export type DynamicVNetAssignmentScope = string; -/** Alias for InboundEndpointProtocol */ -export type InboundEndpointProtocol = string; -/** Alias for NetworkSecurityGroupRuleAccess */ -export type NetworkSecurityGroupRuleAccess = string; -/** Alias for IpAddressProvisioningType */ -export type IpAddressProvisioningType = string; -/** Alias for ContainerWorkingDirectory */ -export type ContainerWorkingDirectory = string; -/** Alias for AutoUserScope */ -export type AutoUserScope = string; -/** Alias for ElevationLevel */ -export type ElevationLevel = string; -/** Alias for BatchNodeFillType */ -export type BatchNodeFillType = string; -/** Alias for LoginMode */ -export type LoginMode = string; -/** Alias for BatchNodeCommunicationMode */ -export type BatchNodeCommunicationMode = string; -/** Alias for UpgradeMode */ -export type UpgradeMode = string; -/** Alias for BatchNodeDeallocationOption */ -export type BatchNodeDeallocationOption = string; -/** Alias for BatchJobState */ -export type BatchJobState = string; -/** Alias for OutputFileUploadCondition */ -export type OutputFileUploadCondition = string; -/** Alias for AccessScope */ -export type AccessScope = string; -/** Alias for BatchPoolLifetimeOption */ -export type BatchPoolLifetimeOption = string; -/** Alias for OnAllBatchTasksComplete */ -export type OnAllBatchTasksComplete = string; -/** Alias for OnBatchTaskFailure */ -export type OnBatchTaskFailure = string; -/** Alias for ErrorCategory */ -export type ErrorCategory = string; -/** Alias for DisableBatchJobOption */ -export type DisableBatchJobOption = string; -/** Alias for BatchTaskExecutionResult */ -export type BatchTaskExecutionResult = string; -/** Alias for BatchJobScheduleState */ -export type BatchJobScheduleState = string; -/** Alias for BatchJobAction */ -export type BatchJobAction = string; -/** Alias for DependencyAction */ -export type DependencyAction = string; -/** Alias for BatchTaskState */ -export type BatchTaskState = string; -/** Alias for BatchNodeRebootOption */ -export type BatchNodeRebootOption = string; -/** Alias for BatchNodeDisableSchedulingOption */ -export type BatchNodeDisableSchedulingOption = string; diff --git a/sdk/batch/batch-rest/generated/outputModels.ts b/sdk/batch/batch-rest/generated/outputModels.ts deleted file mode 100644 index a8968ab6011c..000000000000 --- a/sdk/batch/batch-rest/generated/outputModels.ts +++ /dev/null @@ -1,2192 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -/** The result of listing the applications available in an Account. */ -export interface BatchApplicationListResultOutput { - /** The list of applications available in the Account. */ - value?: Array; - /** The URL to get the next set of results. */ - "odata.nextLink"?: string; -} - -/** Contains information about an application in an Azure Batch Account. */ -export interface BatchApplicationOutput { - /** A string that uniquely identifies the application within the Account. */ - id: string; - /** The display name for the application. */ - displayName: string; - /** The list of available versions of the application. */ - versions: string[]; -} - -/** An error response received from the Azure Batch service. */ -export interface BatchErrorOutput { - /** 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?: BatchErrorMessageOutput; - /** A collection of key-value pairs containing additional details about the error. */ - values?: Array; -} - -/** An error message received in an Azure Batch error response. */ -export interface BatchErrorMessageOutput { - /** The language code of the error message. */ - lang?: string; - /** The text of the message. */ - value?: string; -} - -/** An item of additional information included in an Azure Batch error response. */ -export interface BatchErrorDetailOutput { - /** An identifier specifying the meaning of the Value property. */ - key?: string; - /** The additional information included with the error response. */ - value?: string; -} - -/** The result of a listing the usage metrics for an Account. */ -export interface BatchPoolListUsageMetricsResultOutput { - /** The Pool usage metrics data. */ - value?: Array; - /** The URL to get the next set of results. */ - "odata.nextLink"?: string; -} - -/** Usage metrics for a Pool across an aggregation interval. */ -export interface BatchPoolUsageMetricsOutput { - /** The ID of the Pool whose metrics are aggregated in this entry. */ - poolId: string; - /** The start time of the aggregation interval covered by this entry. */ - startTime: string; - /** The end time of the aggregation interval covered by this entry. */ - endTime: string; - /** The size of virtual machines in the Pool. All VMs in a Pool are the same size. For information about available sizes of virtual machines in Pools, see Choose a VM size for Compute Nodes in an Azure Batch Pool (https://docs.microsoft.com/azure/batch/batch-pool-vm-sizes). */ - vmSize: string; - /** The total core hours used in the Pool during this aggregation interval. */ - totalCoreHours: number; -} - -/** - * The configuration for Compute Nodes in a Pool based on the Azure Virtual - * Machines infrastructure. - */ -export interface VirtualMachineConfigurationOutput { - /** A reference to the Azure Virtual Machines Marketplace Image or the custom Virtual Machine Image to use. */ - imageReference: ImageReferenceOutput; - /** The SKU of the Batch Compute Node agent to be provisioned on Compute Nodes in the Pool. The Batch Compute Node agent is a program that runs on each Compute Node in the Pool, and provides the command-and-control interface between the Compute Node and the Batch service. There are different implementations of the Compute Node agent, known as SKUs, for different operating systems. You must specify a Compute Node agent SKU which matches the selected Image reference. To get the list of supported Compute Node agent SKUs along with their list of verified Image references, see the 'List supported Compute Node agent SKUs' operation. */ - nodeAgentSKUId: string; - /** Windows operating system settings on the virtual machine. This property must not be specified if the imageReference property specifies a Linux OS Image. */ - windowsConfiguration?: WindowsConfigurationOutput; - /** The configuration for data disks attached to the Compute Nodes in the Pool. This property must be specified if the Compute Nodes in the Pool need to have empty data disks attached to them. This cannot be updated. Each Compute Node gets its own disk (the disk is not a file share). Existing disks cannot be attached, each attached disk is empty. When the Compute Node is removed from the Pool, the disk and all data associated with it is also deleted. The disk is not formatted after being attached, it must be formatted before use - for more information see https://docs.microsoft.com/en-us/azure/virtual-machines/linux/classic/attach-disk#initialize-a-new-data-disk-in-linux and https://docs.microsoft.com/en-us/azure/virtual-machines/windows/attach-disk-ps#add-an-empty-data-disk-to-a-virtual-machine. */ - dataDisks?: Array; - /** - * 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 Compute - * 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; - /** The container configuration for the Pool. If specified, setup is performed on each Compute 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?: ContainerConfigurationOutput; - /** The disk encryption configuration for the pool. If specified, encryption is performed on each node in the pool during node provisioning. */ - diskEncryptionConfiguration?: DiskEncryptionConfigurationOutput; - /** The node placement configuration for the pool. This configuration will specify rules on how nodes in the pool will be physically allocated. */ - nodePlacementConfiguration?: BatchNodePlacementConfigurationOutput; - /** The virtual machine extension for the pool. If specified, the extensions mentioned in this configuration will be installed on each node. */ - extensions?: Array; - /** Settings for the operating system disk of the Virtual Machine. */ - osDisk?: OSDiskOutput; - /** Specifies the security profile settings for the virtual machine or virtual machine scale set. */ - securityProfile?: SecurityProfileOutput; - /** 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. The service artifact reference id in the form of /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactName}/vmArtifactsProfiles/{vmArtifactsProfilesName} */ - serviceArtifactReference?: ServiceArtifactReferenceOutput; -} - -/** - * A reference to an Azure Virtual Machines Marketplace Image or a Azure Compute Gallery Image. - * To get the list of all Azure Marketplace Image references verified by Azure Batch, see the - * ' List Supported Images ' operation. - */ -export interface ImageReferenceOutput { - /** The publisher of the Azure Virtual Machines Marketplace Image. For example, Canonical or MicrosoftWindowsServer. */ - publisher?: string; - /** The offer type of the Azure Virtual Machines Marketplace Image. For example, UbuntuServer or WindowsServer. */ - offer?: string; - /** The SKU of the Azure Virtual Machines Marketplace Image. For example, 18.04-LTS or 2019-Datacenter. */ - sku?: string; - /** The version of the Azure Virtual Machines Marketplace Image. A value of 'latest' can be specified to select the latest version of an Image. If omitted, the default is 'latest'. */ - version?: string; - /** The ARM resource identifier of the Azure Compute Gallery Image. Compute Nodes in the Pool will be created using this Image Id. This is of the form /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageDefinitionName}/versions/{VersionId} or /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageDefinitionName} for always defaulting to the latest image version. This property is mutually exclusive with other ImageReference properties. The Azure Compute Gallery Image must have replicas in the same region and must be in the same subscription as the Azure Batch account. If the image version is not specified in the imageId, the latest version will be used. For information about the firewall settings for the Batch Compute 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. */ - virtualMachineImageId?: string; - /** The specific version of the platform image or marketplace image used to create the node. This read-only field differs from 'version' only if the value specified for 'version' when the pool was created was 'latest'. */ - readonly exactVersion?: string; -} - -/** Windows operating system settings to apply to the virtual machine. */ -export interface WindowsConfigurationOutput { - /** Whether automatic updates are enabled on the virtual machine. 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 DataDiskOutput { - /** The logical unit number. The logicalUnitNumber is used to uniquely identify each data disk. If attaching multiple disks, each should have a distinct logicalUnitNumber. The value must be between 0 and 63, inclusive. */ - lun: number; - /** The type of caching to be enabled for the data disks. The default value for caching is readwrite. For information about the caching options see: https://blogs.msdn.microsoft.com/windowsazurestorage/2012/06/27/exploring-windows-azure-drives-disks-and-images/. */ - caching?: CachingTypeOutput; - /** The initial disk size in gigabytes. */ - diskSizeGB: number; - /** The storage Account type to be used for the data disk. If omitted, the default is "standard_lrs". */ - storageAccountType?: StorageAccountTypeOutput; -} - -/** The configuration for container-enabled Pools. */ -export interface ContainerConfigurationOutput { - /** The container technology to be used. */ - type: ContainerTypeOutput; - /** The collection of container Image names. 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[]; - /** Additional private registries from which containers can be pulled. If any Images must be downloaded from a private registry which requires credentials, then those credentials must be provided here. */ - containerRegistries?: Array; -} - -/** A private container registry. */ -export interface ContainerRegistryReferenceOutput { - /** The user name to log into the registry server. */ - username?: string; - /** The password to log into the registry server. */ - password?: string; - /** The registry URL. If omitted, the default is "docker.io". */ - registryServer?: string; - /** The reference to the user assigned identity to use to access an Azure Container Registry instead of username and password. */ - identityReference?: BatchNodeIdentityReferenceOutput; -} - -/** - * The reference to a user assigned identity associated with the Batch pool which - * a compute node will use. - */ -export interface BatchNodeIdentityReferenceOutput { - /** The ARM resource id of the user assigned identity. */ - resourceId?: string; -} - -/** - * The disk encryption configuration applied on compute nodes in the pool. - * Disk encryption configuration is not supported on Linux pool created with - * Azure Compute Gallery Image. - */ -export interface DiskEncryptionConfigurationOutput { - /** The list of disk targets Batch Service will encrypt on the compute node. If omitted, no disks on the compute nodes in the pool will be encrypted. On Linux pool, only "TemporaryDisk" is supported; on Windows pool, "OsDisk" and "TemporaryDisk" must be specified. */ - targets?: DiskEncryptionTargetOutput[]; -} - -/** - * For regional placement, nodes in the pool will be allocated in the same region. - * For zonal placement, nodes in the pool will be spread across different zones - * with best effort balancing. - */ -export interface BatchNodePlacementConfigurationOutput { - /** Node placement Policy type on Batch Pools. Allocation policy used by Batch Service to provision the nodes. If not specified, Batch will use the regional policy. */ - policy?: BatchNodePlacementPolicyTypeOutput; -} - -/** The configuration for virtual machine extensions. */ -export interface VMExtensionOutput { - /** The name of the virtual machine extension. */ - name: string; - /** The name of the extension handler publisher. */ - publisher: string; - /** The type of the extension. */ - 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; - /** The collection of extension names. Collection of extension names after which this extension needs to be provisioned. */ - provisionAfterExtensions?: string[]; -} - -/** Settings for the operating system disk of the compute node (VM). */ -export interface OSDiskOutput { - /** Specifies the ephemeral Disk Settings for the operating system disk used by the compute node (VM). */ - ephemeralOSDiskSettings?: DiffDiskSettingsOutput; - /** Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The default values are: None for Standard storage. ReadOnly for Premium storage. */ - caching?: CachingTypeOutput; - /** The initial disk size in GB when creating new OS disk. */ - diskSizeGB?: number; - /** The managed disk parameters. */ - managedDisk?: ManagedDiskOutput; - /** 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 - * compute node (VM). - */ -export interface DiffDiskSettingsOutput { - /** Specifies the ephemeral disk placement for operating system disk for all VMs in the pool. This property can be used by user in the request to choose the location 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?: DiffDiskPlacementOutput; -} - -/** The managed disk parameters. */ -export interface ManagedDiskOutput { - /** The storage account type for managed disk. */ - storageAccountType: StorageAccountTypeOutput; -} - -/** Specifies the security profile settings for the virtual machine or virtual machine scale set. */ -export interface SecurityProfileOutput { - /** 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 SecurityType of the virtual machine. It has to be set to any specified value to enable UefiSettings. */ - securityType: SecurityTypesOutput; - /** Specifies the security settings like secure boot and vTPM used while creating the virtual machine. Specifies the security settings like secure boot and vTPM used while creating the virtual machine. */ - uefiSettings: UefiSettingsOutput; -} - -/** Specifies the security settings like secure boot and vTPM used while creating the virtual machine. */ -export interface UefiSettingsOutput { - /** 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 ServiceArtifactReferenceOutput { - /** The service artifact reference id of 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; -} - -/** The network configuration for a Pool. */ -export interface NetworkConfigurationOutput { - /** The ARM resource identifier of the virtual network subnet which the Compute Nodes of the Pool will join. This is of the form /subscriptions/{subscription}/resourceGroups/{group}/providers/{provider}/virtualNetworks/{network}/subnets/{subnet}. 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 Compute Nodes in the Pool. If the subnet doesn't have enough free IP addresses, the Pool will partially allocate 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 Nodes. This can be verified by checking if the specified VNet has any associated Network Security Groups (NSG). If communication to the Nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the Compute Nodes to unusable. For Pools created with virtualMachineConfiguration only ARM virtual networks ('Microsoft.Network/virtualNetworks') are supported. If the specified VNet has any associated Network Security Groups (NSG), then a few reserved system ports must be enabled for inbound communication. For Pools created with a virtual machine configuration, 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?: DynamicVNetAssignmentScopeOutput; - /** The configuration for endpoints on Compute Nodes in the Batch Pool. Pool endpoint configuration is only supported on Pools with the virtualMachineConfiguration property. */ - endpointConfiguration?: BatchPoolEndpointConfigurationOutput; - /** The Public IPAddress configuration for Compute Nodes in the Batch Pool. Public IP configuration property is only supported on Pools with the virtualMachineConfiguration property. */ - publicIPAddressConfiguration?: PublicIpAddressConfigurationOutput; - /** Whether this pool should enable accelerated networking. 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 BatchPoolEndpointConfigurationOutput { - /** A list of inbound NAT Pools that can be used to address specific ports on an individual Compute Node externally. 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: Array; -} - -/** - * A inbound NAT Pool that can be used to address specific ports on Compute Nodes - * in a Batch Pool externally. - */ -export interface InboundNatPoolOutput { - /** The name of the endpoint. 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: InboundEndpointProtocolOutput; - /** The port number on the Compute Node. 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; - /** The first port number in the range of external ports that will be used to provide inbound access to the backendPort on individual Compute Nodes. 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. Each range must contain at least 40 ports. If any reserved or overlapping values are provided the request fails with HTTP status code 400. */ - frontendPortRangeStart: number; - /** The last port number in the range of external ports that will be used to provide inbound access to the backendPort on individual Compute Nodes. 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. Each range must contain at least 40 ports. If any reserved or overlapping values are provided the request fails with HTTP status code 400. */ - frontendPortRangeEnd: number; - /** A list of network security group rules that will be applied to the endpoint. 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?: Array; -} - -/** A network security group rule to apply to an inbound endpoint. */ -export interface NetworkSecurityGroupRuleOutput { - /** The priority for this rule. 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: NetworkSecurityGroupRuleAccessOutput; - /** The source address prefix or tag to match for the rule. 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; - /** The source port ranges to match for the rule. Valid values are '*' (for all ports 0 - 65535), a specific port (i.e. 22), or a port range (i.e. 100-200). The ports must be in the range of 0 to 65535. Each entry in this collection must not overlap any other entry (either a range or an individual port). If any other values are provided the request fails with HTTP status code 400. The default value is '*'. */ - sourcePortRanges?: string[]; -} - -/** The public IP Address configuration of the networking configuration of a Pool. */ -export interface PublicIpAddressConfigurationOutput { - /** The provisioning type for Public IP Addresses for the Pool. The default value is BatchManaged. */ - provision?: IpAddressProvisioningTypeOutput; - /** The list of public IPs which the Batch service will use when provisioning Compute Nodes. 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[]; -} - -/** - * Batch will retry Tasks when a recovery operation is triggered on a Node. - * Examples of recovery operations include (but are not limited to) when an - * unhealthy Node is rebooted or a Compute Node disappeared due to host failure. - * Retries due to recovery operations are independent of and are not counted - * against the maxTaskRetryCount. Even if the maxTaskRetryCount is 0, an internal - * retry due to a recovery operation may occur. Because of this, all Tasks should - * be idempotent. This means Tasks need to tolerate being interrupted and - * restarted without causing any corruption or duplicate data. The best practice - * for long running Tasks is to use some form of checkpointing. In some cases the - * StartTask may be re-run even though the Compute Node was not rebooted. Special - * care should be taken to avoid StartTasks which create breakaway process or - * install/launch services from the StartTask working directory, as this will - * block Batch from being able to re-run the StartTask. - */ -export interface BatchStartTaskOutput { - /** The command line of the 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. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables). */ - commandLine: string; - /** The settings for the container under which the StartTask runs. 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. Files produced in the container outside of AZ_BATCH_NODE_ROOT_DIR might not be reflected to the host disk, meaning that Batch file APIs will not be able to access those files. */ - containerSettings?: BatchTaskContainerSettingsOutput; - /** A list of files that the Batch service will download to the Compute Node before running the command line. There is a maximum size for the list of resource files. When the max size is exceeded, the request will fail and the response error code will be RequestEntityTooLarge. If this occurs, the collection of ResourceFiles must be reduced in size. This can be achieved using .zip files, Application Packages, or Docker Containers. Files listed under this element are located in the Task's working directory. */ - resourceFiles?: Array; - /** A list of environment variable settings for the StartTask. */ - environmentSettings?: Array; - /** The user identity under which the StartTask runs. If omitted, the Task runs as a non-administrative user unique to the Task. */ - userIdentity?: UserIdentityOutput; - /** The maximum number of times the Task may be retried. 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, however this is not recommended for a start task or any task. The default value is 0 (no retries). */ - maxTaskRetryCount?: number; - /** Whether the Batch service should wait for the StartTask to complete successfully (that is, to exit with exit code 0) before scheduling any Tasks on the Compute Node. If true and the StartTask fails on a Node, the Batch service retries the StartTask up to its maximum retry count (maxTaskRetryCount). If the Task has still not completed successfully after all retries, then the Batch service marks the Node unusable, and will not schedule Tasks to it. This condition can be detected via the Compute Node state and failure info details. If false, the Batch service will not wait for the StartTask to complete. In this case, other Tasks can start executing on the Compute Node while the StartTask is still running; and even if the StartTask fails, new Tasks will continue to be scheduled on the Compute Node. The default is true. */ - waitForSuccess?: boolean; -} - -/** The container settings for a Task. */ -export interface BatchTaskContainerSettingsOutput { - /** Additional options to the container create command. These additional options are supplied as arguments to the "docker create" command, in addition to those controlled by the Batch Service. */ - containerRunOptions?: string; - /** The Image to use to create the container in which the Task will run. 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; - /** The private registry which contains the container Image. This setting can be omitted if was already provided at Pool creation. */ - registry?: ContainerRegistryReferenceOutput; - /** The location of the container Task working directory. The default is 'taskWorkingDirectory'. */ - workingDirectory?: ContainerWorkingDirectoryOutput; -} - -/** A single file or multiple files to be downloaded to a Compute Node. */ -export interface ResourceFileOutput { - /** The storage container name in the auto storage Account. The autoStorageContainerName, storageContainerUrl and httpUrl properties are mutually exclusive and one of them must be specified. */ - autoStorageContainerName?: string; - /** The URL of the blob container within Azure Blob Storage. 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 URL of the file to download. 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 blob prefix to use when downloading blobs from an Azure Storage container. Only the blobs whose names begin with the specified prefix will be downloaded. 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; - /** The location on the Compute Node to which to download the file(s), relative to the Task's working directory. 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; - /** The file permission mode attribute in octal format. 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 Compute Node. If this property is not specified for a Linux Compute Node, then a default value of 0770 is applied to the file. */ - fileMode?: string; - /** The reference to the user assigned identity to use to access Azure Blob Storage specified by storageContainerUrl or httpUrl. */ - identityReference?: BatchNodeIdentityReferenceOutput; -} - -/** An environment variable to be set on a Task process. */ -export interface EnvironmentSettingOutput { - /** The name of the environment variable. */ - name: string; - /** The value of the environment variable. */ - value?: string; -} - -/** The definition of the user identity under which the Task is run. Specify either the userName or autoUser property, but not both. */ -export interface UserIdentityOutput { - /** The name of the user identity under which the Task is run. The userName and autoUser properties are mutually exclusive; you must specify one but not both. */ - username?: string; - /** The auto user under which the Task is run. The userName and autoUser properties are mutually exclusive; you must specify one but not both. */ - autoUser?: AutoUserSpecificationOutput; -} - -/** Specifies the options for the auto user that runs an Azure Batch Task. */ -export interface AutoUserSpecificationOutput { - /** The scope for the auto user. 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, such as if the task mutates the registry in a way which could impact other tasks. */ - scope?: AutoUserScopeOutput; - /** The elevation level of the auto user. The default value is nonAdmin. */ - elevationLevel?: ElevationLevelOutput; -} - -/** A reference to an Package to be deployed to Compute Nodes. */ -export interface BatchApplicationPackageReferenceOutput { - /** The ID of the application to deploy. When creating a pool, the package's application ID must be fully qualified (/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}). */ - applicationId: string; - /** The version of the application to deploy. If omitted, the default version is deployed. If this is omitted on a Pool, and no default version is specified for this application, the request fails with the error code InvalidApplicationPackageReferences and HTTP status code 409. If this is omitted on a Task, and no default version is specified for this application, the Task fails with a pre-processing error. */ - version?: string; -} - -/** Specifies how Tasks should be distributed across Compute Nodes. */ -export interface BatchTaskSchedulingPolicyOutput { - /** How Tasks are distributed across Compute Nodes in a Pool. If not specified, the default is spread. */ - nodeFillType: BatchNodeFillTypeOutput; -} - -/** - * Properties used to create a user used to execute Tasks on an Azure Batch - * Compute Node. - */ -export interface UserAccountOutput { - /** 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; - /** The elevation level of the user Account. The default value is nonAdmin. */ - elevationLevel?: ElevationLevelOutput; - /** The Linux-specific user configuration for the user Account. This property is ignored if specified on a Windows Pool. If not specified, the user is created with the default options. */ - linuxUserConfiguration?: LinuxUserConfigurationOutput; - /** The Windows-specific user configuration for the user Account. 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?: WindowsUserConfigurationOutput; -} - -/** Properties used to create a user Account on a Linux Compute Node. */ -export interface LinuxUserConfigurationOutput { - /** The user ID of the user Account. 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 group ID for the user Account. 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 SSH private key for the user Account. The private key must not be password protected. The private key is used to automatically configure asymmetric-key based authentication for SSH between Compute 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 Compute Nodes (no modification of the user's .ssh directory is done). */ - sshPrivateKey?: string; -} - -/** Properties used to create a user Account on a Windows Compute Node. */ -export interface WindowsUserConfigurationOutput { - /** The login mode for the user. The default value for VirtualMachineConfiguration Pools is 'batch'. */ - loginMode?: LoginModeOutput; -} - -/** - * The Batch service does not assign any meaning to this metadata; it is solely - * for the use of user code. - */ -export interface MetadataItemOutput { - /** The name of the metadata item. */ - name: string; - /** The value of the metadata item. */ - value: string; -} - -/** The file system to mount on each node. */ -export interface MountConfigurationOutput { - /** The Azure Storage Container to mount using blob FUSE on each node. This property is mutually exclusive with all other properties. */ - azureBlobFileSystemConfiguration?: AzureBlobFileSystemConfigurationOutput; - /** The NFS file system to mount on each node. This property is mutually exclusive with all other properties. */ - nfsMountConfiguration?: NfsMountConfigurationOutput; - /** The CIFS/SMB file system to mount on each node. This property is mutually exclusive with all other properties. */ - cifsMountConfiguration?: CifsMountConfigurationOutput; - /** The Azure File Share to mount on each node. This property is mutually exclusive with all other properties. */ - azureFileShareConfiguration?: AzureFileShareConfigurationOutput; -} - -/** Information used to connect to an Azure Storage Container using Blobfuse. */ -export interface AzureBlobFileSystemConfigurationOutput { - /** The Azure Storage Account name. */ - accountName: string; - /** The Azure Blob Storage Container name. */ - containerName: string; - /** The Azure Storage Account key. This property is mutually exclusive with both sasKey and identity; exactly one must be specified. */ - accountKey?: string; - /** The Azure Storage SAS token. This property is mutually exclusive with both accountKey and identity; exactly one must be specified. */ - sasKey?: string; - /** Additional command line options to pass to the mount command. These are 'net use' options in Windows and 'mount' options in Linux. */ - blobfuseOptions?: string; - /** The relative path on the compute node where the file system will be mounted. All file systems are mounted relative to the Batch mounts directory, accessible via the AZ_BATCH_NODE_MOUNTS_DIR environment variable. */ - relativeMountPath: string; - /** The reference to the user assigned identity to use to access containerName. This property is mutually exclusive with both accountKey and sasKey; exactly one must be specified. */ - identityReference?: BatchNodeIdentityReferenceOutput; -} - -/** Information used to connect to an NFS file system. */ -export interface NfsMountConfigurationOutput { - /** The URI of the file system to mount. */ - source: string; - /** The relative path on the compute node where the file system will be mounted. All file systems are mounted relative to the Batch mounts directory, accessible via the AZ_BATCH_NODE_MOUNTS_DIR environment variable. */ - relativeMountPath: string; - /** Additional command line options to pass to the mount command. 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 CifsMountConfigurationOutput { - /** The user to use for authentication against the CIFS file system. */ - username: string; - /** The URI of the file system to mount. */ - source: string; - /** The relative path on the compute node where the file system will be mounted. All file systems are mounted relative to the Batch mounts directory, accessible via the AZ_BATCH_NODE_MOUNTS_DIR environment variable. */ - relativeMountPath: string; - /** Additional command line options to pass to the mount command. 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 AzureFileShareConfigurationOutput { - /** The Azure Storage account name. */ - accountName: string; - /** The Azure Files URL. This is of the form 'https://{account}.file.core.windows.net/'. */ - azureFileUrl: string; - /** The Azure Storage account key. */ - accountKey: string; - /** The relative path on the compute node where the file system will be mounted. All file systems are mounted relative to the Batch mounts directory, accessible via the AZ_BATCH_NODE_MOUNTS_DIR environment variable. */ - relativeMountPath: string; - /** Additional command line options to pass to the mount command. These are 'net use' options in Windows and 'mount' options in Linux. */ - mountOptions?: string; -} - -/** Describes an upgrade policy - automatic, manual, or rolling. */ -export interface UpgradePolicyOutput { - /** 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: UpgradeModeOutput; - /** Configuration parameters used for performing automatic OS Upgrade. The configuration parameters used for performing automatic OS upgrade. */ - automaticOSUpgradePolicy?: AutomaticOsUpgradePolicyOutput; - /** The configuration parameters used while performing a rolling upgrade. This property is only supported on Pools with the virtualMachineConfiguration property. */ - rollingUpgradePolicy?: RollingUpgradePolicyOutput; -} - -/** The configuration parameters used for performing automatic OS upgrade. */ -export interface AutomaticOsUpgradePolicyOutput { - /** 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/batchservice/pool/add?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 RollingUpgradePolicyOutput { - /** Allow VMSS to ignore AZ boundaries when constructing upgrade batches. Take into consideration the Update Domain and maxBatchInstancePercent to determine the batch size. 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 result of listing the Pools in an Account. */ -export interface BatchPoolListResultOutput { - /** The list of Pools. */ - value?: Array; - /** The URL to get the next set of results. */ - "odata.nextLink"?: string; -} - -/** A Pool in the Azure Batch service. */ -export interface BatchPoolOutput { - /** A string that uniquely identifies the Pool within the Account. The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. The ID is case-preserving and case-insensitive (that is, you may not have two IDs within an Account that differ only by case). */ - readonly id?: string; - /** The display name for the Pool. The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. */ - readonly displayName?: string; - /** The URL of the Pool. */ - readonly url?: string; - /** The ETag of the Pool. This is an opaque string. You can use it to detect whether the Pool has changed between requests. In particular, you can be pass the ETag when updating a Pool to specify that your changes should take effect only if nobody else has modified the Pool in the meantime. */ - readonly eTag?: string; - /** The last modified time of the Pool. This is the last time at which the Pool level data, such as the targetDedicatedNodes or enableAutoscale settings, changed. It does not factor in node-level changes such as a Compute Node changing state. */ - readonly lastModified?: string; - /** The creation time of the Pool. */ - readonly creationTime?: string; - /** The current state of the Pool. */ - readonly state?: BatchPoolStateOutput; - /** The time at which the Pool entered its current state. */ - readonly stateTransitionTime?: string; - /** Whether the Pool is resizing. */ - readonly allocationState?: AllocationStateOutput; - /** The time at which the Pool entered its current allocation state. */ - readonly allocationStateTransitionTime?: string; - /** The size of virtual machines in the Pool. All virtual machines in a Pool are the same size. For information about available sizes of virtual machines in Pools, see Choose a VM size for Compute Nodes in an Azure Batch Pool (https://docs.microsoft.com/azure/batch/batch-pool-vm-sizes). */ - readonly vmSize?: string; - /** The virtual machine configuration for the Pool. This property must be specified. */ - readonly virtualMachineConfiguration?: VirtualMachineConfigurationOutput; - /** The timeout for allocation of Compute Nodes to the Pool. This is the timeout for the most recent resize operation. (The initial sizing when the Pool is created counts as a resize.) The default value is 15 minutes. */ - readonly resizeTimeout?: string; - /** A list of errors encountered while performing the last resize on the Pool. This property is set only if one or more errors occurred during the last Pool resize, and only when the Pool allocationState is Steady. */ - readonly resizeErrors?: Array; - /** The user-specified tags associated with the pool. 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'. */ - readonly resourceTags?: Record; - /** 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. Spot/Low-priority Compute Nodes which have been preempted are included in this count. */ - readonly currentLowPriorityNodes?: number; - /** The desired number of dedicated Compute Nodes in the Pool. */ - readonly targetDedicatedNodes?: number; - /** The desired number of Spot/Low-priority Compute Nodes in the Pool. */ - readonly targetLowPriorityNodes?: number; - /** Whether the Pool size should automatically adjust over time. If false, at least one of targetDedicatedNodes and targetLowPriorityNodes must be specified. If true, the autoScaleFormula property is required and the Pool automatically resizes according to the formula. The default value is false. */ - readonly enableAutoScale?: boolean; - /** A formula for the desired number of Compute Nodes in the Pool. This property is set only if the Pool automatically scales, i.e. enableAutoScale is true. */ - readonly autoScaleFormula?: string; - /** The time interval at which to automatically adjust the Pool size according to the autoscale formula. This property is set only if the Pool automatically scales, i.e. enableAutoScale is true. */ - readonly autoScaleEvaluationInterval?: string; - /** The results and errors from the last execution of the autoscale formula. This property is set only if the Pool automatically scales, i.e. enableAutoScale is true. */ - readonly autoScaleRun?: AutoScaleRunOutput; - /** Whether the Pool permits direct communication between Compute Nodes. This imposes restrictions on which Compute Nodes can be assigned to the Pool. Specifying this value can reduce the chance of the requested number of Compute Nodes to be allocated in the Pool. */ - readonly enableInterNodeCommunication?: boolean; - /** The network configuration for the Pool. */ - readonly networkConfiguration?: NetworkConfigurationOutput; - /** A Task specified to run on each Compute Node as it joins the Pool. */ - startTask?: BatchStartTaskOutput; - /** The list of Packages to be installed on each Compute Node in the Pool. Changes to Package references affect all new 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 Package references on any given Pool. */ - readonly applicationPackageReferences?: Array; - /** The number of task slots that can be used to run concurrent tasks on a single compute node in the pool. 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. */ - readonly taskSlotsPerNode?: number; - /** How Tasks are distributed across Compute Nodes in a Pool. If not specified, the default is spread. */ - readonly taskSchedulingPolicy?: BatchTaskSchedulingPolicyOutput; - /** The list of user Accounts to be created on each Compute Node in the Pool. */ - readonly userAccounts?: Array; - /** A list of name-value pairs associated with the Pool as metadata. */ - readonly metadata?: Array; - /** Utilization and resource usage statistics for the entire lifetime of the Pool. This property is populated only if the CloudPool was retrieved with an expand clause including the 'stats' attribute; otherwise it is null. The statistics may not be immediately available. The Batch service performs periodic roll-up of statistics. The typical delay is about 30 minutes. */ - readonly stats?: BatchPoolStatisticsOutput; - /** A list of file systems to mount on each node in the pool. This supports Azure Files, NFS, CIFS/SMB, and Blobfuse. */ - readonly mountConfiguration?: Array; - /** The identity of the Batch pool, if configured. The list of user identities associated with the Batch pool. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ - readonly identity?: BatchPoolIdentityOutput; - /** The desired node communication mode for the pool. If omitted, the default value is Default. */ - targetNodeCommunicationMode?: BatchNodeCommunicationModeOutput; - /** The current state of the pool communication mode. */ - readonly currentNodeCommunicationMode?: BatchNodeCommunicationModeOutput; - /** The upgrade policy for the Pool. Describes an upgrade policy - automatic, manual, or rolling. */ - upgradePolicy?: UpgradePolicyOutput; -} - -/** An error that occurred when resizing a Pool. */ -export interface ResizeErrorOutput { - /** An identifier for the Pool resize error. Codes are invariant and are intended to be consumed programmatically. */ - code?: string; - /** A message describing the Pool resize error, intended to be suitable for display in a user interface. */ - message?: string; - /** A list of additional error details related to the Pool resize error. */ - values?: Array; -} - -/** Represents a name-value pair. */ -export interface NameValuePairOutput { - /** The name in the name-value pair. */ - name?: string; - /** The value in the name-value pair. */ - value?: string; -} - -/** The results and errors from an execution of a Pool autoscale formula. */ -export interface AutoScaleRunOutput { - /** The time at which the autoscale formula was last evaluated. */ - timestamp: string; - /** The final values of all variables used in the evaluation of the autoscale formula. Each variable value is returned in the form $variable=value, and variables are separated by semicolons. */ - results?: string; - /** Details of the error encountered evaluating the autoscale formula on the Pool, if the evaluation was unsuccessful. */ - error?: AutoScaleRunErrorOutput; -} - -/** An error that occurred when executing or evaluating a Pool autoscale formula. */ -export interface AutoScaleRunErrorOutput { - /** An identifier for the autoscale error. Codes are invariant and are intended to be consumed programmatically. */ - code?: string; - /** A message describing the autoscale error, intended to be suitable for display in a user interface. */ - message?: string; - /** A list of additional error details related to the autoscale error. */ - values?: Array; -} - -/** Contains utilization and resource usage statistics for the lifetime of a Pool. */ -export interface BatchPoolStatisticsOutput { - /** The URL for the statistics. */ - url: string; - /** The start time of the time range covered by the statistics. */ - startTime: string; - /** The time at which the statistics were last updated. All statistics are limited to the range between startTime and lastUpdateTime. */ - lastUpdateTime: string; - /** Statistics related to Pool usage, such as the amount of core-time used. */ - usageStats?: BatchPoolUsageStatisticsOutput; - /** Statistics related to resource consumption by Compute Nodes in the Pool. */ - resourceStats?: BatchPoolResourceStatisticsOutput; -} - -/** Statistics related to Pool usage information. */ -export interface BatchPoolUsageStatisticsOutput { - /** The start time of the time range covered by the statistics. */ - startTime: string; - /** The time at which the statistics were last updated. All statistics are limited to the range between startTime and lastUpdateTime. */ - lastUpdateTime: string; - /** The aggregated wall-clock time of the dedicated Compute Node cores being part of the Pool. */ - dedicatedCoreTime: string; -} - -/** Statistics related to resource consumption by Compute Nodes in a Pool. */ -export interface BatchPoolResourceStatisticsOutput { - /** The start time of the time range covered by the statistics. */ - startTime: string; - /** The time at which the statistics were last updated. All statistics are limited to the range between startTime and lastUpdateTime. */ - lastUpdateTime: string; - /** The average CPU usage across all Compute Nodes in the Pool (percentage per node). */ - avgCPUPercentage: number; - /** The average memory usage in GiB across all Compute Nodes in the Pool. */ - avgMemoryGiB: number; - /** The peak memory usage in GiB across all Compute Nodes in the Pool. */ - peakMemoryGiB: number; - /** The average used disk space in GiB across all Compute Nodes in the Pool. */ - avgDiskGiB: number; - /** The peak used disk space in GiB across all Compute Nodes in the Pool. */ - peakDiskGiB: number; - /** The total number of disk read operations across all Compute Nodes in the Pool. */ - diskReadIOps: number; - /** The total number of disk write operations across all Compute Nodes in the Pool. */ - diskWriteIOps: number; - /** The total amount of data in GiB of disk reads across all Compute Nodes in the Pool. */ - diskReadGiB: number; - /** The total amount of data in GiB of disk writes across all Compute Nodes in the Pool. */ - diskWriteGiB: number; - /** The total amount of data in GiB of network reads across all Compute Nodes in the Pool. */ - networkReadGiB: number; - /** The total amount of data in GiB of network writes across all Compute Nodes in the Pool. */ - networkWriteGiB: number; -} - -/** The identity of the Batch pool, if configured. */ -export interface BatchPoolIdentityOutput { - /** The identity of the Batch pool, if configured. The list of user identities associated with the Batch pool. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ - type: BatchPoolIdentityTypeOutput; - /** The list of user identities associated with the Batch account. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ - userAssignedIdentities?: Array; -} - -/** The user assigned Identity */ -export interface UserAssignedIdentityOutput { - /** The ARM resource id of the user assigned identity. */ - resourceId: string; - /** The client id of the user assigned identity. */ - readonly clientId?: string; - /** The principal id of the user assigned identity. */ - readonly principalId?: string; -} - -/** The result of listing the supported Virtual Machine Images. */ -export interface BatchAccountListSupportedImagesResultOutput { - /** The list of supported Virtual Machine Images. */ - value?: Array; - /** The URL to get the next set of results. */ - "odata.nextLink"?: string; -} - -/** - * A reference to the Azure Virtual Machines Marketplace Image and additional - * information about the Image. - */ -export interface BatchSupportedImageOutput { - /** The ID of the Compute Node agent SKU which the Image supports. */ - nodeAgentSKUId: string; - /** The reference to the Azure Virtual Machine's Marketplace Image. */ - imageReference: ImageReferenceOutput; - /** The type of operating system (e.g. Windows or Linux) of the Image. */ - osType: OSTypeOutput; - /** The capabilities or features which the Image supports. Not every capability of the Image is listed. Capabilities in this list are considered of special interest and are generally related to integration with other features in the Azure Batch service. */ - capabilities?: string[]; - /** The time when the Azure Batch service will stop accepting create Pool requests for the Image. */ - batchSupportEndOfLife?: string; - /** Whether the Azure Batch service actively verifies that the Image is compatible with the associated Compute Node agent SKU. */ - verificationType: ImageVerificationTypeOutput; -} - -/** The result of listing the Compute Node counts in the Account. */ -export interface BatchPoolNodeCountsListResultOutput { - /** A list of Compute Node counts by Pool. */ - value?: Array; - /** The URL to get the next set of results. */ - "odata.nextLink"?: string; -} - -/** The number of Compute Nodes in each state for a Pool. */ -export interface BatchPoolNodeCountsOutput { - /** The ID of the Pool. */ - poolId: string; - /** The number of dedicated Compute Nodes in each state. */ - dedicated?: BatchNodeCountsOutput; - /** The number of Spot/Low-priority Compute Nodes in each state. */ - lowPriority?: BatchNodeCountsOutput; -} - -/** The number of Compute Nodes in each Compute Node state. */ -export interface BatchNodeCountsOutput { - /** The number of Compute Nodes in the creating state. */ - creating: number; - /** The number of Compute Nodes in the idle state. */ - idle: number; - /** The number of Compute Nodes in the offline state. */ - offline: number; - /** The number of Compute Nodes in the preempted state. */ - preempted: number; - /** The count of Compute Nodes in the rebooting state. */ - rebooting: number; - /** The number of Compute Nodes in the reimaging state. */ - reimaging: number; - /** The number of Compute Nodes in the running state. */ - running: number; - /** The number of Compute Nodes in the starting state. */ - starting: number; - /** The number of Compute Nodes in the startTaskFailed state. */ - startTaskFailed: number; - /** The number of Compute Nodes in the leavingPool state. */ - leavingPool: number; - /** The number of Compute Nodes in the unknown state. */ - unknown: number; - /** The number of Compute Nodes in the unusable state. */ - unusable: number; - /** The number of Compute Nodes in the waitingForStartTask state. */ - waitingForStartTask: number; - /** The total number of Compute Nodes. */ - total: number; - /** The number of Compute Nodes in the upgradingOS state. */ - upgradingOS: number; -} - -/** An Azure Batch Job. */ -export interface BatchJobOutput { - /** A string that uniquely identifies the Job within the Account. The ID is case-preserving and case-insensitive (that is, you may not have two IDs within an Account that differ only by case). */ - readonly id?: string; - /** The display name for the Job. */ - readonly displayName?: string; - /** Whether Tasks in the Job can define dependencies on each other. The default is false. */ - readonly usesTaskDependencies?: boolean; - /** The URL of the Job. */ - readonly url?: string; - /** The ETag of the Job. This is an opaque string. You can use it to detect whether the Job has changed between requests. In particular, you can be pass the ETag when updating a Job to specify that your changes should take effect only if nobody else has modified the Job in the meantime. */ - readonly eTag?: string; - /** The last modified time of the Job. This is the last time at which the Job level data, such as the Job state or priority, changed. It does not factor in task-level changes such as adding new Tasks or Tasks changing state. */ - readonly lastModified?: string; - /** The creation time of the Job. */ - readonly creationTime?: string; - /** The current state of the Job. */ - readonly state?: BatchJobStateOutput; - /** The time at which the Job entered its current state. */ - readonly stateTransitionTime?: string; - /** The previous state of the Job. This property is not set if the Job is in its initial Active state. */ - readonly previousState?: BatchJobStateOutput; - /** The time at which the Job entered its previous state. This property is not set if the Job is in its initial Active state. */ - readonly previousStateTransitionTime?: string; - /** The priority of the Job. Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0. */ - priority?: number; - /** Whether Tasks in this job can be preempted by other high priority jobs. If the value is set to True, other high priority jobs submitted to the system will take precedence and will be able requeue tasks from this job. You can update a job's allowTaskPreemption after it has been created using the update job API. */ - allowTaskPreemption?: boolean; - /** The maximum number of tasks that can be executed in parallel for the job. The value of maxParallelTasks must be -1 or greater than 0 if specified. If not specified, the default value is -1, which means there's no limit to the number of tasks that can be run at once. You can update a job's maxParallelTasks after it has been created using the update job API. */ - maxParallelTasks?: number; - /** The execution constraints for the Job. */ - constraints?: BatchJobConstraintsOutput; - /** Details of a Job Manager Task to be launched when the Job is started. */ - readonly jobManagerTask?: BatchJobManagerTaskOutput; - /** The Job Preparation Task. The Job Preparation Task is a special Task run on each Compute Node before any other Task of the Job. */ - readonly jobPreparationTask?: BatchJobPreparationTaskOutput; - /** The Job Release Task. The Job Release Task is a special Task run at the end of the Job on each Compute Node that has run any other Task of the Job. */ - readonly jobReleaseTask?: BatchJobReleaseTaskOutput; - /** The list of common environment variable settings. These environment variables are set for all Tasks in the Job (including the Job Manager, Job Preparation and Job Release Tasks). Individual Tasks can override an environment setting specified here by specifying the same setting name with a different value. */ - readonly commonEnvironmentSettings?: Array; - /** The Pool settings associated with the Job. */ - poolInfo: BatchPoolInfoOutput; - /** The action the Batch service should take when all Tasks in the Job are in the completed state. The default is noaction. */ - onAllTasksComplete?: OnAllBatchTasksCompleteOutput; - /** The action the Batch service should take when any Task in the Job fails. A Task is considered to have failed if has a failureInfo. A failureInfo is set if the Task completes with a non-zero exit code after exhausting its retry count, or if there was an error starting the Task, for example due to a resource file download error. The default is noaction. */ - readonly onTaskFailure?: OnBatchTaskFailureOutput; - /** The network configuration for the Job. */ - readonly networkConfiguration?: BatchJobNetworkConfigurationOutput; - /** A list of name-value pairs associated with the Job as metadata. The Batch service does not assign any meaning to metadata; it is solely for the use of user code. */ - metadata?: Array; - /** The execution information for the Job. */ - readonly executionInfo?: BatchJobExecutionInfoOutput; - /** Resource usage statistics for the entire lifetime of the Job. This property is populated only if the CloudJob was retrieved with an expand clause including the 'stats' attribute; otherwise it is null. The statistics may not be immediately available. The Batch service performs periodic roll-up of statistics. The typical delay is about 30 minutes. */ - readonly stats?: BatchJobStatisticsOutput; -} - -/** The execution constraints for a Job. */ -export interface BatchJobConstraintsOutput { - /** The maximum elapsed time that the Job may run, measured from the time the Job is created. If the Job does not complete within the time limit, the Batch service terminates it and any Tasks that are still running. In this case, the termination reason will be MaxWallClockTimeExpiry. If this property is not specified, there is no time limit on how long the Job may run. */ - maxWallClockTime?: string; - /** The maximum number of times each Task may be retried. 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 each Task once, and may then retry up to this limit. For example, if the maximum retry count is 3, Batch tries a Task up to 4 times (one initial try and 3 retries). If the maximum retry count is 0, the Batch service does not retry Tasks. If the maximum retry count is -1, the Batch service retries Tasks without limit. The default value is 0 (no retries). */ - maxTaskRetryCount?: number; -} - -/** - * Specifies details of a Job Manager Task. - * The Job Manager Task is automatically started when the Job is created. The - * Batch service tries to schedule the Job Manager Task before any other Tasks in - * the Job. When shrinking a Pool, the Batch service tries to preserve Nodes where - * Job Manager Tasks are running for as long as possible (that is, Compute Nodes - * running 'normal' Tasks are removed before Compute Nodes running Job Manager - * Tasks). When a Job Manager Task fails and needs to be restarted, the system - * tries to schedule it at the highest priority. If there are no idle Compute - * Nodes available, the system may terminate one of the running Tasks in the Pool - * and return it to the queue in order to make room for the Job Manager Task to - * restart. Note that a Job Manager Task in one Job does not have priority over - * Tasks in other Jobs. Across Jobs, only Job level priorities are observed. For - * example, if a Job Manager in a priority 0 Job needs to be restarted, it will - * not displace Tasks of a priority 1 Job. Batch will retry Tasks when a recovery - * operation is triggered on a Node. Examples of recovery operations include (but - * are not limited to) when an unhealthy Node is rebooted or a Compute Node - * disappeared due to host failure. Retries due to recovery operations are - * independent of and are not counted against the maxTaskRetryCount. Even if the - * maxTaskRetryCount is 0, an internal retry due to a recovery operation may - * occur. Because of this, all Tasks should be idempotent. This means Tasks need - * to tolerate being interrupted and restarted without causing any corruption or - * duplicate data. The best practice for long running Tasks is to use some form of - * checkpointing. - */ -export interface BatchJobManagerTaskOutput { - /** A string that uniquely identifies the Job Manager Task within the Job. The ID can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. */ - id: string; - /** The display name of the Job Manager Task. It need not be unique and can contain any Unicode characters up to a maximum length of 1024. */ - displayName?: string; - /** The command line of the Job Manager Task. 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. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables). */ - commandLine: string; - /** The settings for the container under which the Job Manager Task runs. If the Pool that will run this Task has containerConfiguration set, this must be set as well. If the Pool that will run this Task doesn't have containerConfiguration set, this must not be set. 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. Files produced in the container outside of AZ_BATCH_NODE_ROOT_DIR might not be reflected to the host disk, meaning that Batch file APIs will not be able to access those files. */ - containerSettings?: BatchTaskContainerSettingsOutput; - /** A list of files that the Batch service will download to the Compute Node before running the command line. Files listed under this element are located in the Task's working directory. There is a maximum size for the list of resource files. When the max size is exceeded, the request will fail and the response error code will be RequestEntityTooLarge. If this occurs, the collection of ResourceFiles must be reduced in size. This can be achieved using .zip files, Application Packages, or Docker Containers. */ - resourceFiles?: Array; - /** A list of files that the Batch service will upload from the Compute Node after running the command line. For multi-instance Tasks, the files will only be uploaded from the Compute Node on which the primary Task is executed. */ - outputFiles?: Array; - /** A list of environment variable settings for the Job Manager Task. */ - environmentSettings?: Array; - /** Constraints that apply to the Job Manager Task. */ - constraints?: BatchTaskConstraintsOutput; - /** The number of scheduling slots that the Task requires to run. The default is 1. A Task can only be scheduled to run on a compute node if the node has enough free scheduling slots available. For multi-instance Tasks, this property is not supported and must not be specified. */ - requiredSlots?: number; - /** Whether completion of the Job Manager Task signifies completion of the entire Job. If true, when the Job Manager Task completes, the Batch service marks the Job as complete. If any Tasks are still running at this time (other than Job Release), those Tasks are terminated. If false, the completion of the Job Manager Task does not affect the Job status. In this case, you should either use the onAllTasksComplete attribute to terminate the Job, or have a client or user terminate the Job explicitly. An example of this is if the Job Manager creates a set of Tasks but then takes no further role in their execution. The default value is true. If you are using the onAllTasksComplete and onTaskFailure attributes to control Job lifetime, and using the Job Manager Task only to create the Tasks for the Job (not to monitor progress), then it is important to set killJobOnCompletion to false. */ - killJobOnCompletion?: boolean; - /** The user identity under which the Job Manager Task runs. If omitted, the Task runs as a non-administrative user unique to the Task. */ - userIdentity?: UserIdentityOutput; - /** Whether the Job Manager Task requires exclusive use of the Compute Node where it runs. If true, no other Tasks will run on the same Node for as long as the Job Manager is running. If false, other Tasks can run simultaneously with the Job Manager on a Compute Node. The Job Manager Task counts normally against the Compute Node's concurrent Task limit, so this is only relevant if the Compute Node allows multiple concurrent Tasks. The default value is true. */ - runExclusive?: boolean; - /** - * A list of Application Packages that the Batch service will deploy to the - * Compute Node before running the command line.Application Packages are - * downloaded and deployed to a shared directory, not the Task working - * directory. Therefore, if a referenced Application Package is already - * on the Compute Node, and is up to date, then it is not re-downloaded; - * the existing copy on the Compute Node is used. If a referenced Application - * Package cannot be installed, for example because the package has been deleted - * or because download failed, the Task fails. - */ - applicationPackageReferences?: Array; - /** The settings for an authentication token that the Task can use to perform Batch service operations. If this property is set, the Batch service provides the Task with an authentication token which can be used to authenticate Batch service operations without requiring an Account access key. The token is provided via the AZ_BATCH_AUTHENTICATION_TOKEN environment variable. The operations that the Task can carry out using the token depend on the settings. For example, a Task can request Job permissions in order to add other Tasks to the Job, or check the status of the Job or of other Tasks under the Job. */ - authenticationTokenSettings?: AuthenticationTokenSettingsOutput; - /** Whether the Job Manager Task may run on a Spot/Low-priority Compute Node. The default value is true. */ - allowLowPriorityNode?: boolean; -} - -/** On every file uploads, Batch service writes two log files to the compute node, 'fileuploadout.txt' and 'fileuploaderr.txt'. These log files are used to learn more about a specific failure. */ -export interface OutputFileOutput { - /** A pattern indicating which file(s) to upload. Both relative and absolute paths are supported. Relative paths are relative to the Task working directory. The following wildcards are supported: * matches 0 or more characters (for example pattern abc* would match abc or abcdef), ** matches any directory, ? matches any single character, [abc] matches one character in the brackets, and [a-c] matches one character in the range. Brackets can include a negation to match any character not specified (for example [!abc] matches any character but a, b, or c). If a file name starts with "." it is ignored by default but may be matched by specifying it explicitly (for example *.gif will not match .a.gif, but .*.gif will). A simple example: **\*.txt matches any file that does not start in '.' and ends with .txt in the Task working directory or any subdirectory. If the filename contains a wildcard character it can be escaped using brackets (for example abc[*] would match a file named abc*). Note that both \ and / are treated as directory separators on Windows, but only / is on Linux. Environment variables (%var% on Windows or $var on Linux) are expanded prior to the pattern being applied. */ - filePattern: string; - /** The destination for the output file(s). */ - destination: OutputFileDestinationOutput; - /** Additional options for the upload operation, including under what conditions to perform the upload. */ - uploadOptions: OutputFileUploadConfigOutput; -} - -/** The destination to which a file should be uploaded. */ -export interface OutputFileDestinationOutput { - /** A location in Azure blob storage to which files are uploaded. */ - container?: OutputFileBlobContainerDestinationOutput; -} - -/** Specifies a file upload destination within an Azure blob storage container. */ -export interface OutputFileBlobContainerDestinationOutput { - /** The destination blob or virtual directory within the Azure Storage container. If filePattern refers to a specific file (i.e. contains no wildcards), then path is the name of the blob to which to upload that file. If filePattern contains one or more wildcards (and therefore may match multiple files), then path is the name of the blob virtual directory (which is prepended to each blob name) to which to upload the file(s). If omitted, file(s) are uploaded to the root of the container with a blob name matching their file name. */ - path?: string; - /** The URL of the container within Azure Blob Storage to which to upload the file(s). If not using a managed identity, the URL must include a Shared Access Signature (SAS) granting write permissions to the container. */ - containerUrl: string; - /** The reference to the user assigned identity to use to access Azure Blob Storage specified by containerUrl. The identity must have write access to the Azure Blob Storage container. */ - identityReference?: BatchNodeIdentityReferenceOutput; - /** A list of name-value pairs for headers to be used in uploading output files. These headers will be specified when uploading files to Azure Storage. Official document on allowed headers when uploading blobs: https://docs.microsoft.com/en-us/rest/api/storageservices/put-blob#request-headers-all-blob-types. */ - uploadHeaders?: Array; -} - -/** An HTTP header name-value pair */ -export interface HttpHeaderOutput { - /** The case-insensitive name of the header to be used while uploading output files. */ - name: string; - /** The value of the header to be used while uploading output files. */ - value?: string; -} - -/** - * Options for an output file upload operation, including under what conditions - * to perform the upload. - */ -export interface OutputFileUploadConfigOutput { - /** The conditions under which the Task output file or set of files should be uploaded. The default is taskcompletion. */ - uploadCondition: OutputFileUploadConditionOutput; -} - -/** Execution constraints to apply to a Task. */ -export interface BatchTaskConstraintsOutput { - /** The maximum elapsed time that the Task may run, measured from the time the Task starts. If the Task does not complete within the time limit, the Batch service terminates it. If this is not specified, there is no time limit on how long the Task may run. */ - maxWallClockTime?: string; - /** The minimum time to retain the Task directory on the Compute Node where it ran, from the time it completes execution. After this time, the Batch service may delete the Task directory and all its contents. The default is 7 days, i.e. the Task directory will be retained for 7 days unless the Compute Node is removed or the Job is deleted. */ - retentionTime?: string; - /** The maximum number of times the Task may be retried. The Batch service retries a Task if its exit code is nonzero. Note that this value specifically controls the number of retries for the Task executable due to a nonzero exit code. 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 after the first attempt. If the maximum retry count is -1, the Batch service retries the Task without limit, however this is not recommended for a start task or any task. The default value is 0 (no retries). */ - maxTaskRetryCount?: number; -} - -/** - * The settings for an authentication token that the Task can use to perform Batch - * service operations. - */ -export interface AuthenticationTokenSettingsOutput { - /** The Batch resources to which the token grants access. The authentication token grants access to a limited set of Batch service operations. Currently the only supported value for the access property is 'job', which grants access to all operations related to the Job which contains the Task. */ - access?: AccessScopeOutput[]; -} - -/** - * A Job Preparation Task to run before any Tasks of the Job on any given Compute Node. - * You can use Job Preparation to prepare a Node to run Tasks for the Job. - * Activities commonly performed in Job Preparation include: Downloading common - * resource files used by all the Tasks in the Job. The Job Preparation Task can - * download these common resource files to the shared location on the Node. - * (AZ_BATCH_NODE_ROOT_DIR\shared), or starting a local service on the Node so - * that all Tasks of that Job can communicate with it. If the Job Preparation Task - * fails (that is, exhausts its retry count before exiting with exit code 0), - * Batch will not run Tasks of this Job on the Node. The Compute Node remains - * ineligible to run Tasks of this Job until it is reimaged. The Compute Node - * remains active and can be used for other Jobs. The Job Preparation Task can run - * multiple times on the same Node. Therefore, you should write the Job - * Preparation Task to handle re-execution. If the Node is rebooted, the Job - * Preparation Task is run again on the Compute Node before scheduling any other - * Task of the Job, if rerunOnNodeRebootAfterSuccess is true or if the Job - * Preparation Task did not previously complete. If the Node is reimaged, the Job - * Preparation Task is run again before scheduling any Task of the Job. Batch will - * retry Tasks when a recovery operation is triggered on a Node. Examples of - * recovery operations include (but are not limited to) when an unhealthy Node is - * rebooted or a Compute Node disappeared due to host failure. Retries due to - * recovery operations are independent of and are not counted against the - * maxTaskRetryCount. Even if the maxTaskRetryCount is 0, an internal retry due to - * a recovery operation may occur. Because of this, all Tasks should be - * idempotent. This means Tasks need to tolerate being interrupted and restarted - * without causing any corruption or duplicate data. The best practice for long - * running Tasks is to use some form of checkpointing. - */ -export interface BatchJobPreparationTaskOutput { - /** A string that uniquely identifies the Job Preparation Task within the Job. The ID can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. If you do not specify this property, the Batch service assigns a default value of 'jobpreparation'. No other Task in the Job can have the same ID as the Job Preparation Task. If you try to submit a Task with the same id, the Batch service rejects the request with error code TaskIdSameAsJobPreparationTask; if you are calling the REST API directly, the HTTP status code is 409 (Conflict). */ - id?: string; - /** The command line of the Job Preparation Task. 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. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables). */ - commandLine: string; - /** The settings for the container under which the Job Preparation Task runs. 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. Files produced in the container outside of AZ_BATCH_NODE_ROOT_DIR might not be reflected to the host disk, meaning that Batch file APIs will not be able to access those files. */ - containerSettings?: BatchTaskContainerSettingsOutput; - /** A list of files that the Batch service will download to the Compute Node before running the command line. Files listed under this element are located in the Task's working directory. There is a maximum size for the list of resource files. When the max size is exceeded, the request will fail and the response error code will be RequestEntityTooLarge. If this occurs, the collection of ResourceFiles must be reduced in size. This can be achieved using .zip files, Application Packages, or Docker Containers. */ - resourceFiles?: Array; - /** A list of environment variable settings for the Job Preparation Task. */ - environmentSettings?: Array; - /** Constraints that apply to the Job Preparation Task. */ - constraints?: BatchTaskConstraintsOutput; - /** Whether the Batch service should wait for the Job Preparation Task to complete successfully before scheduling any other Tasks of the Job on the Compute Node. A Job Preparation Task has completed successfully if it exits with exit code 0. If true and the Job Preparation Task fails on a Node, the Batch service retries the Job Preparation Task up to its maximum retry count (as specified in the constraints element). If the Task has still not completed successfully after all retries, then the Batch service will not schedule Tasks of the Job to the Node. The Node remains active and eligible to run Tasks of other Jobs. If false, the Batch service will not wait for the Job Preparation Task to complete. In this case, other Tasks of the Job can start executing on the Compute Node while the Job Preparation Task is still running; and even if the Job Preparation Task fails, new Tasks will continue to be scheduled on the Compute Node. The default value is true. */ - waitForSuccess?: boolean; - /** The user identity under which the Job Preparation Task runs. If omitted, the Task runs as a non-administrative user unique to the Task on Windows Compute Nodes, or a non-administrative user unique to the Pool on Linux Compute Nodes. */ - userIdentity?: UserIdentityOutput; - /** Whether the Batch service should rerun the Job Preparation Task after a Compute Node reboots. The Job Preparation Task is always rerun if a Compute Node is reimaged, or if the Job Preparation Task did not complete (e.g. because the reboot occurred while the Task was running). Therefore, you should always write a Job Preparation Task to be idempotent and to behave correctly if run multiple times. The default value is true. */ - rerunOnNodeRebootAfterSuccess?: boolean; -} - -/** - * A Job Release Task to run on Job completion on any Compute Node where the Job has run. - * The Job Release Task runs when the Job ends, because of one of the following: - * The user calls the Terminate Job API, or the Delete Job API while the Job is - * still active, the Job's maximum wall clock time constraint is reached, and the - * Job is still active, or the Job's Job Manager Task completed, and the Job is - * configured to terminate when the Job Manager completes. The Job Release Task - * runs on each Node where Tasks of the Job have run and the Job Preparation Task - * ran and completed. If you reimage a Node after it has run the Job Preparation - * Task, and the Job ends without any further Tasks of the Job running on that - * Node (and hence the Job Preparation Task does not re-run), then the Job Release - * Task does not run on that Compute Node. If a Node reboots while the Job Release - * Task is still running, the Job Release Task runs again when the Compute Node - * starts up. The Job is not marked as complete until all Job Release Tasks have - * completed. The Job Release Task runs in the background. It does not occupy a - * scheduling slot; that is, it does not count towards the taskSlotsPerNode limit - * specified on the Pool. - */ -export interface BatchJobReleaseTaskOutput { - /** A string that uniquely identifies the Job Release Task within the Job. The ID can contain any combination of alphanumeric characters including hyphens and underscores and cannot contain more than 64 characters. If you do not specify this property, the Batch service assigns a default value of 'jobrelease'. No other Task in the Job can have the same ID as the Job Release Task. If you try to submit a Task with the same id, the Batch service rejects the request with error code TaskIdSameAsJobReleaseTask; if you are calling the REST API directly, the HTTP status code is 409 (Conflict). */ - id?: string; - /** The command line of the Job Release Task. 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. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables). */ - commandLine: string; - /** The settings for the container under which the Job Release Task runs. 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. Files produced in the container outside of AZ_BATCH_NODE_ROOT_DIR might not be reflected to the host disk, meaning that Batch file APIs will not be able to access those files. */ - containerSettings?: BatchTaskContainerSettingsOutput; - /** A list of files that the Batch service will download to the Compute Node before running the command line. There is a maximum size for the list of resource files. When the max size is exceeded, the request will fail and the response error code will be RequestEntityTooLarge. If this occurs, the collection of ResourceFiles must be reduced in size. This can be achieved using .zip files, Application Packages, or Docker Containers. Files listed under this element are located in the Task's working directory. */ - resourceFiles?: Array; - /** A list of environment variable settings for the Job Release Task. */ - environmentSettings?: Array; - /** The maximum elapsed time that the Job Release Task may run on a given Compute Node, measured from the time the Task starts. If the Task does not complete within the time limit, the Batch service terminates it. The default value is 15 minutes. You may not specify a timeout longer than 15 minutes. If you do, the Batch service rejects it with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). */ - maxWallClockTime?: string; - /** The minimum time to retain the Task directory for the Job Release Task on the Compute Node. After this time, the Batch service may delete the Task directory and all its contents. The default is 7 days, i.e. the Task directory will be retained for 7 days unless the Compute Node is removed or the Job is deleted. */ - retentionTime?: string; - /** The user identity under which the Job Release Task runs. If omitted, the Task runs as a non-administrative user unique to the Task. */ - userIdentity?: UserIdentityOutput; -} - -/** Specifies how a Job should be assigned to a Pool. */ -export interface BatchPoolInfoOutput { - /** The ID of an existing Pool. All the Tasks of the Job will run on the specified Pool. You must ensure that the Pool referenced by this property exists. If the Pool does not exist at the time the Batch service tries to schedule a Job, no Tasks for the Job will run until you create a Pool with that id. Note that the Batch service will not reject the Job request; it will simply not run Tasks until the Pool exists. You must specify either the Pool ID or the auto Pool specification, but not both. */ - poolId?: string; - /** Characteristics for a temporary 'auto pool'. The Batch service will create this auto Pool when the Job is submitted. If auto Pool creation fails, the Batch service moves the Job to a completed state, and the Pool creation error is set in the Job's scheduling error property. The Batch service manages the lifetime (both creation and, unless keepAlive is specified, deletion) of the auto Pool. Any user actions that affect the lifetime of the auto Pool while the Job is active will result in unexpected behavior. You must specify either the Pool ID or the auto Pool specification, but not both. */ - autoPoolSpecification?: BatchAutoPoolSpecificationOutput; -} - -/** - * Specifies characteristics for a temporary 'auto pool'. The Batch service will - * create this auto Pool when the Job is submitted. - */ -export interface BatchAutoPoolSpecificationOutput { - /** A prefix to be added to the unique identifier when a Pool is automatically created. The Batch service assigns each auto Pool a unique identifier on creation. To distinguish between Pools created for different purposes, you can specify this element to add a prefix to the ID that is assigned. The prefix can be up to 20 characters long. */ - autoPoolIdPrefix?: string; - /** The minimum lifetime of created auto Pools, and how multiple Jobs on a schedule are assigned to Pools. */ - poolLifetimeOption: BatchPoolLifetimeOptionOutput; - /** Whether to keep an auto Pool alive after its lifetime expires. If false, the Batch service deletes the Pool once its lifetime (as determined by the poolLifetimeOption setting) expires; that is, when the Job or Job Schedule completes. If true, the Batch service does not delete the Pool automatically. It is up to the user to delete auto Pools created with this option. */ - keepAlive?: boolean; - /** The Pool specification for the auto Pool. */ - pool?: BatchPoolSpecificationOutput; -} - -/** Specification for creating a new Pool. */ -export interface BatchPoolSpecificationOutput { - /** The display name for the Pool. The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. */ - displayName?: string; - /** The size of the virtual machines in the Pool. All virtual machines in a Pool are the same size. For information about available sizes of virtual machines in Pools, see Choose a VM size for Compute Nodes in an Azure Batch Pool (https://docs.microsoft.com/azure/batch/batch-pool-vm-sizes). */ - vmSize: string; - /** The virtual machine configuration for the Pool. This property must be specified if the Pool needs to be created with Azure IaaS VMs. If it is not specified then the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). */ - virtualMachineConfiguration?: VirtualMachineConfigurationOutput; - /** The number of task slots that can be used to run concurrent tasks on a single compute node in the pool. 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; - /** How Tasks are distributed across Compute Nodes in a Pool. If not specified, the default is spread. */ - taskSchedulingPolicy?: BatchTaskSchedulingPolicyOutput; - /** The timeout for allocation of Compute Nodes to the Pool. This timeout applies only to manual scaling; it has no effect when enableAutoScale is set to true. The default value is 15 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; - /** The user-specified tags associated with the pool.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?: string; - /** The desired number of dedicated Compute Nodes in the Pool. This property must not be specified if enableAutoScale is set to true. If enableAutoScale is set to false, then you must set either targetDedicatedNodes, targetLowPriorityNodes, or both. */ - targetDedicatedNodes?: number; - /** The desired number of Spot/Low-priority Compute Nodes in the Pool. This property must not be specified if enableAutoScale is set to true. If enableAutoScale is set to false, then you must set either targetDedicatedNodes, targetLowPriorityNodes, or both. */ - targetLowPriorityNodes?: number; - /** Whether the Pool size should automatically adjust over time. If false, at least one of targetDedicatedNodes and targetLowPriorityNodes must be specified. If true, the autoScaleFormula element is required. The Pool automatically resizes according to the formula. The default value is false. */ - enableAutoScale?: boolean; - /** The formula for the desired number of Compute Nodes in the Pool. This property must not be specified if enableAutoScale is set to false. It is required if enableAutoScale is set to true. The formula is checked for validity before the Pool is created. If the formula is not valid, the Batch service rejects the request with detailed error information. */ - autoScaleFormula?: string; - /** The time interval at which to automatically adjust the Pool size according to the autoscale formula. The default value is 15 minutes. The minimum and maximum value are 5 minutes and 168 hours respectively. If you specify a value less than 5 minutes or greater than 168 hours, the Batch service rejects the request with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). */ - autoScaleEvaluationInterval?: string; - /** Whether the Pool permits direct communication between Compute Nodes. Enabling inter-node communication limits the maximum size of the Pool due to deployment restrictions on the Compute Nodes of the Pool. This may result in the Pool not reaching its desired size. The default value is false. */ - enableInterNodeCommunication?: boolean; - /** The network configuration for the Pool. */ - networkConfiguration?: NetworkConfigurationOutput; - /** A Task to run on each Compute Node as it joins the Pool. The Task runs when the Compute Node is added to the Pool or when the Compute Node is restarted. */ - startTask?: BatchStartTaskOutput; - /** The list of Packages to be installed on each Compute Node in the Pool. When creating a pool, the package's application ID must be fully qualified (/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName}). Changes to Package references affect all new 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 Package references on any given Pool. */ - applicationPackageReferences?: Array; - /** The list of user Accounts to be created on each Compute Node in the Pool. */ - userAccounts?: Array; - /** A list of name-value pairs associated with the Pool as metadata. The Batch service does not assign any meaning to metadata; it is solely for the use of user code. */ - metadata?: Array; - /** A list of file systems to mount on each node in the pool. This supports Azure Files, NFS, CIFS/SMB, and Blobfuse. */ - mountConfiguration?: Array; - /** The desired node communication mode for the pool. If omitted, the default value is Default. */ - targetNodeCommunicationMode?: BatchNodeCommunicationModeOutput; - /** The upgrade policy for the Pool. Describes an upgrade policy - automatic, manual, or rolling. */ - upgradePolicy?: UpgradePolicyOutput; -} - -/** The network configuration for the Job. */ -export interface BatchJobNetworkConfigurationOutput { - /** The ARM resource identifier of the virtual network subnet which Compute Nodes running Tasks from the Job will join for the duration of the Task. This will only work with a VirtualMachineConfiguration Pool. 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 Compute Nodes which will run Tasks from the Job. This can be up to the number of Compute Nodes in the Pool. The 'MicrosoftAzureBatch' service principal must have the 'Classic Virtual Machine Contributor' Role-Based Access Control (RBAC) role for the specified VNet so that Azure Batch service can schedule Tasks on the Nodes. This can be verified by checking if the specified VNet has any associated Network Security Groups (NSG). If communication to the Nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the Compute Nodes to unusable. This is of the form /subscriptions/{subscription}/resourceGroups/{group}/providers/{provider}/virtualNetworks/{network}/subnets/{subnet}. If the specified VNet has any associated Network Security Groups (NSG), then a few reserved system ports must be enabled for inbound communication from the Azure Batch service. For Pools created with a Virtual Machine configuration, enable ports 29876 and 29877, as well as port 22 for Linux and port 3389 for Windows. Port 443 is also required to be open for outbound connections for communications to Azure Storage. For more details see: https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. */ - subnetId: string; -} - -/** Contains information about the execution of a Job in the Azure Batch service. */ -export interface BatchJobExecutionInfoOutput { - /** The start time of the Job. This is the time at which the Job was created. */ - startTime: string; - /** The completion time of the Job. This property is set only if the Job is in the completed state. */ - endTime?: string; - /** The ID of the Pool to which this Job is assigned. This element contains the actual Pool where the Job is assigned. When you get Job details from the service, they also contain a poolInfo element, which contains the Pool configuration data from when the Job was added or updated. That poolInfo element may also contain a poolId element. If it does, the two IDs are the same. If it does not, it means the Job ran on an auto Pool, and this property contains the ID of that auto Pool. */ - poolId?: string; - /** Details of any error encountered by the service in starting the Job. This property is not set if there was no error starting the Job. */ - schedulingError?: BatchJobSchedulingErrorOutput; - /** A string describing the reason the Job ended. This property is set only if the Job is in the completed state. If the Batch service terminates the Job, it sets the reason as follows: JMComplete - the Job Manager Task completed, and killJobOnCompletion was set to true. MaxWallClockTimeExpiry - the Job reached its maxWallClockTime constraint. TerminateJobSchedule - the Job ran as part of a schedule, and the schedule terminated. AllTasksComplete - the Job's onAllTasksComplete attribute is set to terminatejob, and all Tasks in the Job are complete. TaskFailed - the Job's onTaskFailure attribute is set to performExitOptionsJobAction, and a Task in the Job failed with an exit condition that specified a jobAction of terminatejob. Any other string is a user-defined reason specified in a call to the 'Terminate a Job' operation. */ - terminateReason?: string; -} - -/** An error encountered by the Batch service when scheduling a Job. */ -export interface BatchJobSchedulingErrorOutput { - /** The category of the Job scheduling error. */ - category: ErrorCategoryOutput; - /** An identifier for the Job scheduling error. Codes are invariant and are intended to be consumed programmatically. */ - code?: string; - /** A message describing the Job scheduling error, intended to be suitable for display in a user interface. */ - message?: string; - /** A list of additional error details related to the scheduling error. */ - details?: Array; -} - -/** Resource usage statistics for a Job. */ -export interface BatchJobStatisticsOutput { - /** The URL of the statistics. */ - url: string; - /** The start time of the time range covered by the statistics. */ - startTime: string; - /** The time at which the statistics were last updated. All statistics are limited to the range between startTime and lastUpdateTime. */ - lastUpdateTime: string; - /** The total user mode CPU time (summed across all cores and all Compute Nodes) consumed by all Tasks in the Job. */ - userCPUTime: string; - /** The total kernel mode CPU time (summed across all cores and all Compute Nodes) consumed by all Tasks in the Job. */ - kernelCPUTime: string; - /** The total wall clock time of all Tasks in the Job. The wall clock time is the elapsed time from when the Task started running on a Compute Node to when it finished (or to the last time the statistics were updated, if the Task had not finished by then). If a Task was retried, this includes the wall clock time of all the Task retries. */ - wallClockTime: string; - /** The total number of disk read operations made by all Tasks in the Job. */ - readIOps: number; - /** The total number of disk write operations made by all Tasks in the Job. */ - writeIOps: number; - /** The total amount of data in GiB read from disk by all Tasks in the Job. */ - readIOGiB: number; - /** The total amount of data in GiB written to disk by all Tasks in the Job. */ - writeIOGiB: number; - /** The total number of Tasks successfully completed in the Job during the given time range. A Task completes successfully if it returns exit code 0. */ - numSucceededTasks: number; - /** The total number of Tasks in the Job that failed during the given time range. A Task fails if it exhausts its maximum retry count without returning exit code 0. */ - numFailedTasks: number; - /** The total number of retries on all the Tasks in the Job during the given time range. */ - numTaskRetries: number; - /** The total wait time of all Tasks in the Job. The wait time for a Task is defined as the elapsed time between the creation of the Task and the start of Task execution. (If the Task is retried due to failures, the wait time is the time to the most recent Task execution.) This value is only reported in the Account lifetime statistics; it is not included in the Job statistics. */ - waitTime: string; -} - -/** The result of listing the Jobs in an Account. */ -export interface BatchJobListResultOutput { - /** The list of Jobs. */ - value?: Array; - /** The URL to get the next set of results. */ - "odata.nextLink"?: string; -} - -/** - * The result of listing the status of the Job Preparation and Job Release Tasks - * for a Job. - */ -export interface BatchJobPreparationAndReleaseTaskStatusListResultOutput { - /** A list of Job Preparation and Job Release Task execution information. */ - value?: Array; - /** The URL to get the next set of results. */ - "odata.nextLink"?: string; -} - -/** The status of the Job Preparation and Job Release Tasks on a Compute Node. */ -export interface BatchJobPreparationAndReleaseTaskStatusOutput { - /** The ID of the Pool containing the Compute Node to which this entry refers. */ - poolId?: string; - /** The ID of the Compute Node to which this entry refers. */ - nodeId?: string; - /** The URL of the Compute Node to which this entry refers. */ - nodeUrl?: string; - /** Information about the execution status of the Job Preparation Task on this Compute Node. */ - jobPreparationTaskExecutionInfo?: BatchJobPreparationTaskExecutionInfoOutput; - /** Information about the execution status of the Job Release Task on this Compute Node. This property is set only if the Job Release Task has run on the Compute Node. */ - jobReleaseTaskExecutionInfo?: BatchJobReleaseTaskExecutionInfoOutput; -} - -/** - * Contains information about the execution of a Job Preparation Task on a Compute - * Node. - */ -export interface BatchJobPreparationTaskExecutionInfoOutput { - /** The time at which the Task started running. If the Task has been restarted or retried, this is the most recent time at which the Task started running. */ - startTime: string; - /** The time at which the Job Preparation Task completed. This property is set only if the Task is in the Completed state. */ - endTime?: string; - /** The current state of the Job Preparation Task on the Compute Node. */ - state: BatchJobPreparationTaskStateOutput; - /** The root directory of the Job Preparation Task on the Compute Node. You can use this path to retrieve files created by the Task, such as log files. */ - taskRootDirectory?: string; - /** The URL to the root directory of the Job Preparation Task on the Compute Node. */ - taskRootDirectoryUrl?: string; - /** The exit code of the program specified on the Task command line. This parameter is returned only if the Task is in the completed state. The exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. Note that the exit code may also be generated by the Compute Node operating system, such as when a process is forcibly terminated. */ - exitCode?: number; - /** Information about the container under which the Task is executing. This property is set only if the Task runs in a container context. */ - containerInfo?: BatchTaskContainerExecutionInfoOutput; - /** Information describing the Task failure, if any. This property is set only if the Task is in the completed state and encountered a failure. */ - failureInfo?: BatchTaskFailureInfoOutput; - /** The number of times the Task has been retried by the Batch service. Task application failures (non-zero exit code) are retried, pre-processing errors (the Task could not be run) and file upload errors are not retried. The Batch service will retry the Task up to the limit specified by the constraints. Task application failures (non-zero exit code) are retried, pre-processing errors (the Task could not be run) and file upload errors are not retried. The Batch service will retry the Task up to the limit specified by the constraints. */ - retryCount: number; - /** The most recent time at which a retry of the Job Preparation Task started running. This property is set only if the Task was retried (i.e. retryCount is nonzero). If present, this is typically the same as startTime, but may be different if the Task has been restarted for reasons other than retry; for example, if the Compute Node was rebooted during a retry, then the startTime is updated but the lastRetryTime is not. */ - lastRetryTime?: string; - /** The result of the Task execution. If the value is 'failed', then the details of the failure can be found in the failureInfo property. */ - result?: BatchTaskExecutionResultOutput; -} - -/** Contains information about the container which a Task is executing. */ -export interface BatchTaskContainerExecutionInfoOutput { - /** The ID of the container. */ - containerId?: string; - /** The state of the container. This is the state of the container according to the Docker service. It is equivalent to the status field returned by "docker inspect". */ - state?: string; - /** Detailed error information about the container. This is the detailed error string from the Docker service, if available. It is equivalent to the error field returned by "docker inspect". */ - error?: string; -} - -/** Information about a Task failure. */ -export interface BatchTaskFailureInfoOutput { - /** The category of the Task error. */ - category: ErrorCategoryOutput; - /** An identifier for the Task error. Codes are invariant and are intended to be consumed programmatically. */ - code?: string; - /** A message describing the Task error, intended to be suitable for display in a user interface. */ - message?: string; - /** A list of additional details related to the error. */ - details?: Array; -} - -/** - * Contains information about the execution of a Job Release Task on a Compute - * Node. - */ -export interface BatchJobReleaseTaskExecutionInfoOutput { - /** The time at which the Task started running. If the Task has been restarted or retried, this is the most recent time at which the Task started running. */ - startTime: string; - /** The time at which the Job Release Task completed. This property is set only if the Task is in the Completed state. */ - endTime?: string; - /** The current state of the Job Release Task on the Compute Node. */ - state: BatchJobReleaseTaskStateOutput; - /** The root directory of the Job Release Task on the Compute Node. You can use this path to retrieve files created by the Task, such as log files. */ - taskRootDirectory?: string; - /** The URL to the root directory of the Job Release Task on the Compute Node. */ - taskRootDirectoryUrl?: string; - /** The exit code of the program specified on the Task command line. This parameter is returned only if the Task is in the completed state. The exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. Note that the exit code may also be generated by the Compute Node operating system, such as when a process is forcibly terminated. */ - exitCode?: number; - /** Information about the container under which the Task is executing. This property is set only if the Task runs in a container context. */ - containerInfo?: BatchTaskContainerExecutionInfoOutput; - /** Information describing the Task failure, if any. This property is set only if the Task is in the completed state and encountered a failure. */ - failureInfo?: BatchTaskFailureInfoOutput; - /** The result of the Task execution. If the value is 'failed', then the details of the failure can be found in the failureInfo property. */ - result?: BatchTaskExecutionResultOutput; -} - -/** The Task and TaskSlot counts for a Job. */ -export interface BatchTaskCountsResultOutput { - /** The number of Tasks per state. */ - taskCounts: BatchTaskCountsOutput; - /** The number of TaskSlots required by Tasks per state. */ - taskSlotCounts: BatchTaskSlotCountsOutput; -} - -/** The Task counts for a Job. */ -export interface BatchTaskCountsOutput { - /** The number of Tasks in the active state. */ - active: number; - /** The number of Tasks in the running or preparing state. */ - running: number; - /** The number of Tasks in the completed state. */ - completed: number; - /** The number of Tasks which succeeded. A Task succeeds if its result (found in the executionInfo property) is 'success'. */ - succeeded: number; - /** The number of Tasks which failed. A Task fails if its result (found in the executionInfo property) is 'failure'. */ - failed: number; -} - -/** The TaskSlot counts for a Job. */ -export interface BatchTaskSlotCountsOutput { - /** The number of TaskSlots for active Tasks. */ - active: number; - /** The number of TaskSlots for running Tasks. */ - running: number; - /** The number of TaskSlots for completed Tasks. */ - completed: number; - /** The number of TaskSlots for succeeded Tasks. */ - succeeded: number; - /** The number of TaskSlots for failed Tasks. */ - failed: number; -} - -/** - * A Job Schedule that allows recurring Jobs by specifying when to run Jobs and a - * specification used to create each Job. - */ -export interface BatchJobScheduleOutput { - /** A string that uniquely identifies the schedule within the Account. */ - readonly id?: string; - /** The display name for the schedule. */ - readonly displayName?: string; - /** The URL of the Job Schedule. */ - readonly url?: string; - /** The ETag of the Job Schedule. This is an opaque string. You can use it to detect whether the Job Schedule has changed between requests. In particular, you can be pass the ETag with an Update Job Schedule request to specify that your changes should take effect only if nobody else has modified the schedule in the meantime. */ - readonly eTag?: string; - /** The last modified time of the Job Schedule. This is the last time at which the schedule level data, such as the Job specification or recurrence information, changed. It does not factor in job-level changes such as new Jobs being created or Jobs changing state. */ - readonly lastModified?: string; - /** The creation time of the Job Schedule. */ - readonly creationTime?: string; - /** The current state of the Job Schedule. */ - readonly state?: BatchJobScheduleStateOutput; - /** The time at which the Job Schedule entered the current state. */ - readonly stateTransitionTime?: string; - /** The previous state of the Job Schedule. This property is not present if the Job Schedule is in its initial active state. */ - readonly previousState?: BatchJobScheduleStateOutput; - /** The time at which the Job Schedule entered its previous state. This property is not present if the Job Schedule is in its initial active state. */ - readonly previousStateTransitionTime?: string; - /** The schedule according to which Jobs will be created. All times are fixed respective to UTC and are not impacted by daylight saving time. */ - schedule?: BatchJobScheduleConfigurationOutput; - /** The details of the Jobs to be created on this schedule. */ - jobSpecification: BatchJobSpecificationOutput; - /** Information about Jobs that have been and will be run under this schedule. */ - readonly executionInfo?: BatchJobScheduleExecutionInfoOutput; - /** A list of name-value pairs associated with the schedule as metadata. The Batch service does not assign any meaning to metadata; it is solely for the use of user code. */ - metadata?: Array; - /** The lifetime resource usage statistics for the Job Schedule. The statistics may not be immediately available. The Batch service performs periodic roll-up of statistics. The typical delay is about 30 minutes. */ - readonly stats?: BatchJobScheduleStatisticsOutput; -} - -/** - * The schedule according to which Jobs will be created. All times are fixed - * respective to UTC and are not impacted by daylight saving time. - */ -export interface BatchJobScheduleConfigurationOutput { - /** The earliest time at which any Job may be created under this Job Schedule. If you do not specify a doNotRunUntil time, the schedule becomes ready to create Jobs immediately. */ - doNotRunUntil?: string; - /** A time after which no Job will be created under this Job Schedule. The schedule will move to the completed state as soon as this deadline is past and there is no active Job under this Job Schedule. If you do not specify a doNotRunAfter time, and you are creating a recurring Job Schedule, the Job Schedule will remain active until you explicitly terminate it. */ - doNotRunAfter?: string; - /** The time interval, starting from the time at which the schedule indicates a Job should be created, within which a Job must be created. If a Job is not created within the startWindow interval, then the 'opportunity' is lost; no Job will be created until the next recurrence of the schedule. If the schedule is recurring, and the startWindow is longer than the recurrence interval, then this is equivalent to an infinite startWindow, because the Job that is 'due' in one recurrenceInterval is not carried forward into the next recurrence interval. The default is infinite. The minimum value is 1 minute. If you specify a lower value, the Batch service rejects the schedule with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). */ - startWindow?: string; - /** The time interval between the start times of two successive Jobs under the Job Schedule. A Job Schedule can have at most one active Job under it at any given time. Because a Job Schedule can have at most one active Job under it at any given time, if it is time to create a new Job under a Job Schedule, but the previous Job is still running, the Batch service will not create the new Job until the previous Job finishes. If the previous Job does not finish within the startWindow period of the new recurrenceInterval, then no new Job will be scheduled for that interval. For recurring Jobs, you should normally specify a jobManagerTask in the jobSpecification. If you do not use jobManagerTask, you will need an external process to monitor when Jobs are created, add Tasks to the Jobs and terminate the Jobs ready for the next recurrence. The default is that the schedule does not recur: one Job is created, within the startWindow after the doNotRunUntil time, and the schedule is complete as soon as that Job finishes. The minimum value is 1 minute. If you specify a lower value, the Batch service rejects the schedule with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). */ - recurrenceInterval?: string; -} - -/** Specifies details of the Jobs to be created on a schedule. */ -export interface BatchJobSpecificationOutput { - /** The priority of Jobs created under this schedule. Priority values can range from -1000 to 1000, with -1000 being the lowest priority and 1000 being the highest priority. The default value is 0. This priority is used as the default for all Jobs under the Job Schedule. You can update a Job's priority after it has been created using by using the update Job API. */ - priority?: number; - /** Whether Tasks in this job can be preempted by other high priority jobs. If the value is set to True, other high priority jobs submitted to the system will take precedence and will be able requeue tasks from this job. You can update a job's allowTaskPreemption after it has been created using the update job API. */ - allowTaskPreemption?: boolean; - /** The maximum number of tasks that can be executed in parallel for the job. The value of maxParallelTasks must be -1 or greater than 0 if specified. If not specified, the default value is -1, which means there's no limit to the number of tasks that can be run at once. You can update a job's maxParallelTasks after it has been created using the update job API. */ - maxParallelTasks?: number; - /** The display name for Jobs created under this schedule. The name need not be unique and can contain any Unicode characters up to a maximum length of 1024. */ - displayName?: string; - /** Whether Tasks in the Job can define dependencies on each other. The default is false. */ - usesTaskDependencies?: boolean; - /** The action the Batch service should take when all Tasks in a Job created under this schedule are in the completed state. Note that if a Job contains no Tasks, then all Tasks are considered complete. This option is therefore most commonly used with a Job Manager task; if you want to use automatic Job termination without a Job Manager, you should initially set onAllTasksComplete to noaction and update the Job properties to set onAllTasksComplete to terminatejob once you have finished adding Tasks. The default is noaction. */ - onAllTasksComplete?: OnAllBatchTasksCompleteOutput; - /** The action the Batch service should take when any Task fails in a Job created under this schedule. A Task is considered to have failed if it have failed if has a failureInfo. A failureInfo is set if the Task completes with a non-zero exit code after exhausting its retry count, or if there was an error starting the Task, for example due to a resource file download error. The default is noaction. */ - onTaskFailure?: OnBatchTaskFailureOutput; - /** The network configuration for the Job. */ - networkConfiguration?: BatchJobNetworkConfigurationOutput; - /** The execution constraints for Jobs created under this schedule. */ - constraints?: BatchJobConstraintsOutput; - /** The details of a Job Manager Task to be launched when a Job is started under this schedule. If the Job does not specify a Job Manager Task, the user must explicitly add Tasks to the Job using the Task API. If the Job does specify a Job Manager Task, the Batch service creates the Job Manager Task when the Job is created, and will try to schedule the Job Manager Task before scheduling other Tasks in the Job. */ - jobManagerTask?: BatchJobManagerTaskOutput; - /** The Job Preparation Task for Jobs created under this schedule. If a Job has a Job Preparation Task, the Batch service will run the Job Preparation Task on a Node before starting any Tasks of that Job on that Compute Node. */ - jobPreparationTask?: BatchJobPreparationTaskOutput; - /** The Job Release Task for Jobs created under this schedule. The primary purpose of the Job Release Task is to undo changes to Nodes made by the Job Preparation Task. Example activities include deleting local files, or shutting down services that were started as part of Job preparation. A Job Release Task cannot be specified without also specifying a Job Preparation Task for the Job. The Batch service runs the Job Release Task on the Compute Nodes that have run the Job Preparation Task. */ - jobReleaseTask?: BatchJobReleaseTaskOutput; - /** A list of common environment variable settings. These environment variables are set for all Tasks in Jobs created under this schedule (including the Job Manager, Job Preparation and Job Release Tasks). Individual Tasks can override an environment setting specified here by specifying the same setting name with a different value. */ - commonEnvironmentSettings?: Array; - /** The Pool on which the Batch service runs the Tasks of Jobs created under this schedule. */ - poolInfo: BatchPoolInfoOutput; - /** A list of name-value pairs associated with each Job created under this schedule as metadata. The Batch service does not assign any meaning to metadata; it is solely for the use of user code. */ - metadata?: Array; -} - -/** - * Contains information about Jobs that have been and will be run under a Job - * Schedule. - */ -export interface BatchJobScheduleExecutionInfoOutput { - /** The next time at which a Job will be created under this schedule. This property is meaningful only if the schedule is in the active state when the time comes around. For example, if the schedule is disabled, no Job will be created at nextRunTime unless the Job is enabled before then. */ - nextRunTime?: string; - /** Information about the most recent Job under the Job Schedule. This property is present only if the at least one Job has run under the schedule. */ - recentJob?: RecentBatchJobOutput; - /** The time at which the schedule ended. This property is set only if the Job Schedule is in the completed state. */ - endTime?: string; -} - -/** Information about the most recent Job to run under the Job Schedule. */ -export interface RecentBatchJobOutput { - /** The ID of the Job. */ - id?: string; - /** The URL of the Job. */ - url?: string; -} - -/** Resource usage statistics for a Job Schedule. */ -export interface BatchJobScheduleStatisticsOutput { - /** The URL of the statistics. */ - url: string; - /** The start time of the time range covered by the statistics. */ - startTime: string; - /** The time at which the statistics were last updated. All statistics are limited to the range between startTime and lastUpdateTime. */ - lastUpdateTime: string; - /** The total user mode CPU time (summed across all cores and all Compute Nodes) consumed by all Tasks in all Jobs created under the schedule. */ - userCPUTime: string; - /** The total kernel mode CPU time (summed across all cores and all Compute Nodes) consumed by all Tasks in all Jobs created under the schedule. */ - kernelCPUTime: string; - /** The total wall clock time of all the Tasks in all the Jobs created under the schedule. The wall clock time is the elapsed time from when the Task started running on a Compute Node to when it finished (or to the last time the statistics were updated, if the Task had not finished by then). If a Task was retried, this includes the wall clock time of all the Task retries. */ - wallClockTime: string; - /** The total number of disk read operations made by all Tasks in all Jobs created under the schedule. */ - readIOps: number; - /** The total number of disk write operations made by all Tasks in all Jobs created under the schedule. */ - writeIOps: number; - /** The total gibibytes read from disk by all Tasks in all Jobs created under the schedule. */ - readIOGiB: number; - /** The total gibibytes written to disk by all Tasks in all Jobs created under the schedule. */ - writeIOGiB: number; - /** The total number of Tasks successfully completed during the given time range in Jobs created under the schedule. A Task completes successfully if it returns exit code 0. */ - numSucceededTasks: number; - /** The total number of Tasks that failed during the given time range in Jobs created under the schedule. A Task fails if it exhausts its maximum retry count without returning exit code 0. */ - numFailedTasks: number; - /** The total number of retries during the given time range on all Tasks in all Jobs created under the schedule. */ - numTaskRetries: number; - /** The total wait time of all Tasks in all Jobs created under the schedule. The wait time for a Task is defined as the elapsed time between the creation of the Task and the start of Task execution. (If the Task is retried due to failures, the wait time is the time to the most recent Task execution.). This value is only reported in the Account lifetime statistics; it is not included in the Job statistics. */ - waitTime: string; -} - -/** The result of listing the Job Schedules in an Account. */ -export interface BatchJobScheduleListResultOutput { - /** The list of Job Schedules. */ - value?: Array; - /** The URL to get the next set of results. */ - "odata.nextLink"?: string; -} - -/** Specifies how the Batch service should respond when the Task completes. */ -export interface ExitConditionsOutput { - /** A list of individual Task exit codes and how the Batch service should respond to them. */ - exitCodes?: Array; - /** A list of Task exit code ranges and how the Batch service should respond to them. */ - exitCodeRanges?: Array; - /** How the Batch service should respond if the Task fails to start due to an error. */ - preProcessingError?: ExitOptionsOutput; - /** How the Batch service should respond if a file upload error occurs. If the Task exited with an exit code that was specified via exitCodes or exitCodeRanges, and then encountered a file upload error, then the action specified by the exit code takes precedence. */ - fileUploadError?: ExitOptionsOutput; - /** How the Batch service should respond if the Task fails with an exit condition not covered by any of the other properties. This value is used if the Task exits with any nonzero exit code not listed in the exitCodes or exitCodeRanges collection, with a pre-processing error if the preProcessingError property is not present, or with a file upload error if the fileUploadError property is not present. If you want non-default behavior on exit code 0, you must list it explicitly using the exitCodes or exitCodeRanges collection. */ - default?: ExitOptionsOutput; -} - -/** - * How the Batch service should respond if a Task exits with a particular exit - * code. - */ -export interface ExitCodeMappingOutput { - /** A process exit code. */ - code: number; - /** How the Batch service should respond if the Task exits with this exit code. */ - exitOptions: ExitOptionsOutput; -} - -/** Specifies how the Batch service responds to a particular exit condition. */ -export interface ExitOptionsOutput { - /** An action to take on the Job containing the Task, if the Task completes with the given exit condition and the Job's onTaskFailed property is 'performExitOptionsJobAction'. The default is none for exit code 0 and terminate for all other exit conditions. If the Job's onTaskFailed property is noaction, then specifying this property returns an error and the add Task request fails with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). */ - jobAction?: BatchJobActionOutput; - /** An action that the Batch service performs on Tasks that depend on this Task. Possible values are 'satisfy' (allowing dependent tasks to progress) and 'block' (dependent tasks continue to wait). Batch does not yet support cancellation of dependent tasks. */ - dependencyAction?: DependencyActionOutput; -} - -/** - * A range of exit codes and how the Batch service should respond to exit codes - * within that range. - */ -export interface ExitCodeRangeMappingOutput { - /** The first exit code in the range. */ - start: number; - /** The last exit code in the range. */ - end: number; - /** How the Batch service should respond if the Task exits with an exit code in the range start to end (inclusive). */ - exitOptions: ExitOptionsOutput; -} - -/** - * A locality hint that can be used by the Batch service to select a Compute Node - * on which to start a Task. - */ -export interface AffinityInfoOutput { - /** An opaque string representing the location of a Compute Node or a Task that has run previously. You can pass the affinityId of a Node to indicate that this Task needs to run on that Compute Node. Note that this is just a soft affinity. If the target Compute Node is busy or unavailable at the time the Task is scheduled, then the Task will be scheduled elsewhere. */ - affinityId: string; -} - -/** - * Multi-instance Tasks are commonly used to support MPI Tasks. In the MPI case, - * if any of the subtasks fail (for example due to exiting with a non-zero exit - * code) the entire multi-instance Task fails. The multi-instance Task is then - * terminated and retried, up to its retry limit. - */ -export interface MultiInstanceSettingsOutput { - /** The number of Compute Nodes required by the Task. If omitted, the default is 1. */ - numberOfInstances?: number; - /** The command line to run on all the Compute Nodes to enable them to coordinate when the primary runs the main Task command. A typical coordination command line launches a background service and verifies that the service is ready to process inter-node messages. */ - coordinationCommandLine: string; - /** A list of files that the Batch service will download before running the coordination command line. The difference between common resource files and Task resource files is that common resource files are downloaded for all subtasks including the primary, whereas Task resource files are downloaded only for the primary. Also note that these resource files are not downloaded to the Task working directory, but instead are downloaded to the Task root directory (one directory above the working directory). There is a maximum size for the list of resource files. When the max size is exceeded, the request will fail and the response error code will be RequestEntityTooLarge. If this occurs, the collection of ResourceFiles must be reduced in size. This can be achieved using .zip files, Application Packages, or Docker Containers. */ - commonResourceFiles?: Array; -} - -/** - * Specifies any dependencies of a Task. Any Task that is explicitly specified or - * within a dependency range must complete before the dependant Task will be - * scheduled. - */ -export interface BatchTaskDependenciesOutput { - /** The list of Task IDs that this Task depends on. All Tasks in this list must complete successfully before the dependent Task can be scheduled. The taskIds collection is limited to 64000 characters total (i.e. the combined length of all Task IDs). If the taskIds collection exceeds the maximum length, the Add Task request fails with error code TaskDependencyListTooLong. In this case consider using Task ID ranges instead. */ - taskIds?: string[]; - /** The list of Task ID ranges that this Task depends on. All Tasks in all ranges must complete successfully before the dependent Task can be scheduled. */ - taskIdRanges?: Array; -} - -/** - * The start and end of the range are inclusive. For example, if a range has start - * 9 and end 12, then it represents Tasks '9', '10', '11' and '12'. - */ -export interface BatchTaskIdRangeOutput { - /** The first Task ID in the range. */ - start: number; - /** The last Task ID in the range. */ - end: number; -} - -/** The result of listing the Tasks in a Job. */ -export interface BatchTaskListResultOutput { - /** The list of Tasks. */ - value?: Array; - /** The URL to get the next set of results. */ - "odata.nextLink"?: string; -} - -/** - * Batch will retry Tasks when a recovery operation is triggered on a Node. - * Examples of recovery operations include (but are not limited to) when an - * unhealthy Node is rebooted or a Compute Node disappeared due to host failure. - * Retries due to recovery operations are independent of and are not counted - * against the maxTaskRetryCount. Even if the maxTaskRetryCount is 0, an internal - * retry due to a recovery operation may occur. Because of this, all Tasks should - * be idempotent. This means Tasks need to tolerate being interrupted and - * restarted without causing any corruption or duplicate data. The best practice - * for long running Tasks is to use some form of checkpointing. - */ -export interface BatchTaskOutput { - /** A string that uniquely identifies the Task within the Job. The ID can contain any combination of alphanumeric characters including hyphens and underscores, and cannot contain more than 64 characters. */ - readonly id?: string; - /** A display name for the Task. The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024. */ - readonly displayName?: string; - /** The URL of the Task. */ - readonly url?: string; - /** The ETag of the Task. This is an opaque string. You can use it to detect whether the Task has changed between requests. In particular, you can be pass the ETag when updating a Task to specify that your changes should take effect only if nobody else has modified the Task in the meantime. */ - readonly eTag?: string; - /** The last modified time of the Task. */ - readonly lastModified?: string; - /** The creation time of the Task. */ - readonly creationTime?: string; - /** How the Batch service should respond when the Task completes. */ - readonly exitConditions?: ExitConditionsOutput; - /** The current state of the Task. */ - readonly state?: BatchTaskStateOutput; - /** The time at which the Task entered its current state. */ - readonly stateTransitionTime?: string; - /** The previous state of the Task. This property is not set if the Task is in its initial Active state. */ - readonly previousState?: BatchTaskStateOutput; - /** The time at which the Task entered its previous state. This property is not set if the Task is in its initial Active state. */ - readonly previousStateTransitionTime?: string; - /** The command line of the Task. For multi-instance Tasks, the command line is executed as the primary Task, after the primary Task and all subtasks have finished executing the coordination command line. 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. If the command line refers to file paths, it should use a relative path (relative to the Task working directory), or use the Batch provided environment variable (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables). */ - readonly commandLine?: string; - /** The settings for the container under which the Task runs. If the Pool that will run this Task has containerConfiguration set, this must be set as well. If the Pool that will run this Task doesn't have containerConfiguration set, this must not be set. 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. Files produced in the container outside of AZ_BATCH_NODE_ROOT_DIR might not be reflected to the host disk, meaning that Batch file APIs will not be able to access those files. */ - readonly containerSettings?: BatchTaskContainerSettingsOutput; - /** A list of files that the Batch service will download to the Compute Node before running the command line. For multi-instance Tasks, the resource files will only be downloaded to the Compute Node on which the primary Task is executed. There is a maximum size for the list of resource files. When the max size is exceeded, the request will fail and the response error code will be RequestEntityTooLarge. If this occurs, the collection of ResourceFiles must be reduced in size. This can be achieved using .zip files, Application Packages, or Docker Containers. */ - readonly resourceFiles?: Array; - /** A list of files that the Batch service will upload from the Compute Node after running the command line. For multi-instance Tasks, the files will only be uploaded from the Compute Node on which the primary Task is executed. */ - readonly outputFiles?: Array; - /** A list of environment variable settings for the Task. */ - readonly environmentSettings?: Array; - /** A locality hint that can be used by the Batch service to select a Compute Node on which to start the new Task. */ - readonly affinityInfo?: AffinityInfoOutput; - /** The execution constraints that apply to this Task. */ - constraints?: BatchTaskConstraintsOutput; - /** The number of scheduling slots that the Task requires to run. The default is 1. A Task can only be scheduled to run on a compute node if the node has enough free scheduling slots available. For multi-instance Tasks, this must be 1. */ - readonly requiredSlots?: number; - /** The user identity under which the Task runs. If omitted, the Task runs as a non-administrative user unique to the Task. */ - readonly userIdentity?: UserIdentityOutput; - /** Information about the execution of the Task. */ - readonly executionInfo?: BatchTaskExecutionInfoOutput; - /** Information about the Compute Node on which the Task ran. */ - readonly nodeInfo?: BatchNodeInfoOutput; - /** An object that indicates that the Task is a multi-instance Task, and contains information about how to run the multi-instance Task. */ - readonly multiInstanceSettings?: MultiInstanceSettingsOutput; - /** Resource usage statistics for the Task. */ - readonly stats?: BatchTaskStatisticsOutput; - /** The Tasks that this Task depends on. This Task will not be scheduled until all Tasks that it depends on have completed successfully. If any of those Tasks fail and exhaust their retry counts, this Task will never be scheduled. */ - readonly dependsOn?: BatchTaskDependenciesOutput; - /** A list of Packages that the Batch service will deploy to the Compute Node before running the command line. Application packages are downloaded and deployed to a shared directory, not the Task working directory. Therefore, if a referenced package is already on the Node, and is up to date, then it is not re-downloaded; the existing copy on the Compute Node is used. If a referenced Package cannot be installed, for example because the package has been deleted or because download failed, the Task fails. */ - readonly applicationPackageReferences?: Array; - /** The settings for an authentication token that the Task can use to perform Batch service operations. If this property is set, the Batch service provides the Task with an authentication token which can be used to authenticate Batch service operations without requiring an Account access key. The token is provided via the AZ_BATCH_AUTHENTICATION_TOKEN environment variable. The operations that the Task can carry out using the token depend on the settings. For example, a Task can request Job permissions in order to add other Tasks to the Job, or check the status of the Job or of other Tasks under the Job. */ - readonly authenticationTokenSettings?: AuthenticationTokenSettingsOutput; -} - -/** Information about the execution of a Task. */ -export interface BatchTaskExecutionInfoOutput { - /** The time at which the Task started running. 'Running' corresponds to the running state, so if the Task specifies resource files or Packages, then the start time reflects the time at which the Task started downloading or deploying these. If the Task has been restarted or retried, this is the most recent time at which the Task started running. This property is present only for Tasks that are in the running or completed state. */ - startTime?: string; - /** The time at which the Task completed. This property is set only if the Task is in the Completed state. */ - endTime?: string; - /** The exit code of the program specified on the Task command line. This property is set only if the Task is in the completed state. In general, the exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. However, if the Batch service terminates the Task (due to timeout, or user termination via the API) you may see an operating system-defined exit code. */ - exitCode?: number; - /** Information about the container under which the Task is executing. This property is set only if the Task runs in a container context. */ - containerInfo?: BatchTaskContainerExecutionInfoOutput; - /** Information describing the Task failure, if any. This property is set only if the Task is in the completed state and encountered a failure. */ - failureInfo?: BatchTaskFailureInfoOutput; - /** The number of times the Task has been retried by the Batch service. Task application failures (non-zero exit code) are retried, pre-processing errors (the Task could not be run) and file upload errors are not retried. The Batch service will retry the Task up to the limit specified by the constraints. */ - retryCount: number; - /** The most recent time at which a retry of the Task started running. This element is present only if the Task was retried (i.e. retryCount is nonzero). If present, this is typically the same as startTime, but may be different if the Task has been restarted for reasons other than retry; for example, if the Compute Node was rebooted during a retry, then the startTime is updated but the lastRetryTime is not. */ - lastRetryTime?: string; - /** The number of times the Task has been requeued by the Batch service as the result of a user request. When the user removes Compute Nodes from a Pool (by resizing/shrinking the pool) or when the Job is being disabled, the user can specify that running Tasks on the Compute Nodes be requeued for execution. This count tracks how many times the Task has been requeued for these reasons. */ - requeueCount: number; - /** The most recent time at which the Task has been requeued by the Batch service as the result of a user request. This property is set only if the requeueCount is nonzero. */ - lastRequeueTime?: string; - /** The result of the Task execution. If the value is 'failed', then the details of the failure can be found in the failureInfo property. */ - result?: BatchTaskExecutionResultOutput; -} - -/** Information about the Compute Node on which a Task ran. */ -export interface BatchNodeInfoOutput { - /** An identifier for the Node on which the Task ran, which can be passed when adding a Task to request that the Task be scheduled on this Compute Node. */ - affinityId?: string; - /** The URL of the Compute Node on which the Task ran. */ - nodeUrl?: string; - /** The ID of the Pool on which the Task ran. */ - poolId?: string; - /** The ID of the Compute Node on which the Task ran. */ - nodeId?: string; - /** The root directory of the Task on the Compute Node. */ - taskRootDirectory?: string; - /** The URL to the root directory of the Task on the Compute Node. */ - taskRootDirectoryUrl?: string; -} - -/** Resource usage statistics for a Task. */ -export interface BatchTaskStatisticsOutput { - /** The URL of the statistics. */ - url: string; - /** The start time of the time range covered by the statistics. */ - startTime: string; - /** The time at which the statistics were last updated. All statistics are limited to the range between startTime and lastUpdateTime. */ - lastUpdateTime: string; - /** The total user mode CPU time (summed across all cores and all Compute Nodes) consumed by the Task. */ - userCPUTime: string; - /** The total kernel mode CPU time (summed across all cores and all Compute Nodes) consumed by the Task. */ - kernelCPUTime: string; - /** The total wall clock time of the Task. The wall clock time is the elapsed time from when the Task started running on a Compute Node to when it finished (or to the last time the statistics were updated, if the Task had not finished by then). If the Task was retried, this includes the wall clock time of all the Task retries. */ - wallClockTime: string; - /** The total number of disk read operations made by the Task. */ - readIOps: number; - /** The total number of disk write operations made by the Task. */ - writeIOps: number; - /** The total gibibytes read from disk by the Task. */ - readIOGiB: number; - /** The total gibibytes written to disk by the Task. */ - writeIOGiB: number; - /** The total wait time of the Task. The wait time for a Task is defined as the elapsed time between the creation of the Task and the start of Task execution. (If the Task is retried due to failures, the wait time is the time to the most recent Task execution.). */ - waitTime: string; -} - -/** The result of adding a collection of Tasks to a Job. */ -export interface BatchTaskAddCollectionResultOutput { - /** The results of the add Task collection operation. */ - value?: Array; -} - -/** Result for a single Task added as part of an add Task collection operation. */ -export interface BatchTaskAddResultOutput { - /** The status of the add Task request. */ - status: BatchTaskAddStatusOutput; - /** The ID of the Task for which this is the result. */ - taskId: string; - /** The ETag of the Task, if the Task was successfully added. You can use this to detect whether the Task has changed between requests. In particular, you can be pass the ETag with an Update Task request to specify that your changes should take effect only if nobody else has modified the Job in the meantime. */ - eTag?: string; - /** The last modified time of the Task. */ - lastModified?: string; - /** The URL of the Task, if the Task was successfully added. */ - location?: string; - /** The error encountered while attempting to add the Task. */ - error?: BatchErrorOutput; -} - -/** The result of listing the subtasks of a Task. */ -export interface BatchTaskListSubtasksResultOutput { - /** The list of subtasks. */ - value?: Array; - /** The URL to get the next set of results. */ - "odata.nextLink"?: string; -} - -/** Information about an Azure Batch subtask. */ -export interface BatchSubtaskOutput { - /** The ID of the subtask. */ - id?: number; - /** Information about the Compute Node on which the subtask ran. */ - nodeInfo?: BatchNodeInfoOutput; - /** The time at which the subtask started running. If the subtask has been restarted or retried, this is the most recent time at which the subtask started running. */ - startTime?: string; - /** The time at which the subtask completed. This property is set only if the subtask is in the Completed state. */ - endTime?: string; - /** The exit code of the program specified on the subtask command line. This property is set only if the subtask is in the completed state. In general, the exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. However, if the Batch service terminates the subtask (due to timeout, or user termination via the API) you may see an operating system-defined exit code. */ - exitCode?: number; - /** Information about the container under which the Task is executing. This property is set only if the Task runs in a container context. */ - containerInfo?: BatchTaskContainerExecutionInfoOutput; - /** Information describing the Task failure, if any. This property is set only if the Task is in the completed state and encountered a failure. */ - failureInfo?: BatchTaskFailureInfoOutput; - /** The current state of the subtask. */ - state?: BatchSubtaskStateOutput; - /** The time at which the subtask entered its current state. */ - stateTransitionTime?: string; - /** The previous state of the subtask. This property is not set if the subtask is in its initial running state. */ - previousState?: BatchSubtaskStateOutput; - /** The time at which the subtask entered its previous state. This property is not set if the subtask is in its initial running state. */ - previousStateTransitionTime?: string; - /** The result of the Task execution. If the value is 'failed', then the details of the failure can be found in the failureInfo property. */ - result?: BatchTaskExecutionResultOutput; -} - -/** - * The result of listing the files on a Compute Node, or the files associated with - * a Task on a Compute Node. - */ -export interface BatchNodeFileListResultOutput { - /** The list of files. */ - value?: Array; - /** The URL to get the next set of results. */ - "odata.nextLink"?: string; -} - -/** Information about a file or directory on a Compute Node. */ -export interface BatchNodeFileOutput { - /** The file path. */ - name?: string; - /** The URL of the file. */ - url?: string; - /** Whether the object represents a directory. */ - isDirectory?: boolean; - /** The file properties. */ - properties?: FilePropertiesOutput; -} - -/** The properties of a file on a Compute Node. */ -export interface FilePropertiesOutput { - /** The file creation time. The creation time is not returned for files on Linux Compute Nodes. */ - creationTime?: string; - /** The time at which the file was last modified. */ - lastModified: string; - /** The length of the file. */ - contentLength: string; - /** The content type of the file. */ - contentType?: string; - /** The file mode attribute in octal format. The file mode is returned only for files on Linux Compute Nodes. */ - fileMode?: string; -} - -/** A Compute Node in the Batch service. */ -export interface BatchNodeOutput { - /** The ID of the Compute Node. Every Compute Node that is added to a Pool is assigned a unique ID. Whenever a Compute Node is removed from a Pool, all of its local files are deleted, and the ID is reclaimed and could be reused for new Compute Nodes. */ - id?: string; - /** The URL of the Compute Node. */ - url?: string; - /** The current state of the Compute Node. The Spot/Low-priority Compute Node has been preempted. Tasks which were running on the Compute Node when it was preempted will be rescheduled when another Compute Node becomes available. */ - state?: BatchNodeStateOutput; - /** Whether the Compute Node is available for Task scheduling. */ - schedulingState?: SchedulingStateOutput; - /** The time at which the Compute Node entered its current state. */ - stateTransitionTime?: string; - /** The last time at which the Compute Node was started. This property may not be present if the Compute Node state is unusable. */ - lastBootTime?: string; - /** The time at which this Compute Node was allocated to the Pool. This is the time when the Compute Node was initially allocated and doesn't change once set. It is not updated when the Compute Node is service healed or preempted. */ - allocationTime?: string; - /** The IP address that other Nodes can use to communicate with this Compute Node. Every Compute Node that is added to a Pool is assigned a unique IP address. Whenever a Compute Node is removed from a Pool, all of its local files are deleted, and the IP address is reclaimed and could be reused for new Compute Nodes. */ - ipAddress?: string; - /** An identifier which can be passed when adding a Task to request that the Task be scheduled on this Compute Node. Note that this is just a soft affinity. If the target Compute Node is busy or unavailable at the time the Task is scheduled, then the Task will be scheduled elsewhere. */ - affinityId?: string; - /** The size of the virtual machine hosting the Compute Node. For information about available sizes of virtual machines in Pools, see Choose a VM size for Compute Nodes in an Azure Batch Pool (https://docs.microsoft.com/azure/batch/batch-pool-vm-sizes). */ - vmSize?: string; - /** The total number of Job Tasks completed on the Compute Node. This includes Job Manager Tasks and normal Tasks, but not Job Preparation, Job Release or Start Tasks. */ - totalTasksRun?: number; - /** The total number of currently running Job Tasks on the Compute Node. This includes Job Manager Tasks and normal Tasks, but not Job Preparation, Job Release or Start Tasks. */ - runningTasksCount?: number; - /** The total number of scheduling slots used by currently running Job Tasks on the Compute Node. This includes Job Manager Tasks and normal Tasks, but not Job Preparation, Job Release or Start Tasks. */ - runningTaskSlotsCount?: number; - /** The total number of Job Tasks which completed successfully (with exitCode 0) on the Compute Node. This includes Job Manager Tasks and normal Tasks, but not Job Preparation, Job Release or Start Tasks. */ - totalTasksSucceeded?: number; - /** A list of Tasks whose state has recently changed. This property is present only if at least one Task has run on this Compute Node since it was assigned to the Pool. */ - recentTasks?: Array; - /** The Task specified to run on the Compute Node as it joins the Pool. */ - startTask?: BatchStartTaskOutput; - /** Runtime information about the execution of the StartTask on the Compute Node. */ - startTaskInfo?: BatchStartTaskInfoOutput; - /** The list of errors that are currently being encountered by the Compute Node. */ - errors?: Array; - /** Whether this Compute Node is a dedicated Compute Node. If false, the Compute Node is a Spot/Low-priority Compute Node. */ - isDedicated?: boolean; - /** The endpoint configuration for the Compute Node. */ - endpointConfiguration?: BatchNodeEndpointConfigurationOutput; - /** Information about the Compute Node agent version and the time the Compute Node upgraded to a new version. */ - nodeAgentInfo?: BatchNodeAgentInfoOutput; - /** Info about the current state of the virtual machine. */ - virtualMachineInfo?: VirtualMachineInfoOutput; -} - -/** Information about a Task running on a Compute Node. */ -export interface BatchTaskInfoOutput { - /** The URL of the Task. */ - taskUrl?: string; - /** The ID of the Job to which the Task belongs. */ - jobId?: string; - /** The ID of the Task. */ - taskId?: string; - /** The ID of the subtask if the Task is a multi-instance Task. */ - subtaskId?: number; - /** The current state of the Task. */ - taskState: BatchTaskStateOutput; - /** Information about the execution of the Task. */ - executionInfo?: BatchTaskExecutionInfoOutput; -} - -/** Information about a StartTask running on a Compute Node. */ -export interface BatchStartTaskInfoOutput { - /** The state of the StartTask on the Compute Node. */ - state: BatchStartTaskStateOutput; - /** The time at which the StartTask started running. This value is reset every time the Task is restarted or retried (that is, this is the most recent time at which the StartTask started running). */ - startTime: string; - /** The time at which the StartTask stopped running. This is the end time of the most recent run of the StartTask, if that run has completed (even if that run failed and a retry is pending). This element is not present if the StartTask is currently running. */ - endTime?: string; - /** The exit code of the program specified on the StartTask command line. This property is set only if the StartTask is in the completed state. In general, the exit code for a process reflects the specific convention implemented by the application developer for that process. If you use the exit code value to make decisions in your code, be sure that you know the exit code convention used by the application process. However, if the Batch service terminates the StartTask (due to timeout, or user termination via the API) you may see an operating system-defined exit code. */ - exitCode?: number; - /** Information about the container under which the Task is executing. This property is set only if the Task runs in a container context. */ - containerInfo?: BatchTaskContainerExecutionInfoOutput; - /** Information describing the Task failure, if any. This property is set only if the Task is in the completed state and encountered a failure. */ - failureInfo?: BatchTaskFailureInfoOutput; - /** The number of times the Task has been retried by the Batch service. Task application failures (non-zero exit code) are retried, pre-processing errors (the Task could not be run) and file upload errors are not retried. The Batch service will retry the Task up to the limit specified by the constraints. */ - retryCount: number; - /** The most recent time at which a retry of the Task started running. This element is present only if the Task was retried (i.e. retryCount is nonzero). If present, this is typically the same as startTime, but may be different if the Task has been restarted for reasons other than retry; for example, if the Compute Node was rebooted during a retry, then the startTime is updated but the lastRetryTime is not. */ - lastRetryTime?: string; - /** The result of the Task execution. If the value is 'failed', then the details of the failure can be found in the failureInfo property. */ - result?: BatchTaskExecutionResultOutput; -} - -/** An error encountered by a Compute Node. */ -export interface BatchNodeErrorOutput { - /** An identifier for the Compute Node error. Codes are invariant and are intended to be consumed programmatically. */ - code?: string; - /** A message describing the Compute Node error, intended to be suitable for display in a user interface. */ - message?: string; - /** The list of additional error details related to the Compute Node error. */ - errorDetails?: Array; -} - -/** The endpoint configuration for the Compute Node. */ -export interface BatchNodeEndpointConfigurationOutput { - /** The list of inbound endpoints that are accessible on the Compute Node. */ - inboundEndpoints: Array; -} - -/** An inbound endpoint on a Compute Node. */ -export interface InboundEndpointOutput { - /** The name of the endpoint. */ - name: string; - /** The protocol of the endpoint. */ - protocol: InboundEndpointProtocolOutput; - /** The public IP address of the Compute Node. */ - publicIPAddress: string; - /** The public fully qualified domain name for the Compute Node. */ - publicFQDN: string; - /** The public port number of the endpoint. */ - frontendPort: number; - /** The backend port number of the endpoint. */ - backendPort: number; -} - -/** - * The Batch Compute Node agent is a program that runs on each Compute Node in the - * Pool and provides Batch capability on the Compute Node. - */ -export interface BatchNodeAgentInfoOutput { - /** The version of the Batch Compute Node agent running on the Compute Node. This version number can be checked against the Compute Node agent release notes located at https://github.com/Azure/Batch/blob/master/changelogs/nodeagent/CHANGELOG.md. */ - version: string; - /** The time when the Compute Node agent was updated on the Compute Node. This is the most recent time that the Compute Node agent was updated to a new version. */ - lastUpdateTime: string; -} - -/** Info about the current state of the virtual machine. */ -export interface VirtualMachineInfoOutput { - /** The reference to the Azure Virtual Machine's Marketplace Image. */ - imageReference?: ImageReferenceOutput; - /** The resource ID of the Compute Node's current Virtual Machine Scale Set VM. Only defined if the Batch Account was created with its poolAllocationMode property set to 'UserSubscription'. */ - scaleSetVmResourceId?: string; -} - -/** The remote login settings for a Compute Node. */ -export interface BatchNodeRemoteLoginSettingsOutput { - /** The IP address used for remote login to the Compute Node. */ - remoteLoginIPAddress: string; - /** The port used for remote login to the Compute Node. */ - remoteLoginPort: number; -} - -/** The result of uploading Batch service log files from a specific Compute Node. */ -export interface UploadBatchServiceLogsResultOutput { - /** The virtual directory within Azure Blob Storage container to which the Batch Service log file(s) will be uploaded. The virtual directory name is part of the blob name for each log file uploaded, and it is built based poolId, nodeId and a unique identifier. */ - virtualDirectoryName: string; - /** The number of log files which will be uploaded. */ - numberOfFilesUploaded: number; -} - -/** The result of listing the Compute Nodes in a Pool. */ -export interface BatchNodeListResultOutput { - /** The list of Compute Nodes. */ - value?: Array; - /** The URL to get the next set of results. */ - "odata.nextLink"?: string; -} - -/** The configuration for virtual machine extension instance view. */ -export interface BatchNodeVMExtensionOutput { - /** The provisioning state of the virtual machine extension. */ - provisioningState?: string; - /** The virtual machine extension. */ - vmExtension?: VMExtensionOutput; - /** The vm extension instance view. */ - instanceView?: VMExtensionInstanceViewOutput; -} - -/** The vm extension instance view. */ -export interface VMExtensionInstanceViewOutput { - /** The name of the vm extension instance view. */ - name?: string; - /** The resource status information. */ - statuses?: Array; - /** The resource status information. */ - subStatuses?: Array; -} - -/** The instance view status. */ -export interface InstanceViewStatusOutput { - /** The status code. */ - code?: string; - /** The localized label for the status. */ - displayStatus?: string; - /** Level code. */ - level?: StatusLevelTypesOutput; - /** The detailed status message. */ - message?: string; - /** The time of the status. */ - time?: string; -} - -/** The result of listing the Compute Node extensions in a Node. */ -export interface BatchNodeVMExtensionListResultOutput { - /** The list of Compute Node extensions. */ - value?: Array; - /** The URL to get the next set of results. */ - "odata.nextLink"?: string; -} - -/** Alias for CachingTypeOutput */ -export type CachingTypeOutput = string; -/** Alias for StorageAccountTypeOutput */ -export type StorageAccountTypeOutput = string; -/** Alias for ContainerTypeOutput */ -export type ContainerTypeOutput = string; -/** Alias for DiskEncryptionTargetOutput */ -export type DiskEncryptionTargetOutput = string; -/** Alias for BatchNodePlacementPolicyTypeOutput */ -export type BatchNodePlacementPolicyTypeOutput = string; -/** Alias for DiffDiskPlacementOutput */ -export type DiffDiskPlacementOutput = string; -/** Alias for SecurityTypesOutput */ -export type SecurityTypesOutput = string; -/** Alias for DynamicVNetAssignmentScopeOutput */ -export type DynamicVNetAssignmentScopeOutput = string; -/** Alias for InboundEndpointProtocolOutput */ -export type InboundEndpointProtocolOutput = string; -/** Alias for NetworkSecurityGroupRuleAccessOutput */ -export type NetworkSecurityGroupRuleAccessOutput = string; -/** Alias for IpAddressProvisioningTypeOutput */ -export type IpAddressProvisioningTypeOutput = string; -/** Alias for ContainerWorkingDirectoryOutput */ -export type ContainerWorkingDirectoryOutput = string; -/** Alias for AutoUserScopeOutput */ -export type AutoUserScopeOutput = string; -/** Alias for ElevationLevelOutput */ -export type ElevationLevelOutput = string; -/** Alias for BatchNodeFillTypeOutput */ -export type BatchNodeFillTypeOutput = string; -/** Alias for LoginModeOutput */ -export type LoginModeOutput = string; -/** Alias for BatchNodeCommunicationModeOutput */ -export type BatchNodeCommunicationModeOutput = string; -/** Alias for UpgradeModeOutput */ -export type UpgradeModeOutput = string; -/** Alias for BatchPoolStateOutput */ -export type BatchPoolStateOutput = string; -/** Alias for AllocationStateOutput */ -export type AllocationStateOutput = string; -/** Alias for BatchPoolIdentityTypeOutput */ -export type BatchPoolIdentityTypeOutput = string; -/** Alias for OSTypeOutput */ -export type OSTypeOutput = string; -/** Alias for ImageVerificationTypeOutput */ -export type ImageVerificationTypeOutput = string; -/** Alias for BatchJobStateOutput */ -export type BatchJobStateOutput = string; -/** Alias for OutputFileUploadConditionOutput */ -export type OutputFileUploadConditionOutput = string; -/** Alias for AccessScopeOutput */ -export type AccessScopeOutput = string; -/** Alias for BatchPoolLifetimeOptionOutput */ -export type BatchPoolLifetimeOptionOutput = string; -/** Alias for OnAllBatchTasksCompleteOutput */ -export type OnAllBatchTasksCompleteOutput = string; -/** Alias for OnBatchTaskFailureOutput */ -export type OnBatchTaskFailureOutput = string; -/** Alias for ErrorCategoryOutput */ -export type ErrorCategoryOutput = string; -/** Alias for BatchJobPreparationTaskStateOutput */ -export type BatchJobPreparationTaskStateOutput = string; -/** Alias for BatchTaskExecutionResultOutput */ -export type BatchTaskExecutionResultOutput = string; -/** Alias for BatchJobReleaseTaskStateOutput */ -export type BatchJobReleaseTaskStateOutput = string; -/** Alias for BatchJobScheduleStateOutput */ -export type BatchJobScheduleStateOutput = string; -/** Alias for BatchJobActionOutput */ -export type BatchJobActionOutput = string; -/** Alias for DependencyActionOutput */ -export type DependencyActionOutput = string; -/** Alias for BatchTaskStateOutput */ -export type BatchTaskStateOutput = string; -/** Alias for BatchTaskAddStatusOutput */ -export type BatchTaskAddStatusOutput = string; -/** Alias for BatchSubtaskStateOutput */ -export type BatchSubtaskStateOutput = string; -/** Alias for BatchNodeStateOutput */ -export type BatchNodeStateOutput = string; -/** Alias for SchedulingStateOutput */ -export type SchedulingStateOutput = string; -/** Alias for BatchStartTaskStateOutput */ -export type BatchStartTaskStateOutput = string; -/** Alias for StatusLevelTypesOutput */ -export type StatusLevelTypesOutput = string; diff --git a/sdk/batch/batch-rest/generated/paginateHelper.ts b/sdk/batch/batch-rest/generated/paginateHelper.ts deleted file mode 100644 index b2a24801c35b..000000000000 --- a/sdk/batch/batch-rest/generated/paginateHelper.ts +++ /dev/null @@ -1,200 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { - getPagedAsyncIterator, - PagedAsyncIterableIterator, - PagedResult, -} from "@azure/core-paging"; -import { - Client, - createRestError, - PathUncheckedResponse, -} from "@azure-rest/core-client"; - -/** - * Helper type to extract the type of an array - */ -export type GetArrayType = T extends Array ? TData : never; - -/** - * The type of a custom function that defines how to get a page and a link to the next one if any. - */ -export type GetPage = ( - pageLink: string, - maxPageSize?: number, -) => Promise<{ - page: TPage; - nextPageLink?: string; -}>; - -/** - * Options for the paging helper - */ -export interface PagingOptions { - /** - * Custom function to extract pagination details for crating the PagedAsyncIterableIterator - */ - customGetPage?: GetPage[]>; -} - -/** - * Helper type to infer the Type of the paged elements from the response type - * This type is generated based on the swagger information for x-ms-pageable - * specifically on the itemName property which indicates the property of the response - * where the page items are found. The default value is `value`. - * This type will allow us to provide strongly typed Iterator based on the response we get as second parameter - */ -export type PaginateReturn = TResult extends { - body: { value?: infer TPage }; -} - ? GetArrayType - : Array; - -/** - * Helper to paginate results from an initial response that follows the specification of Autorest `x-ms-pageable` extension - * @param client - Client to use for sending the next page requests - * @param initialResponse - Initial response containing the nextLink and current page of elements - * @param customGetPage - Optional - Function to define how to extract the page and next link to be used to paginate the results - * @returns - PagedAsyncIterableIterator to iterate the elements - */ -export function paginate( - client: Client, - initialResponse: TResponse, - options: PagingOptions = {}, -): PagedAsyncIterableIterator> { - // Extract element type from initial response - type TElement = PaginateReturn; - let firstRun = true; - // We need to check the response for success before trying to inspect it looking for - // the properties to use for nextLink and itemName - checkPagingRequest(initialResponse); - const { itemName, nextLinkName } = getPaginationProperties(initialResponse); - const { customGetPage } = options; - const pagedResult: PagedResult = { - firstPageLink: "", - getPage: - typeof customGetPage === "function" - ? customGetPage - : async (pageLink: string) => { - const result = firstRun - ? initialResponse - : await client.pathUnchecked(pageLink).get(); - firstRun = false; - checkPagingRequest(result); - const nextLink = getNextLink(result.body, nextLinkName); - const values = getElements(result.body, itemName); - return { - page: values, - nextPageLink: nextLink, - }; - }, - }; - - return getPagedAsyncIterator(pagedResult); -} - -/** - * 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") { - throw new Error( - `Body Property ${nextLinkName} should be a string or 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[]; - - // value has to be an array according to the x-ms-pageable extension. - // The fact that this must be an array is used above to calculate the - // type of elements in the page in PaginateReturn - if (!Array.isArray(value)) { - throw new Error( - `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): void { - const Http2xxStatusCodes = [ - "200", - "201", - "202", - "203", - "204", - "205", - "206", - "207", - "208", - "226", - ]; - if (!Http2xxStatusCodes.includes(response.status)) { - throw createRestError( - `Pagination failed with unexpected statusCode ${response.status}`, - response, - ); - } -} - -/** - * Extracts the itemName and nextLinkName from the initial response to use them for pagination - */ -function getPaginationProperties(initialResponse: PathUncheckedResponse) { - // Build a set with the passed custom nextLinkNames - const nextLinkNames = new Set(["nextLink", "odata.nextLink"]); - - // Build a set with the passed custom set of itemNames - const itemNames = new Set(["value"]); - - let nextLinkName: string | undefined; - let itemName: string | undefined; - - for (const name of nextLinkNames) { - const nextLink = (initialResponse.body as Record)[ - name - ] as string; - if (nextLink) { - nextLinkName = name; - break; - } - } - - for (const name of itemNames) { - const item = (initialResponse.body as Record)[ - name - ] as string; - if (item) { - itemName = name; - break; - } - } - - if (!itemName) { - throw new Error( - `Couldn't paginate response\n Body doesn't contain an array property with name: ${[ - ...itemNames, - ].join(" OR ")}`, - ); - } - - return { itemName, nextLinkName }; -} diff --git a/sdk/batch/batch-rest/generated/parameters.ts b/sdk/batch/batch-rest/generated/parameters.ts deleted file mode 100644 index 1b5538cab3de..000000000000 --- a/sdk/batch/batch-rest/generated/parameters.ts +++ /dev/null @@ -1,3526 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { RawHttpHeadersInput } from "@azure/core-rest-pipeline"; -import { RequestParameters } from "@azure-rest/core-client"; -import { - BatchPoolCreateContent, - BatchPoolUpdateContent, - BatchPoolEnableAutoScaleContent, - BatchPoolEvaluateAutoScaleContent, - BatchPoolResizeContent, - BatchPoolReplaceContent, - BatchNodeRemoveContent, - BatchJobUpdateContent, - BatchJob, - BatchJobDisableContent, - BatchJobTerminateContent, - BatchJobCreateContent, - BatchJobScheduleUpdateContent, - BatchJobSchedule, - BatchJobScheduleCreateContent, - BatchTaskCreateContent, - BatchTaskGroup, - BatchTask, - BatchNodeUserCreateContent, - BatchNodeUserUpdateContent, - BatchNodeRebootContent, - BatchNodeDisableSchedulingContent, - UploadBatchServiceLogsContent, -} from "./models.js"; - -export interface ListApplicationsHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; -} - -export interface ListApplicationsQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; - /** - * The maximum number of items to return in the response. A maximum of 1000 - * applications can be returned. - */ - maxresults?: number; -} - -export interface ListApplicationsQueryParam { - queryParameters?: ListApplicationsQueryParamProperties; -} - -export interface ListApplicationsHeaderParam { - headers?: RawHttpHeadersInput & ListApplicationsHeaders; -} - -export type ListApplicationsParameters = ListApplicationsQueryParam & - ListApplicationsHeaderParam & - RequestParameters; - -export interface GetApplicationHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; -} - -export interface GetApplicationQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; -} - -export interface GetApplicationQueryParam { - queryParameters?: GetApplicationQueryParamProperties; -} - -export interface GetApplicationHeaderParam { - headers?: RawHttpHeadersInput & GetApplicationHeaders; -} - -export type GetApplicationParameters = GetApplicationQueryParam & - GetApplicationHeaderParam & - RequestParameters; - -export interface ListPoolUsageMetricsHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; -} - -export interface ListPoolUsageMetricsQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; - /** - * The maximum number of items to return in the response. A maximum of 1000 - * applications can be returned. - */ - maxresults?: number; - /** - * The earliest time from which to include metrics. This must be at least two and - * a half hours before the current time. If not specified this defaults to the - * start time of the last aggregation interval currently available. - */ - startTime?: Date | string; - /** - * The latest time from which to include metrics. This must be at least two hours - * before the current time. If not specified this defaults to the end time of the - * last aggregation interval currently available. - */ - endtime?: Date | string; - /** - * An OData $filter clause. For more information on constructing this filter, see - * https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-account-usage-metrics. - */ - $filter?: string; -} - -export interface ListPoolUsageMetricsQueryParam { - queryParameters?: ListPoolUsageMetricsQueryParamProperties; -} - -export interface ListPoolUsageMetricsHeaderParam { - headers?: RawHttpHeadersInput & ListPoolUsageMetricsHeaders; -} - -export type ListPoolUsageMetricsParameters = ListPoolUsageMetricsQueryParam & - ListPoolUsageMetricsHeaderParam & - RequestParameters; - -export interface CreatePoolHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; -} - -export interface CreatePoolBodyParam { - /** The Pool to be created. */ - body: BatchPoolCreateContent; -} - -export interface CreatePoolQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; -} - -export interface CreatePoolQueryParam { - queryParameters?: CreatePoolQueryParamProperties; -} - -export interface CreatePoolHeaderParam { - headers?: RawHttpHeadersInput & CreatePoolHeaders; -} - -export interface CreatePoolMediaTypesParam { - /** Type of content */ - contentType: "application/json; odata=minimalmetadata"; -} - -export type CreatePoolParameters = CreatePoolQueryParam & - CreatePoolHeaderParam & - CreatePoolMediaTypesParam & - CreatePoolBodyParam & - RequestParameters; - -export interface ListPoolsHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; -} - -export interface ListPoolsQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; - /** - * The maximum number of items to return in the response. A maximum of 1000 - * applications can be returned. - */ - maxresults?: number; - /** - * An OData $filter clause. For more information on constructing this filter, see - * https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-pools. - */ - $filter?: string; - /** An OData $select clause. */ - $select?: string[]; - /** An OData $expand clause. */ - $expand?: string[]; -} - -export interface ListPoolsQueryParam { - queryParameters?: ListPoolsQueryParamProperties; -} - -export interface ListPoolsHeaderParam { - headers?: RawHttpHeadersInput & ListPoolsHeaders; -} - -export type ListPoolsParameters = ListPoolsQueryParam & - ListPoolsHeaderParam & - RequestParameters; - -export interface DeletePoolHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * been modified since the specified time. - */ - "If-Modified-Since"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * not been modified since the specified time. - */ - "If-Unmodified-Since"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service exactly matches the value specified by the client. - */ - "If-Match"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service does not match the value specified by the client. - */ - "If-None-Match"?: string; -} - -export interface DeletePoolQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; -} - -export interface DeletePoolQueryParam { - queryParameters?: DeletePoolQueryParamProperties; -} - -export interface DeletePoolHeaderParam { - headers?: RawHttpHeadersInput & DeletePoolHeaders; -} - -export type DeletePoolParameters = DeletePoolQueryParam & - DeletePoolHeaderParam & - RequestParameters; - -export interface PoolExistsHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * been modified since the specified time. - */ - "If-Modified-Since"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * not been modified since the specified time. - */ - "If-Unmodified-Since"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service exactly matches the value specified by the client. - */ - "If-Match"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service does not match the value specified by the client. - */ - "If-None-Match"?: string; -} - -export interface PoolExistsQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; -} - -export interface PoolExistsQueryParam { - queryParameters?: PoolExistsQueryParamProperties; -} - -export interface PoolExistsHeaderParam { - headers?: RawHttpHeadersInput & PoolExistsHeaders; -} - -export type PoolExistsParameters = PoolExistsQueryParam & - PoolExistsHeaderParam & - RequestParameters; - -export interface GetPoolHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * been modified since the specified time. - */ - "If-Modified-Since"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * not been modified since the specified time. - */ - "If-Unmodified-Since"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service exactly matches the value specified by the client. - */ - "If-Match"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service does not match the value specified by the client. - */ - "If-None-Match"?: string; -} - -export interface GetPoolQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; - /** An OData $select clause. */ - $select?: string[]; - /** An OData $expand clause. */ - $expand?: string[]; -} - -export interface GetPoolQueryParam { - queryParameters?: GetPoolQueryParamProperties; -} - -export interface GetPoolHeaderParam { - headers?: RawHttpHeadersInput & GetPoolHeaders; -} - -export type GetPoolParameters = GetPoolQueryParam & - GetPoolHeaderParam & - RequestParameters; - -export interface UpdatePoolHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * been modified since the specified time. - */ - "If-Modified-Since"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * not been modified since the specified time. - */ - "If-Unmodified-Since"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service exactly matches the value specified by the client. - */ - "If-Match"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service does not match the value specified by the client. - */ - "If-None-Match"?: string; -} - -export interface UpdatePoolBodyParam { - /** The pool properties to update. */ - body: BatchPoolUpdateContent; -} - -export interface UpdatePoolQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; -} - -export interface UpdatePoolQueryParam { - queryParameters?: UpdatePoolQueryParamProperties; -} - -export interface UpdatePoolHeaderParam { - headers?: RawHttpHeadersInput & UpdatePoolHeaders; -} - -export interface UpdatePoolMediaTypesParam { - /** Type of content */ - contentType: "application/json; odata=minimalmetadata"; -} - -export type UpdatePoolParameters = UpdatePoolQueryParam & - UpdatePoolHeaderParam & - UpdatePoolMediaTypesParam & - UpdatePoolBodyParam & - RequestParameters; - -export interface DisablePoolAutoScaleHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; -} - -export interface DisablePoolAutoScaleQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; -} - -export interface DisablePoolAutoScaleQueryParam { - queryParameters?: DisablePoolAutoScaleQueryParamProperties; -} - -export interface DisablePoolAutoScaleHeaderParam { - headers?: RawHttpHeadersInput & DisablePoolAutoScaleHeaders; -} - -export type DisablePoolAutoScaleParameters = DisablePoolAutoScaleQueryParam & - DisablePoolAutoScaleHeaderParam & - RequestParameters; - -export interface EnablePoolAutoScaleHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * been modified since the specified time. - */ - "If-Modified-Since"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * not been modified since the specified time. - */ - "If-Unmodified-Since"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service exactly matches the value specified by the client. - */ - "If-Match"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service does not match the value specified by the client. - */ - "If-None-Match"?: string; -} - -export interface EnablePoolAutoScaleBodyParam { - /** The options to use for enabling automatic scaling. */ - body: BatchPoolEnableAutoScaleContent; -} - -export interface EnablePoolAutoScaleQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; -} - -export interface EnablePoolAutoScaleQueryParam { - queryParameters?: EnablePoolAutoScaleQueryParamProperties; -} - -export interface EnablePoolAutoScaleHeaderParam { - headers?: RawHttpHeadersInput & EnablePoolAutoScaleHeaders; -} - -export interface EnablePoolAutoScaleMediaTypesParam { - /** Type of content */ - contentType: "application/json; odata=minimalmetadata"; -} - -export type EnablePoolAutoScaleParameters = EnablePoolAutoScaleQueryParam & - EnablePoolAutoScaleHeaderParam & - EnablePoolAutoScaleMediaTypesParam & - EnablePoolAutoScaleBodyParam & - RequestParameters; - -export interface EvaluatePoolAutoScaleHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; -} - -export interface EvaluatePoolAutoScaleBodyParam { - /** The options to use for evaluating the automatic scaling formula. */ - body: BatchPoolEvaluateAutoScaleContent; -} - -export interface EvaluatePoolAutoScaleQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; -} - -export interface EvaluatePoolAutoScaleQueryParam { - queryParameters?: EvaluatePoolAutoScaleQueryParamProperties; -} - -export interface EvaluatePoolAutoScaleHeaderParam { - headers?: RawHttpHeadersInput & EvaluatePoolAutoScaleHeaders; -} - -export interface EvaluatePoolAutoScaleMediaTypesParam { - /** Type of content */ - contentType: "application/json; odata=minimalmetadata"; -} - -export type EvaluatePoolAutoScaleParameters = EvaluatePoolAutoScaleQueryParam & - EvaluatePoolAutoScaleHeaderParam & - EvaluatePoolAutoScaleMediaTypesParam & - EvaluatePoolAutoScaleBodyParam & - RequestParameters; - -export interface ResizePoolHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * been modified since the specified time. - */ - "If-Modified-Since"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * not been modified since the specified time. - */ - "If-Unmodified-Since"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service exactly matches the value specified by the client. - */ - "If-Match"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service does not match the value specified by the client. - */ - "If-None-Match"?: string; -} - -export interface ResizePoolBodyParam { - /** The options to use for resizing the pool. */ - body: BatchPoolResizeContent; -} - -export interface ResizePoolQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; -} - -export interface ResizePoolQueryParam { - queryParameters?: ResizePoolQueryParamProperties; -} - -export interface ResizePoolHeaderParam { - headers?: RawHttpHeadersInput & ResizePoolHeaders; -} - -export interface ResizePoolMediaTypesParam { - /** Type of content */ - contentType: "application/json; odata=minimalmetadata"; -} - -export type ResizePoolParameters = ResizePoolQueryParam & - ResizePoolHeaderParam & - ResizePoolMediaTypesParam & - ResizePoolBodyParam & - RequestParameters; - -export interface StopPoolResizeHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * been modified since the specified time. - */ - "If-Modified-Since"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * not been modified since the specified time. - */ - "If-Unmodified-Since"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service exactly matches the value specified by the client. - */ - "If-Match"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service does not match the value specified by the client. - */ - "If-None-Match"?: string; -} - -export interface StopPoolResizeQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; -} - -export interface StopPoolResizeQueryParam { - queryParameters?: StopPoolResizeQueryParamProperties; -} - -export interface StopPoolResizeHeaderParam { - headers?: RawHttpHeadersInput & StopPoolResizeHeaders; -} - -export type StopPoolResizeParameters = StopPoolResizeQueryParam & - StopPoolResizeHeaderParam & - RequestParameters; - -export interface ReplacePoolPropertiesHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; -} - -export interface ReplacePoolPropertiesBodyParam { - /** The options to use for replacing properties on the pool. */ - body: BatchPoolReplaceContent; -} - -export interface ReplacePoolPropertiesQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; -} - -export interface ReplacePoolPropertiesQueryParam { - queryParameters?: ReplacePoolPropertiesQueryParamProperties; -} - -export interface ReplacePoolPropertiesHeaderParam { - headers?: RawHttpHeadersInput & ReplacePoolPropertiesHeaders; -} - -export interface ReplacePoolPropertiesMediaTypesParam { - /** Type of content */ - contentType: "application/json; odata=minimalmetadata"; -} - -export type ReplacePoolPropertiesParameters = ReplacePoolPropertiesQueryParam & - ReplacePoolPropertiesHeaderParam & - ReplacePoolPropertiesMediaTypesParam & - ReplacePoolPropertiesBodyParam & - RequestParameters; - -export interface RemoveNodesHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * been modified since the specified time. - */ - "If-Modified-Since"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * not been modified since the specified time. - */ - "If-Unmodified-Since"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service exactly matches the value specified by the client. - */ - "If-Match"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service does not match the value specified by the client. - */ - "If-None-Match"?: string; -} - -export interface RemoveNodesBodyParam { - /** The options to use for removing the node. */ - body: BatchNodeRemoveContent; -} - -export interface RemoveNodesQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; -} - -export interface RemoveNodesQueryParam { - queryParameters?: RemoveNodesQueryParamProperties; -} - -export interface RemoveNodesHeaderParam { - headers?: RawHttpHeadersInput & RemoveNodesHeaders; -} - -export interface RemoveNodesMediaTypesParam { - /** Type of content */ - contentType: "application/json; odata=minimalmetadata"; -} - -export type RemoveNodesParameters = RemoveNodesQueryParam & - RemoveNodesHeaderParam & - RemoveNodesMediaTypesParam & - RemoveNodesBodyParam & - RequestParameters; - -export interface ListSupportedImagesHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; -} - -export interface ListSupportedImagesQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; - /** - * The maximum number of items to return in the response. A maximum of 1000 - * applications can be returned. - */ - maxresults?: number; - /** - * An OData $filter clause. For more information on constructing this filter, see - * https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-support-images. - */ - $filter?: string; -} - -export interface ListSupportedImagesQueryParam { - queryParameters?: ListSupportedImagesQueryParamProperties; -} - -export interface ListSupportedImagesHeaderParam { - headers?: RawHttpHeadersInput & ListSupportedImagesHeaders; -} - -export type ListSupportedImagesParameters = ListSupportedImagesQueryParam & - ListSupportedImagesHeaderParam & - RequestParameters; - -export interface ListPoolNodeCountsHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; -} - -export interface ListPoolNodeCountsQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; - /** - * The maximum number of items to return in the response. A maximum of 1000 - * applications can be returned. - */ - maxresults?: number; - /** - * An OData $filter clause. For more information on constructing this filter, see - * https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-support-images. - */ - $filter?: string; -} - -export interface ListPoolNodeCountsQueryParam { - queryParameters?: ListPoolNodeCountsQueryParamProperties; -} - -export interface ListPoolNodeCountsHeaderParam { - headers?: RawHttpHeadersInput & ListPoolNodeCountsHeaders; -} - -export type ListPoolNodeCountsParameters = ListPoolNodeCountsQueryParam & - ListPoolNodeCountsHeaderParam & - RequestParameters; - -export interface DeleteJobHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * been modified since the specified time. - */ - "If-Modified-Since"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * not been modified since the specified time. - */ - "If-Unmodified-Since"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service exactly matches the value specified by the client. - */ - "If-Match"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service does not match the value specified by the client. - */ - "If-None-Match"?: string; -} - -export interface DeleteJobQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; -} - -export interface DeleteJobQueryParam { - queryParameters?: DeleteJobQueryParamProperties; -} - -export interface DeleteJobHeaderParam { - headers?: RawHttpHeadersInput & DeleteJobHeaders; -} - -export type DeleteJobParameters = DeleteJobQueryParam & - DeleteJobHeaderParam & - RequestParameters; - -export interface GetJobHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * been modified since the specified time. - */ - "If-Modified-Since"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * not been modified since the specified time. - */ - "If-Unmodified-Since"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service exactly matches the value specified by the client. - */ - "If-Match"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service does not match the value specified by the client. - */ - "If-None-Match"?: string; -} - -export interface GetJobQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; - /** An OData $select clause. */ - $select?: string[]; - /** An OData $expand clause. */ - $expand?: string[]; -} - -export interface GetJobQueryParam { - queryParameters?: GetJobQueryParamProperties; -} - -export interface GetJobHeaderParam { - headers?: RawHttpHeadersInput & GetJobHeaders; -} - -export type GetJobParameters = GetJobQueryParam & - GetJobHeaderParam & - RequestParameters; - -export interface UpdateJobHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * been modified since the specified time. - */ - "If-Modified-Since"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * not been modified since the specified time. - */ - "If-Unmodified-Since"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service exactly matches the value specified by the client. - */ - "If-Match"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service does not match the value specified by the client. - */ - "If-None-Match"?: string; -} - -export interface UpdateJobBodyParam { - /** The options to use for updating the Job. */ - body: BatchJobUpdateContent; -} - -export interface UpdateJobQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; -} - -export interface UpdateJobQueryParam { - queryParameters?: UpdateJobQueryParamProperties; -} - -export interface UpdateJobHeaderParam { - headers?: RawHttpHeadersInput & UpdateJobHeaders; -} - -export interface UpdateJobMediaTypesParam { - /** Type of content */ - contentType: "application/json; odata=minimalmetadata"; -} - -export type UpdateJobParameters = UpdateJobQueryParam & - UpdateJobHeaderParam & - UpdateJobMediaTypesParam & - UpdateJobBodyParam & - RequestParameters; - -export interface ReplaceJobHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * been modified since the specified time. - */ - "If-Modified-Since"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * not been modified since the specified time. - */ - "If-Unmodified-Since"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service exactly matches the value specified by the client. - */ - "If-Match"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service does not match the value specified by the client. - */ - "If-None-Match"?: string; -} - -export interface ReplaceJobBodyParam { - /** A job with updated properties */ - body: BatchJob; -} - -export interface ReplaceJobQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; -} - -export interface ReplaceJobQueryParam { - queryParameters?: ReplaceJobQueryParamProperties; -} - -export interface ReplaceJobHeaderParam { - headers?: RawHttpHeadersInput & ReplaceJobHeaders; -} - -export interface ReplaceJobMediaTypesParam { - /** Type of content */ - contentType: "application/json; odata=minimalmetadata"; -} - -export type ReplaceJobParameters = ReplaceJobQueryParam & - ReplaceJobHeaderParam & - ReplaceJobMediaTypesParam & - ReplaceJobBodyParam & - RequestParameters; - -export interface DisableJobHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * been modified since the specified time. - */ - "If-Modified-Since"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * not been modified since the specified time. - */ - "If-Unmodified-Since"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service exactly matches the value specified by the client. - */ - "If-Match"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service does not match the value specified by the client. - */ - "If-None-Match"?: string; -} - -export interface DisableJobBodyParam { - /** The options to use for disabling the Job. */ - body: BatchJobDisableContent; -} - -export interface DisableJobQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; -} - -export interface DisableJobQueryParam { - queryParameters?: DisableJobQueryParamProperties; -} - -export interface DisableJobHeaderParam { - headers?: RawHttpHeadersInput & DisableJobHeaders; -} - -export interface DisableJobMediaTypesParam { - /** Type of content */ - contentType: "application/json; odata=minimalmetadata"; -} - -export type DisableJobParameters = DisableJobQueryParam & - DisableJobHeaderParam & - DisableJobMediaTypesParam & - DisableJobBodyParam & - RequestParameters; - -export interface EnableJobHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * been modified since the specified time. - */ - "If-Modified-Since"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * not been modified since the specified time. - */ - "If-Unmodified-Since"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service exactly matches the value specified by the client. - */ - "If-Match"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service does not match the value specified by the client. - */ - "If-None-Match"?: string; -} - -export interface EnableJobQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; -} - -export interface EnableJobQueryParam { - queryParameters?: EnableJobQueryParamProperties; -} - -export interface EnableJobHeaderParam { - headers?: RawHttpHeadersInput & EnableJobHeaders; -} - -export type EnableJobParameters = EnableJobQueryParam & - EnableJobHeaderParam & - RequestParameters; - -export interface TerminateJobHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * been modified since the specified time. - */ - "If-Modified-Since"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * not been modified since the specified time. - */ - "If-Unmodified-Since"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service exactly matches the value specified by the client. - */ - "If-Match"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service does not match the value specified by the client. - */ - "If-None-Match"?: string; -} - -export interface TerminateJobBodyParam { - /** The options to use for terminating the Job. */ - body?: BatchJobTerminateContent; -} - -export interface TerminateJobQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; -} - -export interface TerminateJobQueryParam { - queryParameters?: TerminateJobQueryParamProperties; -} - -export interface TerminateJobHeaderParam { - headers?: RawHttpHeadersInput & TerminateJobHeaders; -} - -export interface TerminateJobMediaTypesParam { - /** Type of content */ - contentType: "application/json; odata=minimalmetadata"; -} - -export type TerminateJobParameters = TerminateJobQueryParam & - TerminateJobHeaderParam & - TerminateJobMediaTypesParam & - TerminateJobBodyParam & - RequestParameters; - -export interface CreateJobHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; -} - -export interface CreateJobBodyParam { - /** The Job to be created. */ - body: BatchJobCreateContent; -} - -export interface CreateJobQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; -} - -export interface CreateJobQueryParam { - queryParameters?: CreateJobQueryParamProperties; -} - -export interface CreateJobHeaderParam { - headers?: RawHttpHeadersInput & CreateJobHeaders; -} - -export interface CreateJobMediaTypesParam { - /** Type of content */ - contentType: "application/json; odata=minimalmetadata"; -} - -export type CreateJobParameters = CreateJobQueryParam & - CreateJobHeaderParam & - CreateJobMediaTypesParam & - CreateJobBodyParam & - RequestParameters; - -export interface ListJobsHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; -} - -export interface ListJobsQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; - /** - * The maximum number of items to return in the response. A maximum of 1000 - * applications can be returned. - */ - maxresults?: number; - /** - * An OData $filter clause. For more information on constructing this filter, see - * https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-jobs. - */ - $filter?: string; - /** An OData $select clause. */ - $select?: string[]; - /** An OData $expand clause. */ - $expand?: string[]; -} - -export interface ListJobsQueryParam { - queryParameters?: ListJobsQueryParamProperties; -} - -export interface ListJobsHeaderParam { - headers?: RawHttpHeadersInput & ListJobsHeaders; -} - -export type ListJobsParameters = ListJobsQueryParam & - ListJobsHeaderParam & - RequestParameters; - -export interface ListJobsFromScheduleHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; -} - -export interface ListJobsFromScheduleQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; - /** - * The maximum number of items to return in the response. A maximum of 1000 - * applications can be returned. - */ - maxresults?: number; - /** - * An OData $filter clause. For more information on constructing this filter, see - * https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-jobs-in-a-job-schedule. - */ - $filter?: string; - /** An OData $select clause. */ - $select?: string[]; - /** An OData $expand clause. */ - $expand?: string[]; -} - -export interface ListJobsFromScheduleQueryParam { - queryParameters?: ListJobsFromScheduleQueryParamProperties; -} - -export interface ListJobsFromScheduleHeaderParam { - headers?: RawHttpHeadersInput & ListJobsFromScheduleHeaders; -} - -export type ListJobsFromScheduleParameters = ListJobsFromScheduleQueryParam & - ListJobsFromScheduleHeaderParam & - RequestParameters; - -export interface ListJobPreparationAndReleaseTaskStatusHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; -} - -export interface ListJobPreparationAndReleaseTaskStatusQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; - /** - * The maximum number of items to return in the response. A maximum of 1000 - * applications can be returned. - */ - maxresults?: number; - /** - * An OData $filter clause. For more information on constructing this filter, see - * https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-job-preparation-and-release-status. - */ - $filter?: string; - /** An OData $select clause. */ - $select?: string[]; -} - -export interface ListJobPreparationAndReleaseTaskStatusQueryParam { - queryParameters?: ListJobPreparationAndReleaseTaskStatusQueryParamProperties; -} - -export interface ListJobPreparationAndReleaseTaskStatusHeaderParam { - headers?: RawHttpHeadersInput & ListJobPreparationAndReleaseTaskStatusHeaders; -} - -export type ListJobPreparationAndReleaseTaskStatusParameters = - ListJobPreparationAndReleaseTaskStatusQueryParam & - ListJobPreparationAndReleaseTaskStatusHeaderParam & - RequestParameters; - -export interface GetJobTaskCountsHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; -} - -export interface GetJobTaskCountsQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; -} - -export interface GetJobTaskCountsQueryParam { - queryParameters?: GetJobTaskCountsQueryParamProperties; -} - -export interface GetJobTaskCountsHeaderParam { - headers?: RawHttpHeadersInput & GetJobTaskCountsHeaders; -} - -export type GetJobTaskCountsParameters = GetJobTaskCountsQueryParam & - GetJobTaskCountsHeaderParam & - RequestParameters; - -export interface JobScheduleExistsHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * been modified since the specified time. - */ - "If-Modified-Since"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * not been modified since the specified time. - */ - "If-Unmodified-Since"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service exactly matches the value specified by the client. - */ - "If-Match"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service does not match the value specified by the client. - */ - "If-None-Match"?: string; -} - -export interface JobScheduleExistsQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; -} - -export interface JobScheduleExistsQueryParam { - queryParameters?: JobScheduleExistsQueryParamProperties; -} - -export interface JobScheduleExistsHeaderParam { - headers?: RawHttpHeadersInput & JobScheduleExistsHeaders; -} - -export type JobScheduleExistsParameters = JobScheduleExistsQueryParam & - JobScheduleExistsHeaderParam & - RequestParameters; - -export interface DeleteJobScheduleHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * been modified since the specified time. - */ - "If-Modified-Since"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * not been modified since the specified time. - */ - "If-Unmodified-Since"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service exactly matches the value specified by the client. - */ - "If-Match"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service does not match the value specified by the client. - */ - "If-None-Match"?: string; -} - -export interface DeleteJobScheduleQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; -} - -export interface DeleteJobScheduleQueryParam { - queryParameters?: DeleteJobScheduleQueryParamProperties; -} - -export interface DeleteJobScheduleHeaderParam { - headers?: RawHttpHeadersInput & DeleteJobScheduleHeaders; -} - -export type DeleteJobScheduleParameters = DeleteJobScheduleQueryParam & - DeleteJobScheduleHeaderParam & - RequestParameters; - -export interface GetJobScheduleHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * been modified since the specified time. - */ - "If-Modified-Since"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * not been modified since the specified time. - */ - "If-Unmodified-Since"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service exactly matches the value specified by the client. - */ - "If-Match"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service does not match the value specified by the client. - */ - "If-None-Match"?: string; -} - -export interface GetJobScheduleQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; - /** An OData $select clause. */ - $select?: string[]; - /** An OData $expand clause. */ - $expand?: string[]; -} - -export interface GetJobScheduleQueryParam { - queryParameters?: GetJobScheduleQueryParamProperties; -} - -export interface GetJobScheduleHeaderParam { - headers?: RawHttpHeadersInput & GetJobScheduleHeaders; -} - -export type GetJobScheduleParameters = GetJobScheduleQueryParam & - GetJobScheduleHeaderParam & - RequestParameters; - -export interface UpdateJobScheduleHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * been modified since the specified time. - */ - "If-Modified-Since"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * not been modified since the specified time. - */ - "If-Unmodified-Since"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service exactly matches the value specified by the client. - */ - "If-Match"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service does not match the value specified by the client. - */ - "If-None-Match"?: string; -} - -export interface UpdateJobScheduleBodyParam { - /** The options to use for updating the Job Schedule. */ - body: BatchJobScheduleUpdateContent; -} - -export interface UpdateJobScheduleQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; -} - -export interface UpdateJobScheduleQueryParam { - queryParameters?: UpdateJobScheduleQueryParamProperties; -} - -export interface UpdateJobScheduleHeaderParam { - headers?: RawHttpHeadersInput & UpdateJobScheduleHeaders; -} - -export interface UpdateJobScheduleMediaTypesParam { - /** Type of content */ - contentType: "application/json; odata=minimalmetadata"; -} - -export type UpdateJobScheduleParameters = UpdateJobScheduleQueryParam & - UpdateJobScheduleHeaderParam & - UpdateJobScheduleMediaTypesParam & - UpdateJobScheduleBodyParam & - RequestParameters; - -export interface ReplaceJobScheduleHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * been modified since the specified time. - */ - "If-Modified-Since"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * not been modified since the specified time. - */ - "If-Unmodified-Since"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service exactly matches the value specified by the client. - */ - "If-Match"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service does not match the value specified by the client. - */ - "If-None-Match"?: string; -} - -export interface ReplaceJobScheduleBodyParam { - /** A Job Schedule with updated properties */ - body: BatchJobSchedule; -} - -export interface ReplaceJobScheduleQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; -} - -export interface ReplaceJobScheduleQueryParam { - queryParameters?: ReplaceJobScheduleQueryParamProperties; -} - -export interface ReplaceJobScheduleHeaderParam { - headers?: RawHttpHeadersInput & ReplaceJobScheduleHeaders; -} - -export interface ReplaceJobScheduleMediaTypesParam { - /** Type of content */ - contentType: "application/json; odata=minimalmetadata"; -} - -export type ReplaceJobScheduleParameters = ReplaceJobScheduleQueryParam & - ReplaceJobScheduleHeaderParam & - ReplaceJobScheduleMediaTypesParam & - ReplaceJobScheduleBodyParam & - RequestParameters; - -export interface DisableJobScheduleHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * been modified since the specified time. - */ - "If-Modified-Since"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * not been modified since the specified time. - */ - "If-Unmodified-Since"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service exactly matches the value specified by the client. - */ - "If-Match"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service does not match the value specified by the client. - */ - "If-None-Match"?: string; -} - -export interface DisableJobScheduleQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; -} - -export interface DisableJobScheduleQueryParam { - queryParameters?: DisableJobScheduleQueryParamProperties; -} - -export interface DisableJobScheduleHeaderParam { - headers?: RawHttpHeadersInput & DisableJobScheduleHeaders; -} - -export type DisableJobScheduleParameters = DisableJobScheduleQueryParam & - DisableJobScheduleHeaderParam & - RequestParameters; - -export interface EnableJobScheduleHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * been modified since the specified time. - */ - "If-Modified-Since"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * not been modified since the specified time. - */ - "If-Unmodified-Since"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service exactly matches the value specified by the client. - */ - "If-Match"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service does not match the value specified by the client. - */ - "If-None-Match"?: string; -} - -export interface EnableJobScheduleQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; -} - -export interface EnableJobScheduleQueryParam { - queryParameters?: EnableJobScheduleQueryParamProperties; -} - -export interface EnableJobScheduleHeaderParam { - headers?: RawHttpHeadersInput & EnableJobScheduleHeaders; -} - -export type EnableJobScheduleParameters = EnableJobScheduleQueryParam & - EnableJobScheduleHeaderParam & - RequestParameters; - -export interface TerminateJobScheduleHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * been modified since the specified time. - */ - "If-Modified-Since"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * not been modified since the specified time. - */ - "If-Unmodified-Since"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service exactly matches the value specified by the client. - */ - "If-Match"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service does not match the value specified by the client. - */ - "If-None-Match"?: string; -} - -export interface TerminateJobScheduleQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; -} - -export interface TerminateJobScheduleQueryParam { - queryParameters?: TerminateJobScheduleQueryParamProperties; -} - -export interface TerminateJobScheduleHeaderParam { - headers?: RawHttpHeadersInput & TerminateJobScheduleHeaders; -} - -export type TerminateJobScheduleParameters = TerminateJobScheduleQueryParam & - TerminateJobScheduleHeaderParam & - RequestParameters; - -export interface CreateJobScheduleHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; -} - -export interface CreateJobScheduleBodyParam { - /** The Job Schedule to be created. */ - body: BatchJobScheduleCreateContent; -} - -export interface CreateJobScheduleQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; -} - -export interface CreateJobScheduleQueryParam { - queryParameters?: CreateJobScheduleQueryParamProperties; -} - -export interface CreateJobScheduleHeaderParam { - headers?: RawHttpHeadersInput & CreateJobScheduleHeaders; -} - -export interface CreateJobScheduleMediaTypesParam { - /** Type of content */ - contentType: "application/json; odata=minimalmetadata"; -} - -export type CreateJobScheduleParameters = CreateJobScheduleQueryParam & - CreateJobScheduleHeaderParam & - CreateJobScheduleMediaTypesParam & - CreateJobScheduleBodyParam & - RequestParameters; - -export interface ListJobSchedulesHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; -} - -export interface ListJobSchedulesQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; - /** - * The maximum number of items to return in the response. A maximum of 1000 - * applications can be returned. - */ - maxresults?: number; - /** - * An OData $filter clause. For more information on constructing this filter, see - * https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-job-schedules. - */ - $filter?: string; - /** An OData $select clause. */ - $select?: string[]; - /** An OData $expand clause. */ - $expand?: string[]; -} - -export interface ListJobSchedulesQueryParam { - queryParameters?: ListJobSchedulesQueryParamProperties; -} - -export interface ListJobSchedulesHeaderParam { - headers?: RawHttpHeadersInput & ListJobSchedulesHeaders; -} - -export type ListJobSchedulesParameters = ListJobSchedulesQueryParam & - ListJobSchedulesHeaderParam & - RequestParameters; - -export interface CreateTaskHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; -} - -export interface CreateTaskBodyParam { - /** The Task to be created. */ - body: BatchTaskCreateContent; -} - -export interface CreateTaskQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; -} - -export interface CreateTaskQueryParam { - queryParameters?: CreateTaskQueryParamProperties; -} - -export interface CreateTaskHeaderParam { - headers?: RawHttpHeadersInput & CreateTaskHeaders; -} - -export interface CreateTaskMediaTypesParam { - /** Type of content */ - contentType: "application/json; odata=minimalmetadata"; -} - -export type CreateTaskParameters = CreateTaskQueryParam & - CreateTaskHeaderParam & - CreateTaskMediaTypesParam & - CreateTaskBodyParam & - RequestParameters; - -export interface ListTasksHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; -} - -export interface ListTasksQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; - /** - * The maximum number of items to return in the response. A maximum of 1000 - * applications can be returned. - */ - maxresults?: number; - /** - * An OData $filter clause. For more information on constructing this filter, see - * https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-tasks. - */ - $filter?: string; - /** An OData $select clause. */ - $select?: string[]; - /** An OData $expand clause. */ - $expand?: string[]; -} - -export interface ListTasksQueryParam { - queryParameters?: ListTasksQueryParamProperties; -} - -export interface ListTasksHeaderParam { - headers?: RawHttpHeadersInput & ListTasksHeaders; -} - -export type ListTasksParameters = ListTasksQueryParam & - ListTasksHeaderParam & - RequestParameters; - -export interface CreateTaskCollectionHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; -} - -export interface CreateTaskCollectionBodyParam { - /** The Tasks to be added. */ - body: BatchTaskGroup; -} - -export interface CreateTaskCollectionQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; -} - -export interface CreateTaskCollectionQueryParam { - queryParameters?: CreateTaskCollectionQueryParamProperties; -} - -export interface CreateTaskCollectionHeaderParam { - headers?: RawHttpHeadersInput & CreateTaskCollectionHeaders; -} - -export interface CreateTaskCollectionMediaTypesParam { - /** Type of content */ - contentType: "application/json; odata=minimalmetadata"; -} - -export type CreateTaskCollectionParameters = CreateTaskCollectionQueryParam & - CreateTaskCollectionHeaderParam & - CreateTaskCollectionMediaTypesParam & - CreateTaskCollectionBodyParam & - RequestParameters; - -export interface DeleteTaskHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * been modified since the specified time. - */ - "If-Modified-Since"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * not been modified since the specified time. - */ - "If-Unmodified-Since"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service exactly matches the value specified by the client. - */ - "If-Match"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service does not match the value specified by the client. - */ - "If-None-Match"?: string; -} - -export interface DeleteTaskQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; -} - -export interface DeleteTaskQueryParam { - queryParameters?: DeleteTaskQueryParamProperties; -} - -export interface DeleteTaskHeaderParam { - headers?: RawHttpHeadersInput & DeleteTaskHeaders; -} - -export type DeleteTaskParameters = DeleteTaskQueryParam & - DeleteTaskHeaderParam & - RequestParameters; - -export interface GetTaskHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * been modified since the specified time. - */ - "If-Modified-Since"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * not been modified since the specified time. - */ - "If-Unmodified-Since"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service exactly matches the value specified by the client. - */ - "If-Match"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service does not match the value specified by the client. - */ - "If-None-Match"?: string; -} - -export interface GetTaskQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; - /** An OData $select clause. */ - $select?: string[]; - /** An OData $expand clause. */ - $expand?: string[]; -} - -export interface GetTaskQueryParam { - queryParameters?: GetTaskQueryParamProperties; -} - -export interface GetTaskHeaderParam { - headers?: RawHttpHeadersInput & GetTaskHeaders; -} - -export type GetTaskParameters = GetTaskQueryParam & - GetTaskHeaderParam & - RequestParameters; - -export interface ReplaceTaskHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * been modified since the specified time. - */ - "If-Modified-Since"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * not been modified since the specified time. - */ - "If-Unmodified-Since"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service exactly matches the value specified by the client. - */ - "If-Match"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service does not match the value specified by the client. - */ - "If-None-Match"?: string; -} - -export interface ReplaceTaskBodyParam { - /** The Task to update. */ - body: BatchTask; -} - -export interface ReplaceTaskQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; -} - -export interface ReplaceTaskQueryParam { - queryParameters?: ReplaceTaskQueryParamProperties; -} - -export interface ReplaceTaskHeaderParam { - headers?: RawHttpHeadersInput & ReplaceTaskHeaders; -} - -export interface ReplaceTaskMediaTypesParam { - /** Type of content */ - contentType: "application/json; odata=minimalmetadata"; -} - -export type ReplaceTaskParameters = ReplaceTaskQueryParam & - ReplaceTaskHeaderParam & - ReplaceTaskMediaTypesParam & - ReplaceTaskBodyParam & - RequestParameters; - -export interface ListSubTasksHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; -} - -export interface ListSubTasksQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; - /** An OData $select clause. */ - $select?: string[]; -} - -export interface ListSubTasksQueryParam { - queryParameters?: ListSubTasksQueryParamProperties; -} - -export interface ListSubTasksHeaderParam { - headers?: RawHttpHeadersInput & ListSubTasksHeaders; -} - -export type ListSubTasksParameters = ListSubTasksQueryParam & - ListSubTasksHeaderParam & - RequestParameters; - -export interface TerminateTaskHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * been modified since the specified time. - */ - "If-Modified-Since"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * not been modified since the specified time. - */ - "If-Unmodified-Since"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service exactly matches the value specified by the client. - */ - "If-Match"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service does not match the value specified by the client. - */ - "If-None-Match"?: string; -} - -export interface TerminateTaskQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; -} - -export interface TerminateTaskQueryParam { - queryParameters?: TerminateTaskQueryParamProperties; -} - -export interface TerminateTaskHeaderParam { - headers?: RawHttpHeadersInput & TerminateTaskHeaders; -} - -export type TerminateTaskParameters = TerminateTaskQueryParam & - TerminateTaskHeaderParam & - RequestParameters; - -export interface ReactivateTaskHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * been modified since the specified time. - */ - "If-Modified-Since"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * not been modified since the specified time. - */ - "If-Unmodified-Since"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service exactly matches the value specified by the client. - */ - "If-Match"?: string; - /** - * An ETag value associated with the version of the resource known to the client. - * The operation will be performed only if the resource's current ETag on the - * service does not match the value specified by the client. - */ - "If-None-Match"?: string; -} - -export interface ReactivateTaskQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; -} - -export interface ReactivateTaskQueryParam { - queryParameters?: ReactivateTaskQueryParamProperties; -} - -export interface ReactivateTaskHeaderParam { - headers?: RawHttpHeadersInput & ReactivateTaskHeaders; -} - -export type ReactivateTaskParameters = ReactivateTaskQueryParam & - ReactivateTaskHeaderParam & - RequestParameters; - -export interface DeleteTaskFileHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; -} - -export interface DeleteTaskFileQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; - /** - * Whether to delete children of a directory. If the filePath parameter represents - * a directory instead of a file, you can set recursive to true to delete the - * directory and all of the files and subdirectories in it. If recursive is false - * then the directory must be empty or deletion will fail. - */ - recursive?: boolean; -} - -export interface DeleteTaskFileQueryParam { - queryParameters?: DeleteTaskFileQueryParamProperties; -} - -export interface DeleteTaskFileHeaderParam { - headers?: RawHttpHeadersInput & DeleteTaskFileHeaders; -} - -export type DeleteTaskFileParameters = DeleteTaskFileQueryParam & - DeleteTaskFileHeaderParam & - RequestParameters; - -export interface GetTaskFileHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * been modified since the specified time. - */ - "If-Modified-Since"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * not been modified since the specified time. - */ - "If-Unmodified-Since"?: string; - /** - * The byte range to be retrieved. The default is to retrieve the entire file. The - * format is bytes=startRange-endRange. - */ - "ocp-range"?: string; -} - -export interface GetTaskFileQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; -} - -export interface GetTaskFileQueryParam { - queryParameters?: GetTaskFileQueryParamProperties; -} - -export interface GetTaskFileHeaderParam { - headers?: RawHttpHeadersInput & GetTaskFileHeaders; -} - -export type GetTaskFileParameters = GetTaskFileQueryParam & - GetTaskFileHeaderParam & - RequestParameters; - -export interface GetTaskFilePropertiesHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * been modified since the specified time. - */ - "If-Modified-Since"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * not been modified since the specified time. - */ - "If-Unmodified-Since"?: string; -} - -export interface GetTaskFilePropertiesQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; -} - -export interface GetTaskFilePropertiesQueryParam { - queryParameters?: GetTaskFilePropertiesQueryParamProperties; -} - -export interface GetTaskFilePropertiesHeaderParam { - headers?: RawHttpHeadersInput & GetTaskFilePropertiesHeaders; -} - -export type GetTaskFilePropertiesParameters = GetTaskFilePropertiesQueryParam & - GetTaskFilePropertiesHeaderParam & - RequestParameters; - -export interface ListTaskFilesHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; -} - -export interface ListTaskFilesQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; - /** - * The maximum number of items to return in the response. A maximum of 1000 - * applications can be returned. - */ - maxresults?: number; - /** - * An OData $filter clause. For more information on constructing this filter, see - * https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-task-files. - */ - $filter?: string; - /** - * Whether to list children of the Task directory. This parameter can be used in - * combination with the filter parameter to list specific type of files. - */ - recursive?: boolean; -} - -export interface ListTaskFilesQueryParam { - queryParameters?: ListTaskFilesQueryParamProperties; -} - -export interface ListTaskFilesHeaderParam { - headers?: RawHttpHeadersInput & ListTaskFilesHeaders; -} - -export type ListTaskFilesParameters = ListTaskFilesQueryParam & - ListTaskFilesHeaderParam & - RequestParameters; - -export interface CreateNodeUserHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; -} - -export interface CreateNodeUserBodyParam { - /** The options to use for creating the user. */ - body: BatchNodeUserCreateContent; -} - -export interface CreateNodeUserQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; -} - -export interface CreateNodeUserQueryParam { - queryParameters?: CreateNodeUserQueryParamProperties; -} - -export interface CreateNodeUserHeaderParam { - headers?: RawHttpHeadersInput & CreateNodeUserHeaders; -} - -export interface CreateNodeUserMediaTypesParam { - /** Type of content */ - contentType: "application/json; odata=minimalmetadata"; -} - -export type CreateNodeUserParameters = CreateNodeUserQueryParam & - CreateNodeUserHeaderParam & - CreateNodeUserMediaTypesParam & - CreateNodeUserBodyParam & - RequestParameters; - -export interface DeleteNodeUserHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; -} - -export interface DeleteNodeUserQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; -} - -export interface DeleteNodeUserQueryParam { - queryParameters?: DeleteNodeUserQueryParamProperties; -} - -export interface DeleteNodeUserHeaderParam { - headers?: RawHttpHeadersInput & DeleteNodeUserHeaders; -} - -export type DeleteNodeUserParameters = DeleteNodeUserQueryParam & - DeleteNodeUserHeaderParam & - RequestParameters; - -export interface ReplaceNodeUserHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; -} - -export interface ReplaceNodeUserBodyParam { - /** The options to use for updating the user. */ - body: BatchNodeUserUpdateContent; -} - -export interface ReplaceNodeUserQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; -} - -export interface ReplaceNodeUserQueryParam { - queryParameters?: ReplaceNodeUserQueryParamProperties; -} - -export interface ReplaceNodeUserHeaderParam { - headers?: RawHttpHeadersInput & ReplaceNodeUserHeaders; -} - -export interface ReplaceNodeUserMediaTypesParam { - /** Type of content */ - contentType: "application/json; odata=minimalmetadata"; -} - -export type ReplaceNodeUserParameters = ReplaceNodeUserQueryParam & - ReplaceNodeUserHeaderParam & - ReplaceNodeUserMediaTypesParam & - ReplaceNodeUserBodyParam & - RequestParameters; - -export interface GetNodeHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; -} - -export interface GetNodeQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; - /** An OData $select clause. */ - $select?: string[]; -} - -export interface GetNodeQueryParam { - queryParameters?: GetNodeQueryParamProperties; -} - -export interface GetNodeHeaderParam { - headers?: RawHttpHeadersInput & GetNodeHeaders; -} - -export type GetNodeParameters = GetNodeQueryParam & - GetNodeHeaderParam & - RequestParameters; - -export interface RebootNodeHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; -} - -export interface RebootNodeBodyParam { - /** The options to use for rebooting the Compute Node. */ - body?: BatchNodeRebootContent; -} - -export interface RebootNodeQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; -} - -export interface RebootNodeQueryParam { - queryParameters?: RebootNodeQueryParamProperties; -} - -export interface RebootNodeHeaderParam { - headers?: RawHttpHeadersInput & RebootNodeHeaders; -} - -export interface RebootNodeMediaTypesParam { - /** Type of content */ - contentType: "application/json; odata=minimalmetadata"; -} - -export type RebootNodeParameters = RebootNodeQueryParam & - RebootNodeHeaderParam & - RebootNodeMediaTypesParam & - RebootNodeBodyParam & - RequestParameters; - -export interface DisableNodeSchedulingHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; -} - -export interface DisableNodeSchedulingBodyParam { - /** The options to use for disabling scheduling on the Compute Node. */ - body?: BatchNodeDisableSchedulingContent; -} - -export interface DisableNodeSchedulingQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; -} - -export interface DisableNodeSchedulingQueryParam { - queryParameters?: DisableNodeSchedulingQueryParamProperties; -} - -export interface DisableNodeSchedulingHeaderParam { - headers?: RawHttpHeadersInput & DisableNodeSchedulingHeaders; -} - -export interface DisableNodeSchedulingMediaTypesParam { - /** Type of content */ - contentType: "application/json; odata=minimalmetadata"; -} - -export type DisableNodeSchedulingParameters = DisableNodeSchedulingQueryParam & - DisableNodeSchedulingHeaderParam & - DisableNodeSchedulingMediaTypesParam & - DisableNodeSchedulingBodyParam & - RequestParameters; - -export interface EnableNodeSchedulingHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; -} - -export interface EnableNodeSchedulingQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; -} - -export interface EnableNodeSchedulingQueryParam { - queryParameters?: EnableNodeSchedulingQueryParamProperties; -} - -export interface EnableNodeSchedulingHeaderParam { - headers?: RawHttpHeadersInput & EnableNodeSchedulingHeaders; -} - -export type EnableNodeSchedulingParameters = EnableNodeSchedulingQueryParam & - EnableNodeSchedulingHeaderParam & - RequestParameters; - -export interface GetNodeRemoteLoginSettingsHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; -} - -export interface GetNodeRemoteLoginSettingsQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; -} - -export interface GetNodeRemoteLoginSettingsQueryParam { - queryParameters?: GetNodeRemoteLoginSettingsQueryParamProperties; -} - -export interface GetNodeRemoteLoginSettingsHeaderParam { - headers?: RawHttpHeadersInput & GetNodeRemoteLoginSettingsHeaders; -} - -export type GetNodeRemoteLoginSettingsParameters = - GetNodeRemoteLoginSettingsQueryParam & - GetNodeRemoteLoginSettingsHeaderParam & - RequestParameters; - -export interface UploadNodeLogsHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; -} - -export interface UploadNodeLogsBodyParam { - /** The Azure Batch service log files upload options. */ - body: UploadBatchServiceLogsContent; -} - -export interface UploadNodeLogsQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; -} - -export interface UploadNodeLogsQueryParam { - queryParameters?: UploadNodeLogsQueryParamProperties; -} - -export interface UploadNodeLogsHeaderParam { - headers?: RawHttpHeadersInput & UploadNodeLogsHeaders; -} - -export interface UploadNodeLogsMediaTypesParam { - /** Type of content */ - contentType: "application/json; odata=minimalmetadata"; -} - -export type UploadNodeLogsParameters = UploadNodeLogsQueryParam & - UploadNodeLogsHeaderParam & - UploadNodeLogsMediaTypesParam & - UploadNodeLogsBodyParam & - RequestParameters; - -export interface ListNodesHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; -} - -export interface ListNodesQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; - /** - * The maximum number of items to return in the response. A maximum of 1000 - * applications can be returned. - */ - maxresults?: number; - /** - * An OData $filter clause. For more information on constructing this filter, see - * https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-nodes-in-a-pool. - */ - $filter?: string; - /** An OData $select clause. */ - $select?: string[]; -} - -export interface ListNodesQueryParam { - queryParameters?: ListNodesQueryParamProperties; -} - -export interface ListNodesHeaderParam { - headers?: RawHttpHeadersInput & ListNodesHeaders; -} - -export type ListNodesParameters = ListNodesQueryParam & - ListNodesHeaderParam & - RequestParameters; - -export interface GetNodeExtensionHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; -} - -export interface GetNodeExtensionQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; - /** An OData $select clause. */ - $select?: string[]; -} - -export interface GetNodeExtensionQueryParam { - queryParameters?: GetNodeExtensionQueryParamProperties; -} - -export interface GetNodeExtensionHeaderParam { - headers?: RawHttpHeadersInput & GetNodeExtensionHeaders; -} - -export type GetNodeExtensionParameters = GetNodeExtensionQueryParam & - GetNodeExtensionHeaderParam & - RequestParameters; - -export interface ListNodeExtensionsHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; -} - -export interface ListNodeExtensionsQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; - /** - * The maximum number of items to return in the response. A maximum of 1000 - * applications can be returned. - */ - maxresults?: number; - /** An OData $select clause. */ - $select?: string[]; -} - -export interface ListNodeExtensionsQueryParam { - queryParameters?: ListNodeExtensionsQueryParamProperties; -} - -export interface ListNodeExtensionsHeaderParam { - headers?: RawHttpHeadersInput & ListNodeExtensionsHeaders; -} - -export type ListNodeExtensionsParameters = ListNodeExtensionsQueryParam & - ListNodeExtensionsHeaderParam & - RequestParameters; - -export interface DeleteNodeFileHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; -} - -export interface DeleteNodeFileQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; - /** - * Whether to delete children of a directory. If the filePath parameter represents - * a directory instead of a file, you can set recursive to true to delete the - * directory and all of the files and subdirectories in it. If recursive is false - * then the directory must be empty or deletion will fail. - */ - recursive?: boolean; -} - -export interface DeleteNodeFileQueryParam { - queryParameters?: DeleteNodeFileQueryParamProperties; -} - -export interface DeleteNodeFileHeaderParam { - headers?: RawHttpHeadersInput & DeleteNodeFileHeaders; -} - -export type DeleteNodeFileParameters = DeleteNodeFileQueryParam & - DeleteNodeFileHeaderParam & - RequestParameters; - -export interface GetNodeFileHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * been modified since the specified time. - */ - "If-Modified-Since"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * not been modified since the specified time. - */ - "If-Unmodified-Since"?: string; - /** - * The byte range to be retrieved. The default is to retrieve the entire file. The - * format is bytes=startRange-endRange. - */ - "ocp-range"?: string; -} - -export interface GetNodeFileQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; -} - -export interface GetNodeFileQueryParam { - queryParameters?: GetNodeFileQueryParamProperties; -} - -export interface GetNodeFileHeaderParam { - headers?: RawHttpHeadersInput & GetNodeFileHeaders; -} - -export type GetNodeFileParameters = GetNodeFileQueryParam & - GetNodeFileHeaderParam & - RequestParameters; - -export interface GetNodeFilePropertiesHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * been modified since the specified time. - */ - "If-Modified-Since"?: string; - /** - * A timestamp indicating the last modified time of the resource known to the - * client. The operation will be performed only if the resource on the service has - * not been modified since the specified time. - */ - "If-Unmodified-Since"?: string; -} - -export interface GetNodeFilePropertiesQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; -} - -export interface GetNodeFilePropertiesQueryParam { - queryParameters?: GetNodeFilePropertiesQueryParamProperties; -} - -export interface GetNodeFilePropertiesHeaderParam { - headers?: RawHttpHeadersInput & GetNodeFilePropertiesHeaders; -} - -export type GetNodeFilePropertiesParameters = GetNodeFilePropertiesQueryParam & - GetNodeFilePropertiesHeaderParam & - RequestParameters; - -export interface ListNodeFilesHeaders { - /** - * The caller-generated request identity, in the form of a GUID with no decoration - * such as curly braces, e.g. 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. - */ - "client-request-id"?: string; - /** Whether the server should return the client-request-id in the response. */ - "return-client-request-id"?: boolean; - /** - * The time the request was issued. Client libraries typically set this to the - * current system clock time; set it explicitly if you are calling the REST API - * directly. - */ - "ocp-date"?: string; -} - -export interface ListNodeFilesQueryParamProperties { - /** The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. If the value is larger than 30, the default will be used instead.". */ - timeOut?: number; - /** - * The maximum number of items to return in the response. A maximum of 1000 - * applications can be returned. - */ - maxresults?: number; - /** - * An OData $filter clause. For more information on constructing this filter, see - * https://docs.microsoft.com/en-us/rest/api/batchservice/odata-filters-in-batch#list-compute-node-files. - */ - $filter?: string; - /** Whether to list children of a directory. */ - recursive?: boolean; -} - -export interface ListNodeFilesQueryParam { - queryParameters?: ListNodeFilesQueryParamProperties; -} - -export interface ListNodeFilesHeaderParam { - headers?: RawHttpHeadersInput & ListNodeFilesHeaders; -} - -export type ListNodeFilesParameters = ListNodeFilesQueryParam & - ListNodeFilesHeaderParam & - RequestParameters; diff --git a/sdk/batch/batch-rest/generated/responses.ts b/sdk/batch/batch-rest/generated/responses.ts deleted file mode 100644 index 063e5a51c61f..000000000000 --- a/sdk/batch/batch-rest/generated/responses.ts +++ /dev/null @@ -1,1673 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { RawHttpHeaders } from "@azure/core-rest-pipeline"; -import { HttpResponse } from "@azure-rest/core-client"; -import { - BatchApplicationListResultOutput, - BatchErrorOutput, - BatchApplicationOutput, - BatchPoolListUsageMetricsResultOutput, - BatchPoolListResultOutput, - BatchPoolOutput, - AutoScaleRunOutput, - BatchAccountListSupportedImagesResultOutput, - BatchPoolNodeCountsListResultOutput, - BatchJobOutput, - BatchJobListResultOutput, - BatchJobPreparationAndReleaseTaskStatusListResultOutput, - BatchTaskCountsResultOutput, - BatchJobScheduleOutput, - BatchJobScheduleListResultOutput, - BatchTaskListResultOutput, - BatchTaskAddCollectionResultOutput, - BatchTaskOutput, - BatchTaskListSubtasksResultOutput, - BatchNodeFileListResultOutput, - BatchNodeOutput, - BatchNodeRemoteLoginSettingsOutput, - UploadBatchServiceLogsResultOutput, - BatchNodeListResultOutput, - BatchNodeVMExtensionOutput, - BatchNodeVMExtensionListResultOutput, -} from "./outputModels.js"; - -export interface ListApplications200Headers { - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded. */ -export interface ListApplications200Response extends HttpResponse { - status: "200"; - body: BatchApplicationListResultOutput; - headers: RawHttpHeaders & ListApplications200Headers; -} - -export interface ListApplicationsDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface GetApplication200Headers { - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded. */ -export interface GetApplication200Response extends HttpResponse { - status: "200"; - body: BatchApplicationOutput; - headers: RawHttpHeaders & GetApplication200Headers; -} - -export interface GetApplicationDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface ListPoolUsageMetrics200Headers { - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded. */ -export interface ListPoolUsageMetrics200Response extends HttpResponse { - status: "200"; - body: BatchPoolListUsageMetricsResultOutput; - headers: RawHttpHeaders & ListPoolUsageMetrics200Headers; -} - -export interface ListPoolUsageMetricsDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface CreatePool201Headers { - /** The OData ID of the resource to which the request applied. */ - dataserviceid: string; - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded and a new resource has been created as a result. */ -export interface CreatePool201Response extends HttpResponse { - status: "201"; - headers: RawHttpHeaders & CreatePool201Headers; -} - -export interface CreatePoolDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface ListPools200Headers { - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded. */ -export interface ListPools200Response extends HttpResponse { - status: "200"; - body: BatchPoolListResultOutput; - headers: RawHttpHeaders & ListPools200Headers; -} - -export interface ListPoolsDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface DeletePool202Headers { - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has been accepted for processing, but processing has not yet completed. */ -export interface DeletePool202Response extends HttpResponse { - status: "202"; - headers: RawHttpHeaders & DeletePool202Headers; -} - -export interface DeletePoolDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface PoolExists200Headers { - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded. */ -export interface PoolExists200Response extends HttpResponse { - status: "200"; - headers: RawHttpHeaders & PoolExists200Headers; -} - -/** The server cannot find the requested resource. */ -export interface PoolExists404Response extends HttpResponse { - status: "404"; -} - -export interface PoolExistsDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface GetPool200Headers { - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded. */ -export interface GetPool200Response extends HttpResponse { - status: "200"; - body: BatchPoolOutput; - headers: RawHttpHeaders & GetPool200Headers; -} - -export interface GetPoolDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface UpdatePool200Headers { - /** The OData ID of the resource to which the request applied. */ - dataserviceid: string; - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded. */ -export interface UpdatePool200Response extends HttpResponse { - status: "200"; - headers: RawHttpHeaders & UpdatePool200Headers; -} - -export interface UpdatePoolDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface DisablePoolAutoScale200Headers { - /** The OData ID of the resource to which the request applied. */ - dataserviceid: string; - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded. */ -export interface DisablePoolAutoScale200Response extends HttpResponse { - status: "200"; - headers: RawHttpHeaders & DisablePoolAutoScale200Headers; -} - -export interface DisablePoolAutoScaleDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface EnablePoolAutoScale200Headers { - /** The OData ID of the resource to which the request applied. */ - dataserviceid: string; - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded. */ -export interface EnablePoolAutoScale200Response extends HttpResponse { - status: "200"; - headers: RawHttpHeaders & EnablePoolAutoScale200Headers; -} - -export interface EnablePoolAutoScaleDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface EvaluatePoolAutoScale200Headers { - /** The OData ID of the resource to which the request applied. */ - dataserviceid: string; - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded. */ -export interface EvaluatePoolAutoScale200Response extends HttpResponse { - status: "200"; - body: AutoScaleRunOutput; - headers: RawHttpHeaders & EvaluatePoolAutoScale200Headers; -} - -export interface EvaluatePoolAutoScaleDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface ResizePool202Headers { - /** The OData ID of the resource to which the request applied. */ - dataserviceid: string; - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has been accepted for processing, but processing has not yet completed. */ -export interface ResizePool202Response extends HttpResponse { - status: "202"; - headers: RawHttpHeaders & ResizePool202Headers; -} - -export interface ResizePoolDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface StopPoolResize202Headers { - /** The OData ID of the resource to which the request applied. */ - dataserviceid: string; - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has been accepted for processing, but processing has not yet completed. */ -export interface StopPoolResize202Response extends HttpResponse { - status: "202"; - headers: RawHttpHeaders & StopPoolResize202Headers; -} - -export interface StopPoolResizeDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface ReplacePoolProperties204Headers { - /** The OData ID of the resource to which the request applied. */ - dataserviceid: string; - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** There is no content to send for this request, but the headers may be useful. */ -export interface ReplacePoolProperties204Response extends HttpResponse { - status: "204"; - headers: RawHttpHeaders & ReplacePoolProperties204Headers; -} - -export interface ReplacePoolPropertiesDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface RemoveNodes202Headers { - /** The OData ID of the resource to which the request applied. */ - dataserviceid: string; - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has been accepted for processing, but processing has not yet completed. */ -export interface RemoveNodes202Response extends HttpResponse { - status: "202"; - headers: RawHttpHeaders & RemoveNodes202Headers; -} - -export interface RemoveNodesDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface ListSupportedImages200Headers { - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded. */ -export interface ListSupportedImages200Response extends HttpResponse { - status: "200"; - body: BatchAccountListSupportedImagesResultOutput; - headers: RawHttpHeaders & ListSupportedImages200Headers; -} - -export interface ListSupportedImagesDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface ListPoolNodeCounts200Headers { - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded. */ -export interface ListPoolNodeCounts200Response extends HttpResponse { - status: "200"; - body: BatchPoolNodeCountsListResultOutput; - headers: RawHttpHeaders & ListPoolNodeCounts200Headers; -} - -export interface ListPoolNodeCountsDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface DeleteJob202Headers { - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has been accepted for processing, but processing has not yet completed. */ -export interface DeleteJob202Response extends HttpResponse { - status: "202"; - headers: RawHttpHeaders & DeleteJob202Headers; -} - -export interface DeleteJobDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface GetJob200Headers { - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded. */ -export interface GetJob200Response extends HttpResponse { - status: "200"; - body: BatchJobOutput; - headers: RawHttpHeaders & GetJob200Headers; -} - -export interface GetJobDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface UpdateJob200Headers { - /** The OData ID of the resource to which the request applied. */ - dataserviceid: string; - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded. */ -export interface UpdateJob200Response extends HttpResponse { - status: "200"; - headers: RawHttpHeaders & UpdateJob200Headers; -} - -export interface UpdateJobDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface ReplaceJob200Headers { - /** The OData ID of the resource to which the request applied. */ - dataserviceid: string; - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded. */ -export interface ReplaceJob200Response extends HttpResponse { - status: "200"; - headers: RawHttpHeaders & ReplaceJob200Headers; -} - -export interface ReplaceJobDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface DisableJob202Headers { - /** The OData ID of the resource to which the request applied. */ - dataserviceid: string; - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has been accepted for processing, but processing has not yet completed. */ -export interface DisableJob202Response extends HttpResponse { - status: "202"; - headers: RawHttpHeaders & DisableJob202Headers; -} - -export interface DisableJobDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface EnableJob202Headers { - /** The OData ID of the resource to which the request applied. */ - dataserviceid: string; - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has been accepted for processing, but processing has not yet completed. */ -export interface EnableJob202Response extends HttpResponse { - status: "202"; - headers: RawHttpHeaders & EnableJob202Headers; -} - -export interface EnableJobDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface TerminateJob202Headers { - /** The OData ID of the resource to which the request applied. */ - dataserviceid: string; - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has been accepted for processing, but processing has not yet completed. */ -export interface TerminateJob202Response extends HttpResponse { - status: "202"; - headers: RawHttpHeaders & TerminateJob202Headers; -} - -export interface TerminateJobDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface CreateJob201Headers { - /** The OData ID of the resource to which the request applied. */ - dataserviceid: string; - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded and a new resource has been created as a result. */ -export interface CreateJob201Response extends HttpResponse { - status: "201"; - headers: RawHttpHeaders & CreateJob201Headers; -} - -export interface CreateJobDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface ListJobs200Headers { - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded. */ -export interface ListJobs200Response extends HttpResponse { - status: "200"; - body: BatchJobListResultOutput; - headers: RawHttpHeaders & ListJobs200Headers; -} - -export interface ListJobsDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface ListJobsFromSchedule200Headers { - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded. */ -export interface ListJobsFromSchedule200Response extends HttpResponse { - status: "200"; - body: BatchJobListResultOutput; - headers: RawHttpHeaders & ListJobsFromSchedule200Headers; -} - -export interface ListJobsFromScheduleDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface ListJobPreparationAndReleaseTaskStatus200Headers { - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded. */ -export interface ListJobPreparationAndReleaseTaskStatus200Response - extends HttpResponse { - status: "200"; - body: BatchJobPreparationAndReleaseTaskStatusListResultOutput; - headers: RawHttpHeaders & ListJobPreparationAndReleaseTaskStatus200Headers; -} - -export interface ListJobPreparationAndReleaseTaskStatusDefaultResponse - extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface GetJobTaskCounts200Headers { - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded. */ -export interface GetJobTaskCounts200Response extends HttpResponse { - status: "200"; - body: BatchTaskCountsResultOutput; - headers: RawHttpHeaders & GetJobTaskCounts200Headers; -} - -export interface GetJobTaskCountsDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface JobScheduleExists200Headers { - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded. */ -export interface JobScheduleExists200Response extends HttpResponse { - status: "200"; - headers: RawHttpHeaders & JobScheduleExists200Headers; -} - -/** The server cannot find the requested resource. */ -export interface JobScheduleExists404Response extends HttpResponse { - status: "404"; -} - -export interface JobScheduleExistsDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface DeleteJobSchedule202Headers { - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has been accepted for processing, but processing has not yet completed. */ -export interface DeleteJobSchedule202Response extends HttpResponse { - status: "202"; - headers: RawHttpHeaders & DeleteJobSchedule202Headers; -} - -export interface DeleteJobScheduleDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface GetJobSchedule200Headers { - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded. */ -export interface GetJobSchedule200Response extends HttpResponse { - status: "200"; - body: BatchJobScheduleOutput; - headers: RawHttpHeaders & GetJobSchedule200Headers; -} - -export interface GetJobScheduleDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface UpdateJobSchedule200Headers { - /** The OData ID of the resource to which the request applied. */ - dataserviceid: string; - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded. */ -export interface UpdateJobSchedule200Response extends HttpResponse { - status: "200"; - headers: RawHttpHeaders & UpdateJobSchedule200Headers; -} - -export interface UpdateJobScheduleDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface ReplaceJobSchedule200Headers { - /** The OData ID of the resource to which the request applied. */ - dataserviceid: string; - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded. */ -export interface ReplaceJobSchedule200Response extends HttpResponse { - status: "200"; - headers: RawHttpHeaders & ReplaceJobSchedule200Headers; -} - -export interface ReplaceJobScheduleDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface DisableJobSchedule204Headers { - /** The OData ID of the resource to which the request applied. */ - dataserviceid: string; - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** There is no content to send for this request, but the headers may be useful. */ -export interface DisableJobSchedule204Response extends HttpResponse { - status: "204"; - headers: RawHttpHeaders & DisableJobSchedule204Headers; -} - -export interface DisableJobScheduleDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface EnableJobSchedule204Headers { - /** The OData ID of the resource to which the request applied. */ - dataserviceid: string; - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** There is no content to send for this request, but the headers may be useful. */ -export interface EnableJobSchedule204Response extends HttpResponse { - status: "204"; - headers: RawHttpHeaders & EnableJobSchedule204Headers; -} - -export interface EnableJobScheduleDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface TerminateJobSchedule202Headers { - /** The OData ID of the resource to which the request applied. */ - dataserviceid: string; - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has been accepted for processing, but processing has not yet completed. */ -export interface TerminateJobSchedule202Response extends HttpResponse { - status: "202"; - headers: RawHttpHeaders & TerminateJobSchedule202Headers; -} - -export interface TerminateJobScheduleDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface CreateJobSchedule201Headers { - /** The OData ID of the resource to which the request applied. */ - dataserviceid: string; - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded and a new resource has been created as a result. */ -export interface CreateJobSchedule201Response extends HttpResponse { - status: "201"; - headers: RawHttpHeaders & CreateJobSchedule201Headers; -} - -export interface CreateJobScheduleDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface ListJobSchedules200Headers { - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded. */ -export interface ListJobSchedules200Response extends HttpResponse { - status: "200"; - body: BatchJobScheduleListResultOutput; - headers: RawHttpHeaders & ListJobSchedules200Headers; -} - -export interface ListJobSchedulesDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface CreateTask201Headers { - /** The OData ID of the resource to which the request applied. */ - dataserviceid: string; - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded and a new resource has been created as a result. */ -export interface CreateTask201Response extends HttpResponse { - status: "201"; - headers: RawHttpHeaders & CreateTask201Headers; -} - -export interface CreateTaskDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface ListTasks200Headers { - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded. */ -export interface ListTasks200Response extends HttpResponse { - status: "200"; - body: BatchTaskListResultOutput; - headers: RawHttpHeaders & ListTasks200Headers; -} - -export interface ListTasksDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface CreateTaskCollection200Headers { - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded. */ -export interface CreateTaskCollection200Response extends HttpResponse { - status: "200"; - body: BatchTaskAddCollectionResultOutput; - headers: RawHttpHeaders & CreateTaskCollection200Headers; -} - -export interface CreateTaskCollectionDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface DeleteTask200Headers { - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded. */ -export interface DeleteTask200Response extends HttpResponse { - status: "200"; - headers: RawHttpHeaders & DeleteTask200Headers; -} - -export interface DeleteTaskDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface GetTask200Headers { - /** The OData ID of the resource to which the request applied. */ - dataserviceid: string; - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded. */ -export interface GetTask200Response extends HttpResponse { - status: "200"; - body: BatchTaskOutput; - headers: RawHttpHeaders & GetTask200Headers; -} - -export interface GetTaskDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface ReplaceTask200Headers { - /** The OData ID of the resource to which the request applied. */ - dataserviceid: string; - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded. */ -export interface ReplaceTask200Response extends HttpResponse { - status: "200"; - headers: RawHttpHeaders & ReplaceTask200Headers; -} - -export interface ReplaceTaskDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface ListSubTasks200Headers { - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded. */ -export interface ListSubTasks200Response extends HttpResponse { - status: "200"; - body: BatchTaskListSubtasksResultOutput; - headers: RawHttpHeaders & ListSubTasks200Headers; -} - -export interface ListSubTasksDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface TerminateTask204Headers { - /** The OData ID of the resource to which the request applied. */ - dataserviceid: string; - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** There is no content to send for this request, but the headers may be useful. */ -export interface TerminateTask204Response extends HttpResponse { - status: "204"; - headers: RawHttpHeaders & TerminateTask204Headers; -} - -export interface TerminateTaskDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface ReactivateTask204Headers { - /** The OData ID of the resource to which the request applied. */ - dataserviceid: string; - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** There is no content to send for this request, but the headers may be useful. */ -export interface ReactivateTask204Response extends HttpResponse { - status: "204"; - headers: RawHttpHeaders & ReactivateTask204Headers; -} - -export interface ReactivateTaskDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface DeleteTaskFile200Headers { - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded. */ -export interface DeleteTaskFile200Response extends HttpResponse { - status: "200"; - headers: RawHttpHeaders & DeleteTaskFile200Headers; -} - -export interface DeleteTaskFileDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface GetTaskFile200Headers { - /** The length of the file. */ - "content-length": string; - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** Whether the object represents a directory. */ - "ocp-batch-file-isdirectory": boolean; - /** The file mode attribute in octal format. */ - "ocp-batch-file-mode": string; - /** The URL of the file. */ - "ocp-batch-file-url": string; - /** The file creation time. */ - "ocp-creation-time"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; - /** Type of content */ - "content-type": "application/octet-stream"; -} - -/** The request has succeeded. */ -export interface GetTaskFile200Response extends HttpResponse { - status: "200"; - /** Value may contain any sequence of octets */ - body: Uint8Array; - headers: RawHttpHeaders & GetTaskFile200Headers; -} - -export interface GetTaskFileDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface GetTaskFileProperties200Headers { - /** The length of the file. */ - "content-length": string; - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** Whether the object represents a directory. */ - "ocp-batch-file-isdirectory": boolean; - /** The file mode attribute in octal format. */ - "ocp-batch-file-mode": string; - /** The URL of the file. */ - "ocp-batch-file-url": string; - /** The file creation time. */ - "ocp-creation-time"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded. */ -export interface GetTaskFileProperties200Response extends HttpResponse { - status: "200"; - headers: RawHttpHeaders & GetTaskFileProperties200Headers; -} - -export interface GetTaskFilePropertiesDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface ListTaskFiles200Headers { - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded. */ -export interface ListTaskFiles200Response extends HttpResponse { - status: "200"; - body: BatchNodeFileListResultOutput; - headers: RawHttpHeaders & ListTaskFiles200Headers; -} - -export interface ListTaskFilesDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface CreateNodeUser201Headers { - /** The OData ID of the resource to which the request applied. */ - dataserviceid: string; - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded and a new resource has been created as a result. */ -export interface CreateNodeUser201Response extends HttpResponse { - status: "201"; - headers: RawHttpHeaders & CreateNodeUser201Headers; -} - -export interface CreateNodeUserDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface DeleteNodeUser200Headers { - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded. */ -export interface DeleteNodeUser200Response extends HttpResponse { - status: "200"; - headers: RawHttpHeaders & DeleteNodeUser200Headers; -} - -export interface DeleteNodeUserDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface ReplaceNodeUser200Headers { - /** The OData ID of the resource to which the request applied. */ - dataserviceid: string; - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded. */ -export interface ReplaceNodeUser200Response extends HttpResponse { - status: "200"; - headers: RawHttpHeaders & ReplaceNodeUser200Headers; -} - -export interface ReplaceNodeUserDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface GetNode200Headers { - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded. */ -export interface GetNode200Response extends HttpResponse { - status: "200"; - body: BatchNodeOutput; - headers: RawHttpHeaders & GetNode200Headers; -} - -export interface GetNodeDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface RebootNode202Headers { - /** The OData ID of the resource to which the request applied. */ - dataserviceid: string; - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has been accepted for processing, but processing has not yet completed. */ -export interface RebootNode202Response extends HttpResponse { - status: "202"; - headers: RawHttpHeaders & RebootNode202Headers; -} - -export interface RebootNodeDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface DisableNodeScheduling200Headers { - /** The OData ID of the resource to which the request applied. */ - dataserviceid: string; - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded. */ -export interface DisableNodeScheduling200Response extends HttpResponse { - status: "200"; - headers: RawHttpHeaders & DisableNodeScheduling200Headers; -} - -export interface DisableNodeSchedulingDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface EnableNodeScheduling200Headers { - /** The OData ID of the resource to which the request applied. */ - dataserviceid: string; - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded. */ -export interface EnableNodeScheduling200Response extends HttpResponse { - status: "200"; - headers: RawHttpHeaders & EnableNodeScheduling200Headers; -} - -export interface EnableNodeSchedulingDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface GetNodeRemoteLoginSettings200Headers { - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded. */ -export interface GetNodeRemoteLoginSettings200Response extends HttpResponse { - status: "200"; - body: BatchNodeRemoteLoginSettingsOutput; - headers: RawHttpHeaders & GetNodeRemoteLoginSettings200Headers; -} - -export interface GetNodeRemoteLoginSettingsDefaultResponse - extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface UploadNodeLogs200Headers { - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded. */ -export interface UploadNodeLogs200Response extends HttpResponse { - status: "200"; - body: UploadBatchServiceLogsResultOutput; - headers: RawHttpHeaders & UploadNodeLogs200Headers; -} - -export interface UploadNodeLogsDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface ListNodes200Headers { - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded. */ -export interface ListNodes200Response extends HttpResponse { - status: "200"; - body: BatchNodeListResultOutput; - headers: RawHttpHeaders & ListNodes200Headers; -} - -export interface ListNodesDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface GetNodeExtension200Headers { - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded. */ -export interface GetNodeExtension200Response extends HttpResponse { - status: "200"; - body: BatchNodeVMExtensionOutput; - headers: RawHttpHeaders & GetNodeExtension200Headers; -} - -export interface GetNodeExtensionDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface ListNodeExtensions200Headers { - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded. */ -export interface ListNodeExtensions200Response extends HttpResponse { - status: "200"; - body: BatchNodeVMExtensionListResultOutput; - headers: RawHttpHeaders & ListNodeExtensions200Headers; -} - -export interface ListNodeExtensionsDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface DeleteNodeFile200Headers { - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded. */ -export interface DeleteNodeFile200Response extends HttpResponse { - status: "200"; - headers: RawHttpHeaders & DeleteNodeFile200Headers; -} - -export interface DeleteNodeFileDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface GetNodeFile200Headers { - /** The length of the file. */ - "content-length": string; - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** Whether the object represents a directory. */ - "ocp-batch-file-isdirectory": boolean; - /** The file mode attribute in octal format. */ - "ocp-batch-file-mode": string; - /** The URL of the file. */ - "ocp-batch-file-url": string; - /** The file creation time. */ - "ocp-creation-time"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; - /** Type of content */ - "content-type": "application/octet-stream"; -} - -/** The request has succeeded. */ -export interface GetNodeFile200Response extends HttpResponse { - status: "200"; - /** Value may contain any sequence of octets */ - body: Uint8Array; - headers: RawHttpHeaders & GetNodeFile200Headers; -} - -export interface GetNodeFileDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface GetNodeFileProperties200Headers { - /** The length of the file. */ - "content-length": string; - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** Whether the object represents a directory. */ - "ocp-batch-file-isdirectory": boolean; - /** The file mode attribute in octal format. */ - "ocp-batch-file-mode": string; - /** The URL of the file. */ - "ocp-batch-file-url": string; - /** The file creation time. */ - "ocp-creation-time"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded. */ -export interface GetNodeFileProperties200Response extends HttpResponse { - status: "200"; - headers: RawHttpHeaders & GetNodeFileProperties200Headers; -} - -export interface GetNodeFilePropertiesDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface ListNodeFiles200Headers { - /** 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-Modified-Since, If-Unmodified-Since, If-Match or If-None-Match headers. */ - etag?: string; - /** The time at which the resource was last modified. */ - "last-modified"?: string; - /** The client-request-id provided by the client during the request. This will be returned only if the return-client-request-id parameter was set to true. */ - "client-request-id"?: string; - /** A unique identifier for the request that was made to the Batch service. If a request is consistently failing and you have verified that the request is properly formulated, you may use this value to report the error to Microsoft. In your report, include the value of this request ID, the approximate time that the request was made, the Batch Account against which the request was made, and the region that Account resides in. */ - "request-id"?: string; -} - -/** The request has succeeded. */ -export interface ListNodeFiles200Response extends HttpResponse { - status: "200"; - body: BatchNodeFileListResultOutput; - headers: RawHttpHeaders & ListNodeFiles200Headers; -} - -export interface ListNodeFilesDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} diff --git a/sdk/batch/batch-rest/package.json b/sdk/batch/batch-rest/package.json index d6023626dfc3..fba2535587e5 100644 --- a/sdk/batch/batch-rest/package.json +++ b/sdk/batch/batch-rest/package.json @@ -36,107 +36,102 @@ "files": [ "dist", "README.md", - "LICENSE" + "LICENSE", + "review/*", + "CHANGELOG.md" ], "sdk-type": "client", "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/batch-rest/README.md", - "prettier": "./node_modules/@azure/eslint-plugin-azure-sdk/prettier.json", + "prettier": "@azure/eslint-plugin-azure-sdk/prettier.json", "//metadata": { "constantPaths": [ { "path": "src/batchClient.ts", - "prefix": "package-version" + "prefix": "userAgentInfo" } ] }, - "//sampleConfiguration": { - "productName": "Azure Batch provides Cloud-scale job scheduling and compute management.", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true - }, "dependencies": { - "@azure-rest/core-client": "^1.4.0", + "@azure-rest/core-client": "^2.1.0", "@azure/core-auth": "^1.6.0", - "@azure/core-paging": "^1.5.0", - "@azure/core-rest-pipeline": "^1.16.0", + "@azure/core-rest-pipeline": "^1.5.0", "@azure/logger": "^1.0.0", - "tslib": "^2.6.2" + "tslib": "^2.6.2", + "@azure/core-paging": "^1.5.0" }, "devDependencies": { - "@azure-tools/test-credential": "^1.0.0", - "@azure-tools/test-recorder": "^4.0.0", - "@azure-tools/test-utils": "~1.0.0", - "@azure-tools/vite-plugin-browser-test-map": "~1.0.0", - "@azure/core-util": "^1.0.0", - "@azure/dev-tool": "^1.0.0", - "@azure/eslint-plugin-azure-sdk": "^3.0.0", - "@azure/identity": "^4.0.1", + "dotenv": "^16.0.0", "@microsoft/api-extractor": "^7.40.3", "@types/node": "^18.0.0", - "@vitest/browser": "~1.6.0", - "@vitest/coverage-istanbul": "^1.3.1", - "dotenv": "^16.0.0", - "eslint": "^9.9.0", - "loupe": "~3.1.0", - "mkdirp": "^2.1.2", - "moment": "~2.30.1", - "playwright": "^1.41.2", + "eslint": "^8.55.0", "prettier": "^3.2.5", "rimraf": "^5.0.5", - "typescript": "~5.6.2", - "vitest": "~1.6.0" + "mkdirp": "^3.0.1", + "typescript": "~5.5.3", + "tshy": "^1.11.1", + "@azure/identity": "^4.2.1", + "@vitest/browser": "^2.0.5", + "@vitest/coverage-istanbul": "^2.0.5", + "playwright": "^1.41.2", + "vitest": "^2.0.5", + "@azure-tools/test-credential": "^2.0.0", + "@azure-tools/test-recorder": "^4.0.0", + "@azure/dev-tool": "^1.0.0", + "@azure/eslint-plugin-azure-sdk": "^3.0.0" }, "scripts": { + "clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "extract-api": "rimraf review && mkdirp ./review && dev-tool run extract-api", + "pack": "npm pack 2>&1", + "lint": "eslint package.json api-extractor.json src test", + "lint:fix": "eslint package.json api-extractor.json src test --fix --fix-type [problem,suggestion]", + "unit-test": "npm run unit-test:node && npm run unit-test:browser", + "unit-test:browser": "npm run build:test && dev-tool run test:vitest --browser", + "unit-test:node": "dev-tool run test:vitest", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:browser": "echo skipped", + "integration-test:node": "echo skipped", "audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit", - "build": "npm run clean && dev-tool run build-package && mkdirp ./review && api-extractor run --local", "build:samples": "echo skipped", - "build:test": "npm run clean && dev-tool run build-package && dev-tool run build-test", - "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\"", - "clean": "rimraf --glob dist dist-browser dist-esm dist-test temp types *.tgz *.log", + "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ", "execute:samples": "echo skipped", - "format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\"", + "format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" ", "generate:client": "echo skipped", - "integration-test:browser": "echo skipped", - "integration-test:node": "echo skipped", - "lint": "eslint package.json api-extractor.json src test", - "lint:fix": "eslint package.json api-extractor.json src test --fix --fix-type [problem,suggestion]", - "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", - "pack": "npm pack 2>&1", - "test": "npm run clean && dev-tool run build-package && npm run unit-test:node && dev-tool run bundle && npm run unit-test:browser", "test:browser": "npm run clean && npm run build:test && npm run unit-test:browser && npm run integration-test:browser", - "test:node": "npm run clean && dev-tool run build-package && npm run unit-test:node && npm run integration-test:node", - "unit-test:browser": "npm run build:test && dev-tool run test:vitest --browser", - "unit-test:node": "dev-tool run test:vitest", - "update-snippets": "echo skipped" + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "build:test": "npm run clean && tshy && dev-tool run build-test", + "build": "npm run clean && tshy && mkdirp ./review && dev-tool run extract-api", + "test:node": "npm run clean && tshy && npm run unit-test:node && npm run integration-test:node", + "test": "npm run clean && tshy && npm run unit-test:node && dev-tool run bundle && npm run unit-test:browser && npm run integration-test" }, "exports": { "./package.json": "./package.json", ".": { "browser": { + "source": "./src/index.ts", "types": "./dist/browser/index.d.ts", "default": "./dist/browser/index.js" }, "react-native": { + "source": "./src/index.ts", "types": "./dist/react-native/index.d.ts", "default": "./dist/react-native/index.js" }, "import": { + "source": "./src/index.ts", "types": "./dist/esm/index.d.ts", "default": "./dist/esm/index.js" }, "require": { + "source": "./src/index.ts", "types": "./dist/commonjs/index.d.ts", "default": "./dist/commonjs/index.js" } } }, "main": "./dist/commonjs/index.js", - "types": "./dist/commonjs/index.d.ts", - "module": "./dist/esm/index.js" -} + "types": "./dist/commonjs/index.d.ts" +} \ No newline at end of file diff --git a/sdk/batch/batch-rest/review/batch.api.md b/sdk/batch/batch-rest/review/batch.api.md index c753eff05362..457f460c3d46 100644 --- a/sdk/batch/batch-rest/review/batch.api.md +++ b/sdk/batch/batch-rest/review/batch.api.md @@ -4,13 +4,11 @@ ```ts -import { AzureNamedKeyCredential } from '@azure/core-auth'; import { Client } from '@azure-rest/core-client'; import { ClientOptions } from '@azure-rest/core-client'; import { HttpResponse } from '@azure-rest/core-client'; import { PagedAsyncIterableIterator } from '@azure/core-paging'; import { PathUncheckedResponse } from '@azure-rest/core-client'; -import { PipelinePolicy } from '@azure/core-rest-pipeline'; import { RawHttpHeaders } from '@azure/core-rest-pipeline'; import { RawHttpHeadersInput } from '@azure/core-rest-pipeline'; import { RequestParameters } from '@azure-rest/core-client'; @@ -1583,11 +1581,8 @@ export type ContainerWorkingDirectory = string; // @public export type ContainerWorkingDirectoryOutput = string; -// @public (undocumented) -export function createBatchSharedKeyCredentialsPolicy(credentials: AzureNamedKeyCredential): PipelinePolicy; - // @public -function createClient(endpointParam: string, credentials: TokenCredential | AzureNamedKeyCredential, { apiVersion, ...options }?: BatchClientOptions): BatchClient; +function createClient(endpointParam: string, credentials: TokenCredential, { apiVersion, ...options }?: BatchClientOptions): BatchClient; export default createClient; // @public (undocumented) diff --git a/sdk/batch/batch-rest/sample.env b/sdk/batch/batch-rest/sample.env deleted file mode 100644 index 47cccb3cf4cb..000000000000 --- a/sdk/batch/batch-rest/sample.env +++ /dev/null @@ -1,3 +0,0 @@ -# Environment variable to use in the samples. - -BATCH_ACCOUNT_ENDPOINT= diff --git a/sdk/batch/batch-rest/samples-dev/quick-start.ts b/sdk/batch/batch-rest/samples-dev/quick-start.ts deleted file mode 100644 index 2f98782f9046..000000000000 --- a/sdk/batch/batch-rest/samples-dev/quick-start.ts +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -/** - * @summary Azure Batch quickstart sample - */ - -import createClient, { - BatchClient, - CreateJobParameters, - CreatePoolParameters, - CreateTaskParameters, - isUnexpected, - paginate, -} from "@azure-rest/batch"; -import { DefaultAzureCredential } from "@azure/identity"; - -// Load the .env file if it exists -// eslint-disable-next-line import/no-extraneous-dependencies -import * as dotenv from "dotenv"; -dotenv.config(); - -const batchAccountEndpoint = process.env["BATCH_ACCOUNT_ENDPOINT"] || ""; -const poolName = "samplepool"; -const jobId = "samplejob2"; - -async function main() { - const credentials = new DefaultAzureCredential(); - const client = createClient(batchAccountEndpoint, credentials); - - await createPool(client); - - await createJob(client); - - await submitTasks(client); - - await listTasks(client); - - await waitForTasks(client); - - await cleanup(client); -} - -async function createPool(client: BatchClient) { - const poolParams: CreatePoolParameters = { - body: { - id: poolName, - vmSize: "Standard_D1_v2", - virtualMachineConfiguration: { - nodeAgentSKUId: "batch.node.windows amd64", - imageReference: { - publisher: "microsoftwindowsserver", - offer: "windowsserver", - sku: "2022-datacenter", - }, - }, - networkConfiguration: { - enableAcceleratedNetworking: true, - }, - targetDedicatedNodes: 1, - }, - contentType: "application/json; odata=minimalmetadata", - }; - const result = await client.path("/pools").post(poolParams); - if (isUnexpected(result)) { - console.log(result.body); - throw new Error(`Failed to create pool: ${result.body.message}`); - } - console.log(`Pool ${poolName} created`); -} - -async function createJob(client: BatchClient) { - const jobAddParam: CreateJobParameters = { - body: { - id: jobId, - poolInfo: { poolId: poolName }, - }, - contentType: "application/json; odata=minimalmetadata", - }; - - const result = await client.path("/jobs").post(jobAddParam); - if (isUnexpected(result)) { - throw new Error(`Failed to create job: ${result.body.message}`); - } - console.log(`Job ${jobId} created`); -} - -async function submitTasks(client: BatchClient) { - for (let i = 1; i < 6; i++) { - const addTaskParam: CreateTaskParameters = { - body: { - id: `task${i}`, - commandLine: `cmd /c echo task-${i} > result.txt`, - }, - contentType: "application/json; odata=minimalmetadata", - }; - - const addTaskResult = await client.path("/jobs/{jobId}/tasks", jobId).post(addTaskParam); - if (isUnexpected(addTaskResult)) { - throw new Error(`Failed to add task ${i}: ${addTaskResult.body.message}`); - } - console.log(`Task ${i} added`); - } -} - -async function listTasks(client: BatchClient) { - const result = await client - .path("/jobs/{jobId}/tasks", jobId) - .get({ queryParameters: { maxresults: 1 } }); - if (isUnexpected(result)) { - throw new Error(`Failed to list tasks: ${result.body.message}`); - } - console.log("Tasks first result:", result.body.value?.length); - const taskAsyncIterator = paginate(client, result); - - for await (const task of taskAsyncIterator) { - console.log(`- ${task.id}, state: ${task.state}`); - } -} - -async function waitForTasks(client: BatchClient) { - console.log("Waiting for tasks to complete"); - while (true) { - const result = await client - .path("/jobs/{jobId}/tasks", jobId) - .get({ queryParameters: { maxresults: 1 } }); - if (isUnexpected(result)) { - throw new Error(`Failed to list tasks: ${result.body.message}`); - } - const taskAsyncIterator = paginate(client, result); - let isAllCompleted = true; - for await (const task of taskAsyncIterator) { - if (task.state !== "completed") { - console.log(`- ${task.id}, state: ${task.state}`); - isAllCompleted = false; - break; - } - } - if (isAllCompleted) { - console.log("All tasks completed"); - break; - } - await new Promise((resolve) => setTimeout(resolve, 5000)); - } -} - -async function cleanup(client: BatchClient) { - const result = await client.path("/pools/{poolId}", poolName).delete(); - if (isUnexpected(result)) { - throw new Error(`Failed to delete pool: ${result.body.message}`); - } - console.log(`Pool ${poolName} deleted`); -} - -main().catch(console.error); diff --git a/sdk/batch/batch-rest/samples/v1-beta/javascript/README.md b/sdk/batch/batch-rest/samples/v1-beta/javascript/README.md deleted file mode 100644 index b1999e7347a4..000000000000 --- a/sdk/batch/batch-rest/samples/v1-beta/javascript/README.md +++ /dev/null @@ -1,50 +0,0 @@ -# Azure Batch provides Cloud-scale job scheduling and compute management. client library samples for JavaScript (Beta) - -These sample programs show how to use the JavaScript client libraries for Azure Batch provides Cloud-scale job scheduling and compute management. in some common scenarios. - -| **File Name** | **Description** | -| ----------------------------- | ----------------------------- | -| [quick-start.js][quick-start] | Azure Batch quickstart sample | - -## 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 quick-start.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx cross-env BATCH_ACCOUNT_ENDPOINT="" node quick-start.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[quick-start]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/batch-rest/samples/v1-beta/javascript/quick-start.js -[apiref]: https://docs.microsoft.com/javascript/api/@azure/batch -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/batch/batch-rest/README.md diff --git a/sdk/batch/batch-rest/samples/v1-beta/javascript/package.json b/sdk/batch/batch-rest/samples/v1-beta/javascript/package.json deleted file mode 100644 index dfd4c24d77c2..000000000000 --- a/sdk/batch/batch-rest/samples/v1-beta/javascript/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "@azure-samples/batch-js-beta", - "private": true, - "version": "1.0.0", - "description": "Azure Batch provides Cloud-scale job scheduling and compute management. client library samples for JavaScript (Beta)", - "engines": { - "node": ">=18.0.0" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/batch/batch-rest" - }, - "keywords": [ - "node", - "azure", - "cloud", - "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/batch-rest", - "dependencies": { - "@azure-rest/batch": "next", - "dotenv": "latest", - "@azure/identity": "^4.0.1" - } -} diff --git a/sdk/batch/batch-rest/samples/v1-beta/javascript/quick-start.js b/sdk/batch/batch-rest/samples/v1-beta/javascript/quick-start.js deleted file mode 100644 index 58419a9544a3..000000000000 --- a/sdk/batch/batch-rest/samples/v1-beta/javascript/quick-start.js +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -/** - * @summary Azure Batch quickstart sample - */ - -const createClient = require("@azure-rest/batch").default, - { isUnexpected, paginate } = require("@azure-rest/batch"); -const { DefaultAzureCredential } = require("@azure/identity"); - -// Load the .env file if it exists -// eslint-disable-next-line import/no-extraneous-dependencies -require("dotenv").config(); - -const batchAccountEndpoint = process.env["BATCH_ACCOUNT_ENDPOINT"] || ""; -const poolName = "samplepool"; -const jobId = "samplejob2"; - -async function main() { - const credentials = new DefaultAzureCredential(); - const client = createClient(batchAccountEndpoint, credentials); - - await createPool(client); - - await createJob(client); - - await submitTasks(client); - - await listTasks(client); - - await waitForTasks(client); - - await cleanup(client); -} - -async function createPool(client) { - const poolParams = { - body: { - id: poolName, - vmSize: "Standard_D1_v2", - virtualMachineConfiguration: { - nodeAgentSKUId: "batch.node.windows amd64", - imageReference: { - publisher: "microsoftwindowsserver", - offer: "windowsserver", - sku: "2022-datacenter", - }, - }, - networkConfiguration: { - enableAcceleratedNetworking: true, - }, - targetDedicatedNodes: 1, - }, - contentType: "application/json; odata=minimalmetadata", - }; - const result = await client.path("/pools").post(poolParams); - if (isUnexpected(result)) { - console.log(result.body); - throw new Error(`Failed to create pool: ${result.body.message}`); - } - console.log(`Pool ${poolName} created`); -} - -async function createJob(client) { - const jobAddParam = { - body: { - id: jobId, - poolInfo: { poolId: poolName }, - }, - contentType: "application/json; odata=minimalmetadata", - }; - - const result = await client.path("/jobs").post(jobAddParam); - if (isUnexpected(result)) { - throw new Error(`Failed to create job: ${result.body.message}`); - } - console.log(`Job ${jobId} created`); -} - -async function submitTasks(client) { - for (let i = 1; i < 6; i++) { - const addTaskParam = { - body: { - id: `task${i}`, - commandLine: `cmd /c echo task-${i} > result.txt`, - }, - contentType: "application/json; odata=minimalmetadata", - }; - - const addTaskResult = await client.path("/jobs/{jobId}/tasks", jobId).post(addTaskParam); - if (isUnexpected(addTaskResult)) { - throw new Error(`Failed to add task ${i}: ${addTaskResult.body.message}`); - } - console.log(`Task ${i} added`); - } -} - -async function listTasks(client) { - const result = await client - .path("/jobs/{jobId}/tasks", jobId) - .get({ queryParameters: { maxresults: 1 } }); - if (isUnexpected(result)) { - throw new Error(`Failed to list tasks: ${result.body.message}`); - } - console.log("Tasks first result:", result.body.value?.length); - const taskAsyncIterator = paginate(client, result); - - for await (const task of taskAsyncIterator) { - console.log(`- ${task.id}, state: ${task.state}`); - } -} - -async function waitForTasks(client) { - console.log("Waiting for tasks to complete"); - while (true) { - const result = await client - .path("/jobs/{jobId}/tasks", jobId) - .get({ queryParameters: { maxresults: 1 } }); - if (isUnexpected(result)) { - throw new Error(`Failed to list tasks: ${result.body.message}`); - } - const taskAsyncIterator = paginate(client, result); - let isAllCompleted = true; - for await (const task of taskAsyncIterator) { - if (task.state !== "completed") { - console.log(`- ${task.id}, state: ${task.state}`); - isAllCompleted = false; - break; - } - } - if (isAllCompleted) { - console.log("All tasks completed"); - break; - } - await new Promise((resolve) => setTimeout(resolve, 5000)); - } -} - -async function cleanup(client) { - const result = await client.path("/pools/{poolId}", poolName).delete(); - if (isUnexpected(result)) { - throw new Error(`Failed to delete pool: ${result.body.message}`); - } - console.log(`Pool ${poolName} deleted`); -} - -main().catch(console.error); diff --git a/sdk/batch/batch-rest/samples/v1-beta/javascript/sample.env b/sdk/batch/batch-rest/samples/v1-beta/javascript/sample.env deleted file mode 100644 index 47cccb3cf4cb..000000000000 --- a/sdk/batch/batch-rest/samples/v1-beta/javascript/sample.env +++ /dev/null @@ -1,3 +0,0 @@ -# Environment variable to use in the samples. - -BATCH_ACCOUNT_ENDPOINT= diff --git a/sdk/batch/batch-rest/samples/v1-beta/typescript/README.md b/sdk/batch/batch-rest/samples/v1-beta/typescript/README.md deleted file mode 100644 index cb6e157643c3..000000000000 --- a/sdk/batch/batch-rest/samples/v1-beta/typescript/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# Azure Batch provides Cloud-scale job scheduling and compute management. client library samples for TypeScript (Beta) - -These sample programs show how to use the TypeScript client libraries for Azure Batch provides Cloud-scale job scheduling and compute management. in some common scenarios. - -| **File Name** | **Description** | -| ----------------------------- | ----------------------------- | -| [quick-start.ts][quick-start] | Azure Batch quickstart sample | - -## 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/quick-start.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx cross-env BATCH_ACCOUNT_ENDPOINT="" node dist/quick-start.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[quick-start]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/batch/batch-rest/samples/v1-beta/typescript/src/quick-start.ts -[apiref]: https://docs.microsoft.com/javascript/api/@azure/batch -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/batch/batch-rest/README.md -[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/batch/batch-rest/samples/v1-beta/typescript/package.json b/sdk/batch/batch-rest/samples/v1-beta/typescript/package.json deleted file mode 100644 index dea4c898a680..000000000000 --- a/sdk/batch/batch-rest/samples/v1-beta/typescript/package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "@azure-samples/batch-ts-beta", - "private": true, - "version": "1.0.0", - "description": "Azure Batch provides Cloud-scale job scheduling and compute management. client library samples for TypeScript (Beta)", - "engines": { - "node": ">=18.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/batch-rest" - }, - "keywords": [ - "node", - "azure", - "cloud", - "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/batch-rest", - "dependencies": { - "@azure-rest/batch": "next", - "dotenv": "latest", - "@azure/identity": "^4.0.1" - }, - "devDependencies": { - "@types/node": "^18.0.0", - "typescript": "~5.6.2", - "rimraf": "latest" - } -} diff --git a/sdk/batch/batch-rest/samples/v1-beta/typescript/sample.env b/sdk/batch/batch-rest/samples/v1-beta/typescript/sample.env deleted file mode 100644 index 47cccb3cf4cb..000000000000 --- a/sdk/batch/batch-rest/samples/v1-beta/typescript/sample.env +++ /dev/null @@ -1,3 +0,0 @@ -# Environment variable to use in the samples. - -BATCH_ACCOUNT_ENDPOINT= diff --git a/sdk/batch/batch-rest/samples/v1-beta/typescript/src/quick-start.ts b/sdk/batch/batch-rest/samples/v1-beta/typescript/src/quick-start.ts deleted file mode 100644 index 2f98782f9046..000000000000 --- a/sdk/batch/batch-rest/samples/v1-beta/typescript/src/quick-start.ts +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -/** - * @summary Azure Batch quickstart sample - */ - -import createClient, { - BatchClient, - CreateJobParameters, - CreatePoolParameters, - CreateTaskParameters, - isUnexpected, - paginate, -} from "@azure-rest/batch"; -import { DefaultAzureCredential } from "@azure/identity"; - -// Load the .env file if it exists -// eslint-disable-next-line import/no-extraneous-dependencies -import * as dotenv from "dotenv"; -dotenv.config(); - -const batchAccountEndpoint = process.env["BATCH_ACCOUNT_ENDPOINT"] || ""; -const poolName = "samplepool"; -const jobId = "samplejob2"; - -async function main() { - const credentials = new DefaultAzureCredential(); - const client = createClient(batchAccountEndpoint, credentials); - - await createPool(client); - - await createJob(client); - - await submitTasks(client); - - await listTasks(client); - - await waitForTasks(client); - - await cleanup(client); -} - -async function createPool(client: BatchClient) { - const poolParams: CreatePoolParameters = { - body: { - id: poolName, - vmSize: "Standard_D1_v2", - virtualMachineConfiguration: { - nodeAgentSKUId: "batch.node.windows amd64", - imageReference: { - publisher: "microsoftwindowsserver", - offer: "windowsserver", - sku: "2022-datacenter", - }, - }, - networkConfiguration: { - enableAcceleratedNetworking: true, - }, - targetDedicatedNodes: 1, - }, - contentType: "application/json; odata=minimalmetadata", - }; - const result = await client.path("/pools").post(poolParams); - if (isUnexpected(result)) { - console.log(result.body); - throw new Error(`Failed to create pool: ${result.body.message}`); - } - console.log(`Pool ${poolName} created`); -} - -async function createJob(client: BatchClient) { - const jobAddParam: CreateJobParameters = { - body: { - id: jobId, - poolInfo: { poolId: poolName }, - }, - contentType: "application/json; odata=minimalmetadata", - }; - - const result = await client.path("/jobs").post(jobAddParam); - if (isUnexpected(result)) { - throw new Error(`Failed to create job: ${result.body.message}`); - } - console.log(`Job ${jobId} created`); -} - -async function submitTasks(client: BatchClient) { - for (let i = 1; i < 6; i++) { - const addTaskParam: CreateTaskParameters = { - body: { - id: `task${i}`, - commandLine: `cmd /c echo task-${i} > result.txt`, - }, - contentType: "application/json; odata=minimalmetadata", - }; - - const addTaskResult = await client.path("/jobs/{jobId}/tasks", jobId).post(addTaskParam); - if (isUnexpected(addTaskResult)) { - throw new Error(`Failed to add task ${i}: ${addTaskResult.body.message}`); - } - console.log(`Task ${i} added`); - } -} - -async function listTasks(client: BatchClient) { - const result = await client - .path("/jobs/{jobId}/tasks", jobId) - .get({ queryParameters: { maxresults: 1 } }); - if (isUnexpected(result)) { - throw new Error(`Failed to list tasks: ${result.body.message}`); - } - console.log("Tasks first result:", result.body.value?.length); - const taskAsyncIterator = paginate(client, result); - - for await (const task of taskAsyncIterator) { - console.log(`- ${task.id}, state: ${task.state}`); - } -} - -async function waitForTasks(client: BatchClient) { - console.log("Waiting for tasks to complete"); - while (true) { - const result = await client - .path("/jobs/{jobId}/tasks", jobId) - .get({ queryParameters: { maxresults: 1 } }); - if (isUnexpected(result)) { - throw new Error(`Failed to list tasks: ${result.body.message}`); - } - const taskAsyncIterator = paginate(client, result); - let isAllCompleted = true; - for await (const task of taskAsyncIterator) { - if (task.state !== "completed") { - console.log(`- ${task.id}, state: ${task.state}`); - isAllCompleted = false; - break; - } - } - if (isAllCompleted) { - console.log("All tasks completed"); - break; - } - await new Promise((resolve) => setTimeout(resolve, 5000)); - } -} - -async function cleanup(client: BatchClient) { - const result = await client.path("/pools/{poolId}", poolName).delete(); - if (isUnexpected(result)) { - throw new Error(`Failed to delete pool: ${result.body.message}`); - } - console.log(`Pool ${poolName} deleted`); -} - -main().catch(console.error); diff --git a/sdk/batch/batch-rest/samples/v1-beta/typescript/tsconfig.json b/sdk/batch/batch-rest/samples/v1-beta/typescript/tsconfig.json deleted file mode 100644 index 984eed535aa8..000000000000 --- a/sdk/batch/batch-rest/samples/v1-beta/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/batch-rest/src/batchClient.ts b/sdk/batch/batch-rest/src/batchClient.ts index bb10ce5c46fe..1bf6345c9680 100644 --- a/sdk/batch/batch-rest/src/batchClient.ts +++ b/sdk/batch/batch-rest/src/batchClient.ts @@ -3,10 +3,8 @@ import { getClient, ClientOptions } from "@azure-rest/core-client"; import { logger } from "./logger.js"; -import { TokenCredential, AzureNamedKeyCredential, isTokenCredential } from "@azure/core-auth"; +import { TokenCredential } from "@azure/core-auth"; import { BatchClient } from "./clientDefinitions.js"; -import { createBatchSharedKeyCredentialsPolicy } from "./credentials/batchSharedKeyCredentials.js"; -import { createReplacePoolPropertiesPolicy } from "./replacePoolPropertiesPolicy.js"; /** The optional parameters for the client */ export interface BatchClientOptions extends ClientOptions { @@ -22,7 +20,7 @@ export interface BatchClientOptions extends ClientOptions { */ export default function createClient( endpointParam: string, - credentials: TokenCredential | AzureNamedKeyCredential, + credentials: TokenCredential, { apiVersion = "2024-02-01.19.0", ...options }: BatchClientOptions = {}, ): BatchClient { const endpointUrl = options.endpoint ?? options.baseUrl ?? `${endpointParam}`; @@ -41,49 +39,33 @@ export default function createClient( }, telemetryOptions: { clientRequestIdHeaderName: - options.telemetryOptions?.clientRequestIdHeaderName ?? "client-request-id", + options.telemetryOptions?.clientRequestIdHeaderName ?? + "client-request-id", }, credentials: { - scopes: options.credentials?.scopes ?? ["https://batch.core.windows.net//.default"], + scopes: options.credentials?.scopes ?? [ + "https://batch.core.windows.net//.default", + ], }, - additionalPolicies: [ - ...(options?.additionalPolicies ?? []), - // TODO: remove after service remove certificate feature completely - { - policy: createReplacePoolPropertiesPolicy(), - position: "perCall", - }, - ], }; + const client = getClient(endpointUrl, credentials, options) as BatchClient; - const addClientApiVersionPolicy = (client: BatchClient): BatchClient => { - client.pipeline.removePolicy({ name: "ApiVersionPolicy" }); - client.pipeline.addPolicy({ - name: "ClientApiVersionPolicy", - sendRequest: (req, next) => { - // Use the apiVersion defined in request url directly - // Append one if there is no apiVersion and we have one at client options - const url = new URL(req.url); - if (!url.searchParams.get("api-version") && apiVersion) { - req.url = `${req.url}${ - Array.from(url.searchParams.keys()).length > 0 ? "&" : "?" - }api-version=${apiVersion}`; - } + client.pipeline.removePolicy({ name: "ApiVersionPolicy" }); + client.pipeline.addPolicy({ + name: "ClientApiVersionPolicy", + sendRequest: (req, next) => { + // Use the apiVersion defined in request url directly + // Append one if there is no apiVersion and we have one at client options + const url = new URL(req.url); + if (!url.searchParams.get("api-version") && apiVersion) { + req.url = `${req.url}${ + Array.from(url.searchParams.keys()).length > 0 ? "&" : "?" + }api-version=${apiVersion}`; + } - return next(req); - }, - }); - return client; - }; + return next(req); + }, + }); - // Customization for BatchClient, shouldn't be overwritten by codegen - if (isTokenCredential(credentials)) { - const client = getClient(endpointUrl, credentials, options) as BatchClient; - return addClientApiVersionPolicy(client); - } - // If the credentials are not a TokenCredential, we need to add a policy to handle the shared key auth. - const client = getClient(endpointUrl, options) as BatchClient; - const authPolicy = createBatchSharedKeyCredentialsPolicy(credentials); - client.pipeline.addPolicy(authPolicy); - return addClientApiVersionPolicy(client); + return client; } diff --git a/sdk/batch/batch-rest/src/clientDefinitions.ts b/sdk/batch/batch-rest/src/clientDefinitions.ts index fb7f59e47fdf..e0a80065d2e3 100644 --- a/sdk/batch/batch-rest/src/clientDefinitions.ts +++ b/sdk/batch/batch-rest/src/clientDefinitions.ts @@ -226,7 +226,9 @@ export interface ListApplications { */ get( options?: ListApplicationsParameters, - ): StreamableMethod; + ): StreamableMethod< + ListApplications200Response | ListApplicationsDefaultResponse + >; } export interface GetApplication { @@ -239,7 +241,9 @@ export interface GetApplication { */ get( options?: GetApplicationParameters, - ): StreamableMethod; + ): StreamableMethod< + GetApplication200Response | GetApplicationDefaultResponse + >; } export interface ListPoolUsageMetrics { @@ -253,7 +257,9 @@ export interface ListPoolUsageMetrics { */ get( options?: ListPoolUsageMetricsParameters, - ): StreamableMethod; + ): StreamableMethod< + ListPoolUsageMetrics200Response | ListPoolUsageMetricsDefaultResponse + >; } export interface CreatePool { @@ -292,9 +298,13 @@ export interface DeletePool { /** Gets basic properties of a Pool. */ head( options?: PoolExistsParameters, - ): StreamableMethod; + ): StreamableMethod< + PoolExists200Response | PoolExists404Response | PoolExistsDefaultResponse + >; /** Gets information about the specified Pool. */ - get(options?: GetPoolParameters): StreamableMethod; + get( + options?: GetPoolParameters, + ): StreamableMethod; /** * This only replaces the Pool properties specified in the request. For example, * if the Pool has a StartTask associated with it, and a request does not specify @@ -309,7 +319,9 @@ export interface DisablePoolAutoScale { /** Disables automatic scaling for a Pool. */ post( options?: DisablePoolAutoScaleParameters, - ): StreamableMethod; + ): StreamableMethod< + DisablePoolAutoScale200Response | DisablePoolAutoScaleDefaultResponse + >; } export interface EnablePoolAutoScale { @@ -323,7 +335,9 @@ export interface EnablePoolAutoScale { */ post( options: EnablePoolAutoScaleParameters, - ): StreamableMethod; + ): StreamableMethod< + EnablePoolAutoScale200Response | EnablePoolAutoScaleDefaultResponse + >; } export interface EvaluatePoolAutoScale { @@ -334,7 +348,9 @@ export interface EvaluatePoolAutoScale { */ post( options: EvaluatePoolAutoScaleParameters, - ): StreamableMethod; + ): StreamableMethod< + EvaluatePoolAutoScale200Response | EvaluatePoolAutoScaleDefaultResponse + >; } export interface ResizePool { @@ -364,7 +380,9 @@ export interface StopPoolResize { */ post( options?: StopPoolResizeParameters, - ): StreamableMethod; + ): StreamableMethod< + StopPoolResize202Response | StopPoolResizeDefaultResponse + >; } export interface ReplacePoolProperties { @@ -375,7 +393,9 @@ export interface ReplacePoolProperties { */ post( options: ReplacePoolPropertiesParameters, - ): StreamableMethod; + ): StreamableMethod< + ReplacePoolProperties204Response | ReplacePoolPropertiesDefaultResponse + >; } export interface RemoveNodes { @@ -393,7 +413,9 @@ export interface ListSupportedImages { /** Lists all Virtual Machine Images supported by the Azure Batch service. */ get( options?: ListSupportedImagesParameters, - ): StreamableMethod; + ): StreamableMethod< + ListSupportedImages200Response | ListSupportedImagesDefaultResponse + >; } export interface ListPoolNodeCounts { @@ -404,7 +426,9 @@ export interface ListPoolNodeCounts { */ get( options?: ListPoolNodeCountsParameters, - ): StreamableMethod; + ): StreamableMethod< + ListPoolNodeCounts200Response | ListPoolNodeCountsDefaultResponse + >; } export interface DeleteJob { @@ -422,7 +446,9 @@ export interface DeleteJob { options?: DeleteJobParameters, ): StreamableMethod; /** Gets information about the specified Job. */ - get(options?: GetJobParameters): StreamableMethod; + get( + options?: GetJobParameters, + ): StreamableMethod; /** * This replaces only the Job properties specified in the request. For example, if * the Job has constraints, and a request does not specify the constraints @@ -510,7 +536,9 @@ export interface ListJobsFromSchedule { /** Lists the Jobs that have been created under the specified Job Schedule. */ get( options?: ListJobsFromScheduleParameters, - ): StreamableMethod; + ): StreamableMethod< + ListJobsFromSchedule200Response | ListJobsFromScheduleDefaultResponse + >; } export interface ListJobPreparationAndReleaseTaskStatus { @@ -539,7 +567,9 @@ export interface GetJobTaskCounts { */ get( options?: GetJobTaskCountsParameters, - ): StreamableMethod; + ): StreamableMethod< + GetJobTaskCounts200Response | GetJobTaskCountsDefaultResponse + >; } export interface JobScheduleExists { @@ -547,7 +577,9 @@ export interface JobScheduleExists { head( options?: JobScheduleExistsParameters, ): StreamableMethod< - JobScheduleExists200Response | JobScheduleExists404Response | JobScheduleExistsDefaultResponse + | JobScheduleExists200Response + | JobScheduleExists404Response + | JobScheduleExistsDefaultResponse >; /** * When you delete a Job Schedule, this also deletes all Jobs and Tasks under that @@ -558,11 +590,15 @@ export interface JobScheduleExists { */ delete( options?: DeleteJobScheduleParameters, - ): StreamableMethod; + ): StreamableMethod< + DeleteJobSchedule202Response | DeleteJobScheduleDefaultResponse + >; /** Gets information about the specified Job Schedule. */ get( options?: GetJobScheduleParameters, - ): StreamableMethod; + ): StreamableMethod< + GetJobSchedule200Response | GetJobScheduleDefaultResponse + >; /** * This replaces only the Job Schedule properties specified in the request. For * example, if the schedule property is not specified with this request, then the @@ -572,7 +608,9 @@ export interface JobScheduleExists { */ patch( options: UpdateJobScheduleParameters, - ): StreamableMethod; + ): StreamableMethod< + UpdateJobSchedule200Response | UpdateJobScheduleDefaultResponse + >; /** * This fully replaces all the updatable properties of the Job Schedule. For * example, if the schedule property is not specified with this request, then the @@ -582,39 +620,51 @@ export interface JobScheduleExists { */ put( options: ReplaceJobScheduleParameters, - ): StreamableMethod; + ): StreamableMethod< + ReplaceJobSchedule200Response | ReplaceJobScheduleDefaultResponse + >; } export interface DisableJobSchedule { /** No new Jobs will be created until the Job Schedule is enabled again. */ post( options?: DisableJobScheduleParameters, - ): StreamableMethod; + ): StreamableMethod< + DisableJobSchedule204Response | DisableJobScheduleDefaultResponse + >; } export interface EnableJobSchedule { /** Enables a Job Schedule. */ post( options?: EnableJobScheduleParameters, - ): StreamableMethod; + ): StreamableMethod< + EnableJobSchedule204Response | EnableJobScheduleDefaultResponse + >; } export interface TerminateJobSchedule { /** Terminates a Job Schedule. */ post( options?: TerminateJobScheduleParameters, - ): StreamableMethod; + ): StreamableMethod< + TerminateJobSchedule202Response | TerminateJobScheduleDefaultResponse + >; } export interface CreateJobSchedule { /** Creates a Job Schedule to the specified Account. */ post( options: CreateJobScheduleParameters, - ): StreamableMethod; + ): StreamableMethod< + CreateJobSchedule201Response | CreateJobScheduleDefaultResponse + >; /** Lists all of the Job Schedules in the specified Account. */ get( options?: ListJobSchedulesParameters, - ): StreamableMethod; + ): StreamableMethod< + ListJobSchedules200Response | ListJobSchedulesDefaultResponse + >; } export interface CreateTask { @@ -655,7 +705,9 @@ export interface CreateTaskCollection { */ post( options: CreateTaskCollectionParameters, - ): StreamableMethod; + ): StreamableMethod< + CreateTaskCollection200Response | CreateTaskCollectionDefaultResponse + >; } export interface DeleteTask { @@ -674,7 +726,9 @@ export interface DeleteTask { * nodeInfo refer to the primary Task. Use the list subtasks API to retrieve * information about subtasks. */ - get(options?: GetTaskParameters): StreamableMethod; + get( + options?: GetTaskParameters, + ): StreamableMethod; /** Updates the properties of the specified Task. */ put( options: ReplaceTaskParameters, @@ -711,14 +765,18 @@ export interface ReactivateTask { */ post( options?: ReactivateTaskParameters, - ): StreamableMethod; + ): StreamableMethod< + ReactivateTask204Response | ReactivateTaskDefaultResponse + >; } export interface DeleteTaskFile { /** Deletes the specified Task file from the Compute Node where the Task ran. */ delete( options?: DeleteTaskFileParameters, - ): StreamableMethod; + ): StreamableMethod< + DeleteTaskFile200Response | DeleteTaskFileDefaultResponse + >; /** Returns the content of the specified Task file. */ get( options?: GetTaskFileParameters, @@ -726,7 +784,9 @@ export interface DeleteTaskFile { /** Gets the properties of the specified Task file. */ head( options?: GetTaskFilePropertiesParameters, - ): StreamableMethod; + ): StreamableMethod< + GetTaskFileProperties200Response | GetTaskFilePropertiesDefaultResponse + >; } export interface ListTaskFiles { @@ -743,7 +803,9 @@ export interface CreateNodeUser { */ post( options: CreateNodeUserParameters, - ): StreamableMethod; + ): StreamableMethod< + CreateNodeUser201Response | CreateNodeUserDefaultResponse + >; } export interface DeleteNodeUser { @@ -753,7 +815,9 @@ export interface DeleteNodeUser { */ delete( options?: DeleteNodeUserParameters, - ): StreamableMethod; + ): StreamableMethod< + DeleteNodeUser200Response | DeleteNodeUserDefaultResponse + >; /** * This operation replaces of all the updatable properties of the Account. For * example, if the expiryTime element is not specified, the current value is @@ -762,12 +826,16 @@ export interface DeleteNodeUser { */ put( options: ReplaceNodeUserParameters, - ): StreamableMethod; + ): StreamableMethod< + ReplaceNodeUser200Response | ReplaceNodeUserDefaultResponse + >; } export interface GetNode { /** Gets information about the specified Compute Node. */ - get(options?: GetNodeParameters): StreamableMethod; + get( + options?: GetNodeParameters, + ): StreamableMethod; } export interface RebootNode { @@ -784,7 +852,9 @@ export interface DisableNodeScheduling { */ post( options: DisableNodeSchedulingParameters, - ): StreamableMethod; + ): StreamableMethod< + DisableNodeScheduling200Response | DisableNodeSchedulingDefaultResponse + >; } export interface EnableNodeScheduling { @@ -794,7 +864,9 @@ export interface EnableNodeScheduling { */ post( options?: EnableNodeSchedulingParameters, - ): StreamableMethod; + ): StreamableMethod< + EnableNodeScheduling200Response | EnableNodeSchedulingDefaultResponse + >; } export interface GetNodeRemoteLoginSettings { @@ -806,7 +878,8 @@ export interface GetNodeRemoteLoginSettings { get( options?: GetNodeRemoteLoginSettingsParameters, ): StreamableMethod< - GetNodeRemoteLoginSettings200Response | GetNodeRemoteLoginSettingsDefaultResponse + | GetNodeRemoteLoginSettings200Response + | GetNodeRemoteLoginSettingsDefaultResponse >; } @@ -819,7 +892,9 @@ export interface UploadNodeLogs { */ post( options: UploadNodeLogsParameters, - ): StreamableMethod; + ): StreamableMethod< + UploadNodeLogs200Response | UploadNodeLogsDefaultResponse + >; } export interface ListNodes { @@ -833,21 +908,27 @@ export interface GetNodeExtension { /** Gets information about the specified Compute Node Extension. */ get( options?: GetNodeExtensionParameters, - ): StreamableMethod; + ): StreamableMethod< + GetNodeExtension200Response | GetNodeExtensionDefaultResponse + >; } export interface ListNodeExtensions { /** Lists the Compute Nodes Extensions in the specified Pool. */ get( options?: ListNodeExtensionsParameters, - ): StreamableMethod; + ): StreamableMethod< + ListNodeExtensions200Response | ListNodeExtensionsDefaultResponse + >; } export interface DeleteNodeFile { /** Deletes the specified file from the Compute Node. */ delete( options?: DeleteNodeFileParameters, - ): StreamableMethod; + ): StreamableMethod< + DeleteNodeFile200Response | DeleteNodeFileDefaultResponse + >; /** Returns the content of the specified Compute Node file. */ get( options?: GetNodeFileParameters, @@ -855,7 +936,9 @@ export interface DeleteNodeFile { /** Gets the properties of the specified Compute Node file. */ head( options?: GetNodeFilePropertiesParameters, - ): StreamableMethod; + ): StreamableMethod< + GetNodeFileProperties200Response | GetNodeFilePropertiesDefaultResponse + >; } export interface ListNodeFiles { @@ -869,7 +952,10 @@ export interface Routes { /** Resource for '/applications' has methods for the following verbs: get */ (path: "/applications"): ListApplications; /** Resource for '/applications/\{applicationId\}' has methods for the following verbs: get */ - (path: "/applications/{applicationId}", applicationId: string): GetApplication; + ( + path: "/applications/{applicationId}", + applicationId: string, + ): GetApplication; /** Resource for '/poolusagemetrics' has methods for the following verbs: get */ (path: "/poolusagemetrics"): ListPoolUsageMetrics; /** Resource for '/pools' has methods for the following verbs: post, get */ @@ -877,17 +963,29 @@ export interface Routes { /** Resource for '/pools/\{poolId\}' has methods for the following verbs: delete, head, get, patch */ (path: "/pools/{poolId}", poolId: string): DeletePool; /** Resource for '/pools/\{poolId\}/disableautoscale' has methods for the following verbs: post */ - (path: "/pools/{poolId}/disableautoscale", poolId: string): DisablePoolAutoScale; + ( + path: "/pools/{poolId}/disableautoscale", + poolId: string, + ): DisablePoolAutoScale; /** Resource for '/pools/\{poolId\}/enableautoscale' has methods for the following verbs: post */ - (path: "/pools/{poolId}/enableautoscale", poolId: string): EnablePoolAutoScale; + ( + path: "/pools/{poolId}/enableautoscale", + poolId: string, + ): EnablePoolAutoScale; /** Resource for '/pools/\{poolId\}/evaluateautoscale' has methods for the following verbs: post */ - (path: "/pools/{poolId}/evaluateautoscale", poolId: string): EvaluatePoolAutoScale; + ( + path: "/pools/{poolId}/evaluateautoscale", + poolId: string, + ): EvaluatePoolAutoScale; /** Resource for '/pools/\{poolId\}/resize' has methods for the following verbs: post */ (path: "/pools/{poolId}/resize", poolId: string): ResizePool; /** Resource for '/pools/\{poolId\}/stopresize' has methods for the following verbs: post */ (path: "/pools/{poolId}/stopresize", poolId: string): StopPoolResize; /** Resource for '/pools/\{poolId\}/updateproperties' has methods for the following verbs: post */ - (path: "/pools/{poolId}/updateproperties", poolId: string): ReplacePoolProperties; + ( + path: "/pools/{poolId}/updateproperties", + poolId: string, + ): ReplacePoolProperties; /** Resource for '/pools/\{poolId\}/removenodes' has methods for the following verbs: post */ (path: "/pools/{poolId}/removenodes", poolId: string): RemoveNodes; /** Resource for '/supportedimages' has methods for the following verbs: get */ @@ -905,7 +1003,10 @@ export interface Routes { /** Resource for '/jobs' has methods for the following verbs: post, get */ (path: "/jobs"): CreateJob; /** Resource for '/jobschedules/\{jobScheduleId\}/jobs' has methods for the following verbs: get */ - (path: "/jobschedules/{jobScheduleId}/jobs", jobScheduleId: string): ListJobsFromSchedule; + ( + path: "/jobschedules/{jobScheduleId}/jobs", + jobScheduleId: string, + ): ListJobsFromSchedule; /** Resource for '/jobs/\{jobId\}/jobpreparationandreleasetaskstatus' has methods for the following verbs: get */ ( path: "/jobs/{jobId}/jobpreparationandreleasetaskstatus", @@ -914,27 +1015,58 @@ export interface Routes { /** Resource for '/jobs/\{jobId\}/taskcounts' has methods for the following verbs: get */ (path: "/jobs/{jobId}/taskcounts", jobId: string): GetJobTaskCounts; /** Resource for '/jobschedules/\{jobScheduleId\}' has methods for the following verbs: head, delete, get, patch, put */ - (path: "/jobschedules/{jobScheduleId}", jobScheduleId: string): JobScheduleExists; + ( + path: "/jobschedules/{jobScheduleId}", + jobScheduleId: string, + ): JobScheduleExists; /** Resource for '/jobschedules/\{jobScheduleId\}/disable' has methods for the following verbs: post */ - (path: "/jobschedules/{jobScheduleId}/disable", jobScheduleId: string): DisableJobSchedule; + ( + path: "/jobschedules/{jobScheduleId}/disable", + jobScheduleId: string, + ): DisableJobSchedule; /** Resource for '/jobschedules/\{jobScheduleId\}/enable' has methods for the following verbs: post */ - (path: "/jobschedules/{jobScheduleId}/enable", jobScheduleId: string): EnableJobSchedule; + ( + path: "/jobschedules/{jobScheduleId}/enable", + jobScheduleId: string, + ): EnableJobSchedule; /** Resource for '/jobschedules/\{jobScheduleId\}/terminate' has methods for the following verbs: post */ - (path: "/jobschedules/{jobScheduleId}/terminate", jobScheduleId: string): TerminateJobSchedule; + ( + path: "/jobschedules/{jobScheduleId}/terminate", + jobScheduleId: string, + ): TerminateJobSchedule; /** Resource for '/jobschedules' has methods for the following verbs: post, get */ (path: "/jobschedules"): CreateJobSchedule; /** Resource for '/jobs/\{jobId\}/tasks' has methods for the following verbs: post, get */ (path: "/jobs/{jobId}/tasks", jobId: string): CreateTask; /** Resource for '/jobs/\{jobId\}/addtaskcollection' has methods for the following verbs: post */ - (path: "/jobs/{jobId}/addtaskcollection", jobId: string): CreateTaskCollection; + ( + path: "/jobs/{jobId}/addtaskcollection", + jobId: string, + ): CreateTaskCollection; /** Resource for '/jobs/\{jobId\}/tasks/\{taskId\}' has methods for the following verbs: delete, get, put */ - (path: "/jobs/{jobId}/tasks/{taskId}", jobId: string, taskId: string): DeleteTask; + ( + path: "/jobs/{jobId}/tasks/{taskId}", + jobId: string, + taskId: string, + ): DeleteTask; /** Resource for '/jobs/\{jobId\}/tasks/\{taskId\}/subtasksinfo' has methods for the following verbs: get */ - (path: "/jobs/{jobId}/tasks/{taskId}/subtasksinfo", jobId: string, taskId: string): ListSubTasks; + ( + path: "/jobs/{jobId}/tasks/{taskId}/subtasksinfo", + jobId: string, + taskId: string, + ): ListSubTasks; /** Resource for '/jobs/\{jobId\}/tasks/\{taskId\}/terminate' has methods for the following verbs: post */ - (path: "/jobs/{jobId}/tasks/{taskId}/terminate", jobId: string, taskId: string): TerminateTask; + ( + path: "/jobs/{jobId}/tasks/{taskId}/terminate", + jobId: string, + taskId: string, + ): TerminateTask; /** Resource for '/jobs/\{jobId\}/tasks/\{taskId\}/reactivate' has methods for the following verbs: post */ - (path: "/jobs/{jobId}/tasks/{taskId}/reactivate", jobId: string, taskId: string): ReactivateTask; + ( + path: "/jobs/{jobId}/tasks/{taskId}/reactivate", + jobId: string, + taskId: string, + ): ReactivateTask; /** Resource for '/jobs/\{jobId\}/tasks/\{taskId\}/files/\{filePath\}' has methods for the following verbs: delete, get, head */ ( path: "/jobs/{jobId}/tasks/{taskId}/files/{filePath}", @@ -943,9 +1075,17 @@ export interface Routes { filePath: string, ): DeleteTaskFile; /** Resource for '/jobs/\{jobId\}/tasks/\{taskId\}/files' has methods for the following verbs: get */ - (path: "/jobs/{jobId}/tasks/{taskId}/files", jobId: string, taskId: string): ListTaskFiles; + ( + path: "/jobs/{jobId}/tasks/{taskId}/files", + jobId: string, + taskId: string, + ): ListTaskFiles; /** Resource for '/pools/\{poolId\}/nodes/\{nodeId\}/users' has methods for the following verbs: post */ - (path: "/pools/{poolId}/nodes/{nodeId}/users", poolId: string, nodeId: string): CreateNodeUser; + ( + path: "/pools/{poolId}/nodes/{nodeId}/users", + poolId: string, + nodeId: string, + ): CreateNodeUser; /** Resource for '/pools/\{poolId\}/nodes/\{nodeId\}/users/\{userName\}' has methods for the following verbs: delete, put */ ( path: "/pools/{poolId}/nodes/{nodeId}/users/{userName}", @@ -954,9 +1094,17 @@ export interface Routes { userName: string, ): DeleteNodeUser; /** Resource for '/pools/\{poolId\}/nodes/\{nodeId\}' has methods for the following verbs: get */ - (path: "/pools/{poolId}/nodes/{nodeId}", poolId: string, nodeId: string): GetNode; + ( + path: "/pools/{poolId}/nodes/{nodeId}", + poolId: string, + nodeId: string, + ): GetNode; /** Resource for '/pools/\{poolId\}/nodes/\{nodeId\}/reboot' has methods for the following verbs: post */ - (path: "/pools/{poolId}/nodes/{nodeId}/reboot", poolId: string, nodeId: string): RebootNode; + ( + path: "/pools/{poolId}/nodes/{nodeId}/reboot", + poolId: string, + nodeId: string, + ): RebootNode; /** Resource for '/pools/\{poolId\}/nodes/\{nodeId\}/disablescheduling' has methods for the following verbs: post */ ( path: "/pools/{poolId}/nodes/{nodeId}/disablescheduling", @@ -1004,7 +1152,11 @@ export interface Routes { filePath: string, ): DeleteNodeFile; /** Resource for '/pools/\{poolId\}/nodes/\{nodeId\}/files' has methods for the following verbs: get */ - (path: "/pools/{poolId}/nodes/{nodeId}/files", poolId: string, nodeId: string): ListNodeFiles; + ( + path: "/pools/{poolId}/nodes/{nodeId}/files", + poolId: string, + nodeId: string, + ): ListNodeFiles; } export type BatchClient = Client & { diff --git a/sdk/batch/batch-rest/src/credentials/batchSharedKeyCredentials-browser.mts b/sdk/batch/batch-rest/src/credentials/batchSharedKeyCredentials-browser.mts deleted file mode 100644 index c7aaa62a5424..000000000000 --- a/sdk/batch/batch-rest/src/credentials/batchSharedKeyCredentials-browser.mts +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { type AzureNamedKeyCredential } from "@azure/core-auth"; - -export function createBatchSharedKeyCredentialsPolicy( - // eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters - _: AzureNamedKeyCredential, -): never { - throw new Error("BatchSharedKeyCredentialsPolicy is not supported in browser environment"); -} diff --git a/sdk/batch/batch-rest/src/credentials/batchSharedKeyCredentials-react-native.mts b/sdk/batch/batch-rest/src/credentials/batchSharedKeyCredentials-react-native.mts deleted file mode 100644 index 64c86f094c36..000000000000 --- a/sdk/batch/batch-rest/src/credentials/batchSharedKeyCredentials-react-native.mts +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { type AzureNamedKeyCredential } from "@azure/core-auth"; - -export function createBatchSharedKeyCredentialsPolicy( - // eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters - _: AzureNamedKeyCredential, -): never { - throw new Error("BatchSharedKeyCredentialsPolicy is not supported in react native environment"); -} diff --git a/sdk/batch/batch-rest/src/credentials/batchSharedKeyCredentials.ts b/sdk/batch/batch-rest/src/credentials/batchSharedKeyCredentials.ts deleted file mode 100644 index 13d252517d8b..000000000000 --- a/sdk/batch/batch-rest/src/credentials/batchSharedKeyCredentials.ts +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { type AzureNamedKeyCredential } from "@azure/core-auth"; -import { HttpHeaders, HttpMethods, PipelinePolicy } from "@azure/core-rest-pipeline"; -import { createHmac } from "crypto"; - -export function createBatchSharedKeyCredentialsPolicy( - // eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters - credentials: AzureNamedKeyCredential, -): PipelinePolicy { - return { - name: "BatchSharedKeyCredentialsPolicy", - async sendRequest(request, next) { - const accountName = credentials.name; - const accountKey = Buffer.from(credentials.key, "base64"); - - const ocpDate = request.headers.get("ocp-date"); - if (!ocpDate) { - request.headers.set("ocp-date", new Date().toUTCString()); - } - - let stringToSign = - `${request.method}\n` + - getHeaderToAppend(request.headers, "Content-Encoding") + - getHeaderToAppend(request.headers, "Content-Language") + - getContentLengthToAppend(request.headers, request.method, request.body) + - getHeaderToAppend(request.headers, "Content-MD5") + - getHeaderToAppend(request.headers, "Content-Type") + - getHeaderToAppend(request.headers, "Date") + - getHeaderToAppend(request.headers, "If-Modified-Since") + - getHeaderToAppend(request.headers, "If-Match") + - getHeaderToAppend(request.headers, "If-None-Match") + - getHeaderToAppend(request.headers, "If-Unmodified-Since") + - getHeaderToAppend(request.headers, "Range"); - - // Add canonicalized headers - stringToSign += getCanonicalizedHeaders(request.headers); - - // Add canonicalized resource - stringToSign += getCanonicalizedResource(request.url, accountName); - - // Signed with sha256 - const signature = createHmac("sha256", accountKey) - .update(stringToSign, "utf8") - .digest("base64"); - - request.headers.set("Authorization", `SharedKey ${accountName}:${signature}`); - return next(request); - }, - }; -} - -/** - * Get header value, if header without value, append a newline - * @param headers - The pipeline headers object. - * @param headerName - The header name - * @returns The header value - */ -function getHeaderToAppend(headers: HttpHeaders, headerName: string): string { - return (headers.get(headerName) ?? "") + "\n"; -} - -/** - * Get content length - * @param headers - The pipeline headers object. - * @param method - The HTTP method - * @param body - The request body - * @returns The content length - */ -function getContentLengthToAppend(headers: HttpHeaders, method: HttpMethods, body?: any): string { - const contentLength = headers.get("Content-Length"); - - if (contentLength) { - return contentLength + "\n"; - } - - if (body) { - return Buffer.byteLength(body) + "\n"; - } - - // For POST verb, add 0 content-length - if (method === "POST") { - return "0\n"; - } - - return "\n"; -} -/** - * Constructs the Canonicalized Headers string. - * To construct the CanonicalizedHeaders portion of the signature string, - * follow these steps: 1. Retrieve all headers for the resource that begin - * with ocp-, including the ocp-date header. 2. Convert each HTTP header - * name to lowercase. 3. Sort the headers lexicographically by header name, - * in ascending order. Each header may appear only once in the - * string. 4. Unfold the string by replacing any breaking white space with a - * single space. 5. Trim any white space around the colon in the header. 6. - * Finally, append a new line character to each canonicalized header in the - * resulting list. Construct the CanonicalizedHeaders string by - * concatenating all headers in this list into a single string. - * - * @param headers - The pipeline headers object. - * @returns The canonicalized headers. - */ -function getCanonicalizedHeaders(headers: HttpHeaders): string { - let canonicalizedHeaders = ""; - const canonicalizedHeadersArray = []; - - for (const [key] of headers) { - const lowerCaseKey = key.toLocaleLowerCase(); - if (lowerCaseKey.startsWith("ocp-")) { - canonicalizedHeadersArray.push(lowerCaseKey); - } - } - - canonicalizedHeadersArray.sort(); - for (const currentHeader of canonicalizedHeadersArray) { - const headerValue = headers.get(currentHeader); - if (headerValue) { - canonicalizedHeaders += currentHeader.toLowerCase() + ":" + headerValue + "\n"; - } - } - return canonicalizedHeaders; -} - -/** - * Retrieves the header's canonicalized resource string. - * @param url - The URL of the resource. - * @param accountName - The batch account name. - * @returns The canonicalized resource string. - */ -function getCanonicalizedResource(url: string, accountName: string): string { - let path = "/"; - const urlstring = new URL(url); - if (urlstring.pathname) { - path = urlstring.pathname; - } - - let canonicalizedResource = "/" + accountName + path; - - const queryString = urlstring.searchParams; - const sortedQueryString = [...queryString.entries()].sort(); - for (const [key, value] of sortedQueryString) { - canonicalizedResource += `\n${key}:${value}`; - } - return canonicalizedResource; -} diff --git a/sdk/batch/batch-rest/src/index.ts b/sdk/batch/batch-rest/src/index.ts index 74425d2147b2..00fd811e00c7 100644 --- a/sdk/batch/batch-rest/src/index.ts +++ b/sdk/batch/batch-rest/src/index.ts @@ -11,6 +11,5 @@ export * from "./isUnexpected.js"; export * from "./models.js"; export * from "./outputModels.js"; export * from "./paginateHelper.js"; -export * from "./credentials/batchSharedKeyCredentials.js"; export default BatchClient; diff --git a/sdk/batch/batch-rest/src/isUnexpected.ts b/sdk/batch/batch-rest/src/isUnexpected.ts index 9115381aa031..a4a757488320 100644 --- a/sdk/batch/batch-rest/src/isUnexpected.ts +++ b/sdk/batch/batch-rest/src/isUnexpected.ts @@ -223,7 +223,9 @@ export function isUnexpected( response: GetApplication200Response | GetApplicationDefaultResponse, ): response is GetApplicationDefaultResponse; export function isUnexpected( - response: ListPoolUsageMetrics200Response | ListPoolUsageMetricsDefaultResponse, + response: + | ListPoolUsageMetrics200Response + | ListPoolUsageMetricsDefaultResponse, ): response is ListPoolUsageMetricsDefaultResponse; export function isUnexpected( response: CreatePool201Response | CreatePoolDefaultResponse, @@ -235,7 +237,10 @@ export function isUnexpected( response: DeletePool202Response | DeletePoolDefaultResponse, ): response is DeletePoolDefaultResponse; export function isUnexpected( - response: PoolExists200Response | PoolExists404Response | PoolExistsDefaultResponse, + response: + | PoolExists200Response + | PoolExists404Response + | PoolExistsDefaultResponse, ): response is PoolExistsDefaultResponse; export function isUnexpected( response: GetPool200Response | GetPoolDefaultResponse, @@ -244,13 +249,17 @@ export function isUnexpected( response: UpdatePool200Response | UpdatePoolDefaultResponse, ): response is UpdatePoolDefaultResponse; export function isUnexpected( - response: DisablePoolAutoScale200Response | DisablePoolAutoScaleDefaultResponse, + response: + | DisablePoolAutoScale200Response + | DisablePoolAutoScaleDefaultResponse, ): response is DisablePoolAutoScaleDefaultResponse; export function isUnexpected( response: EnablePoolAutoScale200Response | EnablePoolAutoScaleDefaultResponse, ): response is EnablePoolAutoScaleDefaultResponse; export function isUnexpected( - response: EvaluatePoolAutoScale200Response | EvaluatePoolAutoScaleDefaultResponse, + response: + | EvaluatePoolAutoScale200Response + | EvaluatePoolAutoScaleDefaultResponse, ): response is EvaluatePoolAutoScaleDefaultResponse; export function isUnexpected( response: ResizePool202Response | ResizePoolDefaultResponse, @@ -259,7 +268,9 @@ export function isUnexpected( response: StopPoolResize202Response | StopPoolResizeDefaultResponse, ): response is StopPoolResizeDefaultResponse; export function isUnexpected( - response: ReplacePoolProperties204Response | ReplacePoolPropertiesDefaultResponse, + response: + | ReplacePoolProperties204Response + | ReplacePoolPropertiesDefaultResponse, ): response is ReplacePoolPropertiesDefaultResponse; export function isUnexpected( response: RemoveNodes202Response | RemoveNodesDefaultResponse, @@ -298,7 +309,9 @@ export function isUnexpected( response: ListJobs200Response | ListJobsDefaultResponse, ): response is ListJobsDefaultResponse; export function isUnexpected( - response: ListJobsFromSchedule200Response | ListJobsFromScheduleDefaultResponse, + response: + | ListJobsFromSchedule200Response + | ListJobsFromScheduleDefaultResponse, ): response is ListJobsFromScheduleDefaultResponse; export function isUnexpected( response: @@ -333,7 +346,9 @@ export function isUnexpected( response: EnableJobSchedule204Response | EnableJobScheduleDefaultResponse, ): response is EnableJobScheduleDefaultResponse; export function isUnexpected( - response: TerminateJobSchedule202Response | TerminateJobScheduleDefaultResponse, + response: + | TerminateJobSchedule202Response + | TerminateJobScheduleDefaultResponse, ): response is TerminateJobScheduleDefaultResponse; export function isUnexpected( response: CreateJobSchedule201Response | CreateJobScheduleDefaultResponse, @@ -348,7 +363,9 @@ export function isUnexpected( response: ListTasks200Response | ListTasksDefaultResponse, ): response is ListTasksDefaultResponse; export function isUnexpected( - response: CreateTaskCollection200Response | CreateTaskCollectionDefaultResponse, + response: + | CreateTaskCollection200Response + | CreateTaskCollectionDefaultResponse, ): response is CreateTaskCollectionDefaultResponse; export function isUnexpected( response: DeleteTask200Response | DeleteTaskDefaultResponse, @@ -375,7 +392,9 @@ export function isUnexpected( response: GetTaskFile200Response | GetTaskFileDefaultResponse, ): response is GetTaskFileDefaultResponse; export function isUnexpected( - response: GetTaskFileProperties200Response | GetTaskFilePropertiesDefaultResponse, + response: + | GetTaskFileProperties200Response + | GetTaskFilePropertiesDefaultResponse, ): response is GetTaskFilePropertiesDefaultResponse; export function isUnexpected( response: ListTaskFiles200Response | ListTaskFilesDefaultResponse, @@ -396,13 +415,19 @@ export function isUnexpected( response: RebootNode202Response | RebootNodeDefaultResponse, ): response is RebootNodeDefaultResponse; export function isUnexpected( - response: DisableNodeScheduling200Response | DisableNodeSchedulingDefaultResponse, + response: + | DisableNodeScheduling200Response + | DisableNodeSchedulingDefaultResponse, ): response is DisableNodeSchedulingDefaultResponse; export function isUnexpected( - response: EnableNodeScheduling200Response | EnableNodeSchedulingDefaultResponse, + response: + | EnableNodeScheduling200Response + | EnableNodeSchedulingDefaultResponse, ): response is EnableNodeSchedulingDefaultResponse; export function isUnexpected( - response: GetNodeRemoteLoginSettings200Response | GetNodeRemoteLoginSettingsDefaultResponse, + response: + | GetNodeRemoteLoginSettings200Response + | GetNodeRemoteLoginSettingsDefaultResponse, ): response is GetNodeRemoteLoginSettingsDefaultResponse; export function isUnexpected( response: UploadNodeLogs200Response | UploadNodeLogsDefaultResponse, @@ -423,7 +448,9 @@ export function isUnexpected( response: GetNodeFile200Response | GetNodeFileDefaultResponse, ): response is GetNodeFileDefaultResponse; export function isUnexpected( - response: GetNodeFileProperties200Response | GetNodeFilePropertiesDefaultResponse, + response: + | GetNodeFileProperties200Response + | GetNodeFilePropertiesDefaultResponse, ): response is GetNodeFilePropertiesDefaultResponse; export function isUnexpected( response: ListNodeFiles200Response | ListNodeFilesDefaultResponse, @@ -672,17 +699,24 @@ function getParametrizedPathSuccess(method: string, path: string): string[] { // 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) { + 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] || "", - ); + const isMatched = new RegExp( + `${candidateParts[i]?.slice(start, end)}`, + ).test(pathParts[j] || ""); if (!isMatched) { found = false; diff --git a/sdk/batch/batch-rest/src/models.ts b/sdk/batch/batch-rest/src/models.ts index 1f444d6698a7..4668b1415b12 100644 --- a/sdk/batch/batch-rest/src/models.ts +++ b/sdk/batch/batch-rest/src/models.ts @@ -43,7 +43,11 @@ export interface BatchPoolCreateContent { metadata?: Array; /** Mount storage using specified file system for the entire lifetime of the pool. Mount the storage using Azure fileshare, NFS, CIFS or Blobfuse based file system. */ mountConfiguration?: Array; - /** The desired node communication mode for the pool. If omitted, the default value is Default. */ + /** + * The desired node communication mode for the pool. If omitted, the default value is Default. + * + * Possible values: "default", "classic", "simplified" + */ targetNodeCommunicationMode?: BatchNodeCommunicationMode; /** The upgrade policy for the Pool. Describes an upgrade policy - automatic, manual, or rolling. */ upgradePolicy?: UpgradePolicy; @@ -122,17 +126,29 @@ export interface WindowsConfiguration { export interface DataDisk { /** The logical unit number. The logicalUnitNumber is used to uniquely identify each data disk. If attaching multiple disks, each should have a distinct logicalUnitNumber. The value must be between 0 and 63, inclusive. */ lun: number; - /** The type of caching to be enabled for the data disks. The default value for caching is readwrite. For information about the caching options see: https://blogs.msdn.microsoft.com/windowsazurestorage/2012/06/27/exploring-windows-azure-drives-disks-and-images/. */ + /** + * The type of caching to be enabled for the data disks. The default value for caching is readwrite. For information about the caching options see: https://blogs.msdn.microsoft.com/windowsazurestorage/2012/06/27/exploring-windows-azure-drives-disks-and-images/. + * + * Possible values: "none", "readonly", "readwrite" + */ caching?: CachingType; /** The initial disk size in gigabytes. */ diskSizeGB: number; - /** The storage Account type to be used for the data disk. If omitted, the default is "standard_lrs". */ + /** + * The storage Account type to be used for the data disk. If omitted, the default is "standard_lrs". + * + * Possible values: "standard_lrs", "premium_lrs", "standardssd_lrs" + */ storageAccountType?: StorageAccountType; } /** The configuration for container-enabled Pools. */ export interface ContainerConfiguration { - /** The container technology to be used. */ + /** + * The container technology to be used. + * + * Possible values: "dockerCompatible", "criCompatible" + */ type: ContainerType; /** The collection of container Image names. 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[]; @@ -177,7 +193,11 @@ export interface DiskEncryptionConfiguration { * with best effort balancing. */ export interface BatchNodePlacementConfiguration { - /** Node placement Policy type on Batch Pools. Allocation policy used by Batch Service to provision the nodes. If not specified, Batch will use the regional policy. */ + /** + * Node placement Policy type on Batch Pools. Allocation policy used by Batch Service to provision the nodes. If not specified, Batch will use the regional policy. + * + * Possible values: "regional", "zonal" + */ policy?: BatchNodePlacementPolicyType; } @@ -207,7 +227,11 @@ export interface VMExtension { export interface OSDisk { /** Specifies the ephemeral Disk Settings for the operating system disk used by the compute node (VM). */ ephemeralOSDiskSettings?: DiffDiskSettings; - /** Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The default values are: None for Standard storage. ReadOnly for Premium storage. */ + /** + * Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The default values are: None for Standard storage. ReadOnly for Premium storage. + * + * Possible values: "none", "readonly", "readwrite" + */ caching?: CachingType; /** The initial disk size in GB when creating new OS disk. */ diskSizeGB?: number; @@ -222,13 +246,21 @@ export interface OSDisk { * compute node (VM). */ export interface DiffDiskSettings { - /** Specifies the ephemeral disk placement for operating system disk for all VMs in the pool. This property can be used by user in the request to choose the location 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. */ + /** + * Specifies the ephemeral disk placement for operating system disk for all VMs in the pool. This property can be used by user in the request to choose the location 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. + * + * Possible values: "cachedisk" + */ placement?: DiffDiskPlacement; } /** The managed disk parameters. */ export interface ManagedDisk { - /** The storage account type for managed disk. */ + /** + * The storage account type for managed disk. + * + * Possible values: "standard_lrs", "premium_lrs", "standardssd_lrs" + */ storageAccountType: StorageAccountType; } @@ -236,7 +268,11 @@ export interface ManagedDisk { export interface SecurityProfile { /** 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 SecurityType of the virtual machine. It has to be set to any specified value to enable UefiSettings. */ + /** + * Specifies the SecurityType of the virtual machine. It has to be set to any specified value to enable UefiSettings. + * + * Possible values: "trustedLaunch" + */ securityType: SecurityTypes; /** Specifies the security settings like secure boot and vTPM used while creating the virtual machine. Specifies the security settings like secure boot and vTPM used while creating the virtual machine. */ uefiSettings: UefiSettings; @@ -263,7 +299,11 @@ export interface ServiceArtifactReference { export interface NetworkConfiguration { /** The ARM resource identifier of the virtual network subnet which the Compute Nodes of the Pool will join. This is of the form /subscriptions/{subscription}/resourceGroups/{group}/providers/{provider}/virtualNetworks/{network}/subnets/{subnet}. 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 Compute Nodes in the Pool. If the subnet doesn't have enough free IP addresses, the Pool will partially allocate 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 Nodes. This can be verified by checking if the specified VNet has any associated Network Security Groups (NSG). If communication to the Nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the Compute Nodes to unusable. For Pools created with virtualMachineConfiguration only ARM virtual networks ('Microsoft.Network/virtualNetworks') are supported. If the specified VNet has any associated Network Security Groups (NSG), then a few reserved system ports must be enabled for inbound communication. For Pools created with a virtual machine configuration, 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. */ + /** + * The scope of dynamic vnet assignment. + * + * Possible values: "none", "job" + */ dynamicVNetAssignmentScope?: DynamicVNetAssignmentScope; /** The configuration for endpoints on Compute Nodes in the Batch Pool. Pool endpoint configuration is only supported on Pools with the virtualMachineConfiguration property. */ endpointConfiguration?: BatchPoolEndpointConfiguration; @@ -286,7 +326,11 @@ export interface BatchPoolEndpointConfiguration { export interface InboundNatPool { /** The name of the endpoint. 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. */ + /** + * The protocol of the endpoint. + * + * Possible values: "tcp", "udp" + */ protocol: InboundEndpointProtocol; /** The port number on the Compute Node. 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; @@ -302,7 +346,11 @@ export interface InboundNatPool { export interface NetworkSecurityGroupRule { /** The priority for this rule. 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. */ + /** + * The action that should be taken for a specified IP address, subnet range or tag. + * + * Possible values: "allow", "deny" + */ access: NetworkSecurityGroupRuleAccess; /** The source address prefix or tag to match for the rule. 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; @@ -312,7 +360,11 @@ export interface NetworkSecurityGroupRule { /** The public IP Address configuration of the networking configuration of a Pool. */ export interface PublicIpAddressConfiguration { - /** The provisioning type for Public IP Addresses for the Pool. The default value is BatchManaged. */ + /** + * The provisioning type for Public IP Addresses for the Pool. The default value is BatchManaged. + * + * Possible values: "batchmanaged", "usermanaged", "nopublicipaddresses" + */ provision?: IpAddressProvisioningType; /** The list of public IPs which the Batch service will use when provisioning Compute Nodes. 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[]; @@ -358,7 +410,11 @@ export interface BatchTaskContainerSettings { imageName: string; /** The private registry which contains the container Image. This setting can be omitted if was already provided at Pool creation. */ registry?: ContainerRegistryReference; - /** The location of the container Task working directory. The default is 'taskWorkingDirectory'. */ + /** + * The location of the container Task working directory. The default is 'taskWorkingDirectory'. + * + * Possible values: "taskWorkingDirectory", "containerImageDefault" + */ workingDirectory?: ContainerWorkingDirectory; } @@ -398,9 +454,17 @@ export interface UserIdentity { /** Specifies the options for the auto user that runs an Azure Batch Task. */ export interface AutoUserSpecification { - /** The scope for the auto user. 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, such as if the task mutates the registry in a way which could impact other tasks. */ + /** + * The scope for the auto user. 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, such as if the task mutates the registry in a way which could impact other tasks. + * + * Possible values: "task", "pool" + */ scope?: AutoUserScope; - /** The elevation level of the auto user. The default value is nonAdmin. */ + /** + * The elevation level of the auto user. The default value is nonAdmin. + * + * Possible values: "nonadmin", "admin" + */ elevationLevel?: ElevationLevel; } @@ -414,7 +478,11 @@ export interface BatchApplicationPackageReference { /** Specifies how Tasks should be distributed across Compute Nodes. */ export interface BatchTaskSchedulingPolicy { - /** How Tasks are distributed across Compute Nodes in a Pool. If not specified, the default is spread. */ + /** + * How Tasks are distributed across Compute Nodes in a Pool. If not specified, the default is spread. + * + * Possible values: "spread", "pack" + */ nodeFillType: BatchNodeFillType; } @@ -427,7 +495,11 @@ export interface UserAccount { name: string; /** The password for the user Account. */ password: string; - /** The elevation level of the user Account. The default value is nonAdmin. */ + /** + * The elevation level of the user Account. The default value is nonAdmin. + * + * Possible values: "nonadmin", "admin" + */ elevationLevel?: ElevationLevel; /** The Linux-specific user configuration for the user Account. This property is ignored if specified on a Windows Pool. If not specified, the user is created with the default options. */ linuxUserConfiguration?: LinuxUserConfiguration; @@ -447,7 +519,11 @@ export interface LinuxUserConfiguration { /** Properties used to create a user Account on a Windows Compute Node. */ export interface WindowsUserConfiguration { - /** The login mode for the user. The default value for VirtualMachineConfiguration Pools is 'batch'. */ + /** + * The login mode for the user. The default value for VirtualMachineConfiguration Pools is 'batch'. + * + * Possible values: "batch", "interactive" + */ loginMode?: LoginMode; } @@ -532,7 +608,11 @@ export interface AzureFileShareConfiguration { /** 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. */ + /** + * 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. + * + * Possible values: "automatic", "manual", "rolling" + */ mode: UpgradeMode; /** Configuration parameters used for performing automatic OS Upgrade. The configuration parameters used for performing automatic OS upgrade. */ automaticOSUpgradePolicy?: AutomaticOsUpgradePolicy; @@ -586,7 +666,11 @@ export interface BatchPoolUpdateContent { applicationPackageReferences?: Array; /** A list of name-value pairs associated with the Pool as metadata. If this element is present, it replaces any existing metadata configured on the Pool. If you specify an empty collection, any metadata is removed from the Pool. If omitted, any existing metadata is left unchanged. */ metadata?: Array; - /** The desired node communication mode for the pool. If this element is present, it replaces the existing targetNodeCommunicationMode configured on the Pool. If omitted, any existing metadata is left unchanged. */ + /** + * The desired node communication mode for the pool. If this element is present, it replaces the existing targetNodeCommunicationMode configured on the Pool. If omitted, any existing metadata is left unchanged. + * + * Possible values: "default", "classic", "simplified" + */ targetNodeCommunicationMode?: BatchNodeCommunicationMode; } @@ -612,7 +696,11 @@ export interface BatchPoolResizeContent { targetLowPriorityNodes?: number; /** The timeout for allocation of Nodes to the Pool or removal of Compute Nodes from the Pool. 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; - /** Determines what to do with a Compute Node and its running task(s) if the Pool size is decreasing. The default value is requeue. */ + /** + * Determines what to do with a Compute Node and its running task(s) if the Pool size is decreasing. The default value is requeue. + * + * Possible values: "requeue", "terminate", "taskcompletion", "retaineddata" + */ nodeDeallocationOption?: BatchNodeDeallocationOption; } @@ -624,7 +712,11 @@ export interface BatchPoolReplaceContent { applicationPackageReferences: Array; /** A list of name-value pairs associated with the Pool as metadata. This list replaces any existing metadata configured on the Pool. If omitted, or if you specify an empty collection, any existing metadata is removed from the Pool. */ metadata: Array; - /** The desired node communication mode for the pool. This setting replaces any existing targetNodeCommunication setting on the Pool. If omitted, the existing setting is default. */ + /** + * The desired node communication mode for the pool. This setting replaces any existing targetNodeCommunication setting on the Pool. If omitted, the existing setting is default. + * + * Possible values: "default", "classic", "simplified" + */ targetNodeCommunicationMode?: BatchNodeCommunicationMode; } @@ -634,7 +726,11 @@ export interface BatchNodeRemoveContent { nodeList: string[]; /** The timeout for removal of Compute Nodes to the Pool. 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; - /** Determines what to do with a Compute Node and its running task(s) after it has been selected for deallocation. The default value is requeue. */ + /** + * Determines what to do with a Compute Node and its running task(s) after it has been selected for deallocation. The default value is requeue. + * + * Possible values: "requeue", "terminate", "taskcompletion", "retaineddata" + */ nodeDeallocationOption?: BatchNodeDeallocationOption; } @@ -650,7 +746,11 @@ export interface BatchJob { constraints?: BatchJobConstraints; /** The Pool settings associated with the Job. */ poolInfo: BatchPoolInfo; - /** The action the Batch service should take when all Tasks in the Job are in the completed state. The default is noaction. */ + /** + * The action the Batch service should take when all Tasks in the Job are in the completed state. The default is noaction. + * + * Possible values: "noaction", "terminatejob" + */ onAllTasksComplete?: OnAllBatchTasksComplete; /** A list of name-value pairs associated with the Job as metadata. The Batch service does not assign any meaning to metadata; it is solely for the use of user code. */ metadata?: Array; @@ -772,7 +872,11 @@ export interface HttpHeader { * to perform the upload. */ export interface OutputFileUploadConfig { - /** The conditions under which the Task output file or set of files should be uploaded. The default is taskcompletion. */ + /** + * The conditions under which the Task output file or set of files should be uploaded. The default is taskcompletion. + * + * Possible values: "tasksuccess", "taskfailure", "taskcompletion" + */ uploadCondition: OutputFileUploadCondition; } @@ -896,7 +1000,11 @@ export interface BatchPoolInfo { export interface BatchAutoPoolSpecification { /** A prefix to be added to the unique identifier when a Pool is automatically created. The Batch service assigns each auto Pool a unique identifier on creation. To distinguish between Pools created for different purposes, you can specify this element to add a prefix to the ID that is assigned. The prefix can be up to 20 characters long. */ autoPoolIdPrefix?: string; - /** The minimum lifetime of created auto Pools, and how multiple Jobs on a schedule are assigned to Pools. */ + /** + * The minimum lifetime of created auto Pools, and how multiple Jobs on a schedule are assigned to Pools. + * + * Possible values: "jobschedule", "job" + */ poolLifetimeOption: BatchPoolLifetimeOption; /** Whether to keep an auto Pool alive after its lifetime expires. If false, the Batch service deletes the Pool once its lifetime (as determined by the poolLifetimeOption setting) expires; that is, when the Job or Job Schedule completes. If true, the Batch service does not delete the Pool automatically. It is up to the user to delete auto Pools created with this option. */ keepAlive?: boolean; @@ -944,7 +1052,11 @@ export interface BatchPoolSpecification { metadata?: Array; /** A list of file systems to mount on each node in the pool. This supports Azure Files, NFS, CIFS/SMB, and Blobfuse. */ mountConfiguration?: Array; - /** The desired node communication mode for the pool. If omitted, the default value is Default. */ + /** + * The desired node communication mode for the pool. If omitted, the default value is Default. + * + * Possible values: "default", "classic", "simplified" + */ targetNodeCommunicationMode?: BatchNodeCommunicationMode; /** The upgrade policy for the Pool. Describes an upgrade policy - automatic, manual, or rolling. */ upgradePolicy?: UpgradePolicy; @@ -972,7 +1084,11 @@ export interface BatchJobExecutionInfo { /** An error encountered by the Batch service when scheduling a Job. */ export interface BatchJobSchedulingError { - /** The category of the Job scheduling error. */ + /** + * The category of the Job scheduling error. + * + * Possible values: "usererror", "servererror" + */ category: ErrorCategory; /** An identifier for the Job scheduling error. Codes are invariant and are intended to be consumed programmatically. */ code?: string; @@ -1026,7 +1142,11 @@ export interface BatchJobUpdateContent { constraints?: BatchJobConstraints; /** The Pool on which the Batch service runs the Job's Tasks. You may change the Pool for a Job only when the Job is disabled. The Patch Job call will fail if you include the poolInfo element and the Job is not disabled. If you specify an autoPoolSpecification in the poolInfo, only the keepAlive property of the autoPoolSpecification can be updated, and then only if the autoPoolSpecification has a poolLifetimeOption of Job (other job properties can be updated as normal). If omitted, the Job continues to run on its current Pool. */ poolInfo?: BatchPoolInfo; - /** The action the Batch service should take when all Tasks in the Job are in the completed state. If omitted, the completion behavior is left unchanged. You may not change the value from terminatejob to noaction - that is, once you have engaged automatic Job termination, you cannot turn it off again. If you try to do this, the request fails with an 'invalid property value' error response; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). */ + /** + * The action the Batch service should take when all Tasks in the Job are in the completed state. If omitted, the completion behavior is left unchanged. You may not change the value from terminatejob to noaction - that is, once you have engaged automatic Job termination, you cannot turn it off again. If you try to do this, the request fails with an 'invalid property value' error response; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). + * + * Possible values: "noaction", "terminatejob" + */ onAllTasksComplete?: OnAllBatchTasksComplete; /** A list of name-value pairs associated with the Job as metadata. If omitted, the existing Job metadata is left unchanged. */ metadata?: Array; @@ -1034,7 +1154,11 @@ export interface BatchJobUpdateContent { /** Parameters for disabling an Azure Batch Job. */ export interface BatchJobDisableContent { - /** What to do with active Tasks associated with the Job. */ + /** + * What to do with active Tasks associated with the Job. + * + * Possible values: "requeue", "terminate", "wait" + */ disableTasks: DisableBatchJobOption; } @@ -1070,9 +1194,17 @@ export interface BatchJobCreateContent { commonEnvironmentSettings?: Array; /** The Pool on which the Batch service runs the Job's Tasks. */ poolInfo: BatchPoolInfo; - /** The action the Batch service should take when all Tasks in the Job are in the completed state. Note that if a Job contains no Tasks, then all Tasks are considered complete. This option is therefore most commonly used with a Job Manager task; if you want to use automatic Job termination without a Job Manager, you should initially set onAllTasksComplete to noaction and update the Job properties to set onAllTasksComplete to terminatejob once you have finished adding Tasks. The default is noaction. */ + /** + * The action the Batch service should take when all Tasks in the Job are in the completed state. Note that if a Job contains no Tasks, then all Tasks are considered complete. This option is therefore most commonly used with a Job Manager task; if you want to use automatic Job termination without a Job Manager, you should initially set onAllTasksComplete to noaction and update the Job properties to set onAllTasksComplete to terminatejob once you have finished adding Tasks. The default is noaction. + * + * Possible values: "noaction", "terminatejob" + */ onAllTasksComplete?: OnAllBatchTasksComplete; - /** The action the Batch service should take when any Task in the Job fails. A Task is considered to have failed if has a failureInfo. A failureInfo is set if the Task completes with a non-zero exit code after exhausting its retry count, or if there was an error starting the Task, for example due to a resource file download error. The default is noaction. */ + /** + * The action the Batch service should take when any Task in the Job fails. A Task is considered to have failed if has a failureInfo. A failureInfo is set if the Task completes with a non-zero exit code after exhausting its retry count, or if there was an error starting the Task, for example due to a resource file download error. The default is noaction. + * + * Possible values: "noaction", "performexitoptionsjobaction" + */ onTaskFailure?: OnBatchTaskFailure; /** The network configuration for the Job. */ networkConfiguration?: BatchJobNetworkConfiguration; @@ -1092,7 +1224,11 @@ export interface BatchTaskContainerExecutionInfo { /** Information about a Task failure. */ export interface BatchTaskFailureInfo { - /** The category of the Task error. */ + /** + * The category of the Task error. + * + * Possible values: "usererror", "servererror" + */ category: ErrorCategory; /** An identifier for the Task error. Codes are invariant and are intended to be consumed programmatically. */ code?: string; @@ -1142,9 +1278,17 @@ export interface BatchJobSpecification { displayName?: string; /** Whether Tasks in the Job can define dependencies on each other. The default is false. */ usesTaskDependencies?: boolean; - /** The action the Batch service should take when all Tasks in a Job created under this schedule are in the completed state. Note that if a Job contains no Tasks, then all Tasks are considered complete. This option is therefore most commonly used with a Job Manager task; if you want to use automatic Job termination without a Job Manager, you should initially set onAllTasksComplete to noaction and update the Job properties to set onAllTasksComplete to terminatejob once you have finished adding Tasks. The default is noaction. */ + /** + * The action the Batch service should take when all Tasks in a Job created under this schedule are in the completed state. Note that if a Job contains no Tasks, then all Tasks are considered complete. This option is therefore most commonly used with a Job Manager task; if you want to use automatic Job termination without a Job Manager, you should initially set onAllTasksComplete to noaction and update the Job properties to set onAllTasksComplete to terminatejob once you have finished adding Tasks. The default is noaction. + * + * Possible values: "noaction", "terminatejob" + */ onAllTasksComplete?: OnAllBatchTasksComplete; - /** The action the Batch service should take when any Task fails in a Job created under this schedule. A Task is considered to have failed if it have failed if has a failureInfo. A failureInfo is set if the Task completes with a non-zero exit code after exhausting its retry count, or if there was an error starting the Task, for example due to a resource file download error. The default is noaction. */ + /** + * The action the Batch service should take when any Task fails in a Job created under this schedule. A Task is considered to have failed if it have failed if has a failureInfo. A failureInfo is set if the Task completes with a non-zero exit code after exhausting its retry count, or if there was an error starting the Task, for example due to a resource file download error. The default is noaction. + * + * Possible values: "noaction", "performexitoptionsjobaction" + */ onTaskFailure?: OnBatchTaskFailure; /** The network configuration for the Job. */ networkConfiguration?: BatchJobNetworkConfiguration; @@ -1304,9 +1448,17 @@ export interface ExitCodeMapping { /** Specifies how the Batch service responds to a particular exit condition. */ export interface ExitOptions { - /** An action to take on the Job containing the Task, if the Task completes with the given exit condition and the Job's onTaskFailed property is 'performExitOptionsJobAction'. The default is none for exit code 0 and terminate for all other exit conditions. If the Job's onTaskFailed property is noaction, then specifying this property returns an error and the add Task request fails with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). */ + /** + * An action to take on the Job containing the Task, if the Task completes with the given exit condition and the Job's onTaskFailed property is 'performExitOptionsJobAction'. The default is none for exit code 0 and terminate for all other exit conditions. If the Job's onTaskFailed property is noaction, then specifying this property returns an error and the add Task request fails with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). + * + * Possible values: "none", "disable", "terminate" + */ jobAction?: BatchJobAction; - /** An action that the Batch service performs on Tasks that depend on this Task. Possible values are 'satisfy' (allowing dependent tasks to progress) and 'block' (dependent tasks continue to wait). Batch does not yet support cancellation of dependent tasks. */ + /** + * An action that the Batch service performs on Tasks that depend on this Task. Possible values are 'satisfy' (allowing dependent tasks to progress) and 'block' (dependent tasks continue to wait). Batch does not yet support cancellation of dependent tasks. + * + * Possible values: "satisfy", "block" + */ dependencyAction?: DependencyAction; } @@ -1406,7 +1558,11 @@ export interface BatchTaskExecutionInfo { requeueCount: number; /** The most recent time at which the Task has been requeued by the Batch service as the result of a user request. This property is set only if the requeueCount is nonzero. */ lastRequeueTime?: Date | string; - /** The result of the Task execution. If the value is 'failed', then the details of the failure can be found in the failureInfo property. */ + /** + * The result of the Task execution. If the value is 'failed', then the details of the failure can be found in the failureInfo property. + * + * Possible values: "success", "failure" + */ result?: BatchTaskExecutionResult; } @@ -1484,13 +1640,21 @@ export interface BatchNodeUserUpdateContent { /** Parameters for rebooting an Azure Batch Compute Node. */ export interface BatchNodeRebootContent { - /** When to reboot the Compute Node and what to do with currently running Tasks. The default value is requeue. */ + /** + * When to reboot the Compute Node and what to do with currently running Tasks. The default value is requeue. + * + * Possible values: "requeue", "terminate", "taskcompletion", "retaineddata" + */ nodeRebootOption?: BatchNodeRebootOption; } /** Parameters for disabling scheduling on an Azure Batch Compute Node. */ export interface BatchNodeDisableSchedulingContent { - /** What to do with currently running Tasks when disabling Task scheduling on the Compute Node. The default value is requeue. */ + /** + * What to do with currently running Tasks when disabling Task scheduling on the Compute Node. The default value is requeue. + * + * Possible values: "requeue", "terminate", "taskcompletion" + */ nodeDisableSchedulingOption?: BatchNodeDisableSchedulingOption; } diff --git a/sdk/batch/batch-rest/src/outputModels.ts b/sdk/batch/batch-rest/src/outputModels.ts index a8968ab6011c..6c7d5a4e7b11 100644 --- a/sdk/batch/batch-rest/src/outputModels.ts +++ b/sdk/batch/batch-rest/src/outputModels.ts @@ -142,17 +142,29 @@ export interface WindowsConfigurationOutput { export interface DataDiskOutput { /** The logical unit number. The logicalUnitNumber is used to uniquely identify each data disk. If attaching multiple disks, each should have a distinct logicalUnitNumber. The value must be between 0 and 63, inclusive. */ lun: number; - /** The type of caching to be enabled for the data disks. The default value for caching is readwrite. For information about the caching options see: https://blogs.msdn.microsoft.com/windowsazurestorage/2012/06/27/exploring-windows-azure-drives-disks-and-images/. */ + /** + * The type of caching to be enabled for the data disks. The default value for caching is readwrite. For information about the caching options see: https://blogs.msdn.microsoft.com/windowsazurestorage/2012/06/27/exploring-windows-azure-drives-disks-and-images/. + * + * Possible values: "none", "readonly", "readwrite" + */ caching?: CachingTypeOutput; /** The initial disk size in gigabytes. */ diskSizeGB: number; - /** The storage Account type to be used for the data disk. If omitted, the default is "standard_lrs". */ + /** + * The storage Account type to be used for the data disk. If omitted, the default is "standard_lrs". + * + * Possible values: "standard_lrs", "premium_lrs", "standardssd_lrs" + */ storageAccountType?: StorageAccountTypeOutput; } /** The configuration for container-enabled Pools. */ export interface ContainerConfigurationOutput { - /** The container technology to be used. */ + /** + * The container technology to be used. + * + * Possible values: "dockerCompatible", "criCompatible" + */ type: ContainerTypeOutput; /** The collection of container Image names. 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[]; @@ -197,7 +209,11 @@ export interface DiskEncryptionConfigurationOutput { * with best effort balancing. */ export interface BatchNodePlacementConfigurationOutput { - /** Node placement Policy type on Batch Pools. Allocation policy used by Batch Service to provision the nodes. If not specified, Batch will use the regional policy. */ + /** + * Node placement Policy type on Batch Pools. Allocation policy used by Batch Service to provision the nodes. If not specified, Batch will use the regional policy. + * + * Possible values: "regional", "zonal" + */ policy?: BatchNodePlacementPolicyTypeOutput; } @@ -227,7 +243,11 @@ export interface VMExtensionOutput { export interface OSDiskOutput { /** Specifies the ephemeral Disk Settings for the operating system disk used by the compute node (VM). */ ephemeralOSDiskSettings?: DiffDiskSettingsOutput; - /** Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The default values are: None for Standard storage. ReadOnly for Premium storage. */ + /** + * Specifies the caching requirements. Possible values are: None, ReadOnly, ReadWrite. The default values are: None for Standard storage. ReadOnly for Premium storage. + * + * Possible values: "none", "readonly", "readwrite" + */ caching?: CachingTypeOutput; /** The initial disk size in GB when creating new OS disk. */ diskSizeGB?: number; @@ -242,13 +262,21 @@ export interface OSDiskOutput { * compute node (VM). */ export interface DiffDiskSettingsOutput { - /** Specifies the ephemeral disk placement for operating system disk for all VMs in the pool. This property can be used by user in the request to choose the location 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. */ + /** + * Specifies the ephemeral disk placement for operating system disk for all VMs in the pool. This property can be used by user in the request to choose the location 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. + * + * Possible values: "cachedisk" + */ placement?: DiffDiskPlacementOutput; } /** The managed disk parameters. */ export interface ManagedDiskOutput { - /** The storage account type for managed disk. */ + /** + * The storage account type for managed disk. + * + * Possible values: "standard_lrs", "premium_lrs", "standardssd_lrs" + */ storageAccountType: StorageAccountTypeOutput; } @@ -256,7 +284,11 @@ export interface ManagedDiskOutput { export interface SecurityProfileOutput { /** 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 SecurityType of the virtual machine. It has to be set to any specified value to enable UefiSettings. */ + /** + * Specifies the SecurityType of the virtual machine. It has to be set to any specified value to enable UefiSettings. + * + * Possible values: "trustedLaunch" + */ securityType: SecurityTypesOutput; /** Specifies the security settings like secure boot and vTPM used while creating the virtual machine. Specifies the security settings like secure boot and vTPM used while creating the virtual machine. */ uefiSettings: UefiSettingsOutput; @@ -283,7 +315,11 @@ export interface ServiceArtifactReferenceOutput { export interface NetworkConfigurationOutput { /** The ARM resource identifier of the virtual network subnet which the Compute Nodes of the Pool will join. This is of the form /subscriptions/{subscription}/resourceGroups/{group}/providers/{provider}/virtualNetworks/{network}/subnets/{subnet}. 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 Compute Nodes in the Pool. If the subnet doesn't have enough free IP addresses, the Pool will partially allocate 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 Nodes. This can be verified by checking if the specified VNet has any associated Network Security Groups (NSG). If communication to the Nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the Compute Nodes to unusable. For Pools created with virtualMachineConfiguration only ARM virtual networks ('Microsoft.Network/virtualNetworks') are supported. If the specified VNet has any associated Network Security Groups (NSG), then a few reserved system ports must be enabled for inbound communication. For Pools created with a virtual machine configuration, 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. */ + /** + * The scope of dynamic vnet assignment. + * + * Possible values: "none", "job" + */ dynamicVNetAssignmentScope?: DynamicVNetAssignmentScopeOutput; /** The configuration for endpoints on Compute Nodes in the Batch Pool. Pool endpoint configuration is only supported on Pools with the virtualMachineConfiguration property. */ endpointConfiguration?: BatchPoolEndpointConfigurationOutput; @@ -306,7 +342,11 @@ export interface BatchPoolEndpointConfigurationOutput { export interface InboundNatPoolOutput { /** The name of the endpoint. 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. */ + /** + * The protocol of the endpoint. + * + * Possible values: "tcp", "udp" + */ protocol: InboundEndpointProtocolOutput; /** The port number on the Compute Node. 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; @@ -322,7 +362,11 @@ export interface InboundNatPoolOutput { export interface NetworkSecurityGroupRuleOutput { /** The priority for this rule. 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. */ + /** + * The action that should be taken for a specified IP address, subnet range or tag. + * + * Possible values: "allow", "deny" + */ access: NetworkSecurityGroupRuleAccessOutput; /** The source address prefix or tag to match for the rule. 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; @@ -332,7 +376,11 @@ export interface NetworkSecurityGroupRuleOutput { /** The public IP Address configuration of the networking configuration of a Pool. */ export interface PublicIpAddressConfigurationOutput { - /** The provisioning type for Public IP Addresses for the Pool. The default value is BatchManaged. */ + /** + * The provisioning type for Public IP Addresses for the Pool. The default value is BatchManaged. + * + * Possible values: "batchmanaged", "usermanaged", "nopublicipaddresses" + */ provision?: IpAddressProvisioningTypeOutput; /** The list of public IPs which the Batch service will use when provisioning Compute Nodes. 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[]; @@ -378,7 +426,11 @@ export interface BatchTaskContainerSettingsOutput { imageName: string; /** The private registry which contains the container Image. This setting can be omitted if was already provided at Pool creation. */ registry?: ContainerRegistryReferenceOutput; - /** The location of the container Task working directory. The default is 'taskWorkingDirectory'. */ + /** + * The location of the container Task working directory. The default is 'taskWorkingDirectory'. + * + * Possible values: "taskWorkingDirectory", "containerImageDefault" + */ workingDirectory?: ContainerWorkingDirectoryOutput; } @@ -418,9 +470,17 @@ export interface UserIdentityOutput { /** Specifies the options for the auto user that runs an Azure Batch Task. */ export interface AutoUserSpecificationOutput { - /** The scope for the auto user. 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, such as if the task mutates the registry in a way which could impact other tasks. */ + /** + * The scope for the auto user. 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, such as if the task mutates the registry in a way which could impact other tasks. + * + * Possible values: "task", "pool" + */ scope?: AutoUserScopeOutput; - /** The elevation level of the auto user. The default value is nonAdmin. */ + /** + * The elevation level of the auto user. The default value is nonAdmin. + * + * Possible values: "nonadmin", "admin" + */ elevationLevel?: ElevationLevelOutput; } @@ -434,7 +494,11 @@ export interface BatchApplicationPackageReferenceOutput { /** Specifies how Tasks should be distributed across Compute Nodes. */ export interface BatchTaskSchedulingPolicyOutput { - /** How Tasks are distributed across Compute Nodes in a Pool. If not specified, the default is spread. */ + /** + * How Tasks are distributed across Compute Nodes in a Pool. If not specified, the default is spread. + * + * Possible values: "spread", "pack" + */ nodeFillType: BatchNodeFillTypeOutput; } @@ -447,7 +511,11 @@ export interface UserAccountOutput { name: string; /** The password for the user Account. */ password: string; - /** The elevation level of the user Account. The default value is nonAdmin. */ + /** + * The elevation level of the user Account. The default value is nonAdmin. + * + * Possible values: "nonadmin", "admin" + */ elevationLevel?: ElevationLevelOutput; /** The Linux-specific user configuration for the user Account. This property is ignored if specified on a Windows Pool. If not specified, the user is created with the default options. */ linuxUserConfiguration?: LinuxUserConfigurationOutput; @@ -467,7 +535,11 @@ export interface LinuxUserConfigurationOutput { /** Properties used to create a user Account on a Windows Compute Node. */ export interface WindowsUserConfigurationOutput { - /** The login mode for the user. The default value for VirtualMachineConfiguration Pools is 'batch'. */ + /** + * The login mode for the user. The default value for VirtualMachineConfiguration Pools is 'batch'. + * + * Possible values: "batch", "interactive" + */ loginMode?: LoginModeOutput; } @@ -552,7 +624,11 @@ export interface AzureFileShareConfigurationOutput { /** Describes an upgrade policy - automatic, manual, or rolling. */ export interface UpgradePolicyOutput { - /** 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. */ + /** + * 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. + * + * Possible values: "automatic", "manual", "rolling" + */ mode: UpgradeModeOutput; /** Configuration parameters used for performing automatic OS Upgrade. The configuration parameters used for performing automatic OS upgrade. */ automaticOSUpgradePolicy?: AutomaticOsUpgradePolicyOutput; @@ -612,11 +688,19 @@ export interface BatchPoolOutput { readonly lastModified?: string; /** The creation time of the Pool. */ readonly creationTime?: string; - /** The current state of the Pool. */ + /** + * The current state of the Pool. + * + * Possible values: "active", "deleting" + */ readonly state?: BatchPoolStateOutput; /** The time at which the Pool entered its current state. */ readonly stateTransitionTime?: string; - /** Whether the Pool is resizing. */ + /** + * Whether the Pool is resizing. + * + * Possible values: "steady", "resizing", "stopping" + */ readonly allocationState?: AllocationStateOutput; /** The time at which the Pool entered its current allocation state. */ readonly allocationStateTransitionTime?: string; @@ -668,9 +752,17 @@ export interface BatchPoolOutput { readonly mountConfiguration?: Array; /** The identity of the Batch pool, if configured. The list of user identities associated with the Batch pool. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ readonly identity?: BatchPoolIdentityOutput; - /** The desired node communication mode for the pool. If omitted, the default value is Default. */ + /** + * The desired node communication mode for the pool. If omitted, the default value is Default. + * + * Possible values: "default", "classic", "simplified" + */ targetNodeCommunicationMode?: BatchNodeCommunicationModeOutput; - /** The current state of the pool communication mode. */ + /** + * The current state of the pool communication mode. + * + * Possible values: "default", "classic", "simplified" + */ readonly currentNodeCommunicationMode?: BatchNodeCommunicationModeOutput; /** The upgrade policy for the Pool. Describes an upgrade policy - automatic, manual, or rolling. */ upgradePolicy?: UpgradePolicyOutput; @@ -770,7 +862,11 @@ export interface BatchPoolResourceStatisticsOutput { /** The identity of the Batch pool, if configured. */ export interface BatchPoolIdentityOutput { - /** The identity of the Batch pool, if configured. The list of user identities associated with the Batch pool. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ + /** + * The identity of the Batch pool, if configured. The list of user identities associated with the Batch pool. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + * Possible values: "UserAssigned", "None" + */ type: BatchPoolIdentityTypeOutput; /** The list of user identities associated with the Batch account. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ userAssignedIdentities?: Array; @@ -803,13 +899,21 @@ export interface BatchSupportedImageOutput { nodeAgentSKUId: string; /** The reference to the Azure Virtual Machine's Marketplace Image. */ imageReference: ImageReferenceOutput; - /** The type of operating system (e.g. Windows or Linux) of the Image. */ + /** + * The type of operating system (e.g. Windows or Linux) of the Image. + * + * Possible values: "linux", "windows" + */ osType: OSTypeOutput; /** The capabilities or features which the Image supports. Not every capability of the Image is listed. Capabilities in this list are considered of special interest and are generally related to integration with other features in the Azure Batch service. */ capabilities?: string[]; /** The time when the Azure Batch service will stop accepting create Pool requests for the Image. */ batchSupportEndOfLife?: string; - /** Whether the Azure Batch service actively verifies that the Image is compatible with the associated Compute Node agent SKU. */ + /** + * Whether the Azure Batch service actively verifies that the Image is compatible with the associated Compute Node agent SKU. + * + * Possible values: "verified", "unverified" + */ verificationType: ImageVerificationTypeOutput; } @@ -881,11 +985,19 @@ export interface BatchJobOutput { readonly lastModified?: string; /** The creation time of the Job. */ readonly creationTime?: string; - /** The current state of the Job. */ + /** + * The current state of the Job. + * + * Possible values: "active", "disabling", "disabled", "enabling", "terminating", "completed", "deleting" + */ readonly state?: BatchJobStateOutput; /** The time at which the Job entered its current state. */ readonly stateTransitionTime?: string; - /** The previous state of the Job. This property is not set if the Job is in its initial Active state. */ + /** + * The previous state of the Job. This property is not set if the Job is in its initial Active state. + * + * Possible values: "active", "disabling", "disabled", "enabling", "terminating", "completed", "deleting" + */ readonly previousState?: BatchJobStateOutput; /** The time at which the Job entered its previous state. This property is not set if the Job is in its initial Active state. */ readonly previousStateTransitionTime?: string; @@ -907,9 +1019,17 @@ export interface BatchJobOutput { readonly commonEnvironmentSettings?: Array; /** The Pool settings associated with the Job. */ poolInfo: BatchPoolInfoOutput; - /** The action the Batch service should take when all Tasks in the Job are in the completed state. The default is noaction. */ + /** + * The action the Batch service should take when all Tasks in the Job are in the completed state. The default is noaction. + * + * Possible values: "noaction", "terminatejob" + */ onAllTasksComplete?: OnAllBatchTasksCompleteOutput; - /** The action the Batch service should take when any Task in the Job fails. A Task is considered to have failed if has a failureInfo. A failureInfo is set if the Task completes with a non-zero exit code after exhausting its retry count, or if there was an error starting the Task, for example due to a resource file download error. The default is noaction. */ + /** + * The action the Batch service should take when any Task in the Job fails. A Task is considered to have failed if has a failureInfo. A failureInfo is set if the Task completes with a non-zero exit code after exhausting its retry count, or if there was an error starting the Task, for example due to a resource file download error. The default is noaction. + * + * Possible values: "noaction", "performexitoptionsjobaction" + */ readonly onTaskFailure?: OnBatchTaskFailureOutput; /** The network configuration for the Job. */ readonly networkConfiguration?: BatchJobNetworkConfigurationOutput; @@ -1037,7 +1157,11 @@ export interface HttpHeaderOutput { * to perform the upload. */ export interface OutputFileUploadConfigOutput { - /** The conditions under which the Task output file or set of files should be uploaded. The default is taskcompletion. */ + /** + * The conditions under which the Task output file or set of files should be uploaded. The default is taskcompletion. + * + * Possible values: "tasksuccess", "taskfailure", "taskcompletion" + */ uploadCondition: OutputFileUploadConditionOutput; } @@ -1161,7 +1285,11 @@ export interface BatchPoolInfoOutput { export interface BatchAutoPoolSpecificationOutput { /** A prefix to be added to the unique identifier when a Pool is automatically created. The Batch service assigns each auto Pool a unique identifier on creation. To distinguish between Pools created for different purposes, you can specify this element to add a prefix to the ID that is assigned. The prefix can be up to 20 characters long. */ autoPoolIdPrefix?: string; - /** The minimum lifetime of created auto Pools, and how multiple Jobs on a schedule are assigned to Pools. */ + /** + * The minimum lifetime of created auto Pools, and how multiple Jobs on a schedule are assigned to Pools. + * + * Possible values: "jobschedule", "job" + */ poolLifetimeOption: BatchPoolLifetimeOptionOutput; /** Whether to keep an auto Pool alive after its lifetime expires. If false, the Batch service deletes the Pool once its lifetime (as determined by the poolLifetimeOption setting) expires; that is, when the Job or Job Schedule completes. If true, the Batch service does not delete the Pool automatically. It is up to the user to delete auto Pools created with this option. */ keepAlive?: boolean; @@ -1209,7 +1337,11 @@ export interface BatchPoolSpecificationOutput { metadata?: Array; /** A list of file systems to mount on each node in the pool. This supports Azure Files, NFS, CIFS/SMB, and Blobfuse. */ mountConfiguration?: Array; - /** The desired node communication mode for the pool. If omitted, the default value is Default. */ + /** + * The desired node communication mode for the pool. If omitted, the default value is Default. + * + * Possible values: "default", "classic", "simplified" + */ targetNodeCommunicationMode?: BatchNodeCommunicationModeOutput; /** The upgrade policy for the Pool. Describes an upgrade policy - automatic, manual, or rolling. */ upgradePolicy?: UpgradePolicyOutput; @@ -1237,7 +1369,11 @@ export interface BatchJobExecutionInfoOutput { /** An error encountered by the Batch service when scheduling a Job. */ export interface BatchJobSchedulingErrorOutput { - /** The category of the Job scheduling error. */ + /** + * The category of the Job scheduling error. + * + * Possible values: "usererror", "servererror" + */ category: ErrorCategoryOutput; /** An identifier for the Job scheduling error. Codes are invariant and are intended to be consumed programmatically. */ code?: string; @@ -1321,7 +1457,11 @@ export interface BatchJobPreparationTaskExecutionInfoOutput { startTime: string; /** The time at which the Job Preparation Task completed. This property is set only if the Task is in the Completed state. */ endTime?: string; - /** The current state of the Job Preparation Task on the Compute Node. */ + /** + * The current state of the Job Preparation Task on the Compute Node. + * + * Possible values: "running", "completed" + */ state: BatchJobPreparationTaskStateOutput; /** The root directory of the Job Preparation Task on the Compute Node. You can use this path to retrieve files created by the Task, such as log files. */ taskRootDirectory?: string; @@ -1337,7 +1477,11 @@ export interface BatchJobPreparationTaskExecutionInfoOutput { retryCount: number; /** The most recent time at which a retry of the Job Preparation Task started running. This property is set only if the Task was retried (i.e. retryCount is nonzero). If present, this is typically the same as startTime, but may be different if the Task has been restarted for reasons other than retry; for example, if the Compute Node was rebooted during a retry, then the startTime is updated but the lastRetryTime is not. */ lastRetryTime?: string; - /** The result of the Task execution. If the value is 'failed', then the details of the failure can be found in the failureInfo property. */ + /** + * The result of the Task execution. If the value is 'failed', then the details of the failure can be found in the failureInfo property. + * + * Possible values: "success", "failure" + */ result?: BatchTaskExecutionResultOutput; } @@ -1353,7 +1497,11 @@ export interface BatchTaskContainerExecutionInfoOutput { /** Information about a Task failure. */ export interface BatchTaskFailureInfoOutput { - /** The category of the Task error. */ + /** + * The category of the Task error. + * + * Possible values: "usererror", "servererror" + */ category: ErrorCategoryOutput; /** An identifier for the Task error. Codes are invariant and are intended to be consumed programmatically. */ code?: string; @@ -1372,7 +1520,11 @@ export interface BatchJobReleaseTaskExecutionInfoOutput { startTime: string; /** The time at which the Job Release Task completed. This property is set only if the Task is in the Completed state. */ endTime?: string; - /** The current state of the Job Release Task on the Compute Node. */ + /** + * The current state of the Job Release Task on the Compute Node. + * + * Possible values: "running", "completed" + */ state: BatchJobReleaseTaskStateOutput; /** The root directory of the Job Release Task on the Compute Node. You can use this path to retrieve files created by the Task, such as log files. */ taskRootDirectory?: string; @@ -1384,7 +1536,11 @@ export interface BatchJobReleaseTaskExecutionInfoOutput { containerInfo?: BatchTaskContainerExecutionInfoOutput; /** Information describing the Task failure, if any. This property is set only if the Task is in the completed state and encountered a failure. */ failureInfo?: BatchTaskFailureInfoOutput; - /** The result of the Task execution. If the value is 'failed', then the details of the failure can be found in the failureInfo property. */ + /** + * The result of the Task execution. If the value is 'failed', then the details of the failure can be found in the failureInfo property. + * + * Possible values: "success", "failure" + */ result?: BatchTaskExecutionResultOutput; } @@ -1441,11 +1597,19 @@ export interface BatchJobScheduleOutput { readonly lastModified?: string; /** The creation time of the Job Schedule. */ readonly creationTime?: string; - /** The current state of the Job Schedule. */ + /** + * The current state of the Job Schedule. + * + * Possible values: "active", "completed", "disabled", "terminating", "deleting" + */ readonly state?: BatchJobScheduleStateOutput; /** The time at which the Job Schedule entered the current state. */ readonly stateTransitionTime?: string; - /** The previous state of the Job Schedule. This property is not present if the Job Schedule is in its initial active state. */ + /** + * The previous state of the Job Schedule. This property is not present if the Job Schedule is in its initial active state. + * + * Possible values: "active", "completed", "disabled", "terminating", "deleting" + */ readonly previousState?: BatchJobScheduleStateOutput; /** The time at which the Job Schedule entered its previous state. This property is not present if the Job Schedule is in its initial active state. */ readonly previousStateTransitionTime?: string; @@ -1488,9 +1652,17 @@ export interface BatchJobSpecificationOutput { displayName?: string; /** Whether Tasks in the Job can define dependencies on each other. The default is false. */ usesTaskDependencies?: boolean; - /** The action the Batch service should take when all Tasks in a Job created under this schedule are in the completed state. Note that if a Job contains no Tasks, then all Tasks are considered complete. This option is therefore most commonly used with a Job Manager task; if you want to use automatic Job termination without a Job Manager, you should initially set onAllTasksComplete to noaction and update the Job properties to set onAllTasksComplete to terminatejob once you have finished adding Tasks. The default is noaction. */ + /** + * The action the Batch service should take when all Tasks in a Job created under this schedule are in the completed state. Note that if a Job contains no Tasks, then all Tasks are considered complete. This option is therefore most commonly used with a Job Manager task; if you want to use automatic Job termination without a Job Manager, you should initially set onAllTasksComplete to noaction and update the Job properties to set onAllTasksComplete to terminatejob once you have finished adding Tasks. The default is noaction. + * + * Possible values: "noaction", "terminatejob" + */ onAllTasksComplete?: OnAllBatchTasksCompleteOutput; - /** The action the Batch service should take when any Task fails in a Job created under this schedule. A Task is considered to have failed if it have failed if has a failureInfo. A failureInfo is set if the Task completes with a non-zero exit code after exhausting its retry count, or if there was an error starting the Task, for example due to a resource file download error. The default is noaction. */ + /** + * The action the Batch service should take when any Task fails in a Job created under this schedule. A Task is considered to have failed if it have failed if has a failureInfo. A failureInfo is set if the Task completes with a non-zero exit code after exhausting its retry count, or if there was an error starting the Task, for example due to a resource file download error. The default is noaction. + * + * Possible values: "noaction", "performexitoptionsjobaction" + */ onTaskFailure?: OnBatchTaskFailureOutput; /** The network configuration for the Job. */ networkConfiguration?: BatchJobNetworkConfigurationOutput; @@ -1598,9 +1770,17 @@ export interface ExitCodeMappingOutput { /** Specifies how the Batch service responds to a particular exit condition. */ export interface ExitOptionsOutput { - /** An action to take on the Job containing the Task, if the Task completes with the given exit condition and the Job's onTaskFailed property is 'performExitOptionsJobAction'. The default is none for exit code 0 and terminate for all other exit conditions. If the Job's onTaskFailed property is noaction, then specifying this property returns an error and the add Task request fails with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). */ + /** + * An action to take on the Job containing the Task, if the Task completes with the given exit condition and the Job's onTaskFailed property is 'performExitOptionsJobAction'. The default is none for exit code 0 and terminate for all other exit conditions. If the Job's onTaskFailed property is noaction, then specifying this property returns an error and the add Task request fails with an invalid property value error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). + * + * Possible values: "none", "disable", "terminate" + */ jobAction?: BatchJobActionOutput; - /** An action that the Batch service performs on Tasks that depend on this Task. Possible values are 'satisfy' (allowing dependent tasks to progress) and 'block' (dependent tasks continue to wait). Batch does not yet support cancellation of dependent tasks. */ + /** + * An action that the Batch service performs on Tasks that depend on this Task. Possible values are 'satisfy' (allowing dependent tasks to progress) and 'block' (dependent tasks continue to wait). Batch does not yet support cancellation of dependent tasks. + * + * Possible values: "satisfy", "block" + */ dependencyAction?: DependencyActionOutput; } @@ -1698,11 +1878,19 @@ export interface BatchTaskOutput { readonly creationTime?: string; /** How the Batch service should respond when the Task completes. */ readonly exitConditions?: ExitConditionsOutput; - /** The current state of the Task. */ + /** + * The current state of the Task. + * + * Possible values: "active", "preparing", "running", "completed" + */ readonly state?: BatchTaskStateOutput; /** The time at which the Task entered its current state. */ readonly stateTransitionTime?: string; - /** The previous state of the Task. This property is not set if the Task is in its initial Active state. */ + /** + * The previous state of the Task. This property is not set if the Task is in its initial Active state. + * + * Possible values: "active", "preparing", "running", "completed" + */ readonly previousState?: BatchTaskStateOutput; /** The time at which the Task entered its previous state. This property is not set if the Task is in its initial Active state. */ readonly previousStateTransitionTime?: string; @@ -1760,7 +1948,11 @@ export interface BatchTaskExecutionInfoOutput { requeueCount: number; /** The most recent time at which the Task has been requeued by the Batch service as the result of a user request. This property is set only if the requeueCount is nonzero. */ lastRequeueTime?: string; - /** The result of the Task execution. If the value is 'failed', then the details of the failure can be found in the failureInfo property. */ + /** + * The result of the Task execution. If the value is 'failed', then the details of the failure can be found in the failureInfo property. + * + * Possible values: "success", "failure" + */ result?: BatchTaskExecutionResultOutput; } @@ -1814,7 +2006,11 @@ export interface BatchTaskAddCollectionResultOutput { /** Result for a single Task added as part of an add Task collection operation. */ export interface BatchTaskAddResultOutput { - /** The status of the add Task request. */ + /** + * The status of the add Task request. + * + * Possible values: "success", "clienterror", "servererror" + */ status: BatchTaskAddStatusOutput; /** The ID of the Task for which this is the result. */ taskId: string; @@ -1852,15 +2048,27 @@ export interface BatchSubtaskOutput { containerInfo?: BatchTaskContainerExecutionInfoOutput; /** Information describing the Task failure, if any. This property is set only if the Task is in the completed state and encountered a failure. */ failureInfo?: BatchTaskFailureInfoOutput; - /** The current state of the subtask. */ + /** + * The current state of the subtask. + * + * Possible values: "preparing", "running", "completed" + */ state?: BatchSubtaskStateOutput; /** The time at which the subtask entered its current state. */ stateTransitionTime?: string; - /** The previous state of the subtask. This property is not set if the subtask is in its initial running state. */ + /** + * The previous state of the subtask. This property is not set if the subtask is in its initial running state. + * + * Possible values: "preparing", "running", "completed" + */ previousState?: BatchSubtaskStateOutput; /** The time at which the subtask entered its previous state. This property is not set if the subtask is in its initial running state. */ previousStateTransitionTime?: string; - /** The result of the Task execution. If the value is 'failed', then the details of the failure can be found in the failureInfo property. */ + /** + * The result of the Task execution. If the value is 'failed', then the details of the failure can be found in the failureInfo property. + * + * Possible values: "success", "failure" + */ result?: BatchTaskExecutionResultOutput; } @@ -1907,9 +2115,17 @@ export interface BatchNodeOutput { id?: string; /** The URL of the Compute Node. */ url?: string; - /** The current state of the Compute Node. The Spot/Low-priority Compute Node has been preempted. Tasks which were running on the Compute Node when it was preempted will be rescheduled when another Compute Node becomes available. */ + /** + * The current state of the Compute Node. The Spot/Low-priority Compute Node has been preempted. Tasks which were running on the Compute Node when it was preempted will be rescheduled when another Compute Node becomes available. + * + * Possible values: "idle", "rebooting", "reimaging", "running", "unusable", "creating", "starting", "waitingforstarttask", "starttaskfailed", "unknown", "leavingpool", "offline", "preempted", "upgradingos" + */ state?: BatchNodeStateOutput; - /** Whether the Compute Node is available for Task scheduling. */ + /** + * Whether the Compute Node is available for Task scheduling. + * + * Possible values: "enabled", "disabled" + */ schedulingState?: SchedulingStateOutput; /** The time at which the Compute Node entered its current state. */ stateTransitionTime?: string; @@ -1959,7 +2175,11 @@ export interface BatchTaskInfoOutput { taskId?: string; /** The ID of the subtask if the Task is a multi-instance Task. */ subtaskId?: number; - /** The current state of the Task. */ + /** + * The current state of the Task. + * + * Possible values: "active", "preparing", "running", "completed" + */ taskState: BatchTaskStateOutput; /** Information about the execution of the Task. */ executionInfo?: BatchTaskExecutionInfoOutput; @@ -1967,7 +2187,11 @@ export interface BatchTaskInfoOutput { /** Information about a StartTask running on a Compute Node. */ export interface BatchStartTaskInfoOutput { - /** The state of the StartTask on the Compute Node. */ + /** + * The state of the StartTask on the Compute Node. + * + * Possible values: "running", "completed" + */ state: BatchStartTaskStateOutput; /** The time at which the StartTask started running. This value is reset every time the Task is restarted or retried (that is, this is the most recent time at which the StartTask started running). */ startTime: string; @@ -1983,7 +2207,11 @@ export interface BatchStartTaskInfoOutput { retryCount: number; /** The most recent time at which a retry of the Task started running. This element is present only if the Task was retried (i.e. retryCount is nonzero). If present, this is typically the same as startTime, but may be different if the Task has been restarted for reasons other than retry; for example, if the Compute Node was rebooted during a retry, then the startTime is updated but the lastRetryTime is not. */ lastRetryTime?: string; - /** The result of the Task execution. If the value is 'failed', then the details of the failure can be found in the failureInfo property. */ + /** + * The result of the Task execution. If the value is 'failed', then the details of the failure can be found in the failureInfo property. + * + * Possible values: "success", "failure" + */ result?: BatchTaskExecutionResultOutput; } @@ -2007,7 +2235,11 @@ export interface BatchNodeEndpointConfigurationOutput { export interface InboundEndpointOutput { /** The name of the endpoint. */ name: string; - /** The protocol of the endpoint. */ + /** + * The protocol of the endpoint. + * + * Possible values: "tcp", "udp" + */ protocol: InboundEndpointProtocolOutput; /** The public IP address of the Compute Node. */ publicIPAddress: string; @@ -2088,7 +2320,11 @@ export interface InstanceViewStatusOutput { code?: string; /** The localized label for the status. */ displayStatus?: string; - /** Level code. */ + /** + * Level code. + * + * Possible values: "Error", "Info", "Warning" + */ level?: StatusLevelTypesOutput; /** The detailed status message. */ message?: string; diff --git a/sdk/batch/batch-rest/src/paginateHelper.ts b/sdk/batch/batch-rest/src/paginateHelper.ts index 80517fea98bd..b2a24801c35b 100644 --- a/sdk/batch/batch-rest/src/paginateHelper.ts +++ b/sdk/batch/batch-rest/src/paginateHelper.ts @@ -1,8 +1,16 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { getPagedAsyncIterator, PagedAsyncIterableIterator, PagedResult } from "@azure/core-paging"; -import { Client, createRestError, PathUncheckedResponse } from "@azure-rest/core-client"; +import { + getPagedAsyncIterator, + PagedAsyncIterableIterator, + PagedResult, +} from "@azure/core-paging"; +import { + Client, + createRestError, + PathUncheckedResponse, +} from "@azure-rest/core-client"; /** * Helper type to extract the type of an array @@ -69,7 +77,9 @@ export function paginate( typeof customGetPage === "function" ? customGetPage : async (pageLink: string) => { - const result = firstRun ? initialResponse : await client.pathUnchecked(pageLink).get(); + const result = firstRun + ? initialResponse + : await client.pathUnchecked(pageLink).get(); firstRun = false; checkPagingRequest(result); const nextLink = getNextLink(result.body, nextLinkName); @@ -95,7 +105,9 @@ function getNextLink(body: unknown, nextLinkName?: string): string | undefined { const nextLink = (body as Record)[nextLinkName]; if (typeof nextLink !== "string" && typeof nextLink !== "undefined") { - throw new Error(`Body Property ${nextLinkName} should be a string or undefined`); + throw new Error( + `Body Property ${nextLinkName} should be a string or undefined`, + ); } return nextLink; @@ -123,7 +135,18 @@ function getElements(body: unknown, itemName: string): T[] { * Checks if a request failed */ function checkPagingRequest(response: PathUncheckedResponse): void { - const Http2xxStatusCodes = ["200", "201", "202", "203", "204", "205", "206", "207", "208", "226"]; + const Http2xxStatusCodes = [ + "200", + "201", + "202", + "203", + "204", + "205", + "206", + "207", + "208", + "226", + ]; if (!Http2xxStatusCodes.includes(response.status)) { throw createRestError( `Pagination failed with unexpected statusCode ${response.status}`, @@ -146,7 +169,9 @@ function getPaginationProperties(initialResponse: PathUncheckedResponse) { let itemName: string | undefined; for (const name of nextLinkNames) { - const nextLink = (initialResponse.body as Record)[name] as string; + const nextLink = (initialResponse.body as Record)[ + name + ] as string; if (nextLink) { nextLinkName = name; break; @@ -154,7 +179,9 @@ function getPaginationProperties(initialResponse: PathUncheckedResponse) { } for (const name of itemNames) { - const item = (initialResponse.body as Record)[name] as string; + const item = (initialResponse.body as Record)[ + name + ] as string; if (item) { itemName = name; break; diff --git a/sdk/batch/batch-rest/src/parameters.ts b/sdk/batch/batch-rest/src/parameters.ts index 0c8f58f0558e..1b5538cab3de 100644 --- a/sdk/batch/batch-rest/src/parameters.ts +++ b/sdk/batch/batch-rest/src/parameters.ts @@ -243,7 +243,9 @@ export interface ListPoolsHeaderParam { headers?: RawHttpHeadersInput & ListPoolsHeaders; } -export type ListPoolsParameters = ListPoolsQueryParam & ListPoolsHeaderParam & RequestParameters; +export type ListPoolsParameters = ListPoolsQueryParam & + ListPoolsHeaderParam & + RequestParameters; export interface DeletePoolHeaders { /** @@ -298,7 +300,9 @@ export interface DeletePoolHeaderParam { headers?: RawHttpHeadersInput & DeletePoolHeaders; } -export type DeletePoolParameters = DeletePoolQueryParam & DeletePoolHeaderParam & RequestParameters; +export type DeletePoolParameters = DeletePoolQueryParam & + DeletePoolHeaderParam & + RequestParameters; export interface PoolExistsHeaders { /** @@ -353,7 +357,9 @@ export interface PoolExistsHeaderParam { headers?: RawHttpHeadersInput & PoolExistsHeaders; } -export type PoolExistsParameters = PoolExistsQueryParam & PoolExistsHeaderParam & RequestParameters; +export type PoolExistsParameters = PoolExistsQueryParam & + PoolExistsHeaderParam & + RequestParameters; export interface GetPoolHeaders { /** @@ -412,7 +418,9 @@ export interface GetPoolHeaderParam { headers?: RawHttpHeadersInput & GetPoolHeaders; } -export type GetPoolParameters = GetPoolQueryParam & GetPoolHeaderParam & RequestParameters; +export type GetPoolParameters = GetPoolQueryParam & + GetPoolHeaderParam & + RequestParameters; export interface UpdatePoolHeaders { /** @@ -1009,7 +1017,9 @@ export interface DeleteJobHeaderParam { headers?: RawHttpHeadersInput & DeleteJobHeaders; } -export type DeleteJobParameters = DeleteJobQueryParam & DeleteJobHeaderParam & RequestParameters; +export type DeleteJobParameters = DeleteJobQueryParam & + DeleteJobHeaderParam & + RequestParameters; export interface GetJobHeaders { /** @@ -1068,7 +1078,9 @@ export interface GetJobHeaderParam { headers?: RawHttpHeadersInput & GetJobHeaders; } -export type GetJobParameters = GetJobQueryParam & GetJobHeaderParam & RequestParameters; +export type GetJobParameters = GetJobQueryParam & + GetJobHeaderParam & + RequestParameters; export interface UpdateJobHeaders { /** @@ -1330,7 +1342,9 @@ export interface EnableJobHeaderParam { headers?: RawHttpHeadersInput & EnableJobHeaders; } -export type EnableJobParameters = EnableJobQueryParam & EnableJobHeaderParam & RequestParameters; +export type EnableJobParameters = EnableJobQueryParam & + EnableJobHeaderParam & + RequestParameters; export interface TerminateJobHeaders { /** @@ -1489,7 +1503,9 @@ export interface ListJobsHeaderParam { headers?: RawHttpHeadersInput & ListJobsHeaders; } -export type ListJobsParameters = ListJobsQueryParam & ListJobsHeaderParam & RequestParameters; +export type ListJobsParameters = ListJobsQueryParam & + ListJobsHeaderParam & + RequestParameters; export interface ListJobsFromScheduleHeaders { /** @@ -2281,7 +2297,9 @@ export interface ListTasksHeaderParam { headers?: RawHttpHeadersInput & ListTasksHeaders; } -export type ListTasksParameters = ListTasksQueryParam & ListTasksHeaderParam & RequestParameters; +export type ListTasksParameters = ListTasksQueryParam & + ListTasksHeaderParam & + RequestParameters; export interface CreateTaskCollectionHeaders { /** @@ -2381,7 +2399,9 @@ export interface DeleteTaskHeaderParam { headers?: RawHttpHeadersInput & DeleteTaskHeaders; } -export type DeleteTaskParameters = DeleteTaskQueryParam & DeleteTaskHeaderParam & RequestParameters; +export type DeleteTaskParameters = DeleteTaskQueryParam & + DeleteTaskHeaderParam & + RequestParameters; export interface GetTaskHeaders { /** @@ -2440,7 +2460,9 @@ export interface GetTaskHeaderParam { headers?: RawHttpHeadersInput & GetTaskHeaders; } -export type GetTaskParameters = GetTaskQueryParam & GetTaskHeaderParam & RequestParameters; +export type GetTaskParameters = GetTaskQueryParam & + GetTaskHeaderParam & + RequestParameters; export interface ReplaceTaskHeaders { /** @@ -2997,7 +3019,9 @@ export interface GetNodeHeaderParam { headers?: RawHttpHeadersInput & GetNodeHeaders; } -export type GetNodeParameters = GetNodeQueryParam & GetNodeHeaderParam & RequestParameters; +export type GetNodeParameters = GetNodeQueryParam & + GetNodeHeaderParam & + RequestParameters; export interface RebootNodeHeaders { /** @@ -3151,9 +3175,10 @@ export interface GetNodeRemoteLoginSettingsHeaderParam { headers?: RawHttpHeadersInput & GetNodeRemoteLoginSettingsHeaders; } -export type GetNodeRemoteLoginSettingsParameters = GetNodeRemoteLoginSettingsQueryParam & - GetNodeRemoteLoginSettingsHeaderParam & - RequestParameters; +export type GetNodeRemoteLoginSettingsParameters = + GetNodeRemoteLoginSettingsQueryParam & + GetNodeRemoteLoginSettingsHeaderParam & + RequestParameters; export interface UploadNodeLogsHeaders { /** @@ -3241,7 +3266,9 @@ export interface ListNodesHeaderParam { headers?: RawHttpHeadersInput & ListNodesHeaders; } -export type ListNodesParameters = ListNodesQueryParam & ListNodesHeaderParam & RequestParameters; +export type ListNodesParameters = ListNodesQueryParam & + ListNodesHeaderParam & + RequestParameters; export interface GetNodeExtensionHeaders { /** diff --git a/sdk/batch/batch-rest/src/replacePoolPropertiesPolicy.ts b/sdk/batch/batch-rest/src/replacePoolPropertiesPolicy.ts deleted file mode 100644 index 1587246856d4..000000000000 --- a/sdk/batch/batch-rest/src/replacePoolPropertiesPolicy.ts +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { PipelinePolicy } from "@azure/core-rest-pipeline"; -// import { AzureLogger } from "@azure/logger"; - -/** - * KLUGE: Create a new `PipelinePolicy` to add a empty list for the - * `certificateReferences` property in the request body, as it's required - * in our API and the cerficate related features are removed from our TypeSpec - * and the generated code. In the future, this policy should be removed after - * the Batch service side removes the requirement of this property. - * - */ -export function createReplacePoolPropertiesPolicy(): PipelinePolicy { - return { - name: "ReplacePoolPropertiesPolicy", - async sendRequest(request, next) { - if ( - request.url.match(/\/pools\/[^/]+\/updateproperties/) && - request.method === "POST" && - request.body - ) { - try { - const body = JSON.parse(request.body as string); - body.certificateReferences = []; - request.body = JSON.stringify(body); - // console.log("matched", request.body); - } catch (e) { - // Ignore the error - } - } - return next(request); - }, - }; -} diff --git a/sdk/batch/batch-rest/src/responses.ts b/sdk/batch/batch-rest/src/responses.ts index dbd8a974ed68..063e5a51c61f 100644 --- a/sdk/batch/batch-rest/src/responses.ts +++ b/sdk/batch/batch-rest/src/responses.ts @@ -698,13 +698,15 @@ export interface ListJobPreparationAndReleaseTaskStatus200Headers { } /** The request has succeeded. */ -export interface ListJobPreparationAndReleaseTaskStatus200Response extends HttpResponse { +export interface ListJobPreparationAndReleaseTaskStatus200Response + extends HttpResponse { status: "200"; body: BatchJobPreparationAndReleaseTaskStatusListResultOutput; headers: RawHttpHeaders & ListJobPreparationAndReleaseTaskStatus200Headers; } -export interface ListJobPreparationAndReleaseTaskStatusDefaultResponse extends HttpResponse { +export interface ListJobPreparationAndReleaseTaskStatusDefaultResponse + extends HttpResponse { status: string; body: BatchErrorOutput; } @@ -1463,7 +1465,8 @@ export interface GetNodeRemoteLoginSettings200Response extends HttpResponse { headers: RawHttpHeaders & GetNodeRemoteLoginSettings200Headers; } -export interface GetNodeRemoteLoginSettingsDefaultResponse extends HttpResponse { +export interface GetNodeRemoteLoginSettingsDefaultResponse + extends HttpResponse { status: string; body: BatchErrorOutput; } diff --git a/sdk/batch/batch-rest/test/browser/batchSharedKeyCredentials.spec.ts b/sdk/batch/batch-rest/test/browser/batchSharedKeyCredentials.spec.ts deleted file mode 100644 index e721c874c1aa..000000000000 --- a/sdk/batch/batch-rest/test/browser/batchSharedKeyCredentials.spec.ts +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { createBatchSharedKeyCredentialsPolicy } from "../../src/credentials/batchSharedKeyCredentials.js"; -import { AzureNamedKeyCredential } from "@azure/core-auth"; -import { expect, it } from "vitest"; - -it("should throw error in browser environment", () => { - expect(() => - createBatchSharedKeyCredentialsPolicy(new AzureNamedKeyCredential("name", "key")), - ).toThrowError("BatchSharedKeyCredentialsPolicy is not supported in browser environment"); -}); diff --git a/sdk/batch/batch-rest/test/computeNodes.spec.ts b/sdk/batch/batch-rest/test/computeNodes.spec.ts deleted file mode 100644 index 9586582ab3bb..000000000000 --- a/sdk/batch/batch-rest/test/computeNodes.spec.ts +++ /dev/null @@ -1,267 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { Recorder, VitestTestContext, isPlaybackMode } from "@azure-tools/test-recorder"; -import { createBatchClient, createRecorder } from "./utils/recordedClient.js"; -import { - BatchClient, - isUnexpected, - CreatePoolParameters, - CreateNodeUserParameters, - ReplaceNodeUserParameters, - UploadBatchServiceLogsContent, - UploadNodeLogsParameters, -} from "../src/index.js"; -import { fakeTestPasswordPlaceholder1 } from "./utils/fakeTestSecrets.js"; -import { getResourceName, waitForNotNull } from "./utils/helpers.js"; -import { describe, it, beforeAll, afterAll, beforeEach, afterEach, assert } from "vitest"; - -const BASIC_POOL = getResourceName("Pool-Basic"); -const BASIC_POOL_NUM_VMS = 4; -const TEST_USER = "JSSDKTestUser"; - -describe("Compute node operations", async () => { - let recorder: Recorder; - let batchClient: BatchClient; - let computeNodes: string[]; - - /** - * Provision helper resources needed for testing jobs - */ - beforeAll(async function () { - if (!isPlaybackMode()) { - batchClient = createBatchClient(); - - const poolParams: CreatePoolParameters = { - body: { - id: BASIC_POOL, - vmSize: "Standard_D1_v2", - virtualMachineConfiguration: { - nodeAgentSKUId: "batch.node.windows amd64", - imageReference: { - publisher: "microsoftwindowsserver", - offer: "windowsserver", - sku: "2022-datacenter", - }, - }, - targetDedicatedNodes: BASIC_POOL_NUM_VMS, - // Ensures there's a compute node file we can reference later - startTask: { commandLine: "cmd /c echo hello > hello.txt" }, - // Sets up pool user we can reference later - userAccounts: [ - { - name: "nonAdminUser", - // Recorder sanitizer options will replace password with fakeTestPasswordPlaceholder1 - password: isPlaybackMode() ? fakeTestPasswordPlaceholder1 : "user_1account_password2", - elevationLevel: "nonadmin", - }, - ], - }, - contentType: "application/json; odata=minimalmetadata", - }; - - const poolPostResult = await batchClient.path("/pools").post(poolParams); - if (isUnexpected(poolPostResult)) { - assert.fail(`Received unexpected status code from creating pool: ${poolPostResult.status} - Unable to provision resource needed for Job Testing. - Response Body: ${poolPostResult.body.message}`); - } - } - }); - - /** - * Unprovision helper resources after all tests ran - */ - afterAll(async function () { - if (!isPlaybackMode()) { - batchClient = createBatchClient(); - - const poolDeleteResponse = await batchClient.path("/pools/{poolId}", BASIC_POOL).delete(); - if (isUnexpected(poolDeleteResponse)) { - assert.fail(`Received unexpected status code from deleting pool: ${poolDeleteResponse.status}.Pool Resource Leaked. - Respose Body: ${poolDeleteResponse.body.message}`); - } - } - }); - - beforeEach(async function (ctx: VitestTestContext) { - recorder = await createRecorder(ctx); - batchClient = createBatchClient(recorder); - }); - - afterEach(async function () { - await recorder.stop(); - }); - - it("should list compute nodes successfully", async () => { - const poolId = recorder.variable("BASIC_POOL", BASIC_POOL); - - const getListNodesResult = async () => { - const res = await batchClient.path("/pools/{poolId}/nodes", poolId).get(); - if (isUnexpected(res)) { - assert.fail(`Received unexpected status code from getting pool: ${res.status} - Response Body: ${res.body.message}`); - } - if ( - (res.body.value?.length ?? 0) > 0 && - res.body.value!.filter((node) => - ["starting", "waitingforstarttask", "creating"].includes(node.state!), - ).length === 0 - ) { - return res; - } - return null; - }; - - const listNodesResult = await waitForNotNull(getListNodesResult); - const nodeList = listNodesResult.body.value!; - computeNodes = nodeList.map(function (x) { - return x.id!; - }); - assert.equal(nodeList[0].state, "idle"); - assert.equal(nodeList[0].schedulingState, "enabled"); - assert.isTrue(nodeList[0].isDedicated); - assert.equal(listNodesResult.body.value?.length, BASIC_POOL_NUM_VMS); - }); - - it("should get a compute node reference", async () => { - const getNodeResult = await batchClient - .path( - "/pools/{poolId}/nodes/{nodeId}", - recorder.variable("BASIC_POOL", BASIC_POOL), - computeNodes[0], - ) - .get(); - if (isUnexpected(getNodeResult)) { - assert.fail(`Received unexpected status code from getting compute node: ${getNodeResult.status} - Response Body: ${getNodeResult.body.message}`); - } - - assert.equal(getNodeResult.status, "200"); - assert.equal(getNodeResult.body.id, computeNodes[0]); - assert.equal(getNodeResult.body.state, "idle"); - assert.equal(getNodeResult.body.schedulingState, "enabled"); - }); - - it("should add a user to a compute node successfully", async () => { - const addUserOptions: CreateNodeUserParameters = { - body: { - name: TEST_USER, - isAdmin: false, - password: isPlaybackMode() ? fakeTestPasswordPlaceholder1 : "user_1account_password2", - }, - contentType: "application/json; odata=minimalmetadata", - }; - - const addUserResult = await batchClient - .path( - "/pools/{poolId}/nodes/{nodeId}/users", - recorder.variable("BASIC_POOL", BASIC_POOL), - computeNodes[0], - ) - .post(addUserOptions); - assert.equal(addUserResult.status, "201"); - }); - - it("should update a compute node user successfully", async () => { - const updateUserOptions: ReplaceNodeUserParameters = { - body: { - password: isPlaybackMode() ? fakeTestPasswordPlaceholder1 : "user_1account_password2", - }, - contentType: "application/json; odata=minimalmetadata", - }; - - const updateUserResult = await batchClient - .path( - "/pools/{poolId}/nodes/{nodeId}/users/{userName}", - recorder.variable("BASIC_POOL", BASIC_POOL), - computeNodes[0], - TEST_USER, - ) - .put(updateUserOptions); - assert.equal(updateUserResult.status, "200"); - }); - - it("should delete a compute node user successfully", async () => { - const updateUserResult = await batchClient - .path( - "/pools/{poolId}/nodes/{nodeId}/users/{userName}", - recorder.variable("BASIC_POOL", BASIC_POOL), - computeNodes[0], - TEST_USER, - ) - .delete(); - assert.equal(updateUserResult.status, "200"); - }); - - it("should disable scheduling on a compute node successfully", async () => { - const disableSchedulingResult = await batchClient - .path( - "/pools/{poolId}/nodes/{nodeId}/disablescheduling", - recorder.variable("BASIC_POOL", BASIC_POOL), - computeNodes[1], - ) - .post({ contentType: "application/json; odata=minimalmetadata" }); - assert.equal(disableSchedulingResult.status, "200"); - }); - - it("should enable scheduling on a compute node successfully", async () => { - const enableSchedulingResult = await batchClient - .path( - "/pools/{poolId}/nodes/{nodeId}/enablescheduling", - recorder.variable("BASIC_POOL", BASIC_POOL), - computeNodes[1], - ) - .post({ contentType: "application/json; odata=minimalmetadata" }); - assert.equal(enableSchedulingResult.status, "200"); - }); - - it("should reboot a compute node successfully", async () => { - const rebootNodeResult = await batchClient - .path( - "/pools/{poolId}/nodes/{nodeId}/reboot", - recorder.variable("BASIC_POOL", BASIC_POOL), - computeNodes[0], - ) - .post({ contentType: "application/json; odata=minimalmetadata" }); - assert.equal(rebootNodeResult.status, "202"); - }); - - it("should reimage a compute node successfully", async () => { - const reimageNodeResult = await batchClient - .path( - "/pools/{poolId}/nodes/{nodeId}/reboot", - recorder.variable("BASIC_POOL", BASIC_POOL), - computeNodes[1], - ) - .post({ contentType: "application/json; odata=minimalmetadata" }); - assert.equal(reimageNodeResult.status, "202"); - }); - - it("should upload pool node logs at paas pool", async () => { - const container = "https://teststorage.blob.core.windows.net/fakecontainer"; - const config: UploadBatchServiceLogsContent = { - containerUrl: container, - startTime: new Date("2018-02-25T00:00:00.000Z"), - }; - - const uploadLogBody: UploadNodeLogsParameters = { - body: config, - contentType: "application/json; odata=minimalmetadata", - }; - - const uploadLogResult = await batchClient - .path( - "/pools/{poolId}/nodes/{nodeId}/uploadbatchservicelogs", - recorder.variable("BASIC_POOL", BASIC_POOL), - computeNodes[2], - ) - .post(uploadLogBody); - if (isUnexpected(uploadLogResult)) { - assert.fail(`Received unexpected status code from uploading log to compute node: ${uploadLogResult.status} - Response Body: ${uploadLogResult.body.message}`); - } - - assert.isAtLeast(uploadLogResult.body.numberOfFilesUploaded, 1); - }); -}); diff --git a/sdk/batch/batch-rest/test/jobSchedules.spec.ts b/sdk/batch/batch-rest/test/jobSchedules.spec.ts deleted file mode 100644 index 025cb9dad02e..000000000000 --- a/sdk/batch/batch-rest/test/jobSchedules.spec.ts +++ /dev/null @@ -1,232 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { Recorder, VitestTestContext, isPlaybackMode } from "@azure-tools/test-recorder"; -import { createBatchClient, createRecorder } from "./utils/recordedClient.js"; -import { - isUnexpected, - BatchJobSchedule, - CreateJobScheduleParameters, - BatchClient, - CreatePoolParameters, -} from "../src/index.js"; -import { fakeTestPasswordPlaceholder1 } from "./utils/fakeTestSecrets.js"; -import { getResourceName } from "./utils/helpers.js"; -import moment from "moment"; -import { describe, it, beforeAll, afterAll, beforeEach, afterEach, assert } from "vitest"; - -const BASIC_POOL = getResourceName("Pool-Basic"); -const JOB_SCHEDULE = getResourceName("JobSchedule-Basic"); -const JOB_SCHEDULE_DISPLAY = "JobSchedule-1"; - -describe("Job Schedule Operations Test", () => { - let recorder: Recorder; - let batchClient: BatchClient; - - /** - * Provision helper resources needed for testing jobs - */ - beforeAll(async function () { - if (!isPlaybackMode()) { - batchClient = createBatchClient(); - - const poolParams: CreatePoolParameters = { - body: { - id: BASIC_POOL, - vmSize: "Standard_D1_v2", - virtualMachineConfiguration: { - nodeAgentSKUId: "batch.node.windows amd64", - imageReference: { - publisher: "microsoftwindowsserver", - offer: "windowsserver", - sku: "2022-datacenter", - }, - }, - targetDedicatedNodes: 4, - // Ensures there's a compute node file we can reference later - startTask: { commandLine: "cmd /c echo hello > hello.txt" }, - // Sets up pool user we can reference later - userAccounts: [ - { - name: "nonAdminUser", - password: isPlaybackMode() ? fakeTestPasswordPlaceholder1 : "user_1account_password2", // Recorder sanitizer options will replace password with fakeTestPasswordPlaceholder1 - elevationLevel: "nonadmin", - }, - ], - }, - contentType: "application/json; odata=minimalmetadata", - }; - - const poolPostResult = await batchClient.path("/pools").post(poolParams); - if (isUnexpected(poolPostResult)) { - assert.fail(`Received unexpected status code from creating pool: ${poolPostResult.status} - Unable to provision resource needed for job schedule Testing. - Response Body: ${poolPostResult.body.message}`); - } - } - }); - - /** - * Unprovision helper resources after all tests ran - */ - afterAll(async function () { - if (!isPlaybackMode()) { - batchClient = createBatchClient(); - - const poolId = recorder.variable("BASIC_POOL", BASIC_POOL); - const poolDeleteResponse = await batchClient.path("/pools/{poolId}", poolId).delete(); - if (isUnexpected(poolDeleteResponse)) { - assert.fail(`Received unexpected status code from deleting pool: ${poolDeleteResponse.status}.Pool Resource Leaked. - Respose Body: ${poolDeleteResponse.body.message}`); - } - } - }); - - beforeEach(async function (ctx: VitestTestContext) { - recorder = await createRecorder(ctx); - batchClient = createBatchClient(recorder); - }); - - afterEach(async function () { - await recorder.stop(); - }); - - it("should create a job schedule successfully", async () => { - const options: CreateJobScheduleParameters = { - body: { - id: recorder.variable("JOB_SCHEDULE", JOB_SCHEDULE), - jobSpecification: { - poolInfo: { poolId: recorder.variable("BASIC_POOL", BASIC_POOL) }, - displayName: JOB_SCHEDULE_DISPLAY, - }, - schedule: { - doNotRunAfter: new Date( - recorder.variable("JOB_SCHEDULE_RUN_DATE", moment().add(1, "days").toISOString()), - ), - recurrenceInterval: moment.duration({ minutes: 2 }).toISOString(), - }, - }, - contentType: "application/json; odata=minimalmetadata", - }; - - const postScheduleResult = await batchClient.path("/jobschedules").post(options); - - if (isUnexpected(postScheduleResult)) { - assert.fail(`Received unexpected status code from creating job schedule: ${postScheduleResult.status} - Response Body: ${postScheduleResult.body.message}`); - } - }); - - it("should list job schedules successfully", async () => { - const jobScheduleListResult = await batchClient.path("/jobschedules").get(); - if (isUnexpected(jobScheduleListResult)) { - assert.fail(`Received unexpected status code from listing job schedules: ${jobScheduleListResult.status} - Response Body: ${jobScheduleListResult.body.message}`); - } - - assert.isAtLeast(jobScheduleListResult.body.value?.length || 0, 1); - }); - - it("should list jobs from job schedule successfully", async () => { - const jobListResult = await batchClient - .path("/jobschedules/{jobScheduleId}/jobs", recorder.variable("JOB_SCHEDULE", JOB_SCHEDULE)) - .get(); - if (isUnexpected(jobListResult)) { - assert.fail(`Received unexpected status code from listing jobs under job schedule: ${jobListResult.status} - Response Body: ${jobListResult.body.message}`); - } - - assert.equal(jobListResult.body.value?.length || 0, 1); - }); - - it("should check if a job schedule exists successfully", async () => { - const getJobScheduleResult = await batchClient - .path("/jobschedules/{jobScheduleId}", recorder.variable("JOB_SCHEDULE", JOB_SCHEDULE)) - .get(); - assert.equal(getJobScheduleResult.status, "200"); - }); - - it("should get a job schedule reference successfully", async () => { - const jobScheduleId = recorder.variable("JOB_SCHEDULE", JOB_SCHEDULE); - const getJobScheduleResult = await batchClient - .path("/jobschedules/{jobScheduleId}", jobScheduleId) - .get(); - - if (isUnexpected(getJobScheduleResult)) { - assert.fail(`Received unexpected status code from getting job schedule reference: ${getJobScheduleResult.status} - Response Body: ${getJobScheduleResult.body.message}`); - } - - assert.equal(getJobScheduleResult.body.id, jobScheduleId); - assert.equal(getJobScheduleResult.body.state, "active"); - assert.equal(getJobScheduleResult.body.jobSpecification?.displayName, JOB_SCHEDULE_DISPLAY); - }); - - it("should update a job schedule successfully", async () => { - const updateScheduleOptions: BatchJobSchedule = { - schedule: { recurrenceInterval: moment.duration({ hours: 6 }).toISOString() }, - jobSpecification: { poolInfo: { poolId: recorder.variable("BASIC_POOL", BASIC_POOL) } }, - }; - - const updateScheduleResult = await batchClient - .path("/jobschedules/{jobScheduleId}", recorder.variable("JOB_SCHEDULE", JOB_SCHEDULE)) - .put({ - body: updateScheduleOptions, - contentType: "application/json; odata=minimalmetadata", - }); - - assert.equal(updateScheduleResult.status, "200"); - }); - - it("should patch a job schedule successfully", async () => { - const patchScheduleOptions = { - schedule: { - recurrenceInterval: moment.duration({ hours: 3 }).toISOString(), - startWindow: moment.duration({ hours: 1 }).toISOString(), - }, - }; - - const patchScheduleResult = await batchClient - .path("/jobschedules/{jobScheduleId}", recorder.variable("JOB_SCHEDULE", JOB_SCHEDULE)) - .patch({ - body: patchScheduleOptions, - contentType: "application/json; odata=minimalmetadata", - }); - - assert.equal(patchScheduleResult.status, "200"); - }); - - it("should disable a job schedule successfully", async () => { - const disableScheduleResult = await batchClient - .path( - "/jobschedules/{jobScheduleId}/disable", - recorder.variable("JOB_SCHEDULE", JOB_SCHEDULE), - ) - .post({ contentType: "application/json; odata=minimalmetadata" }); - assert.equal(disableScheduleResult.status, "204"); - }); - - it("should enable a job schedule successfully", async () => { - const enableScheduleResult = await batchClient - .path("/jobschedules/{jobScheduleId}/enable", recorder.variable("JOB_SCHEDULE", JOB_SCHEDULE)) - .post({ contentType: "application/json; odata=minimalmetadata" }); - assert.equal(enableScheduleResult.status, "204"); - }); - - it("should terminate a job schedule successfully", async () => { - const terminateScheduleResult = await batchClient - .path( - "/jobschedules/{jobScheduleId}/terminate", - recorder.variable("JOB_SCHEDULE", JOB_SCHEDULE), - ) - .post({ contentType: "application/json; odata=minimalmetadata" }); - assert.equal(terminateScheduleResult.status, "202"); - }); - - it("should delete a job schedule successfully", async () => { - const deleteJobScheduleResult = await batchClient - .path("/jobschedules/{jobScheduleId}", recorder.variable("JOB_SCHEDULE", JOB_SCHEDULE)) - .delete(); - assert.equal(deleteJobScheduleResult.status, "202"); - }); -}); diff --git a/sdk/batch/batch-rest/test/jobs.spec.ts b/sdk/batch/batch-rest/test/jobs.spec.ts deleted file mode 100644 index 48f24cd5d04c..000000000000 --- a/sdk/batch/batch-rest/test/jobs.spec.ts +++ /dev/null @@ -1,243 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { Recorder, VitestTestContext, isPlaybackMode } from "@azure-tools/test-recorder"; -import { createBatchClient, createRecorder } from "./utils/recordedClient.js"; -import { - BatchClient, - BatchJobCreateContent, - CreateJobParameters, - CreatePoolParameters, - UpdateJobParameters, - isUnexpected, -} from "../src/index.js"; -import { fakeTestPasswordPlaceholder1 } from "./utils/fakeTestSecrets.js"; -import { getResourceName } from "./utils/helpers.js"; -import { describe, it, beforeAll, afterAll, beforeEach, afterEach, assert } from "vitest"; - -const BASIC_POOL = getResourceName("Pool-Basic"); -const JOB_NAME = getResourceName("Job-Basic"); -const JOB_PRIORITY = 600; - -describe("Job Operations Test", () => { - let recorder: Recorder; - let batchClient: BatchClient; - - /** - * Provision helper resources needed for testing jobs - */ - beforeAll(async function () { - if (!isPlaybackMode()) { - batchClient = createBatchClient(); - - const poolParams: CreatePoolParameters = { - body: { - id: BASIC_POOL, - vmSize: "Standard_D1_v2", - virtualMachineConfiguration: { - nodeAgentSKUId: "batch.node.windows amd64", - imageReference: { - publisher: "microsoftwindowsserver", - offer: "windowsserver", - sku: "2022-datacenter", - }, - }, - targetDedicatedNodes: 4, - // Ensures there's a compute node file we can reference later - startTask: { commandLine: "cmd /c echo hello > hello.txt" }, - // Sets up pool user we can reference later - userAccounts: [ - { - name: "nonAdminUser", - password: isPlaybackMode() ? fakeTestPasswordPlaceholder1 : "user_1account_password2", // Recorder sanitizer options will replace password with fakeTestPasswordPlaceholder1 - elevationLevel: "nonadmin", - }, - ], - }, - contentType: "application/json; odata=minimalmetadata", - }; - - const poolPostResult = await batchClient.path("/pools").post(poolParams); - if (isUnexpected(poolPostResult)) { - console.dir(poolPostResult, { depth: null }); - assert.fail(`Received unexpected status code from creating pool: ${poolPostResult.status} - Unable to provision resource needed for Job Testing. - Response Body: ${poolPostResult.body}`); - } - } - }); - - /** - * Unprovision helper resources after all tests ran - */ - afterAll(async function () { - if (!isPlaybackMode()) { - batchClient = createBatchClient(); - - const poolDeleteResponse = await batchClient.path("/pools/{poolId}", BASIC_POOL).delete(); - if (isUnexpected(poolDeleteResponse)) { - assert.fail(`Received unexpected status code from deleting pool: ${poolDeleteResponse.status}.Pool Resource Leaked. - Respose Body: ${poolDeleteResponse.body.message}`); - } - } - }); - - beforeEach(async function (ctx: VitestTestContext) { - recorder = await createRecorder(ctx); - batchClient = createBatchClient(recorder); - }); - - afterEach(async function () { - await recorder.stop(); - }); - - it("should create a job successfully", async () => { - const jobId = recorder.variable("JOB_NAME", JOB_NAME); - const poolId = recorder.variable("BASIC_POOL", BASIC_POOL); - const jobAddParam: CreateJobParameters = { - body: { - id: jobId, - poolInfo: { poolId: poolId }, - }, - contentType: "application/json; odata=minimalmetadata", - }; - - const jobAddResult = await batchClient.path("/jobs").post(jobAddParam); - if (isUnexpected(jobAddResult)) { - assert.fail(`Received unexpected status code from creating job: ${jobAddResult.status} - Response Body: ${jobAddResult.body.message}`); - } - - const getJobResult = await batchClient.path("/jobs/{jobId}", jobId).get(); - - if (isUnexpected(getJobResult)) { - assert.fail(`Received unexpected status code from getting job reference: ${getJobResult.status} - Response Body: ${getJobResult.body.message}`); - } - - assert.equal(getJobResult.body.state, "active"); - assert.equal(getJobResult.body.poolInfo?.poolId, poolId); - assert.equal(getJobResult.body.allowTaskPreemption, false); - }); - - it("should update a job successfully", async () => { - const options: BatchJobCreateContent = { - id: recorder.variable("JOB_NAME", JOB_NAME), - priority: 500, - constraints: { maxTaskRetryCount: 3 }, - poolInfo: { poolId: recorder.variable("BASIC_POOL", BASIC_POOL) }, - }; - - const jobPutParams: CreateJobParameters = { - body: options, - contentType: "application/json; odata=minimalmetadata", - }; - - const updateJobResult = await batchClient - .path("/jobs/{jobId}", recorder.variable("JOB_NAME", JOB_NAME)) - .put(jobPutParams); - assert.equal(updateJobResult.status, "200"); - }); - - it("should patch a job successfully", async () => { - const options = { - priority: JOB_PRIORITY, - constraints: { maxTaskRetryCount: 3 }, - poolInfo: { poolId: recorder.variable("BASIC_POOL", BASIC_POOL) }, - }; - - const jobPatchParams: UpdateJobParameters = { - body: options, - contentType: "application/json; odata=minimalmetadata", - }; - const patchJobResult = await batchClient - .path("/jobs/{jobId}", recorder.variable("JOB_NAME", JOB_NAME)) - .patch(jobPatchParams); - assert.equal(patchJobResult.status, "200"); - }); - - it("should get a job reference successfully", async () => { - const jobId = recorder.variable("JOB_NAME", JOB_NAME); - const jobGetResult = await batchClient.path("/jobs/{jobId}", jobId).get(); - - if (isUnexpected(jobGetResult)) { - assert.fail(`Received unexpected status code from getting job reference: ${jobGetResult.status} - Response Body: ${jobGetResult.body.message}`); - } - - assert.equal(jobGetResult.body.id, jobId); - assert.equal(jobGetResult.body.state, "active"); - assert.equal(jobGetResult.body.priority, JOB_PRIORITY); - assert.equal(jobGetResult.body.poolInfo!.poolId, recorder.variable("BASIC_POOL", BASIC_POOL)); - }); - - it("should list jobs successfully", async () => { - const listJobsResult = await batchClient.path("/jobs").get(); - - if (isUnexpected(listJobsResult)) { - assert.fail(`Received unexpected status code from listing jobs: ${listJobsResult.status} - Response Body: ${listJobsResult.body.message}`); - } - - assert.isAtLeast(listJobsResult.body.value?.length ?? 0, 1); - }); - - it("should fail to job prep+release status", async () => { - // TODO Wrap code around try/catch and try throwing exception from error response body - const getJobPrepResult = await batchClient - .path( - "/jobs/{jobId}/jobpreparationandreleasetaskstatus", - recorder.variable("JOB_NAME", JOB_NAME), - ) - .get(); - if (!isUnexpected(getJobPrepResult)) { - assert.fail("Expected error response to return"); - } - }); - - it("should disable a job successfully", async () => { - const disableJobResult = await batchClient - .path("/jobs/{jobId}/disable", recorder.variable("JOB_NAME", JOB_NAME)) - .post({ - body: { disableTasks: "requeue" }, - contentType: "application/json; odata=minimalmetadata", - }); - - assert.equal(disableJobResult.status, "202"); - }); - - it("should enable a job successfully", async () => { - const enableJobResult = await batchClient - .path("/jobs/{jobId}/enable", recorder.variable("JOB_NAME", JOB_NAME)) - .post({ contentType: "application/json; odata=minimalmetadata" }); - - assert.equal(enableJobResult.status, "202"); - }); - - it("should terminate a job successfully", async () => { - const terminateJobResult = await batchClient - .path("/jobs/{jobId}/terminate", recorder.variable("JOB_NAME", JOB_NAME)) - .post({ - contentType: "application/json; odata=minimalmetadata", - }); - - assert.equal(terminateJobResult.status, "202"); - }); - - // it("should get all job statistics successfully", async () => { - // const getJobStatsResult = await batchClient.path("/joblife").get(); - // if (isUnexpected(getJobStatsResult)) { - // assert.fail(`Received unexpected status code from getting job lifetime stats: ${getJobStatsResult.status} - // Response Body: ${getJobStatsResult.body.message}`); - // } - - // assert.isDefined(getJobStatsResult.body.userCPUTime); - // assert.isDefined(getJobStatsResult.body.kernelCPUTime); - // }); - - it("should delete a job successfully", async function () { - const jobId = recorder.variable("JOB_NAME", JOB_NAME); - const deleteJobResult = await batchClient.path("/jobs/{jobId}", jobId).delete(); - assert.equal(deleteJobResult.status, "202"); - }); -}); diff --git a/sdk/batch/batch-rest/test/poolScaling.spec.ts b/sdk/batch/batch-rest/test/poolScaling.spec.ts deleted file mode 100644 index bdc31da3145a..000000000000 --- a/sdk/batch/batch-rest/test/poolScaling.spec.ts +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { Recorder, VitestTestContext, isPlaybackMode } from "@azure-tools/test-recorder"; -import { createBatchClient, createRecorder } from "./utils/recordedClient.js"; -import { - BatchClient, - CreatePoolParameters, - EnablePoolAutoScaleParameters, - EvaluatePoolAutoScaleParameters, - isUnexpected, -} from "../src/index.js"; -import { fakeTestPasswordPlaceholder1 } from "./utils/fakeTestSecrets.js"; -import { getResourceName, waitForNotNull } from "./utils/helpers.js"; -import moment from "moment"; -import { describe, it, beforeAll, afterAll, beforeEach, afterEach, assert } from "vitest"; - -const BASIC_POOL = getResourceName("Pool-Basic"); -// const JOB_NAME = getResourceName("Job-Basic"); -// const JOB_PRIORITY = 600; - -describe("Autoscale operations", async () => { - let recorder: Recorder; - let batchClient: BatchClient; - - /** - * Provision helper resources needed for testing jobs - */ - beforeAll(async function () { - if (!isPlaybackMode()) { - batchClient = createBatchClient(); - - const poolParams: CreatePoolParameters = { - body: { - id: BASIC_POOL, - vmSize: "Standard_D1_v2", - virtualMachineConfiguration: { - nodeAgentSKUId: "batch.node.windows amd64", - imageReference: { - publisher: "microsoftwindowsserver", - offer: "windowsserver", - sku: "2022-datacenter", - }, - }, - targetDedicatedNodes: 4, - // Ensures there's a compute node file we can reference later - startTask: { commandLine: "cmd /c echo hello > hello.txt" }, - // Sets up pool user we can reference later - userAccounts: [ - { - name: "nonAdminUser", - password: isPlaybackMode() ? fakeTestPasswordPlaceholder1 : "user_1account_password2", // Recorder sanitizer options will replace password with fakeTestPasswordPlaceholder1 - elevationLevel: "nonadmin", - }, - ], - }, - contentType: "application/json; odata=minimalmetadata", - }; - - const poolPostResult = await batchClient.path("/pools").post(poolParams); - if (isUnexpected(poolPostResult)) { - assert.fail(`Received unexpected status code from creating pool: ${poolPostResult.status} - Unable to provision resource needed for Job Testing. - Response Body: ${poolPostResult.body.message}`); - } - const getSteadyPool = async () => { - const getPoolResult = await batchClient.path("/pools/{poolId}", BASIC_POOL).get(); - if (isUnexpected(getPoolResult)) { - assert.fail(`Received unexpected status code from getting pool: ${getPoolResult.status} - Unable to provision resource needed for Job Testing. - Response Body: ${getPoolResult.body.message}`); - } - if (getPoolResult.body.allocationState === "steady") { - return getPoolResult; - } - return null; - }; - await waitForNotNull(getSteadyPool); - } - }); - - /** - * Unprovision helper resources after all tests ran - */ - afterAll(async function () { - if (!isPlaybackMode()) { - batchClient = createBatchClient(); - - const poolDeleteResponse = await batchClient.path("/pools/{poolId}", BASIC_POOL).delete(); - if (isUnexpected(poolDeleteResponse)) { - assert.fail(`Received unexpected status code from deleting pool: ${poolDeleteResponse.status}.Pool Resource Leaked. - Respose Body: ${poolDeleteResponse.body.message}`); - } - } - }); - - beforeEach(async function (ctx: VitestTestContext) { - recorder = await createRecorder(ctx); - batchClient = createBatchClient(recorder); - }); - - afterEach(async function () { - await recorder.stop(); - }); - - it("should enable autoscale successfully", async () => { - const poolEnableAutoScaleParams: EnablePoolAutoScaleParameters = { - body: { - autoScaleFormula: "$TargetDedicatedNodes=2", - autoScaleEvaluationInterval: moment.duration({ minutes: 6 }).toISOString(), - }, - contentType: "application/json; odata=minimalmetadata", - }; - - const autoScaleResult = await batchClient - .path("/pools/{poolId}/enableautoscale", recorder.variable("BASIC_POOL", BASIC_POOL)) - .post(poolEnableAutoScaleParams); - assert.equal(autoScaleResult.status, "200"); - }); - - it("should evaluate pool autoscale successfully", async () => { - const poolEvaluateAutoScaleParams: EvaluatePoolAutoScaleParameters = { - body: { - autoScaleFormula: "$TargetDedicatedNodes=3", - }, - contentType: "application/json; odata=minimalmetadata", - }; - - const evaluateAutoScaleResult = await batchClient - .path("/pools/{poolId}/evaluateautoscale", recorder.variable("BASIC_POOL", BASIC_POOL)) - .post(poolEvaluateAutoScaleParams); - - if (isUnexpected(evaluateAutoScaleResult)) { - assert.fail(`Received unexpected status code from evaluating pool autoscale: ${evaluateAutoScaleResult.status} - Response Body: ${evaluateAutoScaleResult.body.message}`); - } - - assert.isUndefined(evaluateAutoScaleResult.body.error); - assert.equal( - evaluateAutoScaleResult.body.results, - "$TargetDedicatedNodes=3;$TargetLowPriorityNodes=0;$NodeDeallocationOption=requeue", - ); - }); - - it("should fail to evaluate invalid autoscale formula", async () => { - const poolEvaluateAutoScaleParams: EvaluatePoolAutoScaleParameters = { - body: { - autoScaleFormula: "$something_useless", - }, - contentType: "application/json; odata=minimalmetadata", - }; - - const evaluateAutoScaleResult = await batchClient - .path("/pools/{poolId}/evaluateautoscale", recorder.variable("BASIC_POOL", BASIC_POOL)) - .post(poolEvaluateAutoScaleParams); - - if (isUnexpected(evaluateAutoScaleResult)) { - assert.fail(`Received unexpected status code from evaluating pool autoscale: ${evaluateAutoScaleResult.status} - Response Body: ${evaluateAutoScaleResult.body.message}`); - } - - assert.isDefined(evaluateAutoScaleResult.body.error); - assert.equal(evaluateAutoScaleResult.body.error?.code, "AutoScalingFormulaEvaluationError"); - - assert.equal( - evaluateAutoScaleResult.body.results, - "$TargetDedicatedNodes=2;$TargetLowPriorityNodes=0;$NodeDeallocationOption=requeue", - ); - }); - - it("should disable autoscale successfully", async () => { - const disableAutoscaleResult = await batchClient - .path("/pools/{poolId}/disableautoscale", recorder.variable("BASIC_POOL", BASIC_POOL)) - .post({ contentType: "application/json; odata=minimalmetadata" }); - assert.equal(disableAutoscaleResult.status, "200"); - }); -}); diff --git a/sdk/batch/batch-rest/test/pools.spec.ts b/sdk/batch/batch-rest/test/pools.spec.ts deleted file mode 100644 index 91ab004c0aa8..000000000000 --- a/sdk/batch/batch-rest/test/pools.spec.ts +++ /dev/null @@ -1,679 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -/* eslint-disable no-unused-expressions */ - -import { Recorder, VitestTestContext, isPlaybackMode } from "@azure-tools/test-recorder"; -import { createBatchClient, createRecorder } from "./utils/recordedClient.js"; -import { - BatchClient, - BatchPoolResizeContent, - BatchPoolUpdateContent, - CreatePoolParameters, - GetPoolParameters, - ListPoolsParameters, - ReplacePoolPropertiesParameters, - ResizePoolParameters, - isUnexpected, - paginate, -} from "../src/index.js"; -import { fakeTestPasswordPlaceholder1 } from "./utils/fakeTestSecrets.js"; -import { wait } from "./utils/wait.js"; -import { getResourceName, POLLING_INTERVAL, waitForNotNull } from "./utils/helpers.js"; -import { describe, it, beforeEach, afterEach, assert, expect } from "vitest"; - -const BASIC_POOL = getResourceName("Pool-Basic"); -const VMSIZE_D1 = "Standard_D1_v2"; -const VMSIZE_A1 = "Standard_A1_v2"; -const VMSIZE_D2s = "Standard_D2s_v3"; -const BASIC_POOL_NUM_VMS = 4; -const DISK_POOL = getResourceName("Pool-Datadisk"); -const ENDPOINT_POOL = getResourceName("Pool-Endpoint"); -const TEST_POOL3 = getResourceName("Pool-3"); -const SECURITY_PROFILE_POOL = getResourceName("Pool-SecurityProfile"); -const AUTO_OS_UPGRADE_POOL = getResourceName("Pool-AutoOSUpgrade"); - -describe("Pool Operations Test", () => { - let recorder: Recorder; - let batchClient: BatchClient; - - const nonAdminPoolUser: string = "nonAdminUser"; - - /** - * Provision helper resources needed for testing pools - */ - - beforeEach(async function (ctx: VitestTestContext) { - recorder = await createRecorder(ctx); - batchClient = createBatchClient(recorder); - }); - - afterEach(async function () { - await recorder.stop(); - }); - - it("Create Batch Pool successfully", async function () { - // Use assert to test your assumptions - - const poolParams: CreatePoolParameters = { - body: { - id: recorder.variable("BASIC_POOL", BASIC_POOL), - vmSize: VMSIZE_D1, - virtualMachineConfiguration: { - nodeAgentSKUId: "batch.node.windows amd64", - imageReference: { - publisher: "microsoftwindowsserver", - offer: "windowsserver", - sku: "2022-datacenter", - }, - extensions: [ - { - name: "batchextension1", - type: "GenevaMonitoring", - publisher: "Microsoft.Azure.Geneva", - typeHandlerVersion: "2.0", - autoUpgradeMinorVersion: true, - enableAutomaticUpgrade: true, - }, - ], - }, - networkConfiguration: { - enableAcceleratedNetworking: true, - }, - targetDedicatedNodes: BASIC_POOL_NUM_VMS, - // Ensures there's a compute node file we can reference later - startTask: { commandLine: "cmd /c echo hello > hello.txt" }, - // Sets up pool user we can reference later - userAccounts: [ - { - name: nonAdminPoolUser, - password: isPlaybackMode() ? fakeTestPasswordPlaceholder1 : "user_1account_password2", // Recorder sanitizer options will replace password with fakeTestPasswordPlaceholder1 - elevationLevel: "nonadmin", - }, - ], - }, - contentType: "application/json; odata=minimalmetadata", - }; - - const result = await batchClient.path("/pools").post(poolParams); - assert.equal(result.status, "201"); - - if (!isPlaybackMode()) await wait(20000); - }); - - it("should patch pool parameters successfully", async () => { - const options: BatchPoolUpdateContent = { - metadata: [ - { - name: "foo2", - value: "bar2", - }, - ], - }; - - const poolId = recorder.variable("BASIC_POOL", BASIC_POOL); - - const patchResult = await batchClient - .path("/pools/{poolId}", poolId) - .patch({ body: options, contentType: "application/json; odata=minimalmetadata" }); - assert.equal(patchResult.status, "200"); - - const getResult = await batchClient.path("/pools/{poolId}", poolId).get(); - if (isUnexpected(getResult)) { - assert.fail(`Received unexpected status code from getting pool: ${getResult.status} - Response Body: ${getResult.body.message}`); - } - - assert.equal(getResult.body.id, poolId); - assert.equal(getResult.body.state, "active"); - - for (let index = 0; index < options.metadata!.length; index++) { - assert.equal(getResult.body.metadata![index].name, options.metadata![index].name); - assert.equal(getResult.body.metadata![index].value, options.metadata![index].value); - } - }); - - it("should get a pool reference successfully", async () => { - const poolId = recorder.variable("BASIC_POOL", BASIC_POOL); - - const getSteadyPool = async () => { - const res = await batchClient.path("/pools/{poolId}", poolId).get(); - if (isUnexpected(res)) { - assert.fail(`Received unexpected status code from getting pool: ${res.status} - Response Body: ${res.body.message}`); - } - if (res.body.allocationState === "steady") { - return res; - } - return null; - }; - - const getResult = await waitForNotNull(getSteadyPool); - const metadata = getResult.body.metadata![0]; - - assert.equal(getResult.body.id, poolId); - assert.equal(getResult.body.state, "active"); - assert.equal(getResult.body.allocationState, "steady"); - assert.isDefined(getResult.body.virtualMachineConfiguration); - assert.equal( - getResult.body.virtualMachineConfiguration!.imageReference!.sku, - "2022-datacenter", - ); - assert.equal(getResult.body.vmSize?.toLowerCase(), VMSIZE_D1.toLowerCase()); - assert.equal(getResult.body.targetDedicatedNodes, BASIC_POOL_NUM_VMS); - assert.isFalse(getResult.body.enableAutoScale); - - assert.equal(metadata.name, "foo2"); - assert.equal(metadata.value, "bar2"); - - assert.isDefined(getResult.body.startTask); - assert.equal(getResult.body.startTask!.commandLine, "cmd /c echo hello > hello.txt"); - - assert.lengthOf(getResult.body.userAccounts!, 1); - assert.equal(getResult.body.userAccounts![0].name, nonAdminPoolUser); - assert.equal(getResult.body.userAccounts![0].elevationLevel, "nonadmin"); - expect(getResult.body.networkConfiguration?.enableAcceleratedNetworking).to.be.true; - expect(getResult.body.virtualMachineConfiguration?.extensions?.[0].enableAutomaticUpgrade).to.be - .true; - expect(getResult.body.virtualMachineConfiguration?.extensions?.[0].name).to.equal( - "batchextension1", - ); - }); - - it("should update pool parameters successfully", async function () { - const updateOptions: ReplacePoolPropertiesParameters = { - body: { - metadata: [{ name: "foo", value: "bar" }], - applicationPackageReferences: [], - // Ensures the start task isn't cleared - startTask: { commandLine: "cmd /c echo hello > hello.txt" }, - }, - contentType: "application/json; odata=minimalmetadata", - }; - - const poolId = recorder.variable("BASIC_POOL", BASIC_POOL); - - const updateResult = await batchClient - .path("/pools/{poolId}/updateproperties", poolId) - .post(updateOptions); - assert.equal(updateResult.status, "204"); - - const getResult = await batchClient.path("/pools/{poolId}", poolId).get(); - if (isUnexpected(getResult)) { - assert.fail(`Received unexpected status code from getting pool: ${getResult.status} - Response Body: ${getResult.body.message}`); - } - - const metadata = getResult.body.metadata!; - assert.equal(metadata[0].name, "foo"); - assert.equal(metadata[0].value, "bar"); - }); - - it("should get a pool reference with odata successfully", async () => { - const getOptions: GetPoolParameters = { - queryParameters: { - $select: ["id", "state"], - $expand: ["stats"], - }, - }; - - const poolId = recorder.variable("BASIC_POOL", BASIC_POOL); - - const getResult = await batchClient.path("/pools/{poolId}", poolId).get(getOptions); - if (isUnexpected(getResult)) { - assert.fail(`Received unexpected status code from getting pool: ${getResult.status} - Response Body: ${getResult.body.message}`); - } - - assert.equal(getResult.body.id, poolId); - assert.equal(getResult.body.state, "active"); - assert.isUndefined(getResult.body.allocationState); - assert.isUndefined(getResult.body.vmSize); - }); - - it("should list pools without filters", async () => { - const listPoolResult = await batchClient.path("/pools").get(); - assert.equal(listPoolResult.status, "200"); - - if (isUnexpected(listPoolResult)) { - assert.fail(`Received unexpected status code from listing pools: ${listPoolResult.status} - Response Body: ${listPoolResult.body.message}`); - } - - assert.isAtLeast(listPoolResult.body.value?.length ?? 0, 1); - }); - - it("should list a maximum number of pools", async () => { - const listOptions = { queryParameters: { maxresults: 1 } }; - const listPoolResult = await batchClient.path("/pools").get(listOptions); - - if (isUnexpected(listPoolResult)) { - assert.fail(`Received unexpected status code from listing pools: ${listPoolResult.status} - Response Body: ${listPoolResult.body.message}`); - } - - assert.isAtLeast( - listPoolResult.body.value?.length ?? 0, - listOptions.queryParameters.maxresults, - ); - }); - - it("should fail to list pools with invalid max", async () => { - const listOptions = { queryParameters: { maxresults: -5 } }; - const listPoolResult = await batchClient.path("/pools").get(listOptions); - - if (!isUnexpected(listPoolResult)) { - assert.fail(`Received successful list pool result when expected an error reply`); - } - - expect(listPoolResult.body.code).to.equal("InvalidQueryParameterValue"); - expect(listPoolResult.body.values?.[0].value).to.equal("maxresults"); - expect(listPoolResult.body.values?.[1].value).to.equal("-5"); - expect(listPoolResult.body.values?.[2].value).to.equal("MaxResults cannot be less than 1"); - }); - - it("should list pools according to filter", async () => { - const poolId = recorder.variable("BASIC_POOL", BASIC_POOL); - - const listOptions: ListPoolsParameters = { - queryParameters: { - $filter: `startswith(id,'${poolId}')`, - $select: ["id", "state"], - $expand: ["stats"], - }, - }; - - const listPoolsResult = await batchClient.path("/pools").get(listOptions); - if (isUnexpected(listPoolsResult)) { - assert.fail(`Received unexpected status code from listing pools: ${listPoolsResult.status} - Response Body: ${listPoolsResult.body.message}`); - } - - assert.lengthOf(listPoolsResult.body.value!, 1); - assert.equal(listPoolsResult.body.value![0].id, poolId); - assert.equal(listPoolsResult.body.value![0].state, "active"); - assert.isUndefined(listPoolsResult.body.value![0].allocationState); - assert.isUndefined(listPoolsResult.body.value![0].vmSize); - }); - - it("should check that pool exists successfully", async () => { - const poolExistsResult = await batchClient - .path("/pools/{poolId}", recorder.variable("BASIC_POOL", BASIC_POOL)) - .head(); - assert.equal(poolExistsResult.status, "200"); - }); - - it("should add a pool with a Data Disk", async () => { - const poolParams: CreatePoolParameters = { - body: { - id: recorder.variable("DISK_POOL", DISK_POOL), - vmSize: VMSIZE_A1, - virtualMachineConfiguration: { - imageReference: { - publisher: "Canonical", - offer: "UbuntuServer", - sku: "18.04-LTS", - }, - nodeAgentSKUId: "batch.node.ubuntu 18.04", - dataDisks: [ - { - lun: 1, - diskSizeGB: 50, - }, - ], - }, - targetDedicatedNodes: 0, - }, - contentType: "application/json; odata=minimalmetadata", - }; - - const result = await batchClient.path("/pools").post(poolParams); - assert.equal(result.status, "201"); - - await wait(POLLING_INTERVAL); - - const getResult = await batchClient.path("/pools/{poolId}", poolParams.body.id!).get(); - if (isUnexpected(getResult)) { - assert.fail(`Received unexpected status code from getting pool: ${getResult.status} - Response Body: ${getResult.body.message}`); - } - - assert.equal(getResult.body.virtualMachineConfiguration!.dataDisks![0].lun, 1); - assert.equal(getResult.body.virtualMachineConfiguration!.dataDisks![0].diskSizeGB, 50); - - await batchClient.path("/pools/{poolId}", poolParams.body.id!).delete(); - }); - - it("should add a pool with inbound endpoint configuration successfully", async () => { - const pool: CreatePoolParameters = { - body: { - id: recorder.variable("ENDPOINT_POOL", ENDPOINT_POOL), - vmSize: VMSIZE_A1, - networkConfiguration: { - endpointConfiguration: { - inboundNATPools: [ - { - name: "TestEndpointConfig", - protocol: "udp", - backendPort: 64444, - frontendPortRangeStart: 60000, - frontendPortRangeEnd: 61000, - networkSecurityGroupRules: [ - { - priority: 150, - access: "allow", - sourceAddressPrefix: "*", - }, - ], - }, - ], - }, - }, - virtualMachineConfiguration: { - nodeAgentSKUId: "batch.node.ubuntu 18.04", - imageReference: { - publisher: "Canonical", - offer: "UbuntuServer", - sku: "18.04-LTS", - }, - }, - targetDedicatedNodes: 1, - }, - contentType: "application/json; odata=minimalmetadata", - }; - - const addResult = await batchClient.path("/pools").post(pool); - assert.equal(addResult.status, "201"); - }); - - it("should get the details of a pool with endpoint configuration successfully", async () => { - const poolId = recorder.variable("ENDPOINT_POOL", ENDPOINT_POOL); - const listNodes = async () => { - const listResult = await batchClient.path("/pools/{poolId}/nodes", poolId).get(); - if (isUnexpected(listResult)) { - assert.fail(`Received unexpected status code from list compute nodes: ${listResult.status} - Response Body: ${listResult.body.message}`); - } - - const paginateResponse = paginate(batchClient, listResult); - const nodeList = []; - for await (const node of paginateResponse) { - nodeList.push(node); - } - if (nodeList.length > 0) { - return nodeList; - } - return null; - }; - - const nodeList = await waitForNotNull(listNodes); - - assert.lengthOf(nodeList, 1); - assert.isDefined(nodeList[0].endpointConfiguration); - assert.lengthOf(nodeList[0].endpointConfiguration!.inboundEndpoints, 2); - assert.equal( - nodeList[0].endpointConfiguration!.inboundEndpoints[0].name, - "TestEndpointConfig.0", - ); - assert.equal(nodeList[0].endpointConfiguration!.inboundEndpoints[0].protocol, "udp"); - }); - - it("should get pool node counts successfully", async () => { - // let poolList = []; - const poolId = recorder.variable("ENDPOINT_POOL", ENDPOINT_POOL); - // eslint-disable-next-line no-constant-condition - - const listNodeCounts = async () => { - const poolList = []; - const listNodeCountResult = await batchClient.path("/nodecounts").get(); - if (isUnexpected(listNodeCountResult)) { - assert.fail(`Received unexpected status code from list compute nodes: ${listNodeCountResult.status} - Response Body: ${listNodeCountResult.body.message}`); - } - - const paginateResponse = paginate(batchClient, listNodeCountResult); - for await (const pool of paginateResponse) { - poolList.push(pool); - } - - if (poolList.length > 0) { - const endpointPool = poolList.filter((pool) => pool.poolId === poolId); - if (endpointPool.length > 0 && endpointPool[0].dedicated!.idle > 0) { - return endpointPool; - } - } - return null; - }; - const nodeList = await waitForNotNull(listNodeCounts, 60 * 1000); - - const endpointPoolObj = nodeList.filter((pool) => pool.poolId === poolId); - assert.isAbove(endpointPoolObj.length, 0, `Pool with Pool Id ${poolId} not found`); - assert.equal(endpointPoolObj[0].dedicated!.idle, 1); - assert.equal(endpointPoolObj[0].lowPriority!.total, 0); - }); - - it("should create a second pool successfully", async () => { - const poolAddParams: CreatePoolParameters = { - body: { - id: recorder.variable("TEST_POOL3", TEST_POOL3), - vmSize: VMSIZE_A1, - virtualMachineConfiguration: { - nodeAgentSKUId: "batch.node.windows amd64", - imageReference: { - publisher: "microsoftwindowsserver", - offer: "windowsserver", - sku: "2022-datacenter", - }, - }, - }, - contentType: "application/json; odata=minimalmetadata", - }; - - const addPoolResult = await batchClient.path("/pools").post(poolAddParams); - assert.equal(addPoolResult.status, "201"); - }); - - it("should start pool resizing successfully", async () => { - const poolId = recorder.variable("TEST_POOL3", TEST_POOL3); - const getSteadyPool = async () => { - const res = await batchClient.path("/pools/{poolId}", poolId).get(); - if (isUnexpected(res)) { - assert.fail(`Received unexpected status code from getting pool: ${res.status} - Response Body: ${res.body.message}`); - } - if (res.body.allocationState === "steady") { - return res; - } - return null; - }; - await waitForNotNull(getSteadyPool); - - const options: BatchPoolResizeContent = { - targetDedicatedNodes: 3, - targetLowPriorityNodes: 2, - }; - const poolResizeParams: ResizePoolParameters = { - body: options, - contentType: "application/json; odata=minimalmetadata", - }; - - const poolResizeResult = await batchClient - .path("/pools/{poolId}/resize", poolId) - .post(poolResizeParams); - assert.equal(poolResizeResult.status, "202"); - }); - - it("should stop pool resizing successfully", async () => { - const stopPoolResizeResult = await batchClient - .path("/pools/{poolId}/stopresize", recorder.variable("TEST_POOL3", TEST_POOL3)) - .post({ contentType: "application/json; odata=minimalmetadata" }); - assert.equal(stopPoolResizeResult.status, "202"); - }); - - it("should list pools usage metrics", async () => { - const listPoolUsageResult = await batchClient.path("/poolusagemetrics").get(); - if (isUnexpected(listPoolUsageResult)) { - assert.fail(`Received unexpected status code from getting pool usage metrics: ${listPoolUsageResult.status} - Response Body: ${listPoolUsageResult.body.message}`); - } - - assert.isAtLeast(listPoolUsageResult.body?.value?.length ?? 0, 0); // No pool activity during this test - }); - - it("should delete a pool successfully", async function () { - const deleteResult = await batchClient - .path("/pools/{poolId}", recorder.variable("BASIC_POOL", BASIC_POOL)) - .delete(); - assert.equal(deleteResult.status, "202"); - }); - - it("should delete a second pool successfully", async function () { - const deleteResult = await batchClient - .path("/pools/{poolId}", recorder.variable("ENDPOINT_POOL", ENDPOINT_POOL)) - .delete(); - assert.equal(deleteResult.status, "202"); - }); - - it("should delete a third pool successfully", async function () { - const deleteResult = await batchClient - .path("/pools/{poolId}", recorder.variable("TEST_POOL3", TEST_POOL3)) - .delete(); - assert.equal(deleteResult.status, "202"); - }); - - it("should create a pool with SecurityProfile & OS Disk", async () => { - const poolId = recorder.variable("SECURITY_PROFILE_POOL", SECURITY_PROFILE_POOL); - const poolParams: CreatePoolParameters = { - body: { - id: recorder.variable("SECURITY_PROFILE_POOL", SECURITY_PROFILE_POOL), - vmSize: VMSIZE_D2s, - virtualMachineConfiguration: { - imageReference: { - publisher: "Canonical", - offer: "0001-com-ubuntu-server-jammy", - sku: "22_04-lts", - }, - nodeAgentSKUId: "batch.node.ubuntu 22.04", - securityProfile: { - securityType: "trustedLaunch", - encryptionAtHost: true, - uefiSettings: { - secureBootEnabled: true, - vTpmEnabled: true, - }, - }, - osDisk: { - caching: "readwrite", - managedDisk: { - storageAccountType: "standard_lrs", - }, - diskSizeGB: 50, - writeAcceleratorEnabled: true, - }, - }, - targetDedicatedNodes: 0, - }, - contentType: "application/json; odata=minimalmetadata", - }; - - const result = await batchClient.path("/pools").post(poolParams); - - if (isUnexpected(result)) { - assert.fail(`Received unexpected status code from creating pool: ${result.status}`); - } - - try { - const res = await batchClient.path("/pools/{poolId}", poolId).get(); - - if (isUnexpected(res)) { - assert.fail(`Received unexpected status code from getting pool: ${res.status}`); - } - const securityProfile = res.body.virtualMachineConfiguration!.securityProfile!; - assert.equal(securityProfile.securityType?.toLocaleLowerCase(), "trustedlaunch"); - assert.equal(securityProfile.encryptionAtHost, true); - assert.equal(securityProfile.uefiSettings!.secureBootEnabled, true); - assert.equal(securityProfile.uefiSettings!.vTpmEnabled, true); - - const osDisk = res.body.virtualMachineConfiguration!.osDisk!; - assert.equal(osDisk.caching?.toLocaleLowerCase(), "readwrite"); - assert.equal(osDisk.managedDisk!.storageAccountType?.toLocaleLowerCase(), "standard_lrs"); - assert.equal(osDisk.diskSizeGB, 50); - assert.equal(osDisk.writeAcceleratorEnabled, true); - } finally { - await batchClient.path("/pools/{poolId}", poolId).delete(); - } - }); - - it("should create a pool with Auto OS Upgrade", async () => { - const poolId = recorder.variable("AUTO_OS_UPGRADE_POOL", AUTO_OS_UPGRADE_POOL); - const poolParams: CreatePoolParameters = { - body: { - id: poolId, - vmSize: VMSIZE_D2s, - virtualMachineConfiguration: { - imageReference: { - publisher: "Canonical", - offer: "0001-com-ubuntu-server-jammy", - sku: "22_04-lts", - }, - nodeAgentSKUId: "batch.node.ubuntu 22.04", - nodePlacementConfiguration: { - policy: "zonal", - }, - }, - upgradePolicy: { - mode: "automatic", - automaticOSUpgradePolicy: { - disableAutomaticRollback: true, - enableAutomaticOSUpgrade: true, - useRollingUpgradePolicy: true, - osRollingUpgradeDeferral: true, - }, - rollingUpgradePolicy: { - enableCrossZoneUpgrade: true, - maxBatchInstancePercent: 20, - maxUnhealthyInstancePercent: 20, - maxUnhealthyUpgradedInstancePercent: 20, - pauseTimeBetweenBatches: "PT0S", - prioritizeUnhealthyInstances: false, - rollbackFailedInstancesOnPolicyBreach: false, - }, - }, - targetDedicatedNodes: 0, - }, - contentType: "application/json; odata=minimalmetadata", - }; - - const result = await batchClient.path("/pools").post(poolParams); - - if (isUnexpected(result)) { - assert.fail(`Received unexpected status code from creating pool: ${result.status}`); - } - - try { - const res = await batchClient.path("/pools/{poolId}", poolId).get(); - - if (isUnexpected(res)) { - assert.fail(`Received unexpected status code from getting pool: ${res.status}`); - } - const upgradePolicy = res.body.upgradePolicy!; - assert.equal(upgradePolicy.mode, "automatic"); - assert.deepEqual(upgradePolicy.automaticOSUpgradePolicy!, { - disableAutomaticRollback: true, - enableAutomaticOSUpgrade: true, - useRollingUpgradePolicy: true, - osRollingUpgradeDeferral: true, - }); - assert.deepEqual(upgradePolicy.rollingUpgradePolicy!, { - enableCrossZoneUpgrade: true, - maxBatchInstancePercent: 20, - maxUnhealthyInstancePercent: 20, - maxUnhealthyUpgradedInstancePercent: 20, - pauseTimeBetweenBatches: "PT0S", - prioritizeUnhealthyInstances: false, - rollbackFailedInstancesOnPolicyBreach: false, - }); - } finally { - await batchClient.path("/pools/{poolId}", poolId).delete(); - } - }); -}); diff --git a/sdk/batch/batch-rest/test/public/sampleTest.spec.ts b/sdk/batch/batch-rest/test/public/sampleTest.spec.ts new file mode 100644 index 000000000000..d4919ac91ac5 --- /dev/null +++ b/sdk/batch/batch-rest/test/public/sampleTest.spec.ts @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { createRecorder } from "./utils/recordedClient.js"; +import { assert, beforeEach, afterEach, it, describe } from "vitest"; + +describe("My test", () => { + // let recorder: Recorder; + + beforeEach(async function () { + // recorder = await createRecorder(this); + }); + + afterEach(async function () { + // await recorder.stop(); + }); + + it("sample test", async function () { + assert.equal(1, 1); + }); +}); diff --git a/sdk/batch/batch-rest/test/public/utils/recordedClient.ts b/sdk/batch/batch-rest/test/public/utils/recordedClient.ts new file mode 100644 index 000000000000..6e425fdcfdf9 --- /dev/null +++ b/sdk/batch/batch-rest/test/public/utils/recordedClient.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { + Recorder, + RecorderStartOptions, + VitestTestContext, +} from "@azure-tools/test-recorder"; + +const replaceableVariables: Record = { + SUBSCRIPTION_ID: "azure_subscription_id", +}; + +const recorderEnvSetup: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables, +}; + +/** + * creates the recorder and reads the environment variables from the `.env` file. + * Should be called first in the test suite to make sure environment variables are + * read before they are being used. + */ +export async function createRecorder( + context: VitestTestContext, +): Promise { + const recorder = new Recorder(context); + await recorder.start(recorderEnvSetup); + return recorder; +} diff --git a/sdk/batch/batch-rest/test/tasks.spec.ts b/sdk/batch/batch-rest/test/tasks.spec.ts deleted file mode 100644 index 6871b3c5d111..000000000000 --- a/sdk/batch/batch-rest/test/tasks.spec.ts +++ /dev/null @@ -1,530 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { Recorder, VitestTestContext, isPlaybackMode } from "@azure-tools/test-recorder"; -import { createBatchClient, createRecorder } from "./utils/recordedClient.js"; -import { - BatchClient, - BatchTask, - CreateJobParameters, - CreatePoolParameters, - CreateTaskParameters, - isUnexpected, - paginate, -} from "../src/index.js"; -import { fakeTestPasswordPlaceholder1 } from "./utils/fakeTestSecrets.js"; -import { getResourceName, waitForNotNull } from "./utils/helpers.js"; -import { describe, it, beforeAll, afterAll, beforeEach, afterEach, assert } from "vitest"; - -const BASIC_POOL = getResourceName("Pool-Basic"); -const JOB_NAME = getResourceName("Job-Basic"); -const TASK_NAME = `${JOB_NAME}-task1`; -const TASK2_NAME = `${JOB_NAME}-task2`; -const TASK_UPDATE_OPTIONS: BatchTask = { - constraints: { maxTaskRetryCount: 3 }, -}; -const NON_ADMIN_POOL_USER = "nonAdminUser"; - -describe("Task Operations Test", () => { - let recorder: Recorder; - let batchClient: BatchClient; - - /** - * Provision helper resources needed for testing Batch tasks - */ - beforeAll(async function () { - if (!isPlaybackMode()) { - batchClient = createBatchClient(); - - const poolParams: CreatePoolParameters = { - body: { - id: BASIC_POOL, - vmSize: "Standard_D1_v2", - virtualMachineConfiguration: { - nodeAgentSKUId: "batch.node.windows amd64", - imageReference: { - publisher: "microsoftwindowsserver", - offer: "windowsserver", - sku: "2022-datacenter", - }, - }, - targetDedicatedNodes: 4, - // Ensures there's a compute node file we can reference later - startTask: { commandLine: "cmd /c echo hello > hello.txt" }, - // Sets up pool user we can reference later - userAccounts: [ - { - name: NON_ADMIN_POOL_USER, - password: isPlaybackMode() ? fakeTestPasswordPlaceholder1 : "user_1account_password2", // Recorder sanitizer options will replace password with fakeTestPasswordPlaceholder1 - elevationLevel: "nonadmin", - }, - ], - }, - contentType: "application/json; odata=minimalmetadata", - }; - - const poolPostResult = await batchClient.path("/pools").post(poolParams); - if (isUnexpected(poolPostResult)) { - assert.fail(`Received unexpected status code from creating pool: ${poolPostResult.status} - Unable to provision resource needed for Task Testing. - Response Body: ${poolPostResult.body.message}`); - } - - const jobAddParam: CreateJobParameters = { - body: { - id: JOB_NAME, - poolInfo: { poolId: BASIC_POOL }, - }, - contentType: "application/json; odata=minimalmetadata", - }; - - const jobAddResult = await batchClient.path("/jobs").post(jobAddParam); - if (isUnexpected(jobAddResult)) { - assert.fail(`Received unexpected status code from creating job: ${jobAddResult.status} - Unable to provision resources needed for Task Testing. - Response Body: ${jobAddResult.body.message}`); - } - } - }); - - /** - * Unprovision helper resources after all tests ran - */ - afterAll(async function () { - if (!isPlaybackMode()) { - type resourceDeleteErr = { id: string; error: any }; - const failedDeletedResources: resourceDeleteErr[] = []; - batchClient = createBatchClient(); - - const poolDeleteResponse = await batchClient.path("/pools/{poolId}", BASIC_POOL).delete(); - if (isUnexpected(poolDeleteResponse)) { - failedDeletedResources.push({ id: BASIC_POOL, error: poolDeleteResponse.body.message }); - } - - const JobDelete202Response = await batchClient.path("/jobs/{jobId}", JOB_NAME).delete(); - if (isUnexpected(JobDelete202Response)) { - failedDeletedResources.push({ id: JOB_NAME, error: JobDelete202Response.body.message }); - } - - if (failedDeletedResources.length > 0) { - console.log( - "Failed to unprovision helper resources for Task Test. The following resources may be leaked:", - ); - failedDeletedResources.forEach((resource) => - console.log(`Failed to delete ${resource.id} Error Response: ${resource.error}`), - ); - } - } - }); - - beforeEach(async function (ctx: VitestTestContext) { - recorder = await createRecorder(ctx); - batchClient = createBatchClient(recorder); - }); - - afterEach(async function () { - await recorder.stop(); - }); - - it("should create a task with container settings successfully", async () => { - const jobId = recorder.variable("JOB_NAME", JOB_NAME); - - const taskSettings = { - id: "taskWithContainerSettings", - commandLine: "cat /etc/centos-release", - containerSettings: { imageName: "centos" }, - }; - - const addTaskResult = await batchClient - .path("/jobs/{jobId}/tasks", jobId) - .post({ body: taskSettings, contentType: "application/json; odata=minimalmetadata" }); - assert.equal(addTaskResult.status, "201"); - - const getTaskResult = await batchClient - .path("/jobs/{jobId}/tasks/{taskId}", jobId, taskSettings.id) - .get(); - if (isUnexpected(getTaskResult)) { - assert.fail(`Received unexpected status code from getting task: ${getTaskResult.status} - Response Body: ${getTaskResult.body.message}`); - } - - assert.equal( - getTaskResult.body.containerSettings?.imageName, - taskSettings.containerSettings.imageName, - ); - assert.equal(getTaskResult.body.commandLine, taskSettings.commandLine); - - await batchClient.path("/jobs/{jobId}/tasks/{taskId}", jobId, taskSettings.id).delete(); - }); - - it("should create a task with exit conditions successfully", async () => { - const jobId = "JobWithAutoComplete"; - const taskId = "TaskWithAutoComplete"; - const jobAddParams: CreateJobParameters = { - body: { - id: jobId, - poolInfo: { - poolId: "dummypool", - }, - onAllTasksComplete: "noaction", - onTaskFailure: "performexitoptionsjobaction", - usesTaskDependencies: true, - }, - contentType: "application/json; odata=minimalmetadata", - }; - - const jobAddResult = await batchClient.path("/jobs").post(jobAddParams); - assert.equal(jobAddResult.status, "201"); - - const taskSettings = { - id: taskId, - commandLine: "echo Hello World", - exitConditions: { - default: { - jobAction: "terminate", - dependencyAction: "satisfy", - }, - exitCodes: [ - { - code: 1, - exitOptions: { - jobAction: "none", - dependencyAction: "block", - }, - }, - ], - }, - }; - - const taskAddResult = await batchClient - .path("/jobs/{jobId}/tasks", jobId) - .post({ body: taskSettings, contentType: "application/json; odata=minimalmetadata" }); - assert.equal(taskAddResult.status, "201"); - - const getTaskResult = await batchClient - .path("/jobs/{jobId}/tasks/{taskId}", jobId, taskId) - .get(); - if (isUnexpected(getTaskResult)) { - assert.fail(`Received unexpected status code from getting task: ${getTaskResult.status} - Response Body: ${getTaskResult.body.message}`); - } - - assert.equal(getTaskResult.body.exitConditions!.default!.jobAction, "terminate"); - assert.equal(getTaskResult.body.exitConditions!.default!.dependencyAction, "satisfy"); - assert.equal(getTaskResult.body.exitConditions!.exitCodes![0].code, 1); - assert.equal(getTaskResult.body.exitConditions!.exitCodes![0].exitOptions.jobAction, "none"); - assert.equal( - getTaskResult.body.exitConditions!.exitCodes![0].exitOptions.dependencyAction, - "block", - ); - - const deleteJobResult = await batchClient.path("/jobs/{jobId}", jobId).delete(); - if (isUnexpected(deleteJobResult)) { - assert.fail(`Failed to delete ${jobId}. Error Response: ${deleteJobResult.body.message}`); - } - }); - - it("should create a task successfully", async () => { - const taskAddParams: CreateTaskParameters = { - body: { - id: recorder.variable("TASK_NAME", TASK_NAME), - commandLine: "cmd /c echo hello > taskHello.txt", - }, - contentType: "application/json; odata=minimalmetadata", - }; - - const addTaskResult = await batchClient - .path("/jobs/{jobId}/tasks", recorder.variable("JOB_NAME", JOB_NAME)) - .post(taskAddParams); - assert.equal(addTaskResult.status, "201"); - }); - - it("should terminate a task successfully", async () => { - const terminateTaskResult = await batchClient - .path( - "/jobs/{jobId}/tasks/{taskId}/terminate", - recorder.variable("JOB_NAME", JOB_NAME), - recorder.variable("TASK_NAME", TASK_NAME), - ) - .post({ contentType: "application/json; odata=minimalmetadata" }); - assert.equal(terminateTaskResult.status, "204"); - }); - - it("should create a second task with output files successfully", async () => { - const jobId = recorder.variable("JOB_NAME", JOB_NAME); - const taskId = recorder.variable("TASK2_NAME", TASK2_NAME); - - const container = "https://teststorage.blob.core.windows.net/batch-sdk-test?se=REDACTED"; - const outputs = [ - { - filePattern: "../stdout.txt", - destination: { - container: { - containerUrl: container, - path: "taskLogs/output.txt", - uploadHeaders: [ - { name: "x-ms-blob-content-type", value: "text/plain" }, - { name: "x-ms-blob-content-language", value: "en-US" }, - ], - }, - }, - uploadOptions: { uploadCondition: "taskCompletion" }, - }, - { - filePattern: "../stderr.txt", - destination: { - container: { containerUrl: container, path: "taskLogs/error.txt" }, - }, - uploadOptions: { uploadCondition: "taskFailure" }, - }, - ]; - - const taskAddParams: CreateTaskParameters = { - body: { - id: taskId, - commandLine: "cmd /c echo hello world", - outputFiles: outputs, - }, - contentType: "application/json; odata=minimalmetadata", - }; - - const addTaskResult = await batchClient.path("/jobs/{jobId}/tasks", jobId).post(taskAddParams); - assert.equal(addTaskResult.status, "201"); - - const getTaskResult = await batchClient - .path("/jobs/{jobId}/tasks/{taskId}", jobId, taskId) - .get(); - if (isUnexpected(getTaskResult)) { - assert.fail(`Received unexpected status code from getting task: ${getTaskResult.status} - Response Body: ${getTaskResult.body.message}`); - } - - const batchTaskOutput = getTaskResult.body; - assert.isDefined(batchTaskOutput.outputFiles); - assert.equal(batchTaskOutput!.outputFiles![0].filePattern, outputs[0].filePattern); - assert.equal( - batchTaskOutput!.outputFiles![0].destination.container?.containerUrl, - outputs[0].destination.container.containerUrl, - ); - assert.equal(batchTaskOutput!.outputFiles![1].filePattern, outputs[1].filePattern); - assert.equal( - batchTaskOutput!.outputFiles![1].destination.container?.containerUrl, - outputs[1].destination.container.containerUrl, - ); - }); - - it("should reactivate a task successfully", async () => { - const reactivateTaskResult = await batchClient - .path( - "/jobs/{jobId}/tasks/{taskId}/reactivate", - recorder.variable("JOB_NAME", JOB_NAME), - recorder.variable("TASK_NAME", TASK_NAME), - ) - .post({ contentType: "application/json; odata=minimalmetadata" }); - assert.equal(reactivateTaskResult.status, "204"); - }); - - it("should update a task successfully", async () => { - const updateTaskResult = await batchClient - .path( - "/jobs/{jobId}/tasks/{taskId}", - recorder.variable("JOB_NAME", JOB_NAME), - recorder.variable("TASK_NAME", TASK_NAME), - ) - .put({ - body: TASK_UPDATE_OPTIONS, - contentType: "application/json; odata=minimalmetadata", - }); - - assert.equal(updateTaskResult.status, "200"); - }); - - it("should list all tasks successfully", async () => { - const listTasksResult = await batchClient - .path("/jobs/{jobId}/tasks", recorder.variable("JOB_NAME", JOB_NAME)) - .get(); - if (isUnexpected(listTasksResult)) { - assert.fail(`Received unexpected status code from listing tasks: ${listTasksResult.status} - Response Body: ${listTasksResult.body.message}`); - } - - const paginateResponse = paginate(batchClient, listTasksResult); - let taskCounter = 0; - - for await (const _item of paginateResponse) { - ++taskCounter; - } - - assert.equal(taskCounter, 2); - }); - - it("should get task reference successfully", async () => { - const taskId = recorder.variable("TASK_NAME", TASK_NAME); - const getTaskResult = await batchClient - .path("/jobs/{jobId}/tasks/{taskId}", recorder.variable("JOB_NAME", JOB_NAME), taskId) - .get(); - if (isUnexpected(getTaskResult)) { - assert.fail(`Received unexpected status code from getting task: ${getTaskResult.status} - Response Body: ${getTaskResult.body.message}`); - } - - assert.equal(getTaskResult.body.id, taskId); - assert.equal( - getTaskResult.body.constraints?.maxTaskRetryCount, - TASK_UPDATE_OPTIONS!.constraints!.maxTaskRetryCount, - ); - }); - - it("should add a task with an application package reference successfully", async () => { - const jobId = recorder.variable("JOB_NAME", JOB_NAME); - const taskAddParams: CreateTaskParameters = { - body: { - id: "Task-AppPackage", - commandLine: "cmd /c echo hello world", - applicationPackageReferences: [ - { - applicationId: "REDACTED", - }, - ], - }, - contentType: "application/json; odata=minimalmetadata", - }; - - const taskAddResult = await batchClient.path("/jobs/{jobId}/tasks", jobId).post(taskAddParams); - assert.equal(taskAddResult.status, "201"); - - const getTaskResult = await batchClient - .path("/jobs/{jobId}/tasks/{taskId}", jobId, taskAddParams.body.id!) - .get(); - if (isUnexpected(getTaskResult)) { - assert.fail(`Received unexpected status code from getting task: ${getTaskResult.status} - Response Body: ${getTaskResult.body.message}`); - } - - assert.isDefined(getTaskResult.body.applicationPackageReferences); - assert.equal( - getTaskResult.body.applicationPackageReferences![0].applicationId.toLowerCase(), - taskAddParams.body.applicationPackageReferences![0].applicationId.toLowerCase(), - ); - }); - - it("should create a task with authentication token settings successfully", async () => { - const jobId = recorder.variable("JOB_NAME", JOB_NAME); - const taskId = "TaskWithAuthTokenSettings"; - const taskAddParams: CreateTaskParameters = { - body: { - id: taskId, - commandLine: "cmd /c echo Hello World", - authenticationTokenSettings: { - access: ["job"], - }, - }, - contentType: "application/json; odata=minimalmetadata", - }; - - const taskAddResult = await batchClient.path("/jobs/{jobId}/tasks", jobId).post(taskAddParams); - assert.equal(taskAddResult.status, "201"); - - const getTaskResult = await batchClient - .path("/jobs/{jobId}/tasks/{taskId}", jobId, taskAddParams.body.id!) - .get(); - if (isUnexpected(getTaskResult)) { - assert.fail(`Received unexpected status code from getting task: ${getTaskResult.status} - Response Body: ${getTaskResult.body.message}`); - } - - const taskOutput = getTaskResult.body; - assert.isDefined(taskOutput.authenticationTokenSettings); - assert.isDefined(taskOutput.authenticationTokenSettings!.access); - assert.lengthOf(taskOutput.authenticationTokenSettings!.access!, 1); - assert.equal(taskOutput.authenticationTokenSettings!.access![0], "job"); - }); - - it("should create a task with a user identity successfully", async () => { - const jobId = recorder.variable("JOB_NAME", JOB_NAME); - const taskId = "TaskWithUserIdentity"; - const taskAddParams: CreateTaskParameters = { - body: { - id: taskId, - // This command should return a non-zero exit code for a non-admin user - commandLine: "cmd /c net session >nul 2>&1", - userIdentity: { - username: NON_ADMIN_POOL_USER, - }, - }, - contentType: "application/json; odata=minimalmetadata", - }; - - const taskAddResult = await batchClient.path("/jobs/{jobId}/tasks", jobId).post(taskAddParams); - assert.equal(taskAddResult.status, "201"); - - const getExecutedTask = async () => { - const getTaskResult = await batchClient - .path("/jobs/{jobId}/tasks/{taskId}", jobId, taskAddParams.body.id!) - .get(); - if (isUnexpected(getTaskResult)) { - assert.fail(`Received unexpected status code from getting task: ${getTaskResult.status} - Response Body: ${getTaskResult.body.message}`); - } - if ( - getTaskResult.body.executionInfo !== undefined && - getTaskResult.body.executionInfo.result !== undefined - ) { - return getTaskResult; - } - return null; - }; - - const taskRes = await waitForNotNull(getExecutedTask); - - assert.isDefined(taskRes.body.userIdentity); - assert.equal(taskRes.body.userIdentity!.username, NON_ADMIN_POOL_USER); - assert.isDefined(taskRes.body.executionInfo); - assert.equal(taskRes.body.executionInfo!.result, "failure"); - assert.notEqual(taskRes.body.executionInfo!.exitCode, 0); - }); - - it("should count tasks sucessfully", async () => { - const getTaskCountsResult = await batchClient - .path("/jobs/{jobId}/taskcounts", recorder.variable("JOB_NAME", JOB_NAME)) - .get(); - if (isUnexpected(getTaskCountsResult)) { - assert.fail(`Received unexpected status code from getting task counts: ${getTaskCountsResult.status} - Unable to provision resource needed for Task Testing. - Response Body: ${getTaskCountsResult.body.message}`); - } - - assert.isDefined(getTaskCountsResult.body.taskCounts.active); - assert.isDefined(getTaskCountsResult.body.taskCounts.completed); - assert.isAtLeast(getTaskCountsResult.body.taskCounts.completed, 1); - }); - - // TODO: Need to test with actual subtasks - // it("should list sub tasks successfully", async () => { - // const result = await client.task.listSubtasks(JOB_NAME, TASK_NAME); - - // assert.equal(result._response.status, 200); - // }); - - it("should delete a task successfully", async () => { - const deleteTaskResult = await batchClient - .path( - "/jobs/{jobId}/tasks/{taskId}", - recorder.variable("JOB_NAME", JOB_NAME), - recorder.variable("TASK_NAME", TASK_NAME), - ) - .delete(); - assert.equal(deleteTaskResult.status, "200"); - }); - - it("should delete second task successfully", async () => { - const deleteTaskResult = await batchClient - .path( - "/jobs/{jobId}/tasks/{taskId}", - recorder.variable("JOB_NAME", JOB_NAME), - recorder.variable("TASK2_NAME", TASK2_NAME), - ) - .delete(); - assert.equal(deleteTaskResult.status, "200"); - }); -}); diff --git a/sdk/batch/batch-rest/test/utils/env.browser.ts b/sdk/batch/batch-rest/test/utils/env.browser.ts deleted file mode 100644 index fc36ab244fad..000000000000 --- a/sdk/batch/batch-rest/test/utils/env.browser.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. diff --git a/sdk/batch/batch-rest/test/utils/env.ts b/sdk/batch/batch-rest/test/utils/env.ts deleted file mode 100644 index 866412f4082d..000000000000 --- a/sdk/batch/batch-rest/test/utils/env.ts +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import * as dotenv from "dotenv"; - -dotenv.config(); diff --git a/sdk/batch/batch-rest/test/utils/fakeTestSecrets.ts b/sdk/batch/batch-rest/test/utils/fakeTestSecrets.ts deleted file mode 100644 index 5b90d984dbfa..000000000000 --- a/sdk/batch/batch-rest/test/utils/fakeTestSecrets.ts +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// Centralized location for test/fake secrets so that suppressions -// are easier to maintain properly -export const fakeTestPasswordPlaceholder1 = "fakePasswordValue"; -export const fakeTestPasswordPlaceholder2 = "kt#_gahr!@aGERDXA"; -export const fakeTestPasswordPlaceholder3 = "liilef#$DdRGSa_ewkjh"; -export const fakeTestCertData = - "MIIGMQIBAzCCBe0GCSqGSIb3DQEHAaCCBd4EggXaMIIF1jCCA8AGCSqGSIb3DQEHAaCCA7EEggOtMIIDqTCCA6UGCyqGSIb3DQEMCgECoIICtjCCArIwHAYKKoZIhvcNAQwBAzAOBAhyd3xCtln3iQICB9AEggKQhe5P10V9iV1BsDlwWT561Yu2hVq3JT8ae/ebx1ZR/gMApVereDKkS9Zg4vFyssusHebbK5pDpU8vfAqle0TM4m7wGsRj453ZorSPUfMpHvQnAOn+2pEpWdMThU7xvZ6DVpwhDOQk9166z+KnKdHGuJKh4haMT7Rw/6xZ1rsBt2423cwTrQVMQyACrEkianpuujubKltN99qRoFAxhQcnYE2KlYKw7lRcExq6mDSYAyk5xJZ1ZFdLj6MAryZroQit/0g5eyhoNEKwWbi8px5j71pRTf7yjN+deMGQKwbGl+3OgaL1UZ5fCjypbVL60kpIBxLZwIJ7p3jJ+q9pbq9zSdzshPYor5lxyUfXqaso/0/91ayNoBzg4hQGh618PhFI6RMGjwkzhB9xk74iweJ9HQyIHf8yx2RCSI22JuCMitPMWSGvOszhbNx3AEDLuiiAOHg391mprEtKZguOIr9LrJwem/YmcHbwyz5YAbZmiseKPkllfC7dafFfCFEkj6R2oegIsZo0pEKYisAXBqT0g+6/jGwuhlZcBo0f7UIZm88iA3MrJCjlXEgV5OcQdoWj+hq0lKEdnhtCKr03AIfukN6+4vjjarZeW1bs0swq0l3XFf5RHa11otshMS4mpewshB9iO9MuKWpRxuxeng4PlKZ/zuBqmPeUrjJ9454oK35Pq+dghfemt7AUpBH/KycDNIZgfdEWUZrRKBGnc519C+RTqxyt5hWL18nJk4LvSd3QKlJ1iyJxClhhb/NWEzPqNdyA5cxen+2T9bd/EqJ2KzRv5/BPVwTQkHH9W/TZElFyvFfOFIW2+03RKbVGw72Mr/0xKZ+awAnEfoU+SL/2Gj2m6PHkqFX2sOCi/tN9EA4xgdswEwYJKoZIhvcNAQkVMQYEBAEAAAAwXQYJKwYBBAGCNxEBMVAeTgBNAGkAYwByAG8AcwBvAGYAdAAgAFMAdAByAG8AbgBnACAAQwByAHkAcAB0AG8AZwByAGEAcABoAGkAYwAgAFAAcgBvAHYAaQBkAGUAcjBlBgkqhkiG9w0BCRQxWB5WAFAAdgBrAFQAbQBwADoANABjAGUANgAwADQAZABhAC0AMAA2ADgAMQAtADQANAAxADUALQBhADIAYwBhAC0ANQA3ADcAMwAwADgAZQA2AGQAOQBhAGMwggIOBgkqhkiG9w0BBwGgggH/BIIB+zCCAfcwggHzBgsqhkiG9w0BDAoBA6CCAcswggHHBgoqhkiG9w0BCRYBoIIBtwSCAbMwggGvMIIBXaADAgECAhAdka3aTQsIsUphgIXGUmeRMAkGBSsOAwIdBQAwFjEUMBIGA1UEAxMLUm9vdCBBZ2VuY3kwHhcNMTYwMTAxMDcwMDAwWhcNMTgwMTAxMDcwMDAwWjASMRAwDgYDVQQDEwdub2Rlc2RrMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC5fhcxbJHxxBEIDzVOMc56s04U6k4GPY7yMR1m+rBGVRiAyV4RjY6U936dqXHCVD36ps2Q0Z+OeEgyCInkIyVeB1EwXcToOcyeS2YcUb0vRWZDouC3tuFdHwiK1Ed5iW/LksmXDotyV7kpqzaPhOFiMtBuMEwNJcPge9k17hRgRQIDAQABo0swSTBHBgNVHQEEQDA+gBAS5AktBh0dTwCNYSHcFmRjoRgwFjEUMBIGA1UEAxMLUm9vdCBBZ2VuY3mCEAY3bACqAGSKEc+41KpcNfQwCQYFKw4DAh0FAANBAHl2M97QbpzdnwO5HoRBsiEExOcLTNg+GKCr7HUsbzfvrUivw+JLL7qjHAIc5phnK+F5bQ8HKe0L9YXBSKl+fvwxFTATBgkqhkiG9w0BCRUxBgQEAQAAADA7MB8wBwYFKw4DAhoEFGVtyGMqiBd32fGpzlGZQoRM6UQwBBTI0YHFFqTS4Go8CoLgswn29EiuUQICB9A="; -export const fakeAzureBatchAccount = "batch_account"; -export const fakeAzureBatchEndpoint = "https://endpoint"; diff --git a/sdk/batch/batch-rest/test/utils/helpers.ts b/sdk/batch/batch-rest/test/utils/helpers.ts deleted file mode 100644 index 1eddb27fe0db..000000000000 --- a/sdk/batch/batch-rest/test/utils/helpers.ts +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { isPlaybackMode } from "@azure-tools/test-recorder"; -import { wait } from "./wait.js"; - -const RESOURCE_PREFIX = "JSSDKTest"; - -export function getResourceName(type: string): string { - const _SUFFIX = Math.random().toString(16).slice(2, 6); - return `${RESOURCE_PREFIX}-${type}-${_SUFFIX}`; -} - -export const POLLING_INTERVAL = isPlaybackMode() ? 1 : 15000; - -export const LONG_TEST_TIMEOUT = 1000000; - -export async function waitForNotNull( - fn: () => Promise, - pollingInterval: number = POLLING_INTERVAL, -): Promise> { - let result: T | null = null; - const startTime = Date.now(); - while ((result = await fn()) == null) { - if (Date.now() - startTime > LONG_TEST_TIMEOUT) { - throw new Error("waitFor timed out"); - } - await wait(isPlaybackMode() ? 1 : pollingInterval); - } - return result; -} diff --git a/sdk/batch/batch-rest/test/utils/recordedClient.ts b/sdk/batch/batch-rest/test/utils/recordedClient.ts deleted file mode 100644 index c516a5792352..000000000000 --- a/sdk/batch/batch-rest/test/utils/recordedClient.ts +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { - Recorder, - RecorderStartOptions, - VitestTestContext, - env, - isPlaybackMode, -} from "@azure-tools/test-recorder"; -import { ClientOptions } from "@azure-rest/core-client"; -import BatchServiceClient, { BatchClient } from "../../src/index.js"; -import { - fakeTestPasswordPlaceholder1, - fakeAzureBatchAccount, - fakeAzureBatchEndpoint, -} from "./fakeTestSecrets.js"; -import { - // AzureCliCredential, - // AzureCliCredential, - InteractiveBrowserCredential, -} from "@azure/identity"; -import { isNode } from "@azure-tools/test-utils"; -import { NoOpCredential } from "@azure-tools/test-credential"; -import { AzureNamedKeyCredential } from "@azure/core-auth"; - -const recorderEnvSetup: RecorderStartOptions = { - envSetupForPlayback: { - AZURE_BATCH_ENDPOINT: fakeAzureBatchEndpoint, - AZURE_CLIENT_ID: "azure_client_id", - AZURE_CLIENT_SECRET: "azure_client_secret", - AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", - AZURE_BATCH_ACCOUNT: fakeAzureBatchAccount, - AZURE_BATCH_ACCESS_KEY: "api_key", - }, - // see https://github.com/Azure/azure-sdk-tools/blob/main/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Common/SanitizerDictionary.cs - removeCentralSanitizers: ["AZSDK3430", "AZSDK3479", "AZSDK3402", "AZSDK3493"], - sanitizerOptions: { - bodyKeySanitizers: [ - { - jsonPath: "$.userAccounts[0].password", - value: fakeTestPasswordPlaceholder1, - }, - { - jsonPath: "$.password", - value: fakeTestPasswordPlaceholder1, - }, - ], - generalSanitizers: [ - { - regex: true, - target: `https://${fakeAzureBatchAccount}(.*)batch.azure.com`, - value: fakeAzureBatchEndpoint, - }, - ], - }, -}; - -/** - * creates the recorder and reads the environment variables from the `.env` file. - * Should be called first in the test suite to make sure environment variables are - * read before they are being used. - */ -export async function createRecorder(ctx: VitestTestContext): Promise { - const recorder = new Recorder(ctx); - await recorder.setMatcher("CustomDefaultMatcher", { - excludedHeaders: ["client-request-id", "ocp-date", "accept-encoding"], - }); - await recorder.start(recorderEnvSetup); - return recorder; -} - -export function createBatchClient(recorder?: Recorder, options: ClientOptions = {}): BatchClient { - const credential = isPlaybackMode() - ? new NoOpCredential() - : isNode - ? new AzureNamedKeyCredential(env.AZURE_BATCH_ACCOUNT!, env.AZURE_BATCH_ACCESS_KEY!) - : // : new AzureCliCredential(); - new InteractiveBrowserCredential({ - clientId: "04b07795-8ddb-461a-bbee-02f9e1bf7b46", - tokenCachePersistenceOptions: { - enabled: true, - name: "batch-test-cache", - }, - }); - - if (!isPlaybackMode() && !env.AZURE_BATCH_ENDPOINT) { - throw Error("AZURE_BATCH_ENDPOINT env variable should be set in live mode"); - } - - return BatchServiceClient( - env.AZURE_BATCH_ENDPOINT! || "https://dummy.eastus.batch.azure.com", - credential, - recorder ? recorder.configureClientOptions({ ...options }) : options, - ); -} diff --git a/sdk/batch/batch-rest/test/utils/wait.ts b/sdk/batch/batch-rest/test/utils/wait.ts deleted file mode 100644 index a28989dc274d..000000000000 --- a/sdk/batch/batch-rest/test/utils/wait.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -export const wait = (ms: number): Promise => { - return new Promise((resolve) => { - setTimeout(() => { - resolve(); - }, ms); - }); -}; diff --git a/sdk/batch/batch-rest/tsconfig.json b/sdk/batch/batch-rest/tsconfig.json index 02da0737d639..a6575847a41e 100644 --- a/sdk/batch/batch-rest/tsconfig.json +++ b/sdk/batch/batch-rest/tsconfig.json @@ -4,14 +4,13 @@ "module": "NodeNext", "moduleResolution": "NodeNext", "rootDir": ".", - "paths": { "@azure-rest/batch": ["./src/index"] } + "skipLibCheck": true }, "include": [ "./src/**/*.ts", "./src/**/*.mts", "./src/**/*.cts", "test/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ] -} +} \ No newline at end of file diff --git a/sdk/batch/batch-rest/tsp-location.yaml b/sdk/batch/batch-rest/tsp-location.yaml index 4c2217171342..f2c8cb55a596 100644 --- a/sdk/batch/batch-rest/tsp-location.yaml +++ b/sdk/batch/batch-rest/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/batch/Azure.Batch -commit: 934f8b595b6aba70096c6fd19089c3986b344c0c -repo: Azure/azure-rest-api-specs -additionalDirectories: +commit: 65171caa921a67914855465095f912fb17445d7e +repo: /mnt/vss/_work/1/s/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/batch/batch-rest/vitest.browser.config.ts b/sdk/batch/batch-rest/vitest.browser.config.ts index 943f0b6541a8..5e0dc418cfa2 100644 --- a/sdk/batch/batch-rest/vitest.browser.config.ts +++ b/sdk/batch/batch-rest/vitest.browser.config.ts @@ -2,34 +2,24 @@ // Licensed under the MIT License. import { defineConfig } from "vitest/config"; -import { isPlaybackMode, relativeRecordingsPath } from "@azure-tools/test-recorder"; +import { relativeRecordingsPath } from "@azure-tools/test-recorder"; process.env.RECORDINGS_RELATIVE_PATH = relativeRecordingsPath(); + export default defineConfig({ define: { "process.env": process.env, - __env__: process.env, - }, - optimizeDeps: { - include: ["@azure-tools/test-recorder"], }, test: { - testTimeout: 600000, - hookTimeout: 600000, reporters: ["basic", "junit"], outputFile: { junit: "test-results.browser.xml", }, browser: { enabled: true, - headless: isPlaybackMode(), + headless: true, name: "chromium", provider: "playwright", - providerOptions: { - launch: { - args: ["--disable-web-security"], - }, - }, }, fakeTimers: { toFake: ["setTimeout", "Date"], @@ -37,14 +27,11 @@ export default defineConfig({ watch: false, include: ["dist-test/browser/**/*.spec.js"], coverage: { - include: ["dist-test/browser/**/*.js"], - exclude: [ - "dist-test/browser/**/*./*-browser.mjs", - "dist-test/browser/**/*./*-react-native.mjs", - ], + include: ["dist-test/browser/**/*.spec.js"], provider: "istanbul", reporter: ["text", "json", "html"], reportsDirectory: "coverage-browser", }, + testTimeout: 1200000, }, }); diff --git a/sdk/batch/batch-rest/vitest.config.ts b/sdk/batch/batch-rest/vitest.config.ts index adc1bc8ee747..f8ab2a758bf9 100644 --- a/sdk/batch/batch-rest/vitest.config.ts +++ b/sdk/batch/batch-rest/vitest.config.ts @@ -2,19 +2,18 @@ // Licensed under the MIT License. import { defineConfig } from "vitest/config"; +import { relativeRecordingsPath } from "@azure-tools/test-recorder"; export default defineConfig({ test: { reporters: ["basic", "junit"], outputFile: { - junit: "test-results.xml", + junit: "test-results.browser.xml", }, fakeTimers: { toFake: ["setTimeout", "Date"], }, watch: false, - testTimeout: 600000, - hookTimeout: 600000, include: ["test/**/*.spec.ts"], exclude: ["test/**/browser/*.spec.ts"], coverage: { @@ -29,5 +28,6 @@ export default defineConfig({ reporter: ["text", "json", "html"], reportsDirectory: "coverage", }, + testTimeout: 1200000, }, }); diff --git a/sdk/batch/ci.yml b/sdk/batch/ci.yml index 7295c390487e..551aeae6fc2e 100644 --- a/sdk/batch/ci.yml +++ b/sdk/batch/ci.yml @@ -1,5 +1,5 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. - + trigger: branches: include: @@ -11,7 +11,6 @@ trigger: include: - sdk/batch/ci.yml - sdk/batch/batch-rest - pr: branches: include: @@ -20,11 +19,12 @@ pr: - hotfix/* - release/* - restapi* + exclude: + - feature/v4 paths: include: - sdk/batch/ci.yml - sdk/batch/batch-rest - extends: template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: