2014-12-17 17:30:52 +08:00
|
|
|
package configs
|
2014-06-25 07:54:50 +08:00
|
|
|
|
|
|
|
// State represents a running container's state
|
|
|
|
type State struct {
|
2014-06-26 02:42:08 +08:00
|
|
|
// InitPid is the init process id in the parent namespace
|
|
|
|
InitPid int `json:"init_pid,omitempty"`
|
2014-07-09 01:17:05 +08:00
|
|
|
|
2014-06-26 02:42:08 +08:00
|
|
|
// InitStartTime is the init process start time
|
|
|
|
InitStartTime string `json:"init_start_time,omitempty"`
|
2014-07-09 01:17:05 +08:00
|
|
|
|
2014-06-25 07:43:00 +08:00
|
|
|
// Network runtime state.
|
2015-02-01 11:56:27 +08:00
|
|
|
NetworkState NetworkState `json:"network_state,omitempty"`
|
2014-08-13 14:18:55 +08:00
|
|
|
|
2014-08-14 07:25:18 +08:00
|
|
|
// Path to all the cgroups setup for a container. Key is cgroup subsystem name.
|
|
|
|
CgroupPaths map[string]string `json:"cgroup_paths,omitempty"`
|
2015-02-01 11:56:27 +08:00
|
|
|
|
|
|
|
Status Status `json:"status,omitempty"`
|
2014-06-25 07:54:50 +08:00
|
|
|
}
|
|
|
|
|
2015-02-01 11:56:27 +08:00
|
|
|
// Struct describing the network specific runtime state that will be maintained by libcontainer for all running containers
|
|
|
|
// Do not depend on it outside of libcontainer.
|
|
|
|
// TODO: move veth names to config time
|
|
|
|
type NetworkState struct {
|
|
|
|
// The name of the veth interface on the Host.
|
|
|
|
VethHost string `json:"veth_host,omitempty"`
|
|
|
|
// The name of the veth interface created inside the container for the child.
|
|
|
|
VethChild string `json:"veth_child,omitempty"`
|
|
|
|
}
|
2014-07-09 01:17:05 +08:00
|
|
|
|
2015-02-01 11:56:27 +08:00
|
|
|
// The status of a container.
|
|
|
|
type Status int
|
2014-07-09 01:17:05 +08:00
|
|
|
|
2015-02-01 11:56:27 +08:00
|
|
|
const (
|
2014-07-09 01:17:05 +08:00
|
|
|
// The container exists and is running.
|
2015-02-01 11:56:27 +08:00
|
|
|
Running Status = iota + 1
|
2014-07-09 01:17:05 +08:00
|
|
|
|
|
|
|
// The container exists, it is in the process of being paused.
|
|
|
|
Pausing
|
|
|
|
|
|
|
|
// The container exists, but all its processes are paused.
|
|
|
|
Paused
|
|
|
|
|
|
|
|
// The container does not exist.
|
|
|
|
Destroyed
|
|
|
|
)
|