2022-10-08 18:32:02 +08:00
|
|
|
package dto
|
|
|
|
|
2022-10-11 14:20:51 +08:00
|
|
|
import "time"
|
|
|
|
|
2022-10-08 18:32:02 +08:00
|
|
|
type PageContainer struct {
|
|
|
|
PageInfo
|
2022-10-17 16:04:39 +08:00
|
|
|
Filters string `json:"filters"`
|
2022-10-08 18:32:02 +08:00
|
|
|
}
|
|
|
|
|
2022-10-11 19:47:16 +08:00
|
|
|
type InspectReq struct {
|
|
|
|
ID string `json:"id"`
|
|
|
|
Type string `json:"type"`
|
|
|
|
}
|
|
|
|
|
2022-10-08 18:32:02 +08:00
|
|
|
type ContainerInfo struct {
|
|
|
|
ContainerID string `json:"containerID"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
ImageId string `json:"imageID"`
|
|
|
|
ImageName string `json:"imageName"`
|
|
|
|
CreateTime string `json:"createTime"`
|
|
|
|
State string `json:"state"`
|
|
|
|
RunTime string `json:"runTime"`
|
|
|
|
}
|
|
|
|
|
2022-10-12 18:55:47 +08:00
|
|
|
type ContainerCreate struct {
|
|
|
|
Name string `json:"name"`
|
|
|
|
Image string `json:"image"`
|
|
|
|
PublishAllPorts bool `json:"publishAllPorts"`
|
|
|
|
ExposedPorts []PortHelper `json:"exposedPorts"`
|
|
|
|
Cmd []string `json:"cmd"`
|
|
|
|
NanoCPUs int64 `json:"nanoCPUs"`
|
|
|
|
Memory int64 `json:"memory"`
|
|
|
|
AutoRemove bool `json:"autoRemove"`
|
|
|
|
Volumes []VolumeHelper `json:"volumes"`
|
|
|
|
Labels []string `json:"labels"`
|
|
|
|
Env []string `json:"env"`
|
|
|
|
RestartPolicy string `json:"restartPolicy"`
|
|
|
|
}
|
|
|
|
|
2022-10-13 18:24:24 +08:00
|
|
|
type ContainterStats struct {
|
|
|
|
CPUPercent float64 `json:"cpuPercent"`
|
|
|
|
Memory float64 `json:"memory"`
|
|
|
|
Cache float64 `json:"cache"`
|
|
|
|
IORead float64 `json:"ioRead"`
|
|
|
|
IOWrite float64 `json:"ioWrite"`
|
|
|
|
NetworkRX float64 `json:"networkRX"`
|
|
|
|
NetworkTX float64 `json:"networkTX"`
|
|
|
|
|
|
|
|
ShotTime time.Time `json:"shotTime"`
|
|
|
|
}
|
|
|
|
|
2022-10-12 18:55:47 +08:00
|
|
|
type VolumeHelper struct {
|
|
|
|
SourceDir string `json:"sourceDir"`
|
|
|
|
ContainerDir string `json:"containerDir"`
|
|
|
|
Mode string `json:"mode"`
|
|
|
|
}
|
|
|
|
type PortHelper struct {
|
|
|
|
ContainerPort int `json:"containerPort"`
|
|
|
|
HostPort int `json:"hostPort"`
|
|
|
|
}
|
|
|
|
|
2022-10-08 18:32:02 +08:00
|
|
|
type ContainerLog struct {
|
|
|
|
ContainerID string `json:"containerID" validate:"required"`
|
|
|
|
Mode string `json:"mode" validate:"required"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type ContainerOperation struct {
|
|
|
|
ContainerID string `json:"containerID" validate:"required"`
|
2022-10-17 16:04:39 +08:00
|
|
|
Operation string `json:"operation" validate:"required,oneof=start stop restart kill pause unpause rename remove"`
|
2022-10-08 18:32:02 +08:00
|
|
|
NewName string `json:"newName"`
|
|
|
|
}
|
2022-10-11 14:20:51 +08:00
|
|
|
|
|
|
|
type Network struct {
|
2022-10-11 17:46:52 +08:00
|
|
|
ID string `json:"id"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
Labels []string `json:"labels"`
|
|
|
|
Driver string `json:"driver"`
|
|
|
|
IPAMDriver string `json:"ipamDriver"`
|
|
|
|
Subnet string `json:"subnet"`
|
|
|
|
Gateway string `json:"gateway"`
|
|
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
|
|
Attachable bool `json:"attachable"`
|
2022-10-11 14:20:51 +08:00
|
|
|
}
|
|
|
|
type NetworkCreat struct {
|
2022-10-11 17:46:52 +08:00
|
|
|
Name string `json:"name"`
|
|
|
|
Driver string `json:"driver"`
|
|
|
|
Options []string `json:"options"`
|
|
|
|
Subnet string `json:"subnet"`
|
|
|
|
Gateway string `json:"gateway"`
|
|
|
|
IPRange string `json:"ipRange"`
|
|
|
|
Labels []string `json:"labels"`
|
2022-10-11 14:20:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
type Volume struct {
|
|
|
|
Name string `json:"name"`
|
|
|
|
Labels []string `json:"labels"`
|
|
|
|
Driver string `json:"driver"`
|
|
|
|
Mountpoint string `json:"mountpoint"`
|
|
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
|
|
}
|
|
|
|
type VolumeCreat struct {
|
|
|
|
Name string `json:"name"`
|
|
|
|
Driver string `json:"driver"`
|
|
|
|
Options []string `json:"options"`
|
|
|
|
Labels []string `json:"labels"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type BatchDelete struct {
|
|
|
|
Ids []string `json:"ids" validate:"required"`
|
|
|
|
}
|
2022-10-17 16:04:39 +08:00
|
|
|
|
|
|
|
type ComposeInfo struct {
|
|
|
|
Name string `json:"name"`
|
|
|
|
CreatedAt string `json:"createdAt"`
|
|
|
|
ContainerNumber int `json:"containerNumber"`
|
|
|
|
ConfigFile string `json:"configFile"`
|
|
|
|
Workdir string `json:"workdir"`
|
|
|
|
Path string `json:"path"`
|
|
|
|
Containers []ComposeContainer `json:"containers"`
|
|
|
|
}
|
|
|
|
type ComposeContainer struct {
|
|
|
|
ContainerID string `json:"containerID"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
CreateTime string `json:"createTime"`
|
|
|
|
State string `json:"state"`
|
|
|
|
}
|
|
|
|
type ComposeCreate struct {
|
|
|
|
Name string `json:"name" validate:"required"`
|
|
|
|
From string `json:"from" validate:"required,oneof=edit path template"`
|
|
|
|
File string `json:"file"`
|
|
|
|
Path string `json:"path"`
|
|
|
|
Template uint `json:"template"`
|
|
|
|
}
|
|
|
|
type ComposeOperation struct {
|
|
|
|
Path string `json:"path" validate:"required"`
|
|
|
|
Operation string `json:"operation" validate:"required,oneof=up stop pause unpause restart down"`
|
|
|
|
}
|