types.go 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. package types
  2. import "github.com/docker/docker/pkg/version"
  3. // ContainerCreateResponse contains the information returned to a client on the
  4. // creation of a new container.
  5. type ContainerCreateResponse struct {
  6. // ID is the ID of the created container.
  7. ID string `json:"Id"`
  8. // Warnings are any warnings encountered during the creation of the container.
  9. Warnings []string `json:"Warnings"`
  10. }
  11. // POST /containers/{name:.*}/exec
  12. type ContainerExecCreateResponse struct {
  13. // ID is the exec ID.
  14. ID string `json:"Id"`
  15. }
  16. // POST /auth
  17. type AuthResponse struct {
  18. // Status is the authentication status
  19. Status string `json:"Status"`
  20. }
  21. // POST "/containers/"+containerID+"/wait"
  22. type ContainerWaitResponse struct {
  23. // StatusCode is the status code of the wait job
  24. StatusCode int `json:"StatusCode"`
  25. }
  26. // POST "/commit?container="+containerID
  27. type ContainerCommitResponse struct {
  28. ID string `json:"Id"`
  29. }
  30. // GET "/containers/{name:.*}/changes"
  31. type ContainerChange struct {
  32. Kind int
  33. Path string
  34. }
  35. // GET "/images/{name:.*}/history"
  36. type ImageHistory struct {
  37. ID string `json:"Id"`
  38. Created int64
  39. CreatedBy string
  40. Tags []string
  41. Size int64
  42. Comment string
  43. }
  44. // DELETE "/images/{name:.*}"
  45. type ImageDelete struct {
  46. Untagged string `json:",omitempty"`
  47. Deleted string `json:",omitempty"`
  48. }
  49. // GET "/images/json"
  50. type Image struct {
  51. ID string `json:"Id"`
  52. ParentId string
  53. RepoTags []string
  54. RepoDigests []string
  55. Created int
  56. Size int
  57. VirtualSize int
  58. Labels map[string]string
  59. }
  60. type LegacyImage struct {
  61. ID string `json:"Id"`
  62. Repository string
  63. Tag string
  64. Created int
  65. Size int
  66. VirtualSize int
  67. }
  68. // GET "/containers/json"
  69. type Port struct {
  70. IP string
  71. PrivatePort int
  72. PublicPort int
  73. Type string
  74. }
  75. type Container struct {
  76. ID string `json:"Id"`
  77. Names []string `json:",omitempty"`
  78. Image string `json:",omitempty"`
  79. Command string `json:",omitempty"`
  80. Created int `json:",omitempty"`
  81. Ports []Port `json:",omitempty"`
  82. SizeRw int `json:",omitempty"`
  83. SizeRootFs int `json:",omitempty"`
  84. Labels map[string]string `json:",omitempty"`
  85. Status string `json:",omitempty"`
  86. }
  87. // POST "/containers/"+containerID+"/copy"
  88. type CopyConfig struct {
  89. Resource string
  90. }
  91. // GET "/containers/{name:.*}/top"
  92. type ContainerProcessList struct {
  93. Processes [][]string
  94. Titles []string
  95. }
  96. type Version struct {
  97. Version string
  98. ApiVersion version.Version
  99. GitCommit string
  100. GoVersion string
  101. Os string
  102. Arch string
  103. KernelVersion string `json:",omitempty"`
  104. }
  105. // GET "/info"
  106. type Info struct {
  107. ID string
  108. Containers int
  109. Images int
  110. Driver string
  111. DriverStatus [][2]string
  112. MemoryLimit bool
  113. SwapLimit bool
  114. CpuCfsQuota bool
  115. IPv4Forwarding bool
  116. Debug bool
  117. NFd int
  118. NGoroutines int
  119. SystemTime string
  120. ExecutionDriver string
  121. LoggingDriver string
  122. NEventsListener int
  123. KernelVersion string
  124. OperatingSystem string
  125. IndexServerAddress string
  126. RegistryConfig interface{}
  127. InitSha1 string
  128. InitPath string
  129. NCPU int
  130. MemTotal int64
  131. DockerRootDir string
  132. HttpProxy string
  133. HttpsProxy string
  134. NoProxy string
  135. Name string
  136. Labels []string
  137. }
  138. // This struct is a temp struct used by execStart
  139. // Config fields is part of ExecConfig in runconfig package
  140. type ExecStartCheck struct {
  141. // ExecStart will first check if it's detached
  142. Detach bool
  143. // Check if there's a tty
  144. Tty bool
  145. }