types.go 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. package types
  2. import (
  3. "time"
  4. "github.com/docker/docker/daemon/network"
  5. "github.com/docker/docker/pkg/version"
  6. "github.com/docker/docker/runconfig"
  7. )
  8. // ContainerCreateResponse contains the information returned to a client on the
  9. // creation of a new container.
  10. type ContainerCreateResponse struct {
  11. // ID is the ID of the created container.
  12. ID string `json:"Id"`
  13. // Warnings are any warnings encountered during the creation of the container.
  14. Warnings []string `json:"Warnings"`
  15. }
  16. // POST /containers/{name:.*}/exec
  17. type ContainerExecCreateResponse struct {
  18. // ID is the exec ID.
  19. ID string `json:"Id"`
  20. }
  21. // POST /auth
  22. type AuthResponse struct {
  23. // Status is the authentication status
  24. Status string `json:"Status"`
  25. }
  26. // POST "/containers/"+containerID+"/wait"
  27. type ContainerWaitResponse struct {
  28. // StatusCode is the status code of the wait job
  29. StatusCode int `json:"StatusCode"`
  30. }
  31. // POST "/commit?container="+containerID
  32. type ContainerCommitResponse struct {
  33. ID string `json:"Id"`
  34. }
  35. // GET "/containers/{name:.*}/changes"
  36. type ContainerChange struct {
  37. Kind int
  38. Path string
  39. }
  40. // GET "/images/{name:.*}/history"
  41. type ImageHistory struct {
  42. ID string `json:"Id"`
  43. Created int64
  44. CreatedBy string
  45. Tags []string
  46. Size int64
  47. Comment string
  48. }
  49. // DELETE "/images/{name:.*}"
  50. type ImageDelete struct {
  51. Untagged string `json:",omitempty"`
  52. Deleted string `json:",omitempty"`
  53. }
  54. // GET "/images/json"
  55. type Image struct {
  56. ID string `json:"Id"`
  57. ParentId string
  58. RepoTags []string
  59. RepoDigests []string
  60. Created int
  61. Size int
  62. VirtualSize int
  63. Labels map[string]string
  64. }
  65. // GET "/images/{name:.*}/json"
  66. type ImageInspect struct {
  67. Id string
  68. Parent string
  69. Comment string
  70. Created time.Time
  71. Container string
  72. ContainerConfig *runconfig.Config
  73. DockerVersion string
  74. Author string
  75. Config *runconfig.Config
  76. Architecture string
  77. Os string
  78. Size int64
  79. VirtualSize int64
  80. }
  81. // GET "/containers/json"
  82. type Port struct {
  83. IP string
  84. PrivatePort int
  85. PublicPort int
  86. Type string
  87. }
  88. type Container struct {
  89. ID string `json:"Id"`
  90. Names []string `json:",omitempty"`
  91. Image string `json:",omitempty"`
  92. Command string `json:",omitempty"`
  93. Created int `json:",omitempty"`
  94. Ports []Port `json:",omitempty"`
  95. SizeRw int `json:",omitempty"`
  96. SizeRootFs int `json:",omitempty"`
  97. Labels map[string]string `json:",omitempty"`
  98. Status string `json:",omitempty"`
  99. }
  100. // POST "/containers/"+containerID+"/copy"
  101. type CopyConfig struct {
  102. Resource string
  103. }
  104. // GET "/containers/{name:.*}/top"
  105. type ContainerProcessList struct {
  106. Processes [][]string
  107. Titles []string
  108. }
  109. type Version struct {
  110. Version string
  111. ApiVersion version.Version
  112. GitCommit string
  113. GoVersion string
  114. Os string
  115. Arch string
  116. KernelVersion string `json:",omitempty"`
  117. }
  118. // GET "/info"
  119. type Info struct {
  120. ID string
  121. Containers int
  122. Images int
  123. Driver string
  124. DriverStatus [][2]string
  125. MemoryLimit bool
  126. SwapLimit bool
  127. CpuCfsPeriod bool
  128. CpuCfsQuota bool
  129. IPv4Forwarding bool
  130. Debug bool
  131. NFd int
  132. OomKillDisable bool
  133. NGoroutines int
  134. SystemTime string
  135. ExecutionDriver string
  136. LoggingDriver string
  137. NEventsListener int
  138. KernelVersion string
  139. OperatingSystem string
  140. IndexServerAddress string
  141. RegistryConfig interface{}
  142. InitSha1 string
  143. InitPath string
  144. NCPU int
  145. MemTotal int64
  146. DockerRootDir string
  147. HttpProxy string
  148. HttpsProxy string
  149. NoProxy string
  150. Name string
  151. Labels []string
  152. ExperimentalBuild bool
  153. }
  154. // This struct is a temp struct used by execStart
  155. // Config fields is part of ExecConfig in runconfig package
  156. type ExecStartCheck struct {
  157. // ExecStart will first check if it's detached
  158. Detach bool
  159. // Check if there's a tty
  160. Tty bool
  161. }
  162. type ContainerState struct {
  163. Running bool
  164. Paused bool
  165. Restarting bool
  166. OOMKilled bool
  167. Dead bool
  168. Pid int
  169. ExitCode int
  170. Error string
  171. StartedAt time.Time
  172. FinishedAt time.Time
  173. }
  174. // GET "/containers/{name:.*}/json"
  175. type ContainerJSON struct {
  176. Id string
  177. Created time.Time
  178. Path string
  179. Args []string
  180. Config *runconfig.Config
  181. State *ContainerState
  182. Image string
  183. NetworkSettings *network.Settings
  184. ResolvConfPath string
  185. HostnamePath string
  186. HostsPath string
  187. LogPath string
  188. Name string
  189. RestartCount int
  190. Driver string
  191. ExecDriver string
  192. MountLabel string
  193. ProcessLabel string
  194. Volumes map[string]string
  195. VolumesRW map[string]bool
  196. AppArmorProfile string
  197. ExecIDs []string
  198. HostConfig *runconfig.HostConfig
  199. }