types.go 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. package types
  2. // ContainerCreateResponse contains the information returned to a client on the
  3. // creation of a new container.
  4. type ContainerCreateResponse struct {
  5. // ID is the ID of the created container.
  6. ID string `json:"Id"`
  7. // Warnings are any warnings encountered during the creation of the container.
  8. Warnings []string `json:"Warnings"`
  9. }
  10. // POST /containers/{name:.*}/exec
  11. type ContainerExecCreateResponse struct {
  12. // ID is the exec ID.
  13. ID string `json:"Id"`
  14. // Warnings are any warnings encountered during the execution of the command.
  15. Warnings []string `json:"Warnings"`
  16. }
  17. // POST /auth
  18. type AuthResponse struct {
  19. // Status is the authentication status
  20. Status string `json:"Status"`
  21. }
  22. // POST "/containers/"+containerID+"/wait"
  23. type ContainerWaitResponse struct {
  24. // StatusCode is the status code of the wait job
  25. StatusCode int `json:"StatusCode"`
  26. }
  27. // POST "/commit?container="+containerID
  28. type ContainerCommitResponse struct {
  29. ID string `json:"Id"`
  30. }
  31. // GET "/containers/{name:.*}/changes"
  32. type ContainerChange struct {
  33. Kind int
  34. Path string
  35. }
  36. // GET "/images/{name:.*}/history"
  37. type ImageHistory struct {
  38. ID string `json:"Id"`
  39. Created int64
  40. CreatedBy string
  41. Tags []string
  42. Size int64
  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. }