types.go 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  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. type LegacyImage struct {
  82. ID string `json:"Id"`
  83. Repository string
  84. Tag string
  85. Created int
  86. Size int
  87. VirtualSize int
  88. }
  89. // GET "/containers/json"
  90. type Port struct {
  91. IP string
  92. PrivatePort int
  93. PublicPort int
  94. Type string
  95. }
  96. type Container struct {
  97. ID string `json:"Id"`
  98. Names []string `json:",omitempty"`
  99. Image string `json:",omitempty"`
  100. Command string `json:",omitempty"`
  101. Created int `json:",omitempty"`
  102. Ports []Port `json:",omitempty"`
  103. SizeRw int `json:",omitempty"`
  104. SizeRootFs int `json:",omitempty"`
  105. Labels map[string]string `json:",omitempty"`
  106. Status string `json:",omitempty"`
  107. }
  108. // POST "/containers/"+containerID+"/copy"
  109. type CopyConfig struct {
  110. Resource string
  111. }
  112. // GET "/containers/{name:.*}/top"
  113. type ContainerProcessList struct {
  114. Processes [][]string
  115. Titles []string
  116. }
  117. type Version struct {
  118. Version string
  119. ApiVersion version.Version
  120. GitCommit string
  121. GoVersion string
  122. Os string
  123. Arch string
  124. KernelVersion string `json:",omitempty"`
  125. }
  126. // GET "/info"
  127. type Info struct {
  128. ID string
  129. Containers int
  130. Images int
  131. Driver string
  132. DriverStatus [][2]string
  133. MemoryLimit bool
  134. SwapLimit bool
  135. CpuCfsQuota bool
  136. IPv4Forwarding bool
  137. Debug bool
  138. NFd int
  139. OomKillDisable bool
  140. NGoroutines int
  141. SystemTime string
  142. ExecutionDriver string
  143. LoggingDriver string
  144. NEventsListener int
  145. KernelVersion string
  146. OperatingSystem string
  147. IndexServerAddress string
  148. RegistryConfig interface{}
  149. InitSha1 string
  150. InitPath string
  151. NCPU int
  152. MemTotal int64
  153. DockerRootDir string
  154. HttpProxy string
  155. HttpsProxy string
  156. NoProxy string
  157. Name string
  158. Labels []string
  159. }
  160. // This struct is a temp struct used by execStart
  161. // Config fields is part of ExecConfig in runconfig package
  162. type ExecStartCheck struct {
  163. // ExecStart will first check if it's detached
  164. Detach bool
  165. // Check if there's a tty
  166. Tty bool
  167. }
  168. type ContainerState struct {
  169. Running bool
  170. Paused bool
  171. Restarting bool
  172. OOMKilled bool
  173. Dead bool
  174. Pid int
  175. ExitCode int
  176. Error string
  177. StartedAt time.Time
  178. FinishedAt time.Time
  179. }
  180. // GET "/containers/{name:.*}/json"
  181. type ContainerJSON struct {
  182. Id string
  183. Created time.Time
  184. Path string
  185. Args []string
  186. Config *runconfig.Config
  187. State *ContainerState
  188. Image string
  189. NetworkSettings *network.Settings
  190. ResolvConfPath string
  191. HostnamePath string
  192. HostsPath string
  193. LogPath string
  194. Name string
  195. RestartCount int
  196. Driver string
  197. ExecDriver string
  198. MountLabel string
  199. ProcessLabel string
  200. Volumes map[string]string
  201. VolumesRW map[string]bool
  202. AppArmorProfile string
  203. ExecIDs []string
  204. HostConfig *runconfig.HostConfig
  205. }