types

package
v1.4.2-0...-dac92a8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2015 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package types is used for API stability in the types and response to the consumers of the API stats endpoint.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthResponse

type AuthResponse struct {
	// Status is the authentication status
	Status string `json:"Status"`
}

AuthResponse contains response of Remote API: POST "/auth"

type BlkioStatEntry

type BlkioStatEntry struct {
	Major uint64 `json:"major"`
	Minor uint64 `json:"minor"`
	Op    string `json:"op"`
	Value uint64 `json:"value"`
}

BlkioStatEntry is one small entity to store a piece of Blkio stats TODO Windows: This can be factored out

type BlkioStats

type BlkioStats struct {
	// number of bytes tranferred to and from the block device
	IoServiceBytesRecursive []BlkioStatEntry `json:"io_service_bytes_recursive"`
	IoServicedRecursive     []BlkioStatEntry `json:"io_serviced_recursive"`
	IoQueuedRecursive       []BlkioStatEntry `json:"io_queue_recursive"`
	IoServiceTimeRecursive  []BlkioStatEntry `json:"io_service_time_recursive"`
	IoWaitTimeRecursive     []BlkioStatEntry `json:"io_wait_time_recursive"`
	IoMergedRecursive       []BlkioStatEntry `json:"io_merged_recursive"`
	IoTimeRecursive         []BlkioStatEntry `json:"io_time_recursive"`
	SectorsRecursive        []BlkioStatEntry `json:"sectors_recursive"`
}

BlkioStats stores All IO service stats for data read and write TODO Windows: This can be factored out

type CPUStats

type CPUStats struct {
	CPUUsage       CPUUsage       `json:"cpu_usage"`
	SystemUsage    uint64         `json:"system_cpu_usage"`
	ThrottlingData ThrottlingData `json:"throttling_data,omitempty"`
}

CPUStats aggregates and wraps all CPU related info of container

type CPUUsage

type CPUUsage struct {
	// Total CPU time consumed.
	// Units: nanoseconds.
	TotalUsage uint64 `json:"total_usage"`
	// Total CPU time consumed per core.
	// Units: nanoseconds.
	PercpuUsage []uint64 `json:"percpu_usage"`
	// Time spent by tasks of the cgroup in kernel mode.
	// Units: nanoseconds.
	UsageInKernelmode uint64 `json:"usage_in_kernelmode"`
	// Time spent by tasks of the cgroup in user mode.
	// Units: nanoseconds.
	UsageInUsermode uint64 `json:"usage_in_usermode"`
}

CPUUsage stores All CPU stats aggregated since container inception.

type Container

type Container struct {
	ID         string `json:"Id"`
	Names      []string
	Image      string
	Command    string
	Created    int64
	Ports      []Port
	SizeRw     int64 `json:",omitempty"`
	SizeRootFs int64 `json:",omitempty"`
	Labels     map[string]string
	Status     string
	HostConfig struct {
		NetworkMode string `json:",omitempty"`
	}
}

Container contains response of Remote API: GET "/containers/json"

type ContainerChange

type ContainerChange struct {
	Kind int
	Path string
}

ContainerChange contains response of Remote API: GET "/containers/{name:.*}/changes"

type ContainerCommitResponse

type ContainerCommitResponse struct {
	ID string `json:"Id"`
}

ContainerCommitResponse contains response of Remote API: POST "/commit?container="+containerID

type ContainerConfig120

type ContainerConfig120 struct {
	*runconfig.Config
	// backward compatibility, it lives now in HostConfig
	VolumeDriver string
}

ContainerConfig120 is a backcompatibility struct used in ContainerJSON120

type ContainerConfigPre120

type ContainerConfigPre120 struct {
	*runconfig.Config

	// backward compatibility, they now live in HostConfig
	VolumeDriver string
	Memory       int64
	MemorySwap   int64
	CPUShares    int64  `json:"CpuShares"`
	CPUSet       string `json:"CpuSet"`
}

ContainerConfigPre120 is a backcompatibility struct used in ContainerJSONPre120

type ContainerCreateResponse

type ContainerCreateResponse struct {
	// ID is the ID of the created container.
	ID string `json:"Id"`

	// Warnings are any warnings encountered during the creation of the container.
	Warnings []string `json:"Warnings"`
}

ContainerCreateResponse contains the information returned to a client on the creation of a new container.

type ContainerExecCreateResponse

type ContainerExecCreateResponse struct {
	// ID is the exec ID.
	ID string `json:"Id"`
}

ContainerExecCreateResponse contains response of Remote API: POST "/containers/{name:.*}/exec"

type ContainerJSON

type ContainerJSON struct {
	*ContainerJSONBase
	Mounts []MountPoint
	Config *runconfig.Config
}

ContainerJSON is newly used struct along with MountPoint

type ContainerJSON120

type ContainerJSON120 struct {
	*ContainerJSONBase
	Mounts []MountPoint
	Config *ContainerConfig120
}

ContainerJSON120 is a backcompatibility struct along with ContainerConfig120.

type ContainerJSONBase

type ContainerJSONBase struct {
	ID              string `json:"Id"`
	Created         string
	Path            string
	Args            []string
	State           *ContainerState
	Image           string
	NetworkSettings *network.Settings
	ResolvConfPath  string
	HostnamePath    string
	HostsPath       string
	LogPath         string
	Name            string
	RestartCount    int
	Driver          string
	ExecDriver      string
	MountLabel      string
	ProcessLabel    string
	AppArmorProfile string
	ExecIDs         []string
	HostConfig      *runconfig.HostConfig
	GraphDriver     GraphDriverData
}

ContainerJSONBase contains response of Remote API: GET "/containers/{name:.*}/json"

type ContainerJSONPre120

type ContainerJSONPre120 struct {
	*ContainerJSONBase
	Volumes   map[string]string
	VolumesRW map[string]bool
	Config    *ContainerConfigPre120
}

ContainerJSONPre120 is a backcompatibility struct along with ContainerConfigPre120. Note this is not used by the Windows daemon.

type ContainerPathStat

type ContainerPathStat struct {
	Name       string      `json:"name"`
	Size       int64       `json:"size"`
	Mode       os.FileMode `json:"mode"`
	Mtime      time.Time   `json:"mtime"`
	LinkTarget string      `json:"linkTarget"`
}

ContainerPathStat is used to encode the header from GET "/containers/{name:.*}/archive" "Name" is the file or directory name.

type ContainerProcessList

type ContainerProcessList struct {
	Processes [][]string
	Titles    []string
}

ContainerProcessList contains response of Remote API: GET "/containers/{name:.*}/top"

type ContainerState

type ContainerState struct {
	Status     string
	Running    bool
	Paused     bool
	Restarting bool
	OOMKilled  bool
	Dead       bool
	Pid        int
	ExitCode   int
	Error      string
	StartedAt  string
	FinishedAt string
}

ContainerState stores container's running state it's part of ContainerJSONBase and will return by "inspect" command

type ContainerWaitResponse

type ContainerWaitResponse struct {
	// StatusCode is the status code of the wait job
	StatusCode int `json:"StatusCode"`
}

ContainerWaitResponse contains response of Remote API: POST "/containers/"+containerID+"/wait"

type CopyConfig

type CopyConfig struct {
	Resource string
}

CopyConfig contains request body of Remote API: POST "/containers/"+containerID+"/copy"

type ExecStartCheck

type ExecStartCheck struct {
	// ExecStart will first check if it's detached
	Detach bool
	// Check if there's a tty
	Tty bool
}

ExecStartCheck is a temp struct used by execStart Config fields is part of ExecConfig in runconfig package

type GraphDriverData

type GraphDriverData struct {
	Name string
	Data map[string]string
}

GraphDriverData returns Image's graph driver config info when calling inspect command

type Image

type Image struct {
	ID          string `json:"Id"`
	ParentID    string `json:"ParentId"`
	RepoTags    []string
	RepoDigests []string
	Created     int64
	Size        int64
	VirtualSize int64
	Labels      map[string]string
}

Image contains response of Remote API: GET "/images/json"

type ImageDelete

type ImageDelete struct {
	Untagged string `json:",omitempty"`
	Deleted  string `json:",omitempty"`
}

ImageDelete contains response of Remote API: DELETE "/images/{name:.*}"

type ImageHistory

type ImageHistory struct {
	ID        string `json:"Id"`
	Created   int64
	CreatedBy string
	Tags      []string
	Size      int64
	Comment   string
}

ImageHistory contains response of Remote API: GET "/images/{name:.*}/history"

type ImageInspect

type ImageInspect struct {
	ID              string `json:"Id"`
	Tags            []string
	Parent          string
	Comment         string
	Created         string
	Container       string
	ContainerConfig *runconfig.Config
	DockerVersion   string
	Author          string
	Config          *runconfig.Config
	Architecture    string
	Os              string
	Size            int64
	VirtualSize     int64
	GraphDriver     GraphDriverData
}

ImageInspect contains response of Remote API: GET "/images/{name:.*}/json"

type Info

type Info struct {
	ID                 string
	Containers         int
	Images             int
	Driver             string
	DriverStatus       [][2]string
	MemoryLimit        bool
	SwapLimit          bool
	CPUCfsPeriod       bool `json:"CpuCfsPeriod"`
	CPUCfsQuota        bool `json:"CpuCfsQuota"`
	IPv4Forwarding     bool
	BridgeNfIptables   bool
	BridgeNfIP6tables  bool `json:"BridgeNfIp6tables"`
	Debug              bool
	NFd                int
	OomKillDisable     bool
	NGoroutines        int
	SystemTime         string
	ExecutionDriver    string
	LoggingDriver      string
	NEventsListener    int
	KernelVersion      string
	OperatingSystem    string
	IndexServerAddress string
	RegistryConfig     *registry.ServiceConfig
	InitSha1           string
	InitPath           string
	NCPU               int
	MemTotal           int64
	DockerRootDir      string
	HTTPProxy          string `json:"HttpProxy"`
	HTTPSProxy         string `json:"HttpsProxy"`
	NoProxy            string
	Name               string
	Labels             []string
	ExperimentalBuild  bool
}

Info contains response of Remote API: GET "/info"

type MemoryStats

type MemoryStats struct {
	// current res_counter usage for memory
	Usage uint64 `json:"usage"`
	// maximum usage ever recorded.
	MaxUsage uint64 `json:"max_usage"`
	// TODO(vishh): Export these as stronger types.
	// all the stats exported via memory.stat.
	Stats map[string]uint64 `json:"stats"`
	// number of times memory usage hits limits.
	Failcnt uint64 `json:"failcnt"`
	Limit   uint64 `json:"limit"`
}

MemoryStats aggregates All memory stats since container inception

type MountPoint

type MountPoint struct {
	Name        string `json:",omitempty"`
	Source      string
	Destination string
	Driver      string `json:",omitempty"`
	Mode        string
	RW          bool
}

MountPoint represents a mount point configuration inside the container.

type NetworkStats

type NetworkStats struct {
	RxBytes   uint64 `json:"rx_bytes"`
	RxPackets uint64 `json:"rx_packets"`
	RxErrors  uint64 `json:"rx_errors"`
	RxDropped uint64 `json:"rx_dropped"`
	TxBytes   uint64 `json:"tx_bytes"`
	TxPackets uint64 `json:"tx_packets"`
	TxErrors  uint64 `json:"tx_errors"`
	TxDropped uint64 `json:"tx_dropped"`
}

NetworkStats aggregates All network stats of one container TODO Windows: This will require refactoring

type Port

type Port struct {
	IP          string `json:",omitempty"`
	PrivatePort int
	PublicPort  int `json:",omitempty"`
	Type        string
}

Port stores open ports info of container e.g. {"PrivatePort": 8080, "PublicPort": 80, "Type": "tcp"}

type Stats

type Stats struct {
	Read        time.Time    `json:"read"`
	Network     NetworkStats `json:"network,omitempty"`
	PreCPUStats CPUStats     `json:"precpu_stats,omitempty"`
	CPUStats    CPUStats     `json:"cpu_stats,omitempty"`
	MemoryStats MemoryStats  `json:"memory_stats,omitempty"`
	BlkioStats  BlkioStats   `json:"blkio_stats,omitempty"`
}

Stats is Ultimate struct aggregating all types of stats of one container

type ThrottlingData

type ThrottlingData struct {
	// Number of periods with throttling active
	Periods uint64 `json:"periods"`
	// Number of periods when the container hit its throttling limit.
	ThrottledPeriods uint64 `json:"throttled_periods"`
	// Aggregate time the container was throttled for in nanoseconds.
	ThrottledTime uint64 `json:"throttled_time"`
}

ThrottlingData stores CPU throttling stats of one running container

type Version

type Version struct {
	Version       string
	APIVersion    version.Version `json:"ApiVersion"`
	GitCommit     string
	GoVersion     string
	Os            string
	Arch          string
	KernelVersion string `json:",omitempty"`
	Experimental  bool   `json:",omitempty"`
	BuildTime     string `json:",omitempty"`
}

Version contains response of Remote API: GET "/version"

type Volume

type Volume struct {
	Name       string // Name is the name of the volume
	Driver     string // Driver is the Driver name used to create the volume
	Mountpoint string // Mountpoint is the location on disk of the volume
}

Volume represents the configuration of a volume for the remote API

type VolumeCreateRequest

type VolumeCreateRequest struct {
	Name       string            // Name is the requested name of the volume
	Driver     string            // Driver is the name of the driver that should be used to create the volume
	DriverOpts map[string]string // DriverOpts holds the driver specific options to use for when creating the volume.
}

VolumeCreateRequest contains the response for the remote API: POST "/volumes"

type VolumesListResponse

type VolumesListResponse struct {
	Volumes []*Volume // Volumes is the list of volumes being returned
}

VolumesListResponse contains the response for the remote API: GET "/volumes"

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL