github.com/polydawn/docket@v0.5.4-0.20140630233848-90b70fb433da/crocker/api_params.go (about) 1 package crocker 2 3 // Docker API structs. 4 // Source: https://raw.github.com/dotcloud/docker/v0.6.3/api_params.go 5 6 import "encoding/json" 7 8 type APIHistory struct { 9 ID string `json:"Id"` 10 Tags []string `json:",omitempty"` 11 Created int64 12 CreatedBy string `json:",omitempty"` 13 } 14 15 type APIImages struct { 16 RepoTags []string `json:",omitempty"` 17 ID string `json:"Id"` 18 Created int64 19 Size int64 20 VirtualSize int64 21 } 22 23 type APIInfo struct { 24 Debug bool 25 Containers int 26 Images int 27 NFd int `json:",omitempty"` 28 NGoroutines int `json:",omitempty"` 29 MemoryLimit bool `json:",omitempty"` 30 SwapLimit bool `json:",omitempty"` 31 IPv4Forwarding bool `json:",omitempty"` 32 LXCVersion string `json:",omitempty"` 33 NEventsListener int `json:",omitempty"` 34 KernelVersion string `json:",omitempty"` 35 IndexServerAddress string `json:",omitempty"` 36 } 37 38 type APITop struct { 39 Titles []string 40 Processes [][]string 41 } 42 43 type APIRmi struct { 44 Deleted string `json:",omitempty"` 45 Untagged string `json:",omitempty"` 46 } 47 48 type APIContainers struct { 49 ID string `json:"Id"` 50 Image string 51 Command string 52 Created int64 53 Status string 54 Ports []APIPort 55 SizeRw int64 56 SizeRootFs int64 57 } 58 59 /* 60 func (self *APIContainers) ToLegacy() APIContainersOld { 61 return APIContainersOld{ 62 ID: self.ID, 63 Image: self.Image, 64 Command: self.Command, 65 Created: self.Created, 66 Status: self.Status, 67 Ports: displayablePorts(self.Ports), 68 SizeRw: self.SizeRw, 69 SizeRootFs: self.SizeRootFs, 70 } 71 } 72 */ 73 74 type APIContainersOld struct { 75 ID string `json:"Id"` 76 Image string 77 Command string 78 Created int64 79 Status string 80 Ports string 81 SizeRw int64 82 SizeRootFs int64 83 } 84 85 type APISearch struct { 86 Name string 87 Description string 88 } 89 90 type APIID struct { 91 ID string `json:"Id"` 92 } 93 94 type APIRun struct { 95 ID string `json:"Id"` 96 Warnings []string `json:",omitempty"` 97 } 98 99 type APIPort struct { 100 PrivatePort int64 101 PublicPort int64 102 Type string 103 } 104 105 func (port *APIPort) MarshalJSON() ([]byte, error) { 106 return json.Marshal(map[string]interface{}{ 107 "PrivatePort": port.PrivatePort, 108 "PublicPort": port.PublicPort, 109 "Type": port.Type, 110 }) 111 } 112 113 type APIVersion struct { 114 Version string 115 GitCommit string `json:",omitempty"` 116 GoVersion string `json:",omitempty"` 117 } 118 119 type APIWait struct { 120 StatusCode int 121 } 122 123 type APIAuth struct { 124 Status string 125 } 126 127 /* 128 type APIImageConfig struct { 129 ID string `json:"Id"` 130 *Config 131 } 132 */ 133 134 type APICopy struct { 135 Resource string 136 HostPath string 137 }