|
| 1 | +package system |
| 2 | + |
| 3 | +import ( |
| 4 | + "github.com/docker/docker/api/types/container" |
| 5 | + "github.com/docker/docker/api/types/registry" |
| 6 | + "github.com/docker/docker/api/types/swarm" |
| 7 | +) |
| 8 | + |
| 9 | +// Info contains response of Engine API: |
| 10 | +// GET "/info" |
| 11 | +type Info struct { |
| 12 | + ID string |
| 13 | + Containers int |
| 14 | + ContainersRunning int |
| 15 | + ContainersPaused int |
| 16 | + ContainersStopped int |
| 17 | + Images int |
| 18 | + Driver string |
| 19 | + DriverStatus [][2]string |
| 20 | + SystemStatus [][2]string `json:",omitempty"` // SystemStatus is only propagated by the Swarm standalone API |
| 21 | + Plugins PluginsInfo |
| 22 | + MemoryLimit bool |
| 23 | + SwapLimit bool |
| 24 | + KernelMemory bool `json:",omitempty"` // Deprecated: kernel 5.4 deprecated kmem.limit_in_bytes |
| 25 | + KernelMemoryTCP bool `json:",omitempty"` // KernelMemoryTCP is not supported on cgroups v2. |
| 26 | + CPUCfsPeriod bool `json:"CpuCfsPeriod"` |
| 27 | + CPUCfsQuota bool `json:"CpuCfsQuota"` |
| 28 | + CPUShares bool |
| 29 | + CPUSet bool |
| 30 | + PidsLimit bool |
| 31 | + IPv4Forwarding bool |
| 32 | + BridgeNfIptables bool |
| 33 | + BridgeNfIP6tables bool `json:"BridgeNfIp6tables"` |
| 34 | + Debug bool |
| 35 | + NFd int |
| 36 | + OomKillDisable bool |
| 37 | + NGoroutines int |
| 38 | + SystemTime string |
| 39 | + LoggingDriver string |
| 40 | + CgroupDriver string |
| 41 | + CgroupVersion string `json:",omitempty"` |
| 42 | + NEventsListener int |
| 43 | + KernelVersion string |
| 44 | + OperatingSystem string |
| 45 | + OSVersion string |
| 46 | + OSType string |
| 47 | + Architecture string |
| 48 | + IndexServerAddress string |
| 49 | + RegistryConfig *registry.ServiceConfig |
| 50 | + NCPU int |
| 51 | + MemTotal int64 |
| 52 | + GenericResources []swarm.GenericResource |
| 53 | + DockerRootDir string |
| 54 | + HTTPProxy string `json:"HttpProxy"` |
| 55 | + HTTPSProxy string `json:"HttpsProxy"` |
| 56 | + NoProxy string |
| 57 | + Name string |
| 58 | + Labels []string |
| 59 | + ExperimentalBuild bool |
| 60 | + ServerVersion string |
| 61 | + Runtimes map[string]Runtime |
| 62 | + DefaultRuntime string |
| 63 | + Swarm swarm.Info |
| 64 | + // LiveRestoreEnabled determines whether containers should be kept |
| 65 | + // running when the daemon is shutdown or upon daemon start if |
| 66 | + // running containers are detected |
| 67 | + LiveRestoreEnabled bool |
| 68 | + Isolation container.Isolation |
| 69 | + InitBinary string |
| 70 | + ContainerdCommit Commit |
| 71 | + RuncCommit Commit |
| 72 | + InitCommit Commit |
| 73 | + SecurityOptions []string |
| 74 | + ProductLicense string `json:",omitempty"` |
| 75 | + DefaultAddressPools []NetworkAddressPool `json:",omitempty"` |
| 76 | + |
| 77 | + // Legacy API fields for older API versions. |
| 78 | + legacyFields |
| 79 | + |
| 80 | + // Warnings contains a slice of warnings that occurred while collecting |
| 81 | + // system information. These warnings are intended to be informational |
| 82 | + // messages for the user, and are not intended to be parsed / used for |
| 83 | + // other purposes, as they do not have a fixed format. |
| 84 | + Warnings []string |
| 85 | +} |
| 86 | + |
| 87 | +type legacyFields struct { |
| 88 | + ExecutionDriver string `json:",omitempty"` // Deprecated: deprecated since API v1.25, but returned for older versions. |
| 89 | +} |
| 90 | + |
| 91 | +// PluginsInfo is a temp struct holding Plugins name |
| 92 | +// registered with docker daemon. It is used by [Info] struct |
| 93 | +type PluginsInfo struct { |
| 94 | + // List of Volume plugins registered |
| 95 | + Volume []string |
| 96 | + // List of Network plugins registered |
| 97 | + Network []string |
| 98 | + // List of Authorization plugins registered |
| 99 | + Authorization []string |
| 100 | + // List of Log plugins registered |
| 101 | + Log []string |
| 102 | +} |
| 103 | + |
| 104 | +// Commit holds the Git-commit (SHA1) that a binary was built from, as reported |
| 105 | +// in the version-string of external tools, such as containerd, or runC. |
| 106 | +type Commit struct { |
| 107 | + ID string // ID is the actual commit ID of external tool. |
| 108 | + Expected string // Expected is the commit ID of external tool expected by dockerd as set at build time. |
| 109 | +} |
| 110 | + |
| 111 | +// NetworkAddressPool is a temp struct used by [Info] struct. |
| 112 | +type NetworkAddressPool struct { |
| 113 | + Base string |
| 114 | + Size int |
| 115 | +} |
0 commit comments