2018-02-05 21:05:59 +00:00
package types // import "github.com/docker/docker/api/types"
2016-09-06 18:18:12 +00:00
import (
2016-11-16 21:30:29 +00:00
"errors"
"fmt"
2016-09-07 23:08:51 +00:00
"io"
2016-09-06 18:18:12 +00:00
"os"
2016-11-16 21:30:29 +00:00
"strings"
2016-09-06 18:18:12 +00:00
"time"
"github.com/docker/docker/api/types/container"
2016-10-19 16:22:02 +00:00
"github.com/docker/docker/api/types/filters"
2016-09-06 18:18:12 +00:00
"github.com/docker/docker/api/types/mount"
"github.com/docker/docker/api/types/network"
"github.com/docker/docker/api/types/registry"
"github.com/docker/docker/api/types/swarm"
2022-03-18 15:33:43 +00:00
"github.com/docker/docker/api/types/volume"
2016-09-06 18:18:12 +00:00
"github.com/docker/go-connections/nat"
)
2019-08-28 11:46:32 +00:00
const (
// MediaTypeRawStream is vendor specific MIME-Type set for raw TTY streams
MediaTypeRawStream = "application/vnd.docker.raw-stream"
// MediaTypeMultiplexedStream is vendor specific MIME-Type set for stdin/stdout/stderr multiplexed streams
MediaTypeMultiplexedStream = "application/vnd.docker.multiplexed-stream"
)
2016-09-06 18:18:12 +00:00
// RootFS returns Image's RootFS description including the layer IDs.
type RootFS struct {
2022-02-28 18:32:48 +00:00
Type string ` json:",omitempty" `
Layers [ ] string ` json:",omitempty" `
2016-09-06 18:18:12 +00:00
}
2016-11-15 19:45:20 +00:00
// ImageInspect contains response of Engine API:
2016-09-06 18:18:12 +00:00
// GET "/images/{name:.*}/json"
type ImageInspect struct {
2022-02-28 18:05:57 +00:00
// ID is the content-addressable ID of an image.
//
2022-04-19 13:43:59 +00:00
// This identifier is a content-addressable digest calculated from the
2022-02-28 18:05:57 +00:00
// image's configuration (which includes the digests of layers used by
// the image).
//
// Note that this digest differs from the `RepoDigests` below, which
// holds digests of image manifests that reference the image.
ID string ` json:"Id" `
// RepoTags is a list of image names/tags in the local image cache that
// reference this image.
//
2022-05-22 20:08:04 +00:00
// Multiple image tags can refer to the same image, and this list may be
2022-02-28 18:05:57 +00:00
// empty if no tags reference the image, in which case the image is
// "untagged", in which case it can still be referenced by its ID.
RepoTags [ ] string
// RepoDigests is a list of content-addressable digests of locally available
// image manifests that the image is referenced from. Multiple manifests can
// refer to the same image.
//
// These digests are usually only available if the image was either pulled
// from a registry, or if the image was pushed to a registry, which is when
// the manifest is generated and its digest calculated.
RepoDigests [ ] string
// Parent is the ID of the parent image.
//
// Depending on how the image was created, this field may be empty and
// is only set for images that were built/created locally. This field
// is empty if the image was pulled from an image registry.
Parent string
// Comment is an optional message that can be set when committing or
// importing the image.
Comment string
// Created is the date and time at which the image was created, formatted in
// RFC 3339 nano-seconds (time.RFC3339Nano).
Created string
// Container is the ID of the container that was used to create the image.
//
// Depending on how the image was created, this field may be empty.
Container string
2022-04-04 18:10:35 +00:00
// ContainerConfig is an optional field containing the configuration of the
// container that was last committed when creating the image.
//
// Previous versions of Docker builder used this field to store build cache,
// and it is not in active use anymore.
2016-09-06 18:18:12 +00:00
ContainerConfig * container . Config
2022-02-28 18:05:57 +00:00
// DockerVersion is the version of Docker that was used to build the image.
//
// Depending on how the image was created, this field may be empty.
DockerVersion string
// Author is the name of the author that was specified when committing the
// image, or as specified through MAINTAINER (deprecated) in the Dockerfile.
Author string
Config * container . Config
// Architecture is the hardware CPU architecture that the image runs on.
Architecture string
// Variant is the CPU architecture variant (presently ARM-only).
Variant string ` json:",omitempty" `
// OS is the Operating System the image is built to run on.
Os string
// OsVersion is the version of the Operating System the image is built to
// run on (especially for Windows).
OsVersion string ` json:",omitempty" `
// Size is the total size of the image including all layers it is composed of.
Size int64
// VirtualSize is the total size of the image including all layers it is
// composed of.
//
// In versions of Docker before v1.10, this field was calculated from
// the image itself and all of its parent images. Docker v1.10 and up
// store images self-contained, and no longer use a parent-chain, making
// this field an equivalent of the Size field.
//
// This field is kept for backward compatibility, but may be removed in
// a future version of the API.
VirtualSize int64 // TODO(thaJeztah): deprecate this field
// GraphDriver holds information about the storage driver used to store the
// container's and image's filesystem.
GraphDriver GraphDriverData
// RootFS contains information about the image's RootFS, including the
// layer IDs.
RootFS RootFS
// Metadata of the image in the local cache.
//
// This information is local to the daemon, and not part of the image itself.
Metadata ImageMetadata
2017-03-02 20:47:02 +00:00
}
// ImageMetadata contains engine-local data about the image
type ImageMetadata struct {
2022-02-28 18:05:57 +00:00
// LastTagTime is the date and time at which the image was last tagged.
2017-03-02 20:47:02 +00:00
LastTagTime time . Time ` json:",omitempty" `
2016-09-06 18:18:12 +00:00
}
2016-11-15 19:45:20 +00:00
// Container contains response of Engine API:
2016-09-06 18:18:12 +00:00
// GET "/containers/json"
type Container struct {
ID string ` json:"Id" `
Names [ ] string
Image string
ImageID string
Command string
Created int64
Ports [ ] Port
SizeRw int64 ` json:",omitempty" `
SizeRootFs int64 ` json:",omitempty" `
Labels map [ string ] string
State string
Status string
HostConfig struct {
NetworkMode string ` json:",omitempty" `
}
NetworkSettings * SummaryNetworkSettings
Mounts [ ] MountPoint
}
2016-11-15 19:45:20 +00:00
// CopyConfig contains request body of Engine API:
2016-09-06 18:18:12 +00:00
// POST "/containers/"+containerID+"/copy"
type CopyConfig struct {
Resource string
}
// ContainerPathStat is used to encode the header from
// GET "/containers/{name:.*}/archive"
// "Name" is the file or directory name.
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" `
}
2016-11-15 19:45:20 +00:00
// ContainerStats contains response of Engine API:
2016-09-07 23:08:51 +00:00
// GET "/stats"
type ContainerStats struct {
Body io . ReadCloser ` json:"body" `
OSType string ` json:"ostype" `
}
2016-11-15 19:45:20 +00:00
// Ping contains response of Engine API:
2016-11-03 00:43:32 +00:00
// GET "/_ping"
type Ping struct {
2018-08-06 01:52:35 +00:00
APIVersion string
OSType string
Experimental bool
BuilderVersion BuilderVersion
2022-03-14 09:10:19 +00:00
// SwarmStatus provides information about the current swarm status of the
// engine, obtained from the "Swarm" header in the API response.
//
// It can be a nil struct if the API version does not provide this header
// in the ping response, or if an error occurred, in which case the client
// should use other ways to get the current swarm status, such as the /swarm
// endpoint.
SwarmStatus * swarm . Status
2016-11-03 00:43:32 +00:00
}
2017-12-05 14:29:37 +00:00
// ComponentVersion describes the version information for a specific component.
type ComponentVersion struct {
Name string
Version string
Details map [ string ] string ` json:",omitempty" `
}
2016-11-15 19:45:20 +00:00
// Version contains response of Engine API:
2016-09-06 18:18:12 +00:00
// GET "/version"
type Version struct {
2017-12-05 14:29:37 +00:00
Platform struct { Name string } ` json:",omitempty" `
Components [ ] ComponentVersion ` json:",omitempty" `
// The following fields are deprecated, they relate to the Engine component and are kept for backwards compatibility
2016-09-06 18:18:12 +00:00
Version string
APIVersion string ` json:"ApiVersion" `
2016-11-02 17:04:39 +00:00
MinAPIVersion string ` json:"MinAPIVersion,omitempty" `
2016-09-06 18:18:12 +00:00
GitCommit string
GoVersion string
Os string
Arch string
KernelVersion string ` json:",omitempty" `
Experimental bool ` json:",omitempty" `
BuildTime string ` json:",omitempty" `
}
2016-12-19 06:45:48 +00:00
// Commit holds the Git-commit (SHA1) that a binary was built from, as reported
// in the version-string of external tools, such as containerd, or runC.
2016-10-24 22:18:58 +00:00
type Commit struct {
2016-12-19 06:45:48 +00:00
ID string // ID is the actual commit ID of external tool.
Expected string // Expected is the commit ID of external tool expected by dockerd as set at build time.
2016-10-24 22:18:58 +00:00
}
2016-11-15 19:45:20 +00:00
// Info contains response of Engine API:
2016-09-06 18:18:12 +00:00
// GET "/info"
2016-11-16 21:30:29 +00:00
type Info struct {
2016-09-06 18:18:12 +00:00
ID string
Containers int
ContainersRunning int
ContainersPaused int
ContainersStopped int
Images int
Driver string
DriverStatus [ ] [ 2 ] string
2020-01-03 11:28:23 +00:00
SystemStatus [ ] [ 2 ] string ` json:",omitempty" ` // SystemStatus is only propagated by the Swarm standalone API
2016-09-06 18:18:12 +00:00
Plugins PluginsInfo
MemoryLimit bool
SwapLimit bool
2022-02-07 16:09:23 +00:00
KernelMemory bool ` json:",omitempty" ` // Deprecated: kernel 5.4 deprecated kmem.limit_in_bytes
KernelMemoryTCP bool ` json:",omitempty" ` // KernelMemoryTCP is not supported on cgroups v2.
2016-09-06 18:18:12 +00:00
CPUCfsPeriod bool ` json:"CpuCfsPeriod" `
CPUCfsQuota bool ` json:"CpuCfsQuota" `
CPUShares bool
CPUSet bool
2017-04-11 11:28:13 +00:00
PidsLimit bool
2016-09-06 18:18:12 +00:00
IPv4Forwarding bool
BridgeNfIptables bool
BridgeNfIP6tables bool ` json:"BridgeNfIp6tables" `
Debug bool
NFd int
OomKillDisable bool
NGoroutines int
SystemTime string
LoggingDriver string
CgroupDriver string
2020-03-10 12:09:25 +00:00
CgroupVersion string ` json:",omitempty" `
2016-09-06 18:18:12 +00:00
NEventsListener int
KernelVersion string
OperatingSystem string
2019-05-30 16:51:41 +00:00
OSVersion string
2016-09-06 18:18:12 +00:00
OSType string
Architecture string
IndexServerAddress string
RegistryConfig * registry . ServiceConfig
NCPU int
MemTotal int64
2017-05-31 00:02:11 +00:00
GenericResources [ ] swarm . GenericResource
2016-09-06 18:18:12 +00:00
DockerRootDir string
HTTPProxy string ` json:"HttpProxy" `
HTTPSProxy string ` json:"HttpsProxy" `
NoProxy string
Name string
Labels [ ] string
ExperimentalBuild bool
ServerVersion string
Runtimes map [ string ] Runtime
DefaultRuntime string
Swarm swarm . Info
// LiveRestoreEnabled determines whether containers should be kept
// running when the daemon is shutdown or upon daemon start if
// running containers are detected
2020-07-07 03:17:51 +00:00
LiveRestoreEnabled bool
Isolation container . Isolation
InitBinary string
ContainerdCommit Commit
RuncCommit Commit
InitCommit Commit
SecurityOptions [ ] string
2020-07-20 13:11:08 +00:00
ProductLicense string ` json:",omitempty" `
DefaultAddressPools [ ] NetworkAddressPool ` json:",omitempty" `
2021-07-14 14:52:32 +00:00
// Warnings contains a slice of warnings that occurred while collecting
// system information. These warnings are intended to be informational
// messages for the user, and are not intended to be parsed / used for
// other purposes, as they do not have a fixed format.
Warnings [ ] string
2016-09-06 18:18:12 +00:00
}
2016-11-16 21:30:29 +00:00
// KeyValue holds a key/value pair
type KeyValue struct {
2016-09-02 13:20:54 +00:00
Key , Value string
}
2020-07-07 03:17:51 +00:00
// NetworkAddressPool is a temp struct used by Info struct
type NetworkAddressPool struct {
Base string
Size int
}
2016-11-16 21:30:29 +00:00
// SecurityOpt contains the name and options of a security option
type SecurityOpt struct {
Name string
Options [ ] KeyValue
}
// DecodeSecurityOptions decodes a security options string slice to a type safe
// SecurityOpt
func DecodeSecurityOptions ( opts [ ] string ) ( [ ] SecurityOpt , error ) {
so := [ ] SecurityOpt { }
for _ , opt := range opts {
// support output from a < 1.13 docker daemon
if ! strings . Contains ( opt , "=" ) {
so = append ( so , SecurityOpt { Name : opt } )
continue
}
secopt := SecurityOpt { }
split := strings . Split ( opt , "," )
for _ , s := range split {
kv := strings . SplitN ( s , "=" , 2 )
if len ( kv ) != 2 {
return nil , fmt . Errorf ( "invalid security option %q" , s )
}
if kv [ 0 ] == "" || kv [ 1 ] == "" {
return nil , errors . New ( "invalid empty security option" )
}
if kv [ 0 ] == "name" {
secopt . Name = kv [ 1 ]
continue
}
secopt . Options = append ( secopt . Options , KeyValue { Key : kv [ 0 ] , Value : kv [ 1 ] } )
}
so = append ( so , secopt )
}
return so , nil
2016-09-02 13:20:54 +00:00
}
2016-09-06 18:18:12 +00:00
// PluginsInfo is a temp struct holding Plugins name
// registered with docker daemon. It is used by Info struct
type PluginsInfo struct {
// List of Volume plugins registered
Volume [ ] string
// List of Network plugins registered
Network [ ] string
// List of Authorization plugins registered
Authorization [ ] string
2017-04-11 21:21:21 +00:00
// List of Log plugins registered
Log [ ] string
2016-09-06 18:18:12 +00:00
}
// ExecStartCheck is a temp struct used by execStart
// Config fields is part of ExecConfig in runconfig package
type ExecStartCheck struct {
// ExecStart will first check if it's detached
Detach bool
// Check if there's a tty
Tty bool
2022-06-15 07:28:20 +00:00
// Terminal size [height, width], unused if Tty == false
ConsoleSize * [ 2 ] uint ` json:",omitempty" `
2016-09-06 18:18:12 +00:00
}
// HealthcheckResult stores information about a single run of a healthcheck probe
type HealthcheckResult struct {
Start time . Time // Start is the time this check started
End time . Time // End is the time this check ended
ExitCode int // ExitCode meanings: 0=healthy, 1=unhealthy, 2=reserved (considered unhealthy), else=error running probe
Output string // Output from last check
}
// Health states
const (
2016-07-15 18:21:19 +00:00
NoHealthcheck = "none" // Indicates there is no healthcheck
Starting = "starting" // Starting indicates that the container is not yet ready
Healthy = "healthy" // Healthy indicates that the container is running correctly
Unhealthy = "unhealthy" // Unhealthy indicates that the container has a problem
2016-09-06 18:18:12 +00:00
)
// Health stores information about the container's healthcheck results
type Health struct {
Status string // Status is one of Starting, Healthy or Unhealthy
FailingStreak int // FailingStreak is the number of consecutive failures
Log [ ] * HealthcheckResult // Log contains the last few results (oldest first)
}
// ContainerState stores container's running state
// it's part of ContainerJSONBase and will return by "inspect" command
type ContainerState struct {
2017-05-19 10:29:54 +00:00
Status string // String representation of the container state. Can be one of "created", "running", "paused", "restarting", "removing", "exited", or "dead"
2016-09-06 18:18:12 +00:00
Running bool
Paused bool
Restarting bool
OOMKilled bool
Dead bool
Pid int
ExitCode int
Error string
StartedAt string
FinishedAt string
Health * Health ` json:",omitempty" `
}
// ContainerNode stores information about the node that a container
2020-01-03 10:49:12 +00:00
// is running on. It's only used by the Docker Swarm standalone API
2016-09-06 18:18:12 +00:00
type ContainerNode struct {
ID string
IPAddress string ` json:"IP" `
Addr string
Name string
Cpus int
Memory int64
Labels map [ string ] string
}
2016-11-15 19:45:20 +00:00
// ContainerJSONBase contains response of Engine API:
2016-09-06 18:18:12 +00:00
// GET "/containers/{name:.*}/json"
type ContainerJSONBase struct {
ID string ` json:"Id" `
Created string
Path string
Args [ ] string
State * ContainerState
Image string
ResolvConfPath string
HostnamePath string
HostsPath string
LogPath string
2020-01-03 10:49:12 +00:00
Node * ContainerNode ` json:",omitempty" ` // Node is only propagated by Docker Swarm standalone API
2016-09-06 18:18:12 +00:00
Name string
RestartCount int
Driver string
2017-10-09 20:47:28 +00:00
Platform string
2016-09-06 18:18:12 +00:00
MountLabel string
ProcessLabel string
AppArmorProfile string
ExecIDs [ ] string
HostConfig * container . HostConfig
GraphDriver GraphDriverData
SizeRw * int64 ` json:",omitempty" `
SizeRootFs * int64 ` json:",omitempty" `
}
// ContainerJSON is newly used struct along with MountPoint
type ContainerJSON struct {
* ContainerJSONBase
Mounts [ ] MountPoint
Config * container . Config
NetworkSettings * NetworkSettings
}
// NetworkSettings exposes the network settings in the api
type NetworkSettings struct {
NetworkSettingsBase
DefaultNetworkSettings
Networks map [ string ] * network . EndpointSettings
}
// SummaryNetworkSettings provides a summary of container's networks
// in /containers/json
type SummaryNetworkSettings struct {
Networks map [ string ] * network . EndpointSettings
}
// NetworkSettingsBase holds basic information about networks
type NetworkSettingsBase struct {
Bridge string // Bridge is the Bridge name the network uses(e.g. `docker0`)
SandboxID string // SandboxID uniquely represents a container's network stack
HairpinMode bool // HairpinMode specifies if hairpin NAT should be enabled on the virtual interface
LinkLocalIPv6Address string // LinkLocalIPv6Address is an IPv6 unicast address using the link-local prefix
LinkLocalIPv6PrefixLen int // LinkLocalIPv6PrefixLen is the prefix length of an IPv6 unicast address
Ports nat . PortMap // Ports is a collection of PortBinding indexed by Port
SandboxKey string // SandboxKey identifies the sandbox
SecondaryIPAddresses [ ] network . Address
SecondaryIPv6Addresses [ ] network . Address
}
// DefaultNetworkSettings holds network information
// during the 2 release deprecation period.
// It will be removed in Docker 1.11.
type DefaultNetworkSettings struct {
EndpointID string // EndpointID uniquely represents a service endpoint in a Sandbox
Gateway string // Gateway holds the gateway address for the network
GlobalIPv6Address string // GlobalIPv6Address holds network's global IPv6 address
GlobalIPv6PrefixLen int // GlobalIPv6PrefixLen represents mask length of network's global IPv6 address
IPAddress string // IPAddress holds the IPv4 address for the network
IPPrefixLen int // IPPrefixLen represents mask length of network's IPv4 address
IPv6Gateway string // IPv6Gateway holds gateway address specific for IPv6
MacAddress string // MacAddress holds the MAC address for the network
}
// MountPoint represents a mount point configuration inside the container.
// This is used for reporting the mountpoints in use by a container.
type MountPoint struct {
2022-03-06 20:30:07 +00:00
// Type is the type of mount, see `Type<foo>` definitions in
// github.com/docker/docker/api/types/mount.Type
Type mount . Type ` json:",omitempty" `
// Name is the name reference to the underlying data defined by `Source`
// e.g., the volume name.
Name string ` json:",omitempty" `
// Source is the source location of the mount.
//
// For volumes, this contains the storage location of the volume (within
// `/var/lib/docker/volumes/`). For bind-mounts, and `npipe`, this contains
// the source (host) part of the bind-mount. For `tmpfs` mount points, this
// field is empty.
Source string
// Destination is the path relative to the container root (`/`) where the
// Source is mounted inside the container.
2016-09-06 18:18:12 +00:00
Destination string
2022-03-06 20:30:07 +00:00
// Driver is the volume driver used to create the volume (if it is a volume).
Driver string ` json:",omitempty" `
// Mode is a comma separated list of options supplied by the user when
// creating the bind/volume mount.
//
// The default is platform-specific (`"z"` on Linux, empty on Windows).
Mode string
// RW indicates whether the mount is mounted writable (read-write).
RW bool
// Propagation describes how mounts are propagated from the host into the
// mount point, and vice-versa. Refer to the Linux kernel documentation
// for details:
// https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt
//
// This field is not used on Windows.
2016-09-06 18:18:12 +00:00
Propagation mount . Propagation
}
// NetworkResource is the body of the "get network" http response message
type NetworkResource struct {
2017-03-09 19:42:10 +00:00
Name string // Name is the requested name of the network
ID string ` json:"Id" ` // ID uniquely identifies a network on a single machine
Created time . Time // Created is the time the network created
2017-05-01 21:44:05 +00:00
Scope string // Scope describes the level at which the network exists (e.g. `swarm` for cluster-wide or `local` for machine level)
2017-03-09 19:42:10 +00:00
Driver string // Driver is the Driver name used to create the network (e.g. `bridge`, `overlay`)
EnableIPv6 bool // EnableIPv6 represents whether to enable IPv6
IPAM network . IPAM // IPAM is the network's IP Address Management
Internal bool // Internal represents if the network is used internal only
Attachable bool // Attachable represents if the global scope is manually attachable by regular containers from workers in swarm mode.
2017-03-09 19:52:25 +00:00
Ingress bool // Ingress indicates the network is providing the routing-mesh for the swarm cluster.
2017-04-07 18:18:51 +00:00
ConfigFrom network . ConfigReference // ConfigFrom specifies the source which will provide the configuration for this network.
ConfigOnly bool // ConfigOnly networks are place-holder networks for network configurations to be used by other networks. ConfigOnly networks cannot be used directly to run containers or services.
2017-03-09 19:42:10 +00:00
Containers map [ string ] EndpointResource // Containers contains endpoints belonging to the network
Options map [ string ] string // Options holds the network specific options to use for when creating the network
Labels map [ string ] string // Labels holds metadata specific to the network being created
Peers [ ] network . PeerInfo ` json:",omitempty" ` // List of peer nodes for an overlay network
Services map [ string ] network . ServiceInfo ` json:",omitempty" `
2016-09-06 18:18:12 +00:00
}
// EndpointResource contains network resources allocated and used for a container in a network
type EndpointResource struct {
Name string
EndpointID string
MacAddress string
IPv4Address string
IPv6Address string
}
// NetworkCreate is the expected body of the "create network" http request message
type NetworkCreate struct {
2017-01-19 06:49:10 +00:00
// Check for networks with duplicate names.
// Network is primarily keyed based on a random ID and not on the name.
// Network name is strictly a user-friendly alias to the network
// which is uniquely identified using ID.
// And there is no guaranteed way to check for duplicates.
// Option CheckDuplicate is there to provide a best effort checking of any networks
// which has the same name but it is not guaranteed to catch all name collisions.
2016-09-06 18:18:12 +00:00
CheckDuplicate bool
Driver string
2017-05-01 21:44:05 +00:00
Scope string
2016-09-06 18:18:12 +00:00
EnableIPv6 bool
IPAM * network . IPAM
Internal bool
Attachable bool
2017-03-09 19:52:25 +00:00
Ingress bool
2017-04-07 18:18:51 +00:00
ConfigOnly bool
ConfigFrom * network . ConfigReference
2016-09-06 18:18:12 +00:00
Options map [ string ] string
Labels map [ string ] string
}
// NetworkCreateRequest is the request message sent to the server for network create call.
type NetworkCreateRequest struct {
NetworkCreate
Name string
}
// NetworkCreateResponse is the response message sent by the server for network create call
type NetworkCreateResponse struct {
ID string ` json:"Id" `
Warning string
}
// NetworkConnect represents the data to be used to connect a container to the network
type NetworkConnect struct {
Container string
EndpointConfig * network . EndpointSettings ` json:",omitempty" `
}
// NetworkDisconnect represents the data to be used to disconnect a container from the network
type NetworkDisconnect struct {
Container string
Force bool
}
2017-06-11 18:04:35 +00:00
// NetworkInspectOptions holds parameters to inspect network
type NetworkInspectOptions struct {
Scope string
Verbose bool
}
2016-09-06 18:18:12 +00:00
// Checkpoint represents the details of a checkpoint
type Checkpoint struct {
Name string // Name is the name of the checkpoint
}
// Runtime describes an OCI runtime
type Runtime struct {
Path string ` json:"path" `
Args [ ] string ` json:"runtimeArgs,omitempty" `
2020-07-07 20:33:46 +00:00
// This is exposed here only for internal use
// It is not currently supported to specify custom shim configs
Shim * ShimConfig ` json:"-" `
}
// ShimConfig is used by runtime to configure containerd shims
type ShimConfig struct {
Binary string
Opts interface { }
2016-09-06 18:18:12 +00:00
}
2016-08-23 23:24:15 +00:00
2021-06-23 13:26:54 +00:00
// DiskUsageObject represents an object type used for disk usage query filtering.
type DiskUsageObject string
const (
// ContainerObject represents a container DiskUsageObject.
ContainerObject DiskUsageObject = "container"
// ImageObject represents an image DiskUsageObject.
ImageObject DiskUsageObject = "image"
// VolumeObject represents a volume DiskUsageObject.
VolumeObject DiskUsageObject = "volume"
// BuildCacheObject represents a build-cache DiskUsageObject.
BuildCacheObject DiskUsageObject = "build-cache"
)
// DiskUsageOptions holds parameters for system disk usage query.
type DiskUsageOptions struct {
// Types specifies what object types to include in the response. If empty,
// all object types are returned.
Types [ ] DiskUsageObject
}
2016-11-15 19:45:20 +00:00
// DiskUsage contains response of Engine API:
2016-08-23 23:24:15 +00:00
// GET "/system/df"
type DiskUsage struct {
2017-05-15 21:54:27 +00:00
LayersSize int64
Images [ ] * ImageSummary
Containers [ ] * Container
2022-03-18 15:33:43 +00:00
Volumes [ ] * volume . Volume
2018-05-15 17:02:16 +00:00
BuildCache [ ] * BuildCache
2021-07-08 11:30:05 +00:00
BuilderSize int64 ` json:",omitempty" ` // Deprecated: deprecated in API 1.38, and no longer used since API 1.40.
2016-08-23 23:24:15 +00:00
}
2016-08-23 23:25:43 +00:00
2016-11-15 19:45:20 +00:00
// ContainersPruneReport contains the response for Engine API:
2016-08-23 23:25:43 +00:00
// POST "/containers/prune"
type ContainersPruneReport struct {
ContainersDeleted [ ] string
SpaceReclaimed uint64
}
2016-11-15 19:45:20 +00:00
// VolumesPruneReport contains the response for Engine API:
2016-08-23 23:25:43 +00:00
// POST "/volumes/prune"
type VolumesPruneReport struct {
VolumesDeleted [ ] string
SpaceReclaimed uint64
}
2016-11-15 19:45:20 +00:00
// ImagesPruneReport contains the response for Engine API:
2016-10-08 10:38:25 +00:00
// POST "/images/prune"
2016-08-23 23:25:43 +00:00
type ImagesPruneReport struct {
2016-11-10 16:27:56 +00:00
ImagesDeleted [ ] ImageDeleteResponseItem
2016-08-23 23:25:43 +00:00
SpaceReclaimed uint64
}
2016-10-18 04:36:52 +00:00
2017-05-15 21:54:27 +00:00
// BuildCachePruneReport contains the response for Engine API:
// POST "/build/prune"
type BuildCachePruneReport struct {
2018-08-15 21:24:37 +00:00
CachesDeleted [ ] string
2017-05-15 21:54:27 +00:00
SpaceReclaimed uint64
}
2016-11-15 19:45:20 +00:00
// NetworksPruneReport contains the response for Engine API:
2016-10-18 04:36:52 +00:00
// POST "/networks/prune"
type NetworksPruneReport struct {
NetworksDeleted [ ] string
}
2016-10-19 16:22:02 +00:00
// SecretCreateResponse contains the information returned to a client
// on the creation of a new secret.
type SecretCreateResponse struct {
// ID is the id of the created secret.
ID string
}
// SecretListOptions holds parameters to list secrets
type SecretListOptions struct {
2016-11-03 18:09:13 +00:00
Filters filters . Args
2016-10-19 16:22:02 +00:00
}
2016-12-22 19:44:09 +00:00
2017-03-15 21:52:17 +00:00
// ConfigCreateResponse contains the information returned to a client
// on the creation of a new config.
type ConfigCreateResponse struct {
// ID is the id of the created config.
ID string
}
// ConfigListOptions holds parameters to list configs
type ConfigListOptions struct {
Filters filters . Args
}
2016-12-22 19:44:09 +00:00
// PushResult contains the tag, manifest digest, and manifest size from the
// push. It's used to signal this information to the trust code in the client
// so it can sign the manifest if necessary.
type PushResult struct {
Tag string
Digest string
Size int
}
2017-04-06 12:33:56 +00:00
// BuildResult contains the image id of a successful build
type BuildResult struct {
ID string
}
2018-05-15 17:02:16 +00:00
// BuildCache contains information about a build cache record
type BuildCache struct {
2018-08-15 21:24:37 +00:00
ID string
Parent string
Type string
Description string
InUse bool
Shared bool
Size int64
2018-05-15 17:02:16 +00:00
CreatedAt time . Time
LastUsedAt * time . Time
UsageCount int
2018-08-15 21:24:37 +00:00
}
// BuildCachePruneOptions hold parameters to prune the build cache
type BuildCachePruneOptions struct {
All bool
KeepStorage int64
Filters filters . Args
2018-05-15 17:02:16 +00:00
}