2013-04-17 21:13:43 -04:00
|
|
|
package docker
|
|
|
|
|
2013-10-06 01:59:49 -04:00
|
|
|
import "strings"
|
|
|
|
|
2013-11-18 18:35:56 -05:00
|
|
|
type (
|
|
|
|
APIHistory struct {
|
|
|
|
ID string `json:"Id"`
|
|
|
|
Tags []string `json:",omitempty"`
|
|
|
|
Created int64
|
|
|
|
CreatedBy string `json:",omitempty"`
|
|
|
|
Size int64
|
|
|
|
}
|
2013-10-06 01:59:49 -04:00
|
|
|
|
2013-11-18 18:35:56 -05:00
|
|
|
APIImages struct {
|
|
|
|
ID string `json:"Id"`
|
|
|
|
RepoTags []string `json:",omitempty"`
|
|
|
|
Created int64
|
|
|
|
Size int64
|
|
|
|
VirtualSize int64
|
|
|
|
ParentId string `json:",omitempty"`
|
|
|
|
}
|
2013-10-06 01:59:49 -04:00
|
|
|
|
2013-11-18 18:35:56 -05:00
|
|
|
APIImagesOld struct {
|
|
|
|
Repository string `json:",omitempty"`
|
|
|
|
Tag string `json:",omitempty"`
|
|
|
|
ID string `json:"Id"`
|
|
|
|
Created int64
|
|
|
|
Size int64
|
|
|
|
VirtualSize int64
|
2013-10-06 01:59:49 -04:00
|
|
|
}
|
|
|
|
|
2013-11-18 18:35:56 -05:00
|
|
|
APITop struct {
|
|
|
|
Titles []string
|
|
|
|
Processes [][]string
|
|
|
|
}
|
2013-04-19 09:24:37 -04:00
|
|
|
|
2013-11-18 18:35:56 -05:00
|
|
|
APIRmi struct {
|
|
|
|
Deleted string `json:",omitempty"`
|
|
|
|
Untagged string `json:",omitempty"`
|
|
|
|
}
|
2013-06-28 11:51:58 -04:00
|
|
|
|
2013-11-18 18:35:56 -05:00
|
|
|
APIContainers struct {
|
|
|
|
ID string `json:"Id"`
|
|
|
|
Image string
|
|
|
|
Command string
|
|
|
|
Created int64
|
|
|
|
Status string
|
|
|
|
Ports []APIPort
|
|
|
|
SizeRw int64
|
|
|
|
SizeRootFs int64
|
|
|
|
Names []string
|
|
|
|
}
|
2013-05-31 10:37:02 -04:00
|
|
|
|
2013-11-18 18:35:56 -05:00
|
|
|
APIContainersOld struct {
|
|
|
|
ID string `json:"Id"`
|
|
|
|
Image string
|
|
|
|
Command string
|
|
|
|
Created int64
|
|
|
|
Status string
|
|
|
|
Ports string
|
|
|
|
SizeRw int64
|
|
|
|
SizeRootFs int64
|
|
|
|
}
|
2013-04-19 09:24:37 -04:00
|
|
|
|
2013-11-18 18:35:56 -05:00
|
|
|
APIID struct {
|
|
|
|
ID string `json:"Id"`
|
2013-09-04 17:41:44 -04:00
|
|
|
}
|
|
|
|
|
2013-11-18 18:35:56 -05:00
|
|
|
APIRun struct {
|
|
|
|
ID string `json:"Id"`
|
|
|
|
Warnings []string `json:",omitempty"`
|
|
|
|
}
|
2013-09-04 17:41:44 -04:00
|
|
|
|
2013-11-18 18:35:56 -05:00
|
|
|
APIPort struct {
|
|
|
|
PrivatePort int64
|
|
|
|
PublicPort int64
|
|
|
|
Type string
|
|
|
|
IP string
|
|
|
|
}
|
2013-04-24 10:06:03 -04:00
|
|
|
|
2013-11-18 18:35:56 -05:00
|
|
|
APIWait struct {
|
|
|
|
StatusCode int
|
|
|
|
}
|
2013-04-23 12:20:53 -04:00
|
|
|
|
2013-11-18 18:35:56 -05:00
|
|
|
APIAuth struct {
|
|
|
|
Status string
|
|
|
|
}
|
2013-04-24 08:01:40 -04:00
|
|
|
|
2013-11-18 18:35:56 -05:00
|
|
|
APIImageConfig struct {
|
|
|
|
ID string `json:"Id"`
|
|
|
|
*Config
|
|
|
|
}
|
2013-05-06 07:34:31 -04:00
|
|
|
|
2013-11-18 18:35:56 -05:00
|
|
|
APICopy struct {
|
|
|
|
Resource string
|
|
|
|
HostPath string
|
|
|
|
}
|
2013-11-29 20:24:30 -05:00
|
|
|
APIContainer struct {
|
|
|
|
*Container
|
|
|
|
HostConfig *HostConfig
|
|
|
|
}
|
2013-11-18 18:35:56 -05:00
|
|
|
)
|
2013-05-19 13:46:24 -04:00
|
|
|
|
2013-11-18 18:35:56 -05:00
|
|
|
func (api APIImages) ToLegacy() []APIImagesOld {
|
|
|
|
outs := []APIImagesOld{}
|
|
|
|
for _, repotag := range api.RepoTags {
|
|
|
|
components := strings.SplitN(repotag, ":", 2)
|
|
|
|
outs = append(outs, APIImagesOld{
|
|
|
|
ID: api.ID,
|
|
|
|
Repository: components[0],
|
|
|
|
Tag: components[1],
|
|
|
|
Created: api.Created,
|
|
|
|
Size: api.Size,
|
|
|
|
VirtualSize: api.VirtualSize,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
return outs
|
2013-05-19 13:46:24 -04:00
|
|
|
}
|
2013-07-17 00:07:41 -04:00
|
|
|
|
2013-11-18 18:35:56 -05:00
|
|
|
func (api APIContainers) ToLegacy() *APIContainersOld {
|
|
|
|
return &APIContainersOld{
|
|
|
|
ID: api.ID,
|
|
|
|
Image: api.Image,
|
|
|
|
Command: api.Command,
|
|
|
|
Created: api.Created,
|
|
|
|
Status: api.Status,
|
|
|
|
Ports: displayablePorts(api.Ports),
|
|
|
|
SizeRw: api.SizeRw,
|
|
|
|
SizeRootFs: api.SizeRootFs,
|
|
|
|
}
|
2013-07-17 00:07:41 -04:00
|
|
|
}
|