2015-11-05 23:29:53 +00:00
|
|
|
package v1
|
|
|
|
|
2015-12-04 23:12:57 +00:00
|
|
|
import "time"
|
|
|
|
|
2015-11-05 23:29:53 +00:00
|
|
|
type State struct {
|
|
|
|
Containers []Container `json:"containers"`
|
2015-12-03 19:49:56 +00:00
|
|
|
Machine Machine `json:"machine"`
|
2015-11-05 23:29:53 +00:00
|
|
|
}
|
|
|
|
|
2015-11-12 21:40:23 +00:00
|
|
|
type Status string
|
|
|
|
|
|
|
|
const (
|
|
|
|
Paused Status = "paused"
|
|
|
|
Running Status = "running"
|
|
|
|
)
|
|
|
|
|
2015-12-03 19:49:56 +00:00
|
|
|
type Machine struct {
|
2015-12-07 23:19:56 +00:00
|
|
|
ID string `json:"id"`
|
|
|
|
Cpus int `json:"cpus"`
|
|
|
|
Memory int64 `json:"memory"`
|
2015-12-03 19:49:56 +00:00
|
|
|
}
|
|
|
|
|
2015-11-12 21:40:23 +00:00
|
|
|
type ContainerState struct {
|
|
|
|
Status Status `json:"status,omitempty"`
|
2015-12-04 22:10:50 +00:00
|
|
|
Signal int `json:"signal,omitempty"`
|
2015-11-12 21:40:23 +00:00
|
|
|
}
|
|
|
|
|
2015-11-05 23:29:53 +00:00
|
|
|
type Container struct {
|
2015-11-12 21:40:23 +00:00
|
|
|
ID string `json:"id,omitempty"`
|
|
|
|
BundlePath string `json:"bundlePath,omitempty"`
|
|
|
|
Processes []Process `json:"processes,omitempty"`
|
2015-11-13 21:22:42 +00:00
|
|
|
Stdout string `json:"stdout,omitempty"`
|
|
|
|
Stderr string `json:"stderr,omitempty"`
|
2015-11-12 21:40:23 +00:00
|
|
|
State *ContainerState `json:"state,omitempty"`
|
2015-12-04 22:44:08 +00:00
|
|
|
Checkpoint string `json:"checkpoint,omitempty"`
|
2015-11-10 22:57:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type User struct {
|
|
|
|
UID uint32 `json:"uid"`
|
|
|
|
GID uint32 `json:"gid"`
|
|
|
|
AdditionalGids []uint32 `json:"additionalGids,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type Process struct {
|
2015-11-30 23:46:36 +00:00
|
|
|
Terminal bool `json:"terminal"`
|
|
|
|
User User `json:"user"`
|
2015-11-10 22:57:10 +00:00
|
|
|
Args []string `json:"args,omitempty"`
|
|
|
|
Env []string `json:"env,omitempty"`
|
|
|
|
Cwd string `json:"cwd,omitempty"`
|
|
|
|
Pid int `json:"pid,omitempty"`
|
2015-11-05 23:29:53 +00:00
|
|
|
}
|
2015-11-10 21:44:35 +00:00
|
|
|
|
|
|
|
type Signal struct {
|
|
|
|
Signal int `json:"signal"`
|
|
|
|
}
|
2015-11-30 23:46:36 +00:00
|
|
|
|
|
|
|
type Event struct {
|
|
|
|
Type string `json:"type"`
|
|
|
|
ID string `json:"id,omitempty"`
|
|
|
|
Status int `json:"status,omitempty"`
|
|
|
|
}
|
2015-12-04 00:07:53 +00:00
|
|
|
|
|
|
|
type Checkpoint struct {
|
2015-12-04 23:12:57 +00:00
|
|
|
Name string `json:"name,omitempty"`
|
|
|
|
Timestamp time.Time `json:"timestamp,omitempty"`
|
|
|
|
Exit bool `json:"exit,omitempty"`
|
|
|
|
Tcp bool `json:"tcp"`
|
|
|
|
UnixSockets bool `json:"unixSockets"`
|
|
|
|
Shell bool `json:"shell"`
|
2015-12-04 00:07:53 +00:00
|
|
|
}
|