api_params.go 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. package docker
  2. type APIHistory struct {
  3. ID string `json:"Id"`
  4. Tags []string `json:",omitempty"`
  5. Created int64
  6. CreatedBy string `json:",omitempty"`
  7. Size int64
  8. }
  9. type APIImages struct {
  10. ID string `json:"Id"`
  11. RepoTags []string `json:",omitempty"`
  12. Created int64
  13. Size int64
  14. VirtualSize int64
  15. ParentId string `json:",omitempty"`
  16. }
  17. type APIInfo struct {
  18. Debug bool
  19. Containers int
  20. Images int
  21. NFd int `json:",omitempty"`
  22. NGoroutines int `json:",omitempty"`
  23. MemoryLimit bool `json:",omitempty"`
  24. SwapLimit bool `json:",omitempty"`
  25. IPv4Forwarding bool `json:",omitempty"`
  26. LXCVersion string `json:",omitempty"`
  27. NEventsListener int `json:",omitempty"`
  28. KernelVersion string `json:",omitempty"`
  29. IndexServerAddress string `json:",omitempty"`
  30. }
  31. type APITop struct {
  32. Titles []string
  33. Processes [][]string
  34. }
  35. type APIRmi struct {
  36. Deleted string `json:",omitempty"`
  37. Untagged string `json:",omitempty"`
  38. }
  39. type APIContainers struct {
  40. ID string `json:"Id"`
  41. Image string
  42. Command string
  43. Created int64
  44. Status string
  45. Ports []APIPort
  46. SizeRw int64
  47. SizeRootFs int64
  48. Names []string
  49. }
  50. func (self *APIContainers) ToLegacy() APIContainersOld {
  51. return APIContainersOld{
  52. ID: self.ID,
  53. Image: self.Image,
  54. Command: self.Command,
  55. Created: self.Created,
  56. Status: self.Status,
  57. Ports: displayablePorts(self.Ports),
  58. SizeRw: self.SizeRw,
  59. SizeRootFs: self.SizeRootFs,
  60. }
  61. }
  62. type APIContainersOld struct {
  63. ID string `json:"Id"`
  64. Image string
  65. Command string
  66. Created int64
  67. Status string
  68. Ports string
  69. SizeRw int64
  70. SizeRootFs int64
  71. }
  72. type APIID struct {
  73. ID string `json:"Id"`
  74. }
  75. type APIRun struct {
  76. ID string `json:"Id"`
  77. Warnings []string `json:",omitempty"`
  78. }
  79. type APIPort struct {
  80. PrivatePort int64
  81. PublicPort int64
  82. Type string
  83. IP string
  84. }
  85. type APIVersion struct {
  86. Version string
  87. GitCommit string `json:",omitempty"`
  88. GoVersion string `json:",omitempty"`
  89. }
  90. type APIWait struct {
  91. StatusCode int
  92. }
  93. type APIAuth struct {
  94. Status string
  95. }
  96. type APIImageConfig struct {
  97. ID string `json:"Id"`
  98. *Config
  99. }
  100. type APICopy struct {
  101. Resource string
  102. HostPath string
  103. }