github.com/campoy/docker@v1.8.0-rc1/api/types/types.go (about) 1 package types 2 3 import ( 4 "os" 5 "time" 6 7 "github.com/docker/docker/daemon/network" 8 "github.com/docker/docker/pkg/version" 9 "github.com/docker/docker/runconfig" 10 ) 11 12 // ContainerCreateResponse contains the information returned to a client on the 13 // creation of a new container. 14 type ContainerCreateResponse struct { 15 // ID is the ID of the created container. 16 ID string `json:"Id"` 17 18 // Warnings are any warnings encountered during the creation of the container. 19 Warnings []string `json:"Warnings"` 20 } 21 22 // POST /containers/{name:.*}/exec 23 type ContainerExecCreateResponse struct { 24 // ID is the exec ID. 25 ID string `json:"Id"` 26 } 27 28 // POST /auth 29 type AuthResponse struct { 30 // Status is the authentication status 31 Status string `json:"Status"` 32 } 33 34 // POST "/containers/"+containerID+"/wait" 35 type ContainerWaitResponse struct { 36 // StatusCode is the status code of the wait job 37 StatusCode int `json:"StatusCode"` 38 } 39 40 // POST "/commit?container="+containerID 41 type ContainerCommitResponse struct { 42 ID string `json:"Id"` 43 } 44 45 // GET "/containers/{name:.*}/changes" 46 type ContainerChange struct { 47 Kind int 48 Path string 49 } 50 51 // GET "/images/{name:.*}/history" 52 type ImageHistory struct { 53 ID string `json:"Id"` 54 Created int64 55 CreatedBy string 56 Tags []string 57 Size int64 58 Comment string 59 } 60 61 // DELETE "/images/{name:.*}" 62 type ImageDelete struct { 63 Untagged string `json:",omitempty"` 64 Deleted string `json:",omitempty"` 65 } 66 67 // GET "/images/json" 68 type Image struct { 69 ID string `json:"Id"` 70 ParentId string 71 RepoTags []string 72 RepoDigests []string 73 Created int 74 Size int 75 VirtualSize int 76 Labels map[string]string 77 } 78 79 type GraphDriverData struct { 80 Name string 81 Data map[string]string 82 } 83 84 // GET "/images/{name:.*}/json" 85 type ImageInspect struct { 86 Id string 87 Parent string 88 Comment string 89 Created time.Time 90 Container string 91 ContainerConfig *runconfig.Config 92 DockerVersion string 93 Author string 94 Config *runconfig.Config 95 Architecture string 96 Os string 97 Size int64 98 VirtualSize int64 99 GraphDriver GraphDriverData 100 } 101 102 // GET "/containers/json" 103 type Port struct { 104 IP string `json:",omitempty"` 105 PrivatePort int 106 PublicPort int `json:",omitempty"` 107 Type string 108 } 109 110 type Container struct { 111 ID string `json:"Id"` 112 Names []string 113 Image string 114 Command string 115 Created int 116 Ports []Port 117 SizeRw int `json:",omitempty"` 118 SizeRootFs int `json:",omitempty"` 119 Labels map[string]string 120 Status string 121 HostConfig struct { 122 NetworkMode string `json:",omitempty"` 123 } 124 } 125 126 // POST "/containers/"+containerID+"/copy" 127 type CopyConfig struct { 128 Resource string 129 } 130 131 // ContainerPathStat is used to encode the header from 132 // GET /containers/{name:.*}/archive 133 // "name" is the file or directory name. 134 // "path" is the absolute path to the resource in the container. 135 type ContainerPathStat struct { 136 Name string `json:"name"` 137 Path string `json:"path"` 138 Size int64 `json:"size"` 139 Mode os.FileMode `json:"mode"` 140 Mtime time.Time `json:"mtime"` 141 } 142 143 // GET "/containers/{name:.*}/top" 144 type ContainerProcessList struct { 145 Processes [][]string 146 Titles []string 147 } 148 149 type Version struct { 150 Version string 151 ApiVersion version.Version 152 GitCommit string 153 GoVersion string 154 Os string 155 Arch string 156 KernelVersion string `json:",omitempty"` 157 Experimental bool `json:",omitempty"` 158 BuildTime string `json:",omitempty"` 159 } 160 161 // GET "/info" 162 type Info struct { 163 ID string 164 Containers int 165 Images int 166 Driver string 167 DriverStatus [][2]string 168 MemoryLimit bool 169 SwapLimit bool 170 CpuCfsPeriod bool 171 CpuCfsQuota bool 172 IPv4Forwarding bool 173 BridgeNfIptables bool 174 BridgeNfIp6tables bool 175 Debug bool 176 NFd int 177 OomKillDisable bool 178 NGoroutines int 179 SystemTime string 180 ExecutionDriver string 181 LoggingDriver string 182 NEventsListener int 183 KernelVersion string 184 OperatingSystem string 185 IndexServerAddress string 186 RegistryConfig interface{} 187 InitSha1 string 188 InitPath string 189 NCPU int 190 MemTotal int64 191 DockerRootDir string 192 HttpProxy string 193 HttpsProxy string 194 NoProxy string 195 Name string 196 Labels []string 197 ExperimentalBuild bool 198 } 199 200 // This struct is a temp struct used by execStart 201 // Config fields is part of ExecConfig in runconfig package 202 type ExecStartCheck struct { 203 // ExecStart will first check if it's detached 204 Detach bool 205 // Check if there's a tty 206 Tty bool 207 } 208 209 type ContainerState struct { 210 Running bool 211 Paused bool 212 Restarting bool 213 OOMKilled bool 214 Dead bool 215 Pid int 216 ExitCode int 217 Error string 218 StartedAt time.Time 219 FinishedAt time.Time 220 } 221 222 // GET "/containers/{name:.*}/json" 223 type ContainerJSONBase struct { 224 Id string 225 Created time.Time 226 Path string 227 Args []string 228 State *ContainerState 229 Image string 230 NetworkSettings *network.Settings 231 ResolvConfPath string 232 HostnamePath string 233 HostsPath string 234 LogPath string 235 Name string 236 RestartCount int 237 Driver string 238 ExecDriver string 239 MountLabel string 240 ProcessLabel string 241 AppArmorProfile string 242 ExecIDs []string 243 HostConfig *runconfig.HostConfig 244 GraphDriver GraphDriverData 245 } 246 247 type ContainerJSON struct { 248 *ContainerJSONBase 249 Mounts []MountPoint 250 Config *runconfig.Config 251 } 252 253 // backcompatibility struct along with ContainerConfig 254 type ContainerJSONPre120 struct { 255 *ContainerJSONBase 256 Volumes map[string]string 257 VolumesRW map[string]bool 258 Config *ContainerConfig 259 } 260 261 type ContainerConfig struct { 262 *runconfig.Config 263 264 // backward compatibility, they now live in HostConfig 265 Memory int64 266 MemorySwap int64 267 CpuShares int64 268 Cpuset string 269 } 270 271 // MountPoint represents a mount point configuration inside the container. 272 type MountPoint struct { 273 Name string `json:",omitempty"` 274 Source string 275 Destination string 276 Driver string `json:",omitempty"` 277 Mode string // this is internally named `Relabel` 278 RW bool 279 }