api_params.go 2.4 KB

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