Merge branch 'master' into 13935-login-page-and-main-panel
[arvados-workbench2.git] / src / models / mount-types.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 export enum MountKind {
6     COLLECTION = 'collection',
7     GIT_TREE = 'git_tree',
8     TEMPORARY_DIRECTORY = 'tmp',
9     KEEP = 'keep',
10     MOUNTED_FILE = 'file',
11     JSON = 'JSON'
12 }
13
14 export type MountType =
15     CollectionMount |
16     GitTreeMount |
17     TemporaryDirectoryMount |
18     KeepMount |
19     JSONMount;
20
21 export interface CollectionMount {
22     kind: MountKind.COLLECTION;
23     uuid?: string;
24     portableDataHash?: string;
25     path?: string;
26     writable?: boolean;
27 }
28
29 export interface GitTreeMount {
30     kind: MountKind.GIT_TREE;
31     uuid: string;
32     commit: string;
33     path?: string;
34 }
35
36 export enum TemporaryDirectoryDeviceType {
37     RAM = 'ram',
38     SSD = 'ssd',
39     DISK = 'disk',
40     NETWORK = 'network',
41 }
42
43 export interface TemporaryDirectoryMount {
44     kind: MountKind.TEMPORARY_DIRECTORY;
45     capacity: number;
46     deviceType: TemporaryDirectoryDeviceType;
47 }
48
49 export interface KeepMount {
50     kind: MountKind.KEEP;
51 }
52
53 export interface JSONMount {
54     kind: MountKind.JSON;
55     content: string;
56 }