Merge branch 'main' of git.arvados.org:arvados-workbench2 into 20377-dataexplorer...
[arvados-workbench2.git] / src / models / container-request.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { Resource, ResourceKind, ResourceWithProperties } from './resource';
6 import { MountType } from 'models/mount-types';
7 import { RuntimeConstraints } from './runtime-constraints';
8 import { SchedulingParameters } from './scheduling-parameters';
9
10 export enum ContainerRequestState {
11     UNCOMMITTED = 'Uncommitted',
12     COMMITTED = 'Committed',
13     FINAL = 'Final',
14 }
15
16 export interface ContainerRequestResource
17     extends Resource,
18     ResourceWithProperties {
19     command: string[];
20     containerCountMax: number;
21     containerCount: number;
22     containerImage: string;
23     containerUuid: string | null;
24     cumulativeCost: number;
25     cwd: string;
26     description: string;
27     environment: any;
28     expiresAt: string;
29     filters: string;
30     kind: ResourceKind.CONTAINER_REQUEST;
31     logUuid: string | null;
32     mounts: { [path: string]: MountType };
33     name: string;
34     outputName: string;
35     outputPath: string;
36     outputProperties: any;
37     outputStorageClasses: string[];
38     outputTtl: number;
39     outputUuid: string | null;
40     priority: number | null;
41     requestingContainerUuid: string | null;
42     runtimeConstraints: RuntimeConstraints;
43     schedulingParameters: SchedulingParameters;
44     state: ContainerRequestState;
45     useExisting: boolean;
46 }
47
48 // Until the api supports unselecting fields, we need a list of all other fields to omit mounts
49 export const containerRequestFieldsNoMounts = [
50     "command",
51     "container_count_max",
52     "container_count",
53     "container_image",
54     "container_uuid",
55     "created_at",
56     "cwd",
57     "description",
58     "environment",
59     "etag",
60     "expires_at",
61     "filters",
62     "href",
63     "kind",
64     "log_uuid",
65     "modified_at",
66     "modified_by_client_uuid",
67     "modified_by_user_uuid",
68     "name",
69     "output_name",
70     "output_path",
71     "output_properties",
72     "output_storage_classes",
73     "output_ttl",
74     "output_uuid",
75     "owner_uuid",
76     "priority",
77     "properties",
78     "requesting_container_uuid",
79     "runtime_constraints",
80     "scheduling_parameters",
81     "state",
82     "use_existing",
83     "uuid",
84 ];