api_params.go 1.3 KB

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