api_params.go 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. package docker
  2. import "encoding/json"
  3. type APIHistory struct {
  4. ID string `json:"Id"`
  5. Tags []string `json:",omitempty"`
  6. Created int64
  7. CreatedBy string `json:",omitempty"`
  8. }
  9. type APIImages struct {
  10. Repository string `json:",omitempty"`
  11. Tag string `json:",omitempty"`
  12. ID string `json:"Id"`
  13. Created int64
  14. Size int64
  15. VirtualSize int64
  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. }
  49. type APISearch struct {
  50. Name string
  51. Description string
  52. }
  53. type APIID struct {
  54. ID string `json:"Id"`
  55. }
  56. type APIRun struct {
  57. ID string `json:"Id"`
  58. Warnings []string `json:",omitempty"`
  59. }
  60. type APIPort struct {
  61. PrivatePort int64
  62. PublicPort int64
  63. Type string
  64. }
  65. func (port *APIPort) MarshalJSON() ([]byte, error) {
  66. return json.Marshal(map[string]interface{}{
  67. "PrivatePort": port.PrivatePort,
  68. "PublicPort": port.PublicPort,
  69. "Type": port.Type,
  70. })
  71. }
  72. type APIVersion struct {
  73. Version string
  74. GitCommit string `json:",omitempty"`
  75. GoVersion string `json:",omitempty"`
  76. }
  77. type APIWait struct {
  78. StatusCode int
  79. }
  80. type APIAuth struct {
  81. Status string
  82. }
  83. type APIImageConfig struct {
  84. ID string `json:"Id"`
  85. *Config
  86. }
  87. type APICopy struct {
  88. Resource string
  89. HostPath string
  90. }