2013-04-18 01:13:43 +00:00
|
|
|
package docker
|
|
|
|
|
2013-10-06 05:59:49 +00:00
|
|
|
import "strings"
|
|
|
|
|
2013-06-04 18:00:22 +00:00
|
|
|
type APIHistory struct {
|
2013-06-18 17:31:07 +00:00
|
|
|
ID string `json:"Id"`
|
|
|
|
Tags []string `json:",omitempty"`
|
2013-04-30 15:04:31 +00:00
|
|
|
Created int64
|
2013-05-31 22:53:57 +00:00
|
|
|
CreatedBy string `json:",omitempty"`
|
2013-10-18 23:39:40 +00:00
|
|
|
Size int64
|
2013-04-19 13:24:37 +00:00
|
|
|
}
|
|
|
|
|
2013-06-04 18:00:22 +00:00
|
|
|
type APIImages struct {
|
2013-10-06 05:44:04 +00:00
|
|
|
ID string `json:"Id"`
|
|
|
|
RepoTags []string `json:",omitempty"`
|
2013-06-14 10:05:01 +00:00
|
|
|
Created int64
|
|
|
|
Size int64
|
|
|
|
VirtualSize int64
|
2013-10-06 05:44:04 +00:00
|
|
|
ParentId string `json:",omitempty"`
|
2013-04-18 16:56:22 +00:00
|
|
|
}
|
|
|
|
|
2013-10-06 05:59:49 +00:00
|
|
|
type APIImagesOld struct {
|
|
|
|
Repository string `json:",omitempty"`
|
|
|
|
Tag string `json:",omitempty"`
|
|
|
|
ID string `json:"Id"`
|
|
|
|
Created int64
|
|
|
|
Size int64
|
|
|
|
VirtualSize int64
|
|
|
|
}
|
|
|
|
|
|
|
|
func (self *APIImages) ToLegacy() []APIImagesOld {
|
|
|
|
|
|
|
|
outs := []APIImagesOld{}
|
|
|
|
for _, repotag := range self.RepoTags {
|
|
|
|
|
|
|
|
components := strings.SplitN(repotag, ":", 2)
|
|
|
|
|
|
|
|
outs = append(outs, APIImagesOld{
|
|
|
|
ID: self.ID,
|
|
|
|
Repository: components[0],
|
|
|
|
Tag: components[1],
|
|
|
|
Created: self.Created,
|
|
|
|
Size: self.Size,
|
|
|
|
VirtualSize: self.VirtualSize,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
return outs
|
|
|
|
}
|
|
|
|
|
2013-06-04 18:00:22 +00:00
|
|
|
type APIInfo struct {
|
2013-07-22 18:42:31 +00:00
|
|
|
Debug bool
|
|
|
|
Containers int
|
|
|
|
Images int
|
2013-11-15 10:04:02 +00:00
|
|
|
Driver string `json:",omitempty"`
|
|
|
|
DriverStatus [][2]string `json:",omitempty"`
|
|
|
|
NFd int `json:",omitempty"`
|
|
|
|
NGoroutines int `json:",omitempty"`
|
|
|
|
MemoryLimit bool `json:",omitempty"`
|
|
|
|
SwapLimit bool `json:",omitempty"`
|
|
|
|
IPv4Forwarding bool `json:",omitempty"`
|
|
|
|
LXCVersion string `json:",omitempty"`
|
|
|
|
NEventsListener int `json:",omitempty"`
|
|
|
|
KernelVersion string `json:",omitempty"`
|
|
|
|
IndexServerAddress string `json:",omitempty"`
|
2013-04-19 13:24:37 +00:00
|
|
|
}
|
|
|
|
|
2013-07-01 15:19:42 +00:00
|
|
|
type APITop struct {
|
2013-07-19 10:06:32 +00:00
|
|
|
Titles []string
|
|
|
|
Processes [][]string
|
2013-06-28 15:51:58 +00:00
|
|
|
}
|
|
|
|
|
2013-06-10 21:05:54 +00:00
|
|
|
type APIRmi struct {
|
2013-05-31 14:37:02 +00:00
|
|
|
Deleted string `json:",omitempty"`
|
|
|
|
Untagged string `json:",omitempty"`
|
|
|
|
}
|
|
|
|
|
2013-06-04 18:00:22 +00:00
|
|
|
type APIContainers struct {
|
2013-06-05 16:01:36 +00:00
|
|
|
ID string `json:"Id"`
|
2013-06-14 10:05:01 +00:00
|
|
|
Image string
|
|
|
|
Command string
|
|
|
|
Created int64
|
|
|
|
Status string
|
2013-08-27 22:20:35 +00:00
|
|
|
Ports []APIPort
|
2013-05-13 13:10:26 +00:00
|
|
|
SizeRw int64
|
|
|
|
SizeRootFs int64
|
2013-10-05 02:25:15 +00:00
|
|
|
Names []string
|
2013-04-19 13:24:37 +00:00
|
|
|
}
|
|
|
|
|
2013-09-04 21:41:44 +00:00
|
|
|
func (self *APIContainers) ToLegacy() APIContainersOld {
|
|
|
|
return APIContainersOld{
|
2013-09-23 00:06:31 +00:00
|
|
|
ID: self.ID,
|
|
|
|
Image: self.Image,
|
|
|
|
Command: self.Command,
|
|
|
|
Created: self.Created,
|
|
|
|
Status: self.Status,
|
|
|
|
Ports: displayablePorts(self.Ports),
|
|
|
|
SizeRw: self.SizeRw,
|
2013-09-04 21:41:44 +00:00
|
|
|
SizeRootFs: self.SizeRootFs,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
type APIContainersOld struct {
|
|
|
|
ID string `json:"Id"`
|
|
|
|
Image string
|
|
|
|
Command string
|
|
|
|
Created int64
|
|
|
|
Status string
|
|
|
|
Ports string
|
|
|
|
SizeRw int64
|
|
|
|
SizeRootFs int64
|
|
|
|
}
|
|
|
|
|
2013-06-04 18:00:22 +00:00
|
|
|
type APIID struct {
|
|
|
|
ID string `json:"Id"`
|
2013-04-24 14:06:03 +00:00
|
|
|
}
|
|
|
|
|
2013-06-04 18:00:22 +00:00
|
|
|
type APIRun struct {
|
|
|
|
ID string `json:"Id"`
|
2013-05-31 22:53:57 +00:00
|
|
|
Warnings []string `json:",omitempty"`
|
2013-05-02 16:36:23 +00:00
|
|
|
}
|
|
|
|
|
2013-06-04 18:00:22 +00:00
|
|
|
type APIPort struct {
|
2013-08-27 22:20:35 +00:00
|
|
|
PrivatePort int64
|
|
|
|
PublicPort int64
|
|
|
|
Type string
|
2013-10-05 02:25:15 +00:00
|
|
|
IP string
|
2013-04-23 16:20:53 +00:00
|
|
|
}
|
|
|
|
|
2013-06-04 18:00:22 +00:00
|
|
|
type APIVersion struct {
|
2013-05-31 22:53:57 +00:00
|
|
|
Version string
|
|
|
|
GitCommit string `json:",omitempty"`
|
|
|
|
GoVersion string `json:",omitempty"`
|
2013-04-18 01:13:43 +00:00
|
|
|
}
|
2013-04-24 12:01:40 +00:00
|
|
|
|
2013-06-04 18:00:22 +00:00
|
|
|
type APIWait struct {
|
2013-04-24 12:01:40 +00:00
|
|
|
StatusCode int
|
|
|
|
}
|
2013-05-06 11:34:31 +00:00
|
|
|
|
2013-06-04 18:00:22 +00:00
|
|
|
type APIAuth struct {
|
2013-05-06 11:34:31 +00:00
|
|
|
Status string
|
|
|
|
}
|
2013-05-19 17:46:24 +00:00
|
|
|
|
2013-06-04 18:00:22 +00:00
|
|
|
type APIImageConfig struct {
|
|
|
|
ID string `json:"Id"`
|
2013-05-19 17:46:24 +00:00
|
|
|
*Config
|
|
|
|
}
|
2013-07-17 04:07:41 +00:00
|
|
|
|
|
|
|
type APICopy struct {
|
|
|
|
Resource string
|
|
|
|
HostPath string
|
|
|
|
}
|