From ba5aa487a824990993a0f94a1ba6806115ac3008 Mon Sep 17 00:00:00 2001 From: Brenda Coronel Date: Mon, 10 Jun 2024 14:27:46 -0700 Subject: [PATCH 01/38] Start work on task list ui --- packages/playground/src/demo-routes.tsx | 2 +- .../src/demo/display/task-grid/utils.ts | 27 +++++++ packages/react/src/task/task-list.tsx | 1 + .../src/environment/batch-dependencies.ts | 3 + .../src/environment/environment-util.ts | 2 + .../task/__tests__/fake-task-service.spec.ts | 7 ++ .../task/__tests__/live-task-service.spec.ts | 75 +++++++++++++++++++ .../service/src/task/fake-task-service.ts | 8 ++ packages/service/src/test-util/fakes.ts | 37 +++++++++ web/src/index.tsx | 2 + 10 files changed, 163 insertions(+), 1 deletion(-) create mode 100644 packages/react/src/task/task-list.tsx create mode 100644 packages/service/src/task/__tests__/live-task-service.spec.ts diff --git a/packages/playground/src/demo-routes.tsx b/packages/playground/src/demo-routes.tsx index a32d47ae9..0a8cd536d 100644 --- a/packages/playground/src/demo-routes.tsx +++ b/packages/playground/src/demo-routes.tsx @@ -13,7 +13,7 @@ import { DataGridLoadMoreDemo } from "./demo/display/task-grid/task-data-grid"; import { TabSelectorDemo } from "./demo/form/tab-selector-demo"; import { StringListDemo } from "./demo/form/stringlist/stringlist-demo"; import { VmExtensionListDemo } from "./demo/display/vm-extension/vm-extension-list-demo"; - +// add VmExtensionTaskListDemo here once created export const DEMO_MAP = { default: () => , actionform: () => , diff --git a/packages/playground/src/demo/display/task-grid/utils.ts b/packages/playground/src/demo/display/task-grid/utils.ts index 2e84a062a..52c341036 100644 --- a/packages/playground/src/demo/display/task-grid/utils.ts +++ b/packages/playground/src/demo/display/task-grid/utils.ts @@ -1,5 +1,7 @@ import { getLogger } from "@azure/bonito-core"; import { LoadMoreFn } from "@azure/bonito-ui/lib/hooks"; +// eslint-disable-next-line no-restricted-imports +import { BatchTaskOutput } from "@batch/ui-service/src/batch-models"; // ask abt this export interface DemoTask { name: string; @@ -94,3 +96,28 @@ export class DemoTasksLoader { return tasks; } } + +// Duplicated code used for intern project +export function generateTasksForList( + accountEndPoint: string, + jobId: string, + numOfTasks: number +): BatchTaskOutput[] { + if (!jobId) { + throw new Error("Cannot create a task without a valid job ID"); + } + + const taskOutput: BatchTaskOutput[] = []; + + const baseTaskUrl = `https://${accountEndPoint}/jobs/${jobId}/tasks/`; + + for (let i = 0; i < numOfTasks; i++) { + taskOutput.push({ + url: `${baseTaskUrl}task${i + 1}`, + id: `task${i + 1}`, + state: "active", + executionInfo: { retryCount: 0, requeueCount: 0 }, + }); + } + return taskOutput; +} diff --git a/packages/react/src/task/task-list.tsx b/packages/react/src/task/task-list.tsx new file mode 100644 index 000000000..48e000ae4 --- /dev/null +++ b/packages/react/src/task/task-list.tsx @@ -0,0 +1 @@ +// React Component that displays tasks in a table/grid. Calls TaskService to get data diff --git a/packages/service/src/environment/batch-dependencies.ts b/packages/service/src/environment/batch-dependencies.ts index 94d334127..79d2c070a 100644 --- a/packages/service/src/environment/batch-dependencies.ts +++ b/packages/service/src/environment/batch-dependencies.ts @@ -1,13 +1,16 @@ import { DependencyFactories } from "@azure/bonito-core/lib/environment"; import { NodeService } from "../node"; import { PoolService } from "../pool"; +import { TaskService } from "../task/task-service"; export enum BatchDependencyName { PoolService = "poolService", NodeService = "nodeService", + TaskService = "taskService", } export interface BatchDependencyFactories extends DependencyFactories { [BatchDependencyName.PoolService]: () => PoolService; [BatchDependencyName.NodeService]: () => NodeService; + [BatchDependencyName.TaskService]: () => TaskService; } diff --git a/packages/service/src/environment/environment-util.ts b/packages/service/src/environment/environment-util.ts index 2dc157201..1f50f3031 100644 --- a/packages/service/src/environment/environment-util.ts +++ b/packages/service/src/environment/environment-util.ts @@ -8,6 +8,7 @@ import { } from "@azure/bonito-core/lib/environment"; import { FakeNodeService } from "../node"; import { FakePoolService } from "../pool"; +import { FakeTaskService } from "../task/fake-task-service"; import { BatchDependencyFactories, BatchDependencyName, @@ -16,6 +17,7 @@ import { export const mockBatchDepFactories: Partial = { [BatchDependencyName.PoolService]: () => new FakePoolService(), [BatchDependencyName.NodeService]: () => new FakeNodeService(), + [BatchDependencyName.TaskService]: () => new FakeTaskService(), }; /** diff --git a/packages/service/src/task/__tests__/fake-task-service.spec.ts b/packages/service/src/task/__tests__/fake-task-service.spec.ts index e1f98ea32..b2d276b07 100644 --- a/packages/service/src/task/__tests__/fake-task-service.spec.ts +++ b/packages/service/src/task/__tests__/fake-task-service.spec.ts @@ -17,6 +17,13 @@ describe("FakeTaskService", () => { service.setFakes(fakeSet); }); + test("Generate tasks", async () => { + const task = await service.generateTasks(accountEndpoint, jobId, 3); + expect(task[0].id).toEqual("task1"); + expect(task[1].id).toEqual("task2"); + expect(task[2].id).toEqual("task3"); + }); + test("List batch tasks", async () => { const tasks = await service.listTasks(accountEndpoint, jobId); diff --git a/packages/service/src/task/__tests__/live-task-service.spec.ts b/packages/service/src/task/__tests__/live-task-service.spec.ts new file mode 100644 index 000000000..4ac9217f5 --- /dev/null +++ b/packages/service/src/task/__tests__/live-task-service.spec.ts @@ -0,0 +1,75 @@ +import { getMockEnvironment } from "@azure/bonito-core/lib/environment"; +import { MockHttpClient, MockHttpResponse } from "@azure/bonito-core/lib/http"; +import { BatchApiVersion } from "../../constants"; +import { initMockBatchEnvironment } from "../../environment"; +import { BasicBatchFakeSet, BatchFakeSet } from "../../test-util/fakes"; +import { LiveTaskService } from "../live-task-service"; +import { TaskService } from "../task-service"; + +describe("LiveTaskService", () => { + const hoboAcctEndpoint = "mercury.eastus.batch.azure.com"; + + let service: TaskService; + let fakeSet: BatchFakeSet; + + let httpClient: MockHttpClient; + + beforeEach(() => { + initMockBatchEnvironment(); + httpClient = getMockEnvironment().getHttpClient(); + service = new LiveTaskService(); + fakeSet = new BasicBatchFakeSet(); + }); + + test("Simple get", async () => { + httpClient.addExpected( + new MockHttpResponse( + `https://${hoboAcctEndpoint}/jobs/faketestjob1/tasks/task1?api-version=${BatchApiVersion.data}`, + { + status: 200, + body: JSON.stringify( + fakeSet.getTask( + hoboAcctEndpoint, + "faketestjob1", + "task1" + ) + ), + } + ) + ); + + const task = await service.getTask( + hoboAcctEndpoint, + "faketestjob1", + "task1" + ); + expect(task).toBeDefined(); + expect(task?.id).toEqual("task1"); + }); + + test("List by job", async () => { + httpClient.addExpected( + new MockHttpResponse( + `https://${hoboAcctEndpoint}/jobs/faketestjob1/tasks?api-version=${BatchApiVersion.data}`, + { + status: 200, + body: JSON.stringify({ + value: fakeSet.listTasks( + hoboAcctEndpoint, + "faketestjob1" + ), + }), + } + ) + ); + + const tasks = await service.listTasks(hoboAcctEndpoint, "faketestjob1"); + const allTasks = []; + for await (const task of tasks) { + allTasks.push(task); + } + expect(allTasks.length).toBe(2); + expect(allTasks[0].id).toEqual("taska"); + expect(allTasks[1].id).toEqual("task1"); + }); +}); diff --git a/packages/service/src/task/fake-task-service.ts b/packages/service/src/task/fake-task-service.ts index d8d37ca5d..24b87ac39 100644 --- a/packages/service/src/task/fake-task-service.ts +++ b/packages/service/src/task/fake-task-service.ts @@ -25,4 +25,12 @@ export class FakeTaskService implements TaskService { ): Promise> { return createPagedArray(this.fakeSet.listTasks(accountEndpoint, jobId)); } + + async generateTasks( + accountEndpoint: string, + jobId: string, + numOfTasks: number + ): Promise { + return this.fakeSet.generateTasks(accountEndpoint, jobId, numOfTasks); + } } diff --git a/packages/service/src/test-util/fakes.ts b/packages/service/src/test-util/fakes.ts index 30e71ee73..2b61c73d7 100644 --- a/packages/service/src/test-util/fakes.ts +++ b/packages/service/src/test-util/fakes.ts @@ -113,6 +113,19 @@ export interface BatchFakeSet extends FakeSet { * @param jobId */ listTasks(accountEndpoint: string, jobId: string): BatchTaskOutput[]; + + /** + * Generate tasks + * + * @param accountEndpoint + * @param jobId + * @param numOfTasks The number of tasks to generate + */ + generateTasks( + accountEndpoint: string, + jobId: string, + numOfTasks: number + ): BatchTaskOutput[]; } export abstract class AbstractBatchFakeSet @@ -252,6 +265,30 @@ export abstract class AbstractBatchFakeSet ) .map((entry) => entry[1]); } + + generateTasks( + accountEndPoint: string, + jobId: string, + numOfTasks: number + ): BatchTaskOutput[] { + if (!jobId) { + throw new Error("Cannot create a task without a valid job ID"); + } + + const taskOutput: BatchTaskOutput[] = []; + + const baseTaskUrl = `https://${accountEndPoint}/jobs/${jobId}/tasks/`; + + for (let i = 0; i < numOfTasks; i++) { + taskOutput.push({ + url: `${baseTaskUrl}task${i + 1}`, + id: `task${i + 1}`, + state: "active", + executionInfo: { retryCount: 0, requeueCount: 0 }, + }); + } + return taskOutput; + } } export class BasicBatchFakeSet extends AbstractBatchFakeSet { diff --git a/web/src/index.tsx b/web/src/index.tsx index def1212e1..1809c13d7 100644 --- a/web/src/index.tsx +++ b/web/src/index.tsx @@ -25,6 +25,7 @@ import { import { FakeNodeService } from "@batch/ui-service"; import { BatchDependencyName } from "@batch/ui-service/lib/environment"; import { FakePoolService } from "@batch/ui-service/lib/pool"; +import { FakeTaskService } from "@batch/ui-service/lib/task/fake-task-service"; import * as React from "react"; import * as ReactDOM from "react-dom"; import { Application } from "./components"; @@ -65,6 +66,7 @@ export async function init(rootEl: HTMLElement): Promise { [DependencyName.Notifier]: () => new AlertNotifier(), // TODO: update with real notification implementation [BatchDependencyName.PoolService]: () => new FakePoolService(), [BatchDependencyName.NodeService]: () => new FakeNodeService(), + [BatchDependencyName.TaskService]: () => new FakeTaskService(), [DependencyName.ResourceGroupService]: () => new FakeResourceGroupService(), [DependencyName.StorageAccountService]: () => From 727fdb469eb7cbfdfa07255ca77f281387d76a42 Mon Sep 17 00:00:00 2001 From: Brenda Coronel Date: Thu, 13 Jun 2024 11:32:55 -0700 Subject: [PATCH 02/38] Playground demo testing --- package-lock.json | 9 ++ package.json | 3 +- packages/playground/src/demo-routes.tsx | 4 +- .../src/demo/display/task-grid/utils.ts | 10 +- .../demo/display/task-list/task-list-demo.tsx | 33 +++++++ .../playground/src/layout/demo-nav-menu.tsx | 5 + packages/react/src/task/task-list.tsx | 95 ++++++++++++++++++- .../service/src/task/live-task-service.ts | 8 +- 8 files changed, 156 insertions(+), 11 deletions(-) create mode 100644 packages/playground/src/demo/display/task-list/task-list-demo.tsx diff --git a/package-lock.json b/package-lock.json index d709e6940..fe1136e5b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,6 +18,7 @@ "monaco-editor": "~0.31.0", "react": "17.0.2", "react-dom": "17.0.2", + "react-icons": "^5.2.1", "tslib": "^2.3.1" }, "devDependencies": { @@ -10823,6 +10824,14 @@ "react": ">=16.13.1" } }, + "node_modules/react-icons": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-5.2.1.tgz", + "integrity": "sha512-zdbW5GstTzXaVKvGSyTaBalt7HSfuK5ovrzlpyiWHAFXndXTdd/1hdDHI4xBM1Mn7YriT6aqESucFl9kEXzrdw==", + "peerDependencies": { + "react": "*" + } + }, "node_modules/react-is": { "version": "16.13.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", diff --git a/package.json b/package.json index a0aab0069..fe75124ce 100644 --- a/package.json +++ b/package.json @@ -24,12 +24,12 @@ "monaco-editor": "~0.31.0", "react": "17.0.2", "react-dom": "17.0.2", + "react-icons": "^5.2.1", "tslib": "^2.3.1" }, "devDependencies": { "@azure-tools/typespec-client-generator-cli": "^0.3.0", "@lerna/legacy-package-management": "7.1.5", - "@typespec/compiler": "^0.50.0", "@octokit/core": "^3.5.1", "@testing-library/react": "^12.0.0", "@testing-library/react-hooks": "^8.0.0", @@ -38,6 +38,7 @@ "@types/react-dom": "^17.0.18", "@typescript-eslint/eslint-plugin": "^5.13.0", "@typescript-eslint/parser": "^5.13.0", + "@typespec/compiler": "^0.50.0", "autorest": "^3.6.3", "cross-env": "^7.0.3", "eslint": "^8.10.0", diff --git a/packages/playground/src/demo-routes.tsx b/packages/playground/src/demo-routes.tsx index 0a8cd536d..88c7330fb 100644 --- a/packages/playground/src/demo-routes.tsx +++ b/packages/playground/src/demo-routes.tsx @@ -13,7 +13,8 @@ import { DataGridLoadMoreDemo } from "./demo/display/task-grid/task-data-grid"; import { TabSelectorDemo } from "./demo/form/tab-selector-demo"; import { StringListDemo } from "./demo/form/stringlist/stringlist-demo"; import { VmExtensionListDemo } from "./demo/display/vm-extension/vm-extension-list-demo"; -// add VmExtensionTaskListDemo here once created +import { TaskListDemo } from "./demo/display/task-list/task-list-demo"; + export const DEMO_MAP = { default: () => , actionform: () => , @@ -30,6 +31,7 @@ export const DEMO_MAP = { dataGridLoadMore: () => , stringlist: () => , vmExtensionList: () => , + taskList: () => , }; export type DemoName = keyof typeof DEMO_MAP; diff --git a/packages/playground/src/demo/display/task-grid/utils.ts b/packages/playground/src/demo/display/task-grid/utils.ts index 52c341036..b7b4ba51e 100644 --- a/packages/playground/src/demo/display/task-grid/utils.ts +++ b/packages/playground/src/demo/display/task-grid/utils.ts @@ -1,7 +1,6 @@ import { getLogger } from "@azure/bonito-core"; import { LoadMoreFn } from "@azure/bonito-ui/lib/hooks"; -// eslint-disable-next-line no-restricted-imports -import { BatchTaskOutput } from "@batch/ui-service/src/batch-models"; // ask abt this +import { BatchTaskOutput } from "@batch/ui-service/lib/batch-models"; export interface DemoTask { name: string; @@ -115,8 +114,11 @@ export function generateTasksForList( taskOutput.push({ url: `${baseTaskUrl}task${i + 1}`, id: `task${i + 1}`, - state: "active", - executionInfo: { retryCount: 0, requeueCount: 0 }, + state: Math.random() > 0.5 ? "active" : "completed", + executionInfo: { + retryCount: Math.random() > 0.5 ? 0 : 1, + requeueCount: Math.random() > 0.5 ? 0 : 1, + }, }); } return taskOutput; diff --git a/packages/playground/src/demo/display/task-list/task-list-demo.tsx b/packages/playground/src/demo/display/task-list/task-list-demo.tsx new file mode 100644 index 000000000..c85eb6479 --- /dev/null +++ b/packages/playground/src/demo/display/task-list/task-list-demo.tsx @@ -0,0 +1,33 @@ +import React from "react"; +import { TaskList } from "@batch/ui-react/lib/task/task-list"; +import { DemoPane } from "../../../layout/demo-pane"; + +// TODO: look at vm-extension-list.tsx & vm-extension-list-demo.tsx +// Donutchart created here too +export const TaskListDemo: React.FC = () => { + // const [accountEndpoint] = React.useState("accountTest"); + // const [jobId] = React.useState("jobIdTest"); + const [numOfTasks] = React.useState(5); + + return ( + + + + ); +}; + +//DonutChart should be here under DemoPane +/* + + + + +*/ diff --git a/packages/playground/src/layout/demo-nav-menu.tsx b/packages/playground/src/layout/demo-nav-menu.tsx index 41b4f5ebd..49f7ec63e 100644 --- a/packages/playground/src/layout/demo-nav-menu.tsx +++ b/packages/playground/src/layout/demo-nav-menu.tsx @@ -90,6 +90,11 @@ export const DemoNavMenu: React.FC = () => { name: "VMExtension List Display", url: getDemoHash("vmExtensionList"), }, + { + key: "TaskList", + name: "Task List Display", + url: getDemoHash("taskList"), + }, ], }, ]; diff --git a/packages/react/src/task/task-list.tsx b/packages/react/src/task/task-list.tsx index 48e000ae4..d768d8ae2 100644 --- a/packages/react/src/task/task-list.tsx +++ b/packages/react/src/task/task-list.tsx @@ -1 +1,94 @@ -// React Component that displays tasks in a table/grid. Calls TaskService to get data +import React from "react"; +import { CiCircleCheck, CiClock1 } from "react-icons/ci"; +import { + DataGrid, + DataGridColumn, +} from "@azure/bonito-ui/lib/components/data-grid"; +import { BatchTaskOutput } from "@batch/ui-service/lib/batch-models"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { inject } from "@azure/bonito-core/lib/environment"; +import { BatchDependencyName } from "@batch/ui-service/lib/environment"; +import { TaskService } from "@batch/ui-service/lib/task/task-service"; + +interface TaskListProps { + accountEndpoint: string; + jobId: string; + numOfTasks: number; +} + +interface taskRow extends BatchTaskOutput { + url?: string | undefined; + id?: string | undefined; + state?: string | undefined; +} + +export const TaskList = (props: TaskListProps) => { + const { accountEndpoint, jobId, numOfTasks } = props; + const [isCompact] = React.useState(false); + const [items, setItems] = React.useState([]); + + React.useEffect(() => { + let isMounted = true; + + const taskService: TaskService = inject( + BatchDependencyName.TaskService + ); + + taskService.listTasks(accountEndpoint, jobId).then((tasks) => { + if (!isMounted) return; + + console.log(tasks); + }); + + return () => { + isMounted = false; + }; + }, [accountEndpoint, jobId, numOfTasks]); + + return ( + <> + + + ); +}; + +const columns: DataGridColumn[] = [ + { + label: "Url", + prop: "url", + minWidth: 100, + maxWidth: 150, + }, + { + label: "Name", + prop: "id", + minWidth: 100, + maxWidth: 150, + onRender: (task: any) => { + return {task.id}; + }, + }, + { + label: "State", + prop: "state", + minWidth: 150, + maxWidth: 200, + onRender: (task: any) => { + return ( +
+ {task.state == "completed" ? ( + + ) : ( + + )} + {task.state} +
+ ); + }, + }, + { + label: "ExecutionInfo", + prop: "executioninfo", + minWidth: 150, + }, +]; diff --git a/packages/service/src/task/live-task-service.ts b/packages/service/src/task/live-task-service.ts index fca39fb5c..2640b4c12 100644 --- a/packages/service/src/task/live-task-service.ts +++ b/packages/service/src/task/live-task-service.ts @@ -23,13 +23,13 @@ export class LiveTaskService } async listTasks( - accountResourceId: string, + accountEndpoint: string, jobId: string, opts?: OperationOptions ): Promise> { const listTaskPath = "/jobs/{jobId}/tasks"; const batchClient = createBatchClient( - this._ensureHttpsEndpoint(accountResourceId) + this._ensureHttpsEndpoint(accountEndpoint) ); const res = await batchClient.path(listTaskPath, jobId).get({ @@ -46,14 +46,14 @@ export class LiveTaskService } async getTask( - accountResourceId: string, + accountEndpoint: string, jobId: string, taskId: string, opts?: OperationOptions ): Promise { const taskPath = "/jobs/{jobId}/tasks/{taskId}"; const batchClient = createBatchClient( - this._ensureHttpsEndpoint(accountResourceId) + this._ensureHttpsEndpoint(accountEndpoint) ); const res = await batchClient.path(taskPath, jobId, taskId).get({ headers: { From e0bf5b8d38c1aa7816db958f8f5b3fe7dcfc5e13 Mon Sep 17 00:00:00 2001 From: Brenda Coronel Date: Tue, 18 Jun 2024 10:26:27 -0700 Subject: [PATCH 03/38] Playground service modification and slider added --- .../demo/display/task-list/task-list-demo.tsx | 48 +++--- packages/react/src/task/task-list.js | 161 ++++++++++++++++++ packages/react/src/task/task-list.tsx | 35 +++- .../task/__tests__/fake-task-service.spec.ts | 16 +- .../task/__tests__/live-task-service.spec.ts | 7 +- .../service/src/task/fake-task-service.ts | 16 +- packages/service/src/test-util/fakes.ts | 68 +++++--- 7 files changed, 288 insertions(+), 63 deletions(-) create mode 100644 packages/react/src/task/task-list.js diff --git a/packages/playground/src/demo/display/task-list/task-list-demo.tsx b/packages/playground/src/demo/display/task-list/task-list-demo.tsx index c85eb6479..b100845eb 100644 --- a/packages/playground/src/demo/display/task-list/task-list-demo.tsx +++ b/packages/playground/src/demo/display/task-list/task-list-demo.tsx @@ -1,33 +1,39 @@ import React from "react"; import { TaskList } from "@batch/ui-react/lib/task/task-list"; import { DemoPane } from "../../../layout/demo-pane"; +import { Stack } from "@fluentui/react/lib/Stack"; +import { Slider } from "@fluentui/react/lib/Slider"; -// TODO: look at vm-extension-list.tsx & vm-extension-list-demo.tsx -// Donutchart created here too export const TaskListDemo: React.FC = () => { - // const [accountEndpoint] = React.useState("accountTest"); - // const [jobId] = React.useState("jobIdTest"); - const [numOfTasks] = React.useState(5); + const [taskNumberSlider, setTaskNumberSlider] = React.useState(0); + const taskNumberSliderOnChange = (value: number) => { + setTaskNumberSlider(value); + }; return ( - + + + + + + ); }; - -//DonutChart should be here under DemoPane -/* - - - - -*/ diff --git a/packages/react/src/task/task-list.js b/packages/react/src/task/task-list.js new file mode 100644 index 000000000..492032ac5 --- /dev/null +++ b/packages/react/src/task/task-list.js @@ -0,0 +1,161 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncValues = (this && this.__asyncValues) || function (o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TaskList = void 0; +var react_1 = require("react"); +var ci_1 = require("react-icons/ci"); +var data_grid_1 = require("@azure/bonito-ui/lib/components/data-grid"); +var environment_1 = require("@azure/bonito-core/lib/environment"); +var environment_2 = require("@batch/ui-service/lib/environment"); +var TaskList = function (props) { + var accountEndpoint = props.accountEndpoint, jobId = props.jobId, numOfTasks = props.numOfTasks; + var isCompact = react_1.default.useState(false)[0]; + var _a = react_1.default.useState([]), items = _a[0], setItems = _a[1]; + react_1.default.useEffect(function () { + var isMounted = true; + var taskService = (0, environment_1.inject)(environment_2.BatchDependencyName.TaskService); + var fetchTaskList = function () { return __awaiter(void 0, void 0, void 0, function () { + var tasks, auxList, _a, tasks_1, tasks_1_1, task, e_1_1; + var _b, e_1, _c, _d; + return __generator(this, function (_e) { + switch (_e.label) { + case 0: + if (!isMounted) + return [2 /*return*/]; + return [4 /*yield*/, taskService.listTasks(accountEndpoint, jobId)]; + case 1: + tasks = _e.sent(); + auxList = []; + _e.label = 2; + case 2: + _e.trys.push([2, 7, 8, 13]); + _a = true, tasks_1 = __asyncValues(tasks); + _e.label = 3; + case 3: return [4 /*yield*/, tasks_1.next()]; + case 4: + if (!(tasks_1_1 = _e.sent(), _b = tasks_1_1.done, !_b)) return [3 /*break*/, 6]; + _d = tasks_1_1.value; + _a = false; + task = _d; + auxList.push(task); + _e.label = 5; + case 5: + _a = true; + return [3 /*break*/, 3]; + case 6: return [3 /*break*/, 13]; + case 7: + e_1_1 = _e.sent(); + e_1 = { error: e_1_1 }; + return [3 /*break*/, 13]; + case 8: + _e.trys.push([8, , 11, 12]); + if (!(!_a && !_b && (_c = tasks_1.return))) return [3 /*break*/, 10]; + return [4 /*yield*/, _c.call(tasks_1)]; + case 9: + _e.sent(); + _e.label = 10; + case 10: return [3 /*break*/, 12]; + case 11: + if (e_1) throw e_1.error; + return [7 /*endfinally*/]; + case 12: return [7 /*endfinally*/]; + case 13: + setItems(auxList); + return [2 /*return*/]; + } + }); + }); }; + fetchTaskList().catch(function (e) { + console.log("Error: ", e); + }); + return function () { + isMounted = false; + }; + }, [accountEndpoint, jobId, numOfTasks]); + return (<> + + ); +}; +exports.TaskList = TaskList; +var columns = [ + { + label: "Url", + prop: "url", + minWidth: 100, + maxWidth: 150, + }, + { + label: "Name", + prop: "id", + minWidth: 100, + maxWidth: 150, + onRender: function (task) { + return {task.id}; + }, + }, + { + label: "State", + prop: "state", + minWidth: 150, + maxWidth: 200, + onRender: function (task) { + return (
+ {task.state == "completed" ? () : ()} + {task.state} +
); + }, + }, + { + label: "ExecutionInfo", + prop: "executioninfo", + minWidth: 150, + onRender: function (task) { + return (
+ Retry count: {task.executionInfo.retryCount} {"\n"} + Requeue count: {task.executionInfo.requeueCount} +
); + }, + }, +]; diff --git a/packages/react/src/task/task-list.tsx b/packages/react/src/task/task-list.tsx index d768d8ae2..ab4d3f8ce 100644 --- a/packages/react/src/task/task-list.tsx +++ b/packages/react/src/task/task-list.tsx @@ -5,7 +5,6 @@ import { DataGridColumn, } from "@azure/bonito-ui/lib/components/data-grid"; import { BatchTaskOutput } from "@batch/ui-service/lib/batch-models"; -import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { inject } from "@azure/bonito-core/lib/environment"; import { BatchDependencyName } from "@batch/ui-service/lib/environment"; import { TaskService } from "@batch/ui-service/lib/task/task-service"; @@ -34,10 +33,26 @@ export const TaskList = (props: TaskListProps) => { BatchDependencyName.TaskService ); - taskService.listTasks(accountEndpoint, jobId).then((tasks) => { + const fetchTaskList = async () => { if (!isMounted) return; - console.log(tasks); + const tasks = await taskService.listTasks(accountEndpoint, jobId); + + const auxList = []; + for await (const task of tasks) { + auxList.push({ + url: task.url, + id: task.id, + state: " " + task.state, + executionInfo: task.executionInfo, + }); + } + + setItems(auxList); + }; + + fetchTaskList().catch((e) => { + console.log("Error: ", e); }); return () => { @@ -45,11 +60,7 @@ export const TaskList = (props: TaskListProps) => { }; }, [accountEndpoint, jobId, numOfTasks]); - return ( - <> - - - ); + return ; }; const columns: DataGridColumn[] = [ @@ -90,5 +101,13 @@ const columns: DataGridColumn[] = [ label: "ExecutionInfo", prop: "executioninfo", minWidth: 150, + onRender: (task: any) => { + return ( +
+ Retry count: {task.executionInfo.retryCount} {"\n"} + Requeue count: {task.executionInfo.requeueCount} +
+ ); + }, }, ]; diff --git a/packages/service/src/task/__tests__/fake-task-service.spec.ts b/packages/service/src/task/__tests__/fake-task-service.spec.ts index b2d276b07..75e52e1f5 100644 --- a/packages/service/src/task/__tests__/fake-task-service.spec.ts +++ b/packages/service/src/task/__tests__/fake-task-service.spec.ts @@ -5,7 +5,8 @@ import { FakeTaskService } from "../fake-task-service"; describe("FakeTaskService", () => { const accountEndpoint = "mercury.eastus.batch.azure.com"; const jobId = `faketestjob1`; - const taskIds = ["taska", "task1"]; + const taskIds = ["task1", "task2", "task3"]; + const harcodedTaskIds = ["taska", "task1"]; let service: FakeTaskService; let fakeSet: BatchFakeSet; @@ -18,7 +19,7 @@ describe("FakeTaskService", () => { }); test("Generate tasks", async () => { - const task = await service.generateTasks(accountEndpoint, jobId, 3); + const task = await service.generateTasks(accountEndpoint, jobId); expect(task[0].id).toEqual("task1"); expect(task[1].id).toEqual("task2"); expect(task[2].id).toEqual("task3"); @@ -46,4 +47,15 @@ describe("FakeTaskService", () => { expect(taskNum.id).toEqual("task1"); expect(taskLetter.id).toEqual("taska"); }); + + test("List hardcoded batch tasks", async () => { + const tasks = await service.listHardcodedTasks(accountEndpoint, jobId); + + const allTasks = []; + + for await (const task of tasks) { + allTasks.push(task); + } + expect(allTasks.map((task) => task.id)).toEqual(harcodedTaskIds); + }); }); diff --git a/packages/service/src/task/__tests__/live-task-service.spec.ts b/packages/service/src/task/__tests__/live-task-service.spec.ts index 4ac9217f5..5957deb23 100644 --- a/packages/service/src/task/__tests__/live-task-service.spec.ts +++ b/packages/service/src/task/__tests__/live-task-service.spec.ts @@ -68,8 +68,9 @@ describe("LiveTaskService", () => { for await (const task of tasks) { allTasks.push(task); } - expect(allTasks.length).toBe(2); - expect(allTasks[0].id).toEqual("taska"); - expect(allTasks[1].id).toEqual("task1"); + expect(allTasks.length).toBe(3); + expect(allTasks[0].id).toEqual("task1"); + expect(allTasks[1].id).toEqual("task2"); + expect(allTasks[2].id).toEqual("task3"); }); }); diff --git a/packages/service/src/task/fake-task-service.ts b/packages/service/src/task/fake-task-service.ts index 24b87ac39..e739ae951 100644 --- a/packages/service/src/task/fake-task-service.ts +++ b/packages/service/src/task/fake-task-service.ts @@ -23,14 +23,22 @@ export class FakeTaskService implements TaskService { accountEndpoint: string, jobId: string ): Promise> { - return createPagedArray(this.fakeSet.listTasks(accountEndpoint, jobId)); + const res = this.fakeSet.listTasks(accountEndpoint, jobId); + return createPagedArray(res); } async generateTasks( accountEndpoint: string, - jobId: string, - numOfTasks: number + jobId: string ): Promise { - return this.fakeSet.generateTasks(accountEndpoint, jobId, numOfTasks); + return this.fakeSet.generateTasks(accountEndpoint, jobId); + } + + async listHardcodedTasks( + accountEndpoint: string, + jobId: string + ): Promise> { + const res = this.fakeSet.listHardcodedTask(accountEndpoint, jobId); + return createPagedArray(res); } } diff --git a/packages/service/src/test-util/fakes.ts b/packages/service/src/test-util/fakes.ts index 2b61c73d7..875a452dc 100644 --- a/packages/service/src/test-util/fakes.ts +++ b/packages/service/src/test-util/fakes.ts @@ -119,12 +119,18 @@ export interface BatchFakeSet extends FakeSet { * * @param accountEndpoint * @param jobId - * @param numOfTasks The number of tasks to generate */ - generateTasks( + generateTasks(accountEndpoint: string, jobId: string): BatchTaskOutput[]; + + /** + * List hardcoded tasks in fakes + * + * @param accountEndpoint + * @param jobId + */ + listHardcodedTask( accountEndpoint: string, - jobId: string, - numOfTasks: number + jobId: string ): BatchTaskOutput[]; } @@ -251,26 +257,7 @@ export abstract class AbstractBatchFakeSet ]; } - listTasks(accountEndpoint: string, jobId: string): BatchTaskOutput[] { - if (!jobId) { - return []; - } - - return Object.entries(this.batchTasks) - .filter((entry) => - startsWithIgnoreCase( - entry[0], - `${accountEndpoint}:${jobId}`.toLowerCase() - ) - ) - .map((entry) => entry[1]); - } - - generateTasks( - accountEndPoint: string, - jobId: string, - numOfTasks: number - ): BatchTaskOutput[] { + generateTasks(accountEndPoint: string, jobId: string): BatchTaskOutput[] { if (!jobId) { throw new Error("Cannot create a task without a valid job ID"); } @@ -279,7 +266,7 @@ export abstract class AbstractBatchFakeSet const baseTaskUrl = `https://${accountEndPoint}/jobs/${jobId}/tasks/`; - for (let i = 0; i < numOfTasks; i++) { + for (let i = 0; i < 3; i++) { taskOutput.push({ url: `${baseTaskUrl}task${i + 1}`, id: `task${i + 1}`, @@ -289,6 +276,37 @@ export abstract class AbstractBatchFakeSet } return taskOutput; } + + listTasks(accountEndpoint: string, jobId: string): BatchTaskOutput[] { + if (!jobId) { + return []; + } + + const tasks: BatchTaskOutput[] = this.generateTasks( + accountEndpoint, + jobId + ); + + return tasks; + } + + listHardcodedTask( + accountEndpoint: string, + jobId: string + ): BatchTaskOutput[] { + if (!jobId) { + return []; + } + + return Object.entries(this.batchTasks) + .filter((entry) => + startsWithIgnoreCase( + entry[0], + `${accountEndpoint}:${jobId}`.toLowerCase() + ) + ) + .map((entry) => entry[1]); + } } export class BasicBatchFakeSet extends AbstractBatchFakeSet { From 1de774004ec7f4abe63635ae55eaacecd2445ac8 Mon Sep 17 00:00:00 2001 From: Brenda Coronel Date: Wed, 19 Jun 2024 14:03:25 -0700 Subject: [PATCH 04/38] Playground demo changes --- .../src/demo/display/task-grid/utils.ts | 28 ------- .../demo/display/task-list/task-list-demo.tsx | 14 +++- packages/react/src/task/task-list.tsx | 84 ++++++++++++++----- .../service/src/task/fake-task-service.ts | 18 +--- packages/service/src/test-util/fakes.ts | 67 ++++++++++++++- 5 files changed, 139 insertions(+), 72 deletions(-) diff --git a/packages/playground/src/demo/display/task-grid/utils.ts b/packages/playground/src/demo/display/task-grid/utils.ts index b7b4ba51e..d72f3f15b 100644 --- a/packages/playground/src/demo/display/task-grid/utils.ts +++ b/packages/playground/src/demo/display/task-grid/utils.ts @@ -95,31 +95,3 @@ export class DemoTasksLoader { return tasks; } } - -// Duplicated code used for intern project -export function generateTasksForList( - accountEndPoint: string, - jobId: string, - numOfTasks: number -): BatchTaskOutput[] { - if (!jobId) { - throw new Error("Cannot create a task without a valid job ID"); - } - - const taskOutput: BatchTaskOutput[] = []; - - const baseTaskUrl = `https://${accountEndPoint}/jobs/${jobId}/tasks/`; - - for (let i = 0; i < numOfTasks; i++) { - taskOutput.push({ - url: `${baseTaskUrl}task${i + 1}`, - id: `task${i + 1}`, - state: Math.random() > 0.5 ? "active" : "completed", - executionInfo: { - retryCount: Math.random() > 0.5 ? 0 : 1, - requeueCount: Math.random() > 0.5 ? 0 : 1, - }, - }); - } - return taskOutput; -} diff --git a/packages/playground/src/demo/display/task-list/task-list-demo.tsx b/packages/playground/src/demo/display/task-list/task-list-demo.tsx index b100845eb..d9b26f8f1 100644 --- a/packages/playground/src/demo/display/task-list/task-list-demo.tsx +++ b/packages/playground/src/demo/display/task-list/task-list-demo.tsx @@ -1,8 +1,11 @@ -import React from "react"; +import { inject } from "@azure/bonito-core/lib/environment"; import { TaskList } from "@batch/ui-react/lib/task/task-list"; -import { DemoPane } from "../../../layout/demo-pane"; -import { Stack } from "@fluentui/react/lib/Stack"; +import { BatchDependencyName } from "@batch/ui-service/lib/environment/batch-dependencies"; +import { FakeTaskService } from "@batch/ui-service/lib/task/fake-task-service"; import { Slider } from "@fluentui/react/lib/Slider"; +import { Stack } from "@fluentui/react/lib/Stack"; +import React from "react"; +import { DemoPane } from "../../../layout/demo-pane"; export const TaskListDemo: React.FC = () => { const [taskNumberSlider, setTaskNumberSlider] = React.useState(0); @@ -10,6 +13,10 @@ export const TaskListDemo: React.FC = () => { setTaskNumberSlider(value); }; + const taskService: FakeTaskService = inject( + BatchDependencyName.TaskService + ); + return ( { ); diff --git a/packages/react/src/task/task-list.tsx b/packages/react/src/task/task-list.tsx index ab4d3f8ce..14e3e9391 100644 --- a/packages/react/src/task/task-list.tsx +++ b/packages/react/src/task/task-list.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { CiCircleCheck, CiClock1 } from "react-icons/ci"; +import { CiCircleCheck, CiAvocado } from "react-icons/ci"; import { DataGrid, DataGridColumn, @@ -8,11 +8,12 @@ import { BatchTaskOutput } from "@batch/ui-service/lib/batch-models"; import { inject } from "@azure/bonito-core/lib/environment"; import { BatchDependencyName } from "@batch/ui-service/lib/environment"; import { TaskService } from "@batch/ui-service/lib/task/task-service"; +import { CiCircleChevDown } from "react-icons/ci"; +import { IconButton } from "@fluentui/react/lib/Button"; interface TaskListProps { accountEndpoint: string; jobId: string; - numOfTasks: number; } interface taskRow extends BatchTaskOutput { @@ -22,7 +23,7 @@ interface taskRow extends BatchTaskOutput { } export const TaskList = (props: TaskListProps) => { - const { accountEndpoint, jobId, numOfTasks } = props; + const { accountEndpoint, jobId } = props; const [isCompact] = React.useState(false); const [items, setItems] = React.useState([]); @@ -38,17 +39,18 @@ export const TaskList = (props: TaskListProps) => { const tasks = await taskService.listTasks(accountEndpoint, jobId); - const auxList = []; + const items = []; for await (const task of tasks) { - auxList.push({ + items.push({ url: task.url, id: task.id, - state: " " + task.state, + state: task.state, + creationTime: task.creationTime, executionInfo: task.executionInfo, }); } - setItems(auxList); + setItems(items); }; fetchTaskList().catch((e) => { @@ -58,20 +60,21 @@ export const TaskList = (props: TaskListProps) => { return () => { isMounted = false; }; - }, [accountEndpoint, jobId, numOfTasks]); + }, [accountEndpoint, jobId]); - return ; + return ( + + ); }; const columns: DataGridColumn[] = [ { - label: "Url", - prop: "url", - minWidth: 100, - maxWidth: 150, - }, - { - label: "Name", + label: "Task", prop: "id", minWidth: 100, maxWidth: 150, @@ -87,10 +90,20 @@ const columns: DataGridColumn[] = [ onRender: (task: any) => { return (
- {task.state == "completed" ? ( - + {task.state === "completed" ? ( + ) : ( - + )} {task.state}
@@ -98,8 +111,17 @@ const columns: DataGridColumn[] = [ }, }, { - label: "ExecutionInfo", - prop: "executioninfo", + label: "Created", + prop: "created", + minWidth: 150, + maxWidth: 200, + onRender: (task: any) => { + return
{task.creationTime}
; + }, + }, + { + label: "Exit Code", + prop: "exitcode", minWidth: 150, onRender: (task: any) => { return ( @@ -110,4 +132,24 @@ const columns: DataGridColumn[] = [ ); }, }, + { + label: " ", + prop: " ", + minWidth: 150, + onRender: (task: any) => { + return ( +
+ + + +
+ ); + }, + }, ]; +/** + + */ diff --git a/packages/service/src/task/fake-task-service.ts b/packages/service/src/task/fake-task-service.ts index e739ae951..d8d37ca5d 100644 --- a/packages/service/src/task/fake-task-service.ts +++ b/packages/service/src/task/fake-task-service.ts @@ -23,22 +23,6 @@ export class FakeTaskService implements TaskService { accountEndpoint: string, jobId: string ): Promise> { - const res = this.fakeSet.listTasks(accountEndpoint, jobId); - return createPagedArray(res); - } - - async generateTasks( - accountEndpoint: string, - jobId: string - ): Promise { - return this.fakeSet.generateTasks(accountEndpoint, jobId); - } - - async listHardcodedTasks( - accountEndpoint: string, - jobId: string - ): Promise> { - const res = this.fakeSet.listHardcodedTask(accountEndpoint, jobId); - return createPagedArray(res); + return createPagedArray(this.fakeSet.listTasks(accountEndpoint, jobId)); } } diff --git a/packages/service/src/test-util/fakes.ts b/packages/service/src/test-util/fakes.ts index 875a452dc..b0a70a619 100644 --- a/packages/service/src/test-util/fakes.ts +++ b/packages/service/src/test-util/fakes.ts @@ -258,6 +258,46 @@ export abstract class AbstractBatchFakeSet } generateTasks(accountEndPoint: string, jobId: string): BatchTaskOutput[] { + /* + function getRandomDateTime(): string { + const year = Math.floor(Math.random() * 50) + 2020; + const month = Math.floor(Math.random() * 12); + const day = Math.floor(Math.random() * 28) + 1; + const hours = Math.floor(Math.random() * 24); + const minutes = Math.floor(Math.random() * 60); + const seconds = Math.floor(Math.random() * 60); // Random second + + const date = new Date(year, month, day, hours, minutes, seconds); + return date.toString(); + } + */ + + function getRandomDateTime(): string { + const year = Math.floor(Math.random() * 50) + 2020; + const month = Math.floor(Math.random() * 12); + const day = Math.floor(Math.random() * 28); // Assume all months have 28 days for simplicity + const hours = Math.floor(Math.random() * 24); + const minutes = Math.floor(Math.random() * 60); + const seconds = Math.floor(Math.random() * 60); + + const date = new Date(year, month, day, hours, minutes, seconds); + + // Format the date and time + const formattedDateTime = date.toLocaleString("en-US", { + year: "numeric", + month: "short", + day: "numeric", + hour: "2-digit", + minute: "2-digit", + second: "2-digit", + }); + + return formattedDateTime; + } + + const randomGeneratedDateTime = getRandomDateTime(); + console.log(randomGeneratedDateTime); // Example output: "Aug 17, 2022 14:50:40" + if (!jobId) { throw new Error("Cannot create a task without a valid job ID"); } @@ -267,11 +307,34 @@ export abstract class AbstractBatchFakeSet const baseTaskUrl = `https://${accountEndPoint}/jobs/${jobId}/tasks/`; for (let i = 0; i < 3; i++) { + /* + const seed = Math.random(); + const seedStr = seed.toString().substring(2); + + let exitCode, state; + + if (parseInt(seedStr[0]) <= 5) { + exitCode = "Success"; + } else { + exitCode = "Failure"; + } + + if (exitCode === "Success") { + state = parseInt(seedStr[1]) <= 5 ? "Active" : "Completed"; + } else { + state = parseInt(seedStr[1]) <= 5 ? "Error" : "Running"; + } + */ + taskOutput.push({ url: `${baseTaskUrl}task${i + 1}`, id: `task${i + 1}`, - state: "active", - executionInfo: { retryCount: 0, requeueCount: 0 }, + state: Math.random() > 0.5 ? "active" : "completed", + creationTime: getRandomDateTime(), + executionInfo: { + retryCount: Math.random() > 0.5 ? 0 : 1, + requeueCount: Math.random() > 0.5 ? 0 : 1, + }, }); } return taskOutput; From 3664b804d3d567f2d86c2c9f24c6dfed7fd8e6ac Mon Sep 17 00:00:00 2001 From: ReneOv-MSFT <142273469+ReneOv-MSFT@users.noreply.github.com> Date: Wed, 19 Jun 2024 14:27:27 -0700 Subject: [PATCH 05/38] Remove numOfTask from live service, inject TaskService on demo view instead of grid component --- .../demo/display/task-list/task-list-demo.tsx | 40 +++++++++++--- packages/react/src/task/task-list.tsx | 54 ++++++------------- .../service/src/task/fake-task-service.ts | 7 ++- packages/service/src/test-util/fakes.ts | 39 +++++++------- 4 files changed, 75 insertions(+), 65 deletions(-) diff --git a/packages/playground/src/demo/display/task-list/task-list-demo.tsx b/packages/playground/src/demo/display/task-list/task-list-demo.tsx index d9b26f8f1..cab18bf30 100644 --- a/packages/playground/src/demo/display/task-list/task-list-demo.tsx +++ b/packages/playground/src/demo/display/task-list/task-list-demo.tsx @@ -6,16 +6,45 @@ import { Slider } from "@fluentui/react/lib/Slider"; import { Stack } from "@fluentui/react/lib/Stack"; import React from "react"; import { DemoPane } from "../../../layout/demo-pane"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { BatchTaskOutput } from "@batch/ui-service/src/batch-models"; export const TaskListDemo: React.FC = () => { const [taskNumberSlider, setTaskNumberSlider] = React.useState(0); + const [items, setItems] = React.useState< + PagedAsyncIterableIterator + >([]); const taskNumberSliderOnChange = (value: number) => { setTaskNumberSlider(value); }; - - const taskService: FakeTaskService = inject( - BatchDependencyName.TaskService + const [accountEndpoint, setAccountEndpoint] = React.useState( + "mercury.eastus.batch.azure.com" ); + const [jobId, setJobId] = React.useState("faketestjob1"); + + React.useEffect(() => { + let isMounted = true; + + const taskService: FakeTaskService = inject( + BatchDependencyName.TaskService + ); + + const fetchTaskList = async () => { + if (!isMounted) return; + + const tasks = await taskService.listTasks(accountEndpoint, jobId); + + setItems(tasks); + }; + + fetchTaskList().catch((e) => { + console.log("Error: ", e); + }); + + return () => { + isMounted = false; + }; + }, [accountEndpoint, jobId]); return ( @@ -36,10 +65,7 @@ export const TaskListDemo: React.FC = () => { /> - + ); }; diff --git a/packages/react/src/task/task-list.tsx b/packages/react/src/task/task-list.tsx index 14e3e9391..af46ed770 100644 --- a/packages/react/src/task/task-list.tsx +++ b/packages/react/src/task/task-list.tsx @@ -5,15 +5,12 @@ import { DataGridColumn, } from "@azure/bonito-ui/lib/components/data-grid"; import { BatchTaskOutput } from "@batch/ui-service/lib/batch-models"; -import { inject } from "@azure/bonito-core/lib/environment"; -import { BatchDependencyName } from "@batch/ui-service/lib/environment"; -import { TaskService } from "@batch/ui-service/lib/task/task-service"; import { CiCircleChevDown } from "react-icons/ci"; import { IconButton } from "@fluentui/react/lib/Button"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; interface TaskListProps { - accountEndpoint: string; - jobId: string; + pagedTasks: PagedAsyncIterableIterator; } interface taskRow extends BatchTaskOutput { @@ -23,44 +20,25 @@ interface taskRow extends BatchTaskOutput { } export const TaskList = (props: TaskListProps) => { - const { accountEndpoint, jobId } = props; - const [isCompact] = React.useState(false); + const { pagedTasks } = props; const [items, setItems] = React.useState([]); + const [isCompact] = React.useState(false); React.useEffect(() => { - let isMounted = true; - - const taskService: TaskService = inject( - BatchDependencyName.TaskService - ); - - const fetchTaskList = async () => { - if (!isMounted) return; - - const tasks = await taskService.listTasks(accountEndpoint, jobId); - - const items = []; - for await (const task of tasks) { - items.push({ - url: task.url, - id: task.id, - state: task.state, - creationTime: task.creationTime, - executionInfo: task.executionInfo, - }); - } - - setItems(items); - }; + const taskArray = []; - fetchTaskList().catch((e) => { - console.log("Error: ", e); - }); + for await (const task of pagedTasks) { + taskArray.push({ + url: task.url, + id: task.id, + state: task.state, + creationTime: task.creationTime, + executionInfo: task.executionInfo, + }); + } - return () => { - isMounted = false; - }; - }, [accountEndpoint, jobId]); + setItems(taskArray); + }, [pagedTasks]); return ( > { - return createPagedArray(this.fakeSet.listTasks(accountEndpoint, jobId)); + return createPagedArray( + this.fakeSet.listTasks(accountEndpoint, jobId, numOfTasks) + ); } } diff --git a/packages/service/src/test-util/fakes.ts b/packages/service/src/test-util/fakes.ts index b0a70a619..fa4dc9b85 100644 --- a/packages/service/src/test-util/fakes.ts +++ b/packages/service/src/test-util/fakes.ts @@ -112,15 +112,11 @@ export interface BatchFakeSet extends FakeSet { * @param accountEndpoint * @param jobId */ - listTasks(accountEndpoint: string, jobId: string): BatchTaskOutput[]; - - /** - * Generate tasks - * - * @param accountEndpoint - * @param jobId - */ - generateTasks(accountEndpoint: string, jobId: string): BatchTaskOutput[]; + listTasks( + accountEndpoint: string, + jobId: string, + numOfTasks?: number + ): BatchTaskOutput[]; /** * List hardcoded tasks in fakes @@ -257,7 +253,11 @@ export abstract class AbstractBatchFakeSet ]; } - generateTasks(accountEndPoint: string, jobId: string): BatchTaskOutput[] { + generateTasks( + accountEndPoint: string, + jobId: string, + numOfTasks: number + ): BatchTaskOutput[] { /* function getRandomDateTime(): string { const year = Math.floor(Math.random() * 50) + 2020; @@ -306,7 +306,7 @@ export abstract class AbstractBatchFakeSet const baseTaskUrl = `https://${accountEndPoint}/jobs/${jobId}/tasks/`; - for (let i = 0; i < 3; i++) { + for (let i = 0; i < numOfTasks; i++) { /* const seed = Math.random(); const seedStr = seed.toString().substring(2); @@ -340,17 +340,20 @@ export abstract class AbstractBatchFakeSet return taskOutput; } - listTasks(accountEndpoint: string, jobId: string): BatchTaskOutput[] { + listTasks( + accountEndpoint: string, + jobId: string, + numOfTasks?: number + ): BatchTaskOutput[] { if (!jobId) { return []; } - const tasks: BatchTaskOutput[] = this.generateTasks( - accountEndpoint, - jobId - ); - - return tasks; + if (numOfTasks) { + return this.generateTasks(accountEndpoint, jobId, numOfTasks); + } else { + return this.listHardcodedTask(accountEndpoint, jobId); + } } listHardcodedTask( From bca932f501bdc14fe66c7dee7cd03c5881800b9e Mon Sep 17 00:00:00 2001 From: Brenda Coronel Date: Wed, 19 Jun 2024 15:25:40 -0700 Subject: [PATCH 06/38] Task List Demo modifications --- .../src/demo/display/task-grid/utils.ts | 1 - .../demo/display/task-list/task-list-demo.tsx | 31 +++++++++---------- packages/react/src/task/task-list.tsx | 30 +++++++++--------- .../task/__tests__/fake-task-service.spec.ts | 15 ++++++--- 4 files changed, 40 insertions(+), 37 deletions(-) diff --git a/packages/playground/src/demo/display/task-grid/utils.ts b/packages/playground/src/demo/display/task-grid/utils.ts index d72f3f15b..2e84a062a 100644 --- a/packages/playground/src/demo/display/task-grid/utils.ts +++ b/packages/playground/src/demo/display/task-grid/utils.ts @@ -1,6 +1,5 @@ import { getLogger } from "@azure/bonito-core"; import { LoadMoreFn } from "@azure/bonito-ui/lib/hooks"; -import { BatchTaskOutput } from "@batch/ui-service/lib/batch-models"; export interface DemoTask { name: string; diff --git a/packages/playground/src/demo/display/task-list/task-list-demo.tsx b/packages/playground/src/demo/display/task-list/task-list-demo.tsx index cab18bf30..3c75a4402 100644 --- a/packages/playground/src/demo/display/task-list/task-list-demo.tsx +++ b/packages/playground/src/demo/display/task-list/task-list-demo.tsx @@ -6,21 +6,18 @@ import { Slider } from "@fluentui/react/lib/Slider"; import { Stack } from "@fluentui/react/lib/Stack"; import React from "react"; import { DemoPane } from "../../../layout/demo-pane"; -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { BatchTaskOutput } from "@batch/ui-service/src/batch-models"; +import { TextField } from "@azure/bonito-ui/src/components/form"; +import { TextFieldOnChange } from "../../../functions"; +//import { PagedAsyncIterableIterator } from "@azure/core-paging"; export const TaskListDemo: React.FC = () => { - const [taskNumberSlider, setTaskNumberSlider] = React.useState(0); - const [items, setItems] = React.useState< - PagedAsyncIterableIterator - >([]); - const taskNumberSliderOnChange = (value: number) => { - setTaskNumberSlider(value); - }; - const [accountEndpoint, setAccountEndpoint] = React.useState( + const [taskNumberField, setTaskNumberField] = React.useState(0); + const [items, setItems] = React.useState([]); + + const [accountEndpoint] = React.useState( "mercury.eastus.batch.azure.com" ); - const [jobId, setJobId] = React.useState("faketestjob1"); + const [jobId] = React.useState("faketestjob1"); React.useEffect(() => { let isMounted = true; @@ -56,12 +53,12 @@ export const TaskListDemo: React.FC = () => { styles={{ root: { marginBottom: "1em" } }} > - { + const number = parseInt(`${newValue}`); + setTaskNumberField(number); + }} /> diff --git a/packages/react/src/task/task-list.tsx b/packages/react/src/task/task-list.tsx index af46ed770..238cc1759 100644 --- a/packages/react/src/task/task-list.tsx +++ b/packages/react/src/task/task-list.tsx @@ -7,10 +7,10 @@ import { import { BatchTaskOutput } from "@batch/ui-service/lib/batch-models"; import { CiCircleChevDown } from "react-icons/ci"; import { IconButton } from "@fluentui/react/lib/Button"; -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +//import { PagedAsyncIterableIterator } from "@azure/core-paging"; interface TaskListProps { - pagedTasks: PagedAsyncIterableIterator; + pagedTasks: any; } interface taskRow extends BatchTaskOutput { @@ -25,19 +25,21 @@ export const TaskList = (props: TaskListProps) => { const [isCompact] = React.useState(false); React.useEffect(() => { - const taskArray = []; + const parseTasks = async () => { + const taskArray = []; - for await (const task of pagedTasks) { - taskArray.push({ - url: task.url, - id: task.id, - state: task.state, - creationTime: task.creationTime, - executionInfo: task.executionInfo, - }); - } - - setItems(taskArray); + for await (const task of pagedTasks) { + taskArray.push({ + url: task.url, + id: task.id, + state: task.state, + creationTime: task.creationTime, + executionInfo: task.executionInfo, + }); + } + setItems(taskArray); + }; + parseTasks(); }, [pagedTasks]); return ( diff --git a/packages/service/src/task/__tests__/fake-task-service.spec.ts b/packages/service/src/task/__tests__/fake-task-service.spec.ts index 75e52e1f5..3ab2da460 100644 --- a/packages/service/src/task/__tests__/fake-task-service.spec.ts +++ b/packages/service/src/task/__tests__/fake-task-service.spec.ts @@ -19,10 +19,15 @@ describe("FakeTaskService", () => { }); test("Generate tasks", async () => { - const task = await service.generateTasks(accountEndpoint, jobId); - expect(task[0].id).toEqual("task1"); - expect(task[1].id).toEqual("task2"); - expect(task[2].id).toEqual("task3"); + const tasks = await service.listTasks(accountEndpoint, jobId, 3); + const allTasks = []; + for await (const task of tasks) { + allTasks.push(task); + } + + expect(allTasks[0].id).toEqual("task1"); + expect(allTasks[1].id).toEqual("task2"); + expect(allTasks[2].id).toEqual("task3"); }); test("List batch tasks", async () => { @@ -49,7 +54,7 @@ describe("FakeTaskService", () => { }); test("List hardcoded batch tasks", async () => { - const tasks = await service.listHardcodedTasks(accountEndpoint, jobId); + const tasks = await service.listTasks(accountEndpoint, jobId); const allTasks = []; From 0924135f2cdfffa43c771c637cc644130155e7cc Mon Sep 17 00:00:00 2001 From: Brenda Coronel Date: Thu, 20 Jun 2024 15:18:21 -0700 Subject: [PATCH 07/38] Displayed exit code in demo --- .../demo/display/task-list/task-list-demo.tsx | 25 +++---- packages/react/src/task/task-list.tsx | 50 +++++++++----- packages/service/src/test-util/fakes.ts | 66 +++++-------------- 3 files changed, 64 insertions(+), 77 deletions(-) diff --git a/packages/playground/src/demo/display/task-list/task-list-demo.tsx b/packages/playground/src/demo/display/task-list/task-list-demo.tsx index 3c75a4402..4aa522feb 100644 --- a/packages/playground/src/demo/display/task-list/task-list-demo.tsx +++ b/packages/playground/src/demo/display/task-list/task-list-demo.tsx @@ -2,16 +2,15 @@ import { inject } from "@azure/bonito-core/lib/environment"; import { TaskList } from "@batch/ui-react/lib/task/task-list"; import { BatchDependencyName } from "@batch/ui-service/lib/environment/batch-dependencies"; import { FakeTaskService } from "@batch/ui-service/lib/task/fake-task-service"; -import { Slider } from "@fluentui/react/lib/Slider"; import { Stack } from "@fluentui/react/lib/Stack"; import React from "react"; import { DemoPane } from "../../../layout/demo-pane"; -import { TextField } from "@azure/bonito-ui/src/components/form"; -import { TextFieldOnChange } from "../../../functions"; -//import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { TextField } from "@fluentui/react/lib/TextField"; export const TaskListDemo: React.FC = () => { - const [taskNumberField, setTaskNumberField] = React.useState(0); + const [taskNumberField, setTaskNumberField] = React.useState< + string | undefined + >(undefined); const [items, setItems] = React.useState([]); const [accountEndpoint] = React.useState( @@ -29,8 +28,13 @@ export const TaskListDemo: React.FC = () => { const fetchTaskList = async () => { if (!isMounted) return; - const tasks = await taskService.listTasks(accountEndpoint, jobId); - + const tasks = taskNumberField + ? await taskService.listTasks( + accountEndpoint, + jobId, + parseInt(taskNumberField) + ) + : await taskService.listTasks(accountEndpoint, jobId); setItems(tasks); }; @@ -41,10 +45,10 @@ export const TaskListDemo: React.FC = () => { return () => { isMounted = false; }; - }, [accountEndpoint, jobId]); + }, [accountEndpoint, jobId, taskNumberField]); return ( - + { { - const number = parseInt(`${newValue}`); - setTaskNumberField(number); + setTaskNumberField(newValue); }} /> diff --git a/packages/react/src/task/task-list.tsx b/packages/react/src/task/task-list.tsx index 238cc1759..304de1a15 100644 --- a/packages/react/src/task/task-list.tsx +++ b/packages/react/src/task/task-list.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { CiCircleCheck, CiAvocado } from "react-icons/ci"; +import { CiCircleCheck } from "react-icons/ci"; import { DataGrid, DataGridColumn, @@ -7,6 +7,8 @@ import { import { BatchTaskOutput } from "@batch/ui-service/lib/batch-models"; import { CiCircleChevDown } from "react-icons/ci"; import { IconButton } from "@fluentui/react/lib/Button"; +import { MdOutlineRunningWithErrors } from "react-icons/md"; +import { RiProgress1Line, RiLoader3Fill } from "react-icons/ri"; //import { PagedAsyncIterableIterator } from "@azure/core-paging"; interface TaskListProps { @@ -35,6 +37,7 @@ export const TaskList = (props: TaskListProps) => { state: task.state, creationTime: task.creationTime, executionInfo: task.executionInfo, + exitConditions: task.exitConditions?.exitCodes[0].code, }); } setItems(taskArray); @@ -68,23 +71,38 @@ const columns: DataGridColumn[] = [ minWidth: 150, maxWidth: 200, onRender: (task: any) => { + console.log(task.exitConditions); return (
- {task.state === "completed" ? ( + {task.state.toLowerCase() === "completed" ? ( - ) : ( - + ) : task.state.toLowerCase() === "failed" ? ( + + ) : task.state.toLowerCase() === "running" ? ( + - )} + ) : null} {task.state}
); @@ -100,16 +118,12 @@ const columns: DataGridColumn[] = [ }, }, { - label: "Exit Code", - prop: "exitcode", + label: "Exit code", + prop: "exitCode", minWidth: 150, + maxWidth: 200, onRender: (task: any) => { - return ( -
- Retry count: {task.executionInfo.retryCount} {"\n"} - Requeue count: {task.executionInfo.requeueCount} -
- ); + return
{task.exitConditions}
; }, }, { @@ -132,4 +146,8 @@ const columns: DataGridColumn[] = [ name="" iconProps={} /> + + + Retry count: {task.executionInfo.retryCount} {"\n"} +Requeue count: {task.executionInfo.requeueCount} */ diff --git a/packages/service/src/test-util/fakes.ts b/packages/service/src/test-util/fakes.ts index fa4dc9b85..a14cf03c7 100644 --- a/packages/service/src/test-util/fakes.ts +++ b/packages/service/src/test-util/fakes.ts @@ -111,6 +111,7 @@ export interface BatchFakeSet extends FakeSet { * * @param accountEndpoint * @param jobId + * @param numOfTasks The number of tasks to generate */ listTasks( accountEndpoint: string, @@ -258,46 +259,6 @@ export abstract class AbstractBatchFakeSet jobId: string, numOfTasks: number ): BatchTaskOutput[] { - /* - function getRandomDateTime(): string { - const year = Math.floor(Math.random() * 50) + 2020; - const month = Math.floor(Math.random() * 12); - const day = Math.floor(Math.random() * 28) + 1; - const hours = Math.floor(Math.random() * 24); - const minutes = Math.floor(Math.random() * 60); - const seconds = Math.floor(Math.random() * 60); // Random second - - const date = new Date(year, month, day, hours, minutes, seconds); - return date.toString(); - } - */ - - function getRandomDateTime(): string { - const year = Math.floor(Math.random() * 50) + 2020; - const month = Math.floor(Math.random() * 12); - const day = Math.floor(Math.random() * 28); // Assume all months have 28 days for simplicity - const hours = Math.floor(Math.random() * 24); - const minutes = Math.floor(Math.random() * 60); - const seconds = Math.floor(Math.random() * 60); - - const date = new Date(year, month, day, hours, minutes, seconds); - - // Format the date and time - const formattedDateTime = date.toLocaleString("en-US", { - year: "numeric", - month: "short", - day: "numeric", - hour: "2-digit", - minute: "2-digit", - second: "2-digit", - }); - - return formattedDateTime; - } - - const randomGeneratedDateTime = getRandomDateTime(); - console.log(randomGeneratedDateTime); // Example output: "Aug 17, 2022 14:50:40" - if (!jobId) { throw new Error("Cannot create a task without a valid job ID"); } @@ -307,33 +268,34 @@ export abstract class AbstractBatchFakeSet const baseTaskUrl = `https://${accountEndPoint}/jobs/${jobId}/tasks/`; for (let i = 0; i < numOfTasks; i++) { - /* const seed = Math.random(); const seedStr = seed.toString().substring(2); let exitCode, state; if (parseInt(seedStr[0]) <= 5) { - exitCode = "Success"; + exitCode = 1; } else { - exitCode = "Failure"; + exitCode = 0; } - if (exitCode === "Success") { + if (exitCode == 1) { state = parseInt(seedStr[1]) <= 5 ? "Active" : "Completed"; } else { - state = parseInt(seedStr[1]) <= 5 ? "Error" : "Running"; + state = parseInt(seedStr[1]) <= 5 ? "Failed" : "Running"; } - */ taskOutput.push({ url: `${baseTaskUrl}task${i + 1}`, id: `task${i + 1}`, - state: Math.random() > 0.5 ? "active" : "completed", - creationTime: getRandomDateTime(), + state: state, + creationTime: `Aug 15, 2022 14:${i}`, executionInfo: { - retryCount: Math.random() > 0.5 ? 0 : 1, - requeueCount: Math.random() > 0.5 ? 0 : 1, + retryCount: Math.floor(Math.random() * 10), + requeueCount: Math.floor(Math.random() * 10), + }, + exitConditions: { + exitCodes: [{ code: exitCode, exitOptions: {} }], }, }); } @@ -974,19 +936,23 @@ export class BasicBatchFakeSet extends AbstractBatchFakeSet { url: "https://batchsyntheticsprod.eastus2euap.batch.azure.com/jobs/faketestjob1/tasks/taskA", id: "taska", state: "active", + creationTime: "Aug 15, 2022 14:50:00", executionInfo: { retryCount: 0, requeueCount: 0, }, + exitConditions: { exitCodes: [{ code: 1, exitOptions: {} }] }, }, "mercury.eastus.batch.azure.com:faketestjob1:task1": { url: "https://batchsyntheticsprod.eastus2euap.batch.azure.com/jobs/faketestjob1/tasks/task1", id: "task1", state: "completed", + creationTime: "Aug 15, 2022 14:50:01", executionInfo: { retryCount: 0, requeueCount: 0, }, + exitConditions: { exitCodes: [{ code: 0, exitOptions: {} }] }, }, }; From 472f938e1771f0c55b794c149da83f9b4da8dc3d Mon Sep 17 00:00:00 2001 From: Brenda Coronel Date: Mon, 24 Jun 2024 11:43:32 -0700 Subject: [PATCH 08/38] Removing comments --- packages/react/src/task/task-list.tsx | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/packages/react/src/task/task-list.tsx b/packages/react/src/task/task-list.tsx index 304de1a15..e5d3b0fbf 100644 --- a/packages/react/src/task/task-list.tsx +++ b/packages/react/src/task/task-list.tsx @@ -9,7 +9,6 @@ import { CiCircleChevDown } from "react-icons/ci"; import { IconButton } from "@fluentui/react/lib/Button"; import { MdOutlineRunningWithErrors } from "react-icons/md"; import { RiProgress1Line, RiLoader3Fill } from "react-icons/ri"; -//import { PagedAsyncIterableIterator } from "@azure/core-paging"; interface TaskListProps { pagedTasks: any; @@ -71,7 +70,6 @@ const columns: DataGridColumn[] = [ minWidth: 150, maxWidth: 200, onRender: (task: any) => { - console.log(task.exitConditions); return (
{task.state.toLowerCase() === "completed" ? ( @@ -121,7 +119,6 @@ const columns: DataGridColumn[] = [ label: "Exit code", prop: "exitCode", minWidth: 150, - maxWidth: 200, onRender: (task: any) => { return
{task.exitConditions}
; }, @@ -141,13 +138,3 @@ const columns: DataGridColumn[] = [ }, }, ]; -/** - - - - Retry count: {task.executionInfo.retryCount} {"\n"} -Requeue count: {task.executionInfo.requeueCount} - */ From 3d97364918268347f4f268c58b30b7e0bebd126c Mon Sep 17 00:00:00 2001 From: Haopeng Wang Date: Mon, 24 Jun 2024 14:33:13 -0700 Subject: [PATCH 09/38] Update Batch Dataplane RLC with latest TypeSpec (#2912) * Update batch-rest with the latest TypeSpec & update API version * update @azure packages * upgrade BatchExplorer's TypeScript --- desktop/package-lock.json | 8 +- desktop/package.json | 2 +- desktop/tsconfig.browser.json | 5 +- eng/emitter-package-lock.json | 563 +++++------ eng/emitter-package.json | 18 +- packages/service/package-lock.json | 161 +-- packages/service/package.json | 8 +- packages/service/src/constants.ts | 2 +- .../service/src/internal/batch-rest/client.ts | 2 +- .../batch-rest/generated/src/batchClient.ts | 16 +- .../generated/src/clientDefinitions.ts | 335 ++----- .../batch-rest/generated/src/index.ts | 18 +- .../batch-rest/generated/src/isUnexpected.ts | 214 ++-- .../batch-rest/generated/src/models.ts | 701 ++++++------- .../batch-rest/generated/src/outputModels.ts | 925 +++++++----------- .../generated/src/paginateHelper.ts | 12 +- .../batch-rest/generated/src/parameters.ts | 721 +++----------- .../batch-rest/generated/src/responses.ts | 820 +++++++--------- .../batch-rest/generated/tsp-location.yaml | 4 +- util/common-config/jest-common.js | 5 +- 20 files changed, 1641 insertions(+), 2899 deletions(-) diff --git a/desktop/package-lock.json b/desktop/package-lock.json index 3815b51e6..76067d77f 100644 --- a/desktop/package-lock.json +++ b/desktop/package-lock.json @@ -138,7 +138,7 @@ "to-string-loader": "^1.1.6", "ts-loader": "^5.4.5", "ts-node": "^8.10.2", - "typescript": "~4.1.0", + "typescript": "~4.6.0", "url-loader": "^1.1.2", "webpack": "^4.44.1", "webpack-cli": "^3.3.12", @@ -20078,9 +20078,9 @@ } }, "node_modules/typescript": { - "version": "4.1.6", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.1.6.tgz", - "integrity": "sha512-pxnwLxeb/Z5SP80JDRzVjh58KsM6jZHRAOtTpS7sXLS4ogXNKC9ANxHHZqLLeVHZN35jCtI4JdmLLbLiC1kBow==", + "version": "4.6.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.4.tgz", + "integrity": "sha512-9ia/jWHIEbo49HfjrLGfKbZSuWo9iTMwXO+Ca3pRsSpbsMbc7/IU8NKdCZVRRBafVPGnoJeFL76ZOAA84I9fEg==", "dev": true, "bin": { "tsc": "bin/tsc", diff --git a/desktop/package.json b/desktop/package.json index 91d910700..9e38957aa 100644 --- a/desktop/package.json +++ b/desktop/package.json @@ -177,7 +177,7 @@ "to-string-loader": "^1.1.6", "ts-loader": "^5.4.5", "ts-node": "^8.10.2", - "typescript": "~4.1.0", + "typescript": "~4.6.0", "url-loader": "^1.1.2", "webpack": "^4.44.1", "webpack-cli": "^3.3.12", diff --git a/desktop/tsconfig.browser.json b/desktop/tsconfig.browser.json index d4de32ffe..0123de454 100644 --- a/desktop/tsconfig.browser.json +++ b/desktop/tsconfig.browser.json @@ -5,5 +5,8 @@ "src/test/**/*.ts", "test/**/*.ts", "**/testing**/*" - ] + ], + "angularCompilerOptions": { + "disableTypeScriptVersionCheck": true + } } diff --git a/eng/emitter-package-lock.json b/eng/emitter-package-lock.json index d35b93521..3969edac8 100644 --- a/eng/emitter-package-lock.json +++ b/eng/emitter-package-lock.json @@ -6,20 +6,22 @@ "": { "name": "typescript-emitter-package", "dependencies": { - "@azure-tools/typespec-autorest": "0.35.0", - "@azure-tools/typespec-azure-core": "0.35.0", - "@azure-tools/typespec-client-generator-core": "0.35.0", - "@azure-tools/typespec-ts": "0.19.0", - "@typespec/compiler": "0.49.0", - "@typespec/http": "0.49.0", - "@typespec/rest": "0.49.0", - "@typespec/versioning": "0.49.0" + "@azure-tools/typespec-autorest": "0.42.1", + "@azure-tools/typespec-azure-core": "0.42.0", + "@azure-tools/typespec-azure-resource-manager": "0.42.1", + "@azure-tools/typespec-azure-rulesets": "0.42.1", + "@azure-tools/typespec-client-generator-core": "0.42.3", + "@azure-tools/typespec-ts": "0.29.0", + "@typespec/compiler": "0.56.0", + "@typespec/http": "0.56.0", + "@typespec/rest": "0.56.0", + "@typespec/versioning": "0.56.0" } }, "node_modules/@azure-tools/rlc-common": { - "version": "0.19.0", - "resolved": "https://registry.npmjs.org/@azure-tools/rlc-common/-/rlc-common-0.19.0.tgz", - "integrity": "sha512-ljfmTt0aCLhCeyamIptBEt1OFg7r4LydMqWqK2esHio2wWzW9JmndiGvnz+hXVi2uXyPlUX4A93tKuHAQq52ug==", + "version": "0.29.0", + "resolved": "https://registry.npmjs.org/@azure-tools/rlc-common/-/rlc-common-0.29.0.tgz", + "integrity": "sha512-JAvOAYuNPBAXSMo2bLsglsbBA26oCwUKibXG6iUIdwP5oKITuuCFLnBG0rx28qEV/exvCpO9QHvd7WEDQzTv5g==", "dependencies": { "handlebars": "^4.7.7", "lodash": "^4.17.21", @@ -27,96 +29,138 @@ } }, "node_modules/@azure-tools/typespec-autorest": { - "version": "0.35.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-autorest/-/typespec-autorest-0.35.0.tgz", - "integrity": "sha512-UGiRhgyBc3WWEUgIsSaT44Jgbw6KD2DwYNDr6Oxl2Ig/8ZIInpIB5Eix7mgdqKoN6ifra1wLn0GDAltwVx+idQ==", + "version": "0.42.1", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-autorest/-/typespec-autorest-0.42.1.tgz", + "integrity": "sha512-egWR2Ljxde5PvyDwuVu/8Rq8cSW6FW+qMbvwHfzrtm/sULdSnA6k+VnGD/PQ+dk+1SmFeKG1b+0MlaFuBVz1Hw==", "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": "~0.35.0", - "@typespec/compiler": "~0.49.0", - "@typespec/http": "~0.49.0", - "@typespec/openapi": "~0.49.0", - "@typespec/rest": "~0.49.0", - "@typespec/versioning": "~0.49.0" + "@azure-tools/typespec-azure-core": "~0.42.0", + "@azure-tools/typespec-client-generator-core": "~0.42.0", + "@typespec/compiler": "~0.56.0", + "@typespec/http": "~0.56.0", + "@typespec/openapi": "~0.56.0", + "@typespec/rest": "~0.56.0", + "@typespec/versioning": "~0.56.0" } }, "node_modules/@azure-tools/typespec-azure-core": { - "version": "0.35.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-core/-/typespec-azure-core-0.35.0.tgz", - "integrity": "sha512-BOzR58O6ZeMcvDD9D1gd9/kZvmJUlyXUiF0BSQUouNVWTlOL9yIMVKZE+zgTiaYm8a3z2uIU9Us6y8CULoWiyw==", + "version": "0.42.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-core/-/typespec-azure-core-0.42.0.tgz", + "integrity": "sha512-8C96RkgSWtgqsaHRMWCd2iDltFJZTGmFQiTZazZj/uRy0Wn1ikjSriSN8t1puL5SiUPd0BVJP/YXiwAfjfZYDA==", "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.49.0", - "@typespec/http": "~0.49.0", - "@typespec/rest": "~0.49.0" + "@typespec/compiler": "~0.56.0", + "@typespec/http": "~0.56.0", + "@typespec/rest": "~0.56.0" + } + }, + "node_modules/@azure-tools/typespec-azure-resource-manager": { + "version": "0.42.1", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-resource-manager/-/typespec-azure-resource-manager-0.42.1.tgz", + "integrity": "sha512-vUqmHWS9OrN+16jXfpgUdUXXa1RLrr8Pkrzb1HFQGmdXuRxMZZtLCRcyyEHZJIMYE4RmmpPoB3JJeqiGWxlegQ==", + "dependencies": { + "change-case": "~5.4.4", + "pluralize": "^8.0.0" + }, + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "@azure-tools/typespec-autorest": "~0.42.1", + "@azure-tools/typespec-azure-core": "~0.42.0", + "@typespec/compiler": "~0.56.0", + "@typespec/http": "~0.56.0", + "@typespec/openapi": "~0.56.0", + "@typespec/rest": "~0.56.0", + "@typespec/versioning": "~0.56.0" + } + }, + "node_modules/@azure-tools/typespec-azure-rulesets": { + "version": "0.42.1", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-rulesets/-/typespec-azure-rulesets-0.42.1.tgz", + "integrity": "sha512-GRiMErWJ96DvDBQMVgGI1sgMTOegXxpx7w6enZyEF0BaodxGfObJyl1TrMb9Pj6NAZfV5Q6uJAfXFbpF1MVDCw==", + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "@azure-tools/typespec-azure-core": "~0.42.0", + "@azure-tools/typespec-azure-resource-manager": "~0.42.1", + "@azure-tools/typespec-client-generator-core": "~0.42.3", + "@typespec/compiler": "~0.56.0" } }, "node_modules/@azure-tools/typespec-client-generator-core": { - "version": "0.35.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.35.0.tgz", - "integrity": "sha512-3uItmYVhZVmPKCe+s8UZKAubUsjtTbgqVQI4wNayLuAovB9OrWmq09Wq1XEWFHPboGf+4Irehe/feTDnSHA+UA==", + "version": "0.42.3", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.42.3.tgz", + "integrity": "sha512-ZDVVIY1uJ8EaI4QhCdQmTdKVACm4xYn/I7ySpwv4oxk9X8kZFhxx+PKNHAlx34mhOf4oF0PW3wCN5DMeU6asYg==", + "dependencies": { + "change-case": "~5.4.4", + "pluralize": "^8.0.0" + }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.49.0", - "@typespec/http": "~0.49.0", - "@typespec/rest": "~0.49.0", - "@typespec/versioning": "~0.49.0" + "@azure-tools/typespec-azure-core": "~0.42.0", + "@typespec/compiler": "~0.56.0", + "@typespec/http": "~0.56.0", + "@typespec/rest": "~0.56.0", + "@typespec/versioning": "~0.56.0" } }, "node_modules/@azure-tools/typespec-ts": { - "version": "0.19.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-ts/-/typespec-ts-0.19.0.tgz", - "integrity": "sha512-kqMYC/69Hrcj0pNs7oVl4hczJ4ewzn89l8Jwh79++zzbDnML/27wZv1Cd5PLqfVxprDOQjZBhPH+eVkHne/ATQ==", + "version": "0.29.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-ts/-/typespec-ts-0.29.0.tgz", + "integrity": "sha512-jV+yFduauP68OtN7Xc4v1iFA91yIIDszkcqwGGnHMhLTiypD/hVt96ZEqOoVsWYeUkGt6bGrgPKak+bZD3DYtA==", "dependencies": { - "@azure-tools/rlc-common": "^0.19.0", + "@azure-tools/rlc-common": "^0.29.0", "fs-extra": "^11.1.0", - "prettier": "^2.6.1", + "prettier": "^3.1.0", "ts-morph": "^15.1.0", "tslib": "^2.3.1" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": ">=0.35.0 <1.0.0", - "@azure-tools/typespec-client-generator-core": ">=0.35.0 <1.0.0", - "@typespec/compiler": ">=0.49.0 <1.0.0", - "@typespec/http": ">=0.49.0 <1.0.0", - "@typespec/rest": ">=0.49.0 <1.0.0", - "@typespec/versioning": ">=0.49.0 <1.0.0" + "@azure-tools/typespec-azure-core": ">=0.42.0 <1.0.0", + "@azure-tools/typespec-client-generator-core": ">=0.42.2 <1.0.0", + "@typespec/compiler": ">=0.56.0 <1.0.0", + "@typespec/http": ">=0.56.0 <1.0.0", + "@typespec/rest": ">=0.56.0 <1.0.0", + "@typespec/versioning": ">=0.56.0 <1.0.0" } }, "node_modules/@babel/code-frame": { - "version": "7.22.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", - "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz", + "integrity": "sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==", "dependencies": { - "@babel/highlight": "^7.22.13", - "chalk": "^2.4.2" + "@babel/highlight": "^7.24.7", + "picocolors": "^1.0.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", - "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz", + "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/highlight": { - "version": "7.23.4", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz", - "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.7.tgz", + "integrity": "sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==", "dependencies": { - "@babel/helper-validator-identifier": "^7.22.20", + "@babel/helper-validator-identifier": "^7.24.7", "chalk": "^2.4.2", - "js-tokens": "^4.0.0" + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" }, "engines": { "node": ">=6.9.0" @@ -154,6 +198,17 @@ "node": ">= 8" } }, + "node_modules/@sindresorhus/merge-streams": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-2.3.0.tgz", + "integrity": "sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/@ts-morph/common": { "version": "0.16.0", "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.16.0.tgz", @@ -166,22 +221,22 @@ } }, "node_modules/@typespec/compiler": { - "version": "0.49.0", - "resolved": "https://registry.npmjs.org/@typespec/compiler/-/compiler-0.49.0.tgz", - "integrity": "sha512-wu0BzCnG6K8GArO1Mo0UIAVvsGnip+Dce3uBuPcW6mGSAv6Y0NljWBHp8dAJNs+uv45wFWpdkZFQvjr3SNUDJw==", + "version": "0.56.0", + "resolved": "https://registry.npmjs.org/@typespec/compiler/-/compiler-0.56.0.tgz", + "integrity": "sha512-K+VhXycoeqcoSGtB0/l1XYco4V2qRsCOOwqklVM4Yew7kTcKVfz7CT7a6a2OKWDMNg5iijZtRBoM5YF50XtQug==", "dependencies": { - "@babel/code-frame": "~7.22.13", + "@babel/code-frame": "~7.24.2", "ajv": "~8.12.0", - "change-case": "~4.1.2", - "globby": "~13.2.2", + "change-case": "~5.4.4", + "globby": "~14.0.1", "mustache": "~4.2.0", "picocolors": "~1.0.0", - "prettier": "~3.0.3", + "prettier": "~3.2.5", "prompts": "~2.4.2", - "semver": "^7.5.4", - "vscode-languageserver": "~9.0.0", - "vscode-languageserver-textdocument": "~1.0.8", - "yaml": "~2.3.2", + "semver": "^7.6.0", + "vscode-languageserver": "~9.0.1", + "vscode-languageserver-textdocument": "~1.0.11", + "yaml": "~2.4.1", "yargs": "~17.7.2" }, "bin": { @@ -189,13 +244,13 @@ "tsp-server": "cmd/tsp-server.js" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/@typespec/compiler/node_modules/prettier": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz", - "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==", + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", + "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", "bin": { "prettier": "bin/prettier.cjs" }, @@ -207,50 +262,50 @@ } }, "node_modules/@typespec/http": { - "version": "0.49.0", - "resolved": "https://registry.npmjs.org/@typespec/http/-/http-0.49.0.tgz", - "integrity": "sha512-MvDJ0s7CjeA/nmutQ4PSTYOj0Gy+78PNd/xe4W5II5w4Kb32Q1vT/oWI2bVZ9G5MkTugKK9P6jmfzwY7EiHksg==", + "version": "0.56.0", + "resolved": "https://registry.npmjs.org/@typespec/http/-/http-0.56.0.tgz", + "integrity": "sha512-f/tpHRWev9bnAtNPFkfCU/5SFou9glA/rPDY0m2W5bK6EG1/6/TKKKz5FoKPA4xvc2dQ5vu/ouGLb4i5UzXvWQ==", "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.49.0" + "@typespec/compiler": "~0.56.0" } }, "node_modules/@typespec/openapi": { - "version": "0.49.0", - "resolved": "https://registry.npmjs.org/@typespec/openapi/-/openapi-0.49.0.tgz", - "integrity": "sha512-2TQfnGKtiiKYD1eMiRAcEwDByaBf5WgvcIlLWpWJk/nmcKr6ZeOzUDj5V1fGiiY+/1sI0C0qGCz8PIxcvLa9kw==", + "version": "0.56.0", + "resolved": "https://registry.npmjs.org/@typespec/openapi/-/openapi-0.56.0.tgz", + "integrity": "sha512-q8+IHRglXBm3slvonRLSNYN2fX7plbWA+ugIiMJZTeyc3enqfxPqMGA8BCiAFV3kwP0uPPpIXbCSIVhHgkONbA==", "peer": true, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.49.0", - "@typespec/http": "~0.49.0" + "@typespec/compiler": "~0.56.0", + "@typespec/http": "~0.56.0" } }, "node_modules/@typespec/rest": { - "version": "0.49.0", - "resolved": "https://registry.npmjs.org/@typespec/rest/-/rest-0.49.0.tgz", - "integrity": "sha512-C5Ym3Dal5MzDkDIAzTekLsGtPDzRSC9cbiagq4LQfFtzfUPA8tJlJOnD8txTw/XIaFg0hvAPNgTZSa+xtiXskQ==", + "version": "0.56.0", + "resolved": "https://registry.npmjs.org/@typespec/rest/-/rest-0.56.0.tgz", + "integrity": "sha512-8w4WhWDcpEQNW8bB1BHhiBxIQUChDJtyq/n9p2OI/Bm1wncd61y/ZNOtcxmlKq8uB9d+dzHiZdEfqFCR8HF8/Q==", "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.49.0", - "@typespec/http": "~0.49.0" + "@typespec/compiler": "~0.56.0", + "@typespec/http": "~0.56.0" } }, "node_modules/@typespec/versioning": { - "version": "0.49.0", - "resolved": "https://registry.npmjs.org/@typespec/versioning/-/versioning-0.49.0.tgz", - "integrity": "sha512-SuRcEB0yaD/wPwaXweIRr+lNDB4hgZwFxHi84y7De1xlntutRl+NeRgWd+K4yVS6tpyNHzcqK6Z7bBD30yQK/w==", + "version": "0.56.0", + "resolved": "https://registry.npmjs.org/@typespec/versioning/-/versioning-0.56.0.tgz", + "integrity": "sha512-j7IN9XFyGn3LH6IOJkinEvk9sDncsxiWPULOAe0VQ+D/dtCfLawDMUALnvklMDRKeD1OOUPSCjjUAp9OB0f7YA==", "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.49.0" + "@typespec/compiler": "~0.56.0" } }, "node_modules/ajv": { @@ -301,35 +356,16 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" } }, - "node_modules/camel-case": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-4.1.2.tgz", - "integrity": "sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw==", - "dependencies": { - "pascal-case": "^3.1.2", - "tslib": "^2.0.3" - } - }, - "node_modules/capital-case": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/capital-case/-/capital-case-1.0.4.tgz", - "integrity": "sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A==", - "dependencies": { - "no-case": "^3.0.4", - "tslib": "^2.0.3", - "upper-case-first": "^2.0.2" - } - }, "node_modules/chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -344,23 +380,9 @@ } }, "node_modules/change-case": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/change-case/-/change-case-4.1.2.tgz", - "integrity": "sha512-bSxY2ws9OtviILG1EiY5K7NNxkqg/JnRnFxLtKQ96JaviiIxi7djMrSd0ECT9AC+lttClmYwKw53BWpOMblo7A==", - "dependencies": { - "camel-case": "^4.1.2", - "capital-case": "^1.0.4", - "constant-case": "^3.0.4", - "dot-case": "^3.0.4", - "header-case": "^2.0.4", - "no-case": "^3.0.4", - "param-case": "^3.0.4", - "pascal-case": "^3.1.2", - "path-case": "^3.0.4", - "sentence-case": "^3.0.4", - "snake-case": "^3.0.4", - "tslib": "^2.0.3" - } + "version": "5.4.4", + "resolved": "https://registry.npmjs.org/change-case/-/change-case-5.4.4.tgz", + "integrity": "sha512-HRQyTk2/YPEkt9TnUPbOpr64Uw3KOicFWPVBb+xiHvd6eBx/qPr9xqfBFDT8P2vWsvvz4jbEkfDe71W3VyNu2w==" }, "node_modules/cliui": { "version": "8.0.1", @@ -393,45 +415,15 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" }, - "node_modules/constant-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/constant-case/-/constant-case-3.0.4.tgz", - "integrity": "sha512-I2hSBi7Vvs7BEuJDr5dDHfzb/Ruj3FyvFyh7KLilAjNQw3Be+xgqUBA2W6scVEcL0hL1dwPRtIqEPVUCKkSsyQ==", - "dependencies": { - "no-case": "^3.0.4", - "tslib": "^2.0.3", - "upper-case": "^2.0.2" - } - }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/dot-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz", - "integrity": "sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==", - "dependencies": { - "no-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, "node_modules/escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", "engines": { "node": ">=6" } @@ -465,17 +457,17 @@ } }, "node_modules/fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", "dependencies": { "reusify": "^1.0.4" } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -484,9 +476,9 @@ } }, "node_modules/fs-extra": { - "version": "11.1.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.1.1.tgz", - "integrity": "sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ==", + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", + "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", @@ -516,18 +508,19 @@ } }, "node_modules/globby": { - "version": "13.2.2", - "resolved": "https://registry.npmjs.org/globby/-/globby-13.2.2.tgz", - "integrity": "sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==", + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/globby/-/globby-14.0.1.tgz", + "integrity": "sha512-jOMLD2Z7MAhyG8aJpNOpmziMOP4rPLcc95oQPKXBazW82z+CEgPFBQvEpRUa1KeIMUJo4Wsm+q6uzO/Q/4BksQ==", "dependencies": { - "dir-glob": "^3.0.1", - "fast-glob": "^3.3.0", + "@sindresorhus/merge-streams": "^2.1.0", + "fast-glob": "^3.3.2", "ignore": "^5.2.4", - "merge2": "^1.4.1", - "slash": "^4.0.0" + "path-type": "^5.0.0", + "slash": "^5.1.0", + "unicorn-magic": "^0.1.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -566,19 +559,10 @@ "node": ">=4" } }, - "node_modules/header-case": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/header-case/-/header-case-2.0.4.tgz", - "integrity": "sha512-H/vuk5TEEVZwrR0lp2zed9OCo1uAILMlx0JEMgC26rzyJJ3N1v6XkwHHXJQdR2doSjcGPM6OKPYoJgf0plJ11Q==", - "dependencies": { - "capital-case": "^1.0.4", - "tslib": "^2.0.3" - } - }, "node_modules/ignore": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.0.tgz", - "integrity": "sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", "engines": { "node": ">= 4" } @@ -652,25 +636,6 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, - "node_modules/lower-case": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", - "integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==", - "dependencies": { - "tslib": "^2.0.3" - } - }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -680,11 +645,11 @@ } }, "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", + "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", "dependencies": { - "braces": "^3.0.2", + "braces": "^3.0.3", "picomatch": "^2.3.1" }, "engines": { @@ -734,59 +699,26 @@ "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==" }, - "node_modules/no-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", - "integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==", - "dependencies": { - "lower-case": "^2.0.2", - "tslib": "^2.0.3" - } - }, - "node_modules/param-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/param-case/-/param-case-3.0.4.tgz", - "integrity": "sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==", - "dependencies": { - "dot-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, - "node_modules/pascal-case": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/pascal-case/-/pascal-case-3.1.2.tgz", - "integrity": "sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g==", - "dependencies": { - "no-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, "node_modules/path-browserify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==" }, - "node_modules/path-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/path-case/-/path-case-3.0.4.tgz", - "integrity": "sha512-qO4qCFjXqVTrcbPt/hQfhTQ+VhFsqNKOPtytgNKkKxSoEp3XPUQ8ObFuePylOIok5gjn69ry8XiULxCwot3Wfg==", - "dependencies": { - "dot-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-5.0.0.tgz", + "integrity": "sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==", "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", + "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==" }, "node_modules/picomatch": { "version": "2.3.1", @@ -799,15 +731,23 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/pluralize": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", + "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", + "engines": { + "node": ">=4" + } + }, "node_modules/prettier": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", - "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.1.tgz", + "integrity": "sha512-7CAwy5dRsxs8PHXT3twixW9/OEll8MLE0VRPCJyl7CkS6VHGPSlsVaWTiASPTyGyYRyApxlaWTzwUxVNrhcwDg==", "bin": { - "prettier": "bin-prettier.js" + "prettier": "bin/prettier.cjs" }, "engines": { - "node": ">=10.13.0" + "node": ">=14" }, "funding": { "url": "https://github.com/prettier/prettier?sponsor=1" @@ -900,12 +840,9 @@ } }, "node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dependencies": { - "lru-cache": "^6.0.0" - }, + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", "bin": { "semver": "bin/semver.js" }, @@ -913,41 +850,22 @@ "node": ">=10" } }, - "node_modules/sentence-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/sentence-case/-/sentence-case-3.0.4.tgz", - "integrity": "sha512-8LS0JInaQMCRoQ7YUytAo/xUu5W2XnQxV2HI/6uM6U7CITS1RqPElr30V6uIqyMKM9lJGRVFy5/4CuzcixNYSg==", - "dependencies": { - "no-case": "^3.0.4", - "tslib": "^2.0.3", - "upper-case-first": "^2.0.2" - } - }, "node_modules/sisteransi": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==" }, "node_modules/slash": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", - "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-5.1.0.tgz", + "integrity": "sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==", "engines": { - "node": ">=12" + "node": ">=14.16" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/snake-case": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/snake-case/-/snake-case-3.0.4.tgz", - "integrity": "sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==", - "dependencies": { - "dot-case": "^3.0.4", - "tslib": "^2.0.3" - } - }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -1012,9 +930,9 @@ } }, "node_modules/tslib": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", + "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==" }, "node_modules/uglify-js": { "version": "3.17.4", @@ -1028,6 +946,17 @@ "node": ">=0.8.0" } }, + "node_modules/unicorn-magic": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.1.0.tgz", + "integrity": "sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/universalify": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", @@ -1036,22 +965,6 @@ "node": ">= 10.0.0" } }, - "node_modules/upper-case": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/upper-case/-/upper-case-2.0.2.tgz", - "integrity": "sha512-KgdgDGJt2TpuwBUIjgG6lzw2GWFRCW9Qkfkiv0DxqHHLYJHmtmdUIKcZd8rHgFSjopVTlw6ggzCm1b8MFQwikg==", - "dependencies": { - "tslib": "^2.0.3" - } - }, - "node_modules/upper-case-first": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/upper-case-first/-/upper-case-first-2.0.2.tgz", - "integrity": "sha512-514ppYHBaKwfJRK/pNC6c/OxfGa0obSnAl106u97Ed0I625Nin96KAjttZF6ZL3e1XLtphxnqrOi9iWgm+u+bg==", - "dependencies": { - "tslib": "^2.0.3" - } - }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -1157,15 +1070,13 @@ "node": ">=10" } }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - }, "node_modules/yaml": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.4.tgz", - "integrity": "sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==", + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.3.tgz", + "integrity": "sha512-sntgmxj8o7DE7g/Qi60cqpLBA3HG3STcDA0kO+WfB05jEKhZMbY7umNm2rBpQvsmZ16/lPXCJGW2672dgOUkrg==", + "bin": { + "yaml": "bin.mjs" + }, "engines": { "node": ">= 14" } diff --git a/eng/emitter-package.json b/eng/emitter-package.json index 11221c28b..f948f4f1a 100644 --- a/eng/emitter-package.json +++ b/eng/emitter-package.json @@ -2,13 +2,15 @@ "name": "typescript-emitter-package", "main": "dist/src/index.js", "dependencies": { - "@azure-tools/typespec-ts": "0.19.0", - "@azure-tools/typespec-azure-core": "0.35.0", - "@azure-tools/typespec-autorest": "0.35.0", - "@azure-tools/typespec-client-generator-core": "0.35.0", - "@typespec/compiler": "0.49.0", - "@typespec/http": "0.49.0", - "@typespec/rest": "0.49.0", - "@typespec/versioning": "0.49.0" + "@azure-tools/typespec-ts": "0.29.0", + "@azure-tools/typespec-azure-core": "0.42.0", + "@azure-tools/typespec-autorest": "0.42.1", + "@azure-tools/typespec-client-generator-core": "0.42.3", + "@azure-tools/typespec-azure-resource-manager": "0.42.1", + "@azure-tools/typespec-azure-rulesets": "0.42.1", + "@typespec/compiler": "0.56.0", + "@typespec/http": "0.56.0", + "@typespec/rest": "0.56.0", + "@typespec/versioning": "0.56.0" } } diff --git a/packages/service/package-lock.json b/packages/service/package-lock.json index fb7e938aa..9175e527a 100644 --- a/packages/service/package-lock.json +++ b/packages/service/package-lock.json @@ -9,11 +9,11 @@ "version": "1.0.1", "license": "MIT", "dependencies": { - "@azure-rest/core-client": "^1.1.4", - "@azure/core-auth": "^1.3.0", + "@azure-rest/core-client": "^1.4.0", + "@azure/core-auth": "^1.6.0", "@azure/core-lro": "^2.2.0", - "@azure/core-paging": "^1.2.0", - "@azure/core-rest-pipeline": "^1.8.0", + "@azure/core-paging": "^1.5.0", + "@azure/core-rest-pipeline": "^1.16.0", "@azure/logger": "^1.0.0" }, "devDependencies": { @@ -42,19 +42,30 @@ } }, "node_modules/@azure-rest/core-client": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/@azure-rest/core-client/-/core-client-1.1.4.tgz", - "integrity": "sha512-RUIQOA8T0WcbNlddr8hjl2MuC5GVRqmMwPXqBVsgvdKesLy+eg3y/6nf3qe2fvcJMI1gF6VtgU5U4hRaR4w4ag==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@azure-rest/core-client/-/core-client-1.4.0.tgz", + "integrity": "sha512-ozTDPBVUDR5eOnMIwhggbnVmOrka4fXCs8n8mvUo4WLLc38kki6bAOByDoVZZPz/pZy2jMt2kwfpvy/UjALj6w==", "dependencies": { - "@azure/abort-controller": "^1.1.0", + "@azure/abort-controller": "^2.0.0", "@azure/core-auth": "^1.3.0", "@azure/core-rest-pipeline": "^1.5.0", "@azure/core-tracing": "^1.0.1", "@azure/core-util": "^1.0.0", - "tslib": "^2.2.0" + "tslib": "^2.6.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18.0.0" + } + }, + "node_modules/@azure-rest/core-client/node_modules/@azure/abort-controller": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-2.1.2.tgz", + "integrity": "sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA==", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" } }, "node_modules/@azure/abort-controller": { @@ -69,16 +80,27 @@ } }, "node_modules/@azure/core-auth": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.5.0.tgz", - "integrity": "sha512-udzoBuYG1VBoHVohDTrvKjyzel34zt77Bhp7dQntVGGD0ehVq48owENbBG8fIgkHRNUBQH5k1r0hpoMu5L8+kw==", + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.7.2.tgz", + "integrity": "sha512-Igm/S3fDYmnMq1uKS38Ae1/m37B3zigdlZw+kocwEhh5GjyKjPrXKO2J6rzpC1wAxrNil/jX9BJRqBshyjnF3g==", "dependencies": { - "@azure/abort-controller": "^1.0.0", + "@azure/abort-controller": "^2.0.0", "@azure/core-util": "^1.1.0", - "tslib": "^2.2.0" + "tslib": "^2.6.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18.0.0" + } + }, + "node_modules/@azure/core-auth/node_modules/@azure/abort-controller": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-2.1.2.tgz", + "integrity": "sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA==", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" } }, "node_modules/@azure/core-lro": { @@ -107,56 +129,67 @@ } }, "node_modules/@azure/core-rest-pipeline": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.12.2.tgz", - "integrity": "sha512-wLLJQdL4v1yoqYtEtjKNjf8pJ/G/BqVomAWxcKOR1KbZJyCEnCv04yks7Y1NhJ3JzxbDs307W67uX0JzklFdCg==", + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.16.0.tgz", + "integrity": "sha512-CeuTvsXxCUmEuxH5g/aceuSl6w2EugvNHKAtKKVdiX915EjJJxAwfzNNWZreNnbxHZ2fi0zaM6wwS23x2JVqSQ==", "dependencies": { - "@azure/abort-controller": "^1.0.0", + "@azure/abort-controller": "^2.0.0", "@azure/core-auth": "^1.4.0", "@azure/core-tracing": "^1.0.1", - "@azure/core-util": "^1.3.0", + "@azure/core-util": "^1.9.0", "@azure/logger": "^1.0.0", - "form-data": "^4.0.0", - "http-proxy-agent": "^5.0.0", - "https-proxy-agent": "^5.0.0", - "tslib": "^2.2.0" + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.0", + "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, - "node_modules/@azure/core-rest-pipeline/node_modules/@tootallnate/once": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", - "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", + "node_modules/@azure/core-rest-pipeline/node_modules/@azure/abort-controller": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-2.1.2.tgz", + "integrity": "sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA==", + "dependencies": { + "tslib": "^2.6.2" + }, "engines": { - "node": ">= 10" + "node": ">=18.0.0" } }, - "node_modules/@azure/core-rest-pipeline/node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "node_modules/@azure/core-rest-pipeline/node_modules/agent-base": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", + "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" + "debug": "^4.3.4" }, "engines": { - "node": ">= 6" + "node": ">= 14" } }, "node_modules/@azure/core-rest-pipeline/node_modules/http-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", - "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", "dependencies": { - "@tootallnate/once": "2", - "agent-base": "6", + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/@azure/core-rest-pipeline/node_modules/https-proxy-agent": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.4.tgz", + "integrity": "sha512-wlwpilI7YdjSkWaQ/7omYBMTliDcmCN8OLihO6I9B86g06lMyAoqgoDpV0XqoaPOKj+0DIdAvnsWfyAAhmimcg==", + "dependencies": { + "agent-base": "^7.0.2", "debug": "4" }, "engines": { - "node": ">= 6" + "node": ">= 14" } }, "node_modules/@azure/core-tracing": { @@ -171,15 +204,26 @@ } }, "node_modules/@azure/core-util": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/@azure/core-util/-/core-util-1.6.1.tgz", - "integrity": "sha512-h5taHeySlsV9qxuK64KZxy4iln1BtMYlNt5jbuEFN3UFSAd1EwKg/Gjl5a6tZ/W8t6li3xPnutOx7zbDyXnPmQ==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@azure/core-util/-/core-util-1.9.0.tgz", + "integrity": "sha512-AfalUQ1ZppaKuxPPMsFEUdX6GZPB3d9paR9d/TTL7Ow2De8cJaC7ibi7kWVlFAVPCYo31OcnGymc0R89DX8Oaw==", "dependencies": { - "@azure/abort-controller": "^1.0.0", - "tslib": "^2.2.0" + "@azure/abort-controller": "^2.0.0", + "tslib": "^2.6.2" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" + } + }, + "node_modules/@azure/core-util/node_modules/@azure/abort-controller": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-2.1.2.tgz", + "integrity": "sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA==", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" } }, "node_modules/@azure/logger": { @@ -1310,6 +1354,7 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, "dependencies": { "debug": "4" }, @@ -1381,7 +1426,8 @@ "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true }, "node_modules/babel-jest": { "version": "27.5.1", @@ -1701,6 +1747,7 @@ "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, "dependencies": { "delayed-stream": "~1.0.0" }, @@ -1813,6 +1860,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true, "engines": { "node": ">=0.4.0" } @@ -2217,6 +2265,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "dev": true, "dependencies": { "agent-base": "6", "debug": "4" @@ -3351,6 +3400,7 @@ "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true, "engines": { "node": ">= 0.6" } @@ -3359,6 +3409,7 @@ "version": "2.1.35", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dev": true, "dependencies": { "mime-db": "1.52.0" }, @@ -4133,9 +4184,9 @@ "dev": true }, "node_modules/tslib": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", - "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", + "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==" }, "node_modules/type-detect": { "version": "4.0.8", diff --git a/packages/service/package.json b/packages/service/package.json index 4c3f0d3bd..b49e105b3 100644 --- a/packages/service/package.json +++ b/packages/service/package.json @@ -64,12 +64,12 @@ "tslib": "~2.3.1" }, "dependencies": { - "@azure-rest/core-client": "^1.1.4", + "@azure-rest/core-client": "^1.4.0", "@azure/bonito-core": "^1.0.0", - "@azure/core-auth": "^1.3.0", + "@azure/core-auth": "^1.6.0", "@azure/core-lro": "^2.2.0", - "@azure/core-paging": "^1.2.0", - "@azure/core-rest-pipeline": "^1.8.0", + "@azure/core-paging": "^1.5.0", + "@azure/core-rest-pipeline": "^1.16.0", "@azure/logger": "^1.0.0" }, "devDependencies": { diff --git a/packages/service/src/constants.ts b/packages/service/src/constants.ts index 873a15960..d8cc7c301 100644 --- a/packages/service/src/constants.ts +++ b/packages/service/src/constants.ts @@ -1,4 +1,4 @@ export const BatchApiVersion = { arm: `2023-11-01`, - data: `2023-05-01.17.0`, + data: `2024-02-01.19.0`, }; diff --git a/packages/service/src/internal/batch-rest/client.ts b/packages/service/src/internal/batch-rest/client.ts index 5718657a6..a1d20f734 100644 --- a/packages/service/src/internal/batch-rest/client.ts +++ b/packages/service/src/internal/batch-rest/client.ts @@ -19,7 +19,7 @@ export function createBatchClient( options = { ...options, httpClient: new BatchHttpClient(), - apiVersion: "2023-05-01.17.0", + apiVersion: "2024-02-01.19.0", }; } // eslint-disable-next-line @typescript-eslint/no-explicit-any diff --git a/packages/service/src/internal/batch-rest/generated/src/batchClient.ts b/packages/service/src/internal/batch-rest/generated/src/batchClient.ts index c2c1b54d9..04831d69b 100644 --- a/packages/service/src/internal/batch-rest/generated/src/batchClient.ts +++ b/packages/service/src/internal/batch-rest/generated/src/batchClient.ts @@ -2,23 +2,23 @@ // Licensed under the MIT license. import { getClient, ClientOptions } from "@azure-rest/core-client"; -import { logger } from "./logger"; +import { logger } from "./logger.js"; import { TokenCredential } from "@azure/core-auth"; -import { BatchClient } from "./clientDefinitions"; +import { BatchClient } from "./clientDefinitions.js"; /** * Initialize a new instance of `BatchClient` - * @param endpoint - Batch account endpoint (for example: https://batchaccount.eastus2.batch.azure.com). + * @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( - endpoint: string, + endpointParam: string, credentials: TokenCredential, - options: ClientOptions = {} + options: ClientOptions = {}, ): BatchClient { - const baseUrl = options.baseUrl ?? `${endpoint}`; - options.apiVersion = options.apiVersion ?? "2023-11-01.18.0"; + const endpointUrl = options.endpoint ?? options.baseUrl ?? `${endpointParam}`; + options.apiVersion = options.apiVersion ?? "2024-02-01.19.0"; const userAgentInfo = `azsdk-js-batch-rest/1.0.0-beta.1`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix @@ -44,7 +44,7 @@ export default function createClient( }, }; - const client = getClient(baseUrl, credentials, options) as BatchClient; + const client = getClient(endpointUrl, credentials, options) as BatchClient; return client; } diff --git a/packages/service/src/internal/batch-rest/generated/src/clientDefinitions.ts b/packages/service/src/internal/batch-rest/generated/src/clientDefinitions.ts index a8a57f786..cf6f11b52 100644 --- a/packages/service/src/internal/batch-rest/generated/src/clientDefinitions.ts +++ b/packages/service/src/internal/batch-rest/generated/src/clientDefinitions.ts @@ -32,11 +32,6 @@ import { ListJobsFromScheduleParameters, ListJobPreparationAndReleaseTaskStatusParameters, GetJobTaskCountsParameters, - CreateCertificateParameters, - ListCertificatesParameters, - CancelCertificateDeletionParameters, - DeleteCertificateParameters, - GetCertificateParameters, JobScheduleExistsParameters, DeleteJobScheduleParameters, GetJobScheduleParameters, @@ -65,11 +60,9 @@ import { ReplaceNodeUserParameters, GetNodeParameters, RebootNodeParameters, - ReimageNodeParameters, DisableNodeSchedulingParameters, EnableNodeSchedulingParameters, GetNodeRemoteLoginSettingsParameters, - GetNodeRemoteDesktopFileParameters, UploadNodeLogsParameters, ListNodesParameters, GetNodeExtensionParameters, @@ -78,7 +71,7 @@ import { GetNodeFileParameters, GetNodeFilePropertiesParameters, ListNodeFilesParameters, -} from "./parameters"; +} from "./parameters.js"; import { ListApplications200Response, ListApplicationsDefaultResponse, @@ -141,16 +134,6 @@ import { ListJobPreparationAndReleaseTaskStatusDefaultResponse, GetJobTaskCounts200Response, GetJobTaskCountsDefaultResponse, - CreateCertificate201Response, - CreateCertificateDefaultResponse, - ListCertificates200Response, - ListCertificatesDefaultResponse, - CancelCertificateDeletion204Response, - CancelCertificateDeletionDefaultResponse, - DeleteCertificate202Response, - DeleteCertificateDefaultResponse, - GetCertificate200Response, - GetCertificateDefaultResponse, JobScheduleExists200Response, JobScheduleExists404Response, JobScheduleExistsDefaultResponse, @@ -208,16 +191,12 @@ import { GetNodeDefaultResponse, RebootNode202Response, RebootNodeDefaultResponse, - ReimageNode202Response, - ReimageNodeDefaultResponse, DisableNodeScheduling200Response, DisableNodeSchedulingDefaultResponse, EnableNodeScheduling200Response, EnableNodeSchedulingDefaultResponse, GetNodeRemoteLoginSettings200Response, GetNodeRemoteLoginSettingsDefaultResponse, - GetNodeRemoteDesktopFile200Response, - GetNodeRemoteDesktopFileDefaultResponse, UploadNodeLogs200Response, UploadNodeLogsDefaultResponse, ListNodes200Response, @@ -234,7 +213,7 @@ import { GetNodeFilePropertiesDefaultResponse, ListNodeFiles200Response, ListNodeFilesDefaultResponse, -} from "./responses"; +} from "./responses.js"; import { Client, StreamableMethod } from "@azure-rest/core-client"; export interface ListApplications { @@ -246,7 +225,7 @@ export interface ListApplications { * API. */ get( - options?: ListApplicationsParameters + options?: ListApplicationsParameters, ): StreamableMethod< ListApplications200Response | ListApplicationsDefaultResponse >; @@ -261,7 +240,7 @@ export interface GetApplication { * API. */ get( - options?: GetApplicationParameters + options?: GetApplicationParameters, ): StreamableMethod< GetApplication200Response | GetApplicationDefaultResponse >; @@ -277,7 +256,7 @@ export interface ListPoolUsageMetrics { * last aggregation interval is returned. */ get( - options?: ListPoolUsageMetricsParameters + options?: ListPoolUsageMetricsParameters, ): StreamableMethod< ListPoolUsageMetrics200Response | ListPoolUsageMetricsDefaultResponse >; @@ -290,11 +269,11 @@ export interface CreatePool { * to Microsoft Support engineers. */ post( - options: CreatePoolParameters + options: CreatePoolParameters, ): StreamableMethod; /** Lists all of the Pools in the specified Account. */ get( - options?: ListPoolsParameters + options?: ListPoolsParameters, ): StreamableMethod; } @@ -314,17 +293,17 @@ export interface DeletePool { * error code PoolBeingDeleted. */ delete( - options?: DeletePoolParameters + options?: DeletePoolParameters, ): StreamableMethod; /** Gets basic properties of a Pool. */ head( - options?: PoolExistsParameters + options?: PoolExistsParameters, ): StreamableMethod< PoolExists200Response | PoolExists404Response | PoolExistsDefaultResponse >; /** Gets information about the specified Pool. */ get( - options?: GetPoolParameters + options?: GetPoolParameters, ): StreamableMethod; /** * This only replaces the Pool properties specified in the request. For example, @@ -332,14 +311,14 @@ export interface DeletePool { * a StartTask element, then the Pool keeps the existing StartTask. */ patch( - options: UpdatePoolParameters + options: UpdatePoolParameters, ): StreamableMethod; } export interface DisablePoolAutoScale { /** Disables automatic scaling for a Pool. */ post( - options?: DisablePoolAutoScaleParameters + options?: DisablePoolAutoScaleParameters, ): StreamableMethod< DisablePoolAutoScale200Response | DisablePoolAutoScaleDefaultResponse >; @@ -355,7 +334,7 @@ export interface EnablePoolAutoScale { * more than once every 30 seconds. */ post( - options: EnablePoolAutoScaleParameters + options: EnablePoolAutoScaleParameters, ): StreamableMethod< EnablePoolAutoScale200Response | EnablePoolAutoScaleDefaultResponse >; @@ -368,7 +347,7 @@ export interface EvaluatePoolAutoScale { * scaling enabled in order to evaluate a formula. */ post( - options: EvaluatePoolAutoScaleParameters + options: EvaluatePoolAutoScaleParameters, ): StreamableMethod< EvaluatePoolAutoScale200Response | EvaluatePoolAutoScaleDefaultResponse >; @@ -385,7 +364,7 @@ export interface ResizePool { * Nodes, use the Pool remove Compute Nodes API instead. */ post( - options: ResizePoolParameters + options: ResizePoolParameters, ): StreamableMethod; } @@ -400,7 +379,7 @@ export interface StopPoolResize { * be used to halt the initial sizing of the Pool when it is created. */ post( - options?: StopPoolResizeParameters + options?: StopPoolResizeParameters, ): StreamableMethod< StopPoolResize202Response | StopPoolResizeDefaultResponse >; @@ -413,7 +392,7 @@ export interface ReplacePoolProperties { * with this request, then the Batch service will remove the existing StartTask. */ post( - options: ReplacePoolPropertiesParameters + options: ReplacePoolPropertiesParameters, ): StreamableMethod< ReplacePoolProperties204Response | ReplacePoolPropertiesDefaultResponse >; @@ -426,14 +405,14 @@ export interface RemoveNodes { * Each request may remove up to 100 nodes. */ post( - options: RemoveNodesParameters + options: RemoveNodesParameters, ): StreamableMethod; } export interface ListSupportedImages { /** Lists all Virtual Machine Images supported by the Azure Batch service. */ get( - options?: ListSupportedImagesParameters + options?: ListSupportedImagesParameters, ): StreamableMethod< ListSupportedImages200Response | ListSupportedImagesDefaultResponse >; @@ -446,7 +425,7 @@ export interface ListPoolNodeCounts { * use a list query. */ get( - options?: ListPoolNodeCountsParameters + options?: ListPoolNodeCountsParameters, ): StreamableMethod< ListPoolNodeCounts200Response | ListPoolNodeCountsDefaultResponse >; @@ -464,11 +443,11 @@ export interface DeleteJob { * that the Job is being deleted. */ delete( - options?: DeleteJobParameters + options?: DeleteJobParameters, ): StreamableMethod; /** Gets information about the specified Job. */ get( - options?: GetJobParameters + options?: GetJobParameters, ): StreamableMethod; /** * This replaces only the Job properties specified in the request. For example, if @@ -476,7 +455,7 @@ export interface DeleteJob { * element, then the Job keeps the existing constraints. */ patch( - options: UpdateJobParameters + options: UpdateJobParameters, ): StreamableMethod; /** * This fully replaces all the updatable properties of the Job. For example, if @@ -484,7 +463,7 @@ export interface DeleteJob { * with this request, then the Batch service will remove the existing constraints. */ put( - options: ReplaceJobParameters + options: ReplaceJobParameters, ): StreamableMethod; } @@ -500,7 +479,7 @@ export interface DisableJob { * the request fails with status code 409. */ post( - options: DisableJobParameters + options: DisableJobParameters, ): StreamableMethod; } @@ -514,7 +493,7 @@ export interface EnableJob { * than 180 days ago, those Tasks will not run. */ post( - options?: EnableJobParameters + options?: EnableJobParameters, ): StreamableMethod; } @@ -528,7 +507,7 @@ export interface TerminateJob { * Tasks cannot be added and any remaining active Tasks will not be scheduled. */ post( - options: TerminateJobParameters + options: TerminateJobParameters, ): StreamableMethod; } @@ -545,18 +524,18 @@ export interface CreateJob { * engineers. */ post( - options: CreateJobParameters + options: CreateJobParameters, ): StreamableMethod; /** Lists all of the Jobs in the specified Account. */ get( - options?: ListJobsParameters + options?: ListJobsParameters, ): StreamableMethod; } export interface ListJobsFromSchedule { /** Lists the Jobs that have been created under the specified Job Schedule. */ get( - options?: ListJobsFromScheduleParameters + options?: ListJobsFromScheduleParameters, ): StreamableMethod< ListJobsFromSchedule200Response | ListJobsFromScheduleDefaultResponse >; @@ -572,7 +551,7 @@ export interface ListJobPreparationAndReleaseTaskStatus { * JobPreparationTaskNotSpecified. */ get( - options?: ListJobPreparationAndReleaseTaskStatusParameters + options?: ListJobPreparationAndReleaseTaskStatusParameters, ): StreamableMethod< | ListJobPreparationAndReleaseTaskStatus200Response | ListJobPreparationAndReleaseTaskStatusDefaultResponse @@ -587,74 +566,16 @@ export interface GetJobTaskCounts { * up to date. If you need exact task counts, use a list query. */ get( - options?: GetJobTaskCountsParameters + options?: GetJobTaskCountsParameters, ): StreamableMethod< GetJobTaskCounts200Response | GetJobTaskCountsDefaultResponse >; } -export interface CreateCertificate { - /** Creates a Certificate to the specified Account. */ - post( - options: CreateCertificateParameters - ): StreamableMethod< - CreateCertificate201Response | CreateCertificateDefaultResponse - >; - /** Lists all of the Certificates that have been added to the specified Account. */ - get( - options?: ListCertificatesParameters - ): StreamableMethod< - ListCertificates200Response | ListCertificatesDefaultResponse - >; -} - -export interface CancelCertificateDeletion { - /** - * If you try to delete a Certificate that is being used by a Pool or Compute - * Node, the status of the Certificate changes to deleteFailed. If you decide that - * you want to continue using the Certificate, you can use this operation to set - * the status of the Certificate back to active. If you intend to delete the - * Certificate, you do not need to run this operation after the deletion failed. - * You must make sure that the Certificate is not being used by any resources, and - * then you can try again to delete the Certificate. - */ - post( - options?: CancelCertificateDeletionParameters - ): StreamableMethod< - | CancelCertificateDeletion204Response - | CancelCertificateDeletionDefaultResponse - >; -} - -export interface DeleteCertificate { - /** - * You cannot delete a Certificate if a resource (Pool or Compute Node) is using - * it. Before you can delete a Certificate, you must therefore make sure that the - * Certificate is not associated with any existing Pools, the Certificate is not - * installed on any Nodes (even if you remove a Certificate from a Pool, it is not - * removed from existing Compute Nodes in that Pool until they restart), and no - * running Tasks depend on the Certificate. If you try to delete a Certificate - * that is in use, the deletion fails. The Certificate status changes to - * deleteFailed. You can use Cancel Delete Certificate to set the status back to - * active if you decide that you want to continue using the Certificate. - */ - delete( - options?: DeleteCertificateParameters - ): StreamableMethod< - DeleteCertificate202Response | DeleteCertificateDefaultResponse - >; - /** Gets information about the specified Certificate. */ - get( - options?: GetCertificateParameters - ): StreamableMethod< - GetCertificate200Response | GetCertificateDefaultResponse - >; -} - export interface JobScheduleExists { /** Checks the specified Job Schedule exists. */ head( - options?: JobScheduleExistsParameters + options?: JobScheduleExistsParameters, ): StreamableMethod< | JobScheduleExists200Response | JobScheduleExists404Response @@ -668,13 +589,13 @@ export interface JobScheduleExists { * though they are still counted towards Account lifetime statistics. */ delete( - options?: DeleteJobScheduleParameters + options?: DeleteJobScheduleParameters, ): StreamableMethod< DeleteJobSchedule202Response | DeleteJobScheduleDefaultResponse >; /** Gets information about the specified Job Schedule. */ get( - options?: GetJobScheduleParameters + options?: GetJobScheduleParameters, ): StreamableMethod< GetJobSchedule200Response | GetJobScheduleDefaultResponse >; @@ -686,7 +607,7 @@ export interface JobScheduleExists { * running Jobs are unaffected. */ patch( - options: UpdateJobScheduleParameters + options: UpdateJobScheduleParameters, ): StreamableMethod< UpdateJobSchedule200Response | UpdateJobScheduleDefaultResponse >; @@ -698,7 +619,7 @@ export interface JobScheduleExists { * running Jobs are unaffected. */ put( - options: ReplaceJobScheduleParameters + options: ReplaceJobScheduleParameters, ): StreamableMethod< ReplaceJobSchedule200Response | ReplaceJobScheduleDefaultResponse >; @@ -707,7 +628,7 @@ export interface JobScheduleExists { export interface DisableJobSchedule { /** No new Jobs will be created until the Job Schedule is enabled again. */ post( - options?: DisableJobScheduleParameters + options?: DisableJobScheduleParameters, ): StreamableMethod< DisableJobSchedule204Response | DisableJobScheduleDefaultResponse >; @@ -716,7 +637,7 @@ export interface DisableJobSchedule { export interface EnableJobSchedule { /** Enables a Job Schedule. */ post( - options?: EnableJobScheduleParameters + options?: EnableJobScheduleParameters, ): StreamableMethod< EnableJobSchedule204Response | EnableJobScheduleDefaultResponse >; @@ -725,7 +646,7 @@ export interface EnableJobSchedule { export interface TerminateJobSchedule { /** Terminates a Job Schedule. */ post( - options?: TerminateJobScheduleParameters + options?: TerminateJobScheduleParameters, ): StreamableMethod< TerminateJobSchedule202Response | TerminateJobScheduleDefaultResponse >; @@ -734,13 +655,13 @@ export interface TerminateJobSchedule { export interface CreateJobSchedule { /** Creates a Job Schedule to the specified Account. */ post( - options: CreateJobScheduleParameters + options: CreateJobScheduleParameters, ): StreamableMethod< CreateJobSchedule201Response | CreateJobScheduleDefaultResponse >; /** Lists all of the Job Schedules in the specified Account. */ get( - options?: ListJobSchedulesParameters + options?: ListJobSchedulesParameters, ): StreamableMethod< ListJobSchedules200Response | ListJobSchedulesDefaultResponse >; @@ -753,7 +674,7 @@ export interface CreateTask { * the Batch service and left in whatever state it was in at that time. */ post( - options: CreateTaskParameters + options: CreateTaskParameters, ): StreamableMethod; /** * For multi-instance Tasks, information such as affinityId, executionInfo and @@ -761,7 +682,7 @@ export interface CreateTask { * information about subtasks. */ get( - options?: ListTasksParameters + options?: ListTasksParameters, ): StreamableMethod; } @@ -783,7 +704,7 @@ export interface CreateTaskCollection { * service and left in whatever state it was in at that time. */ post( - options: CreateTaskCollectionParameters + options: CreateTaskCollectionParameters, ): StreamableMethod< CreateTaskCollection200Response | CreateTaskCollectionDefaultResponse >; @@ -798,7 +719,7 @@ export interface DeleteTask { * background. */ delete( - options?: DeleteTaskParameters + options?: DeleteTaskParameters, ): StreamableMethod; /** * For multi-instance Tasks, information such as affinityId, executionInfo and @@ -806,18 +727,18 @@ export interface DeleteTask { * information about subtasks. */ get( - options?: GetTaskParameters + options?: GetTaskParameters, ): StreamableMethod; /** Updates the properties of the specified Task. */ put( - options: ReplaceTaskParameters + options: ReplaceTaskParameters, ): StreamableMethod; } export interface ListSubTasks { /** If the Task is not a multi-instance Task then this returns an empty collection. */ get( - options?: ListSubTasksParameters + options?: ListSubTasksParameters, ): StreamableMethod; } @@ -828,7 +749,7 @@ export interface TerminateTask { * primary task; subtasks are then terminated asynchronously in the background. */ post( - options?: TerminateTaskParameters + options?: TerminateTaskParameters, ): StreamableMethod; } @@ -843,7 +764,7 @@ export interface ReactivateTask { * will fail if the Job has completed (or is terminating or deleting). */ post( - options?: ReactivateTaskParameters + options?: ReactivateTaskParameters, ): StreamableMethod< ReactivateTask204Response | ReactivateTaskDefaultResponse >; @@ -852,17 +773,17 @@ export interface ReactivateTask { export interface DeleteTaskFile { /** Deletes the specified Task file from the Compute Node where the Task ran. */ delete( - options?: DeleteTaskFileParameters + options?: DeleteTaskFileParameters, ): StreamableMethod< DeleteTaskFile200Response | DeleteTaskFileDefaultResponse >; /** Returns the content of the specified Task file. */ get( - options?: GetTaskFileParameters + options?: GetTaskFileParameters, ): StreamableMethod; /** Gets the properties of the specified Task file. */ head( - options?: GetTaskFilePropertiesParameters + options?: GetTaskFilePropertiesParameters, ): StreamableMethod< GetTaskFileProperties200Response | GetTaskFilePropertiesDefaultResponse >; @@ -871,7 +792,7 @@ export interface DeleteTaskFile { export interface ListTaskFiles { /** Lists the files in a Task's directory on its Compute Node. */ get( - options?: ListTaskFilesParameters + options?: ListTaskFilesParameters, ): StreamableMethod; } @@ -881,7 +802,7 @@ export interface CreateNodeUser { * running state. */ post( - options: CreateNodeUserParameters + options: CreateNodeUserParameters, ): StreamableMethod< CreateNodeUser201Response | CreateNodeUserDefaultResponse >; @@ -893,7 +814,7 @@ export interface DeleteNodeUser { * running state. */ delete( - options?: DeleteNodeUserParameters + options?: DeleteNodeUserParameters, ): StreamableMethod< DeleteNodeUser200Response | DeleteNodeUserDefaultResponse >; @@ -904,7 +825,7 @@ export interface DeleteNodeUser { * Account on a Compute Node only when it is in the idle or running state. */ put( - options: ReplaceNodeUserParameters + options: ReplaceNodeUserParameters, ): StreamableMethod< ReplaceNodeUser200Response | ReplaceNodeUserDefaultResponse >; @@ -913,35 +834,24 @@ export interface DeleteNodeUser { export interface GetNode { /** Gets information about the specified Compute Node. */ get( - options?: GetNodeParameters + 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 + options: RebootNodeParameters, ): StreamableMethod; } -export interface ReimageNode { - /** - * You can reinstall the operating system on a Compute Node only if it is in an - * idle or running state. This API can be invoked only on Pools created with the - * cloud service configuration property. - */ - post( - options: ReimageNodeParameters - ): StreamableMethod; -} - export interface DisableNodeScheduling { /** * You can disable Task scheduling on a Compute Node only if its current * scheduling state is enabled. */ post( - options: DisableNodeSchedulingParameters + options: DisableNodeSchedulingParameters, ): StreamableMethod< DisableNodeScheduling200Response | DisableNodeSchedulingDefaultResponse >; @@ -953,7 +863,7 @@ export interface EnableNodeScheduling { * state is disabled */ post( - options?: EnableNodeSchedulingParameters + options?: EnableNodeSchedulingParameters, ): StreamableMethod< EnableNodeScheduling200Response | EnableNodeSchedulingDefaultResponse >; @@ -964,32 +874,15 @@ 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. - * For Pools created with a cloud service configuration, see the GetRemoteDesktop - * API. */ get( - options?: GetNodeRemoteLoginSettingsParameters + options?: GetNodeRemoteLoginSettingsParameters, ): StreamableMethod< | GetNodeRemoteLoginSettings200Response | GetNodeRemoteLoginSettingsDefaultResponse >; } -export interface GetNodeRemoteDesktopFile { - /** - * Before you can access a Compute Node by using the RDP file, you must create a - * user Account on the Compute Node. This API can only be invoked on Pools created - * with a cloud service configuration. For Pools created with a virtual machine - * configuration, see the GetRemoteLoginSettings API. - */ - get( - options?: GetNodeRemoteDesktopFileParameters - ): StreamableMethod< - | GetNodeRemoteDesktopFile200Response - | GetNodeRemoteDesktopFileDefaultResponse - >; -} - export interface UploadNodeLogs { /** * This is for gathering Azure Batch service log files in an automated fashion @@ -998,7 +891,7 @@ export interface UploadNodeLogs { * support to aid in debugging issues with the Batch service. */ post( - options: UploadNodeLogsParameters + options: UploadNodeLogsParameters, ): StreamableMethod< UploadNodeLogs200Response | UploadNodeLogsDefaultResponse >; @@ -1007,14 +900,14 @@ export interface UploadNodeLogs { export interface ListNodes { /** Lists the Compute Nodes in the specified Pool. */ get( - options?: ListNodesParameters + options?: ListNodesParameters, ): StreamableMethod; } export interface GetNodeExtension { /** Gets information about the specified Compute Node Extension. */ get( - options?: GetNodeExtensionParameters + options?: GetNodeExtensionParameters, ): StreamableMethod< GetNodeExtension200Response | GetNodeExtensionDefaultResponse >; @@ -1023,7 +916,7 @@ export interface GetNodeExtension { export interface ListNodeExtensions { /** Lists the Compute Nodes Extensions in the specified Pool. */ get( - options?: ListNodeExtensionsParameters + options?: ListNodeExtensionsParameters, ): StreamableMethod< ListNodeExtensions200Response | ListNodeExtensionsDefaultResponse >; @@ -1032,17 +925,17 @@ export interface ListNodeExtensions { export interface DeleteNodeFile { /** Deletes the specified file from the Compute Node. */ delete( - options?: DeleteNodeFileParameters + options?: DeleteNodeFileParameters, ): StreamableMethod< DeleteNodeFile200Response | DeleteNodeFileDefaultResponse >; /** Returns the content of the specified Compute Node file. */ get( - options?: GetNodeFileParameters + options?: GetNodeFileParameters, ): StreamableMethod; /** Gets the properties of the specified Compute Node file. */ head( - options?: GetNodeFilePropertiesParameters + options?: GetNodeFilePropertiesParameters, ): StreamableMethod< GetNodeFileProperties200Response | GetNodeFilePropertiesDefaultResponse >; @@ -1051,7 +944,7 @@ export interface DeleteNodeFile { export interface ListNodeFiles { /** Lists all of the files in Task directories on the specified Compute Node. */ get( - options?: ListNodeFilesParameters + options?: ListNodeFilesParameters, ): StreamableMethod; } @@ -1061,7 +954,7 @@ export interface Routes { /** Resource for '/applications/\{applicationId\}' has methods for the following verbs: get */ ( path: "/applications/{applicationId}", - applicationId: string + applicationId: string, ): GetApplication; /** Resource for '/poolusagemetrics' has methods for the following verbs: get */ (path: "/poolusagemetrics"): ListPoolUsageMetrics; @@ -1072,17 +965,17 @@ export interface Routes { /** Resource for '/pools/\{poolId\}/disableautoscale' has methods for the following verbs: post */ ( path: "/pools/{poolId}/disableautoscale", - poolId: string + poolId: string, ): DisablePoolAutoScale; /** Resource for '/pools/\{poolId\}/enableautoscale' has methods for the following verbs: post */ ( path: "/pools/{poolId}/enableautoscale", - poolId: string + poolId: string, ): EnablePoolAutoScale; /** Resource for '/pools/\{poolId\}/evaluateautoscale' has methods for the following verbs: post */ ( path: "/pools/{poolId}/evaluateautoscale", - poolId: string + poolId: string, ): EvaluatePoolAutoScale; /** Resource for '/pools/\{poolId\}/resize' has methods for the following verbs: post */ (path: "/pools/{poolId}/resize", poolId: string): ResizePool; @@ -1091,7 +984,7 @@ export interface Routes { /** Resource for '/pools/\{poolId\}/updateproperties' has methods for the following verbs: post */ ( path: "/pools/{poolId}/updateproperties", - poolId: string + poolId: string, ): ReplacePoolProperties; /** Resource for '/pools/\{poolId\}/removenodes' has methods for the following verbs: post */ (path: "/pools/{poolId}/removenodes", poolId: string): RemoveNodes; @@ -1112,48 +1005,34 @@ export interface Routes { /** Resource for '/jobschedules/\{jobScheduleId\}/jobs' has methods for the following verbs: get */ ( path: "/jobschedules/{jobScheduleId}/jobs", - jobScheduleId: string + jobScheduleId: string, ): ListJobsFromSchedule; /** Resource for '/jobs/\{jobId\}/jobpreparationandreleasetaskstatus' has methods for the following verbs: get */ ( path: "/jobs/{jobId}/jobpreparationandreleasetaskstatus", - jobId: string + jobId: string, ): ListJobPreparationAndReleaseTaskStatus; /** Resource for '/jobs/\{jobId\}/taskcounts' has methods for the following verbs: get */ (path: "/jobs/{jobId}/taskcounts", jobId: string): GetJobTaskCounts; - /** Resource for '/certificates' has methods for the following verbs: post, get */ - (path: "/certificates"): CreateCertificate; - /** Resource for '/certificates(thumbprintAlgorithm=\{thumbprintAlgorithm\},thumbprint=\{thumbprint\})/canceldelete' has methods for the following verbs: post */ - ( - path: "/certificates(thumbprintAlgorithm={thumbprintAlgorithm},thumbprint={thumbprint})/canceldelete", - thumbprintAlgorithm: string, - thumbprint: string - ): CancelCertificateDeletion; - /** Resource for '/certificates(thumbprintAlgorithm=\{thumbprintAlgorithm\},thumbprint=\{thumbprint\})' has methods for the following verbs: delete, get */ - ( - path: "/certificates(thumbprintAlgorithm={thumbprintAlgorithm},thumbprint={thumbprint})", - thumbprintAlgorithm: string, - thumbprint: string - ): DeleteCertificate; /** Resource for '/jobschedules/\{jobScheduleId\}' has methods for the following verbs: head, delete, get, patch, put */ ( path: "/jobschedules/{jobScheduleId}", - jobScheduleId: string + jobScheduleId: string, ): JobScheduleExists; /** Resource for '/jobschedules/\{jobScheduleId\}/disable' has methods for the following verbs: post */ ( path: "/jobschedules/{jobScheduleId}/disable", - jobScheduleId: string + jobScheduleId: string, ): DisableJobSchedule; /** Resource for '/jobschedules/\{jobScheduleId\}/enable' has methods for the following verbs: post */ ( path: "/jobschedules/{jobScheduleId}/enable", - jobScheduleId: string + jobScheduleId: string, ): EnableJobSchedule; /** Resource for '/jobschedules/\{jobScheduleId\}/terminate' has methods for the following verbs: post */ ( path: "/jobschedules/{jobScheduleId}/terminate", - jobScheduleId: string + jobScheduleId: string, ): TerminateJobSchedule; /** Resource for '/jobschedules' has methods for the following verbs: post, get */ (path: "/jobschedules"): CreateJobSchedule; @@ -1162,105 +1041,93 @@ export interface Routes { /** Resource for '/jobs/\{jobId\}/addtaskcollection' has methods for the following verbs: post */ ( path: "/jobs/{jobId}/addtaskcollection", - jobId: string + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + nodeId: string, ): RebootNode; - /** Resource for '/pools/\{poolId\}/nodes/\{nodeId\}/reimage' has methods for the following verbs: post */ - ( - path: "/pools/{poolId}/nodes/{nodeId}/reimage", - poolId: string, - nodeId: string - ): ReimageNode; /** Resource for '/pools/\{poolId\}/nodes/\{nodeId\}/disablescheduling' has methods for the following verbs: post */ ( path: "/pools/{poolId}/nodes/{nodeId}/disablescheduling", poolId: string, - nodeId: 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 + 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 + nodeId: string, ): GetNodeRemoteLoginSettings; - /** Resource for '/pools/\{poolId\}/nodes/\{nodeId\}/rdp' has methods for the following verbs: get */ - ( - path: "/pools/{poolId}/nodes/{nodeId}/rdp", - poolId: string, - nodeId: string - ): GetNodeRemoteDesktopFile; /** Resource for '/pools/\{poolId\}/nodes/\{nodeId\}/uploadbatchservicelogs' has methods for the following verbs: post */ ( path: "/pools/{poolId}/nodes/{nodeId}/uploadbatchservicelogs", poolId: string, - nodeId: string + nodeId: string, ): UploadNodeLogs; /** Resource for '/pools/\{poolId\}/nodes' has methods for the following verbs: get */ (path: "/pools/{poolId}/nodes", poolId: string): ListNodes; @@ -1269,26 +1136,26 @@ export interface Routes { path: "/pools/{poolId}/nodes/{nodeId}/extensions/{extensionName}", poolId: string, nodeId: string, - extensionName: 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 + 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 + 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 + nodeId: string, ): ListNodeFiles; } diff --git a/packages/service/src/internal/batch-rest/generated/src/index.ts b/packages/service/src/internal/batch-rest/generated/src/index.ts index 973b06150..93712575e 100644 --- a/packages/service/src/internal/batch-rest/generated/src/index.ts +++ b/packages/service/src/internal/batch-rest/generated/src/index.ts @@ -1,15 +1,15 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import BatchClient from "./batchClient"; +import BatchClient from "./batchClient.js"; -export * from "./batchClient"; -export * from "./parameters"; -export * from "./responses"; -export * from "./clientDefinitions"; -export * from "./isUnexpected"; -export * from "./models"; -export * from "./outputModels"; -export * from "./paginateHelper"; +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/packages/service/src/internal/batch-rest/generated/src/isUnexpected.ts b/packages/service/src/internal/batch-rest/generated/src/isUnexpected.ts index ea7d6cc06..22d1a53b0 100644 --- a/packages/service/src/internal/batch-rest/generated/src/isUnexpected.ts +++ b/packages/service/src/internal/batch-rest/generated/src/isUnexpected.ts @@ -63,16 +63,6 @@ import { ListJobPreparationAndReleaseTaskStatusDefaultResponse, GetJobTaskCounts200Response, GetJobTaskCountsDefaultResponse, - CreateCertificate201Response, - CreateCertificateDefaultResponse, - ListCertificates200Response, - ListCertificatesDefaultResponse, - CancelCertificateDeletion204Response, - CancelCertificateDeletionDefaultResponse, - DeleteCertificate202Response, - DeleteCertificateDefaultResponse, - GetCertificate200Response, - GetCertificateDefaultResponse, JobScheduleExists200Response, JobScheduleExists404Response, JobScheduleExistsDefaultResponse, @@ -130,16 +120,12 @@ import { GetNodeDefaultResponse, RebootNode202Response, RebootNodeDefaultResponse, - ReimageNode202Response, - ReimageNodeDefaultResponse, DisableNodeScheduling200Response, DisableNodeSchedulingDefaultResponse, EnableNodeScheduling200Response, EnableNodeSchedulingDefaultResponse, GetNodeRemoteLoginSettings200Response, GetNodeRemoteLoginSettingsDefaultResponse, - GetNodeRemoteDesktopFile200Response, - GetNodeRemoteDesktopFileDefaultResponse, UploadNodeLogs200Response, UploadNodeLogsDefaultResponse, ListNodes200Response, @@ -156,7 +142,7 @@ import { GetNodeFilePropertiesDefaultResponse, ListNodeFiles200Response, ListNodeFilesDefaultResponse, -} from "./responses"; +} from "./responses.js"; const responseMap: Record = { "GET /applications": ["200"], @@ -189,14 +175,6 @@ const responseMap: Record = { "GET /jobschedules/{jobScheduleId}/jobs": ["200"], "GET /jobs/{jobId}/jobpreparationandreleasetaskstatus": ["200"], "GET /jobs/{jobId}/taskcounts": ["200"], - "POST /certificates": ["201"], - "GET /certificates": ["200"], - "POST /certificates(thumbprintAlgorithm={thumbprintAlgorithm},thumbprint={thumbprint})/canceldelete": - ["204"], - "DELETE /certificates(thumbprintAlgorithm={thumbprintAlgorithm},thumbprint={thumbprint})": - ["202"], - "GET /certificates(thumbprintAlgorithm={thumbprintAlgorithm},thumbprint={thumbprint})": - ["200"], "HEAD /jobschedules/{jobScheduleId}": ["200", "404"], "DELETE /jobschedules/{jobScheduleId}": ["202"], "GET /jobschedules/{jobScheduleId}": ["200"], @@ -225,11 +203,9 @@ const responseMap: Record = { "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}/reimage": ["202"], "POST /pools/{poolId}/nodes/{nodeId}/disablescheduling": ["200"], "POST /pools/{poolId}/nodes/{nodeId}/enablescheduling": ["200"], "GET /pools/{poolId}/nodes/{nodeId}/remoteloginsettings": ["200"], - "GET /pools/{poolId}/nodes/{nodeId}/rdp": ["200"], "POST /pools/{poolId}/nodes/{nodeId}/uploadbatchservicelogs": ["200"], "GET /pools/{poolId}/nodes": ["200"], "GET /pools/{poolId}/nodes/{nodeId}/extensions/{extensionName}": ["200"], @@ -241,268 +217,243 @@ const responseMap: Record = { }; export function isUnexpected( - response: ListApplications200Response | ListApplicationsDefaultResponse + response: ListApplications200Response | ListApplicationsDefaultResponse, ): response is ListApplicationsDefaultResponse; export function isUnexpected( - response: GetApplication200Response | GetApplicationDefaultResponse + response: GetApplication200Response | GetApplicationDefaultResponse, ): response is GetApplicationDefaultResponse; export function isUnexpected( response: | ListPoolUsageMetrics200Response - | ListPoolUsageMetricsDefaultResponse + | ListPoolUsageMetricsDefaultResponse, ): response is ListPoolUsageMetricsDefaultResponse; export function isUnexpected( - response: CreatePool201Response | CreatePoolDefaultResponse + response: CreatePool201Response | CreatePoolDefaultResponse, ): response is CreatePoolDefaultResponse; export function isUnexpected( - response: ListPools200Response | ListPoolsDefaultResponse + response: ListPools200Response | ListPoolsDefaultResponse, ): response is ListPoolsDefaultResponse; export function isUnexpected( - response: DeletePool202Response | DeletePoolDefaultResponse + response: DeletePool202Response | DeletePoolDefaultResponse, ): response is DeletePoolDefaultResponse; export function isUnexpected( response: | PoolExists200Response | PoolExists404Response - | PoolExistsDefaultResponse + | PoolExistsDefaultResponse, ): response is PoolExistsDefaultResponse; export function isUnexpected( - response: GetPool200Response | GetPoolDefaultResponse + response: GetPool200Response | GetPoolDefaultResponse, ): response is GetPoolDefaultResponse; export function isUnexpected( - response: UpdatePool200Response | UpdatePoolDefaultResponse + response: UpdatePool200Response | UpdatePoolDefaultResponse, ): response is UpdatePoolDefaultResponse; export function isUnexpected( response: | DisablePoolAutoScale200Response - | DisablePoolAutoScaleDefaultResponse + | DisablePoolAutoScaleDefaultResponse, ): response is DisablePoolAutoScaleDefaultResponse; export function isUnexpected( - response: EnablePoolAutoScale200Response | EnablePoolAutoScaleDefaultResponse + response: EnablePoolAutoScale200Response | EnablePoolAutoScaleDefaultResponse, ): response is EnablePoolAutoScaleDefaultResponse; export function isUnexpected( response: | EvaluatePoolAutoScale200Response - | EvaluatePoolAutoScaleDefaultResponse + | EvaluatePoolAutoScaleDefaultResponse, ): response is EvaluatePoolAutoScaleDefaultResponse; export function isUnexpected( - response: ResizePool202Response | ResizePoolDefaultResponse + response: ResizePool202Response | ResizePoolDefaultResponse, ): response is ResizePoolDefaultResponse; export function isUnexpected( - response: StopPoolResize202Response | StopPoolResizeDefaultResponse + response: StopPoolResize202Response | StopPoolResizeDefaultResponse, ): response is StopPoolResizeDefaultResponse; export function isUnexpected( response: | ReplacePoolProperties204Response - | ReplacePoolPropertiesDefaultResponse + | ReplacePoolPropertiesDefaultResponse, ): response is ReplacePoolPropertiesDefaultResponse; export function isUnexpected( - response: RemoveNodes202Response | RemoveNodesDefaultResponse + response: RemoveNodes202Response | RemoveNodesDefaultResponse, ): response is RemoveNodesDefaultResponse; export function isUnexpected( - response: ListSupportedImages200Response | ListSupportedImagesDefaultResponse + response: ListSupportedImages200Response | ListSupportedImagesDefaultResponse, ): response is ListSupportedImagesDefaultResponse; export function isUnexpected( - response: ListPoolNodeCounts200Response | ListPoolNodeCountsDefaultResponse + response: ListPoolNodeCounts200Response | ListPoolNodeCountsDefaultResponse, ): response is ListPoolNodeCountsDefaultResponse; export function isUnexpected( - response: DeleteJob202Response | DeleteJobDefaultResponse + response: DeleteJob202Response | DeleteJobDefaultResponse, ): response is DeleteJobDefaultResponse; export function isUnexpected( - response: GetJob200Response | GetJobDefaultResponse + response: GetJob200Response | GetJobDefaultResponse, ): response is GetJobDefaultResponse; export function isUnexpected( - response: UpdateJob200Response | UpdateJobDefaultResponse + response: UpdateJob200Response | UpdateJobDefaultResponse, ): response is UpdateJobDefaultResponse; export function isUnexpected( - response: ReplaceJob200Response | ReplaceJobDefaultResponse + response: ReplaceJob200Response | ReplaceJobDefaultResponse, ): response is ReplaceJobDefaultResponse; export function isUnexpected( - response: DisableJob202Response | DisableJobDefaultResponse + response: DisableJob202Response | DisableJobDefaultResponse, ): response is DisableJobDefaultResponse; export function isUnexpected( - response: EnableJob202Response | EnableJobDefaultResponse + response: EnableJob202Response | EnableJobDefaultResponse, ): response is EnableJobDefaultResponse; export function isUnexpected( - response: TerminateJob202Response | TerminateJobDefaultResponse + response: TerminateJob202Response | TerminateJobDefaultResponse, ): response is TerminateJobDefaultResponse; export function isUnexpected( - response: CreateJob201Response | CreateJobDefaultResponse + response: CreateJob201Response | CreateJobDefaultResponse, ): response is CreateJobDefaultResponse; export function isUnexpected( - response: ListJobs200Response | ListJobsDefaultResponse + response: ListJobs200Response | ListJobsDefaultResponse, ): response is ListJobsDefaultResponse; export function isUnexpected( response: | ListJobsFromSchedule200Response - | ListJobsFromScheduleDefaultResponse + | ListJobsFromScheduleDefaultResponse, ): response is ListJobsFromScheduleDefaultResponse; export function isUnexpected( response: | ListJobPreparationAndReleaseTaskStatus200Response - | ListJobPreparationAndReleaseTaskStatusDefaultResponse + | ListJobPreparationAndReleaseTaskStatusDefaultResponse, ): response is ListJobPreparationAndReleaseTaskStatusDefaultResponse; export function isUnexpected( - response: GetJobTaskCounts200Response | GetJobTaskCountsDefaultResponse + response: GetJobTaskCounts200Response | GetJobTaskCountsDefaultResponse, ): response is GetJobTaskCountsDefaultResponse; -export function isUnexpected( - response: CreateCertificate201Response | CreateCertificateDefaultResponse -): response is CreateCertificateDefaultResponse; -export function isUnexpected( - response: ListCertificates200Response | ListCertificatesDefaultResponse -): response is ListCertificatesDefaultResponse; -export function isUnexpected( - response: - | CancelCertificateDeletion204Response - | CancelCertificateDeletionDefaultResponse -): response is CancelCertificateDeletionDefaultResponse; -export function isUnexpected( - response: DeleteCertificate202Response | DeleteCertificateDefaultResponse -): response is DeleteCertificateDefaultResponse; -export function isUnexpected( - response: GetCertificate200Response | GetCertificateDefaultResponse -): response is GetCertificateDefaultResponse; export function isUnexpected( response: | JobScheduleExists200Response | JobScheduleExists404Response - | JobScheduleExistsDefaultResponse + | JobScheduleExistsDefaultResponse, ): response is JobScheduleExistsDefaultResponse; export function isUnexpected( - response: DeleteJobSchedule202Response | DeleteJobScheduleDefaultResponse + response: DeleteJobSchedule202Response | DeleteJobScheduleDefaultResponse, ): response is DeleteJobScheduleDefaultResponse; export function isUnexpected( - response: GetJobSchedule200Response | GetJobScheduleDefaultResponse + response: GetJobSchedule200Response | GetJobScheduleDefaultResponse, ): response is GetJobScheduleDefaultResponse; export function isUnexpected( - response: UpdateJobSchedule200Response | UpdateJobScheduleDefaultResponse + response: UpdateJobSchedule200Response | UpdateJobScheduleDefaultResponse, ): response is UpdateJobScheduleDefaultResponse; export function isUnexpected( - response: ReplaceJobSchedule200Response | ReplaceJobScheduleDefaultResponse + response: ReplaceJobSchedule200Response | ReplaceJobScheduleDefaultResponse, ): response is ReplaceJobScheduleDefaultResponse; export function isUnexpected( - response: DisableJobSchedule204Response | DisableJobScheduleDefaultResponse + response: DisableJobSchedule204Response | DisableJobScheduleDefaultResponse, ): response is DisableJobScheduleDefaultResponse; export function isUnexpected( - response: EnableJobSchedule204Response | EnableJobScheduleDefaultResponse + response: EnableJobSchedule204Response | EnableJobScheduleDefaultResponse, ): response is EnableJobScheduleDefaultResponse; export function isUnexpected( response: | TerminateJobSchedule202Response - | TerminateJobScheduleDefaultResponse + | TerminateJobScheduleDefaultResponse, ): response is TerminateJobScheduleDefaultResponse; export function isUnexpected( - response: CreateJobSchedule201Response | CreateJobScheduleDefaultResponse + response: CreateJobSchedule201Response | CreateJobScheduleDefaultResponse, ): response is CreateJobScheduleDefaultResponse; export function isUnexpected( - response: ListJobSchedules200Response | ListJobSchedulesDefaultResponse + response: ListJobSchedules200Response | ListJobSchedulesDefaultResponse, ): response is ListJobSchedulesDefaultResponse; export function isUnexpected( - response: CreateTask201Response | CreateTaskDefaultResponse + response: CreateTask201Response | CreateTaskDefaultResponse, ): response is CreateTaskDefaultResponse; export function isUnexpected( - response: ListTasks200Response | ListTasksDefaultResponse + response: ListTasks200Response | ListTasksDefaultResponse, ): response is ListTasksDefaultResponse; export function isUnexpected( response: | CreateTaskCollection200Response - | CreateTaskCollectionDefaultResponse + | CreateTaskCollectionDefaultResponse, ): response is CreateTaskCollectionDefaultResponse; export function isUnexpected( - response: DeleteTask200Response | DeleteTaskDefaultResponse + response: DeleteTask200Response | DeleteTaskDefaultResponse, ): response is DeleteTaskDefaultResponse; export function isUnexpected( - response: GetTask200Response | GetTaskDefaultResponse + response: GetTask200Response | GetTaskDefaultResponse, ): response is GetTaskDefaultResponse; export function isUnexpected( - response: ReplaceTask200Response | ReplaceTaskDefaultResponse + response: ReplaceTask200Response | ReplaceTaskDefaultResponse, ): response is ReplaceTaskDefaultResponse; export function isUnexpected( - response: ListSubTasks200Response | ListSubTasksDefaultResponse + response: ListSubTasks200Response | ListSubTasksDefaultResponse, ): response is ListSubTasksDefaultResponse; export function isUnexpected( - response: TerminateTask204Response | TerminateTaskDefaultResponse + response: TerminateTask204Response | TerminateTaskDefaultResponse, ): response is TerminateTaskDefaultResponse; export function isUnexpected( - response: ReactivateTask204Response | ReactivateTaskDefaultResponse + response: ReactivateTask204Response | ReactivateTaskDefaultResponse, ): response is ReactivateTaskDefaultResponse; export function isUnexpected( - response: DeleteTaskFile200Response | DeleteTaskFileDefaultResponse + response: DeleteTaskFile200Response | DeleteTaskFileDefaultResponse, ): response is DeleteTaskFileDefaultResponse; export function isUnexpected( - response: GetTaskFile200Response | GetTaskFileDefaultResponse + response: GetTaskFile200Response | GetTaskFileDefaultResponse, ): response is GetTaskFileDefaultResponse; export function isUnexpected( response: | GetTaskFileProperties200Response - | GetTaskFilePropertiesDefaultResponse + | GetTaskFilePropertiesDefaultResponse, ): response is GetTaskFilePropertiesDefaultResponse; export function isUnexpected( - response: ListTaskFiles200Response | ListTaskFilesDefaultResponse + response: ListTaskFiles200Response | ListTaskFilesDefaultResponse, ): response is ListTaskFilesDefaultResponse; export function isUnexpected( - response: CreateNodeUser201Response | CreateNodeUserDefaultResponse + response: CreateNodeUser201Response | CreateNodeUserDefaultResponse, ): response is CreateNodeUserDefaultResponse; export function isUnexpected( - response: DeleteNodeUser200Response | DeleteNodeUserDefaultResponse + response: DeleteNodeUser200Response | DeleteNodeUserDefaultResponse, ): response is DeleteNodeUserDefaultResponse; export function isUnexpected( - response: ReplaceNodeUser200Response | ReplaceNodeUserDefaultResponse + response: ReplaceNodeUser200Response | ReplaceNodeUserDefaultResponse, ): response is ReplaceNodeUserDefaultResponse; export function isUnexpected( - response: GetNode200Response | GetNodeDefaultResponse + response: GetNode200Response | GetNodeDefaultResponse, ): response is GetNodeDefaultResponse; export function isUnexpected( - response: RebootNode202Response | RebootNodeDefaultResponse + response: RebootNode202Response | RebootNodeDefaultResponse, ): response is RebootNodeDefaultResponse; -export function isUnexpected( - response: ReimageNode202Response | ReimageNodeDefaultResponse -): response is ReimageNodeDefaultResponse; export function isUnexpected( response: | DisableNodeScheduling200Response - | DisableNodeSchedulingDefaultResponse + | DisableNodeSchedulingDefaultResponse, ): response is DisableNodeSchedulingDefaultResponse; export function isUnexpected( response: | EnableNodeScheduling200Response - | EnableNodeSchedulingDefaultResponse + | EnableNodeSchedulingDefaultResponse, ): response is EnableNodeSchedulingDefaultResponse; export function isUnexpected( response: | GetNodeRemoteLoginSettings200Response - | GetNodeRemoteLoginSettingsDefaultResponse + | GetNodeRemoteLoginSettingsDefaultResponse, ): response is GetNodeRemoteLoginSettingsDefaultResponse; export function isUnexpected( - response: - | GetNodeRemoteDesktopFile200Response - | GetNodeRemoteDesktopFileDefaultResponse -): response is GetNodeRemoteDesktopFileDefaultResponse; -export function isUnexpected( - response: UploadNodeLogs200Response | UploadNodeLogsDefaultResponse + response: UploadNodeLogs200Response | UploadNodeLogsDefaultResponse, ): response is UploadNodeLogsDefaultResponse; export function isUnexpected( - response: ListNodes200Response | ListNodesDefaultResponse + response: ListNodes200Response | ListNodesDefaultResponse, ): response is ListNodesDefaultResponse; export function isUnexpected( - response: GetNodeExtension200Response | GetNodeExtensionDefaultResponse + response: GetNodeExtension200Response | GetNodeExtensionDefaultResponse, ): response is GetNodeExtensionDefaultResponse; export function isUnexpected( - response: ListNodeExtensions200Response | ListNodeExtensionsDefaultResponse + response: ListNodeExtensions200Response | ListNodeExtensionsDefaultResponse, ): response is ListNodeExtensionsDefaultResponse; export function isUnexpected( - response: DeleteNodeFile200Response | DeleteNodeFileDefaultResponse + response: DeleteNodeFile200Response | DeleteNodeFileDefaultResponse, ): response is DeleteNodeFileDefaultResponse; export function isUnexpected( - response: GetNodeFile200Response | GetNodeFileDefaultResponse + response: GetNodeFile200Response | GetNodeFileDefaultResponse, ): response is GetNodeFileDefaultResponse; export function isUnexpected( response: | GetNodeFileProperties200Response - | GetNodeFilePropertiesDefaultResponse + | GetNodeFilePropertiesDefaultResponse, ): response is GetNodeFilePropertiesDefaultResponse; export function isUnexpected( - response: ListNodeFiles200Response | ListNodeFilesDefaultResponse + response: ListNodeFiles200Response | ListNodeFilesDefaultResponse, ): response is ListNodeFilesDefaultResponse; export function isUnexpected( response: @@ -567,16 +518,6 @@ export function isUnexpected( | ListJobPreparationAndReleaseTaskStatusDefaultResponse | GetJobTaskCounts200Response | GetJobTaskCountsDefaultResponse - | CreateCertificate201Response - | CreateCertificateDefaultResponse - | ListCertificates200Response - | ListCertificatesDefaultResponse - | CancelCertificateDeletion204Response - | CancelCertificateDeletionDefaultResponse - | DeleteCertificate202Response - | DeleteCertificateDefaultResponse - | GetCertificate200Response - | GetCertificateDefaultResponse | JobScheduleExists200Response | JobScheduleExists404Response | JobScheduleExistsDefaultResponse @@ -634,16 +575,12 @@ export function isUnexpected( | GetNodeDefaultResponse | RebootNode202Response | RebootNodeDefaultResponse - | ReimageNode202Response - | ReimageNodeDefaultResponse | DisableNodeScheduling200Response | DisableNodeSchedulingDefaultResponse | EnableNodeScheduling200Response | EnableNodeSchedulingDefaultResponse | GetNodeRemoteLoginSettings200Response | GetNodeRemoteLoginSettingsDefaultResponse - | GetNodeRemoteDesktopFile200Response - | GetNodeRemoteDesktopFileDefaultResponse | UploadNodeLogs200Response | UploadNodeLogsDefaultResponse | ListNodes200Response @@ -659,7 +596,7 @@ export function isUnexpected( | GetNodeFileProperties200Response | GetNodeFilePropertiesDefaultResponse | ListNodeFiles200Response - | ListNodeFilesDefaultResponse + | ListNodeFilesDefaultResponse, ): response is | ListApplicationsDefaultResponse | GetApplicationDefaultResponse @@ -691,11 +628,6 @@ export function isUnexpected( | ListJobsFromScheduleDefaultResponse | ListJobPreparationAndReleaseTaskStatusDefaultResponse | GetJobTaskCountsDefaultResponse - | CreateCertificateDefaultResponse - | ListCertificatesDefaultResponse - | CancelCertificateDeletionDefaultResponse - | DeleteCertificateDefaultResponse - | GetCertificateDefaultResponse | JobScheduleExistsDefaultResponse | DeleteJobScheduleDefaultResponse | GetJobScheduleDefaultResponse @@ -724,11 +656,9 @@ export function isUnexpected( | ReplaceNodeUserDefaultResponse | GetNodeDefaultResponse | RebootNodeDefaultResponse - | ReimageNodeDefaultResponse | DisableNodeSchedulingDefaultResponse | EnableNodeSchedulingDefaultResponse | GetNodeRemoteLoginSettingsDefaultResponse - | GetNodeRemoteDesktopFileDefaultResponse | UploadNodeLogsDefaultResponse | ListNodesDefaultResponse | GetNodeExtensionDefaultResponse @@ -785,7 +715,7 @@ function getParametrizedPathSuccess(method: string, path: string): string[] { // {guid} ==> $ // {guid}:export ==> :export$ const isMatched = new RegExp( - `${candidateParts[i]?.slice(start, end)}` + `${candidateParts[i]?.slice(start, end)}`, ).test(pathParts[j] || ""); if (!isMatched) { diff --git a/packages/service/src/internal/batch-rest/generated/src/models.ts b/packages/service/src/internal/batch-rest/generated/src/models.ts index affe1e5bf..e10f7a10d 100644 --- a/packages/service/src/internal/batch-rest/generated/src/models.ts +++ b/packages/service/src/internal/batch-rest/generated/src/models.ts @@ -2,16 +2,14 @@ // Licensed under the MIT license. /** Parameters for creating an Azure Batch Pool. */ -export interface BatchPoolCreateParameters { +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 sizes of virtual machines for Cloud Services Pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (https://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall, A1V2 and A2V2. 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). */ + /** 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 cloud service configuration for the Pool. This property and virtualMachineConfiguration are mutually exclusive and one of the properties must be specified. This property cannot be specified if the Batch Account was created with its poolAllocationMode property set to 'UserSubscription'. */ - cloudServiceConfiguration?: CloudServiceConfiguration; - /** The virtual machine configuration for the Pool. This property and cloudServiceConfiguration are mutually exclusive and one of the properties must be specified. */ + /** 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; @@ -33,17 +31,8 @@ export interface BatchPoolCreateParameters { 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; - /** - * For Windows Nodes, the Batch service installs the Certificates to the specified Certificate store and location. - * For Linux Compute Nodes, the Certificates are stored in a directory inside the Task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the Task to query for this location. - * For Certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and Certificates are placed in that directory. - * Warning: This property is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. - */ - certificateReferences?: Array; /** 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 application licenses the Batch service will make available on each Compute Node in the Pool. The list of application licenses must be a subset of available Batch service application licenses. If a license is requested which is not supported, Pool creation will fail. */ - applicationLicenses?: string[]; /** 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. */ @@ -54,35 +43,10 @@ export interface BatchPoolCreateParameters { 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. - * - * Possible values: default, classic, simplified - */ - targetNodeCommunicationMode?: string; -} - -/** - * The configuration for Compute Nodes in a Pool based on the Azure Cloud Services - * platform. - */ -export interface CloudServiceConfiguration { - /** - * Possible values are: - * 2 - OS Family 2, equivalent to Windows Server 2008 R2 - * SP1. - * 3 - OS Family 3, equivalent to Windows Server 2012. - * 4 - OS Family 4, - * equivalent to Windows Server 2012 R2. - * 5 - OS Family 5, equivalent to Windows - * Server 2016. - * 6 - OS Family 6, equivalent to Windows Server 2019. For more - * information, see Azure Guest OS Releases - * (https://azure.microsoft.com/documentation/articles/cloud-services-guestos-update-matrix/#releases). - */ - osFamily: string; - /** The Azure Guest OS version to be installed on the virtual machines in the Pool. The default value is * which specifies the latest operating system version for the specified OS family. */ - osVersion?: string; + /** 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; } /** @@ -156,40 +120,28 @@ export interface WindowsConfiguration { * disks from within a VM to use them. */ export interface DataDisk { - /** The logical unit number. The lun is used to uniquely identify each data disk. If attaching multiple disks, each should have a distinct lun. The value must be between 0 and 63, inclusive. */ + /** 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/. - * - * Possible values: none, readonly, readwrite - */ - caching?: string; + /** 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". - * - * Possible values: standard_lrs, premium_lrs, standardssd_lrs - */ - storageAccountType?: string; + /** 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. - * - * Possible values: dockerCompatible, criCompatible - */ - type: string; + /** 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; + containerRegistries?: Array; } /** A private container registry. */ -export interface ContainerRegistry { +export interface ContainerRegistryReference { /** The user name to log into the registry server. */ username?: string; /** The password to log into the registry server. */ @@ -216,7 +168,7 @@ export interface BatchNodeIdentityReference { */ 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?: string[]; + targets?: DiskEncryptionTarget[]; } /** @@ -225,12 +177,8 @@ 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. - * - * Possible values: regional, zonal - */ - policy?: string; + /** 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. */ @@ -259,12 +207,8 @@ 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. - * - * Possible values: none, readonly, readwrite - */ - caching?: string; + /** 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. */ @@ -278,34 +222,22 @@ 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. - * - * Possible values: cachedisk - */ - placement?: string; + /** 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. - * - * Possible values: standard_lrs, premium_lrs, standardssd_lrs - */ - storageAccountType: string; + /** 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. - * - * Possible values: trustedLaunch - */ - securityType: string; + /** 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; } @@ -329,18 +261,14 @@ export interface ServiceArtifactReference { /** 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, but for Pools created with cloudServiceConfiguration both ARM and classic virtual networks 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. For Pools created with a cloud service configuration, enable ports 10100, 20100, and 30100. 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. */ + /** 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. - * - * Possible values: none, job - */ - dynamicVNetAssignmentScope?: 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; + 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; } @@ -348,22 +276,18 @@ export interface NetworkConfiguration { /** 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; + 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 { +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. - * - * Possible values: tcp, udp - */ - protocol: 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. */ @@ -378,12 +302,8 @@ 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. - * - * Possible values: allow, deny - */ - access: string; + /** 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 '*'. */ @@ -391,13 +311,9 @@ 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. - * - * Possible values: batchmanaged, usermanaged, nopublicipaddresses - */ - provision?: string; +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[]; } @@ -441,13 +357,9 @@ export interface BatchTaskContainerSettings { /** 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?: ContainerRegistry; - /** - * The location of the container Task working directory. The default is 'taskWorkingDirectory'. - * - * Possible values: taskWorkingDirectory, containerImageDefault - */ - workingDirectory?: string; + 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. */ @@ -486,36 +398,10 @@ 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. For example, if the task mutates the registry in a way which could impact other tasks, or if certificates have been specified on the pool which should not be accessible by normal tasks but should be accessible by StartTasks. - * - * Possible values: task, pool - */ - scope?: string; - /** - * The elevation level of the auto user. The default value is nonAdmin. - * - * Possible values: nonadmin, admin - */ - elevationLevel?: string; -} - -/** A reference to a Certificate to be installed on Compute Nodes in a Pool. Warning: This object is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. */ -export interface BatchCertificateReference { - /** The thumbprint of the Certificate. */ - thumbprint: string; - /** The algorithm with which the thumbprint is associated. This must be sha1. */ - thumbprintAlgorithm: string; - /** - * The location of the Certificate store on the Compute Node into which to install the Certificate. The default value is currentuser. This property is applicable only for Pools configured with Windows Compute Nodes (that is, created with cloudServiceConfiguration, or with virtualMachineConfiguration using a Windows Image reference). For Linux Compute Nodes, the Certificates are stored in a directory inside the Task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the Task to query for this location. For Certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and Certificates are placed in that directory. - * - * Possible values: currentuser, localmachine - */ - storeLocation?: string; - /** The name of the Certificate store on the Compute Node into which to install the Certificate. This property is applicable only for Pools configured with Windows Compute Nodes (that is, created with cloudServiceConfiguration, or with virtualMachineConfiguration using a Windows Image reference). Common store names include: My, Root, CA, Trust, Disallowed, TrustedPeople, TrustedPublisher, AuthRoot, AddressBook, but any custom store name can also be used. The default value is My. */ - storeName?: string; - /** Which user Accounts on the Compute Node should have access to the private data of the Certificate. You can specify more than one visibility in this collection. The default is all Accounts. */ - visibility?: string[]; + /** 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. */ @@ -528,12 +414,8 @@ 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. - * - * Possible values: spread, pack - */ - nodeFillType: string; + /** How Tasks are distributed across Compute Nodes in a Pool. If not specified, the default is spread. */ + nodeFillType: BatchNodeFillType; } /** @@ -545,12 +427,8 @@ 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. - * - * Possible values: nonadmin, admin - */ - elevationLevel?: 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. */ @@ -569,12 +447,8 @@ 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' and for CloudServiceConfiguration Pools is 'interactive'. - * - * Possible values: batch, interactive - */ - loginMode?: string; + /** The login mode for the user. The default value for VirtualMachineConfiguration Pools is 'batch'. */ + loginMode?: LoginMode; } /** @@ -593,7 +467,7 @@ 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; + 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. */ @@ -619,7 +493,7 @@ export interface AzureBlobFileSystemConfiguration { } /** Information used to connect to an NFS file system. */ -export interface NFSMountConfiguration { +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. */ @@ -656,6 +530,46 @@ export interface AzureFileShareConfiguration { 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. */ @@ -665,32 +579,19 @@ export interface NameValuePair { } /** Parameters for updating an Azure Batch Pool. */ -export interface BatchPoolUpdateParameters { +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; - /** - * If this element is present, it replaces any existing Certificate references configured on the Pool. - * If omitted, any existing Certificate references are left unchanged. - * For Windows Nodes, the Batch service installs the Certificates to the specified Certificate store and location. - * For Linux Compute Nodes, the Certificates are stored in a directory inside the Task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the Task to query for this location. - * For Certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and Certificates are placed in that directory. - * Warning: This property is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. - */ - certificateReferences?: Array; /** 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. - * - * Possible values: default, classic, simplified - */ - targetNodeCommunicationMode?: string; + /** 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 BatchPoolEnableAutoScaleParameters { +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. */ @@ -698,64 +599,43 @@ export interface BatchPoolEnableAutoScaleParameters { } /** Parameters for evaluating an automatic scaling formula on an Azure Batch Pool. */ -export interface BatchPoolEvaluateAutoScaleParameters { +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 BatchPoolResizeParameters { +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. - * - * Possible values: requeue, terminate, taskcompletion, retaineddata - */ - nodeDeallocationOption?: 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 BatchPoolReplaceParameters { +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; - /** - * This list replaces any existing Certificate references configured on the Pool. - * If you specify an empty collection, any existing Certificate references are removed from the Pool. - * For Windows Nodes, the Batch service installs the Certificates to the specified Certificate store and location. - * For Linux Compute Nodes, the Certificates are stored in a directory inside the Task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the Task to query for this location. - * For Certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and Certificates are placed in that directory. - * Warning: This property is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. - */ - certificateReferences: Array; /** 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. - * - * Possible values: default, classic, simplified - */ - targetNodeCommunicationMode?: string; + /** 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 BatchNodeRemoveParameters { +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. - * - * Possible values: requeue, terminate, taskcompletion, retaineddata - */ - nodeDeallocationOption?: 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. */ @@ -770,12 +650,8 @@ 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. - * - * Possible values: noaction, terminatejob - */ - onAllTasksComplete?: string; + /** 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; } @@ -862,7 +738,7 @@ export interface OutputFile { /** The destination for the output file(s). */ destination: OutputFileDestination; /** Additional options for the upload operation, including under what conditions to perform the upload. */ - uploadOptions: OutputFileUploadOptions; + uploadOptions: OutputFileUploadConfig; } /** The destination to which a file should be uploaded. */ @@ -895,13 +771,9 @@ export interface HttpHeader { * Options for an output file upload operation, including under what conditions * to perform the upload. */ -export interface OutputFileUploadOptions { - /** - * 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: string; +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. */ @@ -920,7 +792,7 @@ export interface BatchTaskConstraints { */ 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?: string[]; + access?: AccessScope[]; } /** @@ -1024,12 +896,8 @@ 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. - * - * Possible values: jobschedule, job - */ - poolLifetimeOption: 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. */ @@ -1042,9 +910,7 @@ export interface BatchPoolSpecification { 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 cloud service configuration for the Pool. This property must be specified if the Pool needs to be created with Azure PaaS VMs. This property and virtualMachineConfiguration are mutually exclusive and one of the properties must be specified. If neither is specified then the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). This property cannot be specified if the Batch Account was created with its poolAllocationMode property set to 'UserSubscription'. */ - cloudServiceConfiguration?: CloudServiceConfiguration; - /** The virtual machine configuration for the Pool. This property must be specified if the Pool needs to be created with Azure IaaS VMs. This property and cloudServiceConfiguration are mutually exclusive and one of the properties must be specified. If neither is specified then the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). */ + /** 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; @@ -1070,28 +936,18 @@ export interface BatchPoolSpecification { 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; - /** - * For Windows Nodes, the Batch service installs the Certificates to the specified Certificate store and location. For Linux Compute Nodes, the Certificates are stored in a directory inside the Task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the Task to query for this location. For Certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and Certificates are placed in that directory. - * Warning: This property is deprecated and will be removed after February, 2024. - * Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. - */ - certificateReferences?: Array; /** 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 application licenses the Batch service will make available on each Compute Node in the Pool. The list of application licenses must be a subset of available Batch service application licenses. If a license is requested which is not supported, Pool creation will fail. The permitted licenses available on the Pool are 'maya', 'vray', '3dsmax', 'arnold'. An additional charge applies for each application license added to the Pool. */ - applicationLicenses?: string[]; /** 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. - * - * Possible values: default, classic, simplified - */ - targetNodeCommunicationMode?: string; + /** 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. */ @@ -1116,12 +972,8 @@ export interface BatchJobExecutionInfo { /** An error encountered by the Batch service when scheduling a Job. */ export interface BatchJobSchedulingError { - /** - * The category of the Job scheduling error. - * - * Possible values: usererror, servererror - */ - category: string; + /** 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. */ @@ -1163,7 +1015,7 @@ export interface BatchJobStatistics { } /** Parameters for updating an Azure Batch Job. */ -export interface BatchJobUpdateParameters { +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. */ @@ -1174,34 +1026,26 @@ export interface BatchJobUpdateParameters { 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). - * - * Possible values: noaction, terminatejob - */ - onAllTasksComplete?: string; + /** 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 BatchJobDisableParameters { - /** - * What to do with active Tasks associated with the Job. - * - * Possible values: requeue, terminate, wait - */ - disableTasks: string; +export interface BatchJobDisableContent { + /** What to do with active Tasks associated with the Job. */ + disableTasks: DisableBatchJobOption; } /** Parameters for terminating an Azure Batch Job. */ -export interface BatchJobTerminateParameters { - /** The text you want to appear as the Job's TerminateReason. The default is 'UserTerminate'. */ +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 BatchJobCreateParameters { +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. */ @@ -1226,18 +1070,10 @@ export interface BatchJobCreateParameters { 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. - * - * Possible values: noaction, terminatejob - */ - onAllTasksComplete?: string; - /** - * 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?: string; + /** 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. */ @@ -1256,12 +1092,8 @@ export interface BatchTaskContainerExecutionInfo { /** Information about a Task failure. */ export interface BatchTaskFailureInfo { - /** - * The category of the Task error. - * - * Possible values: usererror, servererror - */ - category: string; + /** 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. */ @@ -1270,44 +1102,13 @@ export interface BatchTaskFailureInfo { details?: Array; } -/** - * A Certificate that can be installed on Compute Nodes and can be used to - * authenticate operations on the machine. - */ -export interface BatchCertificate { - /** The X.509 thumbprint of the Certificate. This is a sequence of up to 40 hex digits (it may include spaces but these are removed). */ - thumbprint: string; - /** The algorithm used to derive the thumbprint. This must be sha1. */ - thumbprintAlgorithm: string; - /** The base64-encoded contents of the Certificate. The maximum size is 10KB. */ - data: string; - /** - * The format of the Certificate data. - * - * Possible values: pfx, cer - */ - certificateFormat?: string; - /** The password to access the Certificate's private key. This must be omitted if the Certificate format is cer. */ - password?: string; -} - -/** An error encountered by the Batch service when deleting a Certificate. */ -export interface DeleteBatchCertificateError { - /** An identifier for the Certificate deletion error. Codes are invariant and are intended to be consumed programmatically. */ - code?: string; - /** A message describing the Certificate deletion error, intended to be suitable for display in a user interface. */ - message?: string; - /** A list of additional error details related to the Certificate deletion error. This list includes details such as the active Pools and Compute Nodes referencing this Certificate. However, if a large number of resources reference the Certificate, the list contains only about the first hundred. */ - values?: 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?: Schedule; + 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. */ @@ -1318,7 +1119,7 @@ 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. */ -export interface Schedule { +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. */ @@ -1341,18 +1142,10 @@ 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. - * - * Possible values: noaction, terminatejob - */ - onAllTasksComplete?: string; - /** - * 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?: string; + /** 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. */ @@ -1425,9 +1218,9 @@ export interface BatchJobScheduleStatistics { } /** Parameters for updating an Azure Batch Job Schedule. */ -export interface BatchJobScheduleUpdateParameters { +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?: Schedule; + 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. */ @@ -1435,13 +1228,13 @@ export interface BatchJobScheduleUpdateParameters { } /** Parameters for creating an Azure Batch Job Schedule */ -export interface BatchJobScheduleCreateParameters { +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: Schedule; + 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. */ @@ -1449,7 +1242,7 @@ export interface BatchJobScheduleCreateParameters { } /** Parameters for creating an Azure Batch Task. */ -export interface BatchTaskCreateParameters { +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. */ @@ -1511,18 +1304,10 @@ 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). - * - * Possible values: none, disable, terminate - */ - jobAction?: string; - /** - * 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?: string; + /** 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; } /** @@ -1621,12 +1406,8 @@ 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. - * - * Possible values: success, failure - */ - result?: 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. */ @@ -1672,28 +1453,28 @@ export interface BatchTaskStatistics { } /** A collection of Azure Batch Tasks to add. */ -export interface BatchTaskCollection { +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; + value: Array; } /** Parameters for creating a user account for RDP or SSH access on an Azure Batch Compute Node. */ -export interface BatchNodeUserCreateParameters { +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 'cloudServiceConfiguration', or created with 'virtualMachineConfiguration' using a Windows Image reference). For Linux Compute Nodes, the password can optionally be specified along with the sshPublicKey property. */ + /** 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 BatchNodeUserUpdateParameters { - /** The password of the Account. The password is required for Windows Compute Nodes (those created with 'cloudServiceConfiguration', or 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. */ +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; @@ -1702,37 +1483,19 @@ export interface BatchNodeUserUpdateParameters { } /** Parameters for rebooting an Azure Batch Compute Node. */ -export interface BatchNodeRebootParameters { - /** - * 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?: string; -} - -/** Parameters for reimaging an Azure Batch Compute Node. */ -export interface BatchNodeReimageParameters { - /** - * When to reimage the Compute Node and what to do with currently running Tasks. The default value is requeue. - * - * Possible values: requeue, terminate, taskcompletion, retaineddata - */ - nodeReimageOption?: string; +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 BatchNodeDisableSchedulingParameters { - /** - * 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?: string; +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 UploadBatchServiceLogsParameters { +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. */ @@ -1742,3 +1505,127 @@ export interface UploadBatchServiceLogsParameters { /** 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 | "none" | "readonly" | "readwrite"; +/** Alias for StorageAccountType */ +export type StorageAccountType = + | string + | "standard_lrs" + | "premium_lrs" + | "standardssd_lrs"; +/** Alias for ContainerType */ +export type ContainerType = string | "dockerCompatible" | "criCompatible"; +/** Alias for DiskEncryptionTarget */ +export type DiskEncryptionTarget = string | "osdisk" | "temporarydisk"; +/** Alias for BatchNodePlacementPolicyType */ +export type BatchNodePlacementPolicyType = string | "regional" | "zonal"; +/** Alias for DiffDiskPlacement */ +export type DiffDiskPlacement = string | "cachedisk"; +/** Alias for SecurityTypes */ +export type SecurityTypes = string | "trustedLaunch"; +/** Alias for DynamicVNetAssignmentScope */ +export type DynamicVNetAssignmentScope = string | "none" | "job"; +/** Alias for InboundEndpointProtocol */ +export type InboundEndpointProtocol = string | "tcp" | "udp"; +/** Alias for NetworkSecurityGroupRuleAccess */ +export type NetworkSecurityGroupRuleAccess = string | "allow" | "deny"; +/** Alias for IpAddressProvisioningType */ +export type IpAddressProvisioningType = + | string + | "batchmanaged" + | "usermanaged" + | "nopublicipaddresses"; +/** Alias for ContainerWorkingDirectory */ +export type ContainerWorkingDirectory = + | string + | "taskWorkingDirectory" + | "containerImageDefault"; +/** Alias for AutoUserScope */ +export type AutoUserScope = string | "task" | "pool"; +/** Alias for ElevationLevel */ +export type ElevationLevel = string | "nonadmin" | "admin"; +/** Alias for BatchNodeFillType */ +export type BatchNodeFillType = string | "spread" | "pack"; +/** Alias for LoginMode */ +export type LoginMode = string | "batch" | "interactive"; +/** Alias for BatchNodeCommunicationMode */ +export type BatchNodeCommunicationMode = + | string + | "default" + | "classic" + | "simplified"; +/** Alias for UpgradeMode */ +export type UpgradeMode = string | "automatic" | "manual" | "rolling"; +/** Alias for BatchNodeDeallocationOption */ +export type BatchNodeDeallocationOption = + | string + | "requeue" + | "terminate" + | "taskcompletion" + | "retaineddata"; +/** Alias for BatchJobState */ +export type BatchJobState = + | string + | "active" + | "disabling" + | "disabled" + | "enabling" + | "terminating" + | "completed" + | "deleting"; +/** Alias for OutputFileUploadCondition */ +export type OutputFileUploadCondition = + | string + | "tasksuccess" + | "taskfailure" + | "taskcompletion"; +/** Alias for AccessScope */ +export type AccessScope = string | "job"; +/** Alias for BatchPoolLifetimeOption */ +export type BatchPoolLifetimeOption = string | "jobschedule" | "job"; +/** Alias for OnAllBatchTasksComplete */ +export type OnAllBatchTasksComplete = string | "noaction" | "terminatejob"; +/** Alias for OnBatchTaskFailure */ +export type OnBatchTaskFailure = + | string + | "noaction" + | "performexitoptionsjobaction"; +/** Alias for ErrorCategory */ +export type ErrorCategory = string | "usererror" | "servererror"; +/** Alias for DisableBatchJobOption */ +export type DisableBatchJobOption = string | "requeue" | "terminate" | "wait"; +/** Alias for BatchTaskExecutionResult */ +export type BatchTaskExecutionResult = string | "success" | "failure"; +/** Alias for BatchJobScheduleState */ +export type BatchJobScheduleState = + | string + | "active" + | "completed" + | "disabled" + | "terminating" + | "deleting"; +/** Alias for BatchJobAction */ +export type BatchJobAction = string | "none" | "disable" | "terminate"; +/** Alias for DependencyAction */ +export type DependencyAction = string | "satisfy" | "block"; +/** Alias for BatchTaskState */ +export type BatchTaskState = + | string + | "active" + | "preparing" + | "running" + | "completed"; +/** Alias for BatchNodeRebootOption */ +export type BatchNodeRebootOption = + | string + | "requeue" + | "terminate" + | "taskcompletion" + | "retaineddata"; +/** Alias for BatchNodeDisableSchedulingOption */ +export type BatchNodeDisableSchedulingOption = + | string + | "requeue" + | "terminate" + | "taskcompletion"; diff --git a/packages/service/src/internal/batch-rest/generated/src/outputModels.ts b/packages/service/src/internal/batch-rest/generated/src/outputModels.ts index 9fff150a7..f42982008 100644 --- a/packages/service/src/internal/batch-rest/generated/src/outputModels.ts +++ b/packages/service/src/internal/batch-rest/generated/src/outputModels.ts @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -export interface BatchApplicationListResultListOutput {} - /** The result of listing the applications available in an Account. */ export interface BatchApplicationListResultOutput { /** The list of applications available in the Account. */ @@ -47,8 +45,6 @@ export interface BatchErrorDetailOutput { value?: string; } -export interface BatchPoolListUsageMetricsResultListOutput {} - /** The result of a listing the usage metrics for an Account. */ export interface BatchPoolListUsageMetricsResultOutput { /** The Pool usage metrics data. */ @@ -71,29 +67,6 @@ export interface BatchPoolUsageMetricsOutput { totalCoreHours: number; } -/** - * The configuration for Compute Nodes in a Pool based on the Azure Cloud Services - * platform. - */ -export interface CloudServiceConfigurationOutput { - /** - * Possible values are: - * 2 - OS Family 2, equivalent to Windows Server 2008 R2 - * SP1. - * 3 - OS Family 3, equivalent to Windows Server 2012. - * 4 - OS Family 4, - * equivalent to Windows Server 2012 R2. - * 5 - OS Family 5, equivalent to Windows - * Server 2016. - * 6 - OS Family 6, equivalent to Windows Server 2019. For more - * information, see Azure Guest OS Releases - * (https://azure.microsoft.com/documentation/articles/cloud-services-guestos-update-matrix/#releases). - */ - osFamily: string; - /** The Azure Guest OS version to be installed on the virtual machines in the Pool. The default value is * which specifies the latest operating system version for the specified OS family. */ - osVersion?: string; -} - /** * The configuration for Compute Nodes in a Pool based on the Azure Virtual * Machines infrastructure. @@ -167,40 +140,28 @@ export interface WindowsConfigurationOutput { * disks from within a VM to use them. */ export interface DataDiskOutput { - /** The logical unit number. The lun is used to uniquely identify each data disk. If attaching multiple disks, each should have a distinct lun. The value must be between 0 and 63, inclusive. */ + /** 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/. - * - * Possible values: none, readonly, readwrite - */ - caching?: string; + /** 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". - * - * Possible values: standard_lrs, premium_lrs, standardssd_lrs - */ - storageAccountType?: string; + /** 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. - * - * Possible values: dockerCompatible, criCompatible - */ - type: string; + /** 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; + containerRegistries?: Array; } /** A private container registry. */ -export interface ContainerRegistryOutput { +export interface ContainerRegistryReferenceOutput { /** The user name to log into the registry server. */ username?: string; /** The password to log into the registry server. */ @@ -227,7 +188,7 @@ export interface BatchNodeIdentityReferenceOutput { */ 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?: string[]; + targets?: DiskEncryptionTargetOutput[]; } /** @@ -236,12 +197,8 @@ 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. - * - * Possible values: regional, zonal - */ - policy?: string; + /** 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. */ @@ -270,12 +227,8 @@ 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. - * - * Possible values: none, readonly, readwrite - */ - caching?: string; + /** 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. */ @@ -289,34 +242,22 @@ 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. - * - * Possible values: cachedisk - */ - placement?: string; + /** 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. - * - * Possible values: standard_lrs, premium_lrs, standardssd_lrs - */ - storageAccountType: string; + /** 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. - * - * Possible values: trustedLaunch - */ - securityType: string; + /** 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; } @@ -340,18 +281,14 @@ export interface ServiceArtifactReferenceOutput { /** 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, but for Pools created with cloudServiceConfiguration both ARM and classic virtual networks 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. For Pools created with a cloud service configuration, enable ports 10100, 20100, and 30100. 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. */ + /** 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. - * - * Possible values: none, job - */ - dynamicVNetAssignmentScope?: 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; + 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; } @@ -359,22 +296,18 @@ export interface NetworkConfigurationOutput { /** 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; + 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 { +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. - * - * Possible values: tcp, udp - */ - protocol: 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. */ @@ -389,12 +322,8 @@ 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. - * - * Possible values: allow, deny - */ - access: string; + /** 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 '*'. */ @@ -402,13 +331,9 @@ 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. - * - * Possible values: batchmanaged, usermanaged, nopublicipaddresses - */ - provision?: string; +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[]; } @@ -452,13 +377,9 @@ export interface BatchTaskContainerSettingsOutput { /** 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?: ContainerRegistryOutput; - /** - * The location of the container Task working directory. The default is 'taskWorkingDirectory'. - * - * Possible values: taskWorkingDirectory, containerImageDefault - */ - workingDirectory?: string; + 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. */ @@ -497,36 +418,10 @@ 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. For example, if the task mutates the registry in a way which could impact other tasks, or if certificates have been specified on the pool which should not be accessible by normal tasks but should be accessible by StartTasks. - * - * Possible values: task, pool - */ - scope?: string; - /** - * The elevation level of the auto user. The default value is nonAdmin. - * - * Possible values: nonadmin, admin - */ - elevationLevel?: string; -} - -/** A reference to a Certificate to be installed on Compute Nodes in a Pool. Warning: This object is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. */ -export interface BatchCertificateReferenceOutput { - /** The thumbprint of the Certificate. */ - thumbprint: string; - /** The algorithm with which the thumbprint is associated. This must be sha1. */ - thumbprintAlgorithm: string; - /** - * The location of the Certificate store on the Compute Node into which to install the Certificate. The default value is currentuser. This property is applicable only for Pools configured with Windows Compute Nodes (that is, created with cloudServiceConfiguration, or with virtualMachineConfiguration using a Windows Image reference). For Linux Compute Nodes, the Certificates are stored in a directory inside the Task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the Task to query for this location. For Certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and Certificates are placed in that directory. - * - * Possible values: currentuser, localmachine - */ - storeLocation?: string; - /** The name of the Certificate store on the Compute Node into which to install the Certificate. This property is applicable only for Pools configured with Windows Compute Nodes (that is, created with cloudServiceConfiguration, or with virtualMachineConfiguration using a Windows Image reference). Common store names include: My, Root, CA, Trust, Disallowed, TrustedPeople, TrustedPublisher, AuthRoot, AddressBook, but any custom store name can also be used. The default value is My. */ - storeName?: string; - /** Which user Accounts on the Compute Node should have access to the private data of the Certificate. You can specify more than one visibility in this collection. The default is all Accounts. */ - visibility?: string[]; + /** 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. */ @@ -539,12 +434,8 @@ 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. - * - * Possible values: spread, pack - */ - nodeFillType: string; + /** How Tasks are distributed across Compute Nodes in a Pool. If not specified, the default is spread. */ + nodeFillType: BatchNodeFillTypeOutput; } /** @@ -556,12 +447,8 @@ 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. - * - * Possible values: nonadmin, admin - */ - elevationLevel?: 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. */ @@ -580,12 +467,8 @@ 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' and for CloudServiceConfiguration Pools is 'interactive'. - * - * Possible values: batch, interactive - */ - loginMode?: string; + /** The login mode for the user. The default value for VirtualMachineConfiguration Pools is 'batch'. */ + loginMode?: LoginModeOutput; } /** @@ -604,7 +487,7 @@ 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; + 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. */ @@ -630,7 +513,7 @@ export interface AzureBlobFileSystemConfigurationOutput { } /** Information used to connect to an NFS file system. */ -export interface NFSMountConfigurationOutput { +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. */ @@ -667,7 +550,45 @@ export interface AzureFileShareConfigurationOutput { mountOptions?: string; } -export interface BatchPoolListResultListOutput {} +/** 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 { @@ -691,27 +612,17 @@ export interface BatchPoolOutput { readonly lastModified?: string; /** The creation time of the Pool. */ readonly creationTime?: string; - /** - * The current state of the Pool. - * - * Possible values: active, deleting - */ - readonly state?: 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. - * - * Possible values: steady, resizing, stopping - */ - readonly allocationState?: 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 cloud service configuration for the Pool. This property and virtualMachineConfiguration are mutually exclusive and one of the properties must be specified. This property cannot be specified if the Batch Account was created with its poolAllocationMode property set to 'UserSubscription'. */ - readonly cloudServiceConfiguration?: CloudServiceConfigurationOutput; - /** The virtual machine configuration for the Pool. This property and cloudServiceConfiguration are mutually exclusive and one of the properties must be specified. */ + /** 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; @@ -741,17 +652,8 @@ export interface BatchPoolOutput { readonly networkConfiguration?: NetworkConfigurationOutput; /** A Task specified to run on each Compute Node as it joins the Pool. */ startTask?: BatchStartTaskOutput; - /** - * For Windows Nodes, the Batch service installs the Certificates to the specified Certificate store and location. - * For Linux Compute Nodes, the Certificates are stored in a directory inside the Task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the Task to query for this location. - * For Certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and Certificates are placed in that directory. - * Warning: This property is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. - */ - readonly certificateReferences?: Array; /** 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 list of application licenses the Batch service will make available on each Compute Node in the Pool. The list of application licenses must be a subset of available Batch service application licenses. If a license is requested which is not supported, Pool creation will fail. */ - readonly applicationLicenses?: string[]; /** 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. */ @@ -766,18 +668,12 @@ 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. - * - * Possible values: default, classic, simplified - */ - targetNodeCommunicationMode?: string; - /** - * The current state of the pool communication mode. - * - * Possible values: default, classic, simplified - */ - readonly currentNodeCommunicationMode?: string; + /** 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. */ @@ -874,12 +770,8 @@ 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}'. - * - * Possible values: UserAssigned, None - */ - type: string; + /** 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; } @@ -894,18 +786,10 @@ export interface UserAssignedIdentityOutput { readonly principalId?: string; } -/** Parameters for evaluating an automatic scaling formula on an Azure Batch Pool. */ -export interface BatchPoolEvaluateAutoScaleParametersOutput { - /** 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; -} - -export interface BatchAccountListSupportedImagesResultListOutput {} - /** The result of listing the supported Virtual Machine Images. */ export interface BatchAccountListSupportedImagesResultOutput { /** The list of supported Virtual Machine Images. */ - value?: Array; + value?: Array; /** The URL to get the next set of results. */ "odata.nextLink"?: string; } @@ -914,31 +798,21 @@ export interface BatchAccountListSupportedImagesResultOutput { * A reference to the Azure Virtual Machines Marketplace Image and additional * information about the Image. */ -export interface ImageInfoOutput { +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. - * - * Possible values: linux, windows - */ - osType: string; + /** 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. - * - * Possible values: verified, unverified - */ - verificationType: string; + /** Whether the Azure Batch service actively verifies that the Image is compatible with the associated Compute Node agent SKU. */ + verificationType: ImageVerificationTypeOutput; } -export interface BatchPoolNodeCountsListResultListOutput {} - /** The result of listing the Compute Node counts in the Account. */ export interface BatchPoolNodeCountsListResultOutput { /** A list of Compute Node counts by Pool. */ @@ -987,6 +861,8 @@ export interface BatchNodeCountsOutput { 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. */ @@ -1005,20 +881,12 @@ export interface BatchJobOutput { readonly lastModified?: string; /** The creation time of the Job. */ readonly creationTime?: string; - /** - * The current state of the Job. - * - * Possible values: active, disabling, disabled, enabling, terminating, completed, deleting - */ - readonly state?: 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. - * - * Possible values: active, disabling, disabled, enabling, terminating, completed, deleting - */ - readonly previousState?: 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. */ @@ -1039,18 +907,10 @@ 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. - * - * Possible values: noaction, terminatejob - */ - onAllTasksComplete?: string; - /** - * 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?: string; + /** 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. */ @@ -1143,7 +1003,7 @@ export interface OutputFileOutput { /** The destination for the output file(s). */ destination: OutputFileDestinationOutput; /** Additional options for the upload operation, including under what conditions to perform the upload. */ - uploadOptions: OutputFileUploadOptionsOutput; + uploadOptions: OutputFileUploadConfigOutput; } /** The destination to which a file should be uploaded. */ @@ -1176,13 +1036,9 @@ export interface HttpHeaderOutput { * Options for an output file upload operation, including under what conditions * to perform the upload. */ -export interface OutputFileUploadOptionsOutput { - /** - * 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: string; +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. */ @@ -1201,7 +1057,7 @@ export interface BatchTaskConstraintsOutput { */ 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?: string[]; + access?: AccessScopeOutput[]; } /** @@ -1305,12 +1161,8 @@ 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. - * - * Possible values: jobschedule, job - */ - poolLifetimeOption: 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. */ @@ -1323,9 +1175,7 @@ export interface BatchPoolSpecificationOutput { 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 cloud service configuration for the Pool. This property must be specified if the Pool needs to be created with Azure PaaS VMs. This property and virtualMachineConfiguration are mutually exclusive and one of the properties must be specified. If neither is specified then the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). This property cannot be specified if the Batch Account was created with its poolAllocationMode property set to 'UserSubscription'. */ - cloudServiceConfiguration?: CloudServiceConfigurationOutput; - /** The virtual machine configuration for the Pool. This property must be specified if the Pool needs to be created with Azure IaaS VMs. This property and cloudServiceConfiguration are mutually exclusive and one of the properties must be specified. If neither is specified then the Batch service returns an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request). */ + /** 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; @@ -1351,28 +1201,18 @@ export interface BatchPoolSpecificationOutput { 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; - /** - * For Windows Nodes, the Batch service installs the Certificates to the specified Certificate store and location. For Linux Compute Nodes, the Certificates are stored in a directory inside the Task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the Task to query for this location. For Certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and Certificates are placed in that directory. - * Warning: This property is deprecated and will be removed after February, 2024. - * Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. - */ - certificateReferences?: Array; /** 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 application licenses the Batch service will make available on each Compute Node in the Pool. The list of application licenses must be a subset of available Batch service application licenses. If a license is requested which is not supported, Pool creation will fail. The permitted licenses available on the Pool are 'maya', 'vray', '3dsmax', 'arnold'. An additional charge applies for each application license added to the Pool. */ - applicationLicenses?: string[]; /** 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. - * - * Possible values: default, classic, simplified - */ - targetNodeCommunicationMode?: string; + /** 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. */ @@ -1397,12 +1237,8 @@ export interface BatchJobExecutionInfoOutput { /** An error encountered by the Batch service when scheduling a Job. */ export interface BatchJobSchedulingErrorOutput { - /** - * The category of the Job scheduling error. - * - * Possible values: usererror, servererror - */ - category: string; + /** 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. */ @@ -1443,8 +1279,6 @@ export interface BatchJobStatisticsOutput { waitTime: string; } -export interface BatchJobListResultListOutput {} - /** The result of listing the Jobs in an Account. */ export interface BatchJobListResultOutput { /** The list of Jobs. */ @@ -1453,8 +1287,6 @@ export interface BatchJobListResultOutput { "odata.nextLink"?: string; } -export interface BatchJobPreparationAndReleaseTaskStatusListResultListOutput {} - /** * The result of listing the status of the Job Preparation and Job Release Tasks * for a Job. @@ -1489,12 +1321,8 @@ 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. - * - * Possible values: running, completed - */ - state: 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. */ @@ -1509,12 +1337,8 @@ 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. - * - * Possible values: success, failure - */ - result?: 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. */ @@ -1529,12 +1353,8 @@ export interface BatchTaskContainerExecutionInfoOutput { /** Information about a Task failure. */ export interface BatchTaskFailureInfoOutput { - /** - * The category of the Task error. - * - * Possible values: usererror, servererror - */ - category: string; + /** 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. */ @@ -1552,12 +1372,8 @@ 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. - * - * Possible values: running, completed - */ - state: 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. */ @@ -1568,12 +1384,8 @@ 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. - * - * Possible values: success, failure - */ - result?: 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 Task and TaskSlot counts for a Job. */ @@ -1612,69 +1424,6 @@ export interface BatchTaskSlotCountsOutput { failed: number; } -/** - * A Certificate that can be installed on Compute Nodes and can be used to - * authenticate operations on the machine. - */ -export interface BatchCertificateOutput { - /** The X.509 thumbprint of the Certificate. This is a sequence of up to 40 hex digits (it may include spaces but these are removed). */ - thumbprint: string; - /** The algorithm used to derive the thumbprint. This must be sha1. */ - thumbprintAlgorithm: string; - /** The URL of the Certificate. */ - readonly url?: string; - /** - * The state of the Certificate. - * - * Possible values: active, deleting, deletefailed - */ - readonly state?: string; - /** The time at which the Certificate entered its current state. */ - readonly stateTransitionTime?: string; - /** - * The previous state of the Certificate. This property is not set if the Certificate is in its initial active state. - * - * Possible values: active, deleting, deletefailed - */ - readonly previousState?: string; - /** The time at which the Certificate entered its previous state. This property is not set if the Certificate is in its initial Active state. */ - readonly previousStateTransitionTime?: string; - /** The public part of the Certificate as a base-64 encoded .cer file. */ - readonly publicData?: string; - /** The error that occurred on the last attempt to delete this Certificate. This property is set only if the Certificate is in the DeleteFailed state. */ - readonly deleteCertificateError?: DeleteBatchCertificateErrorOutput; - /** The base64-encoded contents of the Certificate. The maximum size is 10KB. */ - data: string; - /** - * The format of the Certificate data. - * - * Possible values: pfx, cer - */ - certificateFormat?: string; - /** The password to access the Certificate's private key. This must be omitted if the Certificate format is cer. */ - password?: string; -} - -/** An error encountered by the Batch service when deleting a Certificate. */ -export interface DeleteBatchCertificateErrorOutput { - /** An identifier for the Certificate deletion error. Codes are invariant and are intended to be consumed programmatically. */ - code?: string; - /** A message describing the Certificate deletion error, intended to be suitable for display in a user interface. */ - message?: string; - /** A list of additional error details related to the Certificate deletion error. This list includes details such as the active Pools and Compute Nodes referencing this Certificate. However, if a large number of resources reference the Certificate, the list contains only about the first hundred. */ - values?: Array; -} - -export interface BatchCertificateListResultListOutput {} - -/** The result of listing the Certificates in the Account. */ -export interface BatchCertificateListResultOutput { - /** The list of Certificates. */ - value?: Array; - /** The URL to get the next set of results. */ - "odata.nextLink"?: string; -} - /** * A Job Schedule that allows recurring Jobs by specifying when to run Jobs and a * specification used to create each Job. @@ -1692,24 +1441,16 @@ export interface BatchJobScheduleOutput { readonly lastModified?: string; /** The creation time of the Job Schedule. */ readonly creationTime?: string; - /** - * The current state of the Job Schedule. - * - * Possible values: active, completed, disabled, terminating, deleting - */ - readonly state?: 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. - * - * Possible values: active, completed, disabled, terminating, deleting - */ - readonly previousState?: 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?: ScheduleOutput; + 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. */ @@ -1724,7 +1465,7 @@ export interface BatchJobScheduleOutput { * 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 ScheduleOutput { +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. */ @@ -1747,18 +1488,10 @@ 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. - * - * Possible values: noaction, terminatejob - */ - onAllTasksComplete?: string; - /** - * 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?: string; + /** 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. */ @@ -1830,8 +1563,6 @@ export interface BatchJobScheduleStatisticsOutput { waitTime: string; } -export interface BatchJobScheduleListResultListOutput {} - /** The result of listing the Job Schedules in an Account. */ export interface BatchJobScheduleListResultOutput { /** The list of Job Schedules. */ @@ -1840,42 +1571,6 @@ export interface BatchJobScheduleListResultOutput { "odata.nextLink"?: string; } -/** Parameters for creating an Azure Batch Task. */ -export interface BatchTaskCreateParametersOutput { - /** 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?: ExitConditionsOutput; - /** 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?: 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. */ - 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?: AffinityInfoOutput; - /** 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?: BatchTaskConstraintsOutput; - /** 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?: UserIdentityOutput; - /** An object that indicates that the Task is a multi-instance Task, and contains information about how to run the multi-instance Task. */ - multiInstanceSettings?: MultiInstanceSettingsOutput; - /** 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?: 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. */ - 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; -} - /** 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. */ @@ -1903,18 +1598,10 @@ 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). - * - * Possible values: none, disable, terminate - */ - jobAction?: string; - /** - * 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?: string; + /** 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; } /** @@ -1977,8 +1664,6 @@ export interface BatchTaskIdRangeOutput { end: number; } -export interface BatchTaskListResultListOutput {} - /** The result of listing the Tasks in a Job. */ export interface BatchTaskListResultOutput { /** The list of Tasks. */ @@ -2013,20 +1698,12 @@ 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. - * - * Possible values: active, preparing, running, completed - */ - readonly state?: string; + /** 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. - * - * Possible values: active, preparing, running, completed - */ - readonly previousState?: 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). */ @@ -2083,12 +1760,8 @@ 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. - * - * Possible values: success, failure - */ - result?: 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. */ @@ -2133,12 +1806,6 @@ export interface BatchTaskStatisticsOutput { waitTime: string; } -/** A collection of Azure Batch Tasks to add. */ -export interface BatchTaskCollectionOutput { - /** 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; -} - /** The result of adding a collection of Tasks to a Job. */ export interface BatchTaskAddCollectionResultOutput { /** The results of the add Task collection operation. */ @@ -2147,12 +1814,8 @@ 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. - * - * Possible values: success, clienterror, servererror - */ - status: string; + /** 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. */ @@ -2165,8 +1828,6 @@ export interface BatchTaskAddResultOutput { error?: BatchErrorOutput; } -export interface BatchTaskListSubtasksResultListOutput {} - /** The result of listing the subtasks of a Task. */ export interface BatchTaskListSubtasksResultOutput { /** The list of subtasks. */ @@ -2191,32 +1852,18 @@ 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. - * - * Possible values: preparing, running, completed - */ - state?: string; + /** 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. - * - * Possible values: preparing, running, completed - */ - previousState?: 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. - * - * Possible values: success, failure - */ - result?: 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; } -export interface BatchNodeFileListResultListOutput {} - /** * The result of listing the files on a Compute Node, or the files associated with * a Task on a Compute Node. @@ -2260,18 +1907,10 @@ 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. - * - * Possible values: idle, rebooting, reimaging, running, unusable, creating, starting, waitingforstarttask, starttaskfailed, unknown, leavingpool, offline, preempted - */ - state?: string; - /** - * Whether the Compute Node is available for Task scheduling. - * - * Possible values: enabled, disabled - */ - schedulingState?: 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. */ @@ -2298,13 +1937,6 @@ export interface BatchNodeOutput { startTask?: BatchStartTaskOutput; /** Runtime information about the execution of the StartTask on the Compute Node. */ startTaskInfo?: BatchStartTaskInfoOutput; - /** - * For Windows Nodes, the Batch service installs the Certificates to the specified Certificate store and location. - * For Linux Compute Nodes, the Certificates are stored in a directory inside the Task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the Task to query for this location. - * For Certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and Certificates are placed in that directory. - * Warning: This property is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. - */ - certificateReferences?: Array; /** 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. */ @@ -2327,24 +1959,16 @@ 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. - * - * Possible values: active, preparing, running, completed - */ - taskState: string; + /** 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. - * - * Possible values: running, completed - */ - state: string; + /** 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. */ @@ -2359,12 +1983,8 @@ 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. - * - * Possible values: success, failure - */ - result?: 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. */ @@ -2387,12 +2007,8 @@ export interface BatchNodeEndpointConfigurationOutput { export interface InboundEndpointOutput { /** The name of the endpoint. */ name: string; - /** - * The protocol of the endpoint. - * - * Possible values: tcp, udp - */ - protocol: 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. */ @@ -2430,18 +2046,6 @@ export interface BatchNodeRemoteLoginSettingsOutput { remoteLoginPort: number; } -/** The Azure Batch service log files upload parameters for a Compute Node. */ -export interface UploadBatchServiceLogsParametersOutput { - /** 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: 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?: 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; -} - /** 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. */ @@ -2450,8 +2054,6 @@ export interface UploadBatchServiceLogsResultOutput { numberOfFilesUploaded: number; } -export interface BatchNodeListResultListOutput {} - /** The result of listing the Compute Nodes in a Pool. */ export interface BatchNodeListResultOutput { /** The list of Compute Nodes. */ @@ -2486,20 +2088,14 @@ export interface InstanceViewStatusOutput { code?: string; /** The localized label for the status. */ displayStatus?: string; - /** - * Level code. - * - * Possible values: Error, Info, Warning - */ - level?: string; + /** Level code. */ + level?: StatusLevelTypesOutput; /** The detailed status message. */ message?: string; /** The time of the status. */ time?: string; } -export interface BatchNodeVMExtensionListResultListOutput {} - /** The result of listing the Compute Node extensions in a Node. */ export interface BatchNodeVMExtensionListResultOutput { /** The list of Compute Node extensions. */ @@ -2507,3 +2103,160 @@ export interface BatchNodeVMExtensionListResultOutput { /** The URL to get the next set of results. */ "odata.nextLink"?: string; } + +/** Alias for CachingTypeOutput */ +export type CachingTypeOutput = string | "none" | "readonly" | "readwrite"; +/** Alias for StorageAccountTypeOutput */ +export type StorageAccountTypeOutput = + | string + | "standard_lrs" + | "premium_lrs" + | "standardssd_lrs"; +/** Alias for ContainerTypeOutput */ +export type ContainerTypeOutput = string | "dockerCompatible" | "criCompatible"; +/** Alias for DiskEncryptionTargetOutput */ +export type DiskEncryptionTargetOutput = string | "osdisk" | "temporarydisk"; +/** Alias for BatchNodePlacementPolicyTypeOutput */ +export type BatchNodePlacementPolicyTypeOutput = string | "regional" | "zonal"; +/** Alias for DiffDiskPlacementOutput */ +export type DiffDiskPlacementOutput = string | "cachedisk"; +/** Alias for SecurityTypesOutput */ +export type SecurityTypesOutput = string | "trustedLaunch"; +/** Alias for DynamicVNetAssignmentScopeOutput */ +export type DynamicVNetAssignmentScopeOutput = string | "none" | "job"; +/** Alias for InboundEndpointProtocolOutput */ +export type InboundEndpointProtocolOutput = string | "tcp" | "udp"; +/** Alias for NetworkSecurityGroupRuleAccessOutput */ +export type NetworkSecurityGroupRuleAccessOutput = string | "allow" | "deny"; +/** Alias for IpAddressProvisioningTypeOutput */ +export type IpAddressProvisioningTypeOutput = + | string + | "batchmanaged" + | "usermanaged" + | "nopublicipaddresses"; +/** Alias for ContainerWorkingDirectoryOutput */ +export type ContainerWorkingDirectoryOutput = + | string + | "taskWorkingDirectory" + | "containerImageDefault"; +/** Alias for AutoUserScopeOutput */ +export type AutoUserScopeOutput = string | "task" | "pool"; +/** Alias for ElevationLevelOutput */ +export type ElevationLevelOutput = string | "nonadmin" | "admin"; +/** Alias for BatchNodeFillTypeOutput */ +export type BatchNodeFillTypeOutput = string | "spread" | "pack"; +/** Alias for LoginModeOutput */ +export type LoginModeOutput = string | "batch" | "interactive"; +/** Alias for BatchNodeCommunicationModeOutput */ +export type BatchNodeCommunicationModeOutput = + | string + | "default" + | "classic" + | "simplified"; +/** Alias for UpgradeModeOutput */ +export type UpgradeModeOutput = string | "automatic" | "manual" | "rolling"; +/** Alias for BatchPoolStateOutput */ +export type BatchPoolStateOutput = string | "active" | "deleting"; +/** Alias for AllocationStateOutput */ +export type AllocationStateOutput = string | "steady" | "resizing" | "stopping"; +/** Alias for BatchPoolIdentityTypeOutput */ +export type BatchPoolIdentityTypeOutput = string | "UserAssigned" | "None"; +/** Alias for OSTypeOutput */ +export type OSTypeOutput = string | "linux" | "windows"; +/** Alias for ImageVerificationTypeOutput */ +export type ImageVerificationTypeOutput = string | "verified" | "unverified"; +/** Alias for BatchJobStateOutput */ +export type BatchJobStateOutput = + | string + | "active" + | "disabling" + | "disabled" + | "enabling" + | "terminating" + | "completed" + | "deleting"; +/** Alias for OutputFileUploadConditionOutput */ +export type OutputFileUploadConditionOutput = + | string + | "tasksuccess" + | "taskfailure" + | "taskcompletion"; +/** Alias for AccessScopeOutput */ +export type AccessScopeOutput = string | "job"; +/** Alias for BatchPoolLifetimeOptionOutput */ +export type BatchPoolLifetimeOptionOutput = string | "jobschedule" | "job"; +/** Alias for OnAllBatchTasksCompleteOutput */ +export type OnAllBatchTasksCompleteOutput = + | string + | "noaction" + | "terminatejob"; +/** Alias for OnBatchTaskFailureOutput */ +export type OnBatchTaskFailureOutput = + | string + | "noaction" + | "performexitoptionsjobaction"; +/** Alias for ErrorCategoryOutput */ +export type ErrorCategoryOutput = string | "usererror" | "servererror"; +/** Alias for BatchJobPreparationTaskStateOutput */ +export type BatchJobPreparationTaskStateOutput = + | string + | "running" + | "completed"; +/** Alias for BatchTaskExecutionResultOutput */ +export type BatchTaskExecutionResultOutput = string | "success" | "failure"; +/** Alias for BatchJobReleaseTaskStateOutput */ +export type BatchJobReleaseTaskStateOutput = string | "running" | "completed"; +/** Alias for BatchJobScheduleStateOutput */ +export type BatchJobScheduleStateOutput = + | string + | "active" + | "completed" + | "disabled" + | "terminating" + | "deleting"; +/** Alias for BatchJobActionOutput */ +export type BatchJobActionOutput = string | "none" | "disable" | "terminate"; +/** Alias for DependencyActionOutput */ +export type DependencyActionOutput = string | "satisfy" | "block"; +/** Alias for BatchTaskStateOutput */ +export type BatchTaskStateOutput = + | string + | "active" + | "preparing" + | "running" + | "completed"; +/** Alias for BatchTaskAddStatusOutput */ +export type BatchTaskAddStatusOutput = + | string + | "success" + | "clienterror" + | "servererror"; +/** Alias for BatchSubtaskStateOutput */ +export type BatchSubtaskStateOutput = + | string + | "preparing" + | "running" + | "completed"; +/** Alias for BatchNodeStateOutput */ +export type BatchNodeStateOutput = + | string + | "idle" + | "rebooting" + | "reimaging" + | "running" + | "unusable" + | "creating" + | "starting" + | "waitingforstarttask" + | "starttaskfailed" + | "unknown" + | "leavingpool" + | "offline" + | "preempted" + | "upgradingos"; +/** Alias for SchedulingStateOutput */ +export type SchedulingStateOutput = string | "enabled" | "disabled"; +/** Alias for BatchStartTaskStateOutput */ +export type BatchStartTaskStateOutput = string | "running" | "completed"; +/** Alias for StatusLevelTypesOutput */ +export type StatusLevelTypesOutput = string | "Error" | "Info" | "Warning"; diff --git a/packages/service/src/internal/batch-rest/generated/src/paginateHelper.ts b/packages/service/src/internal/batch-rest/generated/src/paginateHelper.ts index 95baa6a40..3fde5021f 100644 --- a/packages/service/src/internal/batch-rest/generated/src/paginateHelper.ts +++ b/packages/service/src/internal/batch-rest/generated/src/paginateHelper.ts @@ -22,7 +22,7 @@ export type GetArrayType = T extends Array ? TData : never; */ export type GetPage = ( pageLink: string, - maxPageSize?: number + maxPageSize?: number, ) => Promise<{ page: TPage; nextPageLink?: string; @@ -61,7 +61,7 @@ export type PaginateReturn = TResult extends { export function paginate( client: Client, initialResponse: TResponse, - options: PagingOptions = {} + options: PagingOptions = {}, ): PagedAsyncIterableIterator> { // Extract element type from initial response type TElement = PaginateReturn; @@ -106,7 +106,7 @@ function getNextLink(body: unknown, nextLinkName?: string): string | undefined { if (typeof nextLink !== "string" && typeof nextLink !== "undefined") { throw new Error( - `Body Property ${nextLinkName} should be a string or undefined` + `Body Property ${nextLinkName} should be a string or undefined`, ); } @@ -124,7 +124,7 @@ function getElements(body: unknown, itemName: string): T[] { // 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}` + `Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}`, ); } @@ -150,7 +150,7 @@ function checkPagingRequest(response: PathUncheckedResponse): void { if (!Http2xxStatusCodes.includes(response.status)) { throw createRestError( `Pagination failed with unexpected statusCode ${response.status}`, - response + response, ); } } @@ -192,7 +192,7 @@ function getPaginationProperties(initialResponse: PathUncheckedResponse) { throw new Error( `Couldn't paginate response\n Body doesn't contain an array property with name: ${[ ...itemNames, - ].join(" OR ")}` + ].join(" OR ")}`, ); } diff --git a/packages/service/src/internal/batch-rest/generated/src/parameters.ts b/packages/service/src/internal/batch-rest/generated/src/parameters.ts index 06b251179..8020b6f69 100644 --- a/packages/service/src/internal/batch-rest/generated/src/parameters.ts +++ b/packages/service/src/internal/batch-rest/generated/src/parameters.ts @@ -4,32 +4,30 @@ import { RawHttpHeadersInput } from "@azure/core-rest-pipeline"; import { RequestParameters } from "@azure-rest/core-client"; import { - BatchPoolCreateParameters, - BatchPoolUpdateParameters, - BatchPoolEnableAutoScaleParameters, - BatchPoolEvaluateAutoScaleParameters, - BatchPoolResizeParameters, - BatchPoolReplaceParameters, - BatchNodeRemoveParameters, - BatchJobUpdateParameters, + BatchPoolCreateContent, + BatchPoolUpdateContent, + BatchPoolEnableAutoScaleContent, + BatchPoolEvaluateAutoScaleContent, + BatchPoolResizeContent, + BatchPoolReplaceContent, + BatchNodeRemoveContent, + BatchJobUpdateContent, BatchJob, - BatchJobDisableParameters, - BatchJobTerminateParameters, - BatchJobCreateParameters, - BatchCertificate, - BatchJobScheduleUpdateParameters, + BatchJobDisableContent, + BatchJobTerminateContent, + BatchJobCreateContent, + BatchJobScheduleUpdateContent, BatchJobSchedule, - BatchJobScheduleCreateParameters, - BatchTaskCreateParameters, - BatchTaskCollection, + BatchJobScheduleCreateContent, + BatchTaskCreateContent, + BatchTaskGroup, BatchTask, - BatchNodeUserCreateParameters, - BatchNodeUserUpdateParameters, - BatchNodeRebootParameters, - BatchNodeReimageParameters, - BatchNodeDisableSchedulingParameters, - UploadBatchServiceLogsParameters, -} from "./models"; + BatchNodeUserCreateContent, + BatchNodeUserUpdateContent, + BatchNodeRebootContent, + BatchNodeDisableSchedulingContent, + UploadBatchServiceLogsContent, +} from "./models.js"; export interface ListApplicationsHeaders { /** @@ -48,10 +46,7 @@ export interface ListApplicationsHeaders { } export interface ListApplicationsQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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 @@ -89,10 +84,7 @@ export interface GetApplicationHeaders { } export interface GetApplicationQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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; } @@ -125,10 +117,7 @@ export interface ListPoolUsageMetricsHeaders { } export interface ListPoolUsageMetricsQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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 @@ -184,14 +173,11 @@ export interface CreatePoolHeaders { export interface CreatePoolBodyParam { /** The Pool to be created. */ - body: BatchPoolCreateParameters; + body: BatchPoolCreateContent; } export interface CreatePoolQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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; } @@ -231,10 +217,7 @@ export interface ListPoolsHeaders { } export interface ListPoolsQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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 @@ -305,10 +288,7 @@ export interface DeletePoolHeaders { } export interface DeletePoolQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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; } @@ -365,10 +345,7 @@ export interface PoolExistsHeaders { } export interface PoolExistsQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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; } @@ -425,10 +402,7 @@ export interface GetPoolHeaders { } export interface GetPoolQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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[]; @@ -490,14 +464,11 @@ export interface UpdatePoolHeaders { export interface UpdatePoolBodyParam { /** The pool properties to update. */ - body: BatchPoolUpdateParameters; + body: BatchPoolUpdateContent; } export interface UpdatePoolQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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; } @@ -537,10 +508,7 @@ export interface DisablePoolAutoScaleHeaders { } export interface DisablePoolAutoScaleQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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; } @@ -598,14 +566,11 @@ export interface EnablePoolAutoScaleHeaders { export interface EnablePoolAutoScaleBodyParam { /** The options to use for enabling automatic scaling. */ - body: BatchPoolEnableAutoScaleParameters; + body: BatchPoolEnableAutoScaleContent; } export interface EnablePoolAutoScaleQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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; } @@ -646,14 +611,11 @@ export interface EvaluatePoolAutoScaleHeaders { export interface EvaluatePoolAutoScaleBodyParam { /** The options to use for evaluating the automatic scaling formula. */ - body: BatchPoolEvaluateAutoScaleParameters; + body: BatchPoolEvaluateAutoScaleContent; } export interface EvaluatePoolAutoScaleQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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; } @@ -718,14 +680,11 @@ export interface ResizePoolHeaders { export interface ResizePoolBodyParam { /** The options to use for resizing the pool. */ - body: BatchPoolResizeParameters; + body: BatchPoolResizeContent; } export interface ResizePoolQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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; } @@ -789,10 +748,7 @@ export interface StopPoolResizeHeaders { } export interface StopPoolResizeQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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; } @@ -826,14 +782,11 @@ export interface ReplacePoolPropertiesHeaders { export interface ReplacePoolPropertiesBodyParam { /** The options to use for replacing properties on the pool. */ - body: BatchPoolReplaceParameters; + body: BatchPoolReplaceContent; } export interface ReplacePoolPropertiesQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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; } @@ -898,14 +851,11 @@ export interface RemoveNodesHeaders { export interface RemoveNodesBodyParam { /** The options to use for removing the node. */ - body: BatchNodeRemoveParameters; + body: BatchNodeRemoveContent; } export interface RemoveNodesQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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; } @@ -945,10 +895,7 @@ export interface ListSupportedImagesHeaders { } export interface ListSupportedImagesQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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 @@ -991,10 +938,7 @@ export interface ListPoolNodeCountsHeaders { } export interface ListPoolNodeCountsQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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 @@ -1061,10 +1005,7 @@ export interface DeleteJobHeaders { } export interface DeleteJobQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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; } @@ -1121,10 +1062,7 @@ export interface GetJobHeaders { } export interface GetJobQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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[]; @@ -1186,14 +1124,11 @@ export interface UpdateJobHeaders { export interface UpdateJobBodyParam { /** The options to use for updating the Job. */ - body: BatchJobUpdateParameters; + body: BatchJobUpdateContent; } export interface UpdateJobQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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; } @@ -1262,10 +1197,7 @@ export interface ReplaceJobBodyParam { } export interface ReplaceJobQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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; } @@ -1330,14 +1262,11 @@ export interface DisableJobHeaders { export interface DisableJobBodyParam { /** The options to use for disabling the Job. */ - body: BatchJobDisableParameters; + body: BatchJobDisableContent; } export interface DisableJobQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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; } @@ -1401,10 +1330,7 @@ export interface EnableJobHeaders { } export interface EnableJobQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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; } @@ -1462,14 +1388,11 @@ export interface TerminateJobHeaders { export interface TerminateJobBodyParam { /** The options to use for terminating the Job. */ - body?: BatchJobTerminateParameters; + body?: BatchJobTerminateContent; } export interface TerminateJobQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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; } @@ -1510,14 +1433,11 @@ export interface CreateJobHeaders { export interface CreateJobBodyParam { /** The Job to be created. */ - body: BatchJobCreateParameters; + body: BatchJobCreateContent; } export interface CreateJobQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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; } @@ -1557,10 +1477,7 @@ export interface ListJobsHeaders { } export interface ListJobsQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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 @@ -1607,10 +1524,7 @@ export interface ListJobsFromScheduleHeaders { } export interface ListJobsFromScheduleQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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 @@ -1657,10 +1571,7 @@ export interface ListJobPreparationAndReleaseTaskStatusHeaders { } export interface ListJobPreparationAndReleaseTaskStatusQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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 @@ -1706,10 +1617,7 @@ export interface GetJobTaskCountsHeaders { } export interface GetJobTaskCountsQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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; } @@ -1725,213 +1633,6 @@ export type GetJobTaskCountsParameters = GetJobTaskCountsQueryParam & GetJobTaskCountsHeaderParam & RequestParameters; -export interface CreateCertificateHeaders { - /** - * 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 CreateCertificateBodyParam { - /** The Certificate to be created. */ - body: BatchCertificate; -} - -export interface CreateCertificateQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ - timeOut?: number; -} - -export interface CreateCertificateQueryParam { - queryParameters?: CreateCertificateQueryParamProperties; -} - -export interface CreateCertificateHeaderParam { - headers?: RawHttpHeadersInput & CreateCertificateHeaders; -} - -export interface CreateCertificateMediaTypesParam { - /** Type of content */ - contentType: "application/json; odata=minimalmetadata"; -} - -export type CreateCertificateParameters = CreateCertificateQueryParam & - CreateCertificateHeaderParam & - CreateCertificateMediaTypesParam & - CreateCertificateBodyParam & - RequestParameters; - -export interface ListCertificatesHeaders { - /** - * 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 ListCertificatesQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ - 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-certificates. - */ - $filter?: string; - /** An OData $select clause. */ - $select?: string[]; -} - -export interface ListCertificatesQueryParam { - queryParameters?: ListCertificatesQueryParamProperties; -} - -export interface ListCertificatesHeaderParam { - headers?: RawHttpHeadersInput & ListCertificatesHeaders; -} - -export type ListCertificatesParameters = ListCertificatesQueryParam & - ListCertificatesHeaderParam & - RequestParameters; - -export interface CancelCertificateDeletionHeaders { - /** - * 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 CancelCertificateDeletionQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ - timeOut?: number; -} - -export interface CancelCertificateDeletionQueryParam { - queryParameters?: CancelCertificateDeletionQueryParamProperties; -} - -export interface CancelCertificateDeletionHeaderParam { - headers?: RawHttpHeadersInput & CancelCertificateDeletionHeaders; -} - -export type CancelCertificateDeletionParameters = - CancelCertificateDeletionQueryParam & - CancelCertificateDeletionHeaderParam & - RequestParameters; - -export interface DeleteCertificateHeaders { - /** - * 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 DeleteCertificateQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ - timeOut?: number; -} - -export interface DeleteCertificateQueryParam { - queryParameters?: DeleteCertificateQueryParamProperties; -} - -export interface DeleteCertificateHeaderParam { - headers?: RawHttpHeadersInput & DeleteCertificateHeaders; -} - -export type DeleteCertificateParameters = DeleteCertificateQueryParam & - DeleteCertificateHeaderParam & - RequestParameters; - -export interface GetCertificateHeaders { - /** - * 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 GetCertificateQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ - timeOut?: number; - /** An OData $select clause. */ - $select?: string[]; -} - -export interface GetCertificateQueryParam { - queryParameters?: GetCertificateQueryParamProperties; -} - -export interface GetCertificateHeaderParam { - headers?: RawHttpHeadersInput & GetCertificateHeaders; -} - -export type GetCertificateParameters = GetCertificateQueryParam & - GetCertificateHeaderParam & - RequestParameters; - export interface JobScheduleExistsHeaders { /** * The caller-generated request identity, in the form of a GUID with no decoration @@ -1973,10 +1674,7 @@ export interface JobScheduleExistsHeaders { } export interface JobScheduleExistsQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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; } @@ -2033,10 +1731,7 @@ export interface DeleteJobScheduleHeaders { } export interface DeleteJobScheduleQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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; } @@ -2093,10 +1788,7 @@ export interface GetJobScheduleHeaders { } export interface GetJobScheduleQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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[]; @@ -2158,14 +1850,11 @@ export interface UpdateJobScheduleHeaders { export interface UpdateJobScheduleBodyParam { /** The options to use for updating the Job Schedule. */ - body: BatchJobScheduleUpdateParameters; + body: BatchJobScheduleUpdateContent; } export interface UpdateJobScheduleQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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; } @@ -2234,10 +1923,7 @@ export interface ReplaceJobScheduleBodyParam { } export interface ReplaceJobScheduleQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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; } @@ -2301,10 +1987,7 @@ export interface DisableJobScheduleHeaders { } export interface DisableJobScheduleQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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; } @@ -2361,10 +2044,7 @@ export interface EnableJobScheduleHeaders { } export interface EnableJobScheduleQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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; } @@ -2421,10 +2101,7 @@ export interface TerminateJobScheduleHeaders { } export interface TerminateJobScheduleQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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; } @@ -2458,14 +2135,11 @@ export interface CreateJobScheduleHeaders { export interface CreateJobScheduleBodyParam { /** The Job Schedule to be created. */ - body: BatchJobScheduleCreateParameters; + body: BatchJobScheduleCreateContent; } export interface CreateJobScheduleQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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; } @@ -2505,10 +2179,7 @@ export interface ListJobSchedulesHeaders { } export interface ListJobSchedulesQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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 @@ -2556,14 +2227,11 @@ export interface CreateTaskHeaders { export interface CreateTaskBodyParam { /** The Task to be created. */ - body: BatchTaskCreateParameters; + body: BatchTaskCreateContent; } export interface CreateTaskQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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; } @@ -2603,10 +2271,7 @@ export interface ListTasksHeaders { } export interface ListTasksQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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 @@ -2654,14 +2319,11 @@ export interface CreateTaskCollectionHeaders { export interface CreateTaskCollectionBodyParam { /** The Tasks to be added. */ - body: BatchTaskCollection; + body: BatchTaskGroup; } export interface CreateTaskCollectionQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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; } @@ -2725,10 +2387,7 @@ export interface DeleteTaskHeaders { } export interface DeleteTaskQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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; } @@ -2785,10 +2444,7 @@ export interface GetTaskHeaders { } export interface GetTaskQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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[]; @@ -2854,10 +2510,7 @@ export interface ReplaceTaskBodyParam { } export interface ReplaceTaskQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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; } @@ -2897,10 +2550,7 @@ export interface ListSubTasksHeaders { } export interface ListSubTasksQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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[]; @@ -2959,10 +2609,7 @@ export interface TerminateTaskHeaders { } export interface TerminateTaskQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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; } @@ -3019,10 +2666,7 @@ export interface ReactivateTaskHeaders { } export interface ReactivateTaskQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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; } @@ -3055,10 +2699,7 @@ export interface DeleteTaskFileHeaders { } export interface DeleteTaskFileQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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 @@ -3115,10 +2756,7 @@ export interface GetTaskFileHeaders { } export interface GetTaskFileQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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; } @@ -3163,10 +2801,7 @@ export interface GetTaskFilePropertiesHeaders { } export interface GetTaskFilePropertiesQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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; } @@ -3199,10 +2834,7 @@ export interface ListTaskFilesHeaders { } export interface ListTaskFilesQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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 @@ -3251,14 +2883,11 @@ export interface CreateNodeUserHeaders { export interface CreateNodeUserBodyParam { /** The options to use for creating the user. */ - body: BatchNodeUserCreateParameters; + body: BatchNodeUserCreateContent; } export interface CreateNodeUserQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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; } @@ -3298,10 +2927,7 @@ export interface DeleteNodeUserHeaders { } export interface DeleteNodeUserQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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; } @@ -3335,14 +2961,11 @@ export interface ReplaceNodeUserHeaders { export interface ReplaceNodeUserBodyParam { /** The options to use for updating the user. */ - body: BatchNodeUserUpdateParameters; + body: BatchNodeUserUpdateContent; } export interface ReplaceNodeUserQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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; } @@ -3382,10 +3005,7 @@ export interface GetNodeHeaders { } export interface GetNodeQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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[]; @@ -3421,14 +3041,11 @@ export interface RebootNodeHeaders { export interface RebootNodeBodyParam { /** The options to use for rebooting the Compute Node. */ - body?: BatchNodeRebootParameters; + body?: BatchNodeRebootContent; } export interface RebootNodeQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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; } @@ -3451,54 +3068,6 @@ export type RebootNodeParameters = RebootNodeQueryParam & RebootNodeBodyParam & RequestParameters; -export interface ReimageNodeHeaders { - /** - * 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 ReimageNodeBodyParam { - /** The options to use for reimaging the Compute Node. */ - body?: BatchNodeReimageParameters; -} - -export interface ReimageNodeQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ - timeOut?: number; -} - -export interface ReimageNodeQueryParam { - queryParameters?: ReimageNodeQueryParamProperties; -} - -export interface ReimageNodeHeaderParam { - headers?: RawHttpHeadersInput & ReimageNodeHeaders; -} - -export interface ReimageNodeMediaTypesParam { - /** Type of content */ - contentType: "application/json; odata=minimalmetadata"; -} - -export type ReimageNodeParameters = ReimageNodeQueryParam & - ReimageNodeHeaderParam & - ReimageNodeMediaTypesParam & - ReimageNodeBodyParam & - RequestParameters; - export interface DisableNodeSchedulingHeaders { /** * The caller-generated request identity, in the form of a GUID with no decoration @@ -3517,14 +3086,11 @@ export interface DisableNodeSchedulingHeaders { export interface DisableNodeSchedulingBodyParam { /** The options to use for disabling scheduling on the Compute Node. */ - body?: BatchNodeDisableSchedulingParameters; + body?: BatchNodeDisableSchedulingContent; } export interface DisableNodeSchedulingQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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; } @@ -3564,10 +3130,7 @@ export interface EnableNodeSchedulingHeaders { } export interface EnableNodeSchedulingQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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; } @@ -3600,10 +3163,7 @@ export interface GetNodeRemoteLoginSettingsHeaders { } export interface GetNodeRemoteLoginSettingsQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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; } @@ -3620,43 +3180,6 @@ export type GetNodeRemoteLoginSettingsParameters = GetNodeRemoteLoginSettingsHeaderParam & RequestParameters; -export interface GetNodeRemoteDesktopFileHeaders { - /** - * 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 GetNodeRemoteDesktopFileQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ - timeOut?: number; -} - -export interface GetNodeRemoteDesktopFileQueryParam { - queryParameters?: GetNodeRemoteDesktopFileQueryParamProperties; -} - -export interface GetNodeRemoteDesktopFileHeaderParam { - headers?: RawHttpHeadersInput & GetNodeRemoteDesktopFileHeaders; -} - -export type GetNodeRemoteDesktopFileParameters = - GetNodeRemoteDesktopFileQueryParam & - GetNodeRemoteDesktopFileHeaderParam & - RequestParameters; - export interface UploadNodeLogsHeaders { /** * The caller-generated request identity, in the form of a GUID with no decoration @@ -3675,14 +3198,11 @@ export interface UploadNodeLogsHeaders { export interface UploadNodeLogsBodyParam { /** The Azure Batch service log files upload options. */ - body: UploadBatchServiceLogsParameters; + body: UploadBatchServiceLogsContent; } export interface UploadNodeLogsQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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; } @@ -3722,10 +3242,7 @@ export interface ListNodesHeaders { } export interface ListNodesQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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 @@ -3770,10 +3287,7 @@ export interface GetNodeExtensionHeaders { } export interface GetNodeExtensionQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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[]; @@ -3808,10 +3322,7 @@ export interface ListNodeExtensionsHeaders { } export interface ListNodeExtensionsQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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 @@ -3851,10 +3362,7 @@ export interface DeleteNodeFileHeaders { } export interface DeleteNodeFileQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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 @@ -3911,10 +3419,7 @@ export interface GetNodeFileHeaders { } export interface GetNodeFileQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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; } @@ -3959,10 +3464,7 @@ export interface GetNodeFilePropertiesHeaders { } export interface GetNodeFilePropertiesQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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; } @@ -3995,10 +3497,7 @@ export interface ListNodeFilesHeaders { } export interface ListNodeFilesQueryParamProperties { - /** - * Sets the maximum time that the server can spend processing the request, - * in seconds. The default is 30 seconds. - */ + /** 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 diff --git a/packages/service/src/internal/batch-rest/generated/src/responses.ts b/packages/service/src/internal/batch-rest/generated/src/responses.ts index 0a835fa2e..693ba8239 100644 --- a/packages/service/src/internal/batch-rest/generated/src/responses.ts +++ b/packages/service/src/internal/batch-rest/generated/src/responses.ts @@ -17,8 +17,6 @@ import { BatchJobListResultOutput, BatchJobPreparationAndReleaseTaskStatusListResultOutput, BatchTaskCountsResultOutput, - BatchCertificateListResultOutput, - BatchCertificateOutput, BatchJobScheduleOutput, BatchJobScheduleListResultOutput, BatchTaskListResultOutput, @@ -32,17 +30,17 @@ import { BatchNodeListResultOutput, BatchNodeVMExtensionOutput, BatchNodeVMExtensionListResultOutput, -} from "./outputModels"; +} from "./outputModels.js"; export interface ListApplications200Headers { - /** 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 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. */ @@ -58,14 +56,14 @@ export interface ListApplicationsDefaultResponse extends HttpResponse { } export interface GetApplication200Headers { - /** 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 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. */ @@ -81,14 +79,14 @@ export interface GetApplicationDefaultResponse extends HttpResponse { } export interface ListPoolUsageMetrics200Headers { - /** 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 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. */ @@ -104,16 +102,16 @@ export interface ListPoolUsageMetricsDefaultResponse extends HttpResponse { } export interface CreatePool201Headers { - /** 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 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 OData ID of the resource to which the request applied. */ - dataserviceid: 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. */ @@ -128,14 +126,14 @@ export interface CreatePoolDefaultResponse extends HttpResponse { } export interface ListPools200Headers { - /** 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 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. */ @@ -169,14 +167,14 @@ export interface DeletePoolDefaultResponse extends HttpResponse { } export interface PoolExists200Headers { - /** 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 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. */ @@ -196,14 +194,14 @@ export interface PoolExistsDefaultResponse extends HttpResponse { } export interface GetPool200Headers { - /** 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 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. */ @@ -219,16 +217,16 @@ export interface GetPoolDefaultResponse extends HttpResponse { } export interface UpdatePool200Headers { - /** 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 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 OData ID of the resource to which the request applied. */ - dataserviceid: 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. */ @@ -243,16 +241,16 @@ export interface UpdatePoolDefaultResponse extends HttpResponse { } export interface DisablePoolAutoScale200Headers { - /** 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 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 OData ID of the resource to which the request applied. */ - dataserviceid: 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. */ @@ -267,16 +265,16 @@ export interface DisablePoolAutoScaleDefaultResponse extends HttpResponse { } export interface EnablePoolAutoScale200Headers { - /** 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 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 OData ID of the resource to which the request applied. */ - dataserviceid: 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. */ @@ -291,16 +289,16 @@ export interface EnablePoolAutoScaleDefaultResponse extends HttpResponse { } export interface EvaluatePoolAutoScale200Headers { - /** 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 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 OData ID of the resource to which the request applied. */ - dataserviceid: 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. */ @@ -316,16 +314,16 @@ export interface EvaluatePoolAutoScaleDefaultResponse extends HttpResponse { } export interface ResizePool202Headers { - /** 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 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 OData ID of the resource to which the request applied. */ - dataserviceid: 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. */ @@ -340,16 +338,16 @@ export interface ResizePoolDefaultResponse extends HttpResponse { } export interface StopPoolResize202Headers { - /** 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 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 OData ID of the resource to which the request applied. */ - dataserviceid: 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. */ @@ -364,16 +362,16 @@ export interface StopPoolResizeDefaultResponse extends HttpResponse { } export interface ReplacePoolProperties204Headers { - /** 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 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 OData ID of the resource to which the request applied. */ - dataserviceid: 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. */ @@ -388,16 +386,16 @@ export interface ReplacePoolPropertiesDefaultResponse extends HttpResponse { } export interface RemoveNodes202Headers { - /** 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 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 OData ID of the resource to which the request applied. */ - dataserviceid: 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. */ @@ -412,14 +410,14 @@ export interface RemoveNodesDefaultResponse extends HttpResponse { } export interface ListSupportedImages200Headers { - /** 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 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. */ @@ -435,14 +433,14 @@ export interface ListSupportedImagesDefaultResponse extends HttpResponse { } export interface ListPoolNodeCounts200Headers { - /** 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 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. */ @@ -476,14 +474,14 @@ export interface DeleteJobDefaultResponse extends HttpResponse { } export interface GetJob200Headers { - /** 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 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. */ @@ -499,16 +497,16 @@ export interface GetJobDefaultResponse extends HttpResponse { } export interface UpdateJob200Headers { - /** 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 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 OData ID of the resource to which the request applied. */ - dataserviceid: 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. */ @@ -523,16 +521,16 @@ export interface UpdateJobDefaultResponse extends HttpResponse { } export interface ReplaceJob200Headers { - /** 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 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 OData ID of the resource to which the request applied. */ - dataserviceid: 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. */ @@ -547,16 +545,16 @@ export interface ReplaceJobDefaultResponse extends HttpResponse { } export interface DisableJob202Headers { - /** 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 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 OData ID of the resource to which the request applied. */ - dataserviceid: 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. */ @@ -571,16 +569,16 @@ export interface DisableJobDefaultResponse extends HttpResponse { } export interface EnableJob202Headers { - /** 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 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 OData ID of the resource to which the request applied. */ - dataserviceid: 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. */ @@ -595,16 +593,16 @@ export interface EnableJobDefaultResponse extends HttpResponse { } export interface TerminateJob202Headers { - /** 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 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 OData ID of the resource to which the request applied. */ - dataserviceid: 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. */ @@ -619,16 +617,16 @@ export interface TerminateJobDefaultResponse extends HttpResponse { } export interface CreateJob201Headers { - /** 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 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 OData ID of the resource to which the request applied. */ - dataserviceid: 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. */ @@ -643,14 +641,14 @@ export interface CreateJobDefaultResponse extends HttpResponse { } export interface ListJobs200Headers { - /** 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 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. */ @@ -666,14 +664,14 @@ export interface ListJobsDefaultResponse extends HttpResponse { } export interface ListJobsFromSchedule200Headers { - /** 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 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. */ @@ -689,14 +687,14 @@ export interface ListJobsFromScheduleDefaultResponse extends HttpResponse { } export interface ListJobPreparationAndReleaseTaskStatus200Headers { - /** 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 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. */ @@ -714,153 +712,37 @@ export interface ListJobPreparationAndReleaseTaskStatusDefaultResponse } export interface GetJobTaskCounts200Headers { - /** 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 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 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 CreateCertificate201Headers { - /** 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 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 OData ID of the resource to which the request applied. */ - dataserviceid: string; -} - -/** The request has succeeded and a new resource has been created as a result. */ -export interface CreateCertificate201Response extends HttpResponse { - status: "201"; - headers: RawHttpHeaders & CreateCertificate201Headers; -} - -export interface CreateCertificateDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface ListCertificates200Headers { /** 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 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 request has succeeded. */ -export interface ListCertificates200Response extends HttpResponse { +export interface GetJobTaskCounts200Response extends HttpResponse { status: "200"; - body: BatchCertificateListResultOutput; - headers: RawHttpHeaders & ListCertificates200Headers; -} - -export interface ListCertificatesDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface CancelCertificateDeletion204Headers { - /** 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 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 OData ID of the resource to which the request applied. */ - dataserviceid: string; -} - -/** There is no content to send for this request, but the headers may be useful. */ -export interface CancelCertificateDeletion204Response extends HttpResponse { - status: "204"; - headers: RawHttpHeaders & CancelCertificateDeletion204Headers; -} - -export interface CancelCertificateDeletionDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface DeleteCertificate202Headers { - /** 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 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 request has been accepted for processing, but processing has not yet completed. */ -export interface DeleteCertificate202Response extends HttpResponse { - status: "202"; - headers: RawHttpHeaders & DeleteCertificate202Headers; + body: BatchTaskCountsResultOutput; + headers: RawHttpHeaders & GetJobTaskCounts200Headers; } -export interface DeleteCertificateDefaultResponse extends HttpResponse { +export interface GetJobTaskCountsDefaultResponse extends HttpResponse { status: string; body: BatchErrorOutput; } -export interface GetCertificate200Headers { - /** 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; +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 request has succeeded. */ -export interface GetCertificate200Response extends HttpResponse { - status: "200"; - body: BatchCertificateOutput; - headers: RawHttpHeaders & GetCertificate200Headers; -} - -export interface GetCertificateDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface JobScheduleExists200Headers { /** 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 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 request has succeeded. */ @@ -898,14 +780,14 @@ export interface DeleteJobScheduleDefaultResponse extends HttpResponse { } export interface GetJobSchedule200Headers { - /** 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 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. */ @@ -921,16 +803,16 @@ export interface GetJobScheduleDefaultResponse extends HttpResponse { } export interface UpdateJobSchedule200Headers { - /** 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 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 OData ID of the resource to which the request applied. */ - dataserviceid: 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. */ @@ -945,16 +827,16 @@ export interface UpdateJobScheduleDefaultResponse extends HttpResponse { } export interface ReplaceJobSchedule200Headers { - /** 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 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 OData ID of the resource to which the request applied. */ - dataserviceid: 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. */ @@ -969,16 +851,16 @@ export interface ReplaceJobScheduleDefaultResponse extends HttpResponse { } export interface DisableJobSchedule204Headers { - /** 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 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 OData ID of the resource to which the request applied. */ - dataserviceid: 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. */ @@ -993,16 +875,16 @@ export interface DisableJobScheduleDefaultResponse extends HttpResponse { } export interface EnableJobSchedule204Headers { - /** 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 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 OData ID of the resource to which the request applied. */ - dataserviceid: 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. */ @@ -1017,16 +899,16 @@ export interface EnableJobScheduleDefaultResponse extends HttpResponse { } export interface TerminateJobSchedule202Headers { - /** 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 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 OData ID of the resource to which the request applied. */ - dataserviceid: 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. */ @@ -1041,16 +923,16 @@ export interface TerminateJobScheduleDefaultResponse extends HttpResponse { } export interface CreateJobSchedule201Headers { - /** 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 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 OData ID of the resource to which the request applied. */ - dataserviceid: 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. */ @@ -1065,14 +947,14 @@ export interface CreateJobScheduleDefaultResponse extends HttpResponse { } export interface ListJobSchedules200Headers { - /** 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 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. */ @@ -1088,16 +970,16 @@ export interface ListJobSchedulesDefaultResponse extends HttpResponse { } export interface CreateTask201Headers { - /** 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 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 OData ID of the resource to which the request applied. */ - dataserviceid: 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. */ @@ -1112,14 +994,14 @@ export interface CreateTaskDefaultResponse extends HttpResponse { } export interface ListTasks200Headers { - /** 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 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. */ @@ -1135,14 +1017,14 @@ export interface ListTasksDefaultResponse extends HttpResponse { } export interface CreateTaskCollection200Headers { - /** 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 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. */ @@ -1176,16 +1058,16 @@ export interface DeleteTaskDefaultResponse extends HttpResponse { } export interface GetTask200Headers { - /** 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 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 OData ID of the resource to which the request applied. */ - dataserviceid: 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. */ @@ -1201,16 +1083,16 @@ export interface GetTaskDefaultResponse extends HttpResponse { } export interface ReplaceTask200Headers { - /** 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 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 OData ID of the resource to which the request applied. */ - dataserviceid: 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. */ @@ -1225,14 +1107,14 @@ export interface ReplaceTaskDefaultResponse extends HttpResponse { } export interface ListSubTasks200Headers { - /** 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 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. */ @@ -1248,16 +1130,16 @@ export interface ListSubTasksDefaultResponse extends HttpResponse { } export interface TerminateTask204Headers { - /** 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 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 OData ID of the resource to which the request applied. */ - dataserviceid: 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. */ @@ -1272,16 +1154,16 @@ export interface TerminateTaskDefaultResponse extends HttpResponse { } export interface ReactivateTask204Headers { - /** 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 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 OData ID of the resource to which the request applied. */ - dataserviceid: 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. */ @@ -1314,24 +1196,24 @@ export interface DeleteTaskFileDefaultResponse extends HttpResponse { } export interface GetTaskFile200Headers { - /** 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 length of the file. */ + "content-length": number; /** 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 file creation time. */ - "ocp-creation-time"?: 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 URL of the file. */ - "ocp-batch-file-url": string; /** The file mode attribute in octal format. */ "ocp-batch-file-mode": string; - /** The length of the file. */ - "content-length": number; + /** 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. */ @@ -1348,24 +1230,24 @@ export interface GetTaskFileDefaultResponse extends HttpResponse { } export interface GetTaskFileProperties200Headers { - /** 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 length of the file. */ + "content-length": number; /** 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 file creation time. */ - "ocp-creation-time"?: 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 URL of the file. */ - "ocp-batch-file-url": string; /** The file mode attribute in octal format. */ "ocp-batch-file-mode": string; - /** The length of the file. */ - "content-length": number; + /** 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. */ @@ -1380,14 +1262,14 @@ export interface GetTaskFilePropertiesDefaultResponse extends HttpResponse { } export interface ListTaskFiles200Headers { - /** 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 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. */ @@ -1403,16 +1285,16 @@ export interface ListTaskFilesDefaultResponse extends HttpResponse { } export interface CreateNodeUser201Headers { - /** 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 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 OData ID of the resource to which the request applied. */ - dataserviceid: 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. */ @@ -1445,16 +1327,16 @@ export interface DeleteNodeUserDefaultResponse extends HttpResponse { } export interface ReplaceNodeUser200Headers { - /** 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 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 OData ID of the resource to which the request applied. */ - dataserviceid: 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. */ @@ -1469,14 +1351,14 @@ export interface ReplaceNodeUserDefaultResponse extends HttpResponse { } export interface GetNode200Headers { - /** 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 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. */ @@ -1492,16 +1374,16 @@ export interface GetNodeDefaultResponse extends HttpResponse { } export interface RebootNode202Headers { - /** 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 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 OData ID of the resource to which the request applied. */ - dataserviceid: 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. */ @@ -1515,41 +1397,17 @@ export interface RebootNodeDefaultResponse extends HttpResponse { body: BatchErrorOutput; } -export interface ReimageNode202Headers { - /** 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; +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 OData ID of the resource to which the request applied. */ - dataserviceid: string; -} - -/** The request has been accepted for processing, but processing has not yet completed. */ -export interface ReimageNode202Response extends HttpResponse { - status: "202"; - headers: RawHttpHeaders & ReimageNode202Headers; -} - -export interface ReimageNodeDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface DisableNodeScheduling200Headers { /** 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 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 OData ID of the resource to which the request applied. */ - dataserviceid: string; } /** The request has succeeded. */ @@ -1564,16 +1422,16 @@ export interface DisableNodeSchedulingDefaultResponse extends HttpResponse { } export interface EnableNodeScheduling200Headers { - /** 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 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 OData ID of the resource to which the request applied. */ - dataserviceid: 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. */ @@ -1588,14 +1446,14 @@ export interface EnableNodeSchedulingDefaultResponse extends HttpResponse { } export interface GetNodeRemoteLoginSettings200Headers { - /** 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 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. */ @@ -1611,38 +1469,15 @@ export interface GetNodeRemoteLoginSettingsDefaultResponse body: BatchErrorOutput; } -export interface GetNodeRemoteDesktopFile200Headers { - /** 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; +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 request has succeeded. */ -export interface GetNodeRemoteDesktopFile200Response extends HttpResponse { - status: "200"; - body: string; - headers: RawHttpHeaders & GetNodeRemoteDesktopFile200Headers; -} - -export interface GetNodeRemoteDesktopFileDefaultResponse extends HttpResponse { - status: string; - body: BatchErrorOutput; -} - -export interface UploadNodeLogs200Headers { /** 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 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 request has succeeded. */ @@ -1658,14 +1493,14 @@ export interface UploadNodeLogsDefaultResponse extends HttpResponse { } export interface ListNodes200Headers { - /** 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 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. */ @@ -1681,14 +1516,14 @@ export interface ListNodesDefaultResponse extends HttpResponse { } export interface GetNodeExtension200Headers { - /** 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 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. */ @@ -1704,14 +1539,14 @@ export interface GetNodeExtensionDefaultResponse extends HttpResponse { } export interface ListNodeExtensions200Headers { - /** 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 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. */ @@ -1745,30 +1580,31 @@ export interface DeleteNodeFileDefaultResponse extends HttpResponse { } export interface GetNodeFile200Headers { - /** 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 length of the file. */ + "content-length": number; /** 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 file creation time. */ - "ocp-creation-time"?: 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 URL of the file. */ - "ocp-batch-file-url": string; /** The file mode attribute in octal format. */ "ocp-batch-file-mode": string; - /** The length of the file. */ - "content-length": number; + /** 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 GetNodeFile200Response extends HttpResponse { status: "200"; - body: string; + /** Value may contain any sequence of octets */ + body: Uint8Array; headers: RawHttpHeaders & GetNodeFile200Headers; } @@ -1778,24 +1614,24 @@ export interface GetNodeFileDefaultResponse extends HttpResponse { } export interface GetNodeFileProperties200Headers { - /** 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 length of the file. */ + "content-length": number; /** 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 file creation time. */ - "ocp-creation-time"?: 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 URL of the file. */ - "ocp-batch-file-url": string; /** The file mode attribute in octal format. */ "ocp-batch-file-mode": string; - /** The length of the file. */ - "content-length": number; + /** 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. */ @@ -1810,14 +1646,14 @@ export interface GetNodeFilePropertiesDefaultResponse extends HttpResponse { } export interface ListNodeFiles200Headers { - /** 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 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. */ diff --git a/packages/service/src/internal/batch-rest/generated/tsp-location.yaml b/packages/service/src/internal/batch-rest/generated/tsp-location.yaml index 520084cd7..ed5de1e9e 100644 --- a/packages/service/src/internal/batch-rest/generated/tsp-location.yaml +++ b/packages/service/src/internal/batch-rest/generated/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/batch/Azure.Batch -commit: e4b9c403b879114eabb38f23071161e5a6cd508e -repo: wiboris/azure-rest-api-specs +commit: 0f8dd4b5c25cb379c87b85a97ddac2e4969da604 +repo: Azure/azure-rest-api-specs additionalDirectories: diff --git a/util/common-config/jest-common.js b/util/common-config/jest-common.js index a83c5ec3e..ab92df244 100644 --- a/util/common-config/jest-common.js +++ b/util/common-config/jest-common.js @@ -45,7 +45,10 @@ module.exports = { ["cobertura", { file: "cobertura.xml" }], ], moduleDirectories: ["src", "node_modules"], - moduleNameMapper: {}, + moduleNameMapper: { + // batch RLC generates import has .js extension, so we need to remove it in test + "(.+)\\.js": "$1", + }, reporters: [ "default", [ From 7e72940eaab5db31c529c872d10f82228e18aab7 Mon Sep 17 00:00:00 2001 From: Brenda Coronel Date: Tue, 25 Jun 2024 15:44:43 -0700 Subject: [PATCH 10/38] TaskList Component passing generated tasks to demo --- package-lock.json | 144 ++++++++++++++++-- package.json | 1 + .../demo/display/task-list/task-list-demo.tsx | 46 ++---- packages/react/src/task/task-list.tsx | 79 ++++++---- .../task/__tests__/fake-task-service.spec.ts | 25 +-- .../service/src/task/fake-task-service.ts | 17 ++- packages/service/src/test-util/fakes.ts | 12 +- 7 files changed, 229 insertions(+), 95 deletions(-) diff --git a/package-lock.json b/package-lock.json index fe1136e5b..36aaa8b4e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,6 +13,7 @@ "@fluentui/azure-themes": "8.6.34", "@fluentui/react": "8.97.2", "@fluentui/react-theme-provider": "0.19.16", + "@mui/base": "^5.0.0-beta.40", "mobx": "^6.3.2", "mobx-react-lite": "^3.2.0", "monaco-editor": "~0.31.0", @@ -397,10 +398,9 @@ } }, "node_modules/@babel/runtime": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.15.tgz", - "integrity": "sha512-T0O+aa+4w0u06iNmapipJXMV4HoUir03hpx3/YqXXhu9xim3w+dVphjFWl1OH8NbZHw5Lbm9k45drDkgq2VNNA==", - "dev": true, + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.7.tgz", + "integrity": "sha512-UwgBRMjJP+xv857DCngvqXI3Iq6J4v0wXmwc6sapg+zyhbwmQX67LUEFrkK5tbyJ30jGuG3ZvWpBiB9LCy1kWw==", "dependencies": { "regenerator-runtime": "^0.14.0" }, @@ -428,6 +428,40 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, + "node_modules/@floating-ui/core": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.6.3.tgz", + "integrity": "sha512-1ZpCvYf788/ZXOhRQGFxnYQOVgeU+pi0i+d0Ow34La7qjIXETi6RNswGVKkA6KcDO8/+Ysu2E/CeUmmeEBDvTg==", + "dependencies": { + "@floating-ui/utils": "^0.2.3" + } + }, + "node_modules/@floating-ui/dom": { + "version": "1.6.6", + "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.6.6.tgz", + "integrity": "sha512-qiTYajAnh3P+38kECeffMSQgbvXty2VB6rS+42iWR4FPIlZjLK84E9qtLnMTLIpPz2znD/TaFqaiavMUrS+Hcw==", + "dependencies": { + "@floating-ui/core": "^1.0.0", + "@floating-ui/utils": "^0.2.3" + } + }, + "node_modules/@floating-ui/react-dom": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.1.1.tgz", + "integrity": "sha512-4h84MJt3CHrtG18mGsXuLCHMrug49d7DFkU0RMIyshRveBeyV2hmV/pDaF2Uxtu8kgq5r46llp5E5FQiR0K2Yg==", + "dependencies": { + "@floating-ui/dom": "^1.0.0" + }, + "peerDependencies": { + "react": ">=16.8.0", + "react-dom": ">=16.8.0" + } + }, + "node_modules/@floating-ui/utils": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.3.tgz", + "integrity": "sha512-XGndio0l5/Gvd6CLIABvsav9HHezgDFFhDfHk1bvLfr9ni8dojqLSvBbotJEjmIwNHL7vK4QzBJTdBRoB+c1ww==" + }, "node_modules/@fluentui/azure-themes": { "version": "8.6.34", "resolved": "https://registry.npmjs.org/@fluentui/azure-themes/-/azure-themes-8.6.34.tgz", @@ -1783,6 +1817,82 @@ "resolved": "https://registry.npmjs.org/@microsoft/load-themed-styles/-/load-themed-styles-1.10.295.tgz", "integrity": "sha512-W+IzEBw8a6LOOfRJM02dTT7BDZijxm+Z7lhtOAz1+y9vQm1Kdz9jlAO+qCEKsfxtUOmKilW8DIRqFw2aUgKeGg==" }, + "node_modules/@mui/base": { + "version": "5.0.0-beta.40", + "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.40.tgz", + "integrity": "sha512-I/lGHztkCzvwlXpjD2+SNmvNQvB4227xBXhISPjEaJUXGImOQ9f3D2Yj/T3KasSI/h0MLWy74X0J6clhPmsRbQ==", + "dependencies": { + "@babel/runtime": "^7.23.9", + "@floating-ui/react-dom": "^2.0.8", + "@mui/types": "^7.2.14", + "@mui/utils": "^5.15.14", + "@popperjs/core": "^2.11.8", + "clsx": "^2.1.0", + "prop-types": "^15.8.1" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui-org" + }, + "peerDependencies": { + "@types/react": "^17.0.0 || ^18.0.0", + "react": "^17.0.0 || ^18.0.0", + "react-dom": "^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@mui/types": { + "version": "7.2.14", + "resolved": "https://registry.npmjs.org/@mui/types/-/types-7.2.14.tgz", + "integrity": "sha512-MZsBZ4q4HfzBsywtXgM1Ksj6HDThtiwmOKUXH1pKYISI9gAVXCNHNpo7TlGoGrBaYWZTdNoirIN7JsQcQUjmQQ==", + "peerDependencies": { + "@types/react": "^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@mui/utils": { + "version": "5.15.20", + "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.15.20.tgz", + "integrity": "sha512-mAbYx0sovrnpAu1zHc3MDIhPqL8RPVC5W5xcO1b7PiSCJPtckIZmBkp8hefamAvUiAV8gpfMOM6Zb+eSisbI2A==", + "dependencies": { + "@babel/runtime": "^7.23.9", + "@types/prop-types": "^15.7.11", + "prop-types": "^15.8.1", + "react-is": "^18.2.0" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui-org" + }, + "peerDependencies": { + "@types/react": "^17.0.0 || ^18.0.0", + "react": "^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@mui/utils/node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==" + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -3303,6 +3413,15 @@ "node": ">=14" } }, + "node_modules/@popperjs/core": { + "version": "2.11.8", + "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", + "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/popperjs" + } + }, "node_modules/@sigstore/bundle": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@sigstore/bundle/-/bundle-1.1.0.tgz", @@ -3627,9 +3746,9 @@ "dev": true }, "node_modules/@types/prop-types": { - "version": "15.7.5", - "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.5.tgz", - "integrity": "sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==" + "version": "15.7.12", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.12.tgz", + "integrity": "sha512-5zvhXYtRNRluoE/jAp4GVsSduVUzNWKkOZrCDBWYtE7biZywwdC2AcEzg+cSMLFRfVgeAFqpfNabiPjxFddV1Q==" }, "node_modules/@types/react": { "version": "17.0.59", @@ -4898,6 +5017,14 @@ "node": ">=0.10.0" } }, + "node_modules/clsx": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", + "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", + "engines": { + "node": ">=6" + } + }, "node_modules/cmd-shim": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/cmd-shim/-/cmd-shim-6.0.1.tgz", @@ -11222,8 +11349,7 @@ "node_modules/regenerator-runtime": { "version": "0.14.0", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz", - "integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==", - "dev": true + "integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==" }, "node_modules/regexp-tree": { "version": "0.1.24", diff --git a/package.json b/package.json index fe75124ce..856776f8e 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "@fluentui/azure-themes": "8.6.34", "@fluentui/react": "8.97.2", "@fluentui/react-theme-provider": "0.19.16", + "@mui/base": "^5.0.0-beta.40", "mobx": "^6.3.2", "mobx-react-lite": "^3.2.0", "monaco-editor": "~0.31.0", diff --git a/packages/playground/src/demo/display/task-list/task-list-demo.tsx b/packages/playground/src/demo/display/task-list/task-list-demo.tsx index 4aa522feb..59e3f5913 100644 --- a/packages/playground/src/demo/display/task-list/task-list-demo.tsx +++ b/packages/playground/src/demo/display/task-list/task-list-demo.tsx @@ -5,47 +5,23 @@ import { FakeTaskService } from "@batch/ui-service/lib/task/fake-task-service"; import { Stack } from "@fluentui/react/lib/Stack"; import React from "react"; import { DemoPane } from "../../../layout/demo-pane"; -import { TextField } from "@fluentui/react/lib/TextField"; +import { Unstable_NumberInput as NumberInput } from "@mui/base/Unstable_NumberInput"; export const TaskListDemo: React.FC = () => { + const taskService: FakeTaskService = inject( + BatchDependencyName.TaskService + ); + const [taskNumberField, setTaskNumberField] = React.useState< - string | undefined + number | undefined >(undefined); - const [items, setItems] = React.useState([]); - const [accountEndpoint] = React.useState( "mercury.eastus.batch.azure.com" ); const [jobId] = React.useState("faketestjob1"); - React.useEffect(() => { - let isMounted = true; - - const taskService: FakeTaskService = inject( - BatchDependencyName.TaskService - ); - - const fetchTaskList = async () => { - if (!isMounted) return; - - const tasks = taskNumberField - ? await taskService.listTasks( - accountEndpoint, - jobId, - parseInt(taskNumberField) - ) - : await taskService.listTasks(accountEndpoint, jobId); - setItems(tasks); - }; - - fetchTaskList().catch((e) => { - console.log("Error: ", e); - }); - - return () => { - isMounted = false; - }; - }, [accountEndpoint, jobId, taskNumberField]); + taskService.generateTasks = true; + taskService.numOfTasks = taskNumberField; return ( @@ -57,15 +33,15 @@ export const TaskListDemo: React.FC = () => { styles={{ root: { marginBottom: "1em" } }} > - { - setTaskNumberField(newValue); + setTaskNumberField(newValue!); }} /> - + ); }; diff --git a/packages/react/src/task/task-list.tsx b/packages/react/src/task/task-list.tsx index e5d3b0fbf..d2e26e1e2 100644 --- a/packages/react/src/task/task-list.tsx +++ b/packages/react/src/task/task-list.tsx @@ -1,48 +1,60 @@ -import React from "react"; -import { CiCircleCheck } from "react-icons/ci"; +import { inject } from "@azure/bonito-core/lib/environment"; import { DataGrid, DataGridColumn, } from "@azure/bonito-ui/lib/components/data-grid"; import { BatchTaskOutput } from "@batch/ui-service/lib/batch-models"; -import { CiCircleChevDown } from "react-icons/ci"; +import { BatchDependencyName } from "@batch/ui-service/lib/environment"; +import { TaskService } from "@batch/ui-service/lib/task/task-service"; import { IconButton } from "@fluentui/react/lib/Button"; +import React from "react"; +import { CiCircleCheck, CiCircleChevDown } from "react-icons/ci"; import { MdOutlineRunningWithErrors } from "react-icons/md"; -import { RiProgress1Line, RiLoader3Fill } from "react-icons/ri"; +import { RiLoader3Fill, RiProgress1Line } from "react-icons/ri"; interface TaskListProps { - pagedTasks: any; + accountEndpoint: string; + jobId: string; } -interface taskRow extends BatchTaskOutput { - url?: string | undefined; - id?: string | undefined; - state?: string | undefined; +interface TaskRow { + url?: string; + id?: string; + state?: string; + creationTime?: string; + exitCode?: number; } export const TaskList = (props: TaskListProps) => { - const { pagedTasks } = props; - const [items, setItems] = React.useState([]); + const { accountEndpoint, jobId } = props; + const [items, setItems] = React.useState([]); const [isCompact] = React.useState(false); React.useEffect(() => { - const parseTasks = async () => { - const taskArray = []; + let isMounted = true; + const taskService: TaskService = inject( + BatchDependencyName.TaskService + ); + + const fetchTaskList = async () => { + if (!isMounted) return; - for await (const task of pagedTasks) { - taskArray.push({ - url: task.url, - id: task.id, - state: task.state, - creationTime: task.creationTime, - executionInfo: task.executionInfo, - exitConditions: task.exitConditions?.exitCodes[0].code, - }); - } - setItems(taskArray); + const tasks = await taskService.listTasks(accountEndpoint, jobId); + const pages = tasks.byPage(); + // .next not picking up BatchTaskOutput[] variable type + const res: IteratorResult = + await pages.next(); + setItems(tasksToRows(res.value)); }; - parseTasks(); - }, [pagedTasks]); + + fetchTaskList().catch((e) => { + console.log("Error: ", e); + }); + + return () => { + isMounted = false; + }; + }, [accountEndpoint, jobId]); return ( { ); }; +function tasksToRows(tasks: BatchTaskOutput[]): TaskRow[] { + const rows = []; + + for (const task of tasks) { + rows.push({ + url: task.url, + id: task.id, + state: task.state, + creationTime: task.creationTime, + exitCode: task.exitConditions?.exitCodes?.[0].code, + }); + } + return rows; +} + const columns: DataGridColumn[] = [ { label: "Task", diff --git a/packages/service/src/task/__tests__/fake-task-service.spec.ts b/packages/service/src/task/__tests__/fake-task-service.spec.ts index 3ab2da460..1084ade8c 100644 --- a/packages/service/src/task/__tests__/fake-task-service.spec.ts +++ b/packages/service/src/task/__tests__/fake-task-service.spec.ts @@ -5,8 +5,6 @@ import { FakeTaskService } from "../fake-task-service"; describe("FakeTaskService", () => { const accountEndpoint = "mercury.eastus.batch.azure.com"; const jobId = `faketestjob1`; - const taskIds = ["task1", "task2", "task3"]; - const harcodedTaskIds = ["taska", "task1"]; let service: FakeTaskService; let fakeSet: BatchFakeSet; @@ -19,26 +17,19 @@ describe("FakeTaskService", () => { }); test("Generate tasks", async () => { - const tasks = await service.listTasks(accountEndpoint, jobId, 3); - const allTasks = []; - for await (const task of tasks) { - allTasks.push(task); - } + service.numOfTasks = 3; + service.generateTasks = true; - expect(allTasks[0].id).toEqual("task1"); - expect(allTasks[1].id).toEqual("task2"); - expect(allTasks[2].id).toEqual("task3"); - }); - - test("List batch tasks", async () => { const tasks = await service.listTasks(accountEndpoint, jobId); - const allTasks = []; - for await (const task of tasks) { allTasks.push(task); } - expect(allTasks.map((task) => task.id)).toEqual(taskIds); + + expect(allTasks.length).toEqual(3); + expect(allTasks[0].id).toEqual("generatedTask1"); + expect(allTasks[1].id).toEqual("generatedTask2"); + expect(allTasks[2].id).toEqual("generatedTask3"); }); test("Get specific batch task", async () => { @@ -61,6 +52,6 @@ describe("FakeTaskService", () => { for await (const task of tasks) { allTasks.push(task); } - expect(allTasks.map((task) => task.id)).toEqual(harcodedTaskIds); + expect(allTasks.map((task) => task.id)).toEqual(["taska", "task1"]); }); }); diff --git a/packages/service/src/task/fake-task-service.ts b/packages/service/src/task/fake-task-service.ts index b870fcb1c..267e19f8e 100644 --- a/packages/service/src/task/fake-task-service.ts +++ b/packages/service/src/task/fake-task-service.ts @@ -6,6 +6,8 @@ import { createPagedArray } from "../test-util/paging-test-util"; export class FakeTaskService implements TaskService { fakeSet: BatchFakeSet = new BasicBatchFakeSet(); + numOfTasks?: number; + generateTasks?: boolean; setFakes(fakeSet: BatchFakeSet): void { this.fakeSet = fakeSet; @@ -21,11 +23,20 @@ export class FakeTaskService implements TaskService { async listTasks( accountEndpoint: string, - jobId: string, - numOfTasks?: number + jobId: string ): Promise> { return createPagedArray( - this.fakeSet.listTasks(accountEndpoint, jobId, numOfTasks) + this.fakeSet.listTasks( + accountEndpoint, + jobId, + this.numOfTasks, + this.generateTasks + ) ); } } + +// add another memebr var numOfTasks, like line 8 +// can use in listTasks() but not as parameter +// generate tasks or fake tasks +// function can change, signature has to be same diff --git a/packages/service/src/test-util/fakes.ts b/packages/service/src/test-util/fakes.ts index a14cf03c7..23eabff34 100644 --- a/packages/service/src/test-util/fakes.ts +++ b/packages/service/src/test-util/fakes.ts @@ -116,7 +116,8 @@ export interface BatchFakeSet extends FakeSet { listTasks( accountEndpoint: string, jobId: string, - numOfTasks?: number + numOfTasks?: number, + generateTasks?: boolean ): BatchTaskOutput[]; /** @@ -286,8 +287,8 @@ export abstract class AbstractBatchFakeSet } taskOutput.push({ - url: `${baseTaskUrl}task${i + 1}`, - id: `task${i + 1}`, + url: `${baseTaskUrl}generatedTask${i + 1}`, + id: `generatedTask${i + 1}`, state: state, creationTime: `Aug 15, 2022 14:${i}`, executionInfo: { @@ -305,13 +306,14 @@ export abstract class AbstractBatchFakeSet listTasks( accountEndpoint: string, jobId: string, - numOfTasks?: number + numOfTasks: number = 100, + generateTasks: boolean = false ): BatchTaskOutput[] { if (!jobId) { return []; } - if (numOfTasks) { + if (generateTasks) { return this.generateTasks(accountEndpoint, jobId, numOfTasks); } else { return this.listHardcodedTask(accountEndpoint, jobId); From 9fc57587b05ad3db6dc73c3728a683ce3372a940 Mon Sep 17 00:00:00 2001 From: David Watrous <509299+dpwatrous@users.noreply.github.com> Date: Wed, 26 Jun 2024 13:05:45 -0400 Subject: [PATCH 11/38] Update top-level build dir to include all tests & app (#2918) --- util/bux/util.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/util/bux/util.ts b/util/bux/util.ts index cf0016867..98389052d 100644 --- a/util/bux/util.ts +++ b/util/bux/util.ts @@ -322,10 +322,22 @@ export async function gatherBuildResults(basePath: string) { path.join(basePath, "packages", "bonito-core", "build"), path.join(baseBuildDir, "bonito-core") ); + doCopy( + path.join(basePath, "packages", "bonito-ui", "build"), + path.join(baseBuildDir, "bonito-ui") + ); + doCopy( + path.join(basePath, "packages", "playground", "build"), + path.join(baseBuildDir, "playground") + ); doCopy( path.join(basePath, "packages", "react", "build"), path.join(baseBuildDir, "react") ); + doCopy( + path.join(basePath, "packages", "service", "build"), + path.join(baseBuildDir, "service") + ); // web doCopy(path.join(basePath, "web", "build"), path.join(baseBuildDir, "web")); @@ -335,6 +347,10 @@ export async function gatherBuildResults(basePath: string) { path.join(basePath, "desktop", "coverage"), path.join(baseBuildDir, "desktop", "coverage") ); + doCopy( + path.join(basePath, "desktop", "release"), + path.join(baseBuildDir, "desktop", "release") + ); } export async function linkLocalProjects() { From f3cc9f9a4baecb5a846dc0c8fe70a366aa00fa25 Mon Sep 17 00:00:00 2001 From: Brenda Coronel Date: Wed, 26 Jun 2024 11:26:47 -0700 Subject: [PATCH 12/38] Removed depedency, added SpinButton, modified task-list Mounted --- package-lock.json | 144 ++---------------- package.json | 1 - .../demo/display/task-list/task-list-demo.tsx | 9 +- packages/react/src/task/task-list.tsx | 25 +-- .../task/__tests__/fake-task-service.spec.ts | 2 +- .../service/src/task/fake-task-service.ts | 9 +- packages/service/src/test-util/fakes.ts | 9 +- 7 files changed, 35 insertions(+), 164 deletions(-) diff --git a/package-lock.json b/package-lock.json index 36aaa8b4e..fe1136e5b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,6 @@ "@fluentui/azure-themes": "8.6.34", "@fluentui/react": "8.97.2", "@fluentui/react-theme-provider": "0.19.16", - "@mui/base": "^5.0.0-beta.40", "mobx": "^6.3.2", "mobx-react-lite": "^3.2.0", "monaco-editor": "~0.31.0", @@ -398,9 +397,10 @@ } }, "node_modules/@babel/runtime": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.7.tgz", - "integrity": "sha512-UwgBRMjJP+xv857DCngvqXI3Iq6J4v0wXmwc6sapg+zyhbwmQX67LUEFrkK5tbyJ30jGuG3ZvWpBiB9LCy1kWw==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.15.tgz", + "integrity": "sha512-T0O+aa+4w0u06iNmapipJXMV4HoUir03hpx3/YqXXhu9xim3w+dVphjFWl1OH8NbZHw5Lbm9k45drDkgq2VNNA==", + "dev": true, "dependencies": { "regenerator-runtime": "^0.14.0" }, @@ -428,40 +428,6 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "node_modules/@floating-ui/core": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.6.3.tgz", - "integrity": "sha512-1ZpCvYf788/ZXOhRQGFxnYQOVgeU+pi0i+d0Ow34La7qjIXETi6RNswGVKkA6KcDO8/+Ysu2E/CeUmmeEBDvTg==", - "dependencies": { - "@floating-ui/utils": "^0.2.3" - } - }, - "node_modules/@floating-ui/dom": { - "version": "1.6.6", - "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.6.6.tgz", - "integrity": "sha512-qiTYajAnh3P+38kECeffMSQgbvXty2VB6rS+42iWR4FPIlZjLK84E9qtLnMTLIpPz2znD/TaFqaiavMUrS+Hcw==", - "dependencies": { - "@floating-ui/core": "^1.0.0", - "@floating-ui/utils": "^0.2.3" - } - }, - "node_modules/@floating-ui/react-dom": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.1.1.tgz", - "integrity": "sha512-4h84MJt3CHrtG18mGsXuLCHMrug49d7DFkU0RMIyshRveBeyV2hmV/pDaF2Uxtu8kgq5r46llp5E5FQiR0K2Yg==", - "dependencies": { - "@floating-ui/dom": "^1.0.0" - }, - "peerDependencies": { - "react": ">=16.8.0", - "react-dom": ">=16.8.0" - } - }, - "node_modules/@floating-ui/utils": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.3.tgz", - "integrity": "sha512-XGndio0l5/Gvd6CLIABvsav9HHezgDFFhDfHk1bvLfr9ni8dojqLSvBbotJEjmIwNHL7vK4QzBJTdBRoB+c1ww==" - }, "node_modules/@fluentui/azure-themes": { "version": "8.6.34", "resolved": "https://registry.npmjs.org/@fluentui/azure-themes/-/azure-themes-8.6.34.tgz", @@ -1817,82 +1783,6 @@ "resolved": "https://registry.npmjs.org/@microsoft/load-themed-styles/-/load-themed-styles-1.10.295.tgz", "integrity": "sha512-W+IzEBw8a6LOOfRJM02dTT7BDZijxm+Z7lhtOAz1+y9vQm1Kdz9jlAO+qCEKsfxtUOmKilW8DIRqFw2aUgKeGg==" }, - "node_modules/@mui/base": { - "version": "5.0.0-beta.40", - "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.40.tgz", - "integrity": "sha512-I/lGHztkCzvwlXpjD2+SNmvNQvB4227xBXhISPjEaJUXGImOQ9f3D2Yj/T3KasSI/h0MLWy74X0J6clhPmsRbQ==", - "dependencies": { - "@babel/runtime": "^7.23.9", - "@floating-ui/react-dom": "^2.0.8", - "@mui/types": "^7.2.14", - "@mui/utils": "^5.15.14", - "@popperjs/core": "^2.11.8", - "clsx": "^2.1.0", - "prop-types": "^15.8.1" - }, - "engines": { - "node": ">=12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/mui-org" - }, - "peerDependencies": { - "@types/react": "^17.0.0 || ^18.0.0", - "react": "^17.0.0 || ^18.0.0", - "react-dom": "^17.0.0 || ^18.0.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@mui/types": { - "version": "7.2.14", - "resolved": "https://registry.npmjs.org/@mui/types/-/types-7.2.14.tgz", - "integrity": "sha512-MZsBZ4q4HfzBsywtXgM1Ksj6HDThtiwmOKUXH1pKYISI9gAVXCNHNpo7TlGoGrBaYWZTdNoirIN7JsQcQUjmQQ==", - "peerDependencies": { - "@types/react": "^17.0.0 || ^18.0.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@mui/utils": { - "version": "5.15.20", - "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.15.20.tgz", - "integrity": "sha512-mAbYx0sovrnpAu1zHc3MDIhPqL8RPVC5W5xcO1b7PiSCJPtckIZmBkp8hefamAvUiAV8gpfMOM6Zb+eSisbI2A==", - "dependencies": { - "@babel/runtime": "^7.23.9", - "@types/prop-types": "^15.7.11", - "prop-types": "^15.8.1", - "react-is": "^18.2.0" - }, - "engines": { - "node": ">=12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/mui-org" - }, - "peerDependencies": { - "@types/react": "^17.0.0 || ^18.0.0", - "react": "^17.0.0 || ^18.0.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@mui/utils/node_modules/react-is": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", - "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==" - }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -3413,15 +3303,6 @@ "node": ">=14" } }, - "node_modules/@popperjs/core": { - "version": "2.11.8", - "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", - "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/popperjs" - } - }, "node_modules/@sigstore/bundle": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@sigstore/bundle/-/bundle-1.1.0.tgz", @@ -3746,9 +3627,9 @@ "dev": true }, "node_modules/@types/prop-types": { - "version": "15.7.12", - "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.12.tgz", - "integrity": "sha512-5zvhXYtRNRluoE/jAp4GVsSduVUzNWKkOZrCDBWYtE7biZywwdC2AcEzg+cSMLFRfVgeAFqpfNabiPjxFddV1Q==" + "version": "15.7.5", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.5.tgz", + "integrity": "sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==" }, "node_modules/@types/react": { "version": "17.0.59", @@ -5017,14 +4898,6 @@ "node": ">=0.10.0" } }, - "node_modules/clsx": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", - "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", - "engines": { - "node": ">=6" - } - }, "node_modules/cmd-shim": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/cmd-shim/-/cmd-shim-6.0.1.tgz", @@ -11349,7 +11222,8 @@ "node_modules/regenerator-runtime": { "version": "0.14.0", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz", - "integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==" + "integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==", + "dev": true }, "node_modules/regexp-tree": { "version": "0.1.24", diff --git a/package.json b/package.json index 856776f8e..fe75124ce 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,6 @@ "@fluentui/azure-themes": "8.6.34", "@fluentui/react": "8.97.2", "@fluentui/react-theme-provider": "0.19.16", - "@mui/base": "^5.0.0-beta.40", "mobx": "^6.3.2", "mobx-react-lite": "^3.2.0", "monaco-editor": "~0.31.0", diff --git a/packages/playground/src/demo/display/task-list/task-list-demo.tsx b/packages/playground/src/demo/display/task-list/task-list-demo.tsx index 59e3f5913..631f260ca 100644 --- a/packages/playground/src/demo/display/task-list/task-list-demo.tsx +++ b/packages/playground/src/demo/display/task-list/task-list-demo.tsx @@ -5,7 +5,7 @@ import { FakeTaskService } from "@batch/ui-service/lib/task/fake-task-service"; import { Stack } from "@fluentui/react/lib/Stack"; import React from "react"; import { DemoPane } from "../../../layout/demo-pane"; -import { Unstable_NumberInput as NumberInput } from "@mui/base/Unstable_NumberInput"; +import { SpinButton } from "@fluentui/react/lib/SpinButton"; export const TaskListDemo: React.FC = () => { const taskService: FakeTaskService = inject( @@ -33,10 +33,11 @@ export const TaskListDemo: React.FC = () => { styles={{ root: { marginBottom: "1em" } }} > - { - setTaskNumberField(newValue!); + setTaskNumberField(Number(newValue) ?? undefined); }} /> diff --git a/packages/react/src/task/task-list.tsx b/packages/react/src/task/task-list.tsx index d2e26e1e2..b3886b36b 100644 --- a/packages/react/src/task/task-list.tsx +++ b/packages/react/src/task/task-list.tsx @@ -37,9 +37,10 @@ export const TaskList = (props: TaskListProps) => { ); const fetchTaskList = async () => { + const tasks = await taskService.listTasks(accountEndpoint, jobId); + if (!isMounted) return; - const tasks = await taskService.listTasks(accountEndpoint, jobId); const pages = tasks.byPage(); // .next not picking up BatchTaskOutput[] variable type const res: IteratorResult = @@ -81,13 +82,13 @@ function tasksToRows(tasks: BatchTaskOutput[]): TaskRow[] { return rows; } -const columns: DataGridColumn[] = [ +const columns: DataGridColumn[] = [ { label: "Task", prop: "id", minWidth: 100, maxWidth: 150, - onRender: (task: any) => { + onRender: (task) => { return {task.id}; }, }, @@ -96,31 +97,31 @@ const columns: DataGridColumn[] = [ prop: "state", minWidth: 150, maxWidth: 200, - onRender: (task: any) => { + onRender: (task) => { return (
- {task.state.toLowerCase() === "completed" ? ( + {task.state?.toLowerCase() === "completed" ? ( - ) : task.state.toLowerCase() === "active" ? ( + ) : task.state?.toLowerCase() === "active" ? ( - ) : task.state.toLowerCase() === "failed" ? ( + ) : task.state?.toLowerCase() === "failed" ? ( - ) : task.state.toLowerCase() === "running" ? ( + ) : task.state?.toLowerCase() === "running" ? ( { + onRender: (task) => { return
{task.creationTime}
; }, }, @@ -146,15 +147,15 @@ const columns: DataGridColumn[] = [ label: "Exit code", prop: "exitCode", minWidth: 150, - onRender: (task: any) => { - return
{task.exitConditions}
; + onRender: (task) => { + return
{task.exitCode}
; }, }, { label: " ", prop: " ", minWidth: 150, - onRender: (task: any) => { + onRender: (task) => { return (
diff --git a/packages/service/src/task/__tests__/fake-task-service.spec.ts b/packages/service/src/task/__tests__/fake-task-service.spec.ts index 1084ade8c..a898dfa36 100644 --- a/packages/service/src/task/__tests__/fake-task-service.spec.ts +++ b/packages/service/src/task/__tests__/fake-task-service.spec.ts @@ -17,8 +17,8 @@ describe("FakeTaskService", () => { }); test("Generate tasks", async () => { - service.numOfTasks = 3; service.generateTasks = true; + service.numOfTasks = 3; const tasks = await service.listTasks(accountEndpoint, jobId); const allTasks = []; diff --git a/packages/service/src/task/fake-task-service.ts b/packages/service/src/task/fake-task-service.ts index 267e19f8e..55eba764c 100644 --- a/packages/service/src/task/fake-task-service.ts +++ b/packages/service/src/task/fake-task-service.ts @@ -29,14 +29,9 @@ export class FakeTaskService implements TaskService { this.fakeSet.listTasks( accountEndpoint, jobId, - this.numOfTasks, - this.generateTasks + this.generateTasks, + this.numOfTasks ) ); } } - -// add another memebr var numOfTasks, like line 8 -// can use in listTasks() but not as parameter -// generate tasks or fake tasks -// function can change, signature has to be same diff --git a/packages/service/src/test-util/fakes.ts b/packages/service/src/test-util/fakes.ts index 23eabff34..f24ac0442 100644 --- a/packages/service/src/test-util/fakes.ts +++ b/packages/service/src/test-util/fakes.ts @@ -111,13 +111,14 @@ export interface BatchFakeSet extends FakeSet { * * @param accountEndpoint * @param jobId + * @param generateTasks Generate tasks based on if live or fake service * @param numOfTasks The number of tasks to generate */ listTasks( accountEndpoint: string, jobId: string, - numOfTasks?: number, - generateTasks?: boolean + generateTasks?: boolean, + numOfTasks?: number ): BatchTaskOutput[]; /** @@ -306,8 +307,8 @@ export abstract class AbstractBatchFakeSet listTasks( accountEndpoint: string, jobId: string, - numOfTasks: number = 100, - generateTasks: boolean = false + generateTasks: boolean = false, + numOfTasks: number = 100 ): BatchTaskOutput[] { if (!jobId) { return []; From be0992b6d9fc4f312831d3546cf7cd99dd7a9ac2 Mon Sep 17 00:00:00 2001 From: Brenda Coronel Date: Wed, 26 Jun 2024 11:47:35 -0700 Subject: [PATCH 13/38] Replaced playground icons with fluent ui icons --- packages/react/src/task/task-list.tsx | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/packages/react/src/task/task-list.tsx b/packages/react/src/task/task-list.tsx index b3886b36b..26b4b0702 100644 --- a/packages/react/src/task/task-list.tsx +++ b/packages/react/src/task/task-list.tsx @@ -1,3 +1,4 @@ +import * as React from "react"; import { inject } from "@azure/bonito-core/lib/environment"; import { DataGrid, @@ -6,11 +7,9 @@ import { import { BatchTaskOutput } from "@batch/ui-service/lib/batch-models"; import { BatchDependencyName } from "@batch/ui-service/lib/environment"; import { TaskService } from "@batch/ui-service/lib/task/task-service"; +import { Icon } from "@fluentui/react/lib/Icon"; import { IconButton } from "@fluentui/react/lib/Button"; -import React from "react"; -import { CiCircleCheck, CiCircleChevDown } from "react-icons/ci"; -import { MdOutlineRunningWithErrors } from "react-icons/md"; -import { RiLoader3Fill, RiProgress1Line } from "react-icons/ri"; +import { CiCircleChevDown } from "react-icons/ci"; interface TaskListProps { accountEndpoint: string; @@ -101,28 +100,32 @@ const columns: DataGridColumn[] = [ return (
{task.state?.toLowerCase() === "completed" ? ( - ) : task.state?.toLowerCase() === "active" ? ( - ) : task.state?.toLowerCase() === "failed" ? ( - ) : task.state?.toLowerCase() === "running" ? ( - Date: Thu, 27 Jun 2024 16:52:04 -0400 Subject: [PATCH 14/38] Add --no-sandbox flag to Electron when running tests (#2919) This allows tests to run as root in the CI container --- desktop/karma.conf.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop/karma.conf.js b/desktop/karma.conf.js index 8a3763a99..62d76ded5 100644 --- a/desktop/karma.conf.js +++ b/desktop/karma.conf.js @@ -51,7 +51,7 @@ module.exports = function(config) { customLaunchers: { CustomElectron: { base: "Electron", - flags: ["--enable-precise-memory-info"], + flags: ["--enable-precise-memory-info", "--no-sandbox"], browserWindowOptions: { show: true, webPreferences: { From 65691557cfb2d010b5d3ee0c822f43800cd5248d Mon Sep 17 00:00:00 2001 From: Brenda Coronel Date: Tue, 2 Jul 2024 11:00:29 -0700 Subject: [PATCH 15/38] Pagination added to demo --- .../demo/display/task-list/task-list-demo.tsx | 37 +++++++++-- .../grid-footer/data-grid-footer.tsx | 64 +++++++++++++++++++ .../grid-utils/grid-utlis.styles.ts | 34 ++++++++++ packages/react/src/task/task-list.tsx | 53 ++++++++++++--- 4 files changed, 171 insertions(+), 17 deletions(-) create mode 100644 packages/react/src/components/grid-utils/grid-footer/data-grid-footer.tsx create mode 100644 packages/react/src/components/grid-utils/grid-utlis.styles.ts diff --git a/packages/playground/src/demo/display/task-list/task-list-demo.tsx b/packages/playground/src/demo/display/task-list/task-list-demo.tsx index 631f260ca..878c2a9da 100644 --- a/packages/playground/src/demo/display/task-list/task-list-demo.tsx +++ b/packages/playground/src/demo/display/task-list/task-list-demo.tsx @@ -12,16 +12,22 @@ export const TaskListDemo: React.FC = () => { BatchDependencyName.TaskService ); - const [taskNumberField, setTaskNumberField] = React.useState< - number | undefined - >(undefined); + const [spinButtonValue, setSpinButton] = React.useState( + undefined + ); const [accountEndpoint] = React.useState( "mercury.eastus.batch.azure.com" ); - const [jobId] = React.useState("faketestjob1"); + const [jobId, setJobId] = React.useState("faketestjob1"); taskService.generateTasks = true; - taskService.numOfTasks = taskNumberField; + taskService.numOfTasks = spinButtonValue; + + React.useEffect(() => { + taskService.numOfTasks = spinButtonValue; + setSpinButton(spinButtonValue); + setJobId("testjob" + spinButtonValue?.toString()); + }, [spinButtonValue, taskService, jobId]); return ( @@ -35,9 +41,26 @@ export const TaskListDemo: React.FC = () => { { + const numberValue = Number(value); + if (!isNaN(numberValue)) { + setSpinButton(numberValue + 1); + } + }} + onDecrement={(value) => { + const numberValue = Number(value); + if (!isNaN(numberValue)) { + setSpinButton(numberValue - 1); + } + }} onChange={(_, newValue) => { - setTaskNumberField(Number(newValue) ?? undefined); + setSpinButton(Number(newValue) ?? undefined); }} /> diff --git a/packages/react/src/components/grid-utils/grid-footer/data-grid-footer.tsx b/packages/react/src/components/grid-utils/grid-footer/data-grid-footer.tsx new file mode 100644 index 000000000..f99158014 --- /dev/null +++ b/packages/react/src/components/grid-utils/grid-footer/data-grid-footer.tsx @@ -0,0 +1,64 @@ +import * as React from "react"; +import { Stack } from "@fluentui/react/lib/Stack"; +import { IconButton } from "@fluentui/react/lib/Button"; +import { Footer, FooterIcon, FooterRight } from "../grid-utlis.styles"; + +interface GridFooterProps { + currentPage: number; + pageSize: number; + totalItems: number; + // goToPage: (num: number) => void; + nextPage: () => void; + previousPage: () => void; + firstPage: () => void; + lastPage: () => void; +} + +export const GridFooter = (props: GridFooterProps) => { + const { + currentPage, + pageSize, + totalItems, + // goToPage, + nextPage, + previousPage, + firstPage, + lastPage, + } = props; + + return ( + + + + + {(currentPage - 1) * pageSize + 1} -{" "} + {pageSize * currentPage} of {totalItems} + + + + + Page {currentPage} + + + + + + + ); +}; diff --git a/packages/react/src/components/grid-utils/grid-utlis.styles.ts b/packages/react/src/components/grid-utils/grid-utlis.styles.ts new file mode 100644 index 000000000..aa3962560 --- /dev/null +++ b/packages/react/src/components/grid-utils/grid-utlis.styles.ts @@ -0,0 +1,34 @@ +export const Footer = { + height: "32px", + width: "100%", + paddingTop: "3px", + marginLeft: "10px", + color: "#333", + borderTop: "1px solid #edebe9", + + "&:span": { + fontWeight: "400", + color: "rgb(50, 49, 48)", + }, + "&:div": { + fontWeight: "400", + color: "rgb(50, 49, 48)", + }, +}; + +export const FooterRight = { + alignSelf: "flex-end", + marginRight: "10px", +}; + +export const FooterIcon = { + backgroundColor: "transparent", + + "&:i": {}, + "&:span": { + color: "#0078D4", + }, + "&:span:disabled": { + color: "gray", + }, +}; diff --git a/packages/react/src/task/task-list.tsx b/packages/react/src/task/task-list.tsx index 26b4b0702..094d698d5 100644 --- a/packages/react/src/task/task-list.tsx +++ b/packages/react/src/task/task-list.tsx @@ -10,6 +10,7 @@ import { TaskService } from "@batch/ui-service/lib/task/task-service"; import { Icon } from "@fluentui/react/lib/Icon"; import { IconButton } from "@fluentui/react/lib/Button"; import { CiCircleChevDown } from "react-icons/ci"; +import { GridFooter } from "../components/grid-utils/grid-footer/data-grid-footer"; interface TaskListProps { accountEndpoint: string; @@ -27,7 +28,14 @@ interface TaskRow { export const TaskList = (props: TaskListProps) => { const { accountEndpoint, jobId } = props; const [items, setItems] = React.useState([]); - const [isCompact] = React.useState(false); + const [isCompact] = React.useState(true); + const [pageSize] = React.useState(20); + const [currentPage, setCurrentPage] = React.useState(1); + const [totalItems, setTotalItems] = React.useState(0); + + // store result of iterator pages in state variable, want to be global and use in loadMore func + const [iterator, setIterator] = + React.useState>(); React.useEffect(() => { let isMounted = true; @@ -40,10 +48,11 @@ export const TaskList = (props: TaskListProps) => { if (!isMounted) return; - const pages = tasks.byPage(); - // .next not picking up BatchTaskOutput[] variable type + const pages = tasks.byPage({ maxPageSize: pageSize }); + const res: IteratorResult = await pages.next(); + setIterator(pages); setItems(tasksToRows(res.value)); }; @@ -54,15 +63,39 @@ export const TaskList = (props: TaskListProps) => { return () => { isMounted = false; }; - }, [accountEndpoint, jobId]); + }, [accountEndpoint, jobId, pageSize]); return ( - + <> + + { + iterator?.next().then((res) => { + setItems(res.value); + }); + setCurrentPage(currentPage + 1); + }} + previousPage={() => { + return; + }} + firstPage={() => { + //get page? + return; + }} + lastPage={() => { + //get page? + return; + }} + /> + ); }; From 11c3934d06922c1caaca49605bba2b3293cb0fd9 Mon Sep 17 00:00:00 2001 From: hoppe Date: Mon, 24 Jun 2024 22:39:15 -0700 Subject: [PATCH 16/38] temp to add getoradd add getOrAdd and tests --- .../__tests__/memory-cache-manager.spec.ts | 63 ++++++++++++++ .../bonito-core/src/cache/cache-manager.ts | 44 ++++++++++ packages/bonito-core/src/cache/cache-utils.ts | 11 +++ packages/bonito-core/src/cache/index.ts | 3 + .../src/cache/memory-cache-manager.ts | 37 ++++++++ .../src/environment/abstract-environment.ts | 16 ++++ .../src/environment/environment.ts | 8 ++ .../src/environment/mock-environment.ts | 2 + packages/bonito-core/src/index.ts | 1 + .../bonito-core/src/service/operations.ts | 6 ++ .../__tests__/fake-account-service.spec.ts | 22 +++++ .../__tests__/live-account-service.spec.ts | 84 +++++++++++++++++++ .../service/src/account/account-service.ts | 9 ++ .../src/account/fake-account-service.ts | 19 +++++ packages/service/src/account/index.ts | 2 + .../src/account/live-account-service.ts | 53 ++++++++++++ .../service/src/pool/live-pool-service.ts | 6 +- 17 files changed, 381 insertions(+), 5 deletions(-) create mode 100644 packages/bonito-core/src/cache/__tests__/memory-cache-manager.spec.ts create mode 100644 packages/bonito-core/src/cache/cache-manager.ts create mode 100644 packages/bonito-core/src/cache/cache-utils.ts create mode 100644 packages/bonito-core/src/cache/index.ts create mode 100644 packages/bonito-core/src/cache/memory-cache-manager.ts create mode 100644 packages/service/src/account/__tests__/fake-account-service.spec.ts create mode 100644 packages/service/src/account/__tests__/live-account-service.spec.ts create mode 100644 packages/service/src/account/account-service.ts create mode 100644 packages/service/src/account/fake-account-service.ts create mode 100644 packages/service/src/account/live-account-service.ts diff --git a/packages/bonito-core/src/cache/__tests__/memory-cache-manager.spec.ts b/packages/bonito-core/src/cache/__tests__/memory-cache-manager.spec.ts new file mode 100644 index 000000000..27ec15bc0 --- /dev/null +++ b/packages/bonito-core/src/cache/__tests__/memory-cache-manager.spec.ts @@ -0,0 +1,63 @@ +import { initMockEnvironment } from "../../environment"; +import { CacheManager } from "../cache-manager"; +import { getCacheManager } from "../cache-utils"; + +describe("Memory Cache Manager Test", () => { + let cacheManager: CacheManager; + + beforeEach(() => { + initMockEnvironment(); + cacheManager = getCacheManager(); + }); + + test("Memory cache manager works as expected", async () => { + const key = "test-key"; + const value = "test-value"; + await cacheManager.set(key, value); + const result = await cacheManager.get(key, null); + expect(result).toBe(value); + await cacheManager.remove(key); + const result2 = await cacheManager.get(key, null); + expect(result2).toBeNull(); + }); + + test("clear should clear all cache", async () => { + const key = "test-key"; + const value = "test-value"; + await cacheManager.set(key, value); + await cacheManager.clear(); + const result = await cacheManager.get(key); + expect(result).toBeUndefined(); + }); + + test("getOrAdd should add value if not found", async () => { + const key = "test-key"; + const value = "test-value"; + const addValue = jest.fn(() => Promise.resolve(value)); + const result = await cacheManager.getOrAdd(key, addValue); + expect(result).toBe(value); + expect(addValue).toBeCalledTimes(1); + }); + + test("getOrAdd should get value if found", async () => { + const key = "test-key"; + const value = "test-value"; + await cacheManager.set(key, value); + const addValue = jest.fn(() => Promise.resolve("new-value")); + const result = await cacheManager.getOrAdd(key, addValue, {}); + expect(result).toBe(value); + expect(addValue).not.toBeCalled(); + }); + + test("getOrAdd should bypass cache if specified", async () => { + const key = "test-key"; + const value = "test-value"; + await cacheManager.set(key, value); + const addValue = jest.fn(() => Promise.resolve("new-value")); + const result = await cacheManager.getOrAdd(key, addValue, { + bypassCache: true, + }); + expect(result).toBe("new-value"); + expect(addValue).toBeCalledTimes(1); + }); +}); diff --git a/packages/bonito-core/src/cache/cache-manager.ts b/packages/bonito-core/src/cache/cache-manager.ts new file mode 100644 index 000000000..f3bc75059 --- /dev/null +++ b/packages/bonito-core/src/cache/cache-manager.ts @@ -0,0 +1,44 @@ +export interface getOrAddOptions { + /** + * If true, the cache will be bypassed, and the value will be fetched from the source + */ + bypassCache?: boolean; +} + +export interface CacheManager { + /** + * Get a value from the cache + * @param key The key to look up + * @param defaultValue The value to return if the key is not found + */ + get(key: string, defaultValue?: T): Promise; + + /** + * Get a value from the cache, or add it if it is not found + * @param key The key to look up + * @param addValue The value to add if the key is not found + */ + getOrAdd( + key: string, + addValue: () => Promise, + options?: getOrAddOptions + ): Promise; + + /** + * Set a value in the cache + * @param key The key to set + * @param value The value to set + */ + set(key: string, value: T): Promise; + + /** + * Remove a value from the cache + * @param key The key to remove + */ + remove(key: string): Promise; + + /** + * Clear all cache + */ + clear(): Promise; +} diff --git a/packages/bonito-core/src/cache/cache-utils.ts b/packages/bonito-core/src/cache/cache-utils.ts new file mode 100644 index 000000000..f0618e21e --- /dev/null +++ b/packages/bonito-core/src/cache/cache-utils.ts @@ -0,0 +1,11 @@ +import { getEnvironment } from "../environment"; +import { CacheManager } from "./cache-manager"; + +/** + * Gets the notifier for the current environment + * + * @returns The globally-configured notifier instance + */ +export function getCacheManager(): CacheManager { + return getEnvironment().getCacheManager(); +} diff --git a/packages/bonito-core/src/cache/index.ts b/packages/bonito-core/src/cache/index.ts new file mode 100644 index 000000000..0a30597a8 --- /dev/null +++ b/packages/bonito-core/src/cache/index.ts @@ -0,0 +1,3 @@ +export * from "./cache-manager"; +export * from "./memory-cache-manager"; +export * from "./cache-utils"; diff --git a/packages/bonito-core/src/cache/memory-cache-manager.ts b/packages/bonito-core/src/cache/memory-cache-manager.ts new file mode 100644 index 000000000..1bea5fe5c --- /dev/null +++ b/packages/bonito-core/src/cache/memory-cache-manager.ts @@ -0,0 +1,37 @@ +import { CacheManager } from "./cache-manager"; + +export class MemoryCacheManager implements CacheManager { + private cache: Map = new Map(); + + async get(key: string, defaultValue?: T): Promise { + return this.cache.has(key) ? this.cache.get(key) : defaultValue; + } + + async getOrAdd( + key: string, + addValue: () => Promise, + options?: { bypassCache?: boolean } + ): Promise { + if (!options?.bypassCache) { + const cached = await this.get(key); + if (cached) { + return cached; + } + } + const value = await addValue(); + await this.set(key, value); + return value; + } + + async set(key: string, value: T): Promise { + this.cache.set(key, value); + } + + async remove(key: string): Promise { + this.cache.delete(key); + } + + async clear(): Promise { + this.cache.clear(); + } +} diff --git a/packages/bonito-core/src/environment/abstract-environment.ts b/packages/bonito-core/src/environment/abstract-environment.ts index 596ac79f9..d4f08672e 100644 --- a/packages/bonito-core/src/environment/abstract-environment.ts +++ b/packages/bonito-core/src/environment/abstract-environment.ts @@ -12,6 +12,7 @@ import { } from "./environment"; import { Clock } from "../datetime/clock"; import { Notifier } from "../notification"; +import { CacheManager } from "../cache"; const DEFAULT_BASE_PATH = "/"; @@ -93,6 +94,21 @@ export abstract class AbstractEnvironment< return notifier; } + /** + * Get an instance of the global cache manager + */ + getCacheManager(): CacheManager { + const cacheManager = this.getInjectable( + DependencyName.CacheManager + ); + if (!cacheManager) { + throw new Error( + "No cache manager configured for the current environment" + ); + } + return cacheManager; + } + /** * Get the currently configured HTTP client */ diff --git a/packages/bonito-core/src/environment/environment.ts b/packages/bonito-core/src/environment/environment.ts index 679fcff79..5d7654fdd 100644 --- a/packages/bonito-core/src/environment/environment.ts +++ b/packages/bonito-core/src/environment/environment.ts @@ -7,6 +7,7 @@ import { ResourceGroupService } from "../resource-group"; import { StorageAccountService } from "../storage"; import { SubscriptionService } from "../subscription"; import { Notifier } from "../notification"; +import { CacheManager } from "../cache"; /** * Represents the execution environment of the application. Acts as a @@ -56,6 +57,11 @@ export interface Environment { */ getNotifier(): Notifier; + /** + * Gets the notifier for the current environment + */ + getCacheManager(): CacheManager; + /** * Gets the HTTP client for the current environment */ @@ -108,6 +114,7 @@ export enum DependencyName { ResourceGroupService = "resourceGroupService", StorageAccountService = "storageAccountService", SubscriptionService = "subscriptionService", + CacheManager = "cacheManager", } /** @@ -124,6 +131,7 @@ export interface DependencyFactories { [DependencyName.ResourceGroupService]: () => ResourceGroupService; [DependencyName.StorageAccountService]: () => StorageAccountService; [DependencyName.SubscriptionService]: () => SubscriptionService; + [DependencyName.CacheManager]: () => CacheManager; } /** diff --git a/packages/bonito-core/src/environment/mock-environment.ts b/packages/bonito-core/src/environment/mock-environment.ts index 6edd3be46..8022b4f44 100644 --- a/packages/bonito-core/src/environment/mock-environment.ts +++ b/packages/bonito-core/src/environment/mock-environment.ts @@ -15,6 +15,7 @@ import { EnvironmentMode, } from "./environment"; import { FakeNotifier } from "../notification/fake-notifier"; +import { MemoryCacheManager } from "../cache"; export const mockEnvironmentConfig: EnvironmentConfig = { mode: EnvironmentMode.Development, @@ -31,6 +32,7 @@ export const mockDependencyFactories: DependencyFactories = { storageAccountService: () => new FakeStorageAccountService(), subscriptionService: () => new FakeSubscriptionService(), notifier: () => new FakeNotifier(), + cacheManager: () => new MemoryCacheManager(), }; export class MockEnvironment< diff --git a/packages/bonito-core/src/index.ts b/packages/bonito-core/src/index.ts index a1a8caaf5..59319b4ed 100644 --- a/packages/bonito-core/src/index.ts +++ b/packages/bonito-core/src/index.ts @@ -33,6 +33,7 @@ export { export * from "./location"; export { getLogger } from "./logging/logging-util"; export { getNotifier } from "./notification"; +export { getCacheManager } from "./cache/cache-utils"; export * from "./resource-group"; export * from "./service"; export * from "./storage"; diff --git a/packages/bonito-core/src/service/operations.ts b/packages/bonito-core/src/service/operations.ts index 311743a93..e55e07eab 100644 --- a/packages/bonito-core/src/service/operations.ts +++ b/packages/bonito-core/src/service/operations.ts @@ -10,6 +10,12 @@ export interface OperationOptions { * convention. For example: "TaskForm/SubmitTask" */ commandName?: string; + + /** + * If true, the operation should bypass any cache and + * fetch the latest data from the server and update the cache. + */ + bypassCache?: boolean; } /** diff --git a/packages/service/src/account/__tests__/fake-account-service.spec.ts b/packages/service/src/account/__tests__/fake-account-service.spec.ts new file mode 100644 index 000000000..04b6f234a --- /dev/null +++ b/packages/service/src/account/__tests__/fake-account-service.spec.ts @@ -0,0 +1,22 @@ +import { initMockBatchEnvironment } from "../../environment"; +import { BatchFakeSet, BasicBatchFakeSet } from "../../test-util/fakes"; +import { FakeAccountService } from "../fake-account-service"; + +describe("FakeAccountService", () => { + const hoboAcctResId = + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/supercomputing/providers/Microsoft.Batch/batchAccounts/hobo"; + + let service: FakeAccountService; + let fakeSet: BatchFakeSet; + beforeEach(() => { + initMockBatchEnvironment(); + fakeSet = new BasicBatchFakeSet(); + service = new FakeAccountService(); + service.setFakes(fakeSet); + }); + + test("Get account by ARM resource ID", async () => { + const account = await service.get(hoboAcctResId); + expect(account?.name).toEqual("hobo"); + }); +}); diff --git a/packages/service/src/account/__tests__/live-account-service.spec.ts b/packages/service/src/account/__tests__/live-account-service.spec.ts new file mode 100644 index 000000000..6af3b78f7 --- /dev/null +++ b/packages/service/src/account/__tests__/live-account-service.spec.ts @@ -0,0 +1,84 @@ +import { getArmUrl } from "@azure/bonito-core"; +import { getMockEnvironment } from "@azure/bonito-core/lib/environment"; +import { MockHttpClient, MockHttpResponse } from "@azure/bonito-core/lib/http"; +import { BatchApiVersion } from "../../constants"; +import { initMockBatchEnvironment } from "../../environment"; +import { BatchFakeSet, BasicBatchFakeSet } from "../../test-util/fakes"; +import { LiveAccountService } from "../live-account-service"; + +describe("LiveAccountService", () => { + const hoboAcctResId = + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/supercomputing/providers/Microsoft.Batch/batchAccounts/hobo"; + + let service: LiveAccountService; + let fakeSet: BatchFakeSet; + let httpClient: MockHttpClient; + + beforeEach(() => { + initMockBatchEnvironment(); + httpClient = getMockEnvironment().getHttpClient(); + service = new LiveAccountService(); + fakeSet = new BasicBatchFakeSet(); + }); + + test("Get account by ARM resource ID", async () => { + const mockAccountRes = fakeSet.getBatchAccount(hoboAcctResId); + // change the name of the account to test bypassing the cache + const mockAccountResRenamed = { + ...mockAccountRes, + name: "hobo2", + }; + + httpClient.addExpected( + new MockHttpResponse( + `${getArmUrl()}${hoboAcctResId}?api-version=${BatchApiVersion.arm}`, + { + status: 200, + body: JSON.stringify(mockAccountRes), + } + ) + ); + + httpClient.addExpected( + new MockHttpResponse( + `${getArmUrl()}${hoboAcctResId}?api-version=${BatchApiVersion.arm}`, + { + status: 200, + body: JSON.stringify(mockAccountResRenamed), + } + ) + ); + + const account = await service.get(hoboAcctResId); + expect(account?.name).toEqual("hobo"); + + // verify that the cache is working + const account2 = await service.get(hoboAcctResId); + expect(account2?.name).toEqual("hobo"); + + // verify that the cache is bypassed + const account3 = await service.get(hoboAcctResId, { + bypassCache: true, + }); + expect(account3?.name).toEqual("hobo2"); + }); + + test("Get account by ARM resource ID error", async () => { + httpClient.addExpected( + new MockHttpResponse( + `${getArmUrl()}${hoboAcctResId}?api-version=${BatchApiVersion.arm}`, + { + status: 500, + body: "Boom", + } + ) + ); + + await expect(() => service.get(hoboAcctResId)).rejects + .toMatchInlineSnapshot(` + [Error: The Batch management plane returned an unexpected status code [unexpected 500 status] + Response body: + "Boom"] + `); + }); +}); diff --git a/packages/service/src/account/account-service.ts b/packages/service/src/account/account-service.ts new file mode 100644 index 000000000..491daed54 --- /dev/null +++ b/packages/service/src/account/account-service.ts @@ -0,0 +1,9 @@ +import { OperationOptions } from "@azure/bonito-core"; +import { BatchAccountOutput } from "../arm-batch-models"; + +export interface AccountService { + get( + accountResouceId: string, + opts?: OperationOptions + ): Promise; +} diff --git a/packages/service/src/account/fake-account-service.ts b/packages/service/src/account/fake-account-service.ts new file mode 100644 index 000000000..c9d235d8c --- /dev/null +++ b/packages/service/src/account/fake-account-service.ts @@ -0,0 +1,19 @@ +import { OperationOptions } from "@azure/bonito-core"; +import { BatchAccountOutput } from "../arm-batch-models"; +import { AccountService } from "./account-service"; +import { BatchFakeSet, BasicBatchFakeSet } from "../test-util/fakes"; + +export class FakeAccountService implements AccountService { + fakeSet: BatchFakeSet = new BasicBatchFakeSet(); + + setFakes(fakeSet: BatchFakeSet): void { + this.fakeSet = fakeSet; + } + + async get( + accountResouceId: string, + opts?: OperationOptions + ): Promise { + return this.fakeSet.getBatchAccount(accountResouceId); + } +} diff --git a/packages/service/src/account/index.ts b/packages/service/src/account/index.ts index 0ecccbf9d..31586d104 100644 --- a/packages/service/src/account/index.ts +++ b/packages/service/src/account/index.ts @@ -1 +1,3 @@ export * from "./account-models"; +export * from "./account-service"; +export * from "./live-account-service"; diff --git a/packages/service/src/account/live-account-service.ts b/packages/service/src/account/live-account-service.ts new file mode 100644 index 000000000..6121cf994 --- /dev/null +++ b/packages/service/src/account/live-account-service.ts @@ -0,0 +1,53 @@ +import { + CustomHttpHeaders, + OperationOptions, + getArmUrl, + getCacheManager, +} from "@azure/bonito-core"; +import { BatchAccountOutput } from "../arm-batch-models"; +import { AccountService } from "./account-service"; +import { createARMBatchClient, isUnexpected } from "../internal/arm-batch-rest"; +import { + createArmUnexpectedStatusCodeError, + parseBatchAccountIdInfo, +} from "../utils"; + +export class LiveAccountService implements AccountService { + async get( + accountResouceId: string, + opts?: OperationOptions + ): Promise { + const { subscriptionId, resourceGroupName, batchAccountName } = + parseBatchAccountIdInfo(accountResouceId); + const cacheManager = getCacheManager(); + const armBatchClient = createARMBatchClient({ + baseUrl: getArmUrl(), + }); + + const cacheKey = `get-${accountResouceId}`; + const { bypassCache } = opts ?? {}; + + const _get = async () => { + const res = await armBatchClient + .path( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}", + subscriptionId, + resourceGroupName, + batchAccountName + ) + .get({ + headers: { + [CustomHttpHeaders.CommandName]: + opts?.commandName ?? "GetAccount", + }, + }); + + if (isUnexpected(res)) { + throw createArmUnexpectedStatusCodeError(res); + } + + return res.body; + }; + return cacheManager.getOrAdd(cacheKey, _get, { bypassCache }); + } +} diff --git a/packages/service/src/pool/live-pool-service.ts b/packages/service/src/pool/live-pool-service.ts index e2089dbb7..f518aff20 100644 --- a/packages/service/src/pool/live-pool-service.ts +++ b/packages/service/src/pool/live-pool-service.ts @@ -2,7 +2,6 @@ import type { Pool, PoolOutput } from "./pool-models"; import type { PoolService } from "./pool-service"; import { - AbstractHttpService, CustomHttpHeaders, OperationOptions, getArmUrl, @@ -20,10 +19,7 @@ const SINGLE_POOL_PATH = const POOLS_PATH = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools"; -export class LivePoolService - extends AbstractHttpService - implements PoolService -{ +export class LivePoolService implements PoolService { async createOrUpdate( poolResourceId: string, pool: Pool, From 42cae0fe0180d8f3e5cee703c77931a8659d0893 Mon Sep 17 00:00:00 2001 From: hoppe Date: Tue, 2 Jul 2024 12:29:32 -0700 Subject: [PATCH 17/38] update batch dependencies --- .../__tests__/node-vm-ext-list.spec.tsx | 7 +- .../src/vm-extension/node-vm-ext-list.tsx | 78 ++++++++++++------- .../src/environment/batch-dependencies.ts | 3 + 3 files changed, 57 insertions(+), 31 deletions(-) diff --git a/packages/react/src/vm-extension/__tests__/node-vm-ext-list.spec.tsx b/packages/react/src/vm-extension/__tests__/node-vm-ext-list.spec.tsx index fadc50270..0ba0cbbb9 100644 --- a/packages/react/src/vm-extension/__tests__/node-vm-ext-list.spec.tsx +++ b/packages/react/src/vm-extension/__tests__/node-vm-ext-list.spec.tsx @@ -6,6 +6,9 @@ import { NodeVMExtList } from "../node-vm-ext-list"; import { dataGridIgnoredA11yRules } from "@azure/bonito-ui/lib/components/data-grid/test-ignore-a11y-rules"; import { runAxe } from "@azure/bonito-ui/lib/test-util/a11y"; +const hoboAccountResourceId = + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/supercomputing/providers/microsoft.batch/batchaccounts/hobo"; + describe("NodeVMExtList", () => { beforeEach(() => { initMockBatchBrowserEnvironment(); @@ -14,7 +17,7 @@ describe("NodeVMExtList", () => { it("should render vm extension lists", async () => { const { getByText, container } = render( @@ -29,7 +32,7 @@ describe("NodeVMExtList", () => { it("should render vm extension lists with no result", async () => { const { getByText } = render( diff --git a/packages/react/src/vm-extension/node-vm-ext-list.tsx b/packages/react/src/vm-extension/node-vm-ext-list.tsx index 01ca49e29..bd9bc3f47 100644 --- a/packages/react/src/vm-extension/node-vm-ext-list.tsx +++ b/packages/react/src/vm-extension/node-vm-ext-list.tsx @@ -1,18 +1,18 @@ import { inject } from "@azure/bonito-core/lib/environment"; -import { NodeService } from "@batch/ui-service"; +import { AccountService, NodeService } from "@batch/ui-service"; import { BatchDependencyName } from "@batch/ui-service/lib/environment"; import React from "react"; import { VmExtensionList, VmExtItem } from "./vm-extension-list"; interface NodeVmExtensionListProps { - accountEndpoint: string; + accountResourceId: string; poolId: string; nodeId: string; onItemClick?: (item: VmExtItem) => void; } export const NodeVMExtList = (props: NodeVmExtensionListProps) => { - const { accountEndpoint, poolId, nodeId, onItemClick } = props; + const { accountResourceId, poolId, nodeId, onItemClick } = props; const [extensions, setExtensions] = React.useState([]); const [loading, setLoading] = React.useState(true); @@ -21,38 +21,58 @@ export const NodeVMExtList = (props: NodeVmExtensionListProps) => { return inject(BatchDependencyName.NodeService); }, []); + const accountService: AccountService = React.useMemo(() => { + return inject(BatchDependencyName.AccountService); + }, []); + + const fetchExtensions = React.useCallback(async () => { + const accountData = await accountService.get(accountResourceId); + if (!accountData) { + throw new Error(`Account with id ${accountResourceId} not found`); + } + const accountEndpoint = accountData.properties?.accountEndpoint; + if (!accountEndpoint) { + throw new Error( + `Account with id ${accountResourceId} does not have an account endpoint` + ); + } + setLoading(true); + try { + const resList = await nodeService.listVmExtensions( + accountEndpoint, + poolId, + nodeId + ); + const exts = []; + if (resList) { + for (const ext of resList) { + ext.vmExtension && + exts.push({ + ...ext.vmExtension, + provisioningState: ext.provisioningState, + instanceView: ext.instanceView, + }); + } + } + setExtensions(exts); + } finally { + setLoading(false); + } + }, [accountResourceId, accountService, nodeId, nodeService, poolId]); + React.useEffect(() => { let isMounted = true; setLoading(true); - nodeService - .listVmExtensions(accountEndpoint, poolId, nodeId) - .then((resList) => { - if (!isMounted) { - return; - } - const exts = []; - if (resList) { - for (const ext of resList) { - ext.vmExtension && - exts.push({ - ...ext.vmExtension, - provisioningState: ext.provisioningState, - instanceView: ext.instanceView, - }); - } - } - setExtensions(exts); - }) - .finally(() => { - if (!isMounted) { - return; - } - setLoading(false); - }); + fetchExtensions().finally(() => { + if (!isMounted) { + return; + } + setLoading(false); + }); return () => { isMounted = false; }; - }, [accountEndpoint, nodeId, nodeService, poolId]); + }, [fetchExtensions]); return ( PoolService; [BatchDependencyName.NodeService]: () => NodeService; + [BatchDependencyName.AccountService]: () => AccountService; } From 046395006bfb28de53e1f6c0f52b761a1fbde239 Mon Sep 17 00:00:00 2001 From: hoppe Date: Tue, 2 Jul 2024 15:43:43 -0700 Subject: [PATCH 18/38] update mock enviroment --- packages/service/src/environment/environment-util.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/service/src/environment/environment-util.ts b/packages/service/src/environment/environment-util.ts index 2dc157201..abcd4328f 100644 --- a/packages/service/src/environment/environment-util.ts +++ b/packages/service/src/environment/environment-util.ts @@ -12,10 +12,12 @@ import { BatchDependencyFactories, BatchDependencyName, } from "./batch-dependencies"; +import { FakeAccountService } from "../account/fake-account-service"; export const mockBatchDepFactories: Partial = { [BatchDependencyName.PoolService]: () => new FakePoolService(), [BatchDependencyName.NodeService]: () => new FakeNodeService(), + [BatchDependencyName.AccountService]: () => new FakeAccountService(), }; /** From 04710c2111ac6e9032c8b19529cc377a91de4b71 Mon Sep 17 00:00:00 2001 From: hoppe Date: Tue, 2 Jul 2024 16:46:10 -0700 Subject: [PATCH 19/38] update desktop environment --- desktop/src/app/environment/desktop-environment.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/desktop/src/app/environment/desktop-environment.ts b/desktop/src/app/environment/desktop-environment.ts index 9b0bb3bad..e85914883 100644 --- a/desktop/src/app/environment/desktop-environment.ts +++ b/desktop/src/app/environment/desktop-environment.ts @@ -7,6 +7,7 @@ import { LiveSubscriptionService, initEnvironment } from "@azure/bonito-core"; +import { MemoryCacheManager } from "@azure/bonito-core/lib/cache"; import { StandardClock } from "@azure/bonito-core/lib/datetime"; import { createConsoleLogger } from "@azure/bonito-core/lib/logging"; import { AlertNotifier } from "@azure/bonito-core/lib/notification/alert-notifier"; @@ -14,7 +15,7 @@ import { DefaultFormLayoutProvider } from "@azure/bonito-ui/lib/components/form" import { BrowserDependencyName, BrowserEnvironmentConfig, DefaultBrowserEnvironment } from "@azure/bonito-ui/lib/environment"; import BatchExplorerHttpClient from "@batch-flask/core/batch-explorer-http-client"; import { BatchBrowserDependencyFactories, BatchFormControlResolver } from "@batch/ui-react"; -import { LiveNodeService, LivePoolService } from "@batch/ui-service"; +import { LiveAccountService, LiveNodeService, LivePoolService } from "@batch/ui-service"; import { BatchDependencyName } from "@batch/ui-service/lib/environment"; import { DesktopLocalizer } from "app/localizer/desktop-localizer"; import { AppTranslationsLoaderService, AuthService, BatchExplorerService } from "app/services"; @@ -42,10 +43,12 @@ export function initDesktopEnvironment( () => new BatchExplorerHttpClient(authService), [DependencyName.LocationService]: () => new LiveLocationService(), + [DependencyName.CacheManager]: () => new MemoryCacheManager(), [BatchDependencyName.PoolService]: () => new LivePoolService(), [BatchDependencyName.NodeService]: () => new LiveNodeService(), + [BatchDependencyName.AccountService]: () => new LiveAccountService(), [DependencyName.Notifier]: () => new AlertNotifier(), // TODO: update with real notification implementation [DependencyName.ResourceGroupService]: () => From a6cc034a25395b489dc377c36e04b022d898d266 Mon Sep 17 00:00:00 2001 From: hoppe Date: Tue, 2 Jul 2024 16:57:03 -0700 Subject: [PATCH 20/38] fix lint issue --- packages/bonito-core/src/cache/cache-manager.ts | 2 +- packages/bonito-core/src/cache/memory-cache-manager.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/bonito-core/src/cache/cache-manager.ts b/packages/bonito-core/src/cache/cache-manager.ts index f3bc75059..3c9514192 100644 --- a/packages/bonito-core/src/cache/cache-manager.ts +++ b/packages/bonito-core/src/cache/cache-manager.ts @@ -11,7 +11,7 @@ export interface CacheManager { * @param key The key to look up * @param defaultValue The value to return if the key is not found */ - get(key: string, defaultValue?: T): Promise; + get(key: string, defaultValue?: T): Promise; /** * Get a value from the cache, or add it if it is not found diff --git a/packages/bonito-core/src/cache/memory-cache-manager.ts b/packages/bonito-core/src/cache/memory-cache-manager.ts index 1bea5fe5c..d6e00edd0 100644 --- a/packages/bonito-core/src/cache/memory-cache-manager.ts +++ b/packages/bonito-core/src/cache/memory-cache-manager.ts @@ -1,10 +1,10 @@ import { CacheManager } from "./cache-manager"; export class MemoryCacheManager implements CacheManager { - private cache: Map = new Map(); + private cache: Map = new Map(); - async get(key: string, defaultValue?: T): Promise { - return this.cache.has(key) ? this.cache.get(key) : defaultValue; + async get(key: string, defaultValue?: T): Promise { + return this.cache.has(key) ? (this.cache.get(key) as T) : defaultValue; } async getOrAdd( From 6ddd8af3754bf11b2619779dec593f1b39f7ada9 Mon Sep 17 00:00:00 2001 From: hoppe Date: Wed, 3 Jul 2024 10:55:51 -0700 Subject: [PATCH 21/38] update explorer-web's environment --- packages/service/src/account/index.ts | 1 + web/src/index.tsx | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/packages/service/src/account/index.ts b/packages/service/src/account/index.ts index 31586d104..2d449930c 100644 --- a/packages/service/src/account/index.ts +++ b/packages/service/src/account/index.ts @@ -1,3 +1,4 @@ export * from "./account-models"; export * from "./account-service"; export * from "./live-account-service"; +export * from "./fake-account-service"; diff --git a/web/src/index.tsx b/web/src/index.tsx index def1212e1..e9afdd31d 100644 --- a/web/src/index.tsx +++ b/web/src/index.tsx @@ -28,6 +28,8 @@ import { FakePoolService } from "@batch/ui-service/lib/pool"; import * as React from "react"; import * as ReactDOM from "react-dom"; import { Application } from "./components"; +import { MemoryCacheManager } from "@azure/bonito-core/lib/cache"; +import { FakeAccountService } from "@batch/ui-service/lib/account"; // Defined by webpack declare const ENV: { @@ -63,8 +65,11 @@ export async function init(rootEl: HTMLElement): Promise { [DependencyName.LocationService]: () => new FakeLocationService(), [DependencyName.Notifier]: () => new AlertNotifier(), // TODO: update with real notification implementation + [DependencyName.CacheManager]: () => new MemoryCacheManager(), [BatchDependencyName.PoolService]: () => new FakePoolService(), [BatchDependencyName.NodeService]: () => new FakeNodeService(), + [BatchDependencyName.AccountService]: () => + new FakeAccountService(), [DependencyName.ResourceGroupService]: () => new FakeResourceGroupService(), [DependencyName.StorageAccountService]: () => From f3047f3d25114f9879308500980e2cb110d012e2 Mon Sep 17 00:00:00 2001 From: hoppe Date: Wed, 3 Jul 2024 14:14:06 -0700 Subject: [PATCH 22/38] resolve comments. --- packages/bonito-core/src/cache/cache-utils.ts | 4 ++-- packages/bonito-core/src/environment/environment.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/bonito-core/src/cache/cache-utils.ts b/packages/bonito-core/src/cache/cache-utils.ts index f0618e21e..fefc10173 100644 --- a/packages/bonito-core/src/cache/cache-utils.ts +++ b/packages/bonito-core/src/cache/cache-utils.ts @@ -2,9 +2,9 @@ import { getEnvironment } from "../environment"; import { CacheManager } from "./cache-manager"; /** - * Gets the notifier for the current environment + * Gets the cache manager for the current environment * - * @returns The globally-configured notifier instance + * @returns The globally-configured cache manager instance */ export function getCacheManager(): CacheManager { return getEnvironment().getCacheManager(); diff --git a/packages/bonito-core/src/environment/environment.ts b/packages/bonito-core/src/environment/environment.ts index 5d7654fdd..874aad5ef 100644 --- a/packages/bonito-core/src/environment/environment.ts +++ b/packages/bonito-core/src/environment/environment.ts @@ -58,7 +58,7 @@ export interface Environment { getNotifier(): Notifier; /** - * Gets the notifier for the current environment + * Gets the cache manager for the current environment */ getCacheManager(): CacheManager; From 1ef83df7db9663bbb9f2a61345a1578256660123 Mon Sep 17 00:00:00 2001 From: Brenda Coronel Date: Wed, 3 Jul 2024 14:39:42 -0700 Subject: [PATCH 23/38] Infinite scroll added to demo --- packages/react/src/task/task-list.tsx | 76 ++++++++++++++++----------- packages/service/src/index.ts | 1 + packages/service/src/task/index.ts | 2 + 3 files changed, 49 insertions(+), 30 deletions(-) create mode 100644 packages/service/src/task/index.ts diff --git a/packages/react/src/task/task-list.tsx b/packages/react/src/task/task-list.tsx index 094d698d5..617a365f8 100644 --- a/packages/react/src/task/task-list.tsx +++ b/packages/react/src/task/task-list.tsx @@ -10,7 +10,7 @@ import { TaskService } from "@batch/ui-service/lib/task/task-service"; import { Icon } from "@fluentui/react/lib/Icon"; import { IconButton } from "@fluentui/react/lib/Button"; import { CiCircleChevDown } from "react-icons/ci"; -import { GridFooter } from "../components/grid-utils/grid-footer/data-grid-footer"; +import { useLoadMore } from "@azure/bonito-ui/lib/hooks"; interface TaskListProps { accountEndpoint: string; @@ -27,43 +27,57 @@ interface TaskRow { export const TaskList = (props: TaskListProps) => { const { accountEndpoint, jobId } = props; - const [items, setItems] = React.useState([]); const [isCompact] = React.useState(true); - const [pageSize] = React.useState(20); - const [currentPage, setCurrentPage] = React.useState(1); - const [totalItems, setTotalItems] = React.useState(0); + const [pageSize] = React.useState(100); + const [_, setLoadErrorMsg] = React.useState(""); - // store result of iterator pages in state variable, want to be global and use in loadMore func - const [iterator, setIterator] = - React.useState>(); + const onLoad = React.useMemo(() => { + let iterator: AsyncIterableIterator; - React.useEffect(() => { - let isMounted = true; - const taskService: TaskService = inject( - BatchDependencyName.TaskService - ); + return (fresh: boolean) => { + const taskService: TaskService = inject( + BatchDependencyName.TaskService + ); - const fetchTaskList = async () => { - const tasks = await taskService.listTasks(accountEndpoint, jobId); + const fetchTaskList = async () => { + if (fresh || !iterator) { + const tasks = await taskService.listTasks( + accountEndpoint, + jobId + ); + iterator = tasks.byPage({ maxPageSize: pageSize }); + } - if (!isMounted) return; + const res: IteratorResult< + BatchTaskOutput[], + BatchTaskOutput[] + > = await iterator.next(); - const pages = tasks.byPage({ maxPageSize: pageSize }); + if (!res.done) { + return { + items: tasksToRows(res.value), + done: false, + }; + } else { + return { + items: [], + done: true, + }; + } + }; - const res: IteratorResult = - await pages.next(); - setIterator(pages); - setItems(tasksToRows(res.value)); + return fetchTaskList(); }; + }, [accountEndpoint, jobId, pageSize]); - fetchTaskList().catch((e) => { - console.log("Error: ", e); - }); + const onLoadError = (error: unknown) => { + setLoadErrorMsg((error as { message: string })?.message ?? ""); + }; - return () => { - isMounted = false; - }; - }, [accountEndpoint, jobId, pageSize]); + const { items, hasMore, onLoadMore } = useLoadMore( + onLoad, + onLoadError + ); return ( <> @@ -72,8 +86,10 @@ export const TaskList = (props: TaskListProps) => { compact={isCompact} items={items} columns={columns} + hasMore={hasMore} + onLoadMore={onLoadMore} /> - { //get page? return; }} - /> + /> */} ); }; diff --git a/packages/service/src/index.ts b/packages/service/src/index.ts index 9147f198a..997ecd498 100644 --- a/packages/service/src/index.ts +++ b/packages/service/src/index.ts @@ -3,4 +3,5 @@ export * from "./account"; export * from "./certificate"; export * from "./pool"; export * from "./node"; +export * from "./task"; export * from "./constants"; diff --git a/packages/service/src/task/index.ts b/packages/service/src/task/index.ts new file mode 100644 index 000000000..39776c59d --- /dev/null +++ b/packages/service/src/task/index.ts @@ -0,0 +1,2 @@ +export * from "./task-service"; +export * from "./live-task-service"; From 517ee9b0816652ce7b46a6e5af503d7735419ceb Mon Sep 17 00:00:00 2001 From: hoppe Date: Mon, 8 Jul 2024 17:25:04 -0700 Subject: [PATCH 24/38] add LruCahe --- .../src/cache/__tests__/lru-cache.spec.ts | 102 +++++++++++++++ .../__tests__/memory-cache-manager.spec.ts | 60 +++++++-- .../bonito-core/src/cache/cache-manager.ts | 54 ++++++++ packages/bonito-core/src/cache/lru-cache.ts | 123 ++++++++++++++++++ .../src/cache/memory-cache-manager.ts | 31 ++--- 5 files changed, 339 insertions(+), 31 deletions(-) create mode 100644 packages/bonito-core/src/cache/__tests__/lru-cache.spec.ts create mode 100644 packages/bonito-core/src/cache/lru-cache.ts diff --git a/packages/bonito-core/src/cache/__tests__/lru-cache.spec.ts b/packages/bonito-core/src/cache/__tests__/lru-cache.spec.ts new file mode 100644 index 000000000..a06531c3d --- /dev/null +++ b/packages/bonito-core/src/cache/__tests__/lru-cache.spec.ts @@ -0,0 +1,102 @@ +import { getCacheManager } from "../cache-utils"; +import { initMockEnvironment } from "../../environment"; +import { LruCache } from "../lru-cache"; + +describe("Lru Cache Test", () => { + beforeEach(() => { + initMockEnvironment(); + }); + + test("recordSet works as expected", async () => { + const lruCache = new LruCache(getCacheManager(), 3); + expect(lruCache.capacity).toBe(3); + lruCache.recordSet("key1"); + lruCache.recordSet("key2"); + lruCache.recordSet("key3"); + + const head = lruCache.getHead(); + expect(head?.key).toBe("key3"); + expect(head?.next?.key).toBe("key2"); + expect(head?.next?.next?.key).toBe("key1"); + + lruCache.recordSet("key2"); + const head2 = lruCache.getHead(); + expect(head2?.key).toBe("key2"); + + lruCache.recordSet("key4"); + const head3 = lruCache.getHead(); + expect(head3?.key).toBe("key4"); + expect(head3?.next?.key).toBe("key2"); + expect(head3?.next?.next?.key).toBe("key3"); + expect(lruCache.getSize()).toBe(3); + }); + + test("should call cacheManager's remove when capacity is exceeded", async () => { + const lruCache = new LruCache(getCacheManager(), 1); + jest.spyOn(lruCache, "recordRemove"); + const cacheManager = lruCache.cacheManager; + jest.spyOn(cacheManager, "remove"); + + const head = lruCache.getHead(); + expect(head).toBeNull(); + expect(lruCache.getSize()).toBe(0); + + lruCache.recordSet("key1"); + lruCache.recordSet("key2"); + expect(lruCache.getSize()).toBe(1); + expect(cacheManager.remove).toHaveBeenNthCalledWith(1, "key1"); + }); + + test("recordGet works as expected", async () => { + const lruCache = new LruCache(getCacheManager(), 3); + lruCache.recordSet("key1"); + lruCache.recordSet("key2"); + lruCache.recordSet("key3"); + + lruCache.recordGet("key1"); + const head = lruCache.getHead(); + expect(head?.key).toBe("key1"); + expect(head?.next?.key).toBe("key3"); + expect(head?.next?.next?.key).toBe("key2"); + + lruCache.recordGet("key3"); + const head2 = lruCache.getHead(); + expect(head2?.key).toBe("key3"); + + lruCache.recordGet("key4"); + const head3 = lruCache.getHead(); + expect(head3?.key).toBe("key3"); + }); + + test("recordRemove works as expected", async () => { + const lruCache = new LruCache(getCacheManager(), 3); + lruCache.recordSet("key1"); + lruCache.recordSet("key2"); + lruCache.recordSet("key3"); + + lruCache.recordRemove("key2"); + const head = lruCache.getHead(); + expect(head?.key).toBe("key3"); + expect(head?.next?.key).toBe("key1"); + expect(lruCache.getSize()).toBe(2); + }); + + test("recordClear works as expected", async () => { + const lruCache = new LruCache(getCacheManager(), 3); + lruCache.recordSet("key1"); + lruCache.recordSet("key2"); + lruCache.recordSet("key3"); + expect(lruCache.getSize()).toBe(3); + + lruCache.recordClear(); + const head = lruCache.getHead(); + expect(head).toBeNull(); + expect(lruCache.getSize()).toBe(0); + }); + + test("should throw error if capacity is invalid", async () => { + expect(() => new LruCache(getCacheManager(), 0)).toThrowError( + "Invalid capacity: 0" + ); + }); +}); diff --git a/packages/bonito-core/src/cache/__tests__/memory-cache-manager.spec.ts b/packages/bonito-core/src/cache/__tests__/memory-cache-manager.spec.ts index 27ec15bc0..18a5bccd6 100644 --- a/packages/bonito-core/src/cache/__tests__/memory-cache-manager.spec.ts +++ b/packages/bonito-core/src/cache/__tests__/memory-cache-manager.spec.ts @@ -1,36 +1,51 @@ import { initMockEnvironment } from "../../environment"; -import { CacheManager } from "../cache-manager"; -import { getCacheManager } from "../cache-utils"; +import { MemoryCacheManager } from "../memory-cache-manager"; -describe("Memory Cache Manager Test", () => { - let cacheManager: CacheManager; - - beforeEach(() => { - initMockEnvironment(); - cacheManager = getCacheManager(); - }); +const setup = (capacity = 100) => { + initMockEnvironment(); + const cacheManager = new MemoryCacheManager(capacity); + jest.spyOn(cacheManager.lruCache, "recordGet"); + jest.spyOn(cacheManager.lruCache, "recordSet"); + jest.spyOn(cacheManager.lruCache, "recordRemove"); + jest.spyOn(cacheManager.lruCache, "recordClear"); + return { cacheManager, lruCache: cacheManager.lruCache }; +}; +describe("Memory Cache Manager Test", () => { test("Memory cache manager works as expected", async () => { + const { cacheManager, lruCache } = setup(); const key = "test-key"; const value = "test-value"; + await cacheManager.set(key, value); + expect(lruCache.recordSet).toBeCalledWith(key); + const result = await cacheManager.get(key, null); expect(result).toBe(value); + expect(lruCache.recordGet).toBeCalledWith(key); + await cacheManager.remove(key); const result2 = await cacheManager.get(key, null); expect(result2).toBeNull(); + expect(lruCache.recordRemove).toBeCalledWith(key); }); test("clear should clear all cache", async () => { + const { cacheManager, lruCache } = setup(); const key = "test-key"; const value = "test-value"; + await cacheManager.set(key, value); await cacheManager.clear(); + const result = await cacheManager.get(key); expect(result).toBeUndefined(); + expect(lruCache.recordClear).toBeCalledTimes(1); }); test("getOrAdd should add value if not found", async () => { + const { cacheManager } = setup(); + const key = "test-key"; const value = "test-value"; const addValue = jest.fn(() => Promise.resolve(value)); @@ -40,6 +55,8 @@ describe("Memory Cache Manager Test", () => { }); test("getOrAdd should get value if found", async () => { + const { cacheManager } = setup(); + const key = "test-key"; const value = "test-value"; await cacheManager.set(key, value); @@ -50,6 +67,8 @@ describe("Memory Cache Manager Test", () => { }); test("getOrAdd should bypass cache if specified", async () => { + const { cacheManager } = setup(); + const key = "test-key"; const value = "test-value"; await cacheManager.set(key, value); @@ -60,4 +79,27 @@ describe("Memory Cache Manager Test", () => { expect(result).toBe("new-value"); expect(addValue).toBeCalledTimes(1); }); + + test("should remove value if excceed capacity", async () => { + const { cacheManager } = setup(1); + + jest.spyOn(cacheManager, "remove"); + + const key = "test-key"; + const value = "test-value"; + await cacheManager.set(key, value); + await cacheManager.set("key2", "value2"); + + const result = await cacheManager.get(key); + expect(result).toBeUndefined(); + + const result2 = await cacheManager.get("key2"); + expect(result2).toBe("value2"); + + expect(cacheManager.remove).toHaveBeenNthCalledWith(1, key); + expect(cacheManager.lruCache.recordRemove).toHaveBeenNthCalledWith( + 1, + key + ); + }); }); diff --git a/packages/bonito-core/src/cache/cache-manager.ts b/packages/bonito-core/src/cache/cache-manager.ts index 3c9514192..79f41228a 100644 --- a/packages/bonito-core/src/cache/cache-manager.ts +++ b/packages/bonito-core/src/cache/cache-manager.ts @@ -1,3 +1,5 @@ +import { LruCache } from "./lru-cache"; + export interface getOrAddOptions { /** * If true, the cache will be bypassed, and the value will be fetched from the source @@ -42,3 +44,55 @@ export interface CacheManager { */ clear(): Promise; } + +export abstract class CacheManagerBase implements CacheManager { + lruCache: LruCache; + + constructor(public capacity: number = 100) { + this.lruCache = new LruCache(this, capacity); + } + + async getOrAdd( + key: string, + addValue: () => Promise, + options?: getOrAddOptions + ): Promise { + const bypassCache = options?.bypassCache ?? false; + if (!bypassCache) { + const cached = await this.get(key); + if (cached) { + return cached; + } + } + const value = await addValue(); + await this.set(key, value); + return value; + } + + async get(key: string, defaultValue?: T): Promise { + this.lruCache.recordGet(key); + return this.getInternal(key, defaultValue); + } + abstract getInternal( + key: string, + defaultValue?: T + ): Promise; + + async set(key: string, value: T): Promise { + this.lruCache.recordSet(key); + return this.setInternal(key, value); + } + abstract setInternal(key: string, value: T): Promise; + + async remove(key: string): Promise { + this.lruCache.recordRemove(key); + return this.removeInternal(key); + } + abstract removeInternal(key: string): Promise; + + async clear(): Promise { + this.lruCache.recordClear(); + return this.clearInternal(); + } + abstract clearInternal(): Promise; +} diff --git a/packages/bonito-core/src/cache/lru-cache.ts b/packages/bonito-core/src/cache/lru-cache.ts new file mode 100644 index 000000000..c295437e2 --- /dev/null +++ b/packages/bonito-core/src/cache/lru-cache.ts @@ -0,0 +1,123 @@ +import { CacheManager } from "./cache-manager"; + +class LruEntry { + key: string; + next: LruEntry | null; + prev: LruEntry | null; + + constructor(key: string) { + this.key = key; + this.next = null; + this.prev = null; + } +} + +export class LruCache { + private _head: LruEntry; + + private _tail: LruEntry; + + private _map: Map; + + constructor( + public cacheManager: CacheManager, + public capacity: number + ) { + if (capacity <= 0) { + throw new Error(`Invalid capacity: ${capacity}`); + } + this._head = new LruEntry(""); + this._tail = new LruEntry(""); + this._head.next = this._tail; + this._tail.prev = this._head; + this._map = new Map(); + } + + private _moveToHead(entry: LruEntry) { + this._removeEntry(entry); + this._addEntry(entry); + } + + private _removeEntry(entry: LruEntry) { + const prev = entry.prev; + const next = entry.next; + + if (prev) { + prev.next = next; + } + + if (next) { + next.prev = prev; + } + } + + private _addEntry(entry: LruEntry) { + const next = this._head?.next; + if (!next) { + throw new Error("Invalid state: head's next is null"); + } + + this._head.next = entry; + entry.prev = this._head; + + entry.next = next; + next.prev = entry; + } + + private _checkCapacity() { + if (this._map.size > this.capacity) { + const toRemove = this._tail.prev; + if (!toRemove) { + throw new Error("Invalid state: tail's prev is null"); + } + this._removeEntry(toRemove); + this._map.delete(toRemove.key); + this.cacheManager.remove(toRemove.key); + } + } + + recordGet(key: string) { + const entry = this._map.get(key); + if (entry) { + this._moveToHead(entry); + } + } + + recordSet(key: string) { + let entry = this._map.get(key); + if (entry) { + this._moveToHead(entry); + return; + } + entry = new LruEntry(key); + this._addEntry(entry); + this._map.set(key, entry); + this._checkCapacity(); + } + + recordRemove(key: string) { + const entry = this._map.get(key); + if (entry) { + this._removeEntry(entry); + this._map.delete(key); + } + } + + recordClear() { + this._map.clear(); + this._head.next = this._tail; + this._tail.prev = this._head; + } + + getHead(): LruEntry | null { + const head = this._head.next; + if (!head || head === this._tail) { + return null; + } + return head; + } + + getSize(): number { + return this._map.size; + } +} diff --git a/packages/bonito-core/src/cache/memory-cache-manager.ts b/packages/bonito-core/src/cache/memory-cache-manager.ts index d6e00edd0..f23f0c229 100644 --- a/packages/bonito-core/src/cache/memory-cache-manager.ts +++ b/packages/bonito-core/src/cache/memory-cache-manager.ts @@ -1,37 +1,24 @@ -import { CacheManager } from "./cache-manager"; +import { CacheManagerBase } from "./cache-manager"; -export class MemoryCacheManager implements CacheManager { +export class MemoryCacheManager extends CacheManagerBase { private cache: Map = new Map(); - async get(key: string, defaultValue?: T): Promise { - return this.cache.has(key) ? (this.cache.get(key) as T) : defaultValue; - } - - async getOrAdd( + async getInternal( key: string, - addValue: () => Promise, - options?: { bypassCache?: boolean } - ): Promise { - if (!options?.bypassCache) { - const cached = await this.get(key); - if (cached) { - return cached; - } - } - const value = await addValue(); - await this.set(key, value); - return value; + defaultValue?: T + ): Promise { + return this.cache.has(key) ? (this.cache.get(key) as T) : defaultValue; } - async set(key: string, value: T): Promise { + async setInternal(key: string, value: T): Promise { this.cache.set(key, value); } - async remove(key: string): Promise { + async removeInternal(key: string): Promise { this.cache.delete(key); } - async clear(): Promise { + async clearInternal(): Promise { this.cache.clear(); } } From 19a507d191b63636e13e0d1ea663d3d5e65d457a Mon Sep 17 00:00:00 2001 From: Brenda Coronel Date: Mon, 10 Jun 2024 14:27:46 -0700 Subject: [PATCH 25/38] Start work on task list ui --- packages/playground/src/demo-routes.tsx | 2 +- .../src/demo/display/task-grid/utils.ts | 27 +++++++ .../display/task-list/task-list-live-demo.tsx | 36 +++++++++ packages/react/src/task/task-list.tsx | 1 + .../src/environment/batch-dependencies.ts | 3 + .../src/environment/environment-util.ts | 4 +- .../task/__tests__/fake-task-service.spec.ts | 7 ++ .../task/__tests__/live-task-service.spec.ts | 75 +++++++++++++++++++ .../service/src/task/fake-task-service.ts | 8 ++ packages/service/src/test-util/fakes.ts | 37 +++++++++ web/src/index.tsx | 2 + 11 files changed, 199 insertions(+), 3 deletions(-) create mode 100644 packages/playground/src/demo/display/task-list/task-list-live-demo.tsx create mode 100644 packages/react/src/task/task-list.tsx create mode 100644 packages/service/src/task/__tests__/live-task-service.spec.ts diff --git a/packages/playground/src/demo-routes.tsx b/packages/playground/src/demo-routes.tsx index a32d47ae9..0a8cd536d 100644 --- a/packages/playground/src/demo-routes.tsx +++ b/packages/playground/src/demo-routes.tsx @@ -13,7 +13,7 @@ import { DataGridLoadMoreDemo } from "./demo/display/task-grid/task-data-grid"; import { TabSelectorDemo } from "./demo/form/tab-selector-demo"; import { StringListDemo } from "./demo/form/stringlist/stringlist-demo"; import { VmExtensionListDemo } from "./demo/display/vm-extension/vm-extension-list-demo"; - +// add VmExtensionTaskListDemo here once created export const DEMO_MAP = { default: () => , actionform: () => , diff --git a/packages/playground/src/demo/display/task-grid/utils.ts b/packages/playground/src/demo/display/task-grid/utils.ts index 2e84a062a..52c341036 100644 --- a/packages/playground/src/demo/display/task-grid/utils.ts +++ b/packages/playground/src/demo/display/task-grid/utils.ts @@ -1,5 +1,7 @@ import { getLogger } from "@azure/bonito-core"; import { LoadMoreFn } from "@azure/bonito-ui/lib/hooks"; +// eslint-disable-next-line no-restricted-imports +import { BatchTaskOutput } from "@batch/ui-service/src/batch-models"; // ask abt this export interface DemoTask { name: string; @@ -94,3 +96,28 @@ export class DemoTasksLoader { return tasks; } } + +// Duplicated code used for intern project +export function generateTasksForList( + accountEndPoint: string, + jobId: string, + numOfTasks: number +): BatchTaskOutput[] { + if (!jobId) { + throw new Error("Cannot create a task without a valid job ID"); + } + + const taskOutput: BatchTaskOutput[] = []; + + const baseTaskUrl = `https://${accountEndPoint}/jobs/${jobId}/tasks/`; + + for (let i = 0; i < numOfTasks; i++) { + taskOutput.push({ + url: `${baseTaskUrl}task${i + 1}`, + id: `task${i + 1}`, + state: "active", + executionInfo: { retryCount: 0, requeueCount: 0 }, + }); + } + return taskOutput; +} diff --git a/packages/playground/src/demo/display/task-list/task-list-live-demo.tsx b/packages/playground/src/demo/display/task-list/task-list-live-demo.tsx new file mode 100644 index 000000000..6a20c9ef9 --- /dev/null +++ b/packages/playground/src/demo/display/task-list/task-list-live-demo.tsx @@ -0,0 +1,36 @@ +import { inject } from "@azure/bonito-core/lib/environment"; +import { TaskList } from "@batch/ui-react/lib/task/task-list"; +import { BatchDependencyName } from "@batch/ui-service/lib/environment/batch-dependencies"; +import { Stack } from "@fluentui/react/lib/Stack"; +import React from "react"; +import { DemoPane } from "../../../layout/demo-pane"; +import { LiveTaskService } from "@batch/ui-service"; + +export const TaskListLiveDemo: React.FC = () => { + const taskService: LiveTaskService = inject( + BatchDependencyName.TaskService + ); + const [accountEndpoint] = React.useState( + "dpwhobo.eastus2.batch.azure.com" + ); + const [jobId] = React.useState( + "HelloWorldJob-dawatrou-20240703-132020" + ); + + React.useEffect(() => { + return; + }, [taskService]); + + return ( + + + + + ); +}; diff --git a/packages/react/src/task/task-list.tsx b/packages/react/src/task/task-list.tsx new file mode 100644 index 000000000..48e000ae4 --- /dev/null +++ b/packages/react/src/task/task-list.tsx @@ -0,0 +1 @@ +// React Component that displays tasks in a table/grid. Calls TaskService to get data diff --git a/packages/service/src/environment/batch-dependencies.ts b/packages/service/src/environment/batch-dependencies.ts index 4c54ce85c..26f726eac 100644 --- a/packages/service/src/environment/batch-dependencies.ts +++ b/packages/service/src/environment/batch-dependencies.ts @@ -2,15 +2,18 @@ import { DependencyFactories } from "@azure/bonito-core/lib/environment"; import { NodeService } from "../node"; import { PoolService } from "../pool"; import { AccountService } from "../account"; +import { TaskService } from "../task/task-service"; export enum BatchDependencyName { PoolService = "poolService", NodeService = "nodeService", AccountService = "accountService", + TaskService = "taskService", } export interface BatchDependencyFactories extends DependencyFactories { [BatchDependencyName.PoolService]: () => PoolService; [BatchDependencyName.NodeService]: () => NodeService; [BatchDependencyName.AccountService]: () => AccountService; + [BatchDependencyName.TaskService]: () => TaskService; } diff --git a/packages/service/src/environment/environment-util.ts b/packages/service/src/environment/environment-util.ts index abcd4328f..1f50f3031 100644 --- a/packages/service/src/environment/environment-util.ts +++ b/packages/service/src/environment/environment-util.ts @@ -8,16 +8,16 @@ import { } from "@azure/bonito-core/lib/environment"; import { FakeNodeService } from "../node"; import { FakePoolService } from "../pool"; +import { FakeTaskService } from "../task/fake-task-service"; import { BatchDependencyFactories, BatchDependencyName, } from "./batch-dependencies"; -import { FakeAccountService } from "../account/fake-account-service"; export const mockBatchDepFactories: Partial = { [BatchDependencyName.PoolService]: () => new FakePoolService(), [BatchDependencyName.NodeService]: () => new FakeNodeService(), - [BatchDependencyName.AccountService]: () => new FakeAccountService(), + [BatchDependencyName.TaskService]: () => new FakeTaskService(), }; /** diff --git a/packages/service/src/task/__tests__/fake-task-service.spec.ts b/packages/service/src/task/__tests__/fake-task-service.spec.ts index e1f98ea32..b2d276b07 100644 --- a/packages/service/src/task/__tests__/fake-task-service.spec.ts +++ b/packages/service/src/task/__tests__/fake-task-service.spec.ts @@ -17,6 +17,13 @@ describe("FakeTaskService", () => { service.setFakes(fakeSet); }); + test("Generate tasks", async () => { + const task = await service.generateTasks(accountEndpoint, jobId, 3); + expect(task[0].id).toEqual("task1"); + expect(task[1].id).toEqual("task2"); + expect(task[2].id).toEqual("task3"); + }); + test("List batch tasks", async () => { const tasks = await service.listTasks(accountEndpoint, jobId); diff --git a/packages/service/src/task/__tests__/live-task-service.spec.ts b/packages/service/src/task/__tests__/live-task-service.spec.ts new file mode 100644 index 000000000..4ac9217f5 --- /dev/null +++ b/packages/service/src/task/__tests__/live-task-service.spec.ts @@ -0,0 +1,75 @@ +import { getMockEnvironment } from "@azure/bonito-core/lib/environment"; +import { MockHttpClient, MockHttpResponse } from "@azure/bonito-core/lib/http"; +import { BatchApiVersion } from "../../constants"; +import { initMockBatchEnvironment } from "../../environment"; +import { BasicBatchFakeSet, BatchFakeSet } from "../../test-util/fakes"; +import { LiveTaskService } from "../live-task-service"; +import { TaskService } from "../task-service"; + +describe("LiveTaskService", () => { + const hoboAcctEndpoint = "mercury.eastus.batch.azure.com"; + + let service: TaskService; + let fakeSet: BatchFakeSet; + + let httpClient: MockHttpClient; + + beforeEach(() => { + initMockBatchEnvironment(); + httpClient = getMockEnvironment().getHttpClient(); + service = new LiveTaskService(); + fakeSet = new BasicBatchFakeSet(); + }); + + test("Simple get", async () => { + httpClient.addExpected( + new MockHttpResponse( + `https://${hoboAcctEndpoint}/jobs/faketestjob1/tasks/task1?api-version=${BatchApiVersion.data}`, + { + status: 200, + body: JSON.stringify( + fakeSet.getTask( + hoboAcctEndpoint, + "faketestjob1", + "task1" + ) + ), + } + ) + ); + + const task = await service.getTask( + hoboAcctEndpoint, + "faketestjob1", + "task1" + ); + expect(task).toBeDefined(); + expect(task?.id).toEqual("task1"); + }); + + test("List by job", async () => { + httpClient.addExpected( + new MockHttpResponse( + `https://${hoboAcctEndpoint}/jobs/faketestjob1/tasks?api-version=${BatchApiVersion.data}`, + { + status: 200, + body: JSON.stringify({ + value: fakeSet.listTasks( + hoboAcctEndpoint, + "faketestjob1" + ), + }), + } + ) + ); + + const tasks = await service.listTasks(hoboAcctEndpoint, "faketestjob1"); + const allTasks = []; + for await (const task of tasks) { + allTasks.push(task); + } + expect(allTasks.length).toBe(2); + expect(allTasks[0].id).toEqual("taska"); + expect(allTasks[1].id).toEqual("task1"); + }); +}); diff --git a/packages/service/src/task/fake-task-service.ts b/packages/service/src/task/fake-task-service.ts index d8d37ca5d..24b87ac39 100644 --- a/packages/service/src/task/fake-task-service.ts +++ b/packages/service/src/task/fake-task-service.ts @@ -25,4 +25,12 @@ export class FakeTaskService implements TaskService { ): Promise> { return createPagedArray(this.fakeSet.listTasks(accountEndpoint, jobId)); } + + async generateTasks( + accountEndpoint: string, + jobId: string, + numOfTasks: number + ): Promise { + return this.fakeSet.generateTasks(accountEndpoint, jobId, numOfTasks); + } } diff --git a/packages/service/src/test-util/fakes.ts b/packages/service/src/test-util/fakes.ts index 30e71ee73..2b61c73d7 100644 --- a/packages/service/src/test-util/fakes.ts +++ b/packages/service/src/test-util/fakes.ts @@ -113,6 +113,19 @@ export interface BatchFakeSet extends FakeSet { * @param jobId */ listTasks(accountEndpoint: string, jobId: string): BatchTaskOutput[]; + + /** + * Generate tasks + * + * @param accountEndpoint + * @param jobId + * @param numOfTasks The number of tasks to generate + */ + generateTasks( + accountEndpoint: string, + jobId: string, + numOfTasks: number + ): BatchTaskOutput[]; } export abstract class AbstractBatchFakeSet @@ -252,6 +265,30 @@ export abstract class AbstractBatchFakeSet ) .map((entry) => entry[1]); } + + generateTasks( + accountEndPoint: string, + jobId: string, + numOfTasks: number + ): BatchTaskOutput[] { + if (!jobId) { + throw new Error("Cannot create a task without a valid job ID"); + } + + const taskOutput: BatchTaskOutput[] = []; + + const baseTaskUrl = `https://${accountEndPoint}/jobs/${jobId}/tasks/`; + + for (let i = 0; i < numOfTasks; i++) { + taskOutput.push({ + url: `${baseTaskUrl}task${i + 1}`, + id: `task${i + 1}`, + state: "active", + executionInfo: { retryCount: 0, requeueCount: 0 }, + }); + } + return taskOutput; + } } export class BasicBatchFakeSet extends AbstractBatchFakeSet { diff --git a/web/src/index.tsx b/web/src/index.tsx index e9afdd31d..1e7505886 100644 --- a/web/src/index.tsx +++ b/web/src/index.tsx @@ -25,6 +25,7 @@ import { import { FakeNodeService } from "@batch/ui-service"; import { BatchDependencyName } from "@batch/ui-service/lib/environment"; import { FakePoolService } from "@batch/ui-service/lib/pool"; +import { FakeTaskService } from "@batch/ui-service/lib/task/fake-task-service"; import * as React from "react"; import * as ReactDOM from "react-dom"; import { Application } from "./components"; @@ -68,6 +69,7 @@ export async function init(rootEl: HTMLElement): Promise { [DependencyName.CacheManager]: () => new MemoryCacheManager(), [BatchDependencyName.PoolService]: () => new FakePoolService(), [BatchDependencyName.NodeService]: () => new FakeNodeService(), + [BatchDependencyName.TaskService]: () => new FakeTaskService(), [BatchDependencyName.AccountService]: () => new FakeAccountService(), [DependencyName.ResourceGroupService]: () => From 110366007db92ed4f88d965a688fa036a071aa7f Mon Sep 17 00:00:00 2001 From: Brenda Coronel Date: Thu, 13 Jun 2024 11:32:55 -0700 Subject: [PATCH 26/38] Playground demo testing --- package-lock.json | 9 ++ package.json | 3 +- packages/playground/src/demo-routes.tsx | 4 +- .../src/demo/display/task-grid/utils.ts | 10 +- .../demo/display/task-list/task-list-demo.tsx | 33 +++++++ .../playground/src/layout/demo-nav-menu.tsx | 5 + packages/react/src/task/task-list.tsx | 95 ++++++++++++++++++- .../service/src/task/live-task-service.ts | 8 +- 8 files changed, 156 insertions(+), 11 deletions(-) create mode 100644 packages/playground/src/demo/display/task-list/task-list-demo.tsx diff --git a/package-lock.json b/package-lock.json index d709e6940..fe1136e5b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,6 +18,7 @@ "monaco-editor": "~0.31.0", "react": "17.0.2", "react-dom": "17.0.2", + "react-icons": "^5.2.1", "tslib": "^2.3.1" }, "devDependencies": { @@ -10823,6 +10824,14 @@ "react": ">=16.13.1" } }, + "node_modules/react-icons": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-5.2.1.tgz", + "integrity": "sha512-zdbW5GstTzXaVKvGSyTaBalt7HSfuK5ovrzlpyiWHAFXndXTdd/1hdDHI4xBM1Mn7YriT6aqESucFl9kEXzrdw==", + "peerDependencies": { + "react": "*" + } + }, "node_modules/react-is": { "version": "16.13.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", diff --git a/package.json b/package.json index a0aab0069..fe75124ce 100644 --- a/package.json +++ b/package.json @@ -24,12 +24,12 @@ "monaco-editor": "~0.31.0", "react": "17.0.2", "react-dom": "17.0.2", + "react-icons": "^5.2.1", "tslib": "^2.3.1" }, "devDependencies": { "@azure-tools/typespec-client-generator-cli": "^0.3.0", "@lerna/legacy-package-management": "7.1.5", - "@typespec/compiler": "^0.50.0", "@octokit/core": "^3.5.1", "@testing-library/react": "^12.0.0", "@testing-library/react-hooks": "^8.0.0", @@ -38,6 +38,7 @@ "@types/react-dom": "^17.0.18", "@typescript-eslint/eslint-plugin": "^5.13.0", "@typescript-eslint/parser": "^5.13.0", + "@typespec/compiler": "^0.50.0", "autorest": "^3.6.3", "cross-env": "^7.0.3", "eslint": "^8.10.0", diff --git a/packages/playground/src/demo-routes.tsx b/packages/playground/src/demo-routes.tsx index 0a8cd536d..88c7330fb 100644 --- a/packages/playground/src/demo-routes.tsx +++ b/packages/playground/src/demo-routes.tsx @@ -13,7 +13,8 @@ import { DataGridLoadMoreDemo } from "./demo/display/task-grid/task-data-grid"; import { TabSelectorDemo } from "./demo/form/tab-selector-demo"; import { StringListDemo } from "./demo/form/stringlist/stringlist-demo"; import { VmExtensionListDemo } from "./demo/display/vm-extension/vm-extension-list-demo"; -// add VmExtensionTaskListDemo here once created +import { TaskListDemo } from "./demo/display/task-list/task-list-demo"; + export const DEMO_MAP = { default: () => , actionform: () => , @@ -30,6 +31,7 @@ export const DEMO_MAP = { dataGridLoadMore: () => , stringlist: () => , vmExtensionList: () => , + taskList: () => , }; export type DemoName = keyof typeof DEMO_MAP; diff --git a/packages/playground/src/demo/display/task-grid/utils.ts b/packages/playground/src/demo/display/task-grid/utils.ts index 52c341036..b7b4ba51e 100644 --- a/packages/playground/src/demo/display/task-grid/utils.ts +++ b/packages/playground/src/demo/display/task-grid/utils.ts @@ -1,7 +1,6 @@ import { getLogger } from "@azure/bonito-core"; import { LoadMoreFn } from "@azure/bonito-ui/lib/hooks"; -// eslint-disable-next-line no-restricted-imports -import { BatchTaskOutput } from "@batch/ui-service/src/batch-models"; // ask abt this +import { BatchTaskOutput } from "@batch/ui-service/lib/batch-models"; export interface DemoTask { name: string; @@ -115,8 +114,11 @@ export function generateTasksForList( taskOutput.push({ url: `${baseTaskUrl}task${i + 1}`, id: `task${i + 1}`, - state: "active", - executionInfo: { retryCount: 0, requeueCount: 0 }, + state: Math.random() > 0.5 ? "active" : "completed", + executionInfo: { + retryCount: Math.random() > 0.5 ? 0 : 1, + requeueCount: Math.random() > 0.5 ? 0 : 1, + }, }); } return taskOutput; diff --git a/packages/playground/src/demo/display/task-list/task-list-demo.tsx b/packages/playground/src/demo/display/task-list/task-list-demo.tsx new file mode 100644 index 000000000..c85eb6479 --- /dev/null +++ b/packages/playground/src/demo/display/task-list/task-list-demo.tsx @@ -0,0 +1,33 @@ +import React from "react"; +import { TaskList } from "@batch/ui-react/lib/task/task-list"; +import { DemoPane } from "../../../layout/demo-pane"; + +// TODO: look at vm-extension-list.tsx & vm-extension-list-demo.tsx +// Donutchart created here too +export const TaskListDemo: React.FC = () => { + // const [accountEndpoint] = React.useState("accountTest"); + // const [jobId] = React.useState("jobIdTest"); + const [numOfTasks] = React.useState(5); + + return ( + + + + ); +}; + +//DonutChart should be here under DemoPane +/* + + + + +*/ diff --git a/packages/playground/src/layout/demo-nav-menu.tsx b/packages/playground/src/layout/demo-nav-menu.tsx index 41b4f5ebd..49f7ec63e 100644 --- a/packages/playground/src/layout/demo-nav-menu.tsx +++ b/packages/playground/src/layout/demo-nav-menu.tsx @@ -90,6 +90,11 @@ export const DemoNavMenu: React.FC = () => { name: "VMExtension List Display", url: getDemoHash("vmExtensionList"), }, + { + key: "TaskList", + name: "Task List Display", + url: getDemoHash("taskList"), + }, ], }, ]; diff --git a/packages/react/src/task/task-list.tsx b/packages/react/src/task/task-list.tsx index 48e000ae4..d768d8ae2 100644 --- a/packages/react/src/task/task-list.tsx +++ b/packages/react/src/task/task-list.tsx @@ -1 +1,94 @@ -// React Component that displays tasks in a table/grid. Calls TaskService to get data +import React from "react"; +import { CiCircleCheck, CiClock1 } from "react-icons/ci"; +import { + DataGrid, + DataGridColumn, +} from "@azure/bonito-ui/lib/components/data-grid"; +import { BatchTaskOutput } from "@batch/ui-service/lib/batch-models"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { inject } from "@azure/bonito-core/lib/environment"; +import { BatchDependencyName } from "@batch/ui-service/lib/environment"; +import { TaskService } from "@batch/ui-service/lib/task/task-service"; + +interface TaskListProps { + accountEndpoint: string; + jobId: string; + numOfTasks: number; +} + +interface taskRow extends BatchTaskOutput { + url?: string | undefined; + id?: string | undefined; + state?: string | undefined; +} + +export const TaskList = (props: TaskListProps) => { + const { accountEndpoint, jobId, numOfTasks } = props; + const [isCompact] = React.useState(false); + const [items, setItems] = React.useState([]); + + React.useEffect(() => { + let isMounted = true; + + const taskService: TaskService = inject( + BatchDependencyName.TaskService + ); + + taskService.listTasks(accountEndpoint, jobId).then((tasks) => { + if (!isMounted) return; + + console.log(tasks); + }); + + return () => { + isMounted = false; + }; + }, [accountEndpoint, jobId, numOfTasks]); + + return ( + <> + + + ); +}; + +const columns: DataGridColumn[] = [ + { + label: "Url", + prop: "url", + minWidth: 100, + maxWidth: 150, + }, + { + label: "Name", + prop: "id", + minWidth: 100, + maxWidth: 150, + onRender: (task: any) => { + return {task.id}; + }, + }, + { + label: "State", + prop: "state", + minWidth: 150, + maxWidth: 200, + onRender: (task: any) => { + return ( +
+ {task.state == "completed" ? ( + + ) : ( + + )} + {task.state} +
+ ); + }, + }, + { + label: "ExecutionInfo", + prop: "executioninfo", + minWidth: 150, + }, +]; diff --git a/packages/service/src/task/live-task-service.ts b/packages/service/src/task/live-task-service.ts index fca39fb5c..2640b4c12 100644 --- a/packages/service/src/task/live-task-service.ts +++ b/packages/service/src/task/live-task-service.ts @@ -23,13 +23,13 @@ export class LiveTaskService } async listTasks( - accountResourceId: string, + accountEndpoint: string, jobId: string, opts?: OperationOptions ): Promise> { const listTaskPath = "/jobs/{jobId}/tasks"; const batchClient = createBatchClient( - this._ensureHttpsEndpoint(accountResourceId) + this._ensureHttpsEndpoint(accountEndpoint) ); const res = await batchClient.path(listTaskPath, jobId).get({ @@ -46,14 +46,14 @@ export class LiveTaskService } async getTask( - accountResourceId: string, + accountEndpoint: string, jobId: string, taskId: string, opts?: OperationOptions ): Promise { const taskPath = "/jobs/{jobId}/tasks/{taskId}"; const batchClient = createBatchClient( - this._ensureHttpsEndpoint(accountResourceId) + this._ensureHttpsEndpoint(accountEndpoint) ); const res = await batchClient.path(taskPath, jobId, taskId).get({ headers: { From 134658b7a524b4ce401593b913d9e900fb95b547 Mon Sep 17 00:00:00 2001 From: Brenda Coronel Date: Tue, 18 Jun 2024 10:26:27 -0700 Subject: [PATCH 27/38] Playground service modification and slider added --- .../demo/display/task-list/task-list-demo.tsx | 48 +++--- packages/react/src/task/task-list.js | 161 ++++++++++++++++++ packages/react/src/task/task-list.tsx | 35 +++- .../task/__tests__/fake-task-service.spec.ts | 16 +- .../task/__tests__/live-task-service.spec.ts | 7 +- .../service/src/task/fake-task-service.ts | 16 +- packages/service/src/test-util/fakes.ts | 68 +++++--- 7 files changed, 288 insertions(+), 63 deletions(-) create mode 100644 packages/react/src/task/task-list.js diff --git a/packages/playground/src/demo/display/task-list/task-list-demo.tsx b/packages/playground/src/demo/display/task-list/task-list-demo.tsx index c85eb6479..b100845eb 100644 --- a/packages/playground/src/demo/display/task-list/task-list-demo.tsx +++ b/packages/playground/src/demo/display/task-list/task-list-demo.tsx @@ -1,33 +1,39 @@ import React from "react"; import { TaskList } from "@batch/ui-react/lib/task/task-list"; import { DemoPane } from "../../../layout/demo-pane"; +import { Stack } from "@fluentui/react/lib/Stack"; +import { Slider } from "@fluentui/react/lib/Slider"; -// TODO: look at vm-extension-list.tsx & vm-extension-list-demo.tsx -// Donutchart created here too export const TaskListDemo: React.FC = () => { - // const [accountEndpoint] = React.useState("accountTest"); - // const [jobId] = React.useState("jobIdTest"); - const [numOfTasks] = React.useState(5); + const [taskNumberSlider, setTaskNumberSlider] = React.useState(0); + const taskNumberSliderOnChange = (value: number) => { + setTaskNumberSlider(value); + }; return ( - + + + + + + ); }; - -//DonutChart should be here under DemoPane -/* - - - - -*/ diff --git a/packages/react/src/task/task-list.js b/packages/react/src/task/task-list.js new file mode 100644 index 000000000..492032ac5 --- /dev/null +++ b/packages/react/src/task/task-list.js @@ -0,0 +1,161 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __asyncValues = (this && this.__asyncValues) || function (o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TaskList = void 0; +var react_1 = require("react"); +var ci_1 = require("react-icons/ci"); +var data_grid_1 = require("@azure/bonito-ui/lib/components/data-grid"); +var environment_1 = require("@azure/bonito-core/lib/environment"); +var environment_2 = require("@batch/ui-service/lib/environment"); +var TaskList = function (props) { + var accountEndpoint = props.accountEndpoint, jobId = props.jobId, numOfTasks = props.numOfTasks; + var isCompact = react_1.default.useState(false)[0]; + var _a = react_1.default.useState([]), items = _a[0], setItems = _a[1]; + react_1.default.useEffect(function () { + var isMounted = true; + var taskService = (0, environment_1.inject)(environment_2.BatchDependencyName.TaskService); + var fetchTaskList = function () { return __awaiter(void 0, void 0, void 0, function () { + var tasks, auxList, _a, tasks_1, tasks_1_1, task, e_1_1; + var _b, e_1, _c, _d; + return __generator(this, function (_e) { + switch (_e.label) { + case 0: + if (!isMounted) + return [2 /*return*/]; + return [4 /*yield*/, taskService.listTasks(accountEndpoint, jobId)]; + case 1: + tasks = _e.sent(); + auxList = []; + _e.label = 2; + case 2: + _e.trys.push([2, 7, 8, 13]); + _a = true, tasks_1 = __asyncValues(tasks); + _e.label = 3; + case 3: return [4 /*yield*/, tasks_1.next()]; + case 4: + if (!(tasks_1_1 = _e.sent(), _b = tasks_1_1.done, !_b)) return [3 /*break*/, 6]; + _d = tasks_1_1.value; + _a = false; + task = _d; + auxList.push(task); + _e.label = 5; + case 5: + _a = true; + return [3 /*break*/, 3]; + case 6: return [3 /*break*/, 13]; + case 7: + e_1_1 = _e.sent(); + e_1 = { error: e_1_1 }; + return [3 /*break*/, 13]; + case 8: + _e.trys.push([8, , 11, 12]); + if (!(!_a && !_b && (_c = tasks_1.return))) return [3 /*break*/, 10]; + return [4 /*yield*/, _c.call(tasks_1)]; + case 9: + _e.sent(); + _e.label = 10; + case 10: return [3 /*break*/, 12]; + case 11: + if (e_1) throw e_1.error; + return [7 /*endfinally*/]; + case 12: return [7 /*endfinally*/]; + case 13: + setItems(auxList); + return [2 /*return*/]; + } + }); + }); }; + fetchTaskList().catch(function (e) { + console.log("Error: ", e); + }); + return function () { + isMounted = false; + }; + }, [accountEndpoint, jobId, numOfTasks]); + return (<> + + ); +}; +exports.TaskList = TaskList; +var columns = [ + { + label: "Url", + prop: "url", + minWidth: 100, + maxWidth: 150, + }, + { + label: "Name", + prop: "id", + minWidth: 100, + maxWidth: 150, + onRender: function (task) { + return {task.id}; + }, + }, + { + label: "State", + prop: "state", + minWidth: 150, + maxWidth: 200, + onRender: function (task) { + return (
+ {task.state == "completed" ? () : ()} + {task.state} +
); + }, + }, + { + label: "ExecutionInfo", + prop: "executioninfo", + minWidth: 150, + onRender: function (task) { + return (
+ Retry count: {task.executionInfo.retryCount} {"\n"} + Requeue count: {task.executionInfo.requeueCount} +
); + }, + }, +]; diff --git a/packages/react/src/task/task-list.tsx b/packages/react/src/task/task-list.tsx index d768d8ae2..ab4d3f8ce 100644 --- a/packages/react/src/task/task-list.tsx +++ b/packages/react/src/task/task-list.tsx @@ -5,7 +5,6 @@ import { DataGridColumn, } from "@azure/bonito-ui/lib/components/data-grid"; import { BatchTaskOutput } from "@batch/ui-service/lib/batch-models"; -import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { inject } from "@azure/bonito-core/lib/environment"; import { BatchDependencyName } from "@batch/ui-service/lib/environment"; import { TaskService } from "@batch/ui-service/lib/task/task-service"; @@ -34,10 +33,26 @@ export const TaskList = (props: TaskListProps) => { BatchDependencyName.TaskService ); - taskService.listTasks(accountEndpoint, jobId).then((tasks) => { + const fetchTaskList = async () => { if (!isMounted) return; - console.log(tasks); + const tasks = await taskService.listTasks(accountEndpoint, jobId); + + const auxList = []; + for await (const task of tasks) { + auxList.push({ + url: task.url, + id: task.id, + state: " " + task.state, + executionInfo: task.executionInfo, + }); + } + + setItems(auxList); + }; + + fetchTaskList().catch((e) => { + console.log("Error: ", e); }); return () => { @@ -45,11 +60,7 @@ export const TaskList = (props: TaskListProps) => { }; }, [accountEndpoint, jobId, numOfTasks]); - return ( - <> - - - ); + return ; }; const columns: DataGridColumn[] = [ @@ -90,5 +101,13 @@ const columns: DataGridColumn[] = [ label: "ExecutionInfo", prop: "executioninfo", minWidth: 150, + onRender: (task: any) => { + return ( +
+ Retry count: {task.executionInfo.retryCount} {"\n"} + Requeue count: {task.executionInfo.requeueCount} +
+ ); + }, }, ]; diff --git a/packages/service/src/task/__tests__/fake-task-service.spec.ts b/packages/service/src/task/__tests__/fake-task-service.spec.ts index b2d276b07..75e52e1f5 100644 --- a/packages/service/src/task/__tests__/fake-task-service.spec.ts +++ b/packages/service/src/task/__tests__/fake-task-service.spec.ts @@ -5,7 +5,8 @@ import { FakeTaskService } from "../fake-task-service"; describe("FakeTaskService", () => { const accountEndpoint = "mercury.eastus.batch.azure.com"; const jobId = `faketestjob1`; - const taskIds = ["taska", "task1"]; + const taskIds = ["task1", "task2", "task3"]; + const harcodedTaskIds = ["taska", "task1"]; let service: FakeTaskService; let fakeSet: BatchFakeSet; @@ -18,7 +19,7 @@ describe("FakeTaskService", () => { }); test("Generate tasks", async () => { - const task = await service.generateTasks(accountEndpoint, jobId, 3); + const task = await service.generateTasks(accountEndpoint, jobId); expect(task[0].id).toEqual("task1"); expect(task[1].id).toEqual("task2"); expect(task[2].id).toEqual("task3"); @@ -46,4 +47,15 @@ describe("FakeTaskService", () => { expect(taskNum.id).toEqual("task1"); expect(taskLetter.id).toEqual("taska"); }); + + test("List hardcoded batch tasks", async () => { + const tasks = await service.listHardcodedTasks(accountEndpoint, jobId); + + const allTasks = []; + + for await (const task of tasks) { + allTasks.push(task); + } + expect(allTasks.map((task) => task.id)).toEqual(harcodedTaskIds); + }); }); diff --git a/packages/service/src/task/__tests__/live-task-service.spec.ts b/packages/service/src/task/__tests__/live-task-service.spec.ts index 4ac9217f5..5957deb23 100644 --- a/packages/service/src/task/__tests__/live-task-service.spec.ts +++ b/packages/service/src/task/__tests__/live-task-service.spec.ts @@ -68,8 +68,9 @@ describe("LiveTaskService", () => { for await (const task of tasks) { allTasks.push(task); } - expect(allTasks.length).toBe(2); - expect(allTasks[0].id).toEqual("taska"); - expect(allTasks[1].id).toEqual("task1"); + expect(allTasks.length).toBe(3); + expect(allTasks[0].id).toEqual("task1"); + expect(allTasks[1].id).toEqual("task2"); + expect(allTasks[2].id).toEqual("task3"); }); }); diff --git a/packages/service/src/task/fake-task-service.ts b/packages/service/src/task/fake-task-service.ts index 24b87ac39..e739ae951 100644 --- a/packages/service/src/task/fake-task-service.ts +++ b/packages/service/src/task/fake-task-service.ts @@ -23,14 +23,22 @@ export class FakeTaskService implements TaskService { accountEndpoint: string, jobId: string ): Promise> { - return createPagedArray(this.fakeSet.listTasks(accountEndpoint, jobId)); + const res = this.fakeSet.listTasks(accountEndpoint, jobId); + return createPagedArray(res); } async generateTasks( accountEndpoint: string, - jobId: string, - numOfTasks: number + jobId: string ): Promise { - return this.fakeSet.generateTasks(accountEndpoint, jobId, numOfTasks); + return this.fakeSet.generateTasks(accountEndpoint, jobId); + } + + async listHardcodedTasks( + accountEndpoint: string, + jobId: string + ): Promise> { + const res = this.fakeSet.listHardcodedTask(accountEndpoint, jobId); + return createPagedArray(res); } } diff --git a/packages/service/src/test-util/fakes.ts b/packages/service/src/test-util/fakes.ts index 2b61c73d7..875a452dc 100644 --- a/packages/service/src/test-util/fakes.ts +++ b/packages/service/src/test-util/fakes.ts @@ -119,12 +119,18 @@ export interface BatchFakeSet extends FakeSet { * * @param accountEndpoint * @param jobId - * @param numOfTasks The number of tasks to generate */ - generateTasks( + generateTasks(accountEndpoint: string, jobId: string): BatchTaskOutput[]; + + /** + * List hardcoded tasks in fakes + * + * @param accountEndpoint + * @param jobId + */ + listHardcodedTask( accountEndpoint: string, - jobId: string, - numOfTasks: number + jobId: string ): BatchTaskOutput[]; } @@ -251,26 +257,7 @@ export abstract class AbstractBatchFakeSet ]; } - listTasks(accountEndpoint: string, jobId: string): BatchTaskOutput[] { - if (!jobId) { - return []; - } - - return Object.entries(this.batchTasks) - .filter((entry) => - startsWithIgnoreCase( - entry[0], - `${accountEndpoint}:${jobId}`.toLowerCase() - ) - ) - .map((entry) => entry[1]); - } - - generateTasks( - accountEndPoint: string, - jobId: string, - numOfTasks: number - ): BatchTaskOutput[] { + generateTasks(accountEndPoint: string, jobId: string): BatchTaskOutput[] { if (!jobId) { throw new Error("Cannot create a task without a valid job ID"); } @@ -279,7 +266,7 @@ export abstract class AbstractBatchFakeSet const baseTaskUrl = `https://${accountEndPoint}/jobs/${jobId}/tasks/`; - for (let i = 0; i < numOfTasks; i++) { + for (let i = 0; i < 3; i++) { taskOutput.push({ url: `${baseTaskUrl}task${i + 1}`, id: `task${i + 1}`, @@ -289,6 +276,37 @@ export abstract class AbstractBatchFakeSet } return taskOutput; } + + listTasks(accountEndpoint: string, jobId: string): BatchTaskOutput[] { + if (!jobId) { + return []; + } + + const tasks: BatchTaskOutput[] = this.generateTasks( + accountEndpoint, + jobId + ); + + return tasks; + } + + listHardcodedTask( + accountEndpoint: string, + jobId: string + ): BatchTaskOutput[] { + if (!jobId) { + return []; + } + + return Object.entries(this.batchTasks) + .filter((entry) => + startsWithIgnoreCase( + entry[0], + `${accountEndpoint}:${jobId}`.toLowerCase() + ) + ) + .map((entry) => entry[1]); + } } export class BasicBatchFakeSet extends AbstractBatchFakeSet { From 6e26337e063dd7c2459651d768207f4c6fdf7d01 Mon Sep 17 00:00:00 2001 From: Brenda Coronel Date: Wed, 19 Jun 2024 14:03:25 -0700 Subject: [PATCH 28/38] Playground demo changes --- .../src/demo/display/task-grid/utils.ts | 28 ------- .../demo/display/task-list/task-list-demo.tsx | 14 +++- packages/react/src/task/task-list.tsx | 84 ++++++++++++++----- .../service/src/task/fake-task-service.ts | 18 +--- packages/service/src/test-util/fakes.ts | 67 ++++++++++++++- 5 files changed, 139 insertions(+), 72 deletions(-) diff --git a/packages/playground/src/demo/display/task-grid/utils.ts b/packages/playground/src/demo/display/task-grid/utils.ts index b7b4ba51e..d72f3f15b 100644 --- a/packages/playground/src/demo/display/task-grid/utils.ts +++ b/packages/playground/src/demo/display/task-grid/utils.ts @@ -95,31 +95,3 @@ export class DemoTasksLoader { return tasks; } } - -// Duplicated code used for intern project -export function generateTasksForList( - accountEndPoint: string, - jobId: string, - numOfTasks: number -): BatchTaskOutput[] { - if (!jobId) { - throw new Error("Cannot create a task without a valid job ID"); - } - - const taskOutput: BatchTaskOutput[] = []; - - const baseTaskUrl = `https://${accountEndPoint}/jobs/${jobId}/tasks/`; - - for (let i = 0; i < numOfTasks; i++) { - taskOutput.push({ - url: `${baseTaskUrl}task${i + 1}`, - id: `task${i + 1}`, - state: Math.random() > 0.5 ? "active" : "completed", - executionInfo: { - retryCount: Math.random() > 0.5 ? 0 : 1, - requeueCount: Math.random() > 0.5 ? 0 : 1, - }, - }); - } - return taskOutput; -} diff --git a/packages/playground/src/demo/display/task-list/task-list-demo.tsx b/packages/playground/src/demo/display/task-list/task-list-demo.tsx index b100845eb..d9b26f8f1 100644 --- a/packages/playground/src/demo/display/task-list/task-list-demo.tsx +++ b/packages/playground/src/demo/display/task-list/task-list-demo.tsx @@ -1,8 +1,11 @@ -import React from "react"; +import { inject } from "@azure/bonito-core/lib/environment"; import { TaskList } from "@batch/ui-react/lib/task/task-list"; -import { DemoPane } from "../../../layout/demo-pane"; -import { Stack } from "@fluentui/react/lib/Stack"; +import { BatchDependencyName } from "@batch/ui-service/lib/environment/batch-dependencies"; +import { FakeTaskService } from "@batch/ui-service/lib/task/fake-task-service"; import { Slider } from "@fluentui/react/lib/Slider"; +import { Stack } from "@fluentui/react/lib/Stack"; +import React from "react"; +import { DemoPane } from "../../../layout/demo-pane"; export const TaskListDemo: React.FC = () => { const [taskNumberSlider, setTaskNumberSlider] = React.useState(0); @@ -10,6 +13,10 @@ export const TaskListDemo: React.FC = () => { setTaskNumberSlider(value); }; + const taskService: FakeTaskService = inject( + BatchDependencyName.TaskService + ); + return ( { ); diff --git a/packages/react/src/task/task-list.tsx b/packages/react/src/task/task-list.tsx index ab4d3f8ce..14e3e9391 100644 --- a/packages/react/src/task/task-list.tsx +++ b/packages/react/src/task/task-list.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { CiCircleCheck, CiClock1 } from "react-icons/ci"; +import { CiCircleCheck, CiAvocado } from "react-icons/ci"; import { DataGrid, DataGridColumn, @@ -8,11 +8,12 @@ import { BatchTaskOutput } from "@batch/ui-service/lib/batch-models"; import { inject } from "@azure/bonito-core/lib/environment"; import { BatchDependencyName } from "@batch/ui-service/lib/environment"; import { TaskService } from "@batch/ui-service/lib/task/task-service"; +import { CiCircleChevDown } from "react-icons/ci"; +import { IconButton } from "@fluentui/react/lib/Button"; interface TaskListProps { accountEndpoint: string; jobId: string; - numOfTasks: number; } interface taskRow extends BatchTaskOutput { @@ -22,7 +23,7 @@ interface taskRow extends BatchTaskOutput { } export const TaskList = (props: TaskListProps) => { - const { accountEndpoint, jobId, numOfTasks } = props; + const { accountEndpoint, jobId } = props; const [isCompact] = React.useState(false); const [items, setItems] = React.useState([]); @@ -38,17 +39,18 @@ export const TaskList = (props: TaskListProps) => { const tasks = await taskService.listTasks(accountEndpoint, jobId); - const auxList = []; + const items = []; for await (const task of tasks) { - auxList.push({ + items.push({ url: task.url, id: task.id, - state: " " + task.state, + state: task.state, + creationTime: task.creationTime, executionInfo: task.executionInfo, }); } - setItems(auxList); + setItems(items); }; fetchTaskList().catch((e) => { @@ -58,20 +60,21 @@ export const TaskList = (props: TaskListProps) => { return () => { isMounted = false; }; - }, [accountEndpoint, jobId, numOfTasks]); + }, [accountEndpoint, jobId]); - return ; + return ( + + ); }; const columns: DataGridColumn[] = [ { - label: "Url", - prop: "url", - minWidth: 100, - maxWidth: 150, - }, - { - label: "Name", + label: "Task", prop: "id", minWidth: 100, maxWidth: 150, @@ -87,10 +90,20 @@ const columns: DataGridColumn[] = [ onRender: (task: any) => { return (
- {task.state == "completed" ? ( - + {task.state === "completed" ? ( + ) : ( - + )} {task.state}
@@ -98,8 +111,17 @@ const columns: DataGridColumn[] = [ }, }, { - label: "ExecutionInfo", - prop: "executioninfo", + label: "Created", + prop: "created", + minWidth: 150, + maxWidth: 200, + onRender: (task: any) => { + return
{task.creationTime}
; + }, + }, + { + label: "Exit Code", + prop: "exitcode", minWidth: 150, onRender: (task: any) => { return ( @@ -110,4 +132,24 @@ const columns: DataGridColumn[] = [ ); }, }, + { + label: " ", + prop: " ", + minWidth: 150, + onRender: (task: any) => { + return ( +
+ + + +
+ ); + }, + }, ]; +/** + + */ diff --git a/packages/service/src/task/fake-task-service.ts b/packages/service/src/task/fake-task-service.ts index e739ae951..d8d37ca5d 100644 --- a/packages/service/src/task/fake-task-service.ts +++ b/packages/service/src/task/fake-task-service.ts @@ -23,22 +23,6 @@ export class FakeTaskService implements TaskService { accountEndpoint: string, jobId: string ): Promise> { - const res = this.fakeSet.listTasks(accountEndpoint, jobId); - return createPagedArray(res); - } - - async generateTasks( - accountEndpoint: string, - jobId: string - ): Promise { - return this.fakeSet.generateTasks(accountEndpoint, jobId); - } - - async listHardcodedTasks( - accountEndpoint: string, - jobId: string - ): Promise> { - const res = this.fakeSet.listHardcodedTask(accountEndpoint, jobId); - return createPagedArray(res); + return createPagedArray(this.fakeSet.listTasks(accountEndpoint, jobId)); } } diff --git a/packages/service/src/test-util/fakes.ts b/packages/service/src/test-util/fakes.ts index 875a452dc..b0a70a619 100644 --- a/packages/service/src/test-util/fakes.ts +++ b/packages/service/src/test-util/fakes.ts @@ -258,6 +258,46 @@ export abstract class AbstractBatchFakeSet } generateTasks(accountEndPoint: string, jobId: string): BatchTaskOutput[] { + /* + function getRandomDateTime(): string { + const year = Math.floor(Math.random() * 50) + 2020; + const month = Math.floor(Math.random() * 12); + const day = Math.floor(Math.random() * 28) + 1; + const hours = Math.floor(Math.random() * 24); + const minutes = Math.floor(Math.random() * 60); + const seconds = Math.floor(Math.random() * 60); // Random second + + const date = new Date(year, month, day, hours, minutes, seconds); + return date.toString(); + } + */ + + function getRandomDateTime(): string { + const year = Math.floor(Math.random() * 50) + 2020; + const month = Math.floor(Math.random() * 12); + const day = Math.floor(Math.random() * 28); // Assume all months have 28 days for simplicity + const hours = Math.floor(Math.random() * 24); + const minutes = Math.floor(Math.random() * 60); + const seconds = Math.floor(Math.random() * 60); + + const date = new Date(year, month, day, hours, minutes, seconds); + + // Format the date and time + const formattedDateTime = date.toLocaleString("en-US", { + year: "numeric", + month: "short", + day: "numeric", + hour: "2-digit", + minute: "2-digit", + second: "2-digit", + }); + + return formattedDateTime; + } + + const randomGeneratedDateTime = getRandomDateTime(); + console.log(randomGeneratedDateTime); // Example output: "Aug 17, 2022 14:50:40" + if (!jobId) { throw new Error("Cannot create a task without a valid job ID"); } @@ -267,11 +307,34 @@ export abstract class AbstractBatchFakeSet const baseTaskUrl = `https://${accountEndPoint}/jobs/${jobId}/tasks/`; for (let i = 0; i < 3; i++) { + /* + const seed = Math.random(); + const seedStr = seed.toString().substring(2); + + let exitCode, state; + + if (parseInt(seedStr[0]) <= 5) { + exitCode = "Success"; + } else { + exitCode = "Failure"; + } + + if (exitCode === "Success") { + state = parseInt(seedStr[1]) <= 5 ? "Active" : "Completed"; + } else { + state = parseInt(seedStr[1]) <= 5 ? "Error" : "Running"; + } + */ + taskOutput.push({ url: `${baseTaskUrl}task${i + 1}`, id: `task${i + 1}`, - state: "active", - executionInfo: { retryCount: 0, requeueCount: 0 }, + state: Math.random() > 0.5 ? "active" : "completed", + creationTime: getRandomDateTime(), + executionInfo: { + retryCount: Math.random() > 0.5 ? 0 : 1, + requeueCount: Math.random() > 0.5 ? 0 : 1, + }, }); } return taskOutput; From 27e4752ab86a98c8f0028e35bbdfe5ada2098aab Mon Sep 17 00:00:00 2001 From: ReneOv-MSFT <142273469+ReneOv-MSFT@users.noreply.github.com> Date: Wed, 19 Jun 2024 14:27:27 -0700 Subject: [PATCH 29/38] Remove numOfTask from live service, inject TaskService on demo view instead of grid component --- .../demo/display/task-list/task-list-demo.tsx | 40 +++++++++++--- packages/react/src/task/task-list.tsx | 54 ++++++------------- .../service/src/task/fake-task-service.ts | 7 ++- packages/service/src/test-util/fakes.ts | 39 +++++++------- 4 files changed, 75 insertions(+), 65 deletions(-) diff --git a/packages/playground/src/demo/display/task-list/task-list-demo.tsx b/packages/playground/src/demo/display/task-list/task-list-demo.tsx index d9b26f8f1..cab18bf30 100644 --- a/packages/playground/src/demo/display/task-list/task-list-demo.tsx +++ b/packages/playground/src/demo/display/task-list/task-list-demo.tsx @@ -6,16 +6,45 @@ import { Slider } from "@fluentui/react/lib/Slider"; import { Stack } from "@fluentui/react/lib/Stack"; import React from "react"; import { DemoPane } from "../../../layout/demo-pane"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { BatchTaskOutput } from "@batch/ui-service/src/batch-models"; export const TaskListDemo: React.FC = () => { const [taskNumberSlider, setTaskNumberSlider] = React.useState(0); + const [items, setItems] = React.useState< + PagedAsyncIterableIterator + >([]); const taskNumberSliderOnChange = (value: number) => { setTaskNumberSlider(value); }; - - const taskService: FakeTaskService = inject( - BatchDependencyName.TaskService + const [accountEndpoint, setAccountEndpoint] = React.useState( + "mercury.eastus.batch.azure.com" ); + const [jobId, setJobId] = React.useState("faketestjob1"); + + React.useEffect(() => { + let isMounted = true; + + const taskService: FakeTaskService = inject( + BatchDependencyName.TaskService + ); + + const fetchTaskList = async () => { + if (!isMounted) return; + + const tasks = await taskService.listTasks(accountEndpoint, jobId); + + setItems(tasks); + }; + + fetchTaskList().catch((e) => { + console.log("Error: ", e); + }); + + return () => { + isMounted = false; + }; + }, [accountEndpoint, jobId]); return ( @@ -36,10 +65,7 @@ export const TaskListDemo: React.FC = () => { /> - + ); }; diff --git a/packages/react/src/task/task-list.tsx b/packages/react/src/task/task-list.tsx index 14e3e9391..af46ed770 100644 --- a/packages/react/src/task/task-list.tsx +++ b/packages/react/src/task/task-list.tsx @@ -5,15 +5,12 @@ import { DataGridColumn, } from "@azure/bonito-ui/lib/components/data-grid"; import { BatchTaskOutput } from "@batch/ui-service/lib/batch-models"; -import { inject } from "@azure/bonito-core/lib/environment"; -import { BatchDependencyName } from "@batch/ui-service/lib/environment"; -import { TaskService } from "@batch/ui-service/lib/task/task-service"; import { CiCircleChevDown } from "react-icons/ci"; import { IconButton } from "@fluentui/react/lib/Button"; +import { PagedAsyncIterableIterator } from "@azure/core-paging"; interface TaskListProps { - accountEndpoint: string; - jobId: string; + pagedTasks: PagedAsyncIterableIterator; } interface taskRow extends BatchTaskOutput { @@ -23,44 +20,25 @@ interface taskRow extends BatchTaskOutput { } export const TaskList = (props: TaskListProps) => { - const { accountEndpoint, jobId } = props; - const [isCompact] = React.useState(false); + const { pagedTasks } = props; const [items, setItems] = React.useState([]); + const [isCompact] = React.useState(false); React.useEffect(() => { - let isMounted = true; - - const taskService: TaskService = inject( - BatchDependencyName.TaskService - ); - - const fetchTaskList = async () => { - if (!isMounted) return; - - const tasks = await taskService.listTasks(accountEndpoint, jobId); - - const items = []; - for await (const task of tasks) { - items.push({ - url: task.url, - id: task.id, - state: task.state, - creationTime: task.creationTime, - executionInfo: task.executionInfo, - }); - } - - setItems(items); - }; + const taskArray = []; - fetchTaskList().catch((e) => { - console.log("Error: ", e); - }); + for await (const task of pagedTasks) { + taskArray.push({ + url: task.url, + id: task.id, + state: task.state, + creationTime: task.creationTime, + executionInfo: task.executionInfo, + }); + } - return () => { - isMounted = false; - }; - }, [accountEndpoint, jobId]); + setItems(taskArray); + }, [pagedTasks]); return ( > { - return createPagedArray(this.fakeSet.listTasks(accountEndpoint, jobId)); + return createPagedArray( + this.fakeSet.listTasks(accountEndpoint, jobId, numOfTasks) + ); } } diff --git a/packages/service/src/test-util/fakes.ts b/packages/service/src/test-util/fakes.ts index b0a70a619..fa4dc9b85 100644 --- a/packages/service/src/test-util/fakes.ts +++ b/packages/service/src/test-util/fakes.ts @@ -112,15 +112,11 @@ export interface BatchFakeSet extends FakeSet { * @param accountEndpoint * @param jobId */ - listTasks(accountEndpoint: string, jobId: string): BatchTaskOutput[]; - - /** - * Generate tasks - * - * @param accountEndpoint - * @param jobId - */ - generateTasks(accountEndpoint: string, jobId: string): BatchTaskOutput[]; + listTasks( + accountEndpoint: string, + jobId: string, + numOfTasks?: number + ): BatchTaskOutput[]; /** * List hardcoded tasks in fakes @@ -257,7 +253,11 @@ export abstract class AbstractBatchFakeSet ]; } - generateTasks(accountEndPoint: string, jobId: string): BatchTaskOutput[] { + generateTasks( + accountEndPoint: string, + jobId: string, + numOfTasks: number + ): BatchTaskOutput[] { /* function getRandomDateTime(): string { const year = Math.floor(Math.random() * 50) + 2020; @@ -306,7 +306,7 @@ export abstract class AbstractBatchFakeSet const baseTaskUrl = `https://${accountEndPoint}/jobs/${jobId}/tasks/`; - for (let i = 0; i < 3; i++) { + for (let i = 0; i < numOfTasks; i++) { /* const seed = Math.random(); const seedStr = seed.toString().substring(2); @@ -340,17 +340,20 @@ export abstract class AbstractBatchFakeSet return taskOutput; } - listTasks(accountEndpoint: string, jobId: string): BatchTaskOutput[] { + listTasks( + accountEndpoint: string, + jobId: string, + numOfTasks?: number + ): BatchTaskOutput[] { if (!jobId) { return []; } - const tasks: BatchTaskOutput[] = this.generateTasks( - accountEndpoint, - jobId - ); - - return tasks; + if (numOfTasks) { + return this.generateTasks(accountEndpoint, jobId, numOfTasks); + } else { + return this.listHardcodedTask(accountEndpoint, jobId); + } } listHardcodedTask( From f79c4755a48fc64e6204138b624c7bf76f43b5a2 Mon Sep 17 00:00:00 2001 From: Brenda Coronel Date: Wed, 19 Jun 2024 15:25:40 -0700 Subject: [PATCH 30/38] Task List Demo modifications --- .../src/demo/display/task-grid/utils.ts | 1 - .../demo/display/task-list/task-list-demo.tsx | 31 +++++++++---------- packages/react/src/task/task-list.tsx | 30 +++++++++--------- .../task/__tests__/fake-task-service.spec.ts | 15 ++++++--- 4 files changed, 40 insertions(+), 37 deletions(-) diff --git a/packages/playground/src/demo/display/task-grid/utils.ts b/packages/playground/src/demo/display/task-grid/utils.ts index d72f3f15b..2e84a062a 100644 --- a/packages/playground/src/demo/display/task-grid/utils.ts +++ b/packages/playground/src/demo/display/task-grid/utils.ts @@ -1,6 +1,5 @@ import { getLogger } from "@azure/bonito-core"; import { LoadMoreFn } from "@azure/bonito-ui/lib/hooks"; -import { BatchTaskOutput } from "@batch/ui-service/lib/batch-models"; export interface DemoTask { name: string; diff --git a/packages/playground/src/demo/display/task-list/task-list-demo.tsx b/packages/playground/src/demo/display/task-list/task-list-demo.tsx index cab18bf30..3c75a4402 100644 --- a/packages/playground/src/demo/display/task-list/task-list-demo.tsx +++ b/packages/playground/src/demo/display/task-list/task-list-demo.tsx @@ -6,21 +6,18 @@ import { Slider } from "@fluentui/react/lib/Slider"; import { Stack } from "@fluentui/react/lib/Stack"; import React from "react"; import { DemoPane } from "../../../layout/demo-pane"; -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { BatchTaskOutput } from "@batch/ui-service/src/batch-models"; +import { TextField } from "@azure/bonito-ui/src/components/form"; +import { TextFieldOnChange } from "../../../functions"; +//import { PagedAsyncIterableIterator } from "@azure/core-paging"; export const TaskListDemo: React.FC = () => { - const [taskNumberSlider, setTaskNumberSlider] = React.useState(0); - const [items, setItems] = React.useState< - PagedAsyncIterableIterator - >([]); - const taskNumberSliderOnChange = (value: number) => { - setTaskNumberSlider(value); - }; - const [accountEndpoint, setAccountEndpoint] = React.useState( + const [taskNumberField, setTaskNumberField] = React.useState(0); + const [items, setItems] = React.useState([]); + + const [accountEndpoint] = React.useState( "mercury.eastus.batch.azure.com" ); - const [jobId, setJobId] = React.useState("faketestjob1"); + const [jobId] = React.useState("faketestjob1"); React.useEffect(() => { let isMounted = true; @@ -56,12 +53,12 @@ export const TaskListDemo: React.FC = () => { styles={{ root: { marginBottom: "1em" } }} > - { + const number = parseInt(`${newValue}`); + setTaskNumberField(number); + }} /> diff --git a/packages/react/src/task/task-list.tsx b/packages/react/src/task/task-list.tsx index af46ed770..238cc1759 100644 --- a/packages/react/src/task/task-list.tsx +++ b/packages/react/src/task/task-list.tsx @@ -7,10 +7,10 @@ import { import { BatchTaskOutput } from "@batch/ui-service/lib/batch-models"; import { CiCircleChevDown } from "react-icons/ci"; import { IconButton } from "@fluentui/react/lib/Button"; -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +//import { PagedAsyncIterableIterator } from "@azure/core-paging"; interface TaskListProps { - pagedTasks: PagedAsyncIterableIterator; + pagedTasks: any; } interface taskRow extends BatchTaskOutput { @@ -25,19 +25,21 @@ export const TaskList = (props: TaskListProps) => { const [isCompact] = React.useState(false); React.useEffect(() => { - const taskArray = []; + const parseTasks = async () => { + const taskArray = []; - for await (const task of pagedTasks) { - taskArray.push({ - url: task.url, - id: task.id, - state: task.state, - creationTime: task.creationTime, - executionInfo: task.executionInfo, - }); - } - - setItems(taskArray); + for await (const task of pagedTasks) { + taskArray.push({ + url: task.url, + id: task.id, + state: task.state, + creationTime: task.creationTime, + executionInfo: task.executionInfo, + }); + } + setItems(taskArray); + }; + parseTasks(); }, [pagedTasks]); return ( diff --git a/packages/service/src/task/__tests__/fake-task-service.spec.ts b/packages/service/src/task/__tests__/fake-task-service.spec.ts index 75e52e1f5..3ab2da460 100644 --- a/packages/service/src/task/__tests__/fake-task-service.spec.ts +++ b/packages/service/src/task/__tests__/fake-task-service.spec.ts @@ -19,10 +19,15 @@ describe("FakeTaskService", () => { }); test("Generate tasks", async () => { - const task = await service.generateTasks(accountEndpoint, jobId); - expect(task[0].id).toEqual("task1"); - expect(task[1].id).toEqual("task2"); - expect(task[2].id).toEqual("task3"); + const tasks = await service.listTasks(accountEndpoint, jobId, 3); + const allTasks = []; + for await (const task of tasks) { + allTasks.push(task); + } + + expect(allTasks[0].id).toEqual("task1"); + expect(allTasks[1].id).toEqual("task2"); + expect(allTasks[2].id).toEqual("task3"); }); test("List batch tasks", async () => { @@ -49,7 +54,7 @@ describe("FakeTaskService", () => { }); test("List hardcoded batch tasks", async () => { - const tasks = await service.listHardcodedTasks(accountEndpoint, jobId); + const tasks = await service.listTasks(accountEndpoint, jobId); const allTasks = []; From 79282826faddee2d6c43f4416687f22df4f136dd Mon Sep 17 00:00:00 2001 From: Brenda Coronel Date: Thu, 20 Jun 2024 15:18:21 -0700 Subject: [PATCH 31/38] Displayed exit code in demo --- .../demo/display/task-list/task-list-demo.tsx | 25 +++---- packages/react/src/task/task-list.tsx | 50 +++++++++----- packages/service/src/test-util/fakes.ts | 66 +++++-------------- 3 files changed, 64 insertions(+), 77 deletions(-) diff --git a/packages/playground/src/demo/display/task-list/task-list-demo.tsx b/packages/playground/src/demo/display/task-list/task-list-demo.tsx index 3c75a4402..4aa522feb 100644 --- a/packages/playground/src/demo/display/task-list/task-list-demo.tsx +++ b/packages/playground/src/demo/display/task-list/task-list-demo.tsx @@ -2,16 +2,15 @@ import { inject } from "@azure/bonito-core/lib/environment"; import { TaskList } from "@batch/ui-react/lib/task/task-list"; import { BatchDependencyName } from "@batch/ui-service/lib/environment/batch-dependencies"; import { FakeTaskService } from "@batch/ui-service/lib/task/fake-task-service"; -import { Slider } from "@fluentui/react/lib/Slider"; import { Stack } from "@fluentui/react/lib/Stack"; import React from "react"; import { DemoPane } from "../../../layout/demo-pane"; -import { TextField } from "@azure/bonito-ui/src/components/form"; -import { TextFieldOnChange } from "../../../functions"; -//import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { TextField } from "@fluentui/react/lib/TextField"; export const TaskListDemo: React.FC = () => { - const [taskNumberField, setTaskNumberField] = React.useState(0); + const [taskNumberField, setTaskNumberField] = React.useState< + string | undefined + >(undefined); const [items, setItems] = React.useState([]); const [accountEndpoint] = React.useState( @@ -29,8 +28,13 @@ export const TaskListDemo: React.FC = () => { const fetchTaskList = async () => { if (!isMounted) return; - const tasks = await taskService.listTasks(accountEndpoint, jobId); - + const tasks = taskNumberField + ? await taskService.listTasks( + accountEndpoint, + jobId, + parseInt(taskNumberField) + ) + : await taskService.listTasks(accountEndpoint, jobId); setItems(tasks); }; @@ -41,10 +45,10 @@ export const TaskListDemo: React.FC = () => { return () => { isMounted = false; }; - }, [accountEndpoint, jobId]); + }, [accountEndpoint, jobId, taskNumberField]); return ( - + { { - const number = parseInt(`${newValue}`); - setTaskNumberField(number); + setTaskNumberField(newValue); }} /> diff --git a/packages/react/src/task/task-list.tsx b/packages/react/src/task/task-list.tsx index 238cc1759..304de1a15 100644 --- a/packages/react/src/task/task-list.tsx +++ b/packages/react/src/task/task-list.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { CiCircleCheck, CiAvocado } from "react-icons/ci"; +import { CiCircleCheck } from "react-icons/ci"; import { DataGrid, DataGridColumn, @@ -7,6 +7,8 @@ import { import { BatchTaskOutput } from "@batch/ui-service/lib/batch-models"; import { CiCircleChevDown } from "react-icons/ci"; import { IconButton } from "@fluentui/react/lib/Button"; +import { MdOutlineRunningWithErrors } from "react-icons/md"; +import { RiProgress1Line, RiLoader3Fill } from "react-icons/ri"; //import { PagedAsyncIterableIterator } from "@azure/core-paging"; interface TaskListProps { @@ -35,6 +37,7 @@ export const TaskList = (props: TaskListProps) => { state: task.state, creationTime: task.creationTime, executionInfo: task.executionInfo, + exitConditions: task.exitConditions?.exitCodes[0].code, }); } setItems(taskArray); @@ -68,23 +71,38 @@ const columns: DataGridColumn[] = [ minWidth: 150, maxWidth: 200, onRender: (task: any) => { + console.log(task.exitConditions); return (
- {task.state === "completed" ? ( + {task.state.toLowerCase() === "completed" ? ( - ) : ( - + ) : task.state.toLowerCase() === "failed" ? ( + + ) : task.state.toLowerCase() === "running" ? ( + - )} + ) : null} {task.state}
); @@ -100,16 +118,12 @@ const columns: DataGridColumn[] = [ }, }, { - label: "Exit Code", - prop: "exitcode", + label: "Exit code", + prop: "exitCode", minWidth: 150, + maxWidth: 200, onRender: (task: any) => { - return ( -
- Retry count: {task.executionInfo.retryCount} {"\n"} - Requeue count: {task.executionInfo.requeueCount} -
- ); + return
{task.exitConditions}
; }, }, { @@ -132,4 +146,8 @@ const columns: DataGridColumn[] = [ name="" iconProps={} /> + + + Retry count: {task.executionInfo.retryCount} {"\n"} +Requeue count: {task.executionInfo.requeueCount} */ diff --git a/packages/service/src/test-util/fakes.ts b/packages/service/src/test-util/fakes.ts index fa4dc9b85..a14cf03c7 100644 --- a/packages/service/src/test-util/fakes.ts +++ b/packages/service/src/test-util/fakes.ts @@ -111,6 +111,7 @@ export interface BatchFakeSet extends FakeSet { * * @param accountEndpoint * @param jobId + * @param numOfTasks The number of tasks to generate */ listTasks( accountEndpoint: string, @@ -258,46 +259,6 @@ export abstract class AbstractBatchFakeSet jobId: string, numOfTasks: number ): BatchTaskOutput[] { - /* - function getRandomDateTime(): string { - const year = Math.floor(Math.random() * 50) + 2020; - const month = Math.floor(Math.random() * 12); - const day = Math.floor(Math.random() * 28) + 1; - const hours = Math.floor(Math.random() * 24); - const minutes = Math.floor(Math.random() * 60); - const seconds = Math.floor(Math.random() * 60); // Random second - - const date = new Date(year, month, day, hours, minutes, seconds); - return date.toString(); - } - */ - - function getRandomDateTime(): string { - const year = Math.floor(Math.random() * 50) + 2020; - const month = Math.floor(Math.random() * 12); - const day = Math.floor(Math.random() * 28); // Assume all months have 28 days for simplicity - const hours = Math.floor(Math.random() * 24); - const minutes = Math.floor(Math.random() * 60); - const seconds = Math.floor(Math.random() * 60); - - const date = new Date(year, month, day, hours, minutes, seconds); - - // Format the date and time - const formattedDateTime = date.toLocaleString("en-US", { - year: "numeric", - month: "short", - day: "numeric", - hour: "2-digit", - minute: "2-digit", - second: "2-digit", - }); - - return formattedDateTime; - } - - const randomGeneratedDateTime = getRandomDateTime(); - console.log(randomGeneratedDateTime); // Example output: "Aug 17, 2022 14:50:40" - if (!jobId) { throw new Error("Cannot create a task without a valid job ID"); } @@ -307,33 +268,34 @@ export abstract class AbstractBatchFakeSet const baseTaskUrl = `https://${accountEndPoint}/jobs/${jobId}/tasks/`; for (let i = 0; i < numOfTasks; i++) { - /* const seed = Math.random(); const seedStr = seed.toString().substring(2); let exitCode, state; if (parseInt(seedStr[0]) <= 5) { - exitCode = "Success"; + exitCode = 1; } else { - exitCode = "Failure"; + exitCode = 0; } - if (exitCode === "Success") { + if (exitCode == 1) { state = parseInt(seedStr[1]) <= 5 ? "Active" : "Completed"; } else { - state = parseInt(seedStr[1]) <= 5 ? "Error" : "Running"; + state = parseInt(seedStr[1]) <= 5 ? "Failed" : "Running"; } - */ taskOutput.push({ url: `${baseTaskUrl}task${i + 1}`, id: `task${i + 1}`, - state: Math.random() > 0.5 ? "active" : "completed", - creationTime: getRandomDateTime(), + state: state, + creationTime: `Aug 15, 2022 14:${i}`, executionInfo: { - retryCount: Math.random() > 0.5 ? 0 : 1, - requeueCount: Math.random() > 0.5 ? 0 : 1, + retryCount: Math.floor(Math.random() * 10), + requeueCount: Math.floor(Math.random() * 10), + }, + exitConditions: { + exitCodes: [{ code: exitCode, exitOptions: {} }], }, }); } @@ -974,19 +936,23 @@ export class BasicBatchFakeSet extends AbstractBatchFakeSet { url: "https://batchsyntheticsprod.eastus2euap.batch.azure.com/jobs/faketestjob1/tasks/taskA", id: "taska", state: "active", + creationTime: "Aug 15, 2022 14:50:00", executionInfo: { retryCount: 0, requeueCount: 0, }, + exitConditions: { exitCodes: [{ code: 1, exitOptions: {} }] }, }, "mercury.eastus.batch.azure.com:faketestjob1:task1": { url: "https://batchsyntheticsprod.eastus2euap.batch.azure.com/jobs/faketestjob1/tasks/task1", id: "task1", state: "completed", + creationTime: "Aug 15, 2022 14:50:01", executionInfo: { retryCount: 0, requeueCount: 0, }, + exitConditions: { exitCodes: [{ code: 0, exitOptions: {} }] }, }, }; From f96440f8d623eef466f4c9aa460da47db18105f6 Mon Sep 17 00:00:00 2001 From: Brenda Coronel Date: Mon, 24 Jun 2024 11:43:32 -0700 Subject: [PATCH 32/38] Removing comments --- packages/react/src/task/task-list.tsx | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/packages/react/src/task/task-list.tsx b/packages/react/src/task/task-list.tsx index 304de1a15..e5d3b0fbf 100644 --- a/packages/react/src/task/task-list.tsx +++ b/packages/react/src/task/task-list.tsx @@ -9,7 +9,6 @@ import { CiCircleChevDown } from "react-icons/ci"; import { IconButton } from "@fluentui/react/lib/Button"; import { MdOutlineRunningWithErrors } from "react-icons/md"; import { RiProgress1Line, RiLoader3Fill } from "react-icons/ri"; -//import { PagedAsyncIterableIterator } from "@azure/core-paging"; interface TaskListProps { pagedTasks: any; @@ -71,7 +70,6 @@ const columns: DataGridColumn[] = [ minWidth: 150, maxWidth: 200, onRender: (task: any) => { - console.log(task.exitConditions); return (
{task.state.toLowerCase() === "completed" ? ( @@ -121,7 +119,6 @@ const columns: DataGridColumn[] = [ label: "Exit code", prop: "exitCode", minWidth: 150, - maxWidth: 200, onRender: (task: any) => { return
{task.exitConditions}
; }, @@ -141,13 +138,3 @@ const columns: DataGridColumn[] = [ }, }, ]; -/** - - - - Retry count: {task.executionInfo.retryCount} {"\n"} -Requeue count: {task.executionInfo.requeueCount} - */ From 59a9d5144da346d5a2fd1eb8a3d9703d28a4a9b9 Mon Sep 17 00:00:00 2001 From: Brenda Coronel Date: Tue, 25 Jun 2024 15:44:43 -0700 Subject: [PATCH 33/38] TaskList Component passing generated tasks to demo --- package-lock.json | 144 ++++++++++++++++-- package.json | 1 + .../demo/display/task-list/task-list-demo.tsx | 46 ++---- packages/react/src/task/task-list.tsx | 79 ++++++---- .../task/__tests__/fake-task-service.spec.ts | 25 +-- .../service/src/task/fake-task-service.ts | 17 ++- packages/service/src/test-util/fakes.ts | 12 +- 7 files changed, 229 insertions(+), 95 deletions(-) diff --git a/package-lock.json b/package-lock.json index fe1136e5b..36aaa8b4e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,6 +13,7 @@ "@fluentui/azure-themes": "8.6.34", "@fluentui/react": "8.97.2", "@fluentui/react-theme-provider": "0.19.16", + "@mui/base": "^5.0.0-beta.40", "mobx": "^6.3.2", "mobx-react-lite": "^3.2.0", "monaco-editor": "~0.31.0", @@ -397,10 +398,9 @@ } }, "node_modules/@babel/runtime": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.15.tgz", - "integrity": "sha512-T0O+aa+4w0u06iNmapipJXMV4HoUir03hpx3/YqXXhu9xim3w+dVphjFWl1OH8NbZHw5Lbm9k45drDkgq2VNNA==", - "dev": true, + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.7.tgz", + "integrity": "sha512-UwgBRMjJP+xv857DCngvqXI3Iq6J4v0wXmwc6sapg+zyhbwmQX67LUEFrkK5tbyJ30jGuG3ZvWpBiB9LCy1kWw==", "dependencies": { "regenerator-runtime": "^0.14.0" }, @@ -428,6 +428,40 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, + "node_modules/@floating-ui/core": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.6.3.tgz", + "integrity": "sha512-1ZpCvYf788/ZXOhRQGFxnYQOVgeU+pi0i+d0Ow34La7qjIXETi6RNswGVKkA6KcDO8/+Ysu2E/CeUmmeEBDvTg==", + "dependencies": { + "@floating-ui/utils": "^0.2.3" + } + }, + "node_modules/@floating-ui/dom": { + "version": "1.6.6", + "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.6.6.tgz", + "integrity": "sha512-qiTYajAnh3P+38kECeffMSQgbvXty2VB6rS+42iWR4FPIlZjLK84E9qtLnMTLIpPz2znD/TaFqaiavMUrS+Hcw==", + "dependencies": { + "@floating-ui/core": "^1.0.0", + "@floating-ui/utils": "^0.2.3" + } + }, + "node_modules/@floating-ui/react-dom": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.1.1.tgz", + "integrity": "sha512-4h84MJt3CHrtG18mGsXuLCHMrug49d7DFkU0RMIyshRveBeyV2hmV/pDaF2Uxtu8kgq5r46llp5E5FQiR0K2Yg==", + "dependencies": { + "@floating-ui/dom": "^1.0.0" + }, + "peerDependencies": { + "react": ">=16.8.0", + "react-dom": ">=16.8.0" + } + }, + "node_modules/@floating-ui/utils": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.3.tgz", + "integrity": "sha512-XGndio0l5/Gvd6CLIABvsav9HHezgDFFhDfHk1bvLfr9ni8dojqLSvBbotJEjmIwNHL7vK4QzBJTdBRoB+c1ww==" + }, "node_modules/@fluentui/azure-themes": { "version": "8.6.34", "resolved": "https://registry.npmjs.org/@fluentui/azure-themes/-/azure-themes-8.6.34.tgz", @@ -1783,6 +1817,82 @@ "resolved": "https://registry.npmjs.org/@microsoft/load-themed-styles/-/load-themed-styles-1.10.295.tgz", "integrity": "sha512-W+IzEBw8a6LOOfRJM02dTT7BDZijxm+Z7lhtOAz1+y9vQm1Kdz9jlAO+qCEKsfxtUOmKilW8DIRqFw2aUgKeGg==" }, + "node_modules/@mui/base": { + "version": "5.0.0-beta.40", + "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.40.tgz", + "integrity": "sha512-I/lGHztkCzvwlXpjD2+SNmvNQvB4227xBXhISPjEaJUXGImOQ9f3D2Yj/T3KasSI/h0MLWy74X0J6clhPmsRbQ==", + "dependencies": { + "@babel/runtime": "^7.23.9", + "@floating-ui/react-dom": "^2.0.8", + "@mui/types": "^7.2.14", + "@mui/utils": "^5.15.14", + "@popperjs/core": "^2.11.8", + "clsx": "^2.1.0", + "prop-types": "^15.8.1" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui-org" + }, + "peerDependencies": { + "@types/react": "^17.0.0 || ^18.0.0", + "react": "^17.0.0 || ^18.0.0", + "react-dom": "^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@mui/types": { + "version": "7.2.14", + "resolved": "https://registry.npmjs.org/@mui/types/-/types-7.2.14.tgz", + "integrity": "sha512-MZsBZ4q4HfzBsywtXgM1Ksj6HDThtiwmOKUXH1pKYISI9gAVXCNHNpo7TlGoGrBaYWZTdNoirIN7JsQcQUjmQQ==", + "peerDependencies": { + "@types/react": "^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@mui/utils": { + "version": "5.15.20", + "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.15.20.tgz", + "integrity": "sha512-mAbYx0sovrnpAu1zHc3MDIhPqL8RPVC5W5xcO1b7PiSCJPtckIZmBkp8hefamAvUiAV8gpfMOM6Zb+eSisbI2A==", + "dependencies": { + "@babel/runtime": "^7.23.9", + "@types/prop-types": "^15.7.11", + "prop-types": "^15.8.1", + "react-is": "^18.2.0" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui-org" + }, + "peerDependencies": { + "@types/react": "^17.0.0 || ^18.0.0", + "react": "^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@mui/utils/node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==" + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -3303,6 +3413,15 @@ "node": ">=14" } }, + "node_modules/@popperjs/core": { + "version": "2.11.8", + "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", + "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/popperjs" + } + }, "node_modules/@sigstore/bundle": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@sigstore/bundle/-/bundle-1.1.0.tgz", @@ -3627,9 +3746,9 @@ "dev": true }, "node_modules/@types/prop-types": { - "version": "15.7.5", - "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.5.tgz", - "integrity": "sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==" + "version": "15.7.12", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.12.tgz", + "integrity": "sha512-5zvhXYtRNRluoE/jAp4GVsSduVUzNWKkOZrCDBWYtE7biZywwdC2AcEzg+cSMLFRfVgeAFqpfNabiPjxFddV1Q==" }, "node_modules/@types/react": { "version": "17.0.59", @@ -4898,6 +5017,14 @@ "node": ">=0.10.0" } }, + "node_modules/clsx": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", + "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", + "engines": { + "node": ">=6" + } + }, "node_modules/cmd-shim": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/cmd-shim/-/cmd-shim-6.0.1.tgz", @@ -11222,8 +11349,7 @@ "node_modules/regenerator-runtime": { "version": "0.14.0", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz", - "integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==", - "dev": true + "integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==" }, "node_modules/regexp-tree": { "version": "0.1.24", diff --git a/package.json b/package.json index fe75124ce..856776f8e 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "@fluentui/azure-themes": "8.6.34", "@fluentui/react": "8.97.2", "@fluentui/react-theme-provider": "0.19.16", + "@mui/base": "^5.0.0-beta.40", "mobx": "^6.3.2", "mobx-react-lite": "^3.2.0", "monaco-editor": "~0.31.0", diff --git a/packages/playground/src/demo/display/task-list/task-list-demo.tsx b/packages/playground/src/demo/display/task-list/task-list-demo.tsx index 4aa522feb..59e3f5913 100644 --- a/packages/playground/src/demo/display/task-list/task-list-demo.tsx +++ b/packages/playground/src/demo/display/task-list/task-list-demo.tsx @@ -5,47 +5,23 @@ import { FakeTaskService } from "@batch/ui-service/lib/task/fake-task-service"; import { Stack } from "@fluentui/react/lib/Stack"; import React from "react"; import { DemoPane } from "../../../layout/demo-pane"; -import { TextField } from "@fluentui/react/lib/TextField"; +import { Unstable_NumberInput as NumberInput } from "@mui/base/Unstable_NumberInput"; export const TaskListDemo: React.FC = () => { + const taskService: FakeTaskService = inject( + BatchDependencyName.TaskService + ); + const [taskNumberField, setTaskNumberField] = React.useState< - string | undefined + number | undefined >(undefined); - const [items, setItems] = React.useState([]); - const [accountEndpoint] = React.useState( "mercury.eastus.batch.azure.com" ); const [jobId] = React.useState("faketestjob1"); - React.useEffect(() => { - let isMounted = true; - - const taskService: FakeTaskService = inject( - BatchDependencyName.TaskService - ); - - const fetchTaskList = async () => { - if (!isMounted) return; - - const tasks = taskNumberField - ? await taskService.listTasks( - accountEndpoint, - jobId, - parseInt(taskNumberField) - ) - : await taskService.listTasks(accountEndpoint, jobId); - setItems(tasks); - }; - - fetchTaskList().catch((e) => { - console.log("Error: ", e); - }); - - return () => { - isMounted = false; - }; - }, [accountEndpoint, jobId, taskNumberField]); + taskService.generateTasks = true; + taskService.numOfTasks = taskNumberField; return ( @@ -57,15 +33,15 @@ export const TaskListDemo: React.FC = () => { styles={{ root: { marginBottom: "1em" } }} > - { - setTaskNumberField(newValue); + setTaskNumberField(newValue!); }} /> - + ); }; diff --git a/packages/react/src/task/task-list.tsx b/packages/react/src/task/task-list.tsx index e5d3b0fbf..d2e26e1e2 100644 --- a/packages/react/src/task/task-list.tsx +++ b/packages/react/src/task/task-list.tsx @@ -1,48 +1,60 @@ -import React from "react"; -import { CiCircleCheck } from "react-icons/ci"; +import { inject } from "@azure/bonito-core/lib/environment"; import { DataGrid, DataGridColumn, } from "@azure/bonito-ui/lib/components/data-grid"; import { BatchTaskOutput } from "@batch/ui-service/lib/batch-models"; -import { CiCircleChevDown } from "react-icons/ci"; +import { BatchDependencyName } from "@batch/ui-service/lib/environment"; +import { TaskService } from "@batch/ui-service/lib/task/task-service"; import { IconButton } from "@fluentui/react/lib/Button"; +import React from "react"; +import { CiCircleCheck, CiCircleChevDown } from "react-icons/ci"; import { MdOutlineRunningWithErrors } from "react-icons/md"; -import { RiProgress1Line, RiLoader3Fill } from "react-icons/ri"; +import { RiLoader3Fill, RiProgress1Line } from "react-icons/ri"; interface TaskListProps { - pagedTasks: any; + accountEndpoint: string; + jobId: string; } -interface taskRow extends BatchTaskOutput { - url?: string | undefined; - id?: string | undefined; - state?: string | undefined; +interface TaskRow { + url?: string; + id?: string; + state?: string; + creationTime?: string; + exitCode?: number; } export const TaskList = (props: TaskListProps) => { - const { pagedTasks } = props; - const [items, setItems] = React.useState([]); + const { accountEndpoint, jobId } = props; + const [items, setItems] = React.useState([]); const [isCompact] = React.useState(false); React.useEffect(() => { - const parseTasks = async () => { - const taskArray = []; + let isMounted = true; + const taskService: TaskService = inject( + BatchDependencyName.TaskService + ); + + const fetchTaskList = async () => { + if (!isMounted) return; - for await (const task of pagedTasks) { - taskArray.push({ - url: task.url, - id: task.id, - state: task.state, - creationTime: task.creationTime, - executionInfo: task.executionInfo, - exitConditions: task.exitConditions?.exitCodes[0].code, - }); - } - setItems(taskArray); + const tasks = await taskService.listTasks(accountEndpoint, jobId); + const pages = tasks.byPage(); + // .next not picking up BatchTaskOutput[] variable type + const res: IteratorResult = + await pages.next(); + setItems(tasksToRows(res.value)); }; - parseTasks(); - }, [pagedTasks]); + + fetchTaskList().catch((e) => { + console.log("Error: ", e); + }); + + return () => { + isMounted = false; + }; + }, [accountEndpoint, jobId]); return ( { ); }; +function tasksToRows(tasks: BatchTaskOutput[]): TaskRow[] { + const rows = []; + + for (const task of tasks) { + rows.push({ + url: task.url, + id: task.id, + state: task.state, + creationTime: task.creationTime, + exitCode: task.exitConditions?.exitCodes?.[0].code, + }); + } + return rows; +} + const columns: DataGridColumn[] = [ { label: "Task", diff --git a/packages/service/src/task/__tests__/fake-task-service.spec.ts b/packages/service/src/task/__tests__/fake-task-service.spec.ts index 3ab2da460..1084ade8c 100644 --- a/packages/service/src/task/__tests__/fake-task-service.spec.ts +++ b/packages/service/src/task/__tests__/fake-task-service.spec.ts @@ -5,8 +5,6 @@ import { FakeTaskService } from "../fake-task-service"; describe("FakeTaskService", () => { const accountEndpoint = "mercury.eastus.batch.azure.com"; const jobId = `faketestjob1`; - const taskIds = ["task1", "task2", "task3"]; - const harcodedTaskIds = ["taska", "task1"]; let service: FakeTaskService; let fakeSet: BatchFakeSet; @@ -19,26 +17,19 @@ describe("FakeTaskService", () => { }); test("Generate tasks", async () => { - const tasks = await service.listTasks(accountEndpoint, jobId, 3); - const allTasks = []; - for await (const task of tasks) { - allTasks.push(task); - } + service.numOfTasks = 3; + service.generateTasks = true; - expect(allTasks[0].id).toEqual("task1"); - expect(allTasks[1].id).toEqual("task2"); - expect(allTasks[2].id).toEqual("task3"); - }); - - test("List batch tasks", async () => { const tasks = await service.listTasks(accountEndpoint, jobId); - const allTasks = []; - for await (const task of tasks) { allTasks.push(task); } - expect(allTasks.map((task) => task.id)).toEqual(taskIds); + + expect(allTasks.length).toEqual(3); + expect(allTasks[0].id).toEqual("generatedTask1"); + expect(allTasks[1].id).toEqual("generatedTask2"); + expect(allTasks[2].id).toEqual("generatedTask3"); }); test("Get specific batch task", async () => { @@ -61,6 +52,6 @@ describe("FakeTaskService", () => { for await (const task of tasks) { allTasks.push(task); } - expect(allTasks.map((task) => task.id)).toEqual(harcodedTaskIds); + expect(allTasks.map((task) => task.id)).toEqual(["taska", "task1"]); }); }); diff --git a/packages/service/src/task/fake-task-service.ts b/packages/service/src/task/fake-task-service.ts index b870fcb1c..267e19f8e 100644 --- a/packages/service/src/task/fake-task-service.ts +++ b/packages/service/src/task/fake-task-service.ts @@ -6,6 +6,8 @@ import { createPagedArray } from "../test-util/paging-test-util"; export class FakeTaskService implements TaskService { fakeSet: BatchFakeSet = new BasicBatchFakeSet(); + numOfTasks?: number; + generateTasks?: boolean; setFakes(fakeSet: BatchFakeSet): void { this.fakeSet = fakeSet; @@ -21,11 +23,20 @@ export class FakeTaskService implements TaskService { async listTasks( accountEndpoint: string, - jobId: string, - numOfTasks?: number + jobId: string ): Promise> { return createPagedArray( - this.fakeSet.listTasks(accountEndpoint, jobId, numOfTasks) + this.fakeSet.listTasks( + accountEndpoint, + jobId, + this.numOfTasks, + this.generateTasks + ) ); } } + +// add another memebr var numOfTasks, like line 8 +// can use in listTasks() but not as parameter +// generate tasks or fake tasks +// function can change, signature has to be same diff --git a/packages/service/src/test-util/fakes.ts b/packages/service/src/test-util/fakes.ts index a14cf03c7..23eabff34 100644 --- a/packages/service/src/test-util/fakes.ts +++ b/packages/service/src/test-util/fakes.ts @@ -116,7 +116,8 @@ export interface BatchFakeSet extends FakeSet { listTasks( accountEndpoint: string, jobId: string, - numOfTasks?: number + numOfTasks?: number, + generateTasks?: boolean ): BatchTaskOutput[]; /** @@ -286,8 +287,8 @@ export abstract class AbstractBatchFakeSet } taskOutput.push({ - url: `${baseTaskUrl}task${i + 1}`, - id: `task${i + 1}`, + url: `${baseTaskUrl}generatedTask${i + 1}`, + id: `generatedTask${i + 1}`, state: state, creationTime: `Aug 15, 2022 14:${i}`, executionInfo: { @@ -305,13 +306,14 @@ export abstract class AbstractBatchFakeSet listTasks( accountEndpoint: string, jobId: string, - numOfTasks?: number + numOfTasks: number = 100, + generateTasks: boolean = false ): BatchTaskOutput[] { if (!jobId) { return []; } - if (numOfTasks) { + if (generateTasks) { return this.generateTasks(accountEndpoint, jobId, numOfTasks); } else { return this.listHardcodedTask(accountEndpoint, jobId); From 6bd7c576107c729bbc564677c936ea769acc0963 Mon Sep 17 00:00:00 2001 From: Brenda Coronel Date: Wed, 26 Jun 2024 11:26:47 -0700 Subject: [PATCH 34/38] Removed depedency, added SpinButton, modified task-list Mounted --- package-lock.json | 144 ++---------------- package.json | 1 - .../demo/display/task-list/task-list-demo.tsx | 9 +- packages/react/src/task/task-list.tsx | 25 +-- .../task/__tests__/fake-task-service.spec.ts | 2 +- .../service/src/task/fake-task-service.ts | 9 +- packages/service/src/test-util/fakes.ts | 9 +- 7 files changed, 35 insertions(+), 164 deletions(-) diff --git a/package-lock.json b/package-lock.json index 36aaa8b4e..fe1136e5b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,6 @@ "@fluentui/azure-themes": "8.6.34", "@fluentui/react": "8.97.2", "@fluentui/react-theme-provider": "0.19.16", - "@mui/base": "^5.0.0-beta.40", "mobx": "^6.3.2", "mobx-react-lite": "^3.2.0", "monaco-editor": "~0.31.0", @@ -398,9 +397,10 @@ } }, "node_modules/@babel/runtime": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.7.tgz", - "integrity": "sha512-UwgBRMjJP+xv857DCngvqXI3Iq6J4v0wXmwc6sapg+zyhbwmQX67LUEFrkK5tbyJ30jGuG3ZvWpBiB9LCy1kWw==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.15.tgz", + "integrity": "sha512-T0O+aa+4w0u06iNmapipJXMV4HoUir03hpx3/YqXXhu9xim3w+dVphjFWl1OH8NbZHw5Lbm9k45drDkgq2VNNA==", + "dev": true, "dependencies": { "regenerator-runtime": "^0.14.0" }, @@ -428,40 +428,6 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "node_modules/@floating-ui/core": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.6.3.tgz", - "integrity": "sha512-1ZpCvYf788/ZXOhRQGFxnYQOVgeU+pi0i+d0Ow34La7qjIXETi6RNswGVKkA6KcDO8/+Ysu2E/CeUmmeEBDvTg==", - "dependencies": { - "@floating-ui/utils": "^0.2.3" - } - }, - "node_modules/@floating-ui/dom": { - "version": "1.6.6", - "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.6.6.tgz", - "integrity": "sha512-qiTYajAnh3P+38kECeffMSQgbvXty2VB6rS+42iWR4FPIlZjLK84E9qtLnMTLIpPz2znD/TaFqaiavMUrS+Hcw==", - "dependencies": { - "@floating-ui/core": "^1.0.0", - "@floating-ui/utils": "^0.2.3" - } - }, - "node_modules/@floating-ui/react-dom": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.1.1.tgz", - "integrity": "sha512-4h84MJt3CHrtG18mGsXuLCHMrug49d7DFkU0RMIyshRveBeyV2hmV/pDaF2Uxtu8kgq5r46llp5E5FQiR0K2Yg==", - "dependencies": { - "@floating-ui/dom": "^1.0.0" - }, - "peerDependencies": { - "react": ">=16.8.0", - "react-dom": ">=16.8.0" - } - }, - "node_modules/@floating-ui/utils": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.3.tgz", - "integrity": "sha512-XGndio0l5/Gvd6CLIABvsav9HHezgDFFhDfHk1bvLfr9ni8dojqLSvBbotJEjmIwNHL7vK4QzBJTdBRoB+c1ww==" - }, "node_modules/@fluentui/azure-themes": { "version": "8.6.34", "resolved": "https://registry.npmjs.org/@fluentui/azure-themes/-/azure-themes-8.6.34.tgz", @@ -1817,82 +1783,6 @@ "resolved": "https://registry.npmjs.org/@microsoft/load-themed-styles/-/load-themed-styles-1.10.295.tgz", "integrity": "sha512-W+IzEBw8a6LOOfRJM02dTT7BDZijxm+Z7lhtOAz1+y9vQm1Kdz9jlAO+qCEKsfxtUOmKilW8DIRqFw2aUgKeGg==" }, - "node_modules/@mui/base": { - "version": "5.0.0-beta.40", - "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.40.tgz", - "integrity": "sha512-I/lGHztkCzvwlXpjD2+SNmvNQvB4227xBXhISPjEaJUXGImOQ9f3D2Yj/T3KasSI/h0MLWy74X0J6clhPmsRbQ==", - "dependencies": { - "@babel/runtime": "^7.23.9", - "@floating-ui/react-dom": "^2.0.8", - "@mui/types": "^7.2.14", - "@mui/utils": "^5.15.14", - "@popperjs/core": "^2.11.8", - "clsx": "^2.1.0", - "prop-types": "^15.8.1" - }, - "engines": { - "node": ">=12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/mui-org" - }, - "peerDependencies": { - "@types/react": "^17.0.0 || ^18.0.0", - "react": "^17.0.0 || ^18.0.0", - "react-dom": "^17.0.0 || ^18.0.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@mui/types": { - "version": "7.2.14", - "resolved": "https://registry.npmjs.org/@mui/types/-/types-7.2.14.tgz", - "integrity": "sha512-MZsBZ4q4HfzBsywtXgM1Ksj6HDThtiwmOKUXH1pKYISI9gAVXCNHNpo7TlGoGrBaYWZTdNoirIN7JsQcQUjmQQ==", - "peerDependencies": { - "@types/react": "^17.0.0 || ^18.0.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@mui/utils": { - "version": "5.15.20", - "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.15.20.tgz", - "integrity": "sha512-mAbYx0sovrnpAu1zHc3MDIhPqL8RPVC5W5xcO1b7PiSCJPtckIZmBkp8hefamAvUiAV8gpfMOM6Zb+eSisbI2A==", - "dependencies": { - "@babel/runtime": "^7.23.9", - "@types/prop-types": "^15.7.11", - "prop-types": "^15.8.1", - "react-is": "^18.2.0" - }, - "engines": { - "node": ">=12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/mui-org" - }, - "peerDependencies": { - "@types/react": "^17.0.0 || ^18.0.0", - "react": "^17.0.0 || ^18.0.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, - "node_modules/@mui/utils/node_modules/react-is": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", - "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==" - }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -3413,15 +3303,6 @@ "node": ">=14" } }, - "node_modules/@popperjs/core": { - "version": "2.11.8", - "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", - "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/popperjs" - } - }, "node_modules/@sigstore/bundle": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@sigstore/bundle/-/bundle-1.1.0.tgz", @@ -3746,9 +3627,9 @@ "dev": true }, "node_modules/@types/prop-types": { - "version": "15.7.12", - "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.12.tgz", - "integrity": "sha512-5zvhXYtRNRluoE/jAp4GVsSduVUzNWKkOZrCDBWYtE7biZywwdC2AcEzg+cSMLFRfVgeAFqpfNabiPjxFddV1Q==" + "version": "15.7.5", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.5.tgz", + "integrity": "sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==" }, "node_modules/@types/react": { "version": "17.0.59", @@ -5017,14 +4898,6 @@ "node": ">=0.10.0" } }, - "node_modules/clsx": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", - "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", - "engines": { - "node": ">=6" - } - }, "node_modules/cmd-shim": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/cmd-shim/-/cmd-shim-6.0.1.tgz", @@ -11349,7 +11222,8 @@ "node_modules/regenerator-runtime": { "version": "0.14.0", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz", - "integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==" + "integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==", + "dev": true }, "node_modules/regexp-tree": { "version": "0.1.24", diff --git a/package.json b/package.json index 856776f8e..fe75124ce 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,6 @@ "@fluentui/azure-themes": "8.6.34", "@fluentui/react": "8.97.2", "@fluentui/react-theme-provider": "0.19.16", - "@mui/base": "^5.0.0-beta.40", "mobx": "^6.3.2", "mobx-react-lite": "^3.2.0", "monaco-editor": "~0.31.0", diff --git a/packages/playground/src/demo/display/task-list/task-list-demo.tsx b/packages/playground/src/demo/display/task-list/task-list-demo.tsx index 59e3f5913..631f260ca 100644 --- a/packages/playground/src/demo/display/task-list/task-list-demo.tsx +++ b/packages/playground/src/demo/display/task-list/task-list-demo.tsx @@ -5,7 +5,7 @@ import { FakeTaskService } from "@batch/ui-service/lib/task/fake-task-service"; import { Stack } from "@fluentui/react/lib/Stack"; import React from "react"; import { DemoPane } from "../../../layout/demo-pane"; -import { Unstable_NumberInput as NumberInput } from "@mui/base/Unstable_NumberInput"; +import { SpinButton } from "@fluentui/react/lib/SpinButton"; export const TaskListDemo: React.FC = () => { const taskService: FakeTaskService = inject( @@ -33,10 +33,11 @@ export const TaskListDemo: React.FC = () => { styles={{ root: { marginBottom: "1em" } }} > - { - setTaskNumberField(newValue!); + setTaskNumberField(Number(newValue) ?? undefined); }} /> diff --git a/packages/react/src/task/task-list.tsx b/packages/react/src/task/task-list.tsx index d2e26e1e2..b3886b36b 100644 --- a/packages/react/src/task/task-list.tsx +++ b/packages/react/src/task/task-list.tsx @@ -37,9 +37,10 @@ export const TaskList = (props: TaskListProps) => { ); const fetchTaskList = async () => { + const tasks = await taskService.listTasks(accountEndpoint, jobId); + if (!isMounted) return; - const tasks = await taskService.listTasks(accountEndpoint, jobId); const pages = tasks.byPage(); // .next not picking up BatchTaskOutput[] variable type const res: IteratorResult = @@ -81,13 +82,13 @@ function tasksToRows(tasks: BatchTaskOutput[]): TaskRow[] { return rows; } -const columns: DataGridColumn[] = [ +const columns: DataGridColumn[] = [ { label: "Task", prop: "id", minWidth: 100, maxWidth: 150, - onRender: (task: any) => { + onRender: (task) => { return {task.id}; }, }, @@ -96,31 +97,31 @@ const columns: DataGridColumn[] = [ prop: "state", minWidth: 150, maxWidth: 200, - onRender: (task: any) => { + onRender: (task) => { return (
- {task.state.toLowerCase() === "completed" ? ( + {task.state?.toLowerCase() === "completed" ? ( - ) : task.state.toLowerCase() === "active" ? ( + ) : task.state?.toLowerCase() === "active" ? ( - ) : task.state.toLowerCase() === "failed" ? ( + ) : task.state?.toLowerCase() === "failed" ? ( - ) : task.state.toLowerCase() === "running" ? ( + ) : task.state?.toLowerCase() === "running" ? ( { + onRender: (task) => { return
{task.creationTime}
; }, }, @@ -146,15 +147,15 @@ const columns: DataGridColumn[] = [ label: "Exit code", prop: "exitCode", minWidth: 150, - onRender: (task: any) => { - return
{task.exitConditions}
; + onRender: (task) => { + return
{task.exitCode}
; }, }, { label: " ", prop: " ", minWidth: 150, - onRender: (task: any) => { + onRender: (task) => { return (
diff --git a/packages/service/src/task/__tests__/fake-task-service.spec.ts b/packages/service/src/task/__tests__/fake-task-service.spec.ts index 1084ade8c..a898dfa36 100644 --- a/packages/service/src/task/__tests__/fake-task-service.spec.ts +++ b/packages/service/src/task/__tests__/fake-task-service.spec.ts @@ -17,8 +17,8 @@ describe("FakeTaskService", () => { }); test("Generate tasks", async () => { - service.numOfTasks = 3; service.generateTasks = true; + service.numOfTasks = 3; const tasks = await service.listTasks(accountEndpoint, jobId); const allTasks = []; diff --git a/packages/service/src/task/fake-task-service.ts b/packages/service/src/task/fake-task-service.ts index 267e19f8e..55eba764c 100644 --- a/packages/service/src/task/fake-task-service.ts +++ b/packages/service/src/task/fake-task-service.ts @@ -29,14 +29,9 @@ export class FakeTaskService implements TaskService { this.fakeSet.listTasks( accountEndpoint, jobId, - this.numOfTasks, - this.generateTasks + this.generateTasks, + this.numOfTasks ) ); } } - -// add another memebr var numOfTasks, like line 8 -// can use in listTasks() but not as parameter -// generate tasks or fake tasks -// function can change, signature has to be same diff --git a/packages/service/src/test-util/fakes.ts b/packages/service/src/test-util/fakes.ts index 23eabff34..f24ac0442 100644 --- a/packages/service/src/test-util/fakes.ts +++ b/packages/service/src/test-util/fakes.ts @@ -111,13 +111,14 @@ export interface BatchFakeSet extends FakeSet { * * @param accountEndpoint * @param jobId + * @param generateTasks Generate tasks based on if live or fake service * @param numOfTasks The number of tasks to generate */ listTasks( accountEndpoint: string, jobId: string, - numOfTasks?: number, - generateTasks?: boolean + generateTasks?: boolean, + numOfTasks?: number ): BatchTaskOutput[]; /** @@ -306,8 +307,8 @@ export abstract class AbstractBatchFakeSet listTasks( accountEndpoint: string, jobId: string, - numOfTasks: number = 100, - generateTasks: boolean = false + generateTasks: boolean = false, + numOfTasks: number = 100 ): BatchTaskOutput[] { if (!jobId) { return []; From 5ad58dbe682bbb6ad34bdf0b9e3f4478440e68dc Mon Sep 17 00:00:00 2001 From: Brenda Coronel Date: Wed, 26 Jun 2024 11:47:35 -0700 Subject: [PATCH 35/38] Replaced playground icons with fluent ui icons --- packages/react/src/task/task-list.tsx | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/packages/react/src/task/task-list.tsx b/packages/react/src/task/task-list.tsx index b3886b36b..26b4b0702 100644 --- a/packages/react/src/task/task-list.tsx +++ b/packages/react/src/task/task-list.tsx @@ -1,3 +1,4 @@ +import * as React from "react"; import { inject } from "@azure/bonito-core/lib/environment"; import { DataGrid, @@ -6,11 +7,9 @@ import { import { BatchTaskOutput } from "@batch/ui-service/lib/batch-models"; import { BatchDependencyName } from "@batch/ui-service/lib/environment"; import { TaskService } from "@batch/ui-service/lib/task/task-service"; +import { Icon } from "@fluentui/react/lib/Icon"; import { IconButton } from "@fluentui/react/lib/Button"; -import React from "react"; -import { CiCircleCheck, CiCircleChevDown } from "react-icons/ci"; -import { MdOutlineRunningWithErrors } from "react-icons/md"; -import { RiLoader3Fill, RiProgress1Line } from "react-icons/ri"; +import { CiCircleChevDown } from "react-icons/ci"; interface TaskListProps { accountEndpoint: string; @@ -101,28 +100,32 @@ const columns: DataGridColumn[] = [ return (
{task.state?.toLowerCase() === "completed" ? ( - ) : task.state?.toLowerCase() === "active" ? ( - ) : task.state?.toLowerCase() === "failed" ? ( - ) : task.state?.toLowerCase() === "running" ? ( - Date: Tue, 2 Jul 2024 11:00:29 -0700 Subject: [PATCH 36/38] Pagination added to demo --- .../demo/display/task-list/task-list-demo.tsx | 37 +++++++++-- .../grid-footer/data-grid-footer.tsx | 64 +++++++++++++++++++ .../grid-utils/grid-utlis.styles.ts | 34 ++++++++++ packages/react/src/task/task-list.tsx | 53 ++++++++++++--- 4 files changed, 171 insertions(+), 17 deletions(-) create mode 100644 packages/react/src/components/grid-utils/grid-footer/data-grid-footer.tsx create mode 100644 packages/react/src/components/grid-utils/grid-utlis.styles.ts diff --git a/packages/playground/src/demo/display/task-list/task-list-demo.tsx b/packages/playground/src/demo/display/task-list/task-list-demo.tsx index 631f260ca..878c2a9da 100644 --- a/packages/playground/src/demo/display/task-list/task-list-demo.tsx +++ b/packages/playground/src/demo/display/task-list/task-list-demo.tsx @@ -12,16 +12,22 @@ export const TaskListDemo: React.FC = () => { BatchDependencyName.TaskService ); - const [taskNumberField, setTaskNumberField] = React.useState< - number | undefined - >(undefined); + const [spinButtonValue, setSpinButton] = React.useState( + undefined + ); const [accountEndpoint] = React.useState( "mercury.eastus.batch.azure.com" ); - const [jobId] = React.useState("faketestjob1"); + const [jobId, setJobId] = React.useState("faketestjob1"); taskService.generateTasks = true; - taskService.numOfTasks = taskNumberField; + taskService.numOfTasks = spinButtonValue; + + React.useEffect(() => { + taskService.numOfTasks = spinButtonValue; + setSpinButton(spinButtonValue); + setJobId("testjob" + spinButtonValue?.toString()); + }, [spinButtonValue, taskService, jobId]); return ( @@ -35,9 +41,26 @@ export const TaskListDemo: React.FC = () => { { + const numberValue = Number(value); + if (!isNaN(numberValue)) { + setSpinButton(numberValue + 1); + } + }} + onDecrement={(value) => { + const numberValue = Number(value); + if (!isNaN(numberValue)) { + setSpinButton(numberValue - 1); + } + }} onChange={(_, newValue) => { - setTaskNumberField(Number(newValue) ?? undefined); + setSpinButton(Number(newValue) ?? undefined); }} /> diff --git a/packages/react/src/components/grid-utils/grid-footer/data-grid-footer.tsx b/packages/react/src/components/grid-utils/grid-footer/data-grid-footer.tsx new file mode 100644 index 000000000..f99158014 --- /dev/null +++ b/packages/react/src/components/grid-utils/grid-footer/data-grid-footer.tsx @@ -0,0 +1,64 @@ +import * as React from "react"; +import { Stack } from "@fluentui/react/lib/Stack"; +import { IconButton } from "@fluentui/react/lib/Button"; +import { Footer, FooterIcon, FooterRight } from "../grid-utlis.styles"; + +interface GridFooterProps { + currentPage: number; + pageSize: number; + totalItems: number; + // goToPage: (num: number) => void; + nextPage: () => void; + previousPage: () => void; + firstPage: () => void; + lastPage: () => void; +} + +export const GridFooter = (props: GridFooterProps) => { + const { + currentPage, + pageSize, + totalItems, + // goToPage, + nextPage, + previousPage, + firstPage, + lastPage, + } = props; + + return ( + + + + + {(currentPage - 1) * pageSize + 1} -{" "} + {pageSize * currentPage} of {totalItems} + + + + + Page {currentPage} + + + + + + + ); +}; diff --git a/packages/react/src/components/grid-utils/grid-utlis.styles.ts b/packages/react/src/components/grid-utils/grid-utlis.styles.ts new file mode 100644 index 000000000..aa3962560 --- /dev/null +++ b/packages/react/src/components/grid-utils/grid-utlis.styles.ts @@ -0,0 +1,34 @@ +export const Footer = { + height: "32px", + width: "100%", + paddingTop: "3px", + marginLeft: "10px", + color: "#333", + borderTop: "1px solid #edebe9", + + "&:span": { + fontWeight: "400", + color: "rgb(50, 49, 48)", + }, + "&:div": { + fontWeight: "400", + color: "rgb(50, 49, 48)", + }, +}; + +export const FooterRight = { + alignSelf: "flex-end", + marginRight: "10px", +}; + +export const FooterIcon = { + backgroundColor: "transparent", + + "&:i": {}, + "&:span": { + color: "#0078D4", + }, + "&:span:disabled": { + color: "gray", + }, +}; diff --git a/packages/react/src/task/task-list.tsx b/packages/react/src/task/task-list.tsx index 26b4b0702..094d698d5 100644 --- a/packages/react/src/task/task-list.tsx +++ b/packages/react/src/task/task-list.tsx @@ -10,6 +10,7 @@ import { TaskService } from "@batch/ui-service/lib/task/task-service"; import { Icon } from "@fluentui/react/lib/Icon"; import { IconButton } from "@fluentui/react/lib/Button"; import { CiCircleChevDown } from "react-icons/ci"; +import { GridFooter } from "../components/grid-utils/grid-footer/data-grid-footer"; interface TaskListProps { accountEndpoint: string; @@ -27,7 +28,14 @@ interface TaskRow { export const TaskList = (props: TaskListProps) => { const { accountEndpoint, jobId } = props; const [items, setItems] = React.useState([]); - const [isCompact] = React.useState(false); + const [isCompact] = React.useState(true); + const [pageSize] = React.useState(20); + const [currentPage, setCurrentPage] = React.useState(1); + const [totalItems, setTotalItems] = React.useState(0); + + // store result of iterator pages in state variable, want to be global and use in loadMore func + const [iterator, setIterator] = + React.useState>(); React.useEffect(() => { let isMounted = true; @@ -40,10 +48,11 @@ export const TaskList = (props: TaskListProps) => { if (!isMounted) return; - const pages = tasks.byPage(); - // .next not picking up BatchTaskOutput[] variable type + const pages = tasks.byPage({ maxPageSize: pageSize }); + const res: IteratorResult = await pages.next(); + setIterator(pages); setItems(tasksToRows(res.value)); }; @@ -54,15 +63,39 @@ export const TaskList = (props: TaskListProps) => { return () => { isMounted = false; }; - }, [accountEndpoint, jobId]); + }, [accountEndpoint, jobId, pageSize]); return ( - + <> + + { + iterator?.next().then((res) => { + setItems(res.value); + }); + setCurrentPage(currentPage + 1); + }} + previousPage={() => { + return; + }} + firstPage={() => { + //get page? + return; + }} + lastPage={() => { + //get page? + return; + }} + /> + ); }; From f433574614ccb04bc1a5cdad50185a6e6760d035 Mon Sep 17 00:00:00 2001 From: Brenda Coronel Date: Wed, 3 Jul 2024 14:39:42 -0700 Subject: [PATCH 37/38] Infinite scroll added to demo --- packages/react/src/task/task-list.tsx | 76 ++++++++++++++++----------- packages/service/src/index.ts | 1 + packages/service/src/task/index.ts | 2 + 3 files changed, 49 insertions(+), 30 deletions(-) create mode 100644 packages/service/src/task/index.ts diff --git a/packages/react/src/task/task-list.tsx b/packages/react/src/task/task-list.tsx index 094d698d5..617a365f8 100644 --- a/packages/react/src/task/task-list.tsx +++ b/packages/react/src/task/task-list.tsx @@ -10,7 +10,7 @@ import { TaskService } from "@batch/ui-service/lib/task/task-service"; import { Icon } from "@fluentui/react/lib/Icon"; import { IconButton } from "@fluentui/react/lib/Button"; import { CiCircleChevDown } from "react-icons/ci"; -import { GridFooter } from "../components/grid-utils/grid-footer/data-grid-footer"; +import { useLoadMore } from "@azure/bonito-ui/lib/hooks"; interface TaskListProps { accountEndpoint: string; @@ -27,43 +27,57 @@ interface TaskRow { export const TaskList = (props: TaskListProps) => { const { accountEndpoint, jobId } = props; - const [items, setItems] = React.useState([]); const [isCompact] = React.useState(true); - const [pageSize] = React.useState(20); - const [currentPage, setCurrentPage] = React.useState(1); - const [totalItems, setTotalItems] = React.useState(0); + const [pageSize] = React.useState(100); + const [_, setLoadErrorMsg] = React.useState(""); - // store result of iterator pages in state variable, want to be global and use in loadMore func - const [iterator, setIterator] = - React.useState>(); + const onLoad = React.useMemo(() => { + let iterator: AsyncIterableIterator; - React.useEffect(() => { - let isMounted = true; - const taskService: TaskService = inject( - BatchDependencyName.TaskService - ); + return (fresh: boolean) => { + const taskService: TaskService = inject( + BatchDependencyName.TaskService + ); - const fetchTaskList = async () => { - const tasks = await taskService.listTasks(accountEndpoint, jobId); + const fetchTaskList = async () => { + if (fresh || !iterator) { + const tasks = await taskService.listTasks( + accountEndpoint, + jobId + ); + iterator = tasks.byPage({ maxPageSize: pageSize }); + } - if (!isMounted) return; + const res: IteratorResult< + BatchTaskOutput[], + BatchTaskOutput[] + > = await iterator.next(); - const pages = tasks.byPage({ maxPageSize: pageSize }); + if (!res.done) { + return { + items: tasksToRows(res.value), + done: false, + }; + } else { + return { + items: [], + done: true, + }; + } + }; - const res: IteratorResult = - await pages.next(); - setIterator(pages); - setItems(tasksToRows(res.value)); + return fetchTaskList(); }; + }, [accountEndpoint, jobId, pageSize]); - fetchTaskList().catch((e) => { - console.log("Error: ", e); - }); + const onLoadError = (error: unknown) => { + setLoadErrorMsg((error as { message: string })?.message ?? ""); + }; - return () => { - isMounted = false; - }; - }, [accountEndpoint, jobId, pageSize]); + const { items, hasMore, onLoadMore } = useLoadMore( + onLoad, + onLoadError + ); return ( <> @@ -72,8 +86,10 @@ export const TaskList = (props: TaskListProps) => { compact={isCompact} items={items} columns={columns} + hasMore={hasMore} + onLoadMore={onLoadMore} /> - { //get page? return; }} - /> + /> */} ); }; diff --git a/packages/service/src/index.ts b/packages/service/src/index.ts index 9147f198a..997ecd498 100644 --- a/packages/service/src/index.ts +++ b/packages/service/src/index.ts @@ -3,4 +3,5 @@ export * from "./account"; export * from "./certificate"; export * from "./pool"; export * from "./node"; +export * from "./task"; export * from "./constants"; diff --git a/packages/service/src/task/index.ts b/packages/service/src/task/index.ts new file mode 100644 index 000000000..39776c59d --- /dev/null +++ b/packages/service/src/task/index.ts @@ -0,0 +1,2 @@ +export * from "./task-service"; +export * from "./live-task-service"; From 5bdf495e7c4673e5a8161ff2f340bae4353de548 Mon Sep 17 00:00:00 2001 From: Brenda Coronel Date: Tue, 9 Jul 2024 13:35:16 -0700 Subject: [PATCH 38/38] Merge cache and task service --- .../app/environment/desktop-environment.ts | 4 +- packages/playground/src/demo-routes.tsx | 2 + .../playground/src/layout/demo-nav-menu.tsx | 5 ++ packages/react/src/task/task-list.tsx | 46 +++++++++++++------ .../service/src/task/live-task-service.ts | 30 +++++++++++- 5 files changed, 70 insertions(+), 17 deletions(-) diff --git a/desktop/src/app/environment/desktop-environment.ts b/desktop/src/app/environment/desktop-environment.ts index e85914883..470bc1a9b 100644 --- a/desktop/src/app/environment/desktop-environment.ts +++ b/desktop/src/app/environment/desktop-environment.ts @@ -15,7 +15,7 @@ import { DefaultFormLayoutProvider } from "@azure/bonito-ui/lib/components/form" import { BrowserDependencyName, BrowserEnvironmentConfig, DefaultBrowserEnvironment } from "@azure/bonito-ui/lib/environment"; import BatchExplorerHttpClient from "@batch-flask/core/batch-explorer-http-client"; import { BatchBrowserDependencyFactories, BatchFormControlResolver } from "@batch/ui-react"; -import { LiveAccountService, LiveNodeService, LivePoolService } from "@batch/ui-service"; +import { LiveTaskService, LiveAccountService, LiveNodeService, LivePoolService } from "@batch/ui-service"; import { BatchDependencyName } from "@batch/ui-service/lib/environment"; import { DesktopLocalizer } from "app/localizer/desktop-localizer"; import { AppTranslationsLoaderService, AuthService, BatchExplorerService } from "app/services"; @@ -48,6 +48,8 @@ export function initDesktopEnvironment( new LivePoolService(), [BatchDependencyName.NodeService]: () => new LiveNodeService(), + [BatchDependencyName.TaskService]: () => + new LiveTaskService(), [BatchDependencyName.AccountService]: () => new LiveAccountService(), [DependencyName.Notifier]: () => new AlertNotifier(), // TODO: update with real notification implementation diff --git a/packages/playground/src/demo-routes.tsx b/packages/playground/src/demo-routes.tsx index 88c7330fb..170cd4aad 100644 --- a/packages/playground/src/demo-routes.tsx +++ b/packages/playground/src/demo-routes.tsx @@ -14,6 +14,7 @@ import { TabSelectorDemo } from "./demo/form/tab-selector-demo"; import { StringListDemo } from "./demo/form/stringlist/stringlist-demo"; import { VmExtensionListDemo } from "./demo/display/vm-extension/vm-extension-list-demo"; import { TaskListDemo } from "./demo/display/task-list/task-list-demo"; +import { TaskListLiveDemo } from "./demo/display/task-list/task-list-live-demo"; export const DEMO_MAP = { default: () => , @@ -32,6 +33,7 @@ export const DEMO_MAP = { stringlist: () => , vmExtensionList: () => , taskList: () => , + liveTaskList: () => , }; export type DemoName = keyof typeof DEMO_MAP; diff --git a/packages/playground/src/layout/demo-nav-menu.tsx b/packages/playground/src/layout/demo-nav-menu.tsx index 49f7ec63e..9a4ca5880 100644 --- a/packages/playground/src/layout/demo-nav-menu.tsx +++ b/packages/playground/src/layout/demo-nav-menu.tsx @@ -95,6 +95,11 @@ export const DemoNavMenu: React.FC = () => { name: "Task List Display", url: getDemoHash("taskList"), }, + { + key: "LiveTaskList", + name: "Task List Live", + url: getDemoHash("liveTaskList"), + }, ], }, ]; diff --git a/packages/react/src/task/task-list.tsx b/packages/react/src/task/task-list.tsx index 617a365f8..f87c11b1b 100644 --- a/packages/react/src/task/task-list.tsx +++ b/packages/react/src/task/task-list.tsx @@ -1,3 +1,4 @@ +/* eslint-disable no-console */ import * as React from "react"; import { inject } from "@azure/bonito-core/lib/environment"; import { @@ -32,37 +33,52 @@ export const TaskList = (props: TaskListProps) => { const [_, setLoadErrorMsg] = React.useState(""); const onLoad = React.useMemo(() => { + console.log("onLoad"); + console.log("update?"); + let iterator: AsyncIterableIterator; return (fresh: boolean) => { + console.log("injecting service"); const taskService: TaskService = inject( BatchDependencyName.TaskService ); const fetchTaskList = async () => { + console.log("fetching tasks"); + if (fresh || !iterator) { const tasks = await taskService.listTasks( accountEndpoint, jobId ); + console.log("tasks fetched"); iterator = tasks.byPage({ maxPageSize: pageSize }); } + console.log("iterator set"); + try { + const res: IteratorResult< + BatchTaskOutput[], + BatchTaskOutput[] + > = await iterator.next(); + console.log("res value", res.value); - const res: IteratorResult< - BatchTaskOutput[], - BatchTaskOutput[] - > = await iterator.next(); - - if (!res.done) { - return { - items: tasksToRows(res.value), - done: false, - }; - } else { - return { - items: [], - done: true, - }; + if (!res.done) { + console.log("!res", res.value); + return { + items: tasksToRows(res.value), + done: false, + }; + } else { + console.log("res", res.value); + return { + items: tasksToRows(res.value), + done: true, + }; + } + } catch (e: any) { + console.log(e); + return { items: [], done: true }; } }; diff --git a/packages/service/src/task/live-task-service.ts b/packages/service/src/task/live-task-service.ts index 2640b4c12..febf01596 100644 --- a/packages/service/src/task/live-task-service.ts +++ b/packages/service/src/task/live-task-service.ts @@ -32,13 +32,41 @@ export class LiveTaskService this._ensureHttpsEndpoint(accountEndpoint) ); - const res = await batchClient.path(listTaskPath, jobId).get({ + console.log( + "service was called, entering try:", + accountEndpoint, + jobId + ); + console.log("creating task interface"); + + const createTaskI = batchClient.path(listTaskPath, jobId); + + console.log(createTaskI); + + let res = null; + + try { + res = await createTaskI.get({ + headers: { + [CustomHttpHeaders.CommandName]: + opts?.commandName ?? "ListTasks", + }, + }); + } catch (e: any) { + console.log(e); + } + + res = await createTaskI.get({ headers: { [CustomHttpHeaders.CommandName]: opts?.commandName ?? "ListTasks", }, }); + + console.log("service worked:", res); + if (isUnexpected(res)) { + console.log("unexpected res: ", res); throw createBatchUnexpectedStatusCodeError(res); }