/
create.proto
67 lines (57 loc) · 1.72 KB
/
create.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// Creates a new container.
//
// ### Request
//
// All parameters are optional.
//
// * `bind_mounts`: Contains the paths that should be mounted in the
// container's filesystem. The `src_path` field for every bind mount holds the
// path as seen from the host, where the `dst_path` field holds the path as
// seem from the container.
//
// * `grace_time`: Can be used to specify how long a container can go
// unreferenced by any client connection. After this time, the container will
// automatically be destroyed. If not specified, the container will be
// subject to the globally configured grace time.
//
// * `handle`: If specified, its value must be used to refer to the
// container in future requests. If it is not specified,
// warden uses its internal container ID as the container handle.
//
// > **TODO**: `network` and `rootfs`
//
// ### Response
//
// The `handle` field contains the handle that must be used to refer to the
// container in future request. It is the same as the `handle` field in the
// request, if it was passed.
//
// ### Errors
//
// * When the `handle`, if specified, is already taken.
// * When one of the `bind_mount` paths does not exist.
// * When resource allocations fail (subnet, user ID, etc).
//
// ### Definition
//
package IronFoundry.Warden.Protocol;
import "info.proto";
message CreateRequest {
message BindMount {
enum Mode {
RO = 0;
RW = 1;
}
required string src_path = 1;
required string dst_path = 2;
required Mode bind_mount_mode = 3;
}
repeated BindMount bind_mounts = 1;
optional uint32 grace_time = 2;
optional string handle = 3;
optional string network = 4;
optional string rootfs = 5;
}
message CreateResponse {
required string handle = 1;
}