106 lines
3.8 KiB
Go
106 lines
3.8 KiB
Go
package model
|
|
|
|
import "time"
|
|
|
|
// ContainerGroup 表示容器组配置
|
|
type ContainerGroup struct {
|
|
Containers []Container `json:"Containers,omitempty"`
|
|
EksCiName *string `json:"EksCiName,omitempty"`
|
|
SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty"`
|
|
SubnetId *string `json:"SubnetId,omitempty"`
|
|
VpcId *string `json:"VpcId,omitempty"`
|
|
Memory *float64 `json:"Memory,omitempty"`
|
|
Cpu *float64 `json:"Cpu,omitempty"`
|
|
}
|
|
|
|
// Container 表示容器配置
|
|
type Container struct {
|
|
Image *string `json:"Image,omitempty"`
|
|
Name *string `json:"Name,omitempty"`
|
|
Args []*string `json:"Args,omitempty"`
|
|
Commands []*string `json:"Commands,omitempty"`
|
|
Cpu *float64 `json:"Cpu,omitempty"`
|
|
CurrentState *ContainerState `json:"CurrentState,omitempty"`
|
|
EnvironmentVars []*EnvironmentVar `json:"EnvironmentVars,omitempty"`
|
|
GpuLimit *int `json:"GpuLimit,omitempty"`
|
|
LivenessProbe *ProbeConfig `json:"LivenessProbe,omitempty"`
|
|
Memory *float64 `json:"Memory,omitempty"`
|
|
ReadinessProbe *ProbeConfig `json:"ReadinessProbe,omitempty"`
|
|
RestartCount *int `json:"RestartCount,omitempty"`
|
|
SecurityContext *SecurityContext `json:"SecurityContext,omitempty"`
|
|
VolumeMounts []*VolumeMount `json:"VolumeMounts,omitempty"`
|
|
WorkingDir *string `json:"WorkingDir,omitempty"`
|
|
}
|
|
|
|
// ContainerState 表示容器的当前状态
|
|
type ContainerState struct {
|
|
ExitCode *int `json:"ExitCode,omitempty"`
|
|
FinishTime *time.Time `json:"FinishTime,omitempty"`
|
|
Message *string `json:"Message,omitempty"`
|
|
Reason *string `json:"Reason,omitempty"`
|
|
RestartCount *int `json:"RestartCount,omitempty"`
|
|
StartTime *time.Time `json:"StartTime,omitempty"`
|
|
State *string `json:"State,omitempty"`
|
|
}
|
|
|
|
// EnvironmentVar 表示容器环境变量
|
|
type EnvironmentVar struct {
|
|
Name *string `json:"Name,omitempty"`
|
|
Value *string `json:"Value,omitempty"`
|
|
}
|
|
|
|
// ProbeConfig 表示容器健康检查探针配置
|
|
type ProbeConfig struct {
|
|
Probe *Probe `json:"Probe,omitempty"`
|
|
Exec *ExecProbe `json:"Exec,omitempty"`
|
|
HttpGet *HTTPGetProbe `json:"HttpGet,omitempty"`
|
|
TcpSocket *TCPSocketProbe `json:"TcpSocket,omitempty"`
|
|
}
|
|
|
|
// Probe 表示通用探针配置
|
|
type Probe struct {
|
|
FailureThreshold *int `json:"FailureThreshold,omitempty"`
|
|
InitialDelaySeconds *int `json:"InitialDelaySeconds,omitempty"`
|
|
PeriodSeconds *int `json:"PeriodSeconds,omitempty"`
|
|
SuccessThreshold *int `json:"SuccessThreshold,omitempty"`
|
|
TimeoutSeconds *int `json:"TimeoutSeconds,omitempty"`
|
|
}
|
|
|
|
// ExecProbe 表示执行命令类型的探针
|
|
type ExecProbe struct {
|
|
Commands []*string `json:"Commands,omitempty"`
|
|
}
|
|
|
|
// HTTPGetProbe 表示HTTP请求类型的探针
|
|
type HTTPGetProbe struct {
|
|
Path *string `json:"Path,omitempty"`
|
|
Port *int `json:"Port,omitempty"`
|
|
Scheme *string `json:"Scheme,omitempty"`
|
|
}
|
|
|
|
// TCPSocketProbe 表示TCP连接类型的探针
|
|
type TCPSocketProbe struct {
|
|
Port *int `json:"Port,omitempty"`
|
|
}
|
|
|
|
// SecurityContext 表示容器安全上下文
|
|
type SecurityContext struct {
|
|
Capabilities *Capabilities `json:"Capabilities,omitempty"`
|
|
}
|
|
|
|
// Capabilities 表示容器权限配置
|
|
type Capabilities struct {
|
|
Add []*string `json:"Add,omitempty"`
|
|
Drop []*string `json:"Drop,omitempty"`
|
|
}
|
|
|
|
// VolumeMount 表示容器卷挂载配置
|
|
type VolumeMount struct {
|
|
MountPath *string `json:"MountPath,omitempty"`
|
|
Name *string `json:"Name,omitempty"`
|
|
MountPropagation *string `json:"MountPropagation,omitempty"`
|
|
ReadOnly *bool `json:"ReadOnly,omitempty"`
|
|
SubPath *string `json:"SubPath,omitempty"`
|
|
SubPathExpr *string `json:"SubPathExpr,omitempty"`
|
|
}
|