info.go 3.8 KB

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