8784: Fix test for latest firefox.
[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         SchedulingParameters SchedulingParameters `json:"scheduling_parameters"`
18 }
19
20 // Mount is special behavior to attach to a filesystem path or device.
21 type Mount struct {
22         Kind              string      `json:"kind"`
23         Writable          bool        `json:"writable"`
24         PortableDataHash  string      `json:"portable_data_hash"`
25         UUID              string      `json:"uuid"`
26         DeviceType        string      `json:"device_type"`
27         Path              string      `json:"path"`
28         Content           interface{} `json:"content"`
29         ExcludeFromOutput bool        `json:"exclude_from_output"`
30         Capacity          int64       `json:capacity`
31 }
32
33 // RuntimeConstraints specify a container's compute resources (RAM,
34 // CPU) and network connectivity.
35 type RuntimeConstraints struct {
36         API          *bool
37         RAM          int `json:"ram"`
38         VCPUs        int `json:"vcpus"`
39         KeepCacheRAM int `json:"keep_cache_ram"`
40 }
41
42 // SchedulingParameters specify a container's scheduling parameters
43 // such as Partitions
44 type SchedulingParameters struct {
45         Partitions []string `json:"partitions"`
46 }
47
48 // ContainerList is an arvados#containerList resource.
49 type ContainerList struct {
50         Items          []Container `json:"items"`
51         ItemsAvailable int         `json:"items_available"`
52         Offset         int         `json:"offset"`
53         Limit          int         `json:"limit"`
54 }
55
56 // ContainerState is a string corresponding to a valid Container state.
57 type ContainerState string
58
59 const (
60         ContainerStateQueued    = ContainerState("Queued")
61         ContainerStateLocked    = ContainerState("Locked")
62         ContainerStateRunning   = ContainerState("Running")
63         ContainerStateComplete  = ContainerState("Complete")
64         ContainerStateCancelled = ContainerState("Cancelled")
65 )