2022-10-08 10:32:02 +00:00
|
|
|
package dto
|
|
|
|
|
2024-06-14 08:18:39 +00:00
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
)
|
2022-10-11 06:20:51 +00:00
|
|
|
|
2022-10-08 10:32:02 +00:00
|
|
|
type PageContainer struct {
|
|
|
|
PageInfo
|
2023-12-28 03:44:11 +00:00
|
|
|
Name string `json:"name"`
|
|
|
|
State string `json:"state" validate:"required,oneof=all created running paused restarting removing exited dead"`
|
2024-07-10 04:09:24 +00:00
|
|
|
OrderBy string `json:"orderBy" validate:"required,oneof=name state created_at"`
|
2024-06-11 10:06:34 +00:00
|
|
|
Order string `json:"order" validate:"required,oneof=null ascending descending"`
|
2023-12-28 03:44:11 +00:00
|
|
|
Filters string `json:"filters"`
|
|
|
|
ExcludeAppStore bool `json:"excludeAppStore"`
|
2022-10-08 10:32:02 +00:00
|
|
|
}
|
|
|
|
|
2022-10-11 11:47:16 +00:00
|
|
|
type InspectReq struct {
|
2023-10-27 06:19:26 +00:00
|
|
|
ID string `json:"id" validate:"required"`
|
|
|
|
Type string `json:"type" validate:"required"`
|
2022-10-11 11:47:16 +00:00
|
|
|
}
|
|
|
|
|
2022-10-08 10:32:02 +00: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"`
|
2023-02-17 09:59:45 +00:00
|
|
|
|
2023-09-04 07:51:10 +00:00
|
|
|
Network []string `json:"network"`
|
|
|
|
Ports []string `json:"ports"`
|
2023-04-25 14:06:17 +00:00
|
|
|
|
2023-03-15 08:48:26 +00:00
|
|
|
IsFromApp bool `json:"isFromApp"`
|
2023-02-17 09:59:45 +00:00
|
|
|
IsFromCompose bool `json:"isFromCompose"`
|
2023-12-27 14:38:10 +00:00
|
|
|
|
|
|
|
AppName string `json:"appName"`
|
|
|
|
AppInstallName string `json:"appInstallName"`
|
|
|
|
Websites []string `json:"websites"`
|
2022-10-08 10:32:02 +00:00
|
|
|
}
|
|
|
|
|
2023-06-15 12:44:13 +00:00
|
|
|
type ResourceLimit struct {
|
2024-03-04 03:29:04 +00:00
|
|
|
CPU int `json:"cpu"`
|
|
|
|
Memory uint64 `json:"memory"`
|
2023-06-15 12:44:13 +00:00
|
|
|
}
|
|
|
|
|
2023-06-15 03:00:11 +00:00
|
|
|
type ContainerOperate struct {
|
2023-07-05 08:48:25 +00:00
|
|
|
ContainerID string `json:"containerID"`
|
2023-07-10 14:45:08 +00:00
|
|
|
ForcePull bool `json:"forcePull"`
|
2023-10-27 06:19:26 +00:00
|
|
|
Name string `json:"name" validate:"required"`
|
|
|
|
Image string `json:"image" validate:"required"`
|
2023-07-07 15:17:05 +00:00
|
|
|
Network string `json:"network"`
|
2024-04-13 11:56:07 +00:00
|
|
|
Ipv4 string `json:"ipv4"`
|
|
|
|
Ipv6 string `json:"ipv6"`
|
2022-10-12 10:55:47 +00:00
|
|
|
PublishAllPorts bool `json:"publishAllPorts"`
|
|
|
|
ExposedPorts []PortHelper `json:"exposedPorts"`
|
2023-10-07 06:30:46 +00:00
|
|
|
Tty bool `json:"tty"`
|
|
|
|
OpenStdin bool `json:"openStdin"`
|
2022-10-12 10:55:47 +00:00
|
|
|
Cmd []string `json:"cmd"`
|
2023-09-07 08:24:10 +00:00
|
|
|
Entrypoint []string `json:"entrypoint"`
|
2023-06-16 09:54:11 +00:00
|
|
|
CPUShares int64 `json:"cpuShares"`
|
2023-07-10 06:45:08 +00:00
|
|
|
NanoCPUs float64 `json:"nanoCPUs"`
|
|
|
|
Memory float64 `json:"memory"`
|
2023-11-22 05:58:08 +00:00
|
|
|
Privileged bool `json:"privileged"`
|
2022-10-12 10:55:47 +00:00
|
|
|
AutoRemove bool `json:"autoRemove"`
|
|
|
|
Volumes []VolumeHelper `json:"volumes"`
|
|
|
|
Labels []string `json:"labels"`
|
|
|
|
Env []string `json:"env"`
|
|
|
|
RestartPolicy string `json:"restartPolicy"`
|
|
|
|
}
|
|
|
|
|
2023-06-16 09:54:11 +00:00
|
|
|
type ContainerUpgrade struct {
|
2023-07-10 14:45:08 +00:00
|
|
|
Name string `json:"name" validate:"required"`
|
|
|
|
Image string `json:"image" validate:"required"`
|
|
|
|
ForcePull bool `json:"forcePull"`
|
2023-06-16 09:54:11 +00:00
|
|
|
}
|
|
|
|
|
2023-07-06 10:04:22 +00:00
|
|
|
type ContainerListStats struct {
|
2023-09-21 09:34:22 +00:00
|
|
|
ContainerID string `json:"containerID"`
|
|
|
|
|
|
|
|
CPUTotalUsage uint64 `json:"cpuTotalUsage"`
|
|
|
|
SystemUsage uint64 `json:"systemUsage"`
|
2023-07-06 10:04:22 +00:00
|
|
|
CPUPercent float64 `json:"cpuPercent"`
|
2023-09-21 09:34:22 +00:00
|
|
|
PercpuUsage int `json:"percpuUsage"`
|
|
|
|
|
2023-10-07 06:30:46 +00:00
|
|
|
MemoryCache uint64 `json:"memoryCache"`
|
2023-09-21 09:34:22 +00:00
|
|
|
MemoryUsage uint64 `json:"memoryUsage"`
|
|
|
|
MemoryLimit uint64 `json:"memoryLimit"`
|
2023-07-06 10:04:22 +00:00
|
|
|
MemoryPercent float64 `json:"memoryPercent"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type ContainerStats struct {
|
2022-10-13 10:24:24 +00:00
|
|
|
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 10:55:47 +00:00
|
|
|
type VolumeHelper struct {
|
2024-04-02 09:14:45 +00:00
|
|
|
Type string `json:"type"`
|
2022-10-12 10:55:47 +00:00
|
|
|
SourceDir string `json:"sourceDir"`
|
|
|
|
ContainerDir string `json:"containerDir"`
|
|
|
|
Mode string `json:"mode"`
|
|
|
|
}
|
|
|
|
type PortHelper struct {
|
2023-04-26 07:18:13 +00:00
|
|
|
HostIP string `json:"hostIP"`
|
|
|
|
HostPort string `json:"hostPort"`
|
|
|
|
ContainerPort string `json:"containerPort"`
|
|
|
|
Protocol string `json:"protocol"`
|
2022-10-12 10:55:47 +00:00
|
|
|
}
|
|
|
|
|
2022-10-08 10:32:02 +00:00
|
|
|
type ContainerOperation struct {
|
2023-10-26 10:20:16 +00:00
|
|
|
Names []string `json:"names" validate:"required"`
|
2024-09-12 10:06:22 +00:00
|
|
|
Operation string `json:"operation" validate:"required,oneof=up start stop restart kill pause unpause remove"`
|
2023-10-26 10:20:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type ContainerRename struct {
|
|
|
|
Name string `json:"name" validate:"required"`
|
2023-10-27 06:19:26 +00:00
|
|
|
NewName string `json:"newName" validate:"required"`
|
2022-10-08 10:32:02 +00:00
|
|
|
}
|
2022-10-11 06:20:51 +00:00
|
|
|
|
2024-06-14 08:18:39 +00:00
|
|
|
type ContainerCommit struct {
|
|
|
|
ContainerId string `json:"containerID" validate:"required"`
|
|
|
|
ContainerName string `json:"containerName"`
|
|
|
|
NewImageName string `json:"newImageName"`
|
|
|
|
Comment string `json:"comment"`
|
|
|
|
Author string `json:"author"`
|
|
|
|
Pause bool `json:"pause"`
|
|
|
|
}
|
|
|
|
|
2023-05-23 11:00:06 +00:00
|
|
|
type ContainerPrune struct {
|
2024-05-11 09:50:24 +00:00
|
|
|
PruneType string `json:"pruneType" validate:"required,oneof=container image volume network buildcache"`
|
2023-06-16 09:54:11 +00:00
|
|
|
WithTagAll bool `json:"withTagAll"`
|
2023-05-23 11:00:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type ContainerPruneReport struct {
|
|
|
|
DeletedNumber int `json:"deletedNumber"`
|
|
|
|
SpaceReclaimed int `json:"spaceReclaimed"`
|
|
|
|
}
|
|
|
|
|
2022-10-11 06:20:51 +00:00
|
|
|
type Network struct {
|
2022-10-11 09:46:52 +00: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 06:20:51 +00:00
|
|
|
}
|
2023-05-30 07:30:57 +00:00
|
|
|
type NetworkCreate struct {
|
2023-11-21 14:14:07 +00:00
|
|
|
Name string `json:"name" validate:"required"`
|
|
|
|
Driver string `json:"driver" validate:"required"`
|
|
|
|
Options []string `json:"options"`
|
|
|
|
Ipv4 bool `json:"ipv4"`
|
|
|
|
Subnet string `json:"subnet"`
|
|
|
|
Gateway string `json:"gateway"`
|
|
|
|
IPRange string `json:"ipRange"`
|
|
|
|
AuxAddress []SettingUpdate `json:"auxAddress"`
|
|
|
|
|
|
|
|
Ipv6 bool `json:"ipv6"`
|
|
|
|
SubnetV6 string `json:"subnetV6"`
|
|
|
|
GatewayV6 string `json:"gatewayV6"`
|
|
|
|
IPRangeV6 string `json:"ipRangeV6"`
|
|
|
|
AuxAddressV6 []SettingUpdate `json:"auxAddressV6"`
|
|
|
|
Labels []string `json:"labels"`
|
2022-10-11 06:20:51 +00: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"`
|
|
|
|
}
|
2023-05-30 07:30:57 +00:00
|
|
|
type VolumeCreate struct {
|
2023-10-27 06:19:26 +00:00
|
|
|
Name string `json:"name" validate:"required"`
|
|
|
|
Driver string `json:"driver" validate:"required"`
|
2022-10-11 06:20:51 +00:00
|
|
|
Options []string `json:"options"`
|
|
|
|
Labels []string `json:"labels"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type BatchDelete struct {
|
2023-11-30 06:14:08 +00:00
|
|
|
Force bool `json:"force"`
|
2022-12-13 10:54:28 +00:00
|
|
|
Names []string `json:"names" validate:"required"`
|
2022-10-11 06:20:51 +00:00
|
|
|
}
|
2022-10-17 08:04:39 +00:00
|
|
|
|
|
|
|
type ComposeInfo struct {
|
|
|
|
Name string `json:"name"`
|
|
|
|
CreatedAt string `json:"createdAt"`
|
2022-10-18 10:39:45 +00:00
|
|
|
CreatedBy string `json:"createdBy"`
|
2022-10-17 08:04:39 +00:00
|
|
|
ContainerNumber int `json:"containerNumber"`
|
|
|
|
ConfigFile string `json:"configFile"`
|
|
|
|
Workdir string `json:"workdir"`
|
|
|
|
Path string `json:"path"`
|
|
|
|
Containers []ComposeContainer `json:"containers"`
|
2024-09-27 14:25:37 +00:00
|
|
|
Env []string `json:"env"`
|
2022-10-17 08:04:39 +00:00
|
|
|
}
|
|
|
|
type ComposeContainer struct {
|
|
|
|
ContainerID string `json:"containerID"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
CreateTime string `json:"createTime"`
|
|
|
|
State string `json:"state"`
|
|
|
|
}
|
|
|
|
type ComposeCreate struct {
|
2024-09-18 06:00:49 +00:00
|
|
|
Name string `json:"name"`
|
|
|
|
From string `json:"from" validate:"required,oneof=edit path template"`
|
|
|
|
File string `json:"file"`
|
|
|
|
Path string `json:"path"`
|
|
|
|
Template uint `json:"template"`
|
|
|
|
Env []string `json:"env"`
|
2022-10-17 08:04:39 +00:00
|
|
|
}
|
|
|
|
type ComposeOperation struct {
|
2022-12-06 07:05:13 +00:00
|
|
|
Name string `json:"name" validate:"required"`
|
2022-10-17 08:04:39 +00:00
|
|
|
Path string `json:"path" validate:"required"`
|
2024-09-28 14:29:08 +00:00
|
|
|
Operation string `json:"operation" validate:"required,oneof=up start stop down delete"`
|
2023-04-27 04:44:18 +00:00
|
|
|
WithFile bool `json:"withFile"`
|
2022-12-06 07:05:13 +00:00
|
|
|
}
|
|
|
|
type ComposeUpdate struct {
|
2024-09-18 06:00:49 +00:00
|
|
|
Name string `json:"name" validate:"required"`
|
|
|
|
Path string `json:"path" validate:"required"`
|
|
|
|
Content string `json:"content" validate:"required"`
|
|
|
|
Env []string `json:"env"`
|
2022-10-17 08:04:39 +00:00
|
|
|
}
|
2024-06-25 10:17:15 +00:00
|
|
|
|
|
|
|
type ContainerLog struct {
|
|
|
|
Container string `json:"container" validate:"required"`
|
|
|
|
Since string `json:"since"`
|
|
|
|
Tail uint `json:"tail"`
|
|
|
|
ContainerType string `json:"containerType"`
|
|
|
|
}
|