api_params.go 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. package docker
  2. type (
  3. APIHistory struct {
  4. ID string `json:"Id"`
  5. Tags []string `json:",omitempty"`
  6. Created int64
  7. CreatedBy string `json:",omitempty"`
  8. Size int64
  9. }
  10. APITop struct {
  11. Titles []string
  12. Processes [][]string
  13. }
  14. APIRmi struct {
  15. Deleted string `json:",omitempty"`
  16. Untagged string `json:",omitempty"`
  17. }
  18. APIContainers struct {
  19. ID string `json:"Id"`
  20. Image string
  21. Command string
  22. Created int64
  23. Status string
  24. Ports []APIPort
  25. SizeRw int64
  26. SizeRootFs int64
  27. Names []string
  28. }
  29. APIContainersOld struct {
  30. ID string `json:"Id"`
  31. Image string
  32. Command string
  33. Created int64
  34. Status string
  35. Ports string
  36. SizeRw int64
  37. SizeRootFs int64
  38. }
  39. APIID struct {
  40. ID string `json:"Id"`
  41. }
  42. APIRun struct {
  43. ID string `json:"Id"`
  44. Warnings []string `json:",omitempty"`
  45. }
  46. APIPort struct {
  47. PrivatePort int64
  48. PublicPort int64
  49. Type string
  50. IP string
  51. }
  52. APIWait struct {
  53. StatusCode int
  54. }
  55. APIAuth struct {
  56. Status string
  57. }
  58. APIImageConfig struct {
  59. ID string `json:"Id"`
  60. *Config
  61. }
  62. APICopy struct {
  63. Resource string
  64. HostPath string
  65. }
  66. APIContainer struct {
  67. *Container
  68. HostConfig *HostConfig
  69. }
  70. )
  71. func (api APIContainers) ToLegacy() *APIContainersOld {
  72. return &APIContainersOld{
  73. ID: api.ID,
  74. Image: api.Image,
  75. Command: api.Command,
  76. Created: api.Created,
  77. Status: api.Status,
  78. Ports: displayablePorts(api.Ports),
  79. SizeRw: api.SizeRw,
  80. SizeRootFs: api.SizeRootFs,
  81. }
  82. }