Merge branch 'master' into 9372-container-display
[arvados.git] / sdk / go / arvados / container.go
1 package arvados
2
3 // Container is an arvados#container resource.
4 type Container struct {
5         UUID               string             `json:"uuid"`
6         Command            []string           `json:"command"`
7         ContainerImage     string             `json:"container_image"`
8         Cwd                string             `json:"cwd"`
9         Environment        map[string]string  `json:"environment"`
10         LockedByUUID       string             `json:"locked_by_uuid"`
11         Mounts             map[string]Mount   `json:"mounts"`
12         Output             string             `json:"output"`
13         OutputPath         string             `json:"output_path"`
14         Priority           int                `json:"priority"`
15         RuntimeConstraints RuntimeConstraints `json:"runtime_constraints"`
16         State              ContainerState     `json:"state"`
17 }
18
19 // Mount is special behavior to attach to a filesystem path or device.
20 type Mount struct {
21         Kind             string `json:"kind"`
22         Writable         bool   `json:"writable"`
23         PortableDataHash string `json:"portable_data_hash"`
24         UUID             string `json:"uuid"`
25         DeviceType       string `json:"device_type"`
26         Path             string `json:"path"`
27 }
28
29 // RuntimeConstraints specify a container's compute resources (RAM,
30 // CPU) and network connectivity.
31 type RuntimeConstraints struct {
32         API   *bool
33         RAM   int `json:"ram"`
34         VCPUs int `json:"vcpus"`
35 }
36
37 // ContainerList is an arvados#containerList resource.
38 type ContainerList struct {
39         Items          []Container `json:"items"`
40         ItemsAvailable int         `json:"items_available"`
41         Offset         int         `json:"offset"`
42         Limit          int         `json:"limit"`
43 }
44
45 // ContainerState is a string corresponding to a valid Container state.
46 type ContainerState string
47
48 const (
49         ContainerStateQueued    = ContainerState("Queued")
50         ContainerStateLocked    = ContainerState("Locked")
51         ContainerStateRunning   = ContainerState("Running")
52         ContainerStateComplete  = ContainerState("Complete")
53         ContainerStateCancelled = ContainerState("Cancelled")
54 )