model

package
v1.0.20250928075430 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 28, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigTypePrometheus   int8 = 1 // Prometheus 主配置
	ConfigTypeAlertManager int8 = 2 // AlertManager 主配置
	ConfigTypeAlertRule    int8 = 3 // 告警规则配置
	ConfigTypeRecordRule   int8 = 4 // 预聚合规则配置
	ConfigTypeWebhookFile  int8 = 5 // webhook file
)

配置类型常量

View Source
const (
	ConfigStatusActive   int8 = 1 // 激活状态
	ConfigStatusInactive int8 = 2 // 非激活状态
)

配置状态常量

View Source
const (
	IsLeafYes int8 = 1 // 是叶子节点
	IsLeafNo  int8 = 2 // 不是叶子节点
)

叶子节点标识常量,提升可读性,避免魔法数字

View Source
const (
	CategoryStatusEnabled  int8 = 1 // 启用
	CategoryStatusDisabled int8 = 2 // 禁用
)
View Source
const (
	FormDesignStatusDraft     int8 = 1 // 草稿
	FormDesignStatusPublished int8 = 2 // 已发布
	FormDesignStatusArchived  int8 = 3 // 已归档
)
View Source
const (
	FormFieldTypeText     = "text"     // 文本输入
	FormFieldTypeNumber   = "number"   // 数字输入
	FormFieldTypePassword = "password" // 密码输入
	FormFieldTypeTextarea = "textarea" // 多行文本
	FormFieldTypeSelect   = "select"   // 下拉选择
	FormFieldTypeRadio    = "radio"    // 单选框
	FormFieldTypeCheckbox = "checkbox" // 复选框
	FormFieldTypeDate     = "date"     // 日期选择
	FormFieldTypeSwitch   = "switch"   // 开关
)
View Source
const (
	InstanceStatusDraft      int8 = 1 // 草稿
	InstanceStatusPending    int8 = 2 // 待处理
	InstanceStatusProcessing int8 = 3 // 处理中
	InstanceStatusCompleted  int8 = 4 // 已完成
	InstanceStatusRejected   int8 = 5 // 已拒绝
	InstanceStatusCancelled  int8 = 6 // 已取消
)

工单状态

View Source
const (
	PriorityHigh   int8 = 1 // 高
	PriorityNormal int8 = 2 // 中
	PriorityLow    int8 = 3 // 低
)

优先级

View Source
const (
	FlowRecordTypeUser   int8 = 1 // 用户操作
	FlowRecordTypeSystem int8 = 2 // 系统操作
)

记录类型

View Source
const (
	FieldRequiredNo  int8 = 1 // 非必填
	FieldRequiredYes int8 = 2 // 必填
)

字段必填

View Source
const (
	CommentTypeNormal = "normal" // 普通评论
	CommentTypeSystem = "system" // 系统评论
)

评论类型常量

View Source
const (
	CommentStatusNormal  int8 = 1 // 正常
	CommentStatusDeleted int8 = 2 // 已删除
	CommentStatusHidden  int8 = 3 // 已隐藏
)

评论状态常量

View Source
const (
	FlowActionSubmit   = "submit"   // 提交工单
	FlowActionApprove  = "approve"  // 审批通过
	FlowActionReject   = "reject"   // 审批拒绝
	FlowActionAssign   = "assign"   // 指派处理人
	FlowActionCancel   = "cancel"   // 取消工单
	FlowActionComplete = "complete" // 完成工单
	FlowActionReturn   = "return"   // 退回工单
)

工单状态流转动作类型常量 - 仅包含状态变更相关操作

View Source
const (
	TimelineActionCreate   = "create"   // 创建工单
	TimelineActionSubmit   = "submit"   // 提交工单
	TimelineActionApprove  = "approve"  // 审批通过
	TimelineActionReject   = "reject"   // 审批拒绝
	TimelineActionAssign   = "assign"   // 指派处理人
	TimelineActionCancel   = "cancel"   // 取消工单
	TimelineActionComplete = "complete" // 完成工单
	TimelineActionReturn   = "return"   // 退回工单
	TimelineActionComment  = "comment"  // 添加评论
	TimelineActionUpdate   = "update"   // 更新工单信息
	TimelineActionView     = "view"     // 查看工单
	TimelineActionAttach   = "attach"   // 添加附件
	TimelineActionNotify   = "notify"   // 发送通知
	TimelineActionRemind   = "remind"   // 催办提醒
)

时间线操作类型常量 - 包含所有操作记录

View Source
const (
	EventTypeInstanceCreated   = "instance_created"   // 工单创建
	EventTypeInstanceSubmitted = "instance_submitted" // 工单提交
	EventTypeInstanceAssigned  = "instance_assigned"  // 工单指派
	EventTypeInstanceApproved  = "instance_approved"  // 工单审批通过
	EventTypeInstanceRejected  = "instance_rejected"  // 工单拒绝
	EventTypeInstanceCompleted = "instance_completed" // 工单完成
	EventTypeInstanceCancelled = "instance_cancelled" // 工单取消
	EventTypeInstanceUpdated   = "instance_updated"   // 工单更新
	EventTypeInstanceCommented = "instance_commented" // 工单评论
	EventTypeInstanceDeleted   = "instance_deleted"   // 工单删除
	EventTypeInstanceReturned  = "instance_returned"  // 工单退回
)

事件类型

View Source
const (
	NotificationStatusPending int8 = 1 // 待发送
	NotificationStatusSending int8 = 2 // 发送中
	NotificationStatusSuccess int8 = 3 // 发送成功
	NotificationStatusFailed  int8 = 4 // 发送失败
)

通知状态常量

View Source
const (
	NotificationChannelEmail   = "email"   // 邮件通知
	NotificationChannelFeishu  = "feishu"  // 飞书通知
	NotificationChannelSMS     = "sms"     // 短信通知
	NotificationChannelWebhook = "webhook" // Webhook通知
)

通知渠道

View Source
const (
	RecipientTypeCreator  = "creator"  // 工单创建人
	RecipientTypeAssignee = "assignee" // 工单处理人
	RecipientTypeUser     = "user"     // 指定用户
	RecipientTypeRole     = "role"     // 角色用户
	RecipientTypeDept     = "dept"     // 部门用户
	RecipientTypeCustom   = "custom"   // 自定义用户
)

接收人类型

View Source
const (
	NotificationStatusEnabled  int8 = 1 // 启用
	NotificationStatusDisabled int8 = 2 // 禁用
)

通知状态常量

View Source
const (
	NotificationPriorityHigh   int8 = 1 // 高优先级
	NotificationPriorityMedium int8 = 2 // 中优先级
	NotificationPriorityLow    int8 = 3 // 低优先级
)

优先级

View Source
const (
	NotificationSendStatusPending   int8 = 1 // 待发送
	NotificationSendStatusSending   int8 = 2 // 发送中
	NotificationSendStatusSuccess   int8 = 3 // 发送成功
	NotificationSendStatusFailed    int8 = 4 // 发送失败
	NotificationSendStatusCancelled int8 = 5 // 已取消
)

发送状态

View Source
const (
	NotificationQueueStatusPending    int8 = 1 // 待处理
	NotificationQueueStatusProcessing int8 = 2 // 处理中
	NotificationQueueStatusSuccess    int8 = 3 // 处理成功
	NotificationQueueStatusFailed     int8 = 4 // 处理失败
)

队列状态

View Source
const (
	TriggerTypeImmediate   = "immediate"   // 立即触发
	TriggerTypeDelayed     = "delayed"     // 延迟触发
	TriggerTypeScheduled   = "scheduled"   // 定时触发
	TriggerTypeConditional = "conditional" // 条件触发
)

触发类型

View Source
const (
	TaskTypeSendNotification        = "notification:send"
	TaskTypeBatchSendNotification   = "notification:batch_send"
	TaskTypeScheduledNotification   = "notification:scheduled"
	TaskTypeRetryFailedNotification = "notification:retry_failed"
)

任务类型

View Source
const (
	FlowActionUpdate  = "update"  // 更新
	FlowActionComment = "comment" // 评论
)

流程动作

View Source
const (
	IsDefaultYes int8 = 1 // 是
	IsDefaultNo  int8 = 2 // 否
)

默认配置

View Source
const (
	ProcessStatusDraft     int8 = 1 // 草稿
	ProcessStatusPublished int8 = 2 // 已发布
	ProcessStatusArchived  int8 = 3 // 已归档
)

流程状态常量

View Source
const (
	ProcessStepTypeStart    = "start"    // 开始
	ProcessStepTypeApproval = "approval" // 审批
	ProcessStepTypeTask     = "task"     // 任务
	ProcessStepTypeEnd      = "end"      // 结束
)

流程步骤类型常量

View Source
const (
	ActionStart    = "start"    // 开始动作
	ActionApprove  = "approve"  // 审批动作
	ActionReject   = "reject"   // 驳回动作
	ActionComplete = "complete" // 完成动作
	ActionNotify   = "notify"   // 通知动作
)

可执行动作常量

View Source
const (
	AssigneeTypeUser  = "user"   // 用户类型
	AssigneeTypeGroup = "system" // 系统类型
)

受理人类型常量

View Source
const (
	TemplateStatusEnabled  int8 = 1 // 启用
	TemplateStatusDisabled int8 = 2 // 禁用
)

模板状态常量

View Source
const (
	TemplateVisibilityPrivate = "private" // 私有
	TemplateVisibilityPublic  = "public"  // 公开
	TemplateVisibilityShared  = "shared"  // 共享
)

模板可见性常量

Variables

This section is empty.

Functions

This section is empty.

Types

type AddLabelNodesReq

type AddLabelNodesReq struct {
	ClusterID int               `json:"cluster_id" binding:"required"`          // 集群ID
	NodeName  string            `json:"node_name" binding:"required"`           // 节点名称
	Labels    map[string]string `json:"labels" binding:"required"`              // 要添加的标签
	Overwrite int8              `json:"overwrite" binding:"required,oneof=1 2"` // 是否覆盖已存在的标签
}

AddLabelNodesReq 添加节点标签请求

type AddNodeTaintsReq

type AddNodeTaintsReq struct {
	ClusterID int          `json:"cluster_id" binding:"required"` // 集群ID
	NodeName  string       `json:"node_name" binding:"required"`  // 节点名称
	Taints    []core.Taint `json:"taints" binding:"required"`     // 要添加的污点
}

AddNodeTaintsReq 添加节点污点请求

type AddTreeNodeMemberReq

type AddTreeNodeMemberReq struct {
	NodeID     int                `json:"node_id" form:"node_id" binding:"required"`
	UserID     int                `json:"user_id" form:"user_id" binding:"required"`
	MemberType TreeNodeMemberType `json:"member_type" form:"member_type" binding:"required,oneof=1 2"`
}

AddTreeNodeMemberReq 添加节点成员请求

type AdvancedSearchOptions

type AdvancedSearchOptions struct {
	IPAddressList   []string `json:"ip_address_list"`
	StatusCodeList  []int    `json:"status_code_list"`
	DurationMin     int64    `json:"duration_min"`
	DurationMax     int64    `json:"duration_max"`
	HasError        *bool    `json:"has_error"`
	EndpointPattern string   `json:"endpoint_pattern"`
}

AdvancedSearchOptions 高级搜索选项

type AlertRuleSeverity

type AlertRuleSeverity int8
const (
	AlertRuleSeverityInfo AlertRuleSeverity = iota + 1
	AlertRuleSeverityWarning
	AlertRuleSeverityCritical
)

type AnalyzeRBACPermissionsReq

type AnalyzeRBACPermissionsReq struct {
	ClusterID int     `json:"cluster_id" binding:"required" comment:"集群ID"`
	Subject   Subject `json:"subject" binding:"required" comment:"主体信息"`
}

AnalyzeRBACPermissionsReq 分析RBAC权限请求

type Api

type Api struct {
	Model
	Name        string  `json:"name" gorm:"type:varchar(50);uniqueIndex:idx_name_del;not null;comment:API名称"`       // API名称,唯一且非空
	Path        string  `json:"path" gorm:"type:varchar(255);not null;comment:API路径"`                               // API路径,非空
	Method      int8    `json:"method" gorm:"type:tinyint(1);not null;comment:HTTP请求方法 1GET 2POST 3PUT 4DELETE"`    // 请求方法,使用int8节省空间
	Description string  `json:"description" gorm:"type:varchar(500);comment:API描述"`                                 // API描述
	Version     string  `json:"version" gorm:"type:varchar(20);default:v1;comment:API版本"`                           // API版本,默认v1
	Category    int8    `json:"category" gorm:"type:tinyint(1);not null;comment:API分类 1系统 2业务" binding:"oneof=1 2"` // API分类,使用int8节省空间
	IsPublic    int8    `json:"is_public" gorm:"type:tinyint(1);default:0;comment:是否公开 0否 1是" binding:"oneof=0 1"`  // 是否公开,使用int8节省空间
	Users       []*User `json:"users" gorm:"many2many:cl_user_apis;comment:关联用户"`                                   // 多对多关联用户
}

func (*Api) TableName

func (api *Api) TableName() string

type ApiStatistics

type ApiStatistics struct {
	PublicCount  int64 `json:"public_count"`  // 公开API数量
	PrivateCount int64 `json:"private_count"` // 私有API数量
}

type ApplyResourceByYamlReq

type ApplyResourceByYamlReq struct {
	ClusterID int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	YAML      string `json:"yaml" binding:"required" comment:"YAML内容"`                       // YAML内容
	DryRun    bool   `json:"dry_run" comment:"是否为试运行"`                                       // 是否为试运行
}

ApplyResourceByYamlReq 应用YAML到K8s集群的请求

type ApproveWorkorderInstanceReq

type ApproveWorkorderInstanceReq struct {
	ID      int    `json:"id" form:"id" binding:"required,min=1"`
	Comment string `json:"comment" binding:"omitempty,max=500"`
}

通过工单

type ArchiveAuditLogsRequest

type ArchiveAuditLogsRequest struct {
	StartTime int64 `json:"start_time" binding:"required"`
	EndTime   int64 `json:"end_time" binding:"required"`
}

ArchiveAuditLogsRequest 归档审计日志请求

type AssignRoleApiRequest

type AssignRoleApiRequest struct {
	RoleID int   `json:"role_id" binding:"required,gt=0"`
	ApiIds []int `json:"api_ids" binding:"required,dive,gt=0"`
}

type AssignRoleRequest

type AssignRoleRequest struct {
	UserID  int   `json:"user_id" binding:"required,gt=0"`       // 用户ID
	RoleIds []int `json:"role_ids" binding:"required,dive,gt=0"` // 角色ID列表
}

AssignRoleRequest 分配角色请求结构体

type AssignRolesToUserRequest

type AssignRolesToUserRequest struct {
	UserID  int   `json:"user_id" binding:"required,gt=0"`       // 用户ID
	RoleIds []int `json:"role_ids" binding:"required,dive,gt=0"` // 角色ID列表
}

type AssignWorkorderInstanceReq

type AssignWorkorderInstanceReq struct {
	ID         int `json:"id" form:"id" binding:"required,min=1"`
	AssigneeID int `json:"assignee_id" binding:"required,min=1"`
}

指派工单

type AuditLog

type AuditLog struct {
	Model
	UserID        int            `json:"user_id" gorm:"index:idx_user_time;not null;comment:操作用户ID"`
	TraceID       string         `json:"trace_id" gorm:"size:32;index;comment:链路追踪ID"`
	IPAddress     string         `json:"ip_address" gorm:"size:45;not null;comment:操作IP地址"`
	UserAgent     string         `json:"user_agent" gorm:"size:500;comment:用户代理"`
	HttpMethod    string         `json:"http_method" gorm:"size:10;not null;index:idx_method_status;comment:HTTP请求方法"`
	Description   string         `json:"description" gorm:"size:255;comment:描述"`
	Endpoint      string         `json:"endpoint" gorm:"size:255;not null;index;comment:请求端点"`
	OperationType string         `json:"operation_type" gorm:"type:VARCHAR(20);index:idx_operation_time;not null;comment:操作类型"`
	TargetType    string         `json:"target_type" gorm:"size:64;not null;index;comment:目标资源类型"`
	TargetID      string         `json:"target_id" gorm:"size:255;index;comment:目标资源ID"`
	StatusCode    int            `json:"status_code" gorm:"not null;index:idx_method_status;comment:HTTP状态码"`
	RequestBody   datatypes.JSON `json:"request_body" gorm:"type:json;comment:请求体"`
	ResponseBody  datatypes.JSON `json:"response_body" gorm:"type:json;comment:响应体"`
	Duration      int64          `json:"duration" gorm:"not null;comment:请求耗时(微秒)"`
	ErrorMsg      string         `json:"error_msg" gorm:"size:1000;comment:错误信息"`
}

AuditLog 审计日志模型 - 优化存储结构

func (AuditLog) TableName

func (AuditLog) TableName() string

TableName 指定表名,支持分表

type AuditLogBatch

type AuditLogBatch struct {
	Logs []AuditLog `json:"logs"`
}

AuditLogBatch 批量写入的审计日志

type AuditStatistics

type AuditStatistics struct {
	TotalCount         int64                    `json:"total_count"`
	TodayCount         int64                    `json:"today_count"`
	ErrorCount         int64                    `json:"error_count"`
	AvgDuration        float64                  `json:"avg_duration"`
	TypeDistribution   []TypeDistributionItem   `json:"type_distribution"`
	StatusDistribution []StatusDistributionItem `json:"status_distribution"`
	RecentActivity     []RecentActivityItem     `json:"recent_activity"`
	HourlyTrend        []HourlyTrendItem        `json:"hourly_trend"`
}

AuditStatistics 审计统计信息

type AuditTypeInfo

type AuditTypeInfo struct {
	Type        string `json:"type"`
	Description string `json:"description"`
	Category    string `json:"category"`
}

AuditTypeInfo 审计类型信息

type AuthMode

type AuthMode int8
const (
	AuthModePassword AuthMode = iota + 1
	AuthModeKey
)

type BatchDeleteRequest

type BatchDeleteRequest struct {
	IDs []int `json:"ids" binding:"required,min=1,max=100"`
}

BatchDeleteRequest 批量删除请求

type BindTreeLocalResourceReq

type BindTreeLocalResourceReq struct {
	ID          int   `json:"id" form:"id"`
	TreeNodeIDs []int `json:"tree_node_ids" form:"tree_node_ids"`
}

type BindTreeNodeResourceReq

type BindTreeNodeResourceReq struct {
	NodeID      int   `json:"node_id" binding:"required"`
	ResourceIDs []int `json:"resource_ids" binding:"required,min=1"`
}

BindTreeNodeResourceReq 绑定资源请求

type BoolValue

type BoolValue int8

BoolValue Bool值的int8替代

const (
	BoolTrue  BoolValue = 1 // true
	BoolFalse BoolValue = 2 // false
)

type CancelWorkorderInstanceReq

type CancelWorkorderInstanceReq struct {
	ID      int    `json:"id" form:"id" binding:"required,min=1"`
	Comment string `json:"comment" binding:"required,min=1,max=500"`
}

type ChangePasswordReq

type ChangePasswordReq struct {
	UserID          int    `json:"user_id" form:"user_id" binding:"required"`                                       // 用户ID
	Username        string `json:"username" form:"username" binding:"required"`                                     // 用户名
	Password        string `json:"password" form:"password" binding:"required"`                                     // 原密码
	NewPassword     string `json:"new_password" form:"new_password" binding:"required,min=6"`                       // 新密码,至少6位
	ConfirmPassword string `json:"confirm_password" form:"confirm_password" binding:"required,eqfield=NewPassword"` // 确认密码,必须与新密码相同
}

ChangePasswordReq 修改密码请求

type CheckRBACPermissionReq

type CheckRBACPermissionReq struct {
	ClusterID int     `json:"cluster_id" binding:"required" comment:"集群ID"`
	Subject   Subject `json:"subject" binding:"required" comment:"主体信息"`
	Resource  string  `json:"resource" binding:"required" comment:"资源类型"`
	Verb      string  `json:"verb" binding:"required" comment:"动作"`
	Namespace string  `json:"namespace" comment:"命名空间"`
}

CheckRBACPermissionReq 检查RBAC权限请求

type CheckTaintYamlReq

type CheckTaintYamlReq struct {
	ClusterID int    `json:"cluster_id" binding:"required"` // 集群ID
	NodeName  string `json:"node_name" binding:"required"`  // 节点名称
	YamlData  string `json:"yaml_data" binding:"required"`  // YAML数据
}

CheckTaintYamlReq 检查污点YAML配置请求

type CheckTreeNodePermissionReq

type CheckTreeNodePermissionReq struct {
	UserID    int    `json:"user_id" binding:"required"`
	NodeID    int    `json:"node_id" binding:"required"`
	Operation string `json:"operation" binding:"required"`
}

CheckTreeNodePermissionReq 检查节点权限请求

type CheckUserPermissionRequest

type CheckUserPermissionRequest struct {
	UserID int    `json:"user_id" binding:"required,gt=0"`
	Method string `json:"method" binding:"required"`
	Path   string `json:"path" binding:"required"`
}

type CleanupOldEventsReq

type CleanupOldEventsReq struct {
	ClusterID  int       `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"`
	Namespace  string    `json:"namespace" form:"namespace" comment:"命名空间"`
	BeforeTime time.Time `json:"before_time" form:"before_time" binding:"required" comment:"清理此时间之前的事件"`
	EventType  string    `json:"event_type" form:"event_type" comment:"事件类型:Normal,Warning"`
	DryRun     bool      `json:"dry_run" form:"dry_run" comment:"是否为试运行"`
}

CleanupOldEventsReq 清理旧事件请求

type ClusterStatus

type ClusterStatus int8
const (
	StatusRunning ClusterStatus = iota + 1 // 运行中
	StatusStopped                          // 停止
	StatusError                            // 异常
)

type CompleteWorkorderInstanceReq

type CompleteWorkorderInstanceReq struct {
	ID      int    `json:"id" form:"id" binding:"required,min=1"`
	Comment string `json:"comment" binding:"required,min=1,max=500"`
}

type ConnectTerminalResourceReq

type ConnectTerminalResourceReq struct {
	ID     int `json:"id" form:"id"`
	UserID int `json:"user_id"`
}

ConnectTerminalReq 连接终端请求

type ConvertToYamlReq

type ConvertToYamlReq struct {
	ClusterID int         `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	Config    interface{} `json:"config" binding:"required" comment:"资源配置信息"`                     // 资源配置信息
}

ConvertToYamlReq 将资源配置转换为YAML的请求

type CountItem

type CountItem struct {
	Name       string  `json:"name"`       // 名称
	Count      int64   `json:"count"`      // 计数
	Percentage float64 `json:"percentage"` // 百分比
}

CountItem 计数项

type CreateApiRequest

type CreateApiRequest struct {
	Name        string `json:"name" binding:"required"`       // API名称
	Path        string `json:"path" binding:"required"`       // API路径
	Method      int    `json:"method" binding:"required"`     // 请求方法
	Description string `json:"description"`                   // API描述
	Version     string `json:"version"`                       // API版本
	Category    int    `json:"category"`                      // API分类
	IsPublic    int    `json:"is_public" binding:"oneof=1 2"` // 是否公开
}

type CreateAuditLogRequest

type CreateAuditLogRequest struct {
	UserID        int            `json:"user_id" binding:"required"`
	TraceID       string         `json:"trace_id"`
	IPAddress     string         `json:"ip_address" binding:"required"`
	UserAgent     string         `json:"user_agent"`
	HttpMethod    string         `json:"http_method" binding:"required"`
	Endpoint      string         `json:"endpoint" binding:"required"`
	OperationType string         `json:"operation_type" binding:"required"`
	TargetType    string         `json:"target_type"`
	TargetID      string         `json:"target_id"`
	StatusCode    int            `json:"status_code" binding:"required"`
	RequestBody   datatypes.JSON `json:"request_body"`
	ResponseBody  datatypes.JSON `json:"response_body"`
	Duration      int64          `json:"duration" binding:"required"`
	ErrorMsg      string         `json:"error_msg"`
}

CreateAuditLogRequest 创建审计日志请求 - middleware使用

type CreateClusterReq

type CreateClusterReq struct {
	Name                 string       `json:"name" binding:"required,min=1,max=200"` // 集群名称
	CpuRequest           string       `json:"cpu_request,omitempty"`                 // CPU 请求量
	CpuLimit             string       `json:"cpu_limit,omitempty"`                   // CPU 限制量
	MemoryRequest        string       `json:"memory_request,omitempty"`              // 内存请求量
	MemoryLimit          string       `json:"memory_limit,omitempty"`                // 内存限制量
	RestrictNamespace    StringList   `json:"restrict_namespace"`                    // 资源限制命名空间
	Env                  Env          `json:"env,omitempty"`                         // 集群环境
	Version              string       `json:"version,omitempty"`                     // 集群版本
	ApiServerAddr        string       `json:"api_server_addr,omitempty"`             // API Server 地址
	KubeConfigContent    string       `json:"kube_config_content,omitempty"`         // kubeConfig 内容
	ActionTimeoutSeconds int          `json:"action_timeout_seconds,omitempty"`      // 操作超时时间(秒)
	CreateUserName       string       `json:"create_user_name,omitempty"`            // 创建者用户名
	CreateUserID         int          `json:"create_user_id,omitempty"`              // 创建者用户ID
	Tags                 KeyValueList `json:"tags,omitempty"`                        // 标签
}

CreateClusterReq 创建集群请求

type CreateClusterRoleBindingByYamlReq

type CreateClusterRoleBindingByYamlReq struct {
	ClusterID   int    `json:"cluster_id" binding:"required" comment:"集群ID"`
	YamlContent string `json:"yaml_content" binding:"required" comment:"YAML内容"`
}

CreateClusterRoleBindingByYamlReq 通过YAML创建ClusterRoleBinding请求

type CreateClusterRoleBindingReq

type CreateClusterRoleBindingReq struct {
	ClusterID   int               `json:"cluster_id" binding:"required" comment:"集群ID"`
	Name        string            `json:"name" binding:"required" comment:"ClusterRoleBinding名称"`
	Labels      map[string]string `json:"labels" comment:"标签"`
	Annotations map[string]string `json:"annotations" comment:"注解"`
	RoleRef     RoleRef           `json:"role_ref" binding:"required" comment:"角色引用"`
	Subjects    []Subject         `json:"subjects" binding:"required" comment:"主体列表"`
}

CreateClusterRoleBindingReq 创建ClusterRoleBinding请求

type CreateClusterRoleByYamlReq

type CreateClusterRoleByYamlReq struct {
	ClusterID   int    `json:"cluster_id" binding:"required" comment:"集群ID"`
	YamlContent string `json:"yaml_content" binding:"required" comment:"YAML内容"`
}

CreateClusterRoleByYamlReq 通过YAML创建ClusterRole请求

type CreateClusterRoleReq

type CreateClusterRoleReq struct {
	ClusterID   int               `json:"cluster_id" binding:"required" comment:"集群ID"`
	Name        string            `json:"name" binding:"required" comment:"ClusterRole名称"`
	Labels      map[string]string `json:"labels" comment:"标签"`
	Annotations map[string]string `json:"annotations" comment:"注解"`
	Rules       []PolicyRule      `json:"rules" binding:"required" comment:"权限规则列表"`
}

CreateClusterRoleReq 创建ClusterRole请求

type CreateConfigMapByYamlReq

type CreateConfigMapByYamlReq struct {
	ClusterID int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	YAML      string `json:"yaml" binding:"required" comment:"YAML内容"`                       // YAML内容
}

CreateConfigMapByYamlReq 通过YAML创建ConfigMap请求

type CreateConfigMapReq

type CreateConfigMapReq struct {
	ClusterID   int               `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	Name        string            `json:"name" form:"name" binding:"required" comment:"ConfigMap名称"`      // ConfigMap名称
	Namespace   string            `json:"namespace" form:"namespace" binding:"required" comment:"命名空间"`   // 命名空间
	Data        map[string]string `json:"data" comment:"字符串数据"`                                           // 字符串数据
	BinaryData  map[string][]byte `json:"binary_data" comment:"二进制数据"`                                    // 二进制数据
	Labels      map[string]string `json:"labels" comment:"标签"`                                            // 标签
	Annotations map[string]string `json:"annotations" comment:"注解"`                                       // 注解
	Immutable   bool              `json:"immutable" comment:"是否不可变"`                                      // 是否不可变
}

CreateConfigMapReq 创建ConfigMap请求

type CreateCronJobReq

type CreateCronJobReq struct {
	Name           string       `json:"name" binding:"required,min=1,max=100"`
	Description    string       `json:"description" binding:"max=500"`
	JobType        CronJobType  `json:"job_type" binding:"required,oneof=1 2 3 4 5"`
	Schedule       string       `json:"schedule" binding:"required"`
	Command        string       `json:"command"`
	Args           StringList   `json:"args"`
	WorkDir        string       `json:"work_dir"`
	Environment    KeyValueList `json:"environment"`
	HTTPMethod     string       `json:"http_method"`
	HTTPUrl        string       `json:"http_url"`
	HTTPHeaders    KeyValueList `json:"http_headers"`
	HTTPBody       string       `json:"http_body"`
	ScriptType     string       `json:"script_type"`
	ScriptContent  string       `json:"script_content"`
	SSHResourceID  *int         `json:"ssh_resource_id"`
	SSHCommand     string       `json:"ssh_command"`
	SSHWorkDir     string       `json:"ssh_work_dir"`
	SSHEnvironment KeyValueList `json:"ssh_environment"`
	Timeout        int          `json:"timeout" binding:"omitempty,min=1,max=3600"`
	MaxRetry       int          `json:"max_retry" binding:"omitempty,min=0,max=10"`
	CreatedBy      int          `json:"created_by"`
	CreatedByName  string       `json:"created_by_name"`
}

CreateCronJobReq 创建定时任务请求

type CreateDaemonSetByYamlReq

type CreateDaemonSetByYamlReq struct {
	ClusterID int    `json:"cluster_id" binding:"required"` // 集群ID
	YAML      string `json:"yaml" binding:"required"`       // YAML内容
}

CreateDaemonSetByYamlReq 通过YAML创建DaemonSet请求

type CreateDaemonSetReq

type CreateDaemonSetReq struct {
	ClusterID   int               `json:"cluster_id" binding:"required"` // 集群ID
	Name        string            `json:"name" binding:"required"`       // DaemonSet名称
	Namespace   string            `json:"namespace" binding:"required"`  // 命名空间
	Images      []string          `json:"images" binding:"required"`     // 容器镜像列表
	Labels      map[string]string `json:"labels"`                        // 标签
	Annotations map[string]string `json:"annotations"`                   // 注解
	Spec        DaemonSetSpec     `json:"spec"`                          // DaemonSet规格
	YAML        string            `json:"yaml"`                          // YAML内容
}

CreateDaemonSetReq 创建DaemonSet请求

type CreateDeploymentByYamlReq

type CreateDeploymentByYamlReq struct {
	ClusterID int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	YAML      string `json:"yaml" binding:"required" comment:"YAML内容"`                       // YAML内容
}

CreateDeploymentByYamlReq 通过YAML创建Deployment请求

type CreateDeploymentReq

type CreateDeploymentReq struct {
	ClusterID   int               `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	Name        string            `json:"name" form:"name" binding:"required" comment:"Deployment名称"`     // Deployment名称
	Namespace   string            `json:"namespace" form:"namespace" binding:"required" comment:"命名空间"`   // 命名空间
	Replicas    int32             `json:"replicas" binding:"required" comment:"副本数量"`                     // 副本数量
	Images      []string          `json:"images" binding:"required" comment:"容器镜像列表"`                     // 容器镜像列表
	Labels      map[string]string `json:"labels" comment:"标签"`                                            // 标签
	Annotations map[string]string `json:"annotations" comment:"注解"`                                       // 注解
	Spec        DeploymentSpec    `json:"spec" comment:"Deployment规格"`                                    // Deployment规格
}

CreateDeploymentReq 创建Deployment请求

type CreateIngressByYamlReq

type CreateIngressByYamlReq struct {
	ClusterID int    `json:"cluster_id" binding:"required"` // 集群ID
	YAML      string `json:"yaml" binding:"required"`       // YAML内容
}

CreateIngressByYamlReq 通过YAML创建Ingress请求

type CreateIngressReq

type CreateIngressReq struct {
	ClusterID        int               `json:"cluster_id" binding:"required"` // 集群ID
	Name             string            `json:"name" binding:"required"`       // Ingress名称
	Namespace        string            `json:"namespace" binding:"required"`  // 命名空间
	IngressClassName *string           `json:"ingress_class_name"`            // Ingress类名
	Rules            []IngressRule     `json:"rules"`                         // Ingress规则
	TLS              []IngressTLS      `json:"tls"`                           // TLS配置
	Labels           map[string]string `json:"labels"`                        // 标签
	Annotations      map[string]string `json:"annotations"`                   // 注解
}

CreateIngressReq 创建Ingress请求

type CreateMonitorAlertManagerPoolReq

type CreateMonitorAlertManagerPoolReq struct {
	Name                  string     `json:"name" binding:"required,min=1,max=50"`
	AlertManagerInstances StringList `json:"alert_manager_instances" binding:"required,min=1"`
	UserID                int        `json:"user_id" binding:"required"`
	ResolveTimeout        string     `json:"resolve_timeout" binding:"omitempty"`
	GroupWait             string     `json:"group_wait" binding:"omitempty"`
	GroupInterval         string     `json:"group_interval" binding:"omitempty"`
	RepeatInterval        string     `json:"repeat_interval" binding:"omitempty"`
	GroupBy               StringList `json:"group_by" binding:"omitempty"`
	Receiver              string     `json:"receiver" binding:"required,min=1,max=100"`
	CreateUserName        string     `json:"create_user_name" binding:"required,min=1,max=100"`
}

CreateMonitorAlertManagerPoolReq 创建AlertManager实例池请求

type CreateMonitorAlertRuleReq

type CreateMonitorAlertRuleReq struct {
	Name           string            `json:"name" binding:"required,min=1,max=50"`
	UserID         int               `json:"user_id"`
	PoolID         int               `json:"pool_id" binding:"required"`
	SendGroupID    int               `json:"send_group_id" binding:"required"`
	IpAddress      string            `json:"ip_address"`
	Enable         int8              `json:"enable"`
	Expr           string            `json:"expr" binding:"required"`
	Severity       AlertRuleSeverity `json:"severity" binding:"omitempty"`
	GrafanaLink    string            `json:"grafana_link"`
	ForTime        string            `json:"for_time" binding:"required"`
	Labels         StringList        `json:"labels"`
	Annotations    StringList        `json:"annotations"`
	CreateUserName string            `json:"create_user_name"`
}

CreateMonitorAlertRuleReq 创建告警规则请求

type CreateMonitorConfigReq

type CreateMonitorConfigReq struct {
	Name          string `json:"name" binding:"required,min=1,max=100"`
	PoolID        int    `json:"pool_id" binding:"required"`
	InstanceIP    string `json:"instance_ip" binding:"required"`
	ConfigType    int8   `json:"config_type" binding:"required,oneof=1 2 3 4 5"`
	ConfigContent string `json:"config_content" binding:"required"`
	Status        int8   `json:"status" binding:"omitempty,oneof=1 2"`
}

CreateMonitorConfigReq 创建监控配置请求

type CreateMonitorOnDutyGroupChangeReq

type CreateMonitorOnDutyGroupChangeReq struct {
	OnDutyGroupID  int    `json:"on_duty_group_id" binding:"required"`
	Date           string `json:"date" binding:"required"`
	OriginUserID   int    `json:"origin_user_id" binding:"required"`
	OnDutyUserID   int    `json:"on_duty_user_id" binding:"required"`
	UserID         int    `json:"user_id" binding:"required"`
	CreateUserName string `json:"create_user_name"`
	Reason         string `json:"reason" binding:"max=255"`
}

CreateMonitorOnDutyGroupChangeReq 创建值班组换班记录请求

type CreateMonitorOnDutyGroupReq

type CreateMonitorOnDutyGroupReq struct {
	Name           string `json:"name" binding:"required,min=1,max=50"`
	UserID         int    `json:"user_id" form:"user_id" binding:"required"`
	UserIDs        []int  `json:"user_ids" binding:"required,min=1"`
	ShiftDays      int    `json:"shift_days" binding:"required,min=1"`
	CreateUserName string `json:"create_user_name"`
	Description    string `json:"description" binding:"max=255"`
}

CreateMonitorOnDutyGroupReq 创建值班组请求

type CreateMonitorRecordRuleReq

type CreateMonitorRecordRuleReq struct {
	Name           string     `json:"name" binding:"required,min=1,max=50"`
	UserID         int        `json:"user_id"`
	PoolID         int        `json:"pool_id" binding:"required"`
	IpAddress      string     `json:"ip_address"`
	Enable         int8       `json:"enable"`
	Expr           string     `json:"expr" binding:"required"`
	Labels         StringList `json:"labels"`
	CreateUserName string     `json:"create_user_name"`
}

CreateMonitorRecordRuleReq 创建记录规则请求

type CreateMonitorScrapeJobReq

type CreateMonitorScrapeJobReq struct {
	Name                     string               `json:"name" binding:"required,min=1,max=50"`
	UserID                   int                  `json:"user_id" binding:"required"`
	Enable                   int8                 `json:"enable"`
	ServiceDiscoveryType     ServiceDiscoveryType `json:"service_discovery_type"`
	MetricsPath              string               `json:"metrics_path"`
	Scheme                   string               `json:"scheme"`
	ScrapeInterval           int                  `json:"scrape_interval"`
	ScrapeTimeout            int                  `json:"scrape_timeout"`
	PoolID                   int                  `json:"pool_id" binding:"required"`
	RelabelConfigsYamlString string               `json:"relabel_configs_yaml_string"`
	RefreshInterval          int                  `json:"refresh_interval"`
	Port                     int                  `json:"port"`
	IpAddress                string               `json:"ip_address"`
	KubeConfigFilePath       string               `json:"kube_config_file_path"`
	TlsCaFilePath            string               `json:"tls_ca_file_path"`
	TlsCaContent             string               `json:"tls_ca_content"`
	BearerToken              string               `json:"bearer_token"`
	BearerTokenFile          string               `json:"bearer_token_file"`
	KubernetesSdRole         string               `json:"kubernetes_sd_role"`
	CreateUserName           string               `json:"create_user_name"`
	TreeNodeIDs              StringList           `json:"tree_node_ids"`
	Tags                     StringList           `json:"tags"`
}

type CreateMonitorScrapePoolReq

type CreateMonitorScrapePoolReq struct {
	Name                 string     `json:"name" binding:"required,min=1,max=50"`
	UserID               int        `json:"user_id"`
	ScrapeInterval       int        `json:"scrape_interval"`
	ScrapeTimeout        int        `json:"scrape_timeout"`
	RemoteTimeoutSeconds int        `json:"remote_timeout_seconds"`
	SupportAlert         int8       `json:"support_alert"`
	SupportRecord        int8       `json:"support_record"`
	PrometheusInstances  StringList `json:"prometheus_instances"`
	Tags                 StringList `json:"tags"`
	RemoteWriteUrl       string     `json:"remote_write_url"`
	RemoteReadUrl        string     `json:"remote_read_url"`
	AlertManagerUrl      string     `json:"alert_manager_url"`
	RuleFilePath         string     `json:"rule_file_path"`
	RecordFilePath       string     `json:"record_file_path"`
	CreateUserName       string     `json:"create_user_name"`
}

type CreateMonitorSendGroupReq

type CreateMonitorSendGroupReq struct {
	Name                string     `json:"name" binding:"required,min=1,max=50"`
	NameZh              string     `json:"name_zh" binding:"required,min=1,max=50"`
	Enable              int8       `json:"enable" binding:"omitempty,oneof=1 2"`
	UserID              int        `json:"user_id" binding:"required"`
	PoolID              int        `json:"pool_id" binding:"required"`
	OnDutyGroupID       int        `json:"on_duty_group_id"`
	StaticReceiveUsers  []*User    `json:"static_receive_users"`
	FeiShuQunRobotToken string     `json:"fei_shu_qun_robot_token" binding:"max=255"`
	RepeatInterval      string     `json:"repeat_interval" binding:"max=50"`
	SendResolved        int8       `json:"send_resolved" binding:"omitempty,oneof=1 2"`
	NotifyMethods       StringList `json:"notify_methods"`
	NeedUpgrade         int8       `json:"need_upgrade" binding:"omitempty,oneof=1 2"`
	FirstUpgradeUsers   []*User    `json:"first_upgrade_users"`
	UpgradeMinutes      int        `json:"upgrade_minutes" binding:"min=0"`
	SecondUpgradeUsers  []*User    `json:"second_upgrade_users"`
	CreateUserName      string     `json:"create_user_name"`
}

CreateMonitorSendGroupReq 创建发送组请求

type CreatePVByYamlReq

type CreatePVByYamlReq struct {
	ClusterID int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	YAML      string `json:"yaml" binding:"required" comment:"YAML内容"`                       // YAML内容
}

CreatePVByYamlReq 通过YAML创建PV请求

type CreatePVCByYamlReq

type CreatePVCByYamlReq struct {
	ClusterID int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	YAML      string `json:"yaml" binding:"required" comment:"YAML内容"`                       // YAML内容
}

CreatePVCByYamlReq 通过YAML创建PVC请求

type CreatePVCReq

type CreatePVCReq struct {
	ClusterID   int               `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	Namespace   string            `json:"namespace" form:"namespace" binding:"required" comment:"命名空间"`   // 命名空间
	Name        string            `json:"name" form:"name" binding:"required" comment:"PVC名称"`            // PVC名称
	Labels      map[string]string `json:"labels" comment:"标签"`                                            // 标签
	Annotations map[string]string `json:"annotations" comment:"注解"`                                       // 注解
	Spec        PVCSpec           `json:"spec" comment:"PVC规格"`                                           // PVC规格
}

CreatePVCReq 创建PVC请求

type CreatePVReq

type CreatePVReq struct {
	ClusterID     int                    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	Name          string                 `json:"name" form:"name" binding:"required" comment:"PV名称"`             // PV名称
	Capacity      string                 `json:"capacity" binding:"required" comment:"存储容量"`                     // 存储容量
	AccessModes   []string               `json:"access_modes" binding:"required" comment:"访问模式"`                 // 访问模式
	ReclaimPolicy string                 `json:"reclaim_policy" comment:"回收策略"`                                  // 回收策略
	StorageClass  string                 `json:"storage_class" comment:"存储类"`                                    // 存储类
	VolumeMode    string                 `json:"volume_mode" comment:"卷模式"`                                      // 卷模式
	VolumeSource  map[string]interface{} `json:"volume_source" binding:"required" comment:"卷源配置"`                // 卷源配置
	NodeAffinity  map[string]interface{} `json:"node_affinity" comment:"节点亲和性"`                                  // 节点亲和性
	Labels        map[string]string      `json:"labels" comment:"标签"`                                            // 标签
	Annotations   map[string]string      `json:"annotations" comment:"注解"`                                       // 注解
}

CreatePVReq 创建PV请求

type CreatePodByYamlReq

type CreatePodByYamlReq struct {
	ClusterID int    `json:"cluster_id" binding:"required"` // 集群ID
	YAML      string `json:"yaml" binding:"required"`       // YAML内容
}

CreatePodByYamlReq 通过YAML创建Pod请求

type CreatePodContainer

type CreatePodContainer struct {
	Name            string                  `json:"name" binding:"required"`  // 容器名称
	Image           string                  `json:"image" binding:"required"` // 容器镜像
	Command         []string                `json:"command"`                  // 启动命令
	Args            []string                `json:"args"`                     // 启动参数
	Envs            []PodEnvVar             `json:"envs"`                     // 环境变量
	Ports           []PodContainerPort      `json:"ports"`                    // 容器端口
	Resources       PodResourceRequirements `json:"resources"`                // 资源要求
	VolumeMounts    []PodVolumeMount        `json:"volume_mounts"`            // 卷挂载
	LivenessProbe   *PodProbe               `json:"liveness_probe"`           // 存活探测
	ReadinessProbe  *PodProbe               `json:"readiness_probe"`          // 就绪探测
	ImagePullPolicy string                  `json:"image_pull_policy"`        // 镜像拉取策略
	WorkingDir      string                  `json:"working_dir"`              // 工作目录
	SecurityContext *corev1.SecurityContext `json:"security_context"`         // 安全上下文
}

CreatePodContainer 创建Pod容器配置

type CreatePodReq

type CreatePodReq struct {
	ClusterID      int                  `json:"cluster_id" binding:"required"` // 集群ID
	Name           string               `json:"name" binding:"required"`       // Pod名称
	Namespace      string               `json:"namespace" binding:"required"`  // 命名空间
	Labels         map[string]string    `json:"labels"`                        // 标签
	Annotations    map[string]string    `json:"annotations"`                   // 注解
	Containers     []CreatePodContainer `json:"containers" binding:"required"` // 容器列表
	InitContainers []CreatePodContainer `json:"init_containers"`               // 初始化容器列表
	RestartPolicy  string               `json:"restart_policy"`                // 重启策略
	NodeSelector   map[string]string    `json:"node_selector"`                 // 节点选择器
	Tolerations    []corev1.Toleration  `json:"tolerations"`                   // 容忍度
	Affinity       *corev1.Affinity     `json:"affinity"`                      // 亲和性
	Volumes        []corev1.Volume      `json:"volumes"`                       // 卷
	HostNetwork    bool                 `json:"host_network"`                  // 是否使用主机网络
	HostPID        bool                 `json:"host_pid"`                      // 是否使用主机PID
	DNSPolicy      string               `json:"dns_policy"`                    // DNS策略
	ServiceAccount string               `json:"service_account"`               // 服务账户
}

CreatePodReq 创建Pod请求

type CreateResourceByYamlReq

type CreateResourceByYamlReq struct {
	ClusterID int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	YAML      string `json:"yaml" binding:"required" comment:"YAML内容"`                       // YAML内容
	Namespace string `json:"namespace" binding:"required" comment:"命名空间"`                    // 命名空间
}

CreateResourceByYamlReq 通过YAML创建K8s资源的通用请求

type CreateRoleBindingByYamlReq

type CreateRoleBindingByYamlReq struct {
	ClusterID   int    `json:"cluster_id" binding:"required" comment:"集群ID"`
	YamlContent string `json:"yaml_content" binding:"required" comment:"YAML内容"`
}

CreateRoleBindingByYamlReq 通过YAML创建RoleBinding请求

type CreateRoleBindingReq

type CreateRoleBindingReq struct {
	ClusterID   int               `json:"cluster_id" binding:"required" comment:"集群ID"`
	Namespace   string            `json:"namespace" binding:"required" comment:"命名空间"`
	Name        string            `json:"name" binding:"required" comment:"RoleBinding名称"`
	Labels      map[string]string `json:"labels" comment:"标签"`
	Annotations map[string]string `json:"annotations" comment:"注解"`
	RoleRef     RoleRef           `json:"role_ref" binding:"required" comment:"角色引用"`
	Subjects    []Subject         `json:"subjects" binding:"required" comment:"主体列表"`
}

CreateRoleBindingReq 创建RoleBinding请求

type CreateRoleByYamlReq

type CreateRoleByYamlReq struct {
	ClusterID   int    `json:"cluster_id" binding:"required" comment:"集群ID"`
	YamlContent string `json:"yaml_content" binding:"required" comment:"YAML内容"`
}

CreateRoleByYamlReq 通过YAML创建Role请求

type CreateRoleReq

type CreateRoleReq struct {
	ClusterID   int               `json:"cluster_id" binding:"required" comment:"集群ID"`
	Namespace   string            `json:"namespace" binding:"required" comment:"命名空间"`
	Name        string            `json:"name" binding:"required" comment:"Role名称"`
	Labels      map[string]string `json:"labels" comment:"标签"`
	Annotations map[string]string `json:"annotations" comment:"注解"`
	Rules       []PolicyRule      `json:"rules" binding:"required" comment:"权限规则列表"`
}

CreateRoleReq 创建Role请求

type CreateRoleRequest

type CreateRoleRequest struct {
	Name        string `json:"name" binding:"required,max=50"` // 角色名称
	Code        string `json:"code" binding:"required,max=50"` // 角色编码
	Description string `json:"description" binding:"max=500"`  // 角色描述
	Status      int    `json:"status" binding:"oneof=0 1"`     // 状态
	ApiIds      []int  `json:"api_ids"`                        // 关联的API ID列表
}

CreateRoleRequest 创建角色请求结构体

type CreateSecretByYamlReq

type CreateSecretByYamlReq struct {
	ClusterID int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	YAML      string `json:"yaml" binding:"required" comment:"YAML内容"`                       // YAML内容
}

CreateSecretByYamlReq 通过YAML创建Secret请求

type CreateSecretReq

type CreateSecretReq struct {
	ClusterID   int               `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	Name        string            `json:"name" form:"name" binding:"required" comment:"Secret名称"`         // Secret名称
	Namespace   string            `json:"namespace" form:"namespace" binding:"required" comment:"命名空间"`   // 命名空间
	Type        K8sSecretType     `json:"type" comment:"Secret类型"`                                        // Secret类型
	Data        map[string][]byte `json:"data" comment:"加密数据"`                                            // 加密数据
	StringData  map[string]string `json:"string_data" comment:"明文数据"`                                     // 明文数据
	Labels      map[string]string `json:"labels" comment:"标签"`                                            // 标签
	Annotations map[string]string `json:"annotations" comment:"注解"`                                       // 注解
	Immutable   bool              `json:"immutable" comment:"是否不可变"`                                      // 是否不可变
}

CreateSecretReq 创建Secret请求

type CreateServiceAccountByYamlReq

type CreateServiceAccountByYamlReq struct {
	ClusterID   int    `json:"cluster_id" binding:"required" comment:"集群ID"`
	YamlContent string `json:"yaml_content" binding:"required" comment:"YAML内容"`
}

CreateServiceAccountByYamlReq 通过YAML创建ServiceAccount请求

type CreateServiceAccountReq

type CreateServiceAccountReq struct {
	ClusterID                    int               `json:"cluster_id" binding:"required" comment:"集群ID"`
	Namespace                    string            `json:"namespace" binding:"required" comment:"命名空间"`
	Name                         string            `json:"name" binding:"required" comment:"ServiceAccount名称"`
	Labels                       map[string]string `json:"labels" comment:"标签"`
	Annotations                  map[string]string `json:"annotations" comment:"注解"`
	AutomountServiceAccountToken *bool             `json:"automount_service_account_token" comment:"是否自动挂载服务账户令牌"`
	ImagePullSecrets             []string          `json:"image_pull_secrets" comment:"镜像拉取密钥列表"`
	Secrets                      []string          `json:"secrets" comment:"关联的Secret列表"`
}

CreateServiceAccountReq 创建ServiceAccount请求

type CreateServiceAccountTokenReq

type CreateServiceAccountTokenReq struct {
	ClusterID          int    `json:"cluster_id" binding:"required" comment:"集群ID"`
	Namespace          string `json:"namespace" binding:"required" comment:"命名空间"`
	ServiceAccountName string `json:"service_account_name" binding:"required" comment:"ServiceAccount名称"`
	ExpirationSeconds  *int64 `json:"expiration_seconds" comment:"令牌过期时间(秒)"`
}

CreateServiceAccountTokenReq 创建ServiceAccount Token请求

type CreateServiceByYamlReq

type CreateServiceByYamlReq struct {
	ClusterID int    `json:"cluster_id" binding:"required"` // 集群ID
	YAML      string `json:"yaml" binding:"required"`       // YAML内容
}

type CreateServiceReq

type CreateServiceReq struct {
	ClusterID   int               `json:"cluster_id" binding:"required"` // 集群ID
	Name        string            `json:"name" binding:"required"`       // Service名称
	Namespace   string            `json:"namespace" binding:"required"`  // 命名空间
	Type        string            `json:"type" binding:"required"`       // Service类型
	Ports       []ServicePort     `json:"ports" binding:"required"`      // 端口配置
	Selector    map[string]string `json:"selector"`                      // Pod选择器
	Labels      map[string]string `json:"labels"`                        // 标签
	Annotations map[string]string `json:"annotations"`                   // 注解
	YAML        string            `json:"yaml"`                          // YAML内容
}

CreateServiceReq 创建Service请求

type CreateStatefulSetByYamlReq

type CreateStatefulSetByYamlReq struct {
	ClusterID int    `json:"cluster_id" binding:"required"` // 集群ID
	YAML      string `json:"yaml" binding:"required"`       // YAML内容
}

CreateStatefulSetByYamlReq 通过YAML创建StatefulSet请求

type CreateStatefulSetReq

type CreateStatefulSetReq struct {
	ClusterID   int               `json:"cluster_id" binding:"required"`   // 集群ID
	Name        string            `json:"name" binding:"required"`         // StatefulSet名称
	Namespace   string            `json:"namespace" binding:"required"`    // 命名空间
	Replicas    int32             `json:"replicas" binding:"required"`     // 副本数量
	ServiceName string            `json:"service_name" binding:"required"` // 服务名称
	Images      []string          `json:"images" binding:"required"`       // 容器镜像列表
	Labels      map[string]string `json:"labels"`                          // 标签
	Annotations map[string]string `json:"annotations"`                     // 注解
	Spec        StatefulSetSpec   `json:"spec"`                            // StatefulSet规格
	YAML        string            `json:"yaml"`                            // YAML内容
}

CreateStatefulSetReq 创建StatefulSet请求

type CreateTreeLocalResourceReq

type CreateTreeLocalResourceReq struct {
	Name           string     `json:"name" binding:"required"`
	Environment    string     `json:"environment"`
	Description    string     `json:"description"`
	Tags           StringList `json:"tags"`
	IpAddr         string     `json:"ip_addr" binding:"required"`
	Port           int        `json:"port"`
	Username       string     `json:"username"`
	Password       string     `json:"password"`
	CreateUserID   int        `json:"create_user_id"`
	CreateUserName string     `json:"create_user_name"`
	OsType         string     `json:"os_type"`
	OSName         string     `json:"os_name"`
	ImageName      string     `json:"image_name"`
	Key            string     `json:"key"`
	AuthMode       AuthMode   `json:"auth_mode"`
}

CreateTreeLocalReq 创建本地树资源请求

type CreateTreeNodeReq

type CreateTreeNodeReq struct {
	Name           string         `json:"name" form:"name" binding:"required,min=1,max=50"`
	ParentID       int            `json:"parent_id" form:"parent_id"` // 父节点ID,0表示根节点
	CreateUserID   int            `json:"creator_id"`                 // 创建者ID
	CreateUserName string         `json:"creator_name"`               // 创建者姓名
	Description    string         `json:"description" form:"description"`
	IsLeaf         int8           `json:"is_leaf" form:"is_leaf" binding:"omitempty,oneof=1 2"`
	Status         TreeNodeStatus `json:"status" form:"status" binding:"omitempty,oneof=1 2"`
}

CreateTreeNodeReq 创建节点请求

type CreateWorkorderCategoryReq

type CreateWorkorderCategoryReq struct {
	Name         string `json:"name" binding:"required,min=1,max=100"`
	Status       int8   `json:"status" binding:"required,oneof=1 2"`
	Description  string `json:"description" binding:"omitempty,max=500"`
	OperatorID   int    `json:"operator_id" binding:"required,min=1"`
	OperatorName string `json:"operator_name" binding:"required,min=1,max=100"`
}

CreateWorkorderCategoryReq 创建工单分类请求

type CreateWorkorderFormDesignReq

type CreateWorkorderFormDesignReq struct {
	Name         string     `json:"name" binding:"required,min=1,max=200"`
	Description  string     `json:"description" binding:"omitempty,max=1000"`
	Schema       FormSchema `json:"schema" binding:"required"`
	Status       int8       `json:"status" binding:"required,oneof=1 2 3"`
	CategoryID   *int       `json:"category_id" binding:"omitempty,min=1"`
	OperatorID   int        `json:"operator_id" binding:"required,min=1"`
	OperatorName string     `json:"operator_name" binding:"required,min=1,max=100"`
	Tags         StringList `json:"tags" binding:"omitempty"`
	IsTemplate   int8       `json:"is_template" binding:"required,oneof=1 2"`
}

CreateWorkorderFormDesignReq 创建工单表单设计请求

type CreateWorkorderInstanceCommentReq

type CreateWorkorderInstanceCommentReq struct {
	InstanceID   int    `json:"instance_id" binding:"required,min=1"`
	OperatorID   int    `json:"operator_id" binding:"required,min=1"`
	OperatorName string `json:"operator_name" binding:"required,min=1,max=100"`
	Content      string `json:"content" binding:"required,min=1,max=2000"`
	ParentID     *int   `json:"parent_id" binding:"omitempty,min=1"`
	Type         string `json:"type" binding:"omitempty,oneof=normal system"`
	Status       int8   `json:"status" binding:"omitempty,oneof=1 2 3"`
	IsSystem     int8   `json:"is_system" binding:"omitempty,oneof=1 2"`
}

CreateWorkorderInstanceCommentReq 创建工单实例评论请求

type CreateWorkorderInstanceFlowReq

type CreateWorkorderInstanceFlowReq struct {
	InstanceID     int    `json:"instance_id" binding:"required,min=1"`
	Action         string `json:"action" binding:"required,oneof=submit approve reject assign cancel complete return"`
	OperatorID     int    `json:"operator_id" binding:"required,min=1"`
	OperatorName   string `json:"operator_name" binding:"required,min=1,max=100"`
	FromStatus     int8   `json:"from_status" binding:"required,min=1,max=6"`
	ToStatus       int8   `json:"to_status" binding:"required,min=1,max=6"`
	Comment        string `json:"comment" binding:"omitempty,max=1000"`
	IsSystemAction int8   `json:"is_system_action" binding:"omitempty,oneof=1 2"`
}

CreateWorkorderInstanceFlowReq 创建工单流转记录请求

type CreateWorkorderInstanceFromTemplateReq

type CreateWorkorderInstanceFromTemplateReq struct {
	Title        string     `json:"title" binding:"required,min=1,max=200"`
	FormData     JSONMap    `json:"form_data" binding:"omitempty"`
	Priority     int8       `json:"priority" binding:"required,oneof=1 2 3"`
	OperatorID   int        `json:"operator_id" form:"operator_id" binding:"required,min=1"`
	OperatorName string     `json:"operator_name" form:"operator_name" binding:"required,min=1,max=100"`
	AssigneeID   *int       `json:"assignee_id" binding:"omitempty,min=1"`
	Description  string     `json:"description" binding:"omitempty,max=2000"`
	Tags         StringList `json:"tags" binding:"omitempty"`
	DueDate      *time.Time `json:"due_date" binding:"omitempty"`
}

从模板创建工单

type CreateWorkorderInstanceReq

type CreateWorkorderInstanceReq struct {
	Title        string     `json:"title" binding:"required,min=1,max=200"`
	ProcessID    int        `json:"process_id" binding:"required,min=1"`
	FormData     JSONMap    `json:"form_data" binding:"required"`
	Status       int8       `json:"status" binding:"required,oneof=1 2 3 4 5 6"`
	Priority     int8       `json:"priority" binding:"required,oneof=1 2 3"`
	OperatorID   int        `json:"operator_id" binding:"required,min=1"`
	OperatorName string     `json:"operator_name" binding:"required,min=1,max=100"`
	AssigneeID   *int       `json:"assignee_id" binding:"omitempty,min=1"`
	Description  string     `json:"description" binding:"omitempty,max=2000"`
	Tags         StringList `json:"tags" binding:"omitempty"`
	DueDate      *time.Time `json:"due_date" binding:"omitempty"`
}

创建工单请求

type CreateWorkorderInstanceTimelineReq

type CreateWorkorderInstanceTimelineReq struct {
	InstanceID   int    `json:"instance_id" binding:"required,min=1"`
	Action       string `` /* 138-byte string literal not displayed */
	OperatorID   int    `json:"operator_id" binding:"required,min=1"`
	OperatorName string `json:"operator_name" binding:"required,min=1,max=100"`
	ActionDetail string `json:"action_detail" binding:"omitempty"`
	Comment      string `json:"comment" binding:"omitempty,max=2000"`
	RelatedID    *int   `json:"related_id" binding:"omitempty,min=1"`
}

CreateWorkorderInstanceTimelineReq 创建工单操作时间线请求

type CreateWorkorderNotificationReq

type CreateWorkorderNotificationReq struct {
	Name             string     `json:"name" binding:"required"`
	Description      string     `json:"description"`
	ProcessID        *int       `json:"process_id"`
	TemplateID       *int       `json:"template_id"`
	CategoryID       *int       `json:"category_id"`
	EventTypes       StringList `json:"event_types" binding:"required"`
	TriggerType      string     `json:"trigger_type" binding:"required"`
	TriggerCondition JSONMap    `json:"trigger_condition"`
	Channels         StringList `json:"channels" binding:"required"`
	RecipientTypes   StringList `json:"recipient_types" binding:"required"`
	RecipientUsers   StringList `json:"recipient_users"`
	RecipientRoles   StringList `json:"recipient_roles"`
	RecipientDepts   StringList `json:"recipient_depts"`
	MessageTemplate  string     `json:"message_template" binding:"required"`
	SubjectTemplate  string     `json:"subject_template"`
	ScheduledTime    *time.Time `json:"scheduled_time"`
	RepeatInterval   *int       `json:"repeat_interval"`
	MaxRetries       int        `json:"max_retries"`
	RetryInterval    int        `json:"retry_interval"`
	Status           int8       `json:"status"`
	Priority         int8       `json:"priority"`
	IsDefault        int8       `json:"is_default" binding:"omitempty,oneof=1 2"`
	Settings         JSONMap    `json:"settings"`
	UserID           int        `json:"-"` // 由中间件注入
}

CreateWorkorderNotificationReq 创建通知配置

type CreateWorkorderProcessReq

type CreateWorkorderProcessReq struct {
	Name         string            `json:"name" binding:"required,min=1,max=200"`
	Description  string            `json:"description" binding:"omitempty,max=1000"`
	FormDesignID int               `json:"form_design_id" binding:"required,min=1"`
	Definition   ProcessDefinition `json:"definition" binding:"required"`
	Status       int8              `json:"status" binding:"required,oneof=1 2 3"`
	CategoryID   *int              `json:"category_id" binding:"omitempty,min=1"`
	OperatorID   int               `json:"operator_id" binding:"required,min=1"`
	OperatorName string            `json:"operator_name" binding:"required,min=1,max=100"`
	Tags         StringList        `json:"tags" binding:"omitempty"`
	IsDefault    int8              `json:"is_default" binding:"required,oneof=1 2"`
}

CreateWorkorderProcessReq 创建工单流程请求

type CreateWorkorderTemplateReq

type CreateWorkorderTemplateReq struct {
	Name          string     `json:"name" binding:"required,min=1,max=200"`
	Description   string     `json:"description" binding:"omitempty,max=1000"`
	ProcessID     int        `json:"process_id" binding:"required,min=1"`
	FormDesignID  int        `json:"form_design_id" binding:"required,min=1"`
	DefaultValues JSONMap    `json:"default_values" binding:"omitempty"`
	Status        int8       `json:"status" binding:"required,oneof=1 2"`
	CategoryID    *int       `json:"category_id" binding:"omitempty,min=1"`
	OperatorID    int        `json:"operator_id" form:"operator_id" binding:"required,min=1"`
	OperatorName  string     `json:"operator_name" form:"operator_name" binding:"required,min=1,max=100"`
	Tags          StringList `json:"tags" binding:"omitempty"`
}

CreateWorkorderTemplateReq 创建工单模板请求

type CronJob

type CronJob struct {
	Model
	Name            string             `json:"name" gorm:"type:varchar(100);not null;uniqueIndex;comment:任务名称"`
	Description     string             `json:"description" gorm:"type:text;comment:任务描述"`
	JobType         CronJobType        `` /* 141-byte string literal not displayed */
	Status          CronJobStatus      `` /* 128-byte string literal not displayed */
	IsBuiltIn       int8               `json:"is_built_in" gorm:"type:tinyint(1);not null;default:0;index:idx_builtin;comment:是否为内置任务 1是 2否"`
	Schedule        string             `json:"schedule" gorm:"type:varchar(100);not null;comment:调度表达式"`
	Command         string             `json:"command" gorm:"type:text;comment:执行命令"`
	Args            StringList         `json:"args" gorm:"type:text;comment:命令参数"`
	WorkDir         string             `json:"work_dir" gorm:"type:varchar(500);comment:工作目录"`
	Environment     KeyValueList       `json:"environment" gorm:"type:text;comment:环境变量"`
	HTTPMethod      string             `json:"http_method" gorm:"type:varchar(10);comment:HTTP方法"`
	HTTPUrl         string             `json:"http_url" gorm:"type:varchar(500);comment:HTTP URL"`
	HTTPHeaders     KeyValueList       `json:"http_headers" gorm:"type:text;comment:HTTP请求头"`
	HTTPBody        string             `json:"http_body" gorm:"type:text;comment:HTTP请求体"`
	ScriptType      string             `json:"script_type" gorm:"type:varchar(20);comment:脚本类型"`
	ScriptContent   string             `json:"script_content" gorm:"type:longtext;comment:脚本内容"`
	SSHResourceID   *int               `json:"ssh_resource_id" gorm:"comment:SSH资源ID,关联树资源"`
	SSHResource     *TreeLocalResource `json:"ssh_resource,omitempty" gorm:"foreignKey:SSHResourceID"`
	SSHCommand      string             `json:"ssh_command" gorm:"type:text;comment:SSH执行命令"`
	SSHWorkDir      string             `json:"ssh_work_dir" gorm:"type:varchar(500);comment:SSH工作目录"`
	SSHEnvironment  KeyValueList       `json:"ssh_environment" gorm:"type:text;comment:SSH环境变量"`
	Timeout         int                `json:"timeout" gorm:"default:300;comment:超时时间(秒)"`
	MaxRetry        int                `json:"max_retry" gorm:"default:3;comment:最大重试次数"`
	NextRunTime     *time.Time         `json:"next_run_time" gorm:"comment:下次运行时间"`
	LastRunTime     *time.Time         `json:"last_run_time" gorm:"comment:上次运行时间"`
	LastRunStatus   int8               `json:"last_run_status" gorm:"default:0;comment:上次运行状态 0未执行 1成功 2失败"`
	LastRunDuration int                `json:"last_run_duration" gorm:"default:0;comment:上次运行时长(毫秒)"`
	LastRunError    string             `json:"last_run_error" gorm:"type:text;comment:上次运行错误"`
	LastRunOutput   string             `json:"last_run_output" gorm:"type:text;comment:上次运行输出"`
	RunCount        int                `json:"run_count" gorm:"default:0;comment:运行次数"`
	SuccessCount    int                `json:"success_count" gorm:"default:0;comment:成功次数"`
	FailureCount    int                `json:"failure_count" gorm:"default:0;comment:失败次数"`
	CreatedBy       int                `json:"created_by" gorm:"index:idx_created_by;comment:创建者ID"`
	CreatedByName   string             `json:"created_by_name" gorm:"type:varchar(100);comment:创建者名称"`
}

CronJob 定时任务模型 - 简洁设计

func (*CronJob) TableName

func (c *CronJob) TableName() string

type CronJobStatus

type CronJobStatus int8

CronJobStatus 定时任务状态枚举

const (
	CronJobStatusEnabled  CronJobStatus = iota + 1 // 启用
	CronJobStatusDisabled                          // 禁用
	CronJobStatusRunning                           // 运行中
	CronJobStatusError                             // 错误
)

type CronJobType

type CronJobType int8

CronJobType 定时任务类型枚举

const (
	CronJobTypeSystem  CronJobType = iota + 1 // 系统任务
	CronJobTypeCommand                        // 命令行任务
	CronJobTypeHTTP                           // HTTP请求任务
	CronJobTypeScript                         // 脚本任务
	CronJobTypeSSH                            // SSH远程执行任务
)

type DaemonSetCondition

type DaemonSetCondition struct {
	Type               string    `json:"type"`                 // 条件类型
	Status             string    `json:"status"`               // 条件状态
	LastUpdateTime     time.Time `json:"last_update_time"`     // 最后更新时间
	LastTransitionTime time.Time `json:"last_transition_time"` // 最后转换时间
	Reason             string    `json:"reason"`               // 原因
	Message            string    `json:"message"`              // 消息
}

DaemonSetCondition DaemonSet条件

type DaemonSetSpec

type DaemonSetSpec struct {
	Selector             *metav1.LabelSelector           `json:"selector"`                         // 标签选择器
	Template             *corev1.PodTemplateSpec         `json:"template"`                         // Pod模板
	UpdateStrategy       *appsv1.DaemonSetUpdateStrategy `json:"update_strategy,omitempty"`        // 更新策略
	MinReadySeconds      *int32                          `json:"min_ready_seconds,omitempty"`      // 最小就绪时间
	RevisionHistoryLimit *int32                          `json:"revision_history_limit,omitempty"` // 历史版本限制
}

DaemonSetSpec 创建/更新DaemonSet时的配置信息

type DeleteApiRequest

type DeleteApiRequest struct {
	ID int `json:"id" binding:"required,gt=0"` // API ID
}

type DeleteAuditLogRequest

type DeleteAuditLogRequest struct {
	ID int `json:"id" binding:"required"`
}

type DeleteClusterReq

type DeleteClusterReq struct {
	ID int `json:"id" form:"id" uri:"id" binding:"required" comment:"集群ID"`
}

DeleteClusterReq 删除集群请求

type DeleteClusterRoleBindingReq

type DeleteClusterRoleBindingReq struct {
	ClusterID int    `json:"cluster_id" binding:"required" comment:"集群ID"`
	Name      string `json:"name" binding:"required" comment:"ClusterRoleBinding名称"`
}

DeleteClusterRoleBindingReq 删除ClusterRoleBinding请求

type DeleteClusterRoleReq

type DeleteClusterRoleReq struct {
	ClusterID int    `json:"cluster_id" binding:"required" comment:"集群ID"`
	Name      string `json:"name" binding:"required" comment:"ClusterRole名称"`
}

DeleteClusterRoleReq 删除ClusterRole请求

type DeleteConfigMapReq

type DeleteConfigMapReq struct {
	ClusterID int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	Namespace string `json:"namespace" form:"namespace" binding:"required" comment:"命名空间"`   // 命名空间
	Name      string `json:"name" binding:"required" comment:"ConfigMap名称"`                  // ConfigMap名称
}

DeleteConfigMapReq 删除ConfigMap请求

type DeleteDaemonSetReq

type DeleteDaemonSetReq struct {
	ClusterID int    `json:"cluster_id"` // 集群ID
	Namespace string `json:"namespace"`  // 命名空间
	Name      string `json:"name"`       // DaemonSet名称
}

DeleteDaemonSetReq 删除DaemonSet请求

type DeleteDeploymentReq

type DeleteDeploymentReq struct {
	ClusterID int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	Namespace string `json:"namespace" form:"namespace" binding:"required" comment:"命名空间"`   // 命名空间
	Name      string `json:"name" binding:"required" comment:"Deployment名称"`                 // Deployment名称
}

DeleteDeploymentReq 删除Deployment请求

type DeleteEventReq

type DeleteEventReq struct {
	ClusterID int    `json:"cluster_id" binding:"required" comment:"集群ID"`
	Namespace string `json:"namespace" binding:"required" comment:"命名空间"`
	Name      string `json:"name" binding:"required" comment:"事件名称"`
}

DeleteEventReq 删除事件请求

type DeleteIngressReq

type DeleteIngressReq struct {
	ClusterID int    `json:"cluster_id"` // 集群ID
	Namespace string `json:"namespace"`  // 命名空间
	Name      string `json:"name"`       // Ingress名称
}

DeleteIngressReq 删除Ingress请求

type DeleteLabelNodesReq

type DeleteLabelNodesReq struct {
	ClusterID int      `json:"cluster_id" binding:"required"` // 集群ID
	NodeName  string   `json:"node_name" binding:"required"`  // 节点名称
	LabelKeys []string `json:"label_keys" binding:"required"` // 要删除的标签键
}

DeleteLabelNodesReq 删除节点标签请求

type DeleteMonitorAlertManagerPoolReq

type DeleteMonitorAlertManagerPoolReq struct {
	ID int `json:"id" form:"id" binding:"required"`
}

DeleteMonitorAlertManagerPoolReq 删除AlertManager实例池请求

type DeleteMonitorAlertRuleReq

type DeleteMonitorAlertRuleReq struct {
	ID int `json:"id" form:"id" binding:"required"`
}

DeleteMonitorAlertRuleReq 删除告警规则请求

type DeleteMonitorConfigReq

type DeleteMonitorConfigReq struct {
	ID int `json:"id" form:"id" binding:"required"`
}

DeleteMonitorConfigReq 删除监控配置请求

type DeleteMonitorOnDutyGroupReq

type DeleteMonitorOnDutyGroupReq struct {
	ID int `json:"id" binding:"required"`
}

DeleteMonitorOnDutyGroupReq 删除值班组请求

type DeleteMonitorRecordRuleReq

type DeleteMonitorRecordRuleReq struct {
	ID int `json:"id" form:"id" binding:"required"`
}

DeleteMonitorRecordRuleReq 删除记录规则请求

type DeleteMonitorScrapeJobReq

type DeleteMonitorScrapeJobReq struct {
	ID int `json:"id" form:"id" binding:"required"`
}

type DeleteMonitorScrapePoolReq

type DeleteMonitorScrapePoolReq struct {
	ID int `json:"id" form:"id" binding:"required"`
}

type DeleteMonitorSendGroupReq

type DeleteMonitorSendGroupReq struct {
	ID int `json:"id" form:"id" binding:"required"`
}

DeleteMonitorSendGroupReq 删除发送组请求

type DeleteNodeTaintsReq

type DeleteNodeTaintsReq struct {
	ClusterID int      `json:"cluster_id" binding:"required"` // 集群ID
	NodeName  string   `json:"node_name" binding:"required"`  // 节点名称
	TaintKeys []string `json:"taint_keys" binding:"required"` // 要删除的污点键
}

DeleteNodeTaintsReq 删除节点污点请求

type DeletePVCReq

type DeletePVCReq struct {
	ClusterID int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	Namespace string `json:"namespace" form:"namespace" binding:"required" comment:"命名空间"`   // 命名空间
	Name      string `json:"name" binding:"required" comment:"PVC名称"`                        // PVC名称
}

DeletePVCReq 删除PVC请求

type DeletePVReq

type DeletePVReq struct {
	ClusterID          int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	Name               string `json:"name" form:"name" binding:"required" comment:"PV名称"`             // PV名称
	GracePeriodSeconds *int64 `json:"grace_period_seconds" comment:"优雅删除时间(秒)"`                       // 优雅删除时间(秒)
	Force              bool   `json:"force" comment:"是否强制删除"`                                         // 是否强制删除
}

DeletePVReq 删除PV请求

type DeletePodReq

type DeletePodReq struct {
	ClusterID          int    `json:"cluster_id" binding:"required"` // 集群ID
	Namespace          string `json:"namespace" binding:"required"`  // 命名空间
	Name               string `json:"name" binding:"required"`       // Pod名称
	GracePeriodSeconds *int64 `json:"grace_period_seconds"`          // 优雅删除时间(秒)
	Force              bool   `json:"force"`                         // 是否强制删除
}

DeletePodReq 删除Pod请求

type DeleteRoleBindingReq

type DeleteRoleBindingReq struct {
	ClusterID int    `json:"cluster_id" binding:"required" comment:"集群ID"`
	Namespace string `json:"namespace" binding:"required" comment:"命名空间"`
	Name      string `json:"name" binding:"required" comment:"RoleBinding名称"`
}

DeleteRoleBindingReq 删除RoleBinding请求

type DeleteRoleReq

type DeleteRoleReq struct {
	ClusterID int    `json:"cluster_id" binding:"required" comment:"集群ID"`
	Namespace string `json:"namespace" binding:"required" comment:"命名空间"`
	Name      string `json:"name" binding:"required" comment:"Role名称"`
}

DeleteRoleReq 删除Role请求

type DeleteRoleRequest

type DeleteRoleRequest struct {
	ID int `json:"id" form:"id" binding:"required,gt=0"` // 角色ID
}

DeleteRoleRequest 删除角色请求结构体

type DeleteSecretReq

type DeleteSecretReq struct {
	ClusterID int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	Namespace string `json:"namespace" form:"namespace" binding:"required" comment:"命名空间"`   // 命名空间
	Name      string `json:"name" binding:"required" comment:"Secret名称"`                     // Secret名称
}

DeleteSecretReq 删除Secret请求

type DeleteServiceAccountReq

type DeleteServiceAccountReq struct {
	ClusterID int    `json:"cluster_id" binding:"required" comment:"集群ID"`
	Namespace string `json:"namespace" binding:"required" comment:"命名空间"`
	Name      string `json:"name" binding:"required" comment:"ServiceAccount名称"`
}

DeleteServiceAccountReq 删除ServiceAccount请求

type DeleteServiceReq

type DeleteServiceReq struct {
	ClusterID int    `json:"cluster_id"` // 集群ID
	Namespace string `json:"namespace"`  // 命名空间
	Name      string `json:"name"`       // Service名称
}

DeleteServiceReq 删除Service请求

type DeleteStatefulSetReq

type DeleteStatefulSetReq struct {
	ClusterID int    `json:"cluster_id"` // 集群ID
	Namespace string `json:"namespace"`  // 命名空间
	Name      string `json:"name"`       // StatefulSet名称
}

DeleteStatefulSetReq 删除StatefulSet请求

type DeleteTreeLocalResourceReq

type DeleteTreeLocalResourceReq struct {
	ID int `json:"id" form:"id"`
}

DeleteTreeLocalReq 删除本地树资源请求

type DeleteTreeNodeReq

type DeleteTreeNodeReq struct {
	ID int `json:"id" binding:"required"`
}

DeleteTreeNodeReq 删除节点请求

type DeleteUserReq

type DeleteUserReq struct {
	ID int `json:"id" form:"id" binding:"required"` // 用户ID
}

DeleteUserReq 删除用户请求

type DeleteWorkorderCategoryReq

type DeleteWorkorderCategoryReq struct {
	ID int `json:"id" form:"id" binding:"required,min=1"`
}

DeleteWorkorderCategoryReq 删除工单分类请求

type DeleteWorkorderFormDesignReq

type DeleteWorkorderFormDesignReq struct {
	ID int `json:"id" form:"id" binding:"required,min=1"`
}

DeleteWorkorderFormDesignReq 删除工单表单设计请求

type DeleteWorkorderInstanceCommentReq

type DeleteWorkorderInstanceCommentReq struct {
	ID int `json:"id" form:"id" binding:"required,min=1"`
}

DeleteWorkorderInstanceCommentReq 删除工单实例评论请求

type DeleteWorkorderInstanceReq

type DeleteWorkorderInstanceReq struct {
	ID int `json:"id" form:"id" binding:"required,min=1"`
}

删除工单请求

type DeleteWorkorderInstanceTimelineReq

type DeleteWorkorderInstanceTimelineReq struct {
	ID int `json:"id" form:"id" binding:"required,min=1"`
}

DeleteWorkorderInstanceTimelineReq 删除工单实例时间线请求

type DeleteWorkorderNotificationReq

type DeleteWorkorderNotificationReq struct {
	ID int `json:"id" binding:"required"`
}

DeleteWorkorderNotificationReq 删除通知配置

type DeleteWorkorderProcessReq

type DeleteWorkorderProcessReq struct {
	ID int `json:"id" form:"id" binding:"required,min=1"`
}

DeleteWorkorderProcessReq 删除工单流程请求

type DeleteWorkorderTemplateReq

type DeleteWorkorderTemplateReq struct {
	ID int `json:"id" form:"id" binding:"required,min=1"`
}

DeleteWorkorderTemplateReq 删除工单模板请求

type DeploymentCondition

type DeploymentCondition struct {
	Type               string    `json:"type"`                 // 条件类型
	Status             string    `json:"status"`               // 条件状态
	LastUpdateTime     time.Time `json:"last_update_time"`     // 最后更新时间
	LastTransitionTime time.Time `json:"last_transition_time"` // 最后转换时间
	Reason             string    `json:"reason"`               // 原因
	Message            string    `json:"message"`              // 消息
}

DeploymentCondition Deployment条件

type DeploymentSpec

type DeploymentSpec struct {
	Replicas                *int32                     `json:"replicas"`                            // 副本数量
	Selector                *metav1.LabelSelector      `json:"selector"`                            // 标签选择器
	Template                *corev1.PodTemplateSpec    `json:"template"`                            // Pod模板
	Strategy                *appsv1.DeploymentStrategy `json:"strategy,omitempty"`                  // 部署策略
	MinReadySeconds         *int32                     `json:"min_ready_seconds,omitempty"`         // 最小就绪时间
	RevisionHistoryLimit    *int32                     `json:"revision_history_limit,omitempty"`    // 历史版本限制
	Paused                  *bool                      `json:"paused,omitempty"`                    // 是否暂停
	ProgressDeadlineSeconds *int32                     `json:"progress_deadline_seconds,omitempty"` // 进度截止时间
}

DeploymentSpec 创建/更新Deployment时的配置信息

type DetailWorkorderCategoryReq

type DetailWorkorderCategoryReq struct {
	ID int `json:"id" form:"id" binding:"required,min=1"`
}

DetailWorkorderCategoryReq 获取工单分类详情请求

type DetailWorkorderFormDesignReq

type DetailWorkorderFormDesignReq struct {
	ID int `json:"id" form:"id" binding:"required,min=1"`
}

DetailWorkorderFormDesignReq 获取工单表单设计详情请求

type DetailWorkorderInstanceCommentReq

type DetailWorkorderInstanceCommentReq struct {
	ID int `json:"id" form:"id" binding:"required,min=1"`
}

DetailWorkorderInstanceCommentReq 获取工单实例评论详情请求

type DetailWorkorderInstanceFlowReq

type DetailWorkorderInstanceFlowReq struct {
	ID int `json:"id" form:"id" binding:"required,min=1"`
}

DetailWorkorderInstanceFlowReq 获取工单流转记录详情请求

type DetailWorkorderInstanceReq

type DetailWorkorderInstanceReq struct {
	ID int `json:"id" form:"id" binding:"required,min=1"`
}

工单详情请求

type DetailWorkorderInstanceTimelineReq

type DetailWorkorderInstanceTimelineReq struct {
	ID int `json:"id" form:"id" binding:"required,min=1"`
}

DetailWorkorderInstanceTimelineReq 获取工单实例时间线详情请求

type DetailWorkorderNotificationReq

type DetailWorkorderNotificationReq struct {
	ID int `json:"id" binding:"required"`
}

DetailWorkorderNotificationReq 通知配置详情

type DetailWorkorderProcessReq

type DetailWorkorderProcessReq struct {
	ID int `json:"id" form:"id" binding:"required,min=1"`
}

DetailWorkorderProcessReq 获取工单流程详情请求

type DetailWorkorderTemplateReq

type DetailWorkorderTemplateReq struct {
	ID int `json:"id" form:"id" binding:"required,min=1"`
}

DetailWorkorderTemplateReq 获取工单模板详情请求

type DrainNodeReq

type DrainNodeReq struct {
	ClusterID          int    `json:"cluster_id" binding:"required"`                   // 集群ID
	NodeName           string `json:"node_name" binding:"required"`                    // 节点名称
	Force              int8   `json:"force" binding:"required,oneof=1 2"`              // 是否强制驱逐
	IgnoreDaemonSets   int8   `json:"ignore_daemon_sets" binding:"required,oneof=1 2"` // 是否忽略DaemonSet
	DeleteLocalData    int8   `json:"delete_local_data" binding:"required,oneof=1 2"`  // 是否删除本地数据
	GracePeriodSeconds int    `json:"grace_period_seconds"`                            // 优雅关闭时间(秒)
	TimeoutSeconds     int    `json:"timeout_seconds"`                                 // 超时时间(秒)
}

DrainNodeReq 驱逐节点请求

type EffectivePermissions

type EffectivePermissions struct {
	Subject     Subject             `json:"subject"`
	ClusterID   int                 `json:"cluster_id"`
	Permissions map[string][]string `json:"permissions"` // resource -> verbs
	Sources     []PermissionSource  `json:"sources"`     // 权限来源
}

EffectivePermissions 有效权限

type EnableSwitchMonitorAlertRuleReq

type EnableSwitchMonitorAlertRuleReq struct {
	ID int `json:"id" form:"id" binding:"required"`
}

EnableSwitchMonitorAlertRuleReq 启用/禁用监控告警规则请求

type EnableSwitchMonitorRecordRuleReq

type EnableSwitchMonitorRecordRuleReq struct {
	ID int `json:"id" form:"id" binding:"required"`
}

EnableSwitchMonitorRecordRuleReq 启用/禁用监控记录规则请求

type EndpointCondition

type EndpointCondition struct {
	Type               string    `json:"type"`                 // 条件类型
	Status             string    `json:"status"`               // 条件状态
	LastTransitionTime time.Time `json:"last_transition_time"` // 最后转换时间
	Reason             string    `json:"reason"`               // 原因
	Message            string    `json:"message"`              // 消息
}

EndpointCondition 端点条件

type EndpointPort

type EndpointPort struct {
	Name        string          `json:"name"`         // 端口名称
	Port        int32           `json:"port"`         // 端口号
	Protocol    corev1.Protocol `json:"protocol"`     // 协议
	AppProtocol *string         `json:"app_protocol"` // 应用协议
}

EndpointPort 端点端口信息

type EndpointTargetRef

type EndpointTargetRef struct {
	Kind            string `json:"kind"`             // 资源类型
	Namespace       string `json:"namespace"`        // 命名空间
	Name            string `json:"name"`             // 资源名称
	UID             string `json:"uid"`              // 资源UID
	APIVersion      string `json:"api_version"`      // API版本
	ResourceVersion string `json:"resource_version"` // 资源版本
}

EndpointTargetRef 端点目标引用

type Env

type Env int8
const (
	EnvProd  Env = iota + 1 // 生产环境
	EnvDev                  // 开发环境
	EnvStage                // 预发环境
	EnvRc                   // 测试环境
	EnvPress                // 灰度环境
)

type EventAlertClaimReq

type EventAlertClaimReq struct {
	ID     int `json:"id" binding:"required"`
	UserID int `json:"user_id" binding:"required"`
}

EventAlertClaimReq 告警认领请求

type EventAlertSilenceReq

type EventAlertSilenceReq struct {
	ID      int    `json:"id" binding:"required"`
	UserID  int    `json:"user_id" binding:"required"`
	UseName int8   `json:"use_name" binding:"omitempty,oneof=1 2"` // 是否启用名称静默
	Time    string `json:"time" binding:"required"`
}

EventAlertSilenceReq 告警静默请求

type EventAlertUnSilenceReq

type EventAlertUnSilenceReq struct {
	ID     int `json:"id" binding:"required"`
	UserID int `json:"user_id" binding:"required"`
}

EventAlertUnSilenceReq 告警取消静默请求

type EventGroupData

type EventGroupData struct {
	Group  string     `json:"group"`            // 分组名称
	Count  int64      `json:"count"`            // 计数
	Events []K8sEvent `json:"events,omitempty"` // 可选:包含该组的事件样本
}

EventGroupData 分组数据

type EventReason

type EventReason int8

EventReason 事件原因

const (
	EventReasonBackOff EventReason = iota + 1
	EventReasonPulled
	EventReasonCreated
	EventReasonDeleted
	EventReasonUpdated
	EventRestarted
	EventReasonStarted
	EventReasonStopped
	EventReasonFailed
	EventReasonSucceeded
	EventReasonUnknown
	EventReasonWarning
	EventReasonError
	EventReasonFatal
	EventReasonPanic
	EventReasonTimeout
	EventReasonCancelled
	EventReasonInterrupted
	EventReasonAborted
	EventReasonIgnored
	EventReasonOther
)

type EventSeverity

type EventSeverity string

EventSeverity 事件严重程度

const (
	EventSeverityLow      EventSeverity = "Low"
	EventSeverityMedium   EventSeverity = "Medium"
	EventSeverityHigh     EventSeverity = "High"
	EventSeverityCritical EventSeverity = "Critical"
)

type EventSource

type EventSource struct {
	Component string `json:"component"` // kubelet, controller-manager等
	Host      string `json:"host"`      // 节点名称
}

EventSource 事件源信息

type EventStatistics

type EventStatistics struct {
	TimeRange TimeRange        `json:"time_range"`       // 时间范围
	Summary   EventSummary     `json:"summary"`          // 汇总信息
	GroupData []EventGroupData `json:"group_data"`       // 分组数据
	Trends    []EventTrend     `json:"trends,omitempty"` // 趋势数据
}

EventStatistics 事件统计

type EventSummary

type EventSummary struct {
	TotalEvents   int64            `json:"total_events"`   // 总事件数
	UniqueEvents  int64            `json:"unique_events"`  // 唯一事件数
	WarningEvents int64            `json:"warning_events"` // 警告事件数
	NormalEvents  int64            `json:"normal_events"`  // 正常事件数
	Distribution  map[string]int64 `json:"distribution"`   // 按severity分布
	TopReasons    []CountItem      `json:"top_reasons"`    // 热门原因
	TopObjects    []CountItem      `json:"top_objects"`    // 热门对象
}

EventSummary 事件汇总

type EventTimeline

type EventTimeline struct {
	Object   InvolvedObject      `json:"object"`   // 涉及对象
	Timeline []EventTimelineItem `json:"timeline"` // 时间线
}

EventTimeline 事件时间线

type EventTimelineItem

type EventTimelineItem struct {
	Timestamp time.Time `json:"timestamp"` // 时间戳
	Type      string    `json:"type"`      // 类型
	Reason    string    `json:"reason"`    // 原因
	Message   string    `json:"message"`   // 消息
	Count     int64     `json:"count"`     // 计数
}

EventTimelineItem 时间线项

type EventTrend

type EventTrend struct {
	Timestamp time.Time `json:"timestamp"`      // 时间戳
	Count     int64     `json:"count"`          // 计数
	Type      string    `json:"type,omitempty"` // 类型
}

EventTrend 事件趋势

type EventType

type EventType int8

EventType 事件类型

const (
	EventTypeNormal EventType = iota + 1
	EventTypeWarning
)

type ExpandPVCReq

type ExpandPVCReq struct {
	ClusterID   int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	Namespace   string `json:"namespace" form:"namespace" binding:"required" comment:"命名空间"`   // 命名空间
	Name        string `json:"name" form:"name" binding:"required" comment:"PVC名称"`            // PVC名称
	NewCapacity string `json:"new_capacity" binding:"required" comment:"新容量"`                  // 新容量
}

ExpandPVCReq 扩容PVC请求

type FormField

type FormField struct {
	ID          string   `json:"id"`                       // 字段唯一标识
	Name        string   `json:"name" binding:"required"`  // 字段名称
	Type        string   `json:"type" binding:"required"`  // 字段类型
	Label       string   `json:"label" binding:"required"` // 字段标签
	Required    int8     `json:"required"`                 // 是否必填
	Placeholder string   `json:"placeholder"`              // 占位符
	Default     any      `json:"default"`                  // 默认值
	Options     []string `json:"options,omitempty"`        // 选项(如下拉、单选等)
}

FormField 表单字段定义

type FormSchema

type FormSchema struct {
	Fields []FormField `json:"fields" binding:"required"` // 字段列表
}

FormSchema 表单结构定义

type GetApiRequest

type GetApiRequest struct {
	ID int `json:"id" binding:"required,gt=0"` // API ID
}

type GetAuditLogDetailRequest

type GetAuditLogDetailRequest struct {
	ID int `json:"id" binding:"required"`
}

type GetAvailableActionsReq

type GetAvailableActionsReq struct {
	ID int `json:"id" form:"id" binding:"required,min=1"`
}

type GetClusterReq

type GetClusterReq struct {
	ID int `json:"id" form:"id" uri:"id" binding:"required" comment:"集群ID"`
}

GetClusterReq 获取单个集群请求

type GetClusterRoleBindingDetailsReq

type GetClusterRoleBindingDetailsReq struct {
	ClusterID int    `json:"cluster_id" binding:"required" comment:"集群ID"`
	Name      string `json:"name" binding:"required" comment:"ClusterRoleBinding名称"`
}

GetClusterRoleBindingDetailsReq 获取ClusterRoleBinding详情请求

type GetClusterRoleBindingListReq

type GetClusterRoleBindingListReq struct {
	ClusterID int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"`
	Keyword   string `json:"keyword" form:"keyword" comment:"关键字搜索"`
	Page      int    `json:"page" form:"page" comment:"页码"`
	PageSize  int    `json:"page_size" form:"page_size" comment:"页面大小"`
}

GetClusterRoleBindingListReq 获取ClusterRoleBinding列表请求

type GetClusterRoleBindingYamlReq

type GetClusterRoleBindingYamlReq struct {
	ClusterID int    `json:"cluster_id" binding:"required" comment:"集群ID"`
	Name      string `json:"name" binding:"required" comment:"ClusterRoleBinding名称"`
}

GetClusterRoleBindingYamlReq 获取ClusterRoleBinding YAML请求

type GetClusterRoleDetailsReq

type GetClusterRoleDetailsReq struct {
	ClusterID int    `json:"cluster_id" binding:"required" comment:"集群ID"`
	Name      string `json:"name" binding:"required" comment:"ClusterRole名称"`
}

GetClusterRoleDetailsReq 获取ClusterRole详情请求

type GetClusterRoleListReq

type GetClusterRoleListReq struct {
	ClusterID int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"`
	Keyword   string `json:"keyword" form:"keyword" comment:"关键字搜索"`
	Page      int    `json:"page" form:"page" comment:"页码"`
	PageSize  int    `json:"page_size" form:"page_size" comment:"页面大小"`
}

GetClusterRoleListReq 获取ClusterRole列表请求

type GetClusterRoleYamlReq

type GetClusterRoleYamlReq struct {
	ClusterID int    `json:"cluster_id" binding:"required" comment:"集群ID"`
	Name      string `json:"name" binding:"required" comment:"ClusterRole名称"`
}

GetClusterRoleYamlReq 获取ClusterRole YAML请求

type GetConfigMapDetailsReq

type GetConfigMapDetailsReq struct {
	ClusterID int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	Namespace string `json:"namespace" form:"namespace" binding:"required" comment:"命名空间"`   // 命名空间
	Name      string `json:"name" form:"name" binding:"required" comment:"ConfigMap名称"`      // ConfigMap名称
}

GetConfigMapDetailsReq 获取ConfigMap详情请求

type GetConfigMapListReq

type GetConfigMapListReq struct {
	ListReq
	ClusterID int               `json:"cluster_id" form:"cluster_id" comment:"集群ID"` // 集群ID
	Namespace string            `json:"namespace" form:"namespace" comment:"命名空间"`   // 命名空间
	Labels    map[string]string `json:"labels" form:"labels" comment:"标签"`           // 标签
}

GetConfigMapListReq 获取ConfigMap列表请求

type GetConfigMapYamlReq

type GetConfigMapYamlReq struct {
	ClusterID int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	Namespace string `json:"namespace" form:"namespace" binding:"required" comment:"命名空间"`   // 命名空间
	Name      string `json:"name" form:"name" binding:"required" comment:"ConfigMap名称"`      // ConfigMap名称
}

GetConfigMapYamlReq 获取ConfigMap YAML请求

type GetCronJobListReq

type GetCronJobListReq struct {
	ListReq
	Status  *CronJobStatus `json:"status" form:"status" binding:"omitempty,oneof=1 2 3 4"`
	JobType *CronJobType   `json:"job_type" form:"job_type" binding:"omitempty,oneof=1 2 3 4 5"`
	Search  string         `json:"search" form:"search"`
}

GetCronJobListReq 获取定时任务列表请求

type GetCurrentStepReq

type GetCurrentStepReq struct {
	ID int `json:"id" form:"id" binding:"required,min=1"`
}

type GetDaemonSetDetailsReq

type GetDaemonSetDetailsReq struct {
	ClusterID int    `json:"cluster_id"` // 集群ID
	Namespace string `json:"namespace"`  // 命名空间
	Name      string `json:"name"`       // DaemonSet名称
}

GetDaemonSetDetailsReq 获取DaemonSet详情请求

type GetDaemonSetHistoryReq

type GetDaemonSetHistoryReq struct {
	ClusterID int    `json:"cluster_id"` // 集群ID
	Namespace string `json:"namespace"`  // 命名空间
	Name      string `json:"name"`       // DaemonSet名称
}

GetDaemonSetHistoryReq 获取DaemonSet版本历史请求

type GetDaemonSetListReq

type GetDaemonSetListReq struct {
	ListReq
	ClusterID int               `json:"cluster_id" form:"cluster_id"` // 集群ID
	Namespace string            `json:"namespace" form:"namespace"`   // 命名空间
	Status    string            `json:"status" form:"status"`         // DaemonSet状态
	Labels    map[string]string `json:"labels" form:"labels"`         // 标签
}

GetDaemonSetListReq 获取DaemonSet列表请求

type GetDaemonSetPodsReq

type GetDaemonSetPodsReq struct {
	ClusterID int    `json:"cluster_id"` // 集群ID
	Namespace string `json:"namespace"`  // 命名空间
	Name      string `json:"name"`       // DaemonSet名称
}

GetDaemonSetPodsReq 获取DaemonSet下的Pod列表请求

type GetDaemonSetYamlReq

type GetDaemonSetYamlReq struct {
	ClusterID int    `json:"cluster_id"` // 集群ID
	Namespace string `json:"namespace"`  // 命名空间
	Name      string `json:"name"`       // DaemonSet名称
}

GetDaemonSetYamlReq 获取DaemonSet YAML请求

type GetDeploymentDetailsReq

type GetDeploymentDetailsReq struct {
	ClusterID int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	Namespace string `json:"namespace" form:"namespace" binding:"required" comment:"命名空间"`   // 命名空间
	Name      string `json:"name" form:"name" binding:"required" comment:"Deployment名称"`     // Deployment名称
}

GetDeploymentDetailsReq 获取Deployment详情请求

type GetDeploymentHistoryReq

type GetDeploymentHistoryReq struct {
	ClusterID int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	Namespace string `json:"namespace" form:"namespace" binding:"required" comment:"命名空间"`   // 命名空间
	Name      string `json:"name" form:"name" binding:"required" comment:"Deployment名称"`     // Deployment名称
}

GetDeploymentHistoryReq 获取Deployment版本历史请求

type GetDeploymentListReq

type GetDeploymentListReq struct {
	ListReq
	ClusterID int               `json:"cluster_id" form:"cluster_id" comment:"集群ID"` // 集群ID
	Namespace string            `json:"namespace" form:"namespace" comment:"命名空间"`   // 命名空间
	Status    string            `json:"status" form:"status" comment:"Deployment状态"` // Deployment状态
	Labels    map[string]string `json:"labels" form:"labels" comment:"标签"`           // 标签
}

GetDeploymentListReq 获取Deployment列表请求

type GetDeploymentPodsReq

type GetDeploymentPodsReq struct {
	ClusterID int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	Namespace string `json:"namespace" form:"namespace" binding:"required" comment:"命名空间"`   // 命名空间
	Name      string `json:"name" form:"name" binding:"required" comment:"Deployment名称"`     // Deployment名称
}

GetDeploymentPodsReq 获取Deployment下的Pod列表请求

type GetDeploymentYamlReq

type GetDeploymentYamlReq struct {
	ClusterID int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	Namespace string `json:"namespace" form:"namespace" binding:"required" comment:"命名空间"`   // 命名空间
	Name      string `json:"name" form:"name" binding:"required" comment:"Deployment名称"`     // Deployment名称
}

GetDeploymentYamlReq 获取Deployment YAML请求

type GetEventDetailReq

type GetEventDetailReq struct {
	ClusterID int    `json:"cluster_id" binding:"required" comment:"集群ID"`
	Namespace string `json:"namespace" binding:"required" comment:"命名空间"`
	Name      string `json:"name" binding:"required" comment:"事件名称"`
}

GetEventDetailReq 获取事件详情请求

type GetEventGroupDataReq

type GetEventGroupDataReq struct {
	ClusterID int       `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"`
	Namespace string    `json:"namespace" form:"namespace" comment:"命名空间"`
	GroupBy   string    `json:"group_by" form:"group_by" binding:"required" comment:"分组方式:type,reason,object,severity"`
	StartTime time.Time `json:"start_time" form:"start_time" comment:"开始时间"`
	EndTime   time.Time `json:"end_time" form:"end_time" comment:"结束时间"`
	Limit     int       `json:"limit" form:"limit" comment:"限制结果数量"`
}

GetEventGroupDataReq 获取事件分组数据请求

type GetEventListReq

type GetEventListReq struct {
	ClusterID          int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"`
	Namespace          string `json:"namespace" form:"namespace" comment:"命名空间"`
	LabelSelector      string `json:"label_selector" form:"label_selector" comment:"标签选择器"`
	FieldSelector      string `json:"field_selector" form:"field_selector" comment:"字段选择器"`
	EventType          string `json:"event_type" form:"event_type" comment:"事件类型:Normal,Warning"`
	Reason             string `json:"reason" form:"reason" comment:"事件原因"`
	Source             string `json:"source" form:"source" comment:"事件源组件"`
	InvolvedObjectKind string `json:"involved_object_kind" form:"involved_object_kind" comment:"涉及对象类型"`
	InvolvedObjectName string `json:"involved_object_name" form:"involved_object_name" comment:"涉及对象名称"`
	LimitDays          int    `json:"limit_days" form:"limit_days" comment:"限制天数"`
	Limit              int64  `json:"limit" form:"limit" comment:"限制结果数量"`
	Continue           string `json:"continue" form:"continue" comment:"分页续订令牌"`
}

GetEventListReq 获取事件列表请求

type GetEventStatisticsReq

type GetEventStatisticsReq struct {
	ClusterID int       `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"`
	Namespace string    `json:"namespace" form:"namespace" comment:"命名空间"`
	StartTime time.Time `json:"start_time" form:"start_time" comment:"开始时间"`
	EndTime   time.Time `json:"end_time" form:"end_time" comment:"结束时间"`
	GroupBy   string    `json:"group_by" form:"group_by" comment:"分组方式:type,reason,object,severity"`
}

GetEventStatisticsReq 获取事件统计请求

type GetEventSummaryReq

type GetEventSummaryReq struct {
	ClusterID int       `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"`
	Namespace string    `json:"namespace" form:"namespace" comment:"命名空间"`
	StartTime time.Time `json:"start_time" form:"start_time" comment:"开始时间"`
	EndTime   time.Time `json:"end_time" form:"end_time" comment:"结束时间"`
}

GetEventSummaryReq 获取事件汇总请求

type GetEventTimelineReq

type GetEventTimelineReq struct {
	ClusterID  int       `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"`
	Namespace  string    `json:"namespace" form:"namespace" binding:"required" comment:"命名空间"`
	ObjectKind string    `json:"object_kind" form:"object_kind" binding:"required" comment:"对象类型"`
	ObjectName string    `json:"object_name" form:"object_name" binding:"required" comment:"对象名称"`
	StartTime  time.Time `json:"start_time" form:"start_time" comment:"开始时间"`
	EndTime    time.Time `json:"end_time" form:"end_time" comment:"结束时间"`
}

GetEventTimelineReq 获取事件时间线请求

type GetEventTrendsReq

type GetEventTrendsReq struct {
	ClusterID int       `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"`
	Namespace string    `json:"namespace" form:"namespace" comment:"命名空间"`
	StartTime time.Time `json:"start_time" form:"start_time" comment:"开始时间"`
	EndTime   time.Time `json:"end_time" form:"end_time" comment:"结束时间"`
	Interval  string    `json:"interval" form:"interval" comment:"时间间隔:1m,5m,15m,1h,1d"`
	EventType string    `json:"event_type" form:"event_type" comment:"事件类型:Normal,Warning"`
}

GetEventTrendsReq 获取事件趋势请求

type GetEventsByDeploymentReq

type GetEventsByDeploymentReq struct {
	ClusterID      int    `json:"cluster_id" binding:"required" comment:"集群ID"`
	Namespace      string `json:"namespace" binding:"required" comment:"命名空间"`
	DeploymentName string `json:"deployment_name" binding:"required" comment:"Deployment名称"`
}

GetEventsByDeploymentReq 获取Deployment相关事件请求

type GetEventsByNodeReq

type GetEventsByNodeReq struct {
	ClusterID int    `json:"cluster_id" binding:"required" comment:"集群ID"`
	NodeName  string `json:"node_name" binding:"required" comment:"Node名称"`
}

GetEventsByNodeReq 获取Node相关事件请求

type GetEventsByPodReq

type GetEventsByPodReq struct {
	ClusterID int    `json:"cluster_id" binding:"required" comment:"集群ID"`
	Namespace string `json:"namespace" binding:"required" comment:"命名空间"`
	PodName   string `json:"pod_name" binding:"required" comment:"Pod名称"`
}

GetEventsByPodReq 获取Pod相关事件请求

type GetEventsByServiceReq

type GetEventsByServiceReq struct {
	ClusterID   int    `json:"cluster_id" binding:"required" comment:"集群ID"`
	Namespace   string `json:"namespace" binding:"required" comment:"命名空间"`
	ServiceName string `json:"service_name" binding:"required" comment:"Service名称"`
}

GetEventsByServiceReq 获取Service相关事件请求

type GetIngressDetailsReq

type GetIngressDetailsReq struct {
	ClusterID int    `json:"cluster_id"` // 集群ID
	Namespace string `json:"namespace"`  // 命名空间
	Name      string `json:"name"`       // Ingress名称
}

GetIngressDetailsReq 获取Ingress详情请求

type GetIngressListReq

type GetIngressListReq struct {
	ListReq
	ClusterID int               `json:"cluster_id" form:"cluster_id"` // 集群ID
	Namespace string            `json:"namespace" form:"namespace"`   // 命名空间
	Status    string            `json:"status" form:"status"`         // 状态过滤
	Labels    map[string]string `json:"labels" form:"labels"`         // 标签
}

GetIngressListReq Ingress列表请求

type GetIngressYamlReq

type GetIngressYamlReq struct {
	ClusterID int    `json:"cluster_id"` // 集群ID
	Namespace string `json:"namespace"`  // 命名空间
	Name      string `json:"name"`       // Ingress名称
}

GetIngressYamlReq 获取Ingress YAML请求

type GetInstanceCommentsTreeReq

type GetInstanceCommentsTreeReq struct {
	ID int `json:"id" form:"id" binding:"required,min=1"`
}

GetInstanceCommentsTreeReq 获取工单实例评论树请求

type GetMonitorAlertEventListReq

type GetMonitorAlertEventListReq struct {
	ListReq
	Status    MonitorAlertEventStatus `json:"status" form:"status" binding:"omitempty,oneof=1 2 3 4"`
	StartTime string                  `json:"start_time" form:"start_time" binding:"omitempty"`
	EndTime   string                  `json:"end_time" form:"end_time" binding:"omitempty"`
}

GetMonitorAlertEventListReq 获取告警事件列表请求

type GetMonitorAlertManagerPoolListReq

type GetMonitorAlertManagerPoolListReq struct {
	ListReq
}

GetMonitorAlertManagerPoolListReq 获取AlertManager实例池列表请求

type GetMonitorAlertManagerPoolReq

type GetMonitorAlertManagerPoolReq struct {
	ID int `json:"id" form:"id" binding:"required"`
}

GetMonitorAlertManagerPoolReq 获取AlertManager实例池详情请求

type GetMonitorAlertRuleListReq

type GetMonitorAlertRuleListReq struct {
	ListReq
	Enable   *int8              `json:"enable" form:"enable" binding:"omitempty,oneof=1 2"`
	Severity *AlertRuleSeverity `json:"severity" form:"severity" binding:"omitempty,oneof=1 2 3"`
}

GetMonitorAlertRuleListReq 获取告警规则列表的请求

type GetMonitorAlertRuleReq

type GetMonitorAlertRuleReq struct {
	ID int `json:"id" form:"id" binding:"required"`
}

GetMonitorAlertRuleReq 获取告警规则请求

type GetMonitorConfigByInstanceReq

type GetMonitorConfigByInstanceReq struct {
	InstanceIP string `json:"instance_ip" form:"instance_ip" binding:"required"`
	ConfigType int8   `json:"config_type" form:"config_type" binding:"required,oneof=1 2 3 4 5"`
}

GetMonitorConfigByInstanceReq 通过实例获取监控配置请求

type GetMonitorConfigListReq

type GetMonitorConfigListReq struct {
	ListReq
	ConfigType *int8 `json:"config_type" form:"config_type" binding:"omitempty,oneof=1 2 3 4 5"`
	Status     *int8 `json:"status" form:"status" binding:"omitempty,oneof=1 2"`
}

GetMonitorConfigListReq 获取监控配置列表请求

type GetMonitorConfigReq

type GetMonitorConfigReq struct {
	ID int `json:"id" form:"id" binding:"required"`
}

GetMonitorConfigReq 获取单个监控配置请求

type GetMonitorOnDutyGroupChangeListReq

type GetMonitorOnDutyGroupChangeListReq struct {
	ListReq
	OnDutyGroupID int `json:"on_duty_group_id" form:"on_duty_group_id" binding:"required"`
}

GetMonitorOnDutyGroupChangeListReq 获取值班组换班记录列表请求

type GetMonitorOnDutyGroupFuturePlanReq

type GetMonitorOnDutyGroupFuturePlanReq struct {
	ID        int    `json:"id" form:"id" binding:"required"`
	StartTime string `json:"start_time" form:"start_time" binding:"required"`
	EndTime   string `json:"end_time" form:"end_time" binding:"required"`
}

GetMonitorOnDutyGroupFuturePlanReq 获取值班组未来计划请求

type GetMonitorOnDutyGroupListReq

type GetMonitorOnDutyGroupListReq struct {
	ListReq
	Enable *int8 `json:"enable" form:"enable" binding:"omitempty,oneof=1 2"`
}

GetMonitorOnDutyGroupListReq 获取值班组列表请求

type GetMonitorOnDutyGroupReq

type GetMonitorOnDutyGroupReq struct {
	ID int `json:"id" binding:"required"`
}

GetMonitorOnDutyGroupReq 获取指定值班组信息请求

type GetMonitorOnDutyHistoryReq

type GetMonitorOnDutyHistoryReq struct {
	ListReq
	OnDutyGroupID int    `json:"on_duty_group_id" form:"on_duty_group_id" binding:"required"`
	StartDate     string `json:"start_date" form:"start_date"`
	EndDate       string `json:"end_date" form:"end_date"`
}

GetMonitorOnDutyHistoryReq 获取值班历史记录请求

type GetMonitorRecordRuleListReq

type GetMonitorRecordRuleListReq struct {
	ListReq
	PoolID *int  `json:"pool_id" form:"pool_id" binding:"omitempty"`
	Enable *int8 `json:"enable" form:"enable" binding:"omitempty,oneof=1 2"`
}

GetMonitorRecordRuleListReq 获取记录规则列表的请求

type GetMonitorRecordRuleReq

type GetMonitorRecordRuleReq struct {
	ID int `json:"id" form:"id" binding:"required"`
}

GetMonitorRecordRuleReq 获取记录规则请求

type GetMonitorScrapeJobDetailReq

type GetMonitorScrapeJobDetailReq struct {
	ID int `json:"id" form:"id" binding:"required"`
}

type GetMonitorScrapeJobListReq

type GetMonitorScrapeJobListReq struct {
	ListReq
	PoolID int   `json:"pool_id" form:"pool_id" binding:"omitempty"`
	Enable *int8 `json:"enable" form:"enable" binding:"omitempty"`
}

type GetMonitorScrapePoolDetailReq

type GetMonitorScrapePoolDetailReq struct {
	ID int `json:"id" form:"id" binding:"required"`
}

type GetMonitorScrapePoolListReq

type GetMonitorScrapePoolListReq struct {
	ListReq
	SupportAlert  *int8 `json:"support_alert" form:"support_alert" binding:"omitempty"`
	SupportRecord *int8 `json:"support_record" form:"support_record" binding:"omitempty"`
}

type GetMonitorSendGroupListReq

type GetMonitorSendGroupListReq struct {
	ListReq
	PoolID        *int  `json:"pool_id" form:"pool_id"`
	Enable        *int8 `json:"enable" form:"enable" binding:"omitempty,oneof=1 2"`
	OnDutyGroupID *int  `json:"on_duty_group_id" form:"on_duty_group_id"`
}

GetMonitorSendGroupListReq 获取发送组列表请求

type GetMonitorSendGroupReq

type GetMonitorSendGroupReq struct {
	ID int `json:"id" form:"id" binding:"required"`
}

GetMonitorSendGroupReq 获取发送组请求

type GetNodeDetailReq

type GetNodeDetailReq struct {
	ClusterID int    `json:"cluster_id" binding:"required"` // 集群ID
	NodeName  string `json:"node_name" binding:"required"`  // 节点名称
}

GetNodeDetailReq 获取节点详情请求

type GetNodeListReq

type GetNodeListReq struct {
	ListReq
	ClusterID     int          `json:"cluster_id" binding:"required"` // 集群ID
	Status        []NodeStatus `json:"status"`                        // 状态过滤
	LabelSelector string       `json:"label_selector"`                // 标签选择器
}

GetNodeListReq 获取节点列表请求

type GetNodeTaintsReq

type GetNodeTaintsReq struct {
	ClusterID int    `json:"cluster_id" binding:"required"` // 集群ID
	NodeName  string `json:"node_name" binding:"required"`  // 节点名称
}

GetNodeTaintsReq 获取节点污点请求

type GetPVCDetailsReq

type GetPVCDetailsReq struct {
	ClusterID int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	Namespace string `json:"namespace" form:"namespace" binding:"required" comment:"命名空间"`   // 命名空间
	Name      string `json:"name" form:"name" binding:"required" comment:"PVC名称"`            // PVC名称
}

GetPVCDetailsReq 获取PVC详情请求

type GetPVCListReq

type GetPVCListReq struct {
	ListReq
	ClusterID  int               `json:"cluster_id" form:"cluster_id" comment:"集群ID"`   // 集群ID
	Namespace  string            `json:"namespace" form:"namespace" comment:"命名空间"`     // 命名空间
	Status     string            `json:"status" form:"status" comment:"PVC状态"`          // PVC状态
	Labels     map[string]string `json:"labels" form:"labels" comment:"标签"`             // 标签
	AccessMode string            `json:"access_mode" form:"access_mode" comment:"访问模式"` // 访问模式
}

GetPVCListReq 获取PVC列表请求

type GetPVCPodsReq

type GetPVCPodsReq struct {
	ClusterID int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	Namespace string `json:"namespace" form:"namespace" binding:"required" comment:"命名空间"`   // 命名空间
	Name      string `json:"name" form:"name" binding:"required" comment:"PVC名称"`            // PVC名称
}

GetPVCPodsReq 获取使用PVC的Pod列表请求

type GetPVCYamlReq

type GetPVCYamlReq struct {
	ClusterID int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	Namespace string `json:"namespace" form:"namespace" binding:"required" comment:"命名空间"`   // 命名空间
	Name      string `json:"name" form:"name" binding:"required" comment:"PVC名称"`            // PVC名称
}

GetPVCYamlReq 获取PVC YAML请求

type GetPVDetailsReq

type GetPVDetailsReq struct {
	ClusterID int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	Name      string `json:"name" form:"name" binding:"required" comment:"PV名称"`             // PV名称
}

GetPVDetailsReq 获取PV详情请求

type GetPVListReq

type GetPVListReq struct {
	ListReq
	ClusterID  int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	Status     string `json:"status" form:"status" comment:"PV状态过滤"`                          // PV状态过滤
	AccessMode string `json:"access_mode" form:"access_mode" comment:"访问模式过滤"`                // 访问模式过滤
	VolumeType string `json:"volume_type" form:"volume_type" comment:"卷类型过滤"`                 // 卷类型过滤
}

GetPVListReq 获取PV列表请求

type GetPVYamlReq

type GetPVYamlReq struct {
	ClusterID int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	Name      string `json:"name" form:"name" binding:"required" comment:"PV名称"`             // PV名称
}

GetPVYamlReq 获取PV YAML请求

type GetPermCodeReq

type GetPermCodeReq struct {
	ID int `json:"id" binding:"required"` // 用户ID
}

GetPermCodeReq 获取权限码请求

type GetPodContainersReq

type GetPodContainersReq struct {
	ClusterID int    `json:"cluster_id" uri:"cluster_id" binding:"required"` // 集群ID
	Namespace string `json:"namespace" uri:"namespace" binding:"required"`   // 命名空间
	PodName   string `json:"pod_name" uri:"name" binding:"required"`         // Pod名称 - 匹配路由参数:name
}

GetPodContainersReq 获取Pod容器列表请求

type GetPodDetailsReq

type GetPodDetailsReq struct {
	ClusterID int    `json:"cluster_id" uri:"cluster_id" binding:"required"` // 集群ID
	Namespace string `json:"namespace" uri:"namespace" binding:"required"`   // 命名空间
	Name      string `json:"name" uri:"name" binding:"required"`             // Pod名称
}

GetPodDetailsReq 获取Pod详情请求

type GetPodListReq

type GetPodListReq struct {
	ListReq
	ClusterID int    `json:"cluster_id" form:"cluster_id" uri:"cluster_id" binding:"required"` // 集群ID
	Namespace string `json:"namespace" form:"namespace"`                                       // 命名空间
	Status    string `json:"status" form:"status"`                                             // Pod状态
}

GetPodListReq 获取Pod列表请求

type GetPodLogsReq

type GetPodLogsReq struct {
	ClusterID    int    `json:"cluster_id" uri:"cluster_id" binding:"required"` // 集群ID
	Namespace    string `json:"namespace" uri:"namespace" binding:"required"`   // 命名空间
	PodName      string `json:"pod_name" uri:"name" binding:"required"`         // Pod名称 - 匹配路由参数:name
	Container    string `json:"container" uri:"container" binding:"required"`   // 容器名称
	Follow       bool   `json:"follow" form:"follow"`                           // 是否持续跟踪
	Previous     bool   `json:"previous" form:"previous"`                       // 是否获取前一个容器的日志
	SinceSeconds *int64 `json:"since_seconds" form:"since_seconds"`             // 获取多少秒内的日志
	SinceTime    string `json:"since_time" form:"since_time"`                   // 从指定时间开始获取日志
	Timestamps   bool   `json:"timestamps" form:"timestamps"`                   // 是否显示时间戳
	TailLines    *int64 `json:"tail_lines" form:"tail_lines"`                   // 获取最后几行日志
	LimitBytes   *int64 `json:"limit_bytes" form:"limit_bytes"`                 // 限制日志字节数
}

GetPodLogsReq Pod日志查询请求

type GetPodYamlReq

type GetPodYamlReq struct {
	ClusterID int    `json:"cluster_id" uri:"cluster_id" binding:"required"` // 集群ID
	Namespace string `json:"namespace" uri:"namespace" binding:"required"`   // 命名空间
	Name      string `json:"name" uri:"name" binding:"required"`             // Pod名称
}

GetPodYamlReq 获取Pod YAML请求

type GetPodsByNodeReq

type GetPodsByNodeReq struct {
	ClusterID int    `json:"cluster_id" uri:"cluster_id" binding:"required"` // 集群ID
	NodeName  string `json:"node_name" uri:"node_name" binding:"required"`   // 节点名称
}

GetPodsByNodeReq 根据节点获取Pod列表请求

type GetRoleApiRequest

type GetRoleApiRequest struct {
	ID int `json:"id"` // 角色ID
}

type GetRoleBindingDetailsReq

type GetRoleBindingDetailsReq struct {
	ClusterID int    `json:"cluster_id" binding:"required" comment:"集群ID"`
	Namespace string `json:"namespace" binding:"required" comment:"命名空间"`
	Name      string `json:"name" binding:"required" comment:"RoleBinding名称"`
}

GetRoleBindingDetailsReq 获取RoleBinding详情请求

type GetRoleBindingListReq

type GetRoleBindingListReq struct {
	ClusterID int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"`
	Namespace string `json:"namespace" form:"namespace" comment:"命名空间"`
	Keyword   string `json:"keyword" form:"keyword" comment:"关键字搜索"`
	Page      int    `json:"page" form:"page" comment:"页码"`
	PageSize  int    `json:"page_size" form:"page_size" comment:"页面大小"`
}

GetRoleBindingListReq 获取RoleBinding列表请求

type GetRoleBindingYamlReq

type GetRoleBindingYamlReq struct {
	ClusterID int    `json:"cluster_id" binding:"required" comment:"集群ID"`
	Namespace string `json:"namespace" binding:"required" comment:"命名空间"`
	Name      string `json:"name" binding:"required" comment:"RoleBinding名称"`
}

GetRoleBindingYamlReq 获取RoleBinding YAML请求

type GetRoleDetailsReq

type GetRoleDetailsReq struct {
	ClusterID int    `json:"cluster_id" binding:"required" comment:"集群ID"`
	Namespace string `json:"namespace" binding:"required" comment:"命名空间"`
	Name      string `json:"name" binding:"required" comment:"Role名称"`
}

GetRoleDetailsReq 获取Role详情请求

type GetRoleListReq

type GetRoleListReq struct {
	ClusterID int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"`
	Namespace string `json:"namespace" form:"namespace" comment:"命名空间"`
	Keyword   string `json:"keyword" form:"keyword" comment:"关键字搜索"`
	Page      int    `json:"page" form:"page" comment:"页码"`
	PageSize  int    `json:"page_size" form:"page_size" comment:"页面大小"`
}

GetRoleListReq 获取Role列表请求

type GetRoleRequest

type GetRoleRequest struct {
	ID int `json:"id"` // 角色ID
}

GetRoleRequest 获取角色请求结构体

type GetRoleUsersRequest

type GetRoleUsersRequest struct {
	ID int `json:"id"` // 角色ID
}

type GetRoleYamlReq

type GetRoleYamlReq struct {
	ClusterID int    `json:"cluster_id" binding:"required" comment:"集群ID"`
	Namespace string `json:"namespace" binding:"required" comment:"命名空间"`
	Name      string `json:"name" binding:"required" comment:"Role名称"`
}

GetRoleYamlReq 获取Role YAML请求

type GetSecretDetailsReq

type GetSecretDetailsReq struct {
	ClusterID int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	Namespace string `json:"namespace" form:"namespace" binding:"required" comment:"命名空间"`   // 命名空间
	Name      string `json:"name" form:"name" binding:"required" comment:"Secret名称"`         // Secret名称
}

GetSecretDetailsReq 获取Secret详情请求

type GetSecretListReq

type GetSecretListReq struct {
	ListReq
	ClusterID int               `json:"cluster_id" form:"cluster_id" comment:"集群ID"` // 集群ID
	Namespace string            `json:"namespace" form:"namespace" comment:"命名空间"`   // 命名空间
	Type      K8sSecretType     `json:"type" form:"type" comment:"Secret类型"`         // Secret类型
	Labels    map[string]string `json:"labels" form:"labels" comment:"标签"`           // 标签
}

GetSecretListReq 获取Secret列表请求

type GetSecretYamlReq

type GetSecretYamlReq struct {
	ClusterID int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	Namespace string `json:"namespace" form:"namespace" binding:"required" comment:"命名空间"`   // 命名空间
	Name      string `json:"name" form:"name" binding:"required" comment:"Secret名称"`         // Secret名称
}

GetSecretYamlReq 获取Secret YAML请求

type GetServiceAccountDetailsReq

type GetServiceAccountDetailsReq struct {
	ClusterID int    `json:"cluster_id" binding:"required" comment:"集群ID"`
	Namespace string `json:"namespace" binding:"required" comment:"命名空间"`
	Name      string `json:"name" binding:"required" comment:"ServiceAccount名称"`
}

GetServiceAccountDetailsReq 获取ServiceAccount详情请求

type GetServiceAccountListReq

type GetServiceAccountListReq struct {
	ClusterID int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"`
	Namespace string `json:"namespace" form:"namespace" comment:"命名空间"`
	Keyword   string `json:"keyword" form:"keyword" comment:"关键字搜索"`
	Page      int    `json:"page" form:"page" comment:"页码"`
	PageSize  int    `json:"page_size" form:"page_size" comment:"页面大小"`
}

GetServiceAccountListReq 获取ServiceAccount列表请求

type GetServiceAccountTokenReq

type GetServiceAccountTokenReq struct {
	ClusterID int    `json:"cluster_id" binding:"required" comment:"集群ID"`
	Namespace string `json:"namespace" binding:"required" comment:"命名空间"`
	Name      string `json:"name" binding:"required" comment:"ServiceAccount名称"`
}

GetServiceAccountTokenReq 获取ServiceAccount Token请求

type GetServiceAccountYamlReq

type GetServiceAccountYamlReq struct {
	ClusterID int    `json:"cluster_id" binding:"required" comment:"集群ID"`
	Namespace string `json:"namespace" binding:"required" comment:"命名空间"`
	Name      string `json:"name" binding:"required" comment:"ServiceAccount名称"`
}

GetServiceAccountYamlReq 获取ServiceAccount YAML请求

type GetServiceDetailsReq

type GetServiceDetailsReq struct {
	ClusterID int    `json:"cluster_id"` // 集群ID
	Namespace string `json:"namespace"`  // 命名空间
	Name      string `json:"name"`       // Service名称
}

GetServiceDetailsReq 获取Service详情请求

type GetServiceEndpointsReq

type GetServiceEndpointsReq struct {
	ClusterID int    `json:"cluster_id"` // 集群ID
	Namespace string `json:"namespace"`  // 命名空间
	Name      string `json:"name"`       // Service名称
}

GetServiceEndpointsReq 获取Service端点请求

type GetServiceListReq

type GetServiceListReq struct {
	ListReq
	ClusterID int               `json:"cluster_id" form:"cluster_id"` // 集群ID
	Namespace string            `json:"namespace" form:"namespace"`   // 命名空间
	Type      string            `json:"type" form:"type"`             // Service类型
	Labels    map[string]string `json:"labels" form:"labels"`         // 标签
}

GetServiceListReq Service列表请求

type GetServiceYamlReq

type GetServiceYamlReq struct {
	ClusterID int    `json:"cluster_id"` // 集群ID
	Namespace string `json:"namespace"`  // 命名空间
	Name      string `json:"name"`       // Service名称
}

GetServiceYamlReq 获取Service YAML请求

type GetStatefulSetDetailsReq

type GetStatefulSetDetailsReq struct {
	ClusterID int    `json:"cluster_id"` // 集群ID
	Namespace string `json:"namespace"`  // 命名空间
	Name      string `json:"name"`       // StatefulSet名称
}

GetStatefulSetDetailsReq 获取StatefulSet详情请求

type GetStatefulSetHistoryReq

type GetStatefulSetHistoryReq struct {
	ClusterID int    `json:"cluster_id"` // 集群ID
	Namespace string `json:"namespace"`  // 命名空间
	Name      string `json:"name"`       // StatefulSet名称
}

GetStatefulSetHistoryReq 获取StatefulSet版本历史请求

type GetStatefulSetListReq

type GetStatefulSetListReq struct {
	ListReq
	ClusterID   int               `json:"cluster_id" form:"cluster_id"`     // 集群ID
	Namespace   string            `json:"namespace" form:"namespace"`       // 命名空间
	Status      string            `json:"status" form:"status"`             // StatefulSet状态
	ServiceName string            `json:"service_name" form:"service_name"` // 服务名称
	Labels      map[string]string `json:"labels" form:"labels"`             // 标签
}

GetStatefulSetListReq 获取StatefulSet列表请求

type GetStatefulSetPodsReq

type GetStatefulSetPodsReq struct {
	ClusterID int    `json:"cluster_id"` // 集群ID
	Namespace string `json:"namespace"`  // 命名空间
	Name      string `json:"name"`       // StatefulSet名称
}

GetStatefulSetPodsReq 获取StatefulSet下的Pod列表请求

type GetStatefulSetYamlReq

type GetStatefulSetYamlReq struct {
	ClusterID int    `json:"cluster_id"` // 集群ID
	Namespace string `json:"namespace"`  // 命名空间
	Name      string `json:"name"`       // StatefulSet名称
}

GetStatefulSetYamlReq 获取StatefulSet YAML请求

type GetTreeLocalResourceDetailReq

type GetTreeLocalResourceDetailReq struct {
	ID int `json:"id" form:"id"`
}

GetTreeLocalDetailReq 获取本地树资源详情请求

type GetTreeLocalResourceListReq

type GetTreeLocalResourceListReq struct {
	ListReq
	Status ResourceStatus `json:"status" form:"status"`
}

GetTreeLocalListReq 获取本地树资源列表请求

type GetTreeNodeChildNodesReq

type GetTreeNodeChildNodesReq struct {
	ID int `json:"id" form:"id" binding:"required"`
}

GetTreeNodeChildNodesReq 获取子节点列表请求

type GetTreeNodeDetailReq

type GetTreeNodeDetailReq struct {
	ID int `json:"id" form:"id" binding:"required"`
}

GetTreeNodeDetailReq 获取节点详情请求

type GetTreeNodeListReq

type GetTreeNodeListReq struct {
	Level  int            `json:"level" form:"level" binding:"omitempty,min=1"`
	Status TreeNodeStatus `json:"status" form:"status" binding:"omitempty,oneof=1 2"`
	Search string         `json:"search" form:"search" binding:"omitempty"`
}

GetTreeNodeListReq 获取树节点列表请求

type GetTreeNodeMembersReq

type GetTreeNodeMembersReq struct {
	ID   int                `json:"id" binding:"required"`
	Type TreeNodeMemberType `json:"type" form:"type" binding:"omitempty,oneof=1 2"`
}

GetTreeNodeMembersReq 获取节点成员请求

type GetUserDetailReq

type GetUserDetailReq struct {
	ID int `json:"id" form:"id" binding:"required"`
}

GetUserDetailReq 获取用户详情请求

type GetUserListReq

type GetUserListReq struct {
	ListReq
	Enable      int8 `json:"enable" form:"enable" default:"1"`             // 用户状态 1正常 2冻结
	AccountType int8 `json:"account_type" form:"account_type" default:"1"` // 账号类型 1普通用户 2服务账号
}

GetUserListReq 获取用户列表请求

type GetUserPermissionsRequest

type GetUserPermissionsRequest struct {
	ID int `json:"id"` // 用户ID
}

type GetUserRolesRequest

type GetUserRolesRequest struct {
	ID int `json:"id"` // 用户ID
}

type GetUserTreeNodesReq

type GetUserTreeNodesReq struct {
	UserID int                `json:"user_id" binding:"required"`
	Role   TreeNodeMemberType `json:"role" binding:"omitempty,oneof=1 2"`
}

GetUserTreeNodesReq 获取用户相关节点请求

type HourlyTrendItem

type HourlyTrendItem struct {
	Hour  int   `json:"hour"`
	Count int64 `json:"count"`
}

HourlyTrendItem 小时趋势项

type IngressHTTPIngressPath

type IngressHTTPIngressPath struct {
	Path     string                      `json:"path"`      // 路径
	PathType *networkingv1.PathType      `json:"path_type"` // 路径类型
	Backend  networkingv1.IngressBackend `json:"backend"`   // 后端服务
}

IngressHTTPIngressPath HTTP路径

type IngressHTTPRuleValue

type IngressHTTPRuleValue struct {
	Paths []IngressHTTPIngressPath `json:"paths"` // 路径列表
}

IngressHTTPRuleValue HTTP规则值

type IngressLoadBalancer

type IngressLoadBalancer struct {
	Ingress []IngressLoadBalancerIngress `json:"ingress"` // Ingress信息
}

IngressLoadBalancer 负载均衡器

type IngressLoadBalancerIngress

type IngressLoadBalancerIngress struct {
	IP       string              `json:"ip"`       // IP地址
	Hostname string              `json:"hostname"` // 主机名
	Ports    []IngressPortStatus `json:"ports"`    // 端口状态
}

IngressLoadBalancerIngress 负载均衡器Ingress

type IngressPortStatus

type IngressPortStatus struct {
	Port     int32  `json:"port"`     // 端口号
	Protocol string `json:"protocol"` // 协议
	Error    string `json:"error"`    // 错误信息
}

IngressPortStatus 端口状态

type IngressRule

type IngressRule struct {
	Host string               `json:"host"` // 主机名
	HTTP IngressHTTPRuleValue `json:"http"` // HTTP规则
}

IngressRule Ingress规则

type IngressTLS

type IngressTLS struct {
	Hosts      []string `json:"hosts"`       // 主机列表
	SecretName string   `json:"secret_name"` // Secret名称
}

IngressTLS TLS配置

type InvolvedObject

type InvolvedObject struct {
	Kind       string `json:"kind"`                 // Pod, Service, Deployment等
	Name       string `json:"name"`                 // 对象名称
	Namespace  string `json:"namespace"`            // 命名空间
	UID        string `json:"uid"`                  // 对象UID
	APIVersion string `json:"api_version"`          // API版本
	FieldPath  string `json:"field_path,omitempty"` // 如:spec.containers{nginx}
}

InvolvedObject 事件涉及的K8s对象

type JSONMap

type JSONMap map[string]interface{}

JSONMap 通用 JSON 字典类型

func (*JSONMap) Scan

func (m *JSONMap) Scan(val interface{}) error

Scan 实现 sql.Scanner 接口

func (JSONMap) Value

func (m JSONMap) Value() (driver.Value, error)

Value 实现 driver.Valuer 接口

type K8sCluster

type K8sCluster struct {
	Model
	Name                 string        `json:"name" binding:"required,min=1,max=200" gorm:"size:100;comment:集群名称"`        // 集群名称
	CpuRequest           string        `json:"cpu_request,omitempty" gorm:"comment:CPU 请求量 (m)"`                          // CPU 请求量
	CpuLimit             string        `json:"cpu_limit,omitempty" gorm:"comment:CPU 限制量 (m)"`                            // CPU 限制量
	MemoryRequest        string        `json:"memory_request,omitempty" gorm:"comment:内存请求量 (Mi)"`                        // 内存请求量
	MemoryLimit          string        `json:"memory_limit,omitempty" gorm:"comment:内存限制量 (Mi)"`                          // 内存限制量
	RestrictNamespace    StringList    `json:"restrict_namespace" gorm:"comment:资源限制命名空间"`                                // 资源限制命名空间
	Status               ClusterStatus `json:"status" gorm:"index;comment:集群状态 (1:Running, 2:Stopped, 3:Error)"`          // 集群状态
	Env                  Env           `json:"env,omitempty" gorm:"comment:集群环境 (1:Prod, 2:Dev, 3:Stage, 4:Rc, 5:Press)"` // 集群环境
	Version              string        `json:"version,omitempty" gorm:"comment:集群版本"`                                     // 集群版本
	ApiServerAddr        string        `json:"api_server_addr,omitempty" gorm:"comment:API Server 地址"`                    // API Server 地址
	KubeConfigContent    string        `json:"kube_config_content,omitempty" gorm:"type:text;comment:kubeConfig 内容"`      // kubeConfig 内容
	ActionTimeoutSeconds int           `json:"action_timeout_seconds,omitempty" gorm:"comment:操作超时时间(秒)"`                 // 操作超时时间(秒)
	CreateUserName       string        `json:"create_user_name,omitempty" gorm:"comment:创建者用户名"`                          // 创建者用户名
	CreateUserID         int           `json:"create_user_id,omitempty" gorm:"comment:创建者用户ID"`                           // 创建者用户ID
	Tags                 KeyValueList  `json:"tags,omitempty" gorm:"type:text;serializer:json;comment:标签"`                // 标签
}

K8sCluster Kubernetes 集群的配置

func (*K8sCluster) TableName

func (k8sCluster *K8sCluster) TableName() string

type K8sClusterRole

type K8sClusterRole struct {
	Name              string              `json:"name"`
	ClusterID         int                 `json:"cluster_id"`
	UID               string              `json:"uid"`
	CreationTimestamp string              `json:"creation_timestamp"`
	Labels            map[string]string   `json:"labels"`
	Annotations       map[string]string   `json:"annotations"`
	Rules             []PolicyRule        `json:"rules"`
	ResourceVersion   string              `json:"resource_version"`
	Age               string              `json:"age"`
	RawClusterRole    *rbacv1.ClusterRole `json:"-"` // 原始ClusterRole对象,不序列化
}

K8sClusterRole ClusterRole主model

type K8sClusterRoleBinding

type K8sClusterRoleBinding struct {
	Name                  string                     `json:"name"`
	ClusterID             int                        `json:"cluster_id"`
	UID                   string                     `json:"uid"`
	CreationTimestamp     string                     `json:"creation_timestamp"`
	Labels                map[string]string          `json:"labels"`
	Annotations           map[string]string          `json:"annotations"`
	RoleRef               RoleRef                    `json:"role_ref"`
	Subjects              []Subject                  `json:"subjects"`
	ResourceVersion       string                     `json:"resource_version"`
	Age                   string                     `json:"age"`
	RawClusterRoleBinding *rbacv1.ClusterRoleBinding `json:"-"` // 原始ClusterRoleBinding对象,不序列化
}

K8sClusterRoleBinding ClusterRoleBinding主model

type K8sConfigMap

type K8sConfigMap struct {
	Name         string            `json:"name" binding:"required,min=1,max=200"`      // ConfigMap名称
	Namespace    string            `json:"namespace" binding:"required,min=1,max=200"` // 所属命名空间
	ClusterID    int               `json:"cluster_id" gorm:"index;not null"`           // 所属集群ID
	UID          string            `json:"uid" gorm:"size:100"`                        // ConfigMap UID
	Data         map[string]string `json:"data"`                                       // 字符串数据
	BinaryData   map[string][]byte `json:"binary_data"`                                // 二进制数据
	Labels       map[string]string `json:"labels"`                                     // 标签
	Annotations  map[string]string `json:"annotations"`                                // 注解
	Immutable    bool              `json:"immutable"`                                  // 是否不可变
	DataCount    int               `json:"data_count"`                                 // 数据条目数量
	Size         string            `json:"size"`                                       // 数据大小
	CreatedAt    time.Time         `json:"created_at"`                                 // 创建时间
	UpdatedAt    time.Time         `json:"updated_at"`                                 // 更新时间
	Age          string            `json:"age"`                                        // 存在时间,前端计算使用
	RawConfigMap *corev1.ConfigMap `json:"-"`                                          // 原始 ConfigMap 对象,不序列化到 JSON
}

K8sConfigMap Kubernetes ConfigMap

type K8sDaemonSet

type K8sDaemonSet struct {
	Name                   string               `json:"name" binding:"required,min=1,max=200"`      // DaemonSet名称
	Namespace              string               `json:"namespace" binding:"required,min=1,max=200"` // 所属命名空间
	ClusterID              int                  `json:"cluster_id" gorm:"index;not null"`           // 所属集群ID
	UID                    string               `json:"uid" gorm:"size:100"`                        // DaemonSet UID
	DesiredNumberScheduled int32                `json:"desired_number_scheduled"`                   // 期望调度数量
	CurrentNumberScheduled int32                `json:"current_number_scheduled"`                   // 当前调度数量
	NumberReady            int32                `json:"number_ready"`                               // 就绪数量
	NumberAvailable        int32                `json:"number_available"`                           // 可用数量
	NumberUnavailable      int32                `json:"number_unavailable"`                         // 不可用数量
	UpdatedNumberScheduled int32                `json:"updated_number_scheduled"`                   // 更新调度数量
	NumberMisscheduled     int32                `json:"number_misscheduled"`                        // 错误调度数量
	UpdateStrategy         string               `json:"update_strategy"`                            // 更新策略
	RevisionHistoryLimit   int32                `json:"revision_history_limit"`                     // 历史版本限制
	Selector               map[string]string    `json:"selector"`                                   // 标签选择器
	Labels                 map[string]string    `json:"labels"`                                     // 标签
	Annotations            map[string]string    `json:"annotations"`                                // 注解
	Images                 []string             `json:"images"`                                     // 容器镜像列表
	Status                 K8sDaemonSetStatus   `json:"status"`                                     // DaemonSet状态
	Conditions             []DaemonSetCondition `json:"conditions"`                                 // DaemonSet条件
	CreatedAt              time.Time            `json:"created_at"`                                 // 创建时间
	UpdatedAt              time.Time            `json:"updated_at"`                                 // 更新时间
	RawDaemonSet           *appsv1.DaemonSet    `json:"-"`                                          // 原始 DaemonSet 对象,不序列化到 JSON
}

type K8sDaemonSetHistory

type K8sDaemonSetHistory struct {
	Revision int64     `json:"revision"` // 版本
	Date     time.Time `json:"date"`     // 日期
	Message  string    `json:"message"`  // 消息
}

K8sDaemonSetHistory DaemonSet历史版本

type K8sDaemonSetStatus

type K8sDaemonSetStatus int8
const (
	K8sDaemonSetStatusRunning  K8sDaemonSetStatus = iota + 1 // 运行中
	K8sDaemonSetStatusError                                  // 异常
	K8sDaemonSetStatusUpdating                               // 更新中
)

type K8sDeployment

type K8sDeployment struct {
	Name              string                `json:"name" binding:"required,min=1,max=200"`      // Deployment名称
	Namespace         string                `json:"namespace" binding:"required,min=1,max=200"` // 所属命名空间
	ClusterID         int                   `json:"cluster_id" gorm:"index;not null"`           // 所属集群ID
	UID               string                `json:"uid" gorm:"size:100"`                        // Deployment UID
	Replicas          int32                 `json:"replicas"`                                   // 期望副本数
	ReadyReplicas     int32                 `json:"ready_replicas"`                             // 就绪副本数
	AvailableReplicas int32                 `json:"available_replicas"`                         // 可用副本数
	UpdatedReplicas   int32                 `json:"updated_replicas"`                           // 更新副本数
	Strategy          string                `json:"strategy"`                                   // 部署策略
	MaxUnavailable    string                `json:"max_unavailable"`                            // 最大不可用数量
	MaxSurge          string                `json:"max_surge"`                                  // 最大超出数量
	Selector          map[string]string     `json:"selector"`                                   // 标签选择器
	Labels            map[string]string     `json:"labels"`                                     // 标签
	Annotations       map[string]string     `json:"annotations"`                                // 注解
	Images            []string              `json:"images"`                                     // 容器镜像列表
	Status            K8sDeploymentStatus   `json:"status"`                                     // 部署状态
	Conditions        []DeploymentCondition `json:"conditions"`                                 // 部署条件
	CreatedAt         time.Time             `json:"created_at"`                                 // 创建时间
	UpdatedAt         time.Time             `json:"updated_at"`                                 // 更新时间
	RawDeployment     *appsv1.Deployment    `json:"-"`                                          // 原始 Deployment 对象,不序列化到 JSON
}

K8sDeployment Kubernetes Deployment

type K8sDeploymentHistory

type K8sDeploymentHistory struct {
	Revision int64     `json:"revision"` // 版本
	Date     time.Time `json:"date"`     // 日期
	Message  string    `json:"message"`  // 消息
}

type K8sDeploymentStatus

type K8sDeploymentStatus int8

K8sDeploymentStatus Deployment状态枚举

const (
	K8sDeploymentStatusRunning K8sDeploymentStatus = iota + 1 // 运行中
	K8sDeploymentStatusStopped                                // 停止
	K8sDeploymentStatusPaused                                 // 暂停
	K8sDeploymentStatusError                                  // 异常
)

type K8sEvent

type K8sEvent struct {
	Name               string            `json:"name"`                          // 名称
	Namespace          string            `json:"namespace"`                     // 命名空间
	UID                string            `json:"uid"`                           // UID
	ClusterID          int               `json:"cluster_id"`                    // 集群ID
	Type               EventType         `json:"type"`                          // Normal, Warning
	Reason             EventReason       `json:"reason"`                        // 事件原因,如:BackOff, Pulled, Created
	Message            string            `json:"message"`                       // 详细消息
	Severity           EventSeverity     `json:"severity"`                      // 严重程度:low, medium, high, critical
	FirstTimestamp     time.Time         `json:"first_timestamp"`               // 首次发生时间
	LastTimestamp      time.Time         `json:"last_timestamp"`                // 最后发生时间
	Count              int64             `json:"count"`                         // 事件发生次数
	InvolvedObject     InvolvedObject    `json:"involved_object"`               // 涉及对象
	Source             EventSource       `json:"source"`                        // 事件源
	Action             string            `json:"action,omitempty"`              // 执行的动作
	ReportingComponent string            `json:"reporting_component,omitempty"` // 报告组件
	ReportingInstance  string            `json:"reporting_instance,omitempty"`  // 报告实例
	Labels             map[string]string `json:"labels,omitempty"`              // 标签
	Annotations        map[string]string `json:"annotations,omitempty"`         // 注解
}

K8sEvent k8s事件

type K8sIngress

type K8sIngress struct {
	Model
	Name             string                `json:"name" binding:"required,min=1,max=200"`      // Ingress名称
	Namespace        string                `json:"namespace" binding:"required,min=1,max=200"` // 所属命名空间
	ClusterID        int                   `json:"cluster_id"`                                 // 所属集群ID
	UID              string                `json:"uid"`                                        // Ingress UID
	IngressClassName *string               `json:"ingress_class_name"`                         // Ingress类名
	Rules            []IngressRule         `json:"rules"`                                      // Ingress规则
	TLS              []IngressTLS          `json:"tls"`                                        // TLS配置
	LoadBalancer     IngressLoadBalancer   `json:"load_balancer"`                              // 负载均衡器信息
	Labels           map[string]string     `json:"labels"`                                     // 标签
	Annotations      map[string]string     `json:"annotations"`                                // 注解
	CreatedAt        time.Time             `json:"created_at"`                                 // 创建时间
	Age              string                `json:"age"`                                        // 存在时间,前端计算使用
	Status           K8sIngressStatus      `json:"status" binding:"required"`                  // Ingress状态,前端计算使用
	Hosts            []string              `json:"hosts"`                                      // 主机列表,前端使用
	RawIngress       *networkingv1.Ingress `json:"-"`                                          // 原始Ingress对象
}

K8sIngress k8s ingress 实体

type K8sIngressStatus

type K8sIngressStatus int8

K8sIngressStatus Ingress状态枚举

const (
	K8sIngressStatusRunning K8sIngressStatus = iota + 1 // 运行中
	K8sIngressStatusPending                             // 等待中
	K8sIngressStatusFailed                              // 失败
)

type K8sNamespace

type K8sNamespace struct {
	ClusterID   int          `json:"cluster_id"`                             // 所属集群ID
	Name        string       `json:"name" binding:"required,min=1,max=200" ` // 命名空间名称
	UID         string       `json:"uid"`                                    // 命名空间UID
	Status      string       `json:"status" `                                // 命名空间状态
	Phase       string       `json:"phase" `                                 // 命名空间阶段
	Labels      KeyValueList `json:"labels" `                                // 标签
	Annotations KeyValueList `json:"annotations" `                           // 注解
}

K8sNamespace Kubernetes 命名空间

type K8sNamespaceCreateReq

type K8sNamespaceCreateReq struct {
	ClusterID   int          `json:"cluster_id" form:"cluster_id" binding:"required"` // 集群ID,必填
	Name        string       `json:"name" binding:"required,min=1,max=200"`           // 命名空间名称,必填
	Labels      KeyValueList `json:"labels"`                                          // 标签
	Annotations KeyValueList `json:"annotations"`                                     // 注解
}

K8sNamespaceCreateReq 创建命名空间请求

type K8sNamespaceDeleteReq

type K8sNamespaceDeleteReq struct {
	ClusterID          int    `json:"cluster_id" form:"cluster_id" binding:"required"` // 集群ID,必填
	Name               string `json:"name" binding:"required"`                         // 命名空间名称,必填
	GracePeriodSeconds *int64 `json:"grace_period_seconds"`                            // 优雅删除时间(秒)
	Force              int8   `json:"force" binding:"required,oneof= 1 2"`             // 是否强制删除
}

K8sNamespaceDeleteReq 删除命名空间请求

type K8sNamespaceGetDetailsReq

type K8sNamespaceGetDetailsReq struct {
	ClusterID int    `json:"cluster_id" form:"cluster_id" binding:"required"` // 集群ID,必填
	Name      string `json:"name" binding:"required"`                         // 命名空间名称,必填
}

K8sNamespaceGetDetailsReq 获取命名空间详情请求

type K8sNamespaceListReq

type K8sNamespaceListReq struct {
	ListReq
	ClusterID     int          `json:"cluster_id" form:"cluster_id" binding:"required"` // 集群ID,必填
	Status        string       `json:"status" form:"status"`                            // 状态过滤
	Labels        KeyValueList `json:"labels" form:"labels"`                            // 标签
	LabelSelector string       `json:"label_selector" form:"label_selector"`            // 标签选择器
	Search        string       `json:"search" form:"search"`                            // 搜索关键字(用于过滤命名空间名称)
}

K8sNamespaceListReq 命名空间列表查询请求

type K8sNamespaceUpdateReq

type K8sNamespaceUpdateReq struct {
	ClusterID   int          `json:"cluster_id" form:"cluster_id" binding:"required"` // 集群ID,必填
	Name        string       `json:"name" binding:"required"`                         // 命名空间名称,必填
	Labels      KeyValueList `json:"labels"`                                          // 标签
	Annotations KeyValueList `json:"annotations"`                                     // 注解
}

K8sNamespaceUpdateReq 更新命名空间请求

type K8sNode

type K8sNode struct {
	Name             string               `json:"name"`                                         // 节点名称
	ClusterID        int                  `json:"cluster_id"`                                   // 所属集群ID
	Status           NodeStatus           `json:"status"`                                       // 节点状态
	Schedulable      int8                 `json:"schedulable" binding:"required,oneof=1 2"`     // 节点是否可调度
	Roles            []string             `json:"roles" gorm:"type:text;serializer:json"`       // 节点角色,例如 master, worker
	Age              string               `json:"age"`                                          // 节点存在时间,例如 5d
	InternalIP       string               `json:"internal_ip"`                                  // 节点内部IP
	ExternalIP       string               `json:"external_ip"`                                  // 节点外部IP(如果有)
	HostName         string               `json:"hostname"`                                     // 主机名
	KubeletVersion   string               `json:"kubelet_version"`                              // Kubelet 版本
	KubeProxyVersion string               `json:"kube_proxy_version"`                           // KubeProxy 版本
	ContainerRuntime string               `json:"container_runtime"`                            // 容器运行时
	OperatingSystem  string               `json:"operating_system"`                             // 操作系统
	Architecture     string               `json:"architecture"`                                 // 系统架构
	KernelVersion    string               `json:"kernel_version"`                               // 内核版本
	OSImage          string               `json:"os_image"`                                     // 操作系统镜像
	Labels           map[string]string    `json:"labels" gorm:"type:text;serializer:json"`      // 节点标签
	Annotations      map[string]string    `json:"annotations" gorm:"type:text;serializer:json"` // 节点注解
	Conditions       []core.NodeCondition `json:"conditions" gorm:"type:text;serializer:json"`  // 节点条件
	Taints           []core.Taint         `json:"taints" gorm:"type:text;serializer:json"`      // 节点污点
	CreatedAt        time.Time            `json:"created_at"`                                   // 创建时间
	UpdatedAt        time.Time            `json:"updated_at"`                                   // 更新时间
	RawNode          *core.Node           `json:"-"`                                            // 原始 Node 对象,不序列化到 JSON
}

K8sNode Kubernetes 节点

type K8sPV

type K8sPV struct {
	Name            string                   `json:"name" binding:"required,min=1,max=200"` // PV名称
	ClusterID       int                      `json:"cluster_id" gorm:"index;not null"`      // 所属集群ID
	UID             string                   `json:"uid" gorm:"size:100"`                   // PV UID
	Capacity        string                   `json:"capacity"`                              // 存储容量
	AccessModes     []string                 `json:"access_modes"`                          // 访问模式
	ReclaimPolicy   string                   `json:"reclaim_policy"`                        // 回收策略
	StorageClass    string                   `json:"storage_class"`                         // 存储类
	VolumeMode      string                   `json:"volume_mode"`                           // 卷模式
	Status          K8sPVStatus              `json:"status"`                                // PV状态
	ClaimRef        map[string]string        `json:"claim_ref"`                             // 绑定的PVC信息
	VolumeSource    map[string]interface{}   `json:"volume_source"`                         // 卷源配置
	NodeAffinity    map[string]interface{}   `json:"node_affinity"`                         // 节点亲和性
	Labels          map[string]string        `json:"labels"`                                // 标签
	Annotations     map[string]string        `json:"annotations"`                           // 注解
	ResourceVersion string                   `json:"resource_version"`                      // 资源版本
	CreatedAt       time.Time                `json:"created_at"`                            // 创建时间
	Age             string                   `json:"age"`                                   // 存活时长
	RawPV           *corev1.PersistentVolume `json:"-"`                                     // 原始PV对象,不序列化
}

K8sPV Kubernetes PersistentVolume

type K8sPVC

type K8sPVC struct {
	Name            string                        `json:"name" binding:"required,min=1,max=200"`      // PVC名称
	Namespace       string                        `json:"namespace" binding:"required,min=1,max=200"` // 所属命名空间
	ClusterID       int                           `json:"cluster_id" gorm:"index;not null"`           // 所属集群ID
	UID             string                        `json:"uid" gorm:"size:100"`                        // PVC UID
	Capacity        string                        `json:"capacity"`                                   // 实际容量
	RequestStorage  string                        `json:"request_storage"`                            // 请求存储
	AccessModes     []string                      `json:"access_modes"`                               // 访问模式
	StorageClass    string                        `json:"storage_class"`                              // 存储类
	VolumeMode      string                        `json:"volume_mode"`                                // 卷模式
	Status          K8sPVCStatus                  `json:"status"`                                     // PVC状态
	VolumeName      string                        `json:"volume_name"`                                // 绑定的PV名称
	Selector        map[string]string             `json:"selector"`                                   // 选择器
	Labels          map[string]string             `json:"labels"`                                     // 标签
	Annotations     map[string]string             `json:"annotations"`                                // 注解
	ResourceVersion string                        `json:"resource_version"`                           // 资源版本
	CreatedAt       time.Time                     `json:"created_at"`                                 // 创建时间
	Age             string                        `json:"age"`                                        // 年龄
	RawPVC          *corev1.PersistentVolumeClaim `json:"-"`                                          // 原始PVC对象,不序列化到JSON
}

K8sPVC Kubernetes PersistentVolumeClaim

type K8sPVCStatus

type K8sPVCStatus int8

K8sPVCStatus PVC状态枚举

const (
	K8sPVCStatusPending     K8sPVCStatus = iota + 1 // 等待中
	K8sPVCStatusBound                               // 已绑定
	K8sPVCStatusLost                                // 丢失
	K8sPVCStatusTerminating                         // 终止中
	K8sPVCStatusUnknown                             // 未知
)

type K8sPVStatus

type K8sPVStatus int8

K8sPVStatus PV状态枚举

const (
	K8sPVStatusAvailable K8sPVStatus = iota + 1 // 可用
	K8sPVStatusBound                            // 已绑定
	K8sPVStatusReleased                         // 已释放
	K8sPVStatusFailed                           // 失败
	K8sPVStatusUnknown                          // 未知
)

type K8sPod

type K8sPod struct {
	ClusterID         int64      `json:"cluster_id"`         // 集群ID
	Name              string     `json:"name"`               // Pod名称
	Namespace         string     `json:"namespace"`          // 所属命名空间
	UID               string     `json:"uid"`                // Pod UID
	Labels            string     `json:"labels"`             // 标签(JSON字符串)
	Annotations       string     `json:"annotations"`        // 注解(JSON字符串)
	Status            string     `json:"status"`             // Pod状态
	Phase             string     `json:"phase"`              // Pod阶段
	NodeName          string     `json:"node_name"`          // 所在节点
	PodIP             string     `json:"pod_ip"`             // Pod IP地址
	HostIP            string     `json:"host_ip"`            // 宿主机IP地址
	QosClass          string     `json:"qos_class"`          // QoS等级
	RestartCount      int32      `json:"restart_count"`      // 重启次数
	Ready             string     `json:"ready"`              // 就绪状态(如"1/1")
	ServiceAccount    string     `json:"service_account"`    // 服务账户
	RestartPolicy     string     `json:"restart_policy"`     // 重启策略
	DNSPolicy         string     `json:"dns_policy"`         // DNS策略
	Conditions        string     `json:"conditions"`         // Pod条件(JSON字符串)
	Containers        string     `json:"containers"`         // 容器列表(JSON字符串)
	InitContainers    string     `json:"init_containers"`    // 初始化容器列表(JSON字符串)
	Volumes           string     `json:"volumes"`            // 卷列表(JSON字符串)
	CreationTimestamp time.Time  `json:"creation_timestamp"` // 创建时间
	StartTime         *time.Time `json:"start_time"`         // 启动时间
	DeletionTimestamp *time.Time `json:"deletion_timestamp"` // 删除时间戳
	OwnerReferences   string     `json:"owner_references"`   // 所有者引用(JSON字符串)
	ResourceVersion   string     `json:"resource_version"`   // 资源版本
	Generation        int64      `json:"generation"`         // 生成版本号
	Spec              string     `json:"spec"`               // Pod规格(JSON字符串)
}

K8sPod Kubernetes Pod模型

type K8sRole

type K8sRole struct {
	Name              string            `json:"name"`
	Namespace         string            `json:"namespace"`
	ClusterID         int               `json:"cluster_id"`
	UID               string            `json:"uid"`
	CreationTimestamp string            `json:"creation_timestamp"`
	Labels            map[string]string `json:"labels"`
	Annotations       map[string]string `json:"annotations"`
	Rules             []PolicyRule      `json:"rules"`
	ResourceVersion   string            `json:"resource_version"`
	Age               string            `json:"age"`
	RawRole           *rbacv1.Role      `json:"-"` // 原始Role对象,不序列化
}

K8sRole Role主model

type K8sRoleBinding

type K8sRoleBinding struct {
	Name              string              `json:"name"`
	Namespace         string              `json:"namespace"`
	ClusterID         int                 `json:"cluster_id"`
	UID               string              `json:"uid"`
	CreationTimestamp string              `json:"creation_timestamp"`
	Labels            map[string]string   `json:"labels"`
	Annotations       map[string]string   `json:"annotations"`
	RoleRef           RoleRef             `json:"role_ref"`
	Subjects          []Subject           `json:"subjects"`
	ResourceVersion   string              `json:"resource_version"`
	Age               string              `json:"age"`
	RawRoleBinding    *rbacv1.RoleBinding `json:"-"` // 原始RoleBinding对象,不序列化
}

K8sRoleBinding RoleBinding主model

type K8sSecret

type K8sSecret struct {
	Name        string            `json:"name" binding:"required,min=1,max=200"`      // Secret名称
	Namespace   string            `json:"namespace" binding:"required,min=1,max=200"` // 所属命名空间
	ClusterID   int               `json:"cluster_id" gorm:"index;not null"`           // 所属集群ID
	UID         string            `json:"uid" gorm:"size:100"`                        // Secret UID
	Type        K8sSecretType     `json:"type"`                                       // Secret类型
	Data        map[string][]byte `json:"data"`                                       // 加密数据
	StringData  map[string]string `json:"string_data"`                                // 明文数据
	Labels      map[string]string `json:"labels"`                                     // 标签
	Annotations map[string]string `json:"annotations"`                                // 注解
	Immutable   bool              `json:"immutable"`                                  // 是否不可变
	DataCount   int               `json:"data_count"`                                 // 数据条目数量
	Size        string            `json:"size"`                                       // 数据大小
	Age         string            `json:"age"`                                        // 存在时间
	CreatedAt   time.Time         `json:"created_at"`                                 // 创建时间
	UpdatedAt   time.Time         `json:"updated_at"`                                 // 更新时间
	RawSecret   *corev1.Secret    `json:"-"`                                          // 原始 Secret 对象,不序列化到 JSON
}

K8sSecret Kubernetes Secret

type K8sSecretType

type K8sSecretType string

K8sSecretType Secret类型枚举

const (
	K8sSecretTypeOpaque              K8sSecretType = "Opaque"                              // 通用Secret
	K8sSecretTypeServiceAccountToken K8sSecretType = "kubernetes.io/service-account-token" // ServiceAccount令牌
	K8sSecretTypeDockercfg           K8sSecretType = "kubernetes.io/dockercfg"             // Docker配置
	K8sSecretTypeDockerConfigJson    K8sSecretType = "kubernetes.io/dockerconfigjson"      // Docker配置JSON
	K8sSecretTypeBasicAuth           K8sSecretType = "kubernetes.io/basic-auth"            // 基础认证
	K8sSecretTypeSSHAuth             K8sSecretType = "kubernetes.io/ssh-auth"              // SSH认证
	K8sSecretTypeTLS                 K8sSecretType = "kubernetes.io/tls"                   // TLS证书
	K8sSecretTypeBootstrapToken      K8sSecretType = "bootstrap.kubernetes.io/token"       // 引导令牌
)

type K8sService

type K8sService struct {
	Name           string               `json:"name" binding:"required,min=1,max=200"`      // Service名称
	Namespace      string               `json:"namespace" binding:"required,min=1,max=200"` // 所属命名空间
	ClusterID      int                  `json:"cluster_id"`                                 // 所属集群ID
	UID            string               `json:"uid"`                                        // Service UID
	Type           string               `json:"type"`                                       // Service类型
	ClusterIP      string               `json:"cluster_ip"`                                 // 集群内部IP
	ExternalIPs    []string             `json:"external_ips"`                               // 外部IP列表
	LoadBalancerIP string               `json:"load_balancer_ip"`                           // 负载均衡器IP
	Ports          []ServicePort        `json:"ports"`                                      // 端口配置
	Selector       map[string]string    `json:"selector"`                                   // Pod选择器
	Labels         map[string]string    `json:"labels"`                                     // 标签
	Annotations    map[string]string    `json:"annotations"`                                // 注解
	CreatedAt      time.Time            `json:"created_at"`                                 // 创建时间
	Age            string               `json:"age"`                                        // 存在时间,前端计算使用
	Status         K8sSvcStatus         `json:"status" binding:"required"`                  // Service状态,前端计算使用
	Endpoints      []K8sServiceEndpoint `json:"endpoints"`                                  // 服务端点,前端使用
}

K8sService k8s service

type K8sServiceAccount

type K8sServiceAccount struct {
	Name                         string                 `json:"name"`
	Namespace                    string                 `json:"namespace"`
	ClusterID                    int                    `json:"cluster_id"`
	UID                          string                 `json:"uid"`
	CreationTimestamp            string                 `json:"creation_timestamp"`
	Labels                       map[string]string      `json:"labels"`
	Annotations                  map[string]string      `json:"annotations"`
	AutomountServiceAccountToken *bool                  `json:"automount_service_account_token"`
	ImagePullSecrets             []string               `json:"image_pull_secrets"`
	Secrets                      []string               `json:"secrets"`
	ResourceVersion              string                 `json:"resource_version"`
	Age                          string                 `json:"age"`
	RawServiceAccount            *corev1.ServiceAccount `json:"-"` // 原始ServiceAccount对象,不序列化
}

K8sServiceAccount ServiceAccount主model

type K8sServiceEndpoint

type K8sServiceEndpoint struct {
	IP       string `json:"ip"`       // 端点IP
	Port     int32  `json:"port"`     // 端点端口
	Protocol string `json:"protocol"` // 端口协议
	Ready    bool   `json:"ready"`    // 端点是否就绪
}

K8sServiceEndpoint k8s service端点信息

type K8sStatefulSet

type K8sStatefulSet struct {
	Name                 string                 `json:"name" binding:"required,min=1,max=200"`      // StatefulSet名称
	Namespace            string                 `json:"namespace" binding:"required,min=1,max=200"` // 所属命名空间
	ClusterID            int                    `json:"cluster_id" gorm:"index;not null"`           // 所属集群ID
	UID                  string                 `json:"uid" gorm:"size:100"`                        // StatefulSet UID
	Replicas             int32                  `json:"replicas"`                                   // 期望副本数
	ReadyReplicas        int32                  `json:"ready_replicas"`                             // 就绪副本数
	CurrentReplicas      int32                  `json:"current_replicas"`                           // 当前副本数
	UpdatedReplicas      int32                  `json:"updated_replicas"`                           // 更新副本数
	ServiceName          string                 `json:"service_name"`                               // 服务名称
	UpdateStrategy       string                 `json:"update_strategy"`                            // 更新策略
	RevisionHistoryLimit int32                  `json:"revision_history_limit"`                     // 历史版本限制
	PodManagementPolicy  string                 `json:"pod_management_policy"`                      // Pod管理策略
	Selector             map[string]string      `json:"selector"`                                   // 选择器
	Labels               map[string]string      `json:"labels"`                                     // 标签
	Annotations          map[string]string      `json:"annotations"`                                // 注解
	Images               []string               `json:"images"`                                     // 容器镜像列表
	Status               K8sStatefulSetStatus   `json:"status"`                                     // StatefulSet状态
	Conditions           []StatefulSetCondition `json:"conditions"`                                 // StatefulSet条件
	CreatedAt            time.Time              `json:"created_at"`                                 // 创建时间
	UpdatedAt            time.Time              `json:"updated_at"`                                 // 更新时间
	RawStatefulSet       *appsv1.StatefulSet    `json:"-"`                                          // 原始 StatefulSet 对象,不序列化到 JSON
}

type K8sStatefulSetHistory

type K8sStatefulSetHistory struct {
	Revision int64     `json:"revision"` // 版本
	Date     time.Time `json:"date"`     // 日期
	Message  string    `json:"message"`  // 消息
}

K8sStatefulSetHistory StatefulSet版本历史

type K8sStatefulSetStatus

type K8sStatefulSetStatus int8
const (
	K8sStatefulSetStatusRunning  K8sStatefulSetStatus = iota + 1 // 运行中
	K8sStatefulSetStatusStopped                                  // 停止
	K8sStatefulSetStatusUpdating                                 // 更新中
	K8sStatefulSetStatusError                                    // 异常
)

type K8sSvcStatus

type K8sSvcStatus int8

K8sSvcStatus Service状态枚举

const (
	K8sSvcStatusRunning K8sSvcStatus = iota + 1 // 运行中
	K8sSvcStatusStopped                         // 停止
	K8sSvcStatusError                           // 异常
)

type K8sYaml

type K8sYaml struct {
	YAML string `json:"yaml"`
}

type K8sYamlTask

type K8sYamlTask struct {
	Model
	Name        string     `json:"name" gorm:"type:varchar(255);comment:YAML任务名称"`                // YAML任务名称
	UserID      int        `json:"user_id" gorm:"comment:创建者用户ID"`                                // 创建者用户ID
	TemplateID  int        `json:"template_id" gorm:"comment:关联的模板ID"`                            // 关联的模板ID
	ClusterID   int        `json:"cluster_id" gorm:"comment:集群ID"`                                // 集群ID
	Variables   StringList `json:"variables,omitempty" gorm:"type:text;comment:YAML变量,格式k=v,k=v"` // YAML变量
	Status      string     `json:"status,omitempty" gorm:"comment:当前状态"`                          // 当前状态
	ApplyResult string     `json:"apply_result,omitempty" gorm:"comment:apply后的返回数据"`             // apply结果
}

K8sYamlTask Kubernetes YAML 任务的配置

func (*K8sYamlTask) TableName

func (r *K8sYamlTask) TableName() string

type K8sYamlTemplate

type K8sYamlTemplate struct {
	Model
	Name      string `json:"name" binding:"required,min=1,max=50" gorm:"size:100;comment:模板名称"` // 模板名称
	UserID    int    `json:"user_id" gorm:"comment:创建者用户ID"`                                    // 创建者用户ID
	Content   string `json:"content" binding:"required" gorm:"type:text;comment:YAML模板内容"`      // YAML模板内容
	ClusterID int    `json:"cluster_id" gorm:"comment:对应集群ID"`                                  // 对应集群ID
}

K8sYamlTemplate Kubernetes YAML 模板的配置

func (*K8sYamlTemplate) TableName

func (r *K8sYamlTemplate) TableName() string

type KeyValue

type KeyValue struct {
	Key   string `json:"key" gorm:"size:128;index;comment:键"` // 键
	Value string `json:"value" gorm:"size:256;comment:值"`     // 值
}

KeyValue 用于存储单个键值对

func (*KeyValue) FromMap

func (kv *KeyValue) FromMap(m map[string]string)

FromMap 从 map[string]string 填充 KeyValue(取第一个键值对)

func (*KeyValue) ToMap

func (kv *KeyValue) ToMap() map[string]string

ToMap 转为 map[string]string

type KeyValueList

type KeyValueList []KeyValue

KeyValueList 表示一组键值对,通常用于存储标签(tags)等场景

func (*KeyValueList) AddTag

func (kvl *KeyValueList) AddTag(key, value string)

AddTag 添加标签,如果键已存在则更新值

func (KeyValueList) FilterByKey

func (kvl KeyValueList) FilterByKey(prefix string) KeyValueList

FilterByKey 根据键前缀过滤标签

func (*KeyValueList) FromMap

func (kvl *KeyValueList) FromMap(m map[string]string)

FromMap 从 map[string]string 填充 KeyValueList,常用于从配置或查询结果构建标签

func (KeyValueList) GetTag

func (kvl KeyValueList) GetTag(key string) (string, bool)

GetTag 获取指定键的标签值

func (KeyValueList) HasTag

func (kvl KeyValueList) HasTag(key string) bool

HasTag 判断是否包含指定键的标签

func (KeyValueList) IsEmpty

func (kvl KeyValueList) IsEmpty() bool

IsEmpty 判断标签列表是否为空

func (KeyValueList) Keys

func (kvl KeyValueList) Keys() []string

Keys 获取所有标签键

func (KeyValueList) MarshalJSON

func (kvl KeyValueList) MarshalJSON() ([]byte, error)

MarshalJSON 实现 json.Marshaler 接口

func (*KeyValueList) RemoveTag

func (kvl *KeyValueList) RemoveTag(key string)

RemoveTag 删除指定键的标签

func (*KeyValueList) Scan

func (kvl *KeyValueList) Scan(val interface{}) error

Scan 实现 sql.Scanner 接口,用于数据库读取

func (KeyValueList) String

func (kvl KeyValueList) String() string

String 返回标签的字符串表示,格式: {key1=value1, key2=value2}

func (KeyValueList) ToMap

func (kvl KeyValueList) ToMap() map[string]string

ToMap 转为 map[string]string,常用于标签查询和处理

func (*KeyValueList) UnmarshalJSON

func (kvl *KeyValueList) UnmarshalJSON(data []byte) error

UnmarshalJSON 实现 json.Unmarshaler 接口

func (KeyValueList) Value

func (kvl KeyValueList) Value() (driver.Value, error)

Value 实现 driver.Valuer 接口,用于数据库存储

type ListApisRequest

type ListApisRequest struct {
	ListReq
	IsPublic int `json:"is_public" form:"is_public"` // 是否公开
	Method   int `json:"method" form:"method"`       // 请求方法
}

type ListAuditLogsRequest

type ListAuditLogsRequest struct {
	ListReq
	OperationType string `json:"operation_type" form:"operation_type"`
	TargetType    string `json:"target_type" form:"target_type"`
	StatusCode    int    `json:"status_code" form:"status_code"`
	StartTime     int64  `json:"start_time" form:"start_time"`
	EndTime       int64  `json:"end_time" form:"end_time"`
}

ListAuditLogsRequest 审计日志列表查询参数

type ListClustersReq

type ListClustersReq struct {
	ListReq
	Status string `json:"status" form:"status"`
	Env    string `json:"env" form:"env"`
}

ListClustersReq 获取集群列表请求

type ListReq

type ListReq struct {
	Page   int    `json:"page" form:"page" binding:"omitempty,min=1"`
	Size   int    `json:"size" form:"size" binding:"omitempty,min=10,max=100"`
	Search string `json:"search" form:"search" binding:"omitempty"`
}

ListReq 通用列表请求

type ListResp

type ListResp[T any] struct {
	Items []T   `json:"items"` // 数据列表
	Total int64 `json:"total"` // 总数
}

ListResp 列表响应

type ListRolesRequest

type ListRolesRequest struct {
	ListReq
	Status *int `json:"status" form:"status" binding:"omitempty,oneof=0 1"` // 状态筛选,可选
}

type ListWorkorderCategoryReq

type ListWorkorderCategoryReq struct {
	ListReq
	Status *int8 `json:"status" form:"status" binding:"omitempty,oneof=1 2"`
}

ListWorkorderCategoryReq 工单分类列表请求

type ListWorkorderFormDesignReq

type ListWorkorderFormDesignReq struct {
	ListReq
	CategoryID *int  `json:"category_id" form:"category_id" binding:"omitempty,min=1"`
	Status     *int8 `json:"status" form:"status" binding:"omitempty,oneof=1 2 3"`
	IsTemplate *int8 `json:"is_template" form:"is_template" binding:"omitempty,oneof=1 2"`
}

ListWorkorderFormDesignReq 获取工单表单设计列表请求

type ListWorkorderInstanceCommentReq

type ListWorkorderInstanceCommentReq struct {
	ListReq
	InstanceID *int    `json:"instance_id" form:"instance_id" binding:"omitempty,min=1"`
	Type       *string `json:"type" form:"type" binding:"omitempty,oneof=normal system"`
	Status     *int8   `json:"status" form:"status" binding:"omitempty,oneof=1 2 3"`
}

ListWorkorderInstanceCommentReq 工单实例评论列表请求

type ListWorkorderInstanceFlowReq

type ListWorkorderInstanceFlowReq struct {
	ListReq
	InstanceID     *int    `json:"instance_id" form:"instance_id" binding:"omitempty,min=1"`
	Action         *string `json:"action" form:"action" binding:"omitempty,oneof=submit approve reject assign cancel complete return"`
	IsSystemAction *int8   `json:"is_system_action" form:"is_system_action" binding:"omitempty,oneof=1 2"`
}

ListWorkorderInstanceFlowReq 工单流转记录列表请求

type ListWorkorderInstanceReq

type ListWorkorderInstanceReq struct {
	ListReq
	Status    *int8 `json:"status" form:"status" binding:"omitempty,oneof=1 2 3 4 5 6"`
	Priority  *int8 `json:"priority" form:"priority" binding:"omitempty,oneof=1 2 3"`
	ProcessID *int  `json:"process_id" form:"process_id" binding:"omitempty,min=1"`
}

工单列表请求

type ListWorkorderInstanceTimelineReq

type ListWorkorderInstanceTimelineReq struct {
	ListReq
	InstanceID *int       `json:"instance_id" form:"instance_id" binding:"omitempty,min=1"`
	Action     *string    `` /* 153-byte string literal not displayed */
	StartDate  *time.Time `json:"start_date" form:"start_date" binding:"omitempty"`
	EndDate    *time.Time `json:"end_date" form:"end_date" binding:"omitempty"`
}

ListWorkorderInstanceTimelineReq 工单操作时间线列表请求

type ListWorkorderNotificationLogReq

type ListWorkorderNotificationLogReq struct {
	Page           int    `json:"page" form:"page"`
	PageSize       int    `json:"page_size" form:"page_size"`
	NotificationID *int   `json:"notification_id" form:"notification_id"`
	InstanceID     *int   `json:"instance_id" form:"instance_id"`
	EventType      string `json:"event_type" form:"event_type"`
	Channel        string `json:"channel" form:"channel"`
	RecipientType  string `json:"recipient_type" form:"recipient_type"`
	RecipientID    string `json:"recipient_id" form:"recipient_id"`
	Status         *int8  `json:"status" form:"status"`
}

ListWorkorderNotificationLogReq 工单通知发送记录列表

type ListWorkorderNotificationQueueReq

type ListWorkorderNotificationQueueReq struct {
	Page           int    `json:"page" form:"page"`
	PageSize       int    `json:"page_size" form:"page_size"`
	NotificationID *int   `json:"notification_id" form:"notification_id"`
	InstanceID     *int   `json:"instance_id" form:"instance_id"`
	EventType      string `json:"event_type" form:"event_type"`
	Channel        string `json:"channel" form:"channel"`
	RecipientType  string `json:"recipient_type" form:"recipient_type"`
	RecipientID    string `json:"recipient_id" form:"recipient_id"`
	Status         *int8  `json:"status" form:"status"`
	Priority       *int8  `json:"priority" form:"priority"`
}

ListWorkorderNotificationQueueReq 工单通知队列列表

type ListWorkorderNotificationReq

type ListWorkorderNotificationReq struct {
	Page       int    `json:"page" form:"page"`
	PageSize   int    `json:"page_size" form:"page_size"`
	Name       string `json:"name" form:"name"`
	ProcessID  *int   `json:"process_id" form:"process_id"`
	TemplateID *int   `json:"template_id" form:"template_id"`
	CategoryID *int   `json:"category_id" form:"category_id"`
	Status     *int8  `json:"status" form:"status"`
	IsDefault  *int8  `json:"is_default" form:"is_default" binding:"omitempty,oneof=1 2"`
}

ListWorkorderNotificationReq 通知配置列表

type ListWorkorderProcessReq

type ListWorkorderProcessReq struct {
	ListReq
	CategoryID   *int  `json:"category_id" form:"category_id" binding:"omitempty,min=1"`
	FormDesignID *int  `json:"form_design_id" form:"form_design_id" binding:"omitempty,min=1"`
	Status       *int8 `json:"status" form:"status" binding:"omitempty,oneof=1 2 3"`
	IsDefault    *int8 `json:"is_default" form:"is_default" binding:"omitempty,oneof=1 2"`
}

ListWorkorderProcessReq 工单流程列表请求

type ListWorkorderTemplateReq

type ListWorkorderTemplateReq struct {
	ListReq
	CategoryID   *int  `json:"category_id" form:"category_id" binding:"omitempty,min=1"`
	ProcessID    *int  `json:"process_id" form:"process_id" binding:"omitempty,min=1"`
	FormDesignID *int  `json:"form_design_id" form:"form_design_id" binding:"omitempty,min=1"`
	Status       *int8 `json:"status" form:"status" binding:"omitempty,oneof=1 2"`
}

ListWorkorderTemplateReq 工单模板列表请求

type ManualSendNotificationReq

type ManualSendNotificationReq struct {
	Channels  []string `json:"channels" binding:"required"`  // 通知渠道列表
	Recipient string   `json:"recipient" binding:"required"` // 接收人地址
	Subject   string   `json:"subject" binding:"required"`   // 通知主题
	Content   string   `json:"content" binding:"required"`   // 通知内容
}

ManualSendNotificationReq 手动发送通知请求

type Model

type Model struct {
	ID        int                   `json:"id" gorm:"primaryKey;autoIncrement;comment:主键ID"`
	CreatedAt time.Time             `json:"created_at" gorm:"autoCreateTime;comment:创建时间"`
	UpdatedAt time.Time             `json:"updated_at" gorm:"autoUpdateTime;comment:更新时间"`
	DeletedAt soft_delete.DeletedAt `json:"deleted_at" gorm:"index;comment:删除时间"`
}

Model 通用基础模型

type MonitorAlertEvent

type MonitorAlertEvent struct {
	Model
	AlertName     string                  `json:"alert_name" binding:"required,min=1,max=200" gorm:"size:200;not null;comment:告警名称"`
	Fingerprint   string                  `` /* 147-byte string literal not displayed */
	Status        MonitorAlertEventStatus `json:"status" gorm:"not null;default:1;index;comment:告警状态(1:触发 2:静默 3:认领 4:恢复)"`
	RuleID        int                     `json:"rule_id" gorm:"index;not null;comment:关联的告警规则ID"`
	SendGroupID   int                     `json:"send_group_id" gorm:"index;not null;comment:关联的发送组ID"`
	EventTimes    int                     `json:"event_times" gorm:"not null;default:1;comment:触发次数"`
	SilenceID     string                  `json:"silence_id" gorm:"size:100;comment:AlertManager返回的静默ID"`
	RenLingUserID int                     `json:"ren_ling_user_id" gorm:"index;comment:认领告警的用户ID"`
	Labels        StringList              `json:"labels" gorm:"type:text;not null;comment:标签组,格式为key=value"`
	SendGroup     *MonitorSendGroup       `json:"send_group" gorm:"-"`
	RenLingUser   *User                   `json:"ren_ling_user" gorm:"-"`
	LabelsMap     map[string]string       `json:"labels_map" gorm:"-"`
}

MonitorAlertEvent 告警事件模型

func (*MonitorAlertEvent) TableName

func (m *MonitorAlertEvent) TableName() string

type MonitorAlertEventStatus

type MonitorAlertEventStatus int8

MonitorAlertEventStatus 告警事件状态

const (
	MonitorAlertEventStatusFiring   MonitorAlertEventStatus = iota + 1 // 告警触发
	MonitorAlertEventStatusSilenced                                    // 告警静默
	MonitorAlertEventStatusClaimed                                     // 告警认领
	MonitorAlertEventStatusResolved                                    // 告警恢复
	MonitorAlertEventStatusUpgraded                                    // 告警升级
)

type MonitorAlertManagerPool

type MonitorAlertManagerPool struct {
	Model
	Name                  string     `json:"name" binding:"required,min=1,max=50" gorm:"size:100;not null;comment:AlertManager实例池名称"`
	AlertManagerInstances StringList `json:"alert_manager_instances" gorm:"type:text;not null;comment:AlertManager实例列表"`
	UserID                int        `json:"user_id" gorm:"index;not null;comment:所属用户ID"`
	ResolveTimeout        string     `json:"resolve_timeout" gorm:"size:50;default:'5m';not null;comment:告警恢复超时时间"`
	GroupWait             string     `json:"group_wait" gorm:"size:50;default:'30s';not null;comment:首次告警等待时间"`
	GroupInterval         string     `json:"group_interval" gorm:"size:50;default:'5m';not null;comment:告警分组间隔时间"`
	RepeatInterval        string     `json:"repeat_interval" gorm:"size:50;default:'4h';not null;comment:重复告警间隔"`
	GroupBy               StringList `json:"group_by" gorm:"type:text;comment:告警分组标签列表"`
	Receiver              string     `json:"receiver" gorm:"size:100;not null;comment:默认接收者"`
	CreateUserName        string     `json:"create_user_name" gorm:"type:varchar(100);not null;comment:创建者名称"`
}

MonitorAlertManagerPool AlertManager实例池

func (*MonitorAlertManagerPool) TableName

func (m *MonitorAlertManagerPool) TableName() string

type MonitorAlertRule

type MonitorAlertRule struct {
	Model
	Name           string            `json:"name" binding:"required,min=1,max=50" gorm:"size:100;comment:告警规则名称"`
	UserID         int               `json:"user_id" gorm:"index;not null;comment:创建该告警规则的用户ID"`
	PoolID         int               `json:"pool_id" gorm:"index;not null;comment:关联的Prometheus实例池ID"`
	SendGroupID    int               `json:"send_group_id" gorm:"index;not null;comment:关联的发送组ID"`
	IpAddress      string            `json:"ip_address" gorm:"size:255;comment:IP地址"`
	Enable         int8              `json:"enable" gorm:"type:tinyint(1);default:1;not null;comment:是否启用告警规则(1:启用,2:禁用)"`
	Expr           string            `json:"expr" gorm:"type:text;not null;comment:告警规则表达式"`
	Severity       AlertRuleSeverity `json:"severity" gorm:"type:tinyint(1);default:2;not null;comment:告警级别(1:info,2:warning,3:critical)"`
	GrafanaLink    string            `json:"grafana_link" gorm:"type:text;comment:Grafana大盘链接"`
	ForTime        string            `json:"for_time" gorm:"size:50;default:'5m';not null;comment:持续时间"`
	Labels         StringList        `json:"labels" gorm:"type:text;comment:标签组(key=value)"`
	Annotations    StringList        `json:"annotations" gorm:"type:text;comment:注解(key=value)"`
	CreateUserName string            `json:"create_user_name" gorm:"type:varchar(100);not null;comment:创建者名称"`
	PoolName       string            `json:"pool_name" gorm:"-"`
	SendGroupName  string            `json:"send_group_name" gorm:"-"`
}

MonitorAlertRule 告警规则的配置

func (*MonitorAlertRule) TableName

func (m *MonitorAlertRule) TableName() string

type MonitorConfig

type MonitorConfig struct {
	Model
	Name              string `json:"name" gorm:"size:100;not null;comment:配置名称"`
	PoolID            int    `json:"pool_id" gorm:"index;not null;comment:关联的池ID"`
	InstanceIP        string `json:"instance_ip" gorm:"size:45;not null;index;comment:实例IP地址"`
	ConfigType        int8   `` /* 169-byte string literal not displayed */
	ConfigContent     string `json:"config_content" gorm:"type:longtext;not null;comment:配置内容(YAML格式)"`
	ConfigHash        string `json:"config_hash" gorm:"size:64;not null;index;comment:配置内容的哈希值"`
	Status            int8   `json:"status" gorm:"type:tinyint;default:1;not null;comment:配置状态(1:激活,2:非激活)"`
	LastGeneratedTime int64  `json:"last_generated_time" gorm:"not null;comment:最后生成时间(Unix时间戳)"`
}

MonitorConfig 监控配置模型 - 由缓存生成和管理

func (*MonitorConfig) TableName

func (m *MonitorConfig) TableName() string

type MonitorOnDutyChange

type MonitorOnDutyChange struct {
	Model
	OnDutyGroupID  int    `json:"on_duty_group_id" gorm:"index:idx_group_date_deleted_at;comment:值班组ID"`
	UserID         int    `json:"user_id" gorm:"index;comment:创建者ID"`
	Date           string `json:"date" gorm:"type:varchar(10);not null;index:idx_group_date_deleted_at;comment:换班日期"`
	OriginUserID   int    `json:"origin_user_id" gorm:"index;comment:原值班人ID"`
	OnDutyUserID   int    `json:"on_duty_user_id" gorm:"index;comment:新值班人ID"`
	CreateUserName string `json:"create_user_name" gorm:"type:varchar(100);not null;comment:创建者名称"`
	Reason         string `json:"reason" gorm:"type:varchar(255);comment:换班原因"`
}

MonitorOnDutyChange 值班换班记录

func (*MonitorOnDutyChange) TableName

func (m *MonitorOnDutyChange) TableName() string

type MonitorOnDutyGroup

type MonitorOnDutyGroup struct {
	Model
	Name                      string  `json:"name" binding:"required,min=1,max=50" gorm:"size:100;not null;comment:值班组名称"`
	UserID                    int     `json:"user_id" gorm:"index;comment:创建该值班组的用户ID"`
	ShiftDays                 int     `json:"shift_days" gorm:"type:int;not null;default:7;comment:轮班周期,以天为单位"`
	YesterdayNormalDutyUserID int     `json:"yesterday_normal_duty_user_id" gorm:"comment:昨天的正常排班值班人ID,由cron任务设置"`
	CreateUserName            string  `json:"create_user_name" gorm:"type:varchar(100);not null;comment:创建者名称"`
	Users                     []*User `json:"users" gorm:"many2many:cl_monitor_on_duty_group_users;comment:值班组成员列表,多对多关系"`
	Enable                    int8    `json:"enable" gorm:"type:tinyint(1);not null;default:1;comment:是否启用 1-启用 2-禁用"`
	Description               string  `json:"description" gorm:"type:varchar(255);comment:值班组描述"`
	TodayDutyUser             *User   `json:"today_duty_user" gorm:"-;comment:今日值班人"`
}

MonitorOnDutyGroup 值班组的配置

func (*MonitorOnDutyGroup) TableName

func (m *MonitorOnDutyGroup) TableName() string

type MonitorOnDutyHistory

type MonitorOnDutyHistory struct {
	Model
	OnDutyGroupID int    `json:"on_duty_group_id" gorm:"index:idx_group_date_deleted_at;comment:值班组ID"`
	DateString    string `json:"date_string" gorm:"type:varchar(10);not null;index:idx_group_date_deleted_at;comment:值班日期"`
	OnDutyUserID  int    `json:"on_duty_user_id" gorm:"index;comment:当天值班人员ID"`
	OriginUserID  int    `json:"origin_user_id" gorm:"index;comment:原计划值班人员ID"`
}

MonitorOnDutyHistory 值班历史记录

func (*MonitorOnDutyHistory) TableName

func (m *MonitorOnDutyHistory) TableName() string

type MonitorOnDutyOne

type MonitorOnDutyOne struct {
	Date       string `json:"date"`        // 值班日期
	User       *User  `json:"user"`        // 值班人信息
	OriginUser string `json:"origin_user"` // 原始值班人姓名
}

MonitorOnDutyOne 单日值班信息

type MonitorRecordRule

type MonitorRecordRule struct {
	Model
	Name           string     `json:"name" binding:"required,min=1,max=50" gorm:"size:100;not null;comment:记录规则名称"`
	UserID         int        `json:"user_id" gorm:"index;not null;comment:创建该记录规则的用户ID"`
	PoolID         int        `json:"pool_id" gorm:"index;not null;comment:关联的Prometheus实例池ID"`
	IpAddress      string     `json:"ip_address" gorm:"size:255;comment:IP地址"`
	Enable         int8       `json:"enable" gorm:"type:tinyint(1);default:1;not null;comment:是否启用记录规则(1:启用,2:禁用)"`
	Expr           string     `json:"expr" gorm:"type:text;not null;comment:记录规则表达式"`
	Labels         StringList `json:"labels" gorm:"type:text;comment:标签组(key=value)"`
	CreateUserName string     `json:"create_user_name" gorm:"type:varchar(100);not null;comment:创建者名称"`
	PoolName       string     `json:"pool_name" gorm:"-"`
}

MonitorRecordRule 记录规则的配置

func (*MonitorRecordRule) TableName

func (m *MonitorRecordRule) TableName() string

type MonitorScrapeJob

type MonitorScrapeJob struct {
	Model
	Name                     string               `json:"name" binding:"required,min=1,max=50" gorm:"size:100;comment:采集任务名称"`
	UserID                   int                  `json:"user_id" gorm:"index;not null;comment:任务关联的用户ID"`
	Enable                   int8                 `json:"enable" gorm:"type:tinyint(1);default:2;not null;index;comment:是否启用采集任务: 1-启用, 2-禁用"`
	ServiceDiscoveryType     ServiceDiscoveryType `json:"service_discovery_type" gorm:"type:tinyint(1);not null;default:1;comment:服务发现类型(1-k8s, 2-http, 3-static)"`
	MetricsPath              string               `json:"metrics_path" gorm:"size:255;not null;default:'/metrics';comment:监控采集的路径"`
	Scheme                   string               `json:"scheme" gorm:"size:10;not null;default:'http';comment:监控采集的协议方案(http/https)"`
	ScrapeInterval           int                  `json:"scrape_interval" gorm:"default:30;not null;comment:采集的时间间隔(秒)"`
	ScrapeTimeout            int                  `json:"scrape_timeout" gorm:"default:10;not null;comment:采集的超时时间(秒)"`
	PoolID                   int                  `json:"pool_id" gorm:"index;not null;comment:关联的采集池ID"`
	RelabelConfigsYamlString string               `json:"relabel_configs_yaml_string" gorm:"type:text;comment:relabel配置的YAML字符串"`
	RefreshInterval          int                  `json:"refresh_interval" gorm:"default:300;not null;comment:刷新目标的时间间隔(秒)"`
	Port                     int                  `json:"port" gorm:"default:9090;not null;comment:采集端口号"`
	IpAddress                string               `json:"ip_address" gorm:"size:255;comment:IP地址"`
	KubeConfigFilePath       string               `json:"kube_config_file_path" gorm:"size:255;comment:K8s配置文件路径"`
	TlsCaFilePath            string               `json:"tls_ca_file_path" gorm:"size:255;comment:TLS CA证书文件路径"`
	TlsCaContent             string               `json:"tls_ca_content" gorm:"type:text;comment:TLS CA证书内容"`
	BearerToken              string               `json:"bearer_token" gorm:"type:text;comment:鉴权Token内容"`
	BearerTokenFile          string               `json:"bearer_token_file" gorm:"size:255;comment:鉴权Token文件路径"`
	KubernetesSdRole         string               `json:"kubernetes_sd_role" gorm:"size:50;default:'pod';comment:K8s服务发现角色"`
	CreateUserName           string               `json:"create_user_name" gorm:"type:varchar(50);comment:创建用户名称"`
	TreeNodeIDs              StringList           `json:"tree_node_ids" gorm:"type:text;comment:树节点ID列表"`
	Tags                     StringList           `json:"tags" gorm:"type:text;comment:标签"`
}

MonitorScrapeJob 监控采集任务的配置

func (*MonitorScrapeJob) TableName

func (m *MonitorScrapeJob) TableName() string

type MonitorScrapePool

type MonitorScrapePool struct {
	Model
	Name                 string     `json:"name" binding:"required,min=1,max=50" gorm:"size:100;not null;comment:pool池名称"`
	UserID               int        `json:"user_id" gorm:"index;not null;comment:所属用户ID"`
	ScrapeInterval       int        `json:"scrape_interval" gorm:"default:30;type:smallint;not null;comment:采集间隔(秒)"`
	ScrapeTimeout        int        `json:"scrape_timeout" gorm:"default:10;type:smallint;not null;comment:采集超时(秒)"`
	RemoteTimeoutSeconds int        `json:"remote_timeout_seconds" gorm:"default:5;type:smallint;not null;comment:远程写入超时(秒)"`
	SupportAlert         int8       `json:"support_alert" gorm:"type:tinyint(1);default:2;not null;comment:告警支持(1:启用,2:禁用)"`
	SupportRecord        int8       `json:"support_record" gorm:"type:tinyint(1);default:2;not null;comment:预聚合支持(1:启用,2:禁用)"`
	PrometheusInstances  StringList `json:"prometheus_instances" gorm:"type:text;comment:Prometheus实例ID列表"`
	Tags                 StringList `json:"tags" gorm:"type:text;comment:标签"`
	RemoteWriteUrl       string     `json:"remote_write_url" gorm:"size:512;comment:远程写入地址"`
	RemoteReadUrl        string     `json:"remote_read_url" gorm:"size:512;comment:远程读取地址"`
	AlertManagerUrl      string     `json:"alert_manager_url" gorm:"size:512;comment:AlertManager地址"`
	RuleFilePath         string     `json:"rule_file_path" gorm:"size:512;comment:告警规则文件路径"`
	RecordFilePath       string     `json:"record_file_path" gorm:"size:512;comment:记录规则文件路径"`
	CreateUserName       string     `json:"create_user_name" gorm:"type:varchar(50);comment:创建人名称"`
}

MonitorScrapePool 采集池的配置

func (*MonitorScrapePool) TableName

func (m *MonitorScrapePool) TableName() string

type MonitorSendGroup

type MonitorSendGroup struct {
	Model
	Name                   string     `json:"name" binding:"required,min=1,max=50" gorm:"size:100;not null;comment:发送组英文名称"`
	NameZh                 string     `json:"name_zh" binding:"required,min=1,max=50" gorm:"size:100;not null;comment:发送组中文名称"`
	Enable                 int8       `json:"enable" gorm:"type:tinyint(1);default:1;not null;comment:是否启用发送组 1:启用 2:禁用"`
	UserID                 int        `json:"user_id" gorm:"index;not null;comment:创建该发送组的用户ID"`
	PoolID                 int        `json:"pool_id" gorm:"index;not null;comment:关联的AlertManager实例ID"`
	OnDutyGroupID          int        `json:"on_duty_group_id" gorm:"index;comment:值班组ID"`
	FeiShuQunRobotToken    string     `json:"fei_shu_qun_robot_token" gorm:"size:255;comment:飞书机器人Token"`
	RepeatInterval         string     `json:"repeat_interval" gorm:"size:50;default:'4h';comment:重复发送时间间隔"`
	SendResolved           int8       `json:"send_resolved" gorm:"type:tinyint(1);default:1;not null;comment:是否发送恢复通知 1:发送 2:不发送"`
	NotifyMethods          StringList `json:"notify_methods" gorm:"type:text;comment:通知方法列表"` // 例如: ["email", "feishu", "dingtalk"]
	NeedUpgrade            int8       `json:"need_upgrade" gorm:"type:tinyint(1);default:0;not null;comment:是否需要告警升级 1:需要 2:不需要"`
	UpgradeMinutes         int        `json:"upgrade_minutes" gorm:"default:30;comment:告警升级等待时间(分钟)"`
	StaticReceiveUsers     []*User    `` /* 126-byte string literal not displayed */
	FirstUpgradeUsers      []*User    `json:"first_upgrade_users" gorm:"many2many:cl_monitor_send_group_first_upgrade_users;comment:第一级升级人列表"`
	SecondUpgradeUsers     []*User    `json:"second_upgrade_users" gorm:"many2many:cl_monitor_send_group_second_upgrade_users;comment:第二级升级人列表"`
	CreateUserName         string     `json:"create_user_name" gorm:"type:varchar(100);not null;comment:创建该发送组的用户名称"`
	StaticReceiveUserNames []string   `json:"static_receive_user_names" gorm:"-"`
	FirstUserNames         []string   `json:"first_user_names" gorm:"-"`
	SecondUserNames        []string   `json:"second_user_names" gorm:"-"`
}

MonitorSendGroup 发送组的配置

func (*MonitorSendGroup) TableName

func (m *MonitorSendGroup) TableName() string

type MoveTreeNodeReq

type MoveTreeNodeReq struct {
	ID          int `json:"id" form:"id" binding:"required"`
	NewParentID int `json:"new_parent_id" form:"new_parent_id" binding:"required"` // 新父节点ID,必填
}

MoveTreeNodeReq 移动节点请求

type NodeCordonReq

type NodeCordonReq struct {
	ClusterID int    `json:"cluster_id" binding:"required"` // 集群ID
	NodeName  string `json:"node_name" binding:"required"`  // 节点名称
}

NodeCordonReq 禁止节点调度请求

type NodeStatus

type NodeStatus int8

NodeStatus 节点状态枚举

const (
	NodeStatusReady              NodeStatus = iota + 1 // 就绪
	NodeStatusNotReady                                 // 未就绪
	NodeStatusSchedulingDisabled                       // 调度禁用
	NodeStatusUnknown                                  // 未知
	NodeStatusError                                    // 异常
)

type NodeTaint

type NodeTaint struct {
	Key    string `json:"key"`    // 污点键
	Value  string `json:"value"`  // 污点值
	Effect string `json:"effect"` // 污点效果
}

NodeTaint 节点污点

type NodeUncordonReq

type NodeUncordonReq struct {
	ClusterID int    `json:"cluster_id" binding:"required"` // 集群ID
	NodeName  string `json:"node_name" binding:"required"`  // 节点名称
}

NodeUncordonReq 解除节点调度限制请求

type PVCCondition

type PVCCondition struct {
	Type               string    `json:"type"`                 // 条件类型
	Status             string    `json:"status"`               // 条件状态
	LastUpdateTime     time.Time `json:"last_update_time"`     // 最后更新时间
	LastTransitionTime time.Time `json:"last_transition_time"` // 最后转换时间
	Reason             string    `json:"reason"`               // 原因
	Message            string    `json:"message"`              // 消息
}

PVCCondition PVC条件

type PVCSpec

type PVCSpec struct {
	RequestStorage string            `json:"request_storage"` // 请求存储
	AccessModes    []string          `json:"access_modes"`    // 访问模式
	StorageClass   string            `json:"storage_class"`   // 存储类
	VolumeMode     string            `json:"volume_mode"`     // 卷模式
	VolumeName     string            `json:"volume_name"`     // 指定PV名称
	Selector       map[string]string `json:"selector"`        // 选择器
}

PVCSpec 创建/更新PVC时的配置信息

type PauseDeploymentReq

type PauseDeploymentReq struct {
	ClusterID int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	Namespace string `json:"namespace" form:"namespace" binding:"required" comment:"命名空间"`   // 命名空间
	Name      string `json:"name" binding:"required" comment:"Deployment名称"`                 // Deployment名称
}

PauseDeploymentReq 暂停Deployment请求

type PermissionCheckResult

type PermissionCheckResult struct {
	Allowed bool   `json:"allowed"`
	Source  string `json:"source,omitempty"`
	Reason  string `json:"reason,omitempty"`
}

PermissionCheckResult 权限检查结果

type PermissionSource

type PermissionSource struct {
	Type        string `json:"type"` // Role, ClusterRole
	Name        string `json:"name"`
	Namespace   string `json:"namespace,omitempty"`
	BindingName string `json:"binding_name"`
}

PermissionSource 权限来源

type PodCondition

type PodCondition struct {
	Type               string    `json:"type"`                 // 条件类型
	Status             string    `json:"status"`               // 条件状态
	LastProbeTime      time.Time `json:"last_probe_time"`      // 最后探测时间
	LastTransitionTime time.Time `json:"last_transition_time"` // 最后转换时间
	Reason             string    `json:"reason"`               // 原因
	Message            string    `json:"message"`              // 消息
}

PodCondition Pod条件

type PodContainer

type PodContainer struct {
	Name            string                  `json:"name"`              // 容器名称
	Image           string                  `json:"image"`             // 容器镜像
	Command         []string                `json:"command"`           // 启动命令
	Args            []string                `json:"args"`              // 启动参数
	Envs            []PodEnvVar             `json:"envs"`              // 环境变量
	Ports           []PodContainerPort      `json:"ports"`             // 容器端口
	Resources       PodResourceRequirements `json:"resources"`         // 资源要求
	VolumeMounts    []PodVolumeMount        `json:"volume_mounts"`     // 卷挂载
	LivenessProbe   *PodProbe               `json:"liveness_probe"`    // 存活探测
	ReadinessProbe  *PodProbe               `json:"readiness_probe"`   // 就绪探测
	ImagePullPolicy string                  `json:"image_pull_policy"` // 镜像拉取策略
	Ready           bool                    `json:"ready"`             // 是否就绪
	RestartCount    int32                   `json:"restart_count"`     // 重启次数
	State           PodContainerState       `json:"state"`             // 容器状态
}

PodContainer Pod容器信息

type PodContainerPort

type PodContainerPort struct {
	Name          string `json:"name"`           // 端口名称
	ContainerPort int32  `json:"container_port"` // 容器端口号
	Protocol      string `json:"protocol"`       // 协议类型
}

PodContainerPort 容器端口

type PodContainerState

type PodContainerState struct {
	Waiting    *PodContainerStateWaiting    `json:"waiting"`    // 等待状态
	Running    *PodContainerStateRunning    `json:"running"`    // 运行状态
	Terminated *PodContainerStateTerminated `json:"terminated"` // 终止状态
}

PodContainerState 容器状态

type PodContainerStateRunning

type PodContainerStateRunning struct {
	StartedAt time.Time `json:"started_at"` // 开始时间
}

PodContainerStateRunning 容器运行状态

type PodContainerStateTerminated

type PodContainerStateTerminated struct {
	ExitCode    int32     `json:"exit_code"`    // 退出码
	Signal      int32     `json:"signal"`       // 信号
	Reason      string    `json:"reason"`       // 终止原因
	Message     string    `json:"message"`      // 终止消息
	StartedAt   time.Time `json:"started_at"`   // 开始时间
	FinishedAt  time.Time `json:"finished_at"`  // 结束时间
	ContainerID string    `json:"container_id"` // 容器ID
}

PodContainerStateTerminated 容器终止状态

type PodContainerStateWaiting

type PodContainerStateWaiting struct {
	Reason  string `json:"reason"`  // 等待原因
	Message string `json:"message"` // 等待消息
}

PodContainerStateWaiting 容器等待状态

type PodEnvVar

type PodEnvVar struct {
	Name  string `json:"name"`  // 环境变量名称
	Value string `json:"value"` // 环境变量值
}

PodEnvVar 环境变量

type PodExecReq

type PodExecReq struct {
	ClusterID int    `json:"cluster_id" uri:"cluster_id" binding:"required"` // 集群ID
	Namespace string `json:"namespace" uri:"namespace" binding:"required"`   // 命名空间
	PodName   string `json:"pod_name" uri:"name" binding:"required"`         // Pod名称 - 匹配路由参数:name
	Container string `json:"container" uri:"container" binding:"required"`   // 容器名称
	Shell     string `json:"shell" form:"shell"`                             // shell类型
}

PodExecReq Pod执行命令请求

type PodFileDownloadReq

type PodFileDownloadReq struct {
	ClusterID     int    `json:"cluster_id" uri:"cluster_id" binding:"required"` // 集群ID
	Namespace     string `json:"namespace" uri:"namespace" binding:"required"`   // 命名空间
	PodName       string `json:"pod_name" uri:"name" binding:"required"`         // Pod名称 - 匹配路由参数:name
	ContainerName string `json:"container" uri:"container" binding:"required"`   // 容器名称
	FilePath      string `json:"file_path" uri:"file_path" binding:"required"`   // 文件路径
}

PodFileDownloadReq Pod文件下载请求

type PodFileUploadReq

type PodFileUploadReq struct {
	ClusterID     int    `json:"cluster_id" uri:"cluster_id" binding:"required"` // 集群ID
	Namespace     string `json:"namespace" uri:"namespace" binding:"required"`   // 命名空间
	PodName       string `json:"pod_name" uri:"name" binding:"required"`         // Pod名称 - 匹配路由参数:name
	ContainerName string `json:"container" uri:"container" binding:"required"`   // 容器名称
	FilePath      string `json:"file_path" uri:"file_path" binding:"required"`   // 文件路径
}

PodFileUploadReq Pod文件上传请求

type PodHTTPGetAction

type PodHTTPGetAction struct {
	Path   string `json:"path"`   // 探测路径
	Port   int32  `json:"port"`   // 探测端口
	Scheme string `json:"scheme"` // 协议类型
}

PodHTTPGetAction HTTP GET探测动作

type PodPortForwardPort

type PodPortForwardPort struct {
	LocalPort  int `json:"local_port" binding:"required"`  // 本地端口
	RemotePort int `json:"remote_port" binding:"required"` // 远程端口
}

PodPortForwardPort 端口转发端口配置

type PodPortForwardReq

type PodPortForwardReq struct {
	ClusterID int                  `json:"cluster_id" uri:"cluster_id" binding:"required"` // 集群ID
	Namespace string               `json:"namespace" uri:"namespace" binding:"required"`   // 命名空间
	PodName   string               `json:"pod_name" uri:"name" binding:"required"`         // Pod名称 - 匹配路由参数:name
	Ports     []PodPortForwardPort `json:"ports" binding:"required"`                       // 端口转发配置
}

PodPortForwardReq Pod端口转发请求

type PodProbe

type PodProbe struct {
	HTTPGet             *PodHTTPGetAction `json:"http_get"`              // HTTP GET探测
	InitialDelaySeconds int32             `json:"initial_delay_seconds"` // 初始延迟时间
	PeriodSeconds       int32             `json:"period_seconds"`        // 探测间隔时间
	TimeoutSeconds      int32             `json:"timeout_seconds"`       // 探测超时时间
	SuccessThreshold    int32             `json:"success_threshold"`     // 成功阈值
	FailureThreshold    int32             `json:"failure_threshold"`     // 失败阈值
}

PodProbe 探测配置

type PodResourceList

type PodResourceList struct {
	CPU    string `json:"cpu"`    // CPU数量
	Memory string `json:"memory"` // 内存数量
}

PodResourceList 资源列表

type PodResourceRequirements

type PodResourceRequirements struct {
	Requests PodResourceList `json:"requests"` // 资源请求
	Limits   PodResourceList `json:"limits"`   // 资源限制
}

PodResourceRequirements 资源要求

type PodVolumeMount

type PodVolumeMount struct {
	Name      string `json:"name"`       // 卷名称
	MountPath string `json:"mount_path"` // 挂载路径
	ReadOnly  bool   `json:"read_only"`  // 是否只读
	SubPath   string `json:"sub_path"`   // 子路径
}

PodVolumeMount 卷挂载

type PolicyRule

type PolicyRule struct {
	APIGroups       []string `json:"api_groups"`
	Resources       []string `json:"resources"`
	Verbs           []string `json:"verbs"`
	ResourceNames   []string `json:"resource_names,omitempty"`
	NonResourceURLs []string `json:"non_resource_urls,omitempty"`
}

PolicyRule 权限规则

type ProcessConnection

type ProcessConnection struct {
	From string `json:"from"` // 来源步骤ID
	To   string `json:"to"`   // 目标步骤ID
}

ProcessConnection 流程连接定义

type ProcessDefinition

type ProcessDefinition struct {
	Steps       []ProcessStep       `json:"steps" binding:"required"`       // 步骤列表
	Connections []ProcessConnection `json:"connections" binding:"required"` // 连接列表
}

ProcessDefinition 流程定义

type ProcessStep

type ProcessStep struct {
	ID           string   `json:"id"`                      // 步骤唯一标识
	Type         string   `json:"type" binding:"required"` // 步骤类型
	Name         string   `json:"name" binding:"required"` // 步骤名称
	AssigneeType string   `json:"assignee_type"`           // 受理人类型
	AssigneeIDs  []int    `json:"assignee_ids,omitempty"`  // 受理人ID列表
	Actions      []string `json:"actions,omitempty"`       // 可执行动作
	SortOrder    int      `json:"sort_order"`              // 排序
}

ProcessStep 流程步骤定义

type ProfileReq

type ProfileReq struct {
	ID int `json:"id" binding:"required"` // 用户ID
}

ProfileReq 获取用户信息请求

type PromqlAlertRuleExprCheckReq

type PromqlAlertRuleExprCheckReq struct {
	PromqlExpr string `json:"promql_expr" binding:"required"`
}

PromqlAlertRuleExprCheckReq PromQL表达式检查请求

type PromqlRecordRuleExprCheckReq

type PromqlRecordRuleExprCheckReq struct {
	PromqlExpr string `json:"promql_expr" binding:"required"`
}

PromqlRecordRuleExprCheckReq PromQL表达式检查请求

type RecentActivityItem

type RecentActivityItem struct {
	Time          int64  `json:"time"`
	OperationType string `json:"operation_type"`
	UserID        int    `json:"user_id"`
	Username      string `json:"username"`
	TargetType    string `json:"target_type"`
	StatusCode    int    `json:"status_code"`
	Duration      int64  `json:"duration"`
}

RecentActivityItem 最近活动项

type ReclaimPVReq

type ReclaimPVReq struct {
	ClusterID int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	Name      string `json:"name" form:"name" binding:"required" comment:"PV名称"`             // PV名称
}

ReclaimPVReq 回收PV请求

type RefreshClusterReq

type RefreshClusterReq struct {
	ID int `json:"id" form:"id" uri:"id" binding:"required" comment:"集群ID"`
}

RefreshClusterReq 刷新集群请求

type RejectWorkorderInstanceReq

type RejectWorkorderInstanceReq struct {
	ID      int    `json:"id" form:"id" binding:"required,min=1"`
	Comment string `json:"comment" binding:"required,min=1,max=500"`
}

拒绝工单

type RemoveTreeNodeMemberReq

type RemoveTreeNodeMemberReq struct {
	NodeID     int                `json:"node_id" form:"node_id" binding:"required"`
	UserID     int                `json:"user_id" form:"user_id" binding:"required"`
	MemberType TreeNodeMemberType `json:"member_type" form:"member_type" binding:"required,oneof=1 2"`
}

RemoveTreeNodeMemberReq 移除节点成员请求

type ResourceStatus

type ResourceStatus int8
const (
	RUNNING ResourceStatus = iota + 1
	STOPPED
	STARTING
	STOPPING
	RESTARTING
	DELETING
	ERROR
)

type RestartDaemonSetReq

type RestartDaemonSetReq struct {
	ClusterID int    `json:"cluster_id"` // 集群ID
	Namespace string `json:"namespace"`  // 命名空间
	Name      string `json:"name"`       // DaemonSet名称
}

RestartDaemonSetReq 重启DaemonSet请求

type RestartDeploymentReq

type RestartDeploymentReq struct {
	ClusterID int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	Namespace string `json:"namespace" binding:"required" comment:"命名空间"`                    // 命名空间
	Name      string `json:"name" form:"name" binding:"required" comment:"Deployment名称"`     // Deployment名称
}

RestartDeploymentReq 重启Deployment请求

type RestartStatefulSetReq

type RestartStatefulSetReq struct {
	ClusterID int    `json:"cluster_id"` // 集群ID
	Namespace string `json:"namespace"`  // 命名空间
	Name      string `json:"name"`       // StatefulSet名称
}

RestartStatefulSetReq 重启StatefulSet请求

type ResumeDeploymentReq

type ResumeDeploymentReq struct {
	ClusterID int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	Namespace string `json:"namespace" form:"namespace" binding:"required" comment:"命名空间"`   // 命名空间
	Name      string `json:"name" form:"name" binding:"required" comment:"Deployment名称"`     // Deployment名称
}

ResumeDeploymentReq 恢复Deployment请求

type ReturnWorkorderInstanceReq

type ReturnWorkorderInstanceReq struct {
	ID      int    `json:"id" form:"id" binding:"required,min=1"`
	Comment string `json:"comment" binding:"required,min=1,max=500"`
}

type RevokeRoleApiRequest

type RevokeRoleApiRequest struct {
	RoleID int   `json:"role_id" binding:"required,gt=0"`
	ApiIds []int `json:"api_ids" binding:"required,dive,gt=0"`
}

type RevokeRoleRequest

type RevokeRoleRequest struct {
	UserID  int   `json:"user_id" binding:"required,gt=0"`       // 用户ID
	RoleIds []int `json:"role_ids" binding:"required,dive,gt=0"` // 角色ID列表
}

RevokeRoleRequest 撤销角色请求结构体

type RevokeRolesFromUserRequest

type RevokeRolesFromUserRequest struct {
	UserID  int   `json:"user_id" binding:"required,gt=0"`       // 用户ID
	RoleIds []int `json:"role_ids" binding:"required,dive,gt=0"` // 角色ID列表
}

type Role

type Role struct {
	Model
	Name        string  `json:"name" gorm:"type:varchar(50);not null;comment:角色名称"`                             // 角色名称,唯一且非空
	Code        string  `json:"code" gorm:"type:varchar(50);not null;comment:角色编码"`                             // 角色编码,唯一且非空
	Description string  `json:"description" gorm:"type:varchar(500);comment:角色描述"`                              // 角色描述
	Status      int8    `json:"status" gorm:"type:tinyint(1);default:1;comment:状态 0禁用 1启用" binding:"oneof=0 1"` // 角色状态
	IsSystem    int8    `json:"is_system" gorm:"type:tinyint(1);default:0;comment:是否系统角色 0否 1是"`                // 是否系统角色,系统角色不可删除
	Apis        []*Api  `json:"apis" gorm:"many2many:cl_system_role_apis;comment:关联API"`                        // 多对多关联API
	Users       []*User `json:"users" gorm:"many2many:cl_system_user_roles;comment:关联用户"`                       // 多对多关联用户
}

func (*Role) TableName

func (r *Role) TableName() string

type RoleApi

type RoleApi struct {
	ID     int `json:"id" gorm:"primaryKey;autoIncrement;comment:主键ID"`
	RoleID int `json:"role_id" gorm:"not null;index;comment:角色ID"`
	ApiID  int `json:"api_id" gorm:"not null;index;comment:API ID"`
}

RoleApi 角色API权限关联表

func (*RoleApi) TableName

func (r *RoleApi) TableName() string

type RoleRef

type RoleRef struct {
	APIGroup string `json:"api_group"`
	Kind     string `json:"kind"`
	Name     string `json:"name"`
}

RoleRef 角色引用

type RollbackDaemonSetReq

type RollbackDaemonSetReq struct {
	ClusterID int    `json:"cluster_id"`                  // 集群ID
	Namespace string `json:"namespace"`                   // 命名空间
	Name      string `json:"name"`                        // DaemonSet名称
	Revision  int64  `json:"revision" binding:"required"` // 回滚到的版本号
}

RollbackDaemonSetReq 回滚DaemonSet请求

type RollbackDeploymentReq

type RollbackDeploymentReq struct {
	ClusterID int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	Namespace string `json:"namespace" form:"namespace" binding:"required" comment:"命名空间"`   // 命名空间
	Name      string `json:"name" form:"name" binding:"required" comment:"Deployment名称"`     // Deployment名称
	Revision  int64  `json:"revision" binding:"required" comment:"回滚到的版本号"`                  // 回滚到的版本号
}

RollbackDeploymentReq 回滚Deployment请求

type RollbackStatefulSetReq

type RollbackStatefulSetReq struct {
	ClusterID int    `json:"cluster_id"`                  // 集群ID
	Namespace string `json:"namespace"`                   // 命名空间
	Name      string `json:"name"`                        // StatefulSet名称
	Revision  int64  `json:"revision" binding:"required"` // 回滚到的版本号
}

RollbackStatefulSetReq 回滚StatefulSet请求

type ScaleDeploymentReq

type ScaleDeploymentReq struct {
	ClusterID int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	Namespace string `json:"namespace" form:"namespace" binding:"required" comment:"命名空间"`   // 命名空间
	Name      string `json:"name" form:"name" binding:"required" comment:"Deployment名称"`     // Deployment名称
	Replicas  int32  `json:"replicas" binding:"required" comment:"副本数量"`                     // 副本数量
}

ScaleDeploymentReq 伸缩Deployment请求

type ScaleStatefulSetReq

type ScaleStatefulSetReq struct {
	ClusterID int    `json:"cluster_id"`                  // 集群ID
	Namespace string `json:"namespace"`                   // 命名空间
	Name      string `json:"name"`                        // StatefulSet名称
	Replicas  int32  `json:"replicas" binding:"required"` // 副本数量
}

ScaleStatefulSetReq 伸缩StatefulSet请求

type SearchAuditLogsRequest

type SearchAuditLogsRequest struct {
	ListAuditLogsRequest
	Advanced *AdvancedSearchOptions `json:"advanced"`
}

SearchAuditLogsRequest 审计日志搜索请求

type ServiceAccountTokenInfo

type ServiceAccountTokenInfo struct {
	Token             string `json:"token"`
	ExpirationSeconds *int64 `json:"expiration_seconds"`
	CreationTimestamp string `json:"creation_timestamp"`
	ExpirationTime    string `json:"expiration_time"`
}

ServiceAccountTokenInfo ServiceAccount Token信息响应

type ServiceDiscoveryType

type ServiceDiscoveryType int8
const (
	ServiceDiscoveryTypeK8s ServiceDiscoveryType = iota + 1
	ServiceDiscoveryTypeHttp
	ServiceDiscoveryTypeStatic
)

type ServiceEndpoint

type ServiceEndpoint struct {
	Addresses  []string            `json:"addresses"`   // 端点地址列表
	Ports      []EndpointPort      `json:"ports"`       // 端点端口列表
	Ready      bool                `json:"ready"`       // 是否就绪
	Conditions []EndpointCondition `json:"conditions"`  // 端点条件
	TargetRef  *EndpointTargetRef  `json:"target_ref"`  // 目标引用
	Topology   map[string]string   `json:"topology"`    // 拓扑信息
	LastChange time.Time           `json:"last_change"` // 最后变更时间
}

ServiceEndpoint 服务端点详细信息

type ServicePort

type ServicePort struct {
	Name        string             `json:"name"`                   // 端口名称
	Protocol    corev1.Protocol    `json:"protocol"`               // 协议类型
	Port        int32              `json:"port"`                   // 服务端口
	TargetPort  intstr.IntOrString `json:"target_port"`            // 目标端口
	NodePort    int32              `json:"node_port,omitempty"`    // 节点端口(NodePort类型)
	AppProtocol *string            `json:"app_protocol,omitempty"` // 应用协议
}

ServicePort 服务端口配置

type StatefulSetCondition

type StatefulSetCondition struct {
	Type               string    `json:"type"`                 // 条件类型
	Status             string    `json:"status"`               // 条件状态
	LastUpdateTime     time.Time `json:"last_update_time"`     // 最后更新时间
	LastTransitionTime time.Time `json:"last_transition_time"` // 最后转换时间
	Reason             string    `json:"reason"`               // 原因
	Message            string    `json:"message"`              // 消息
}

StatefulSetCondition StatefulSet条件

type StatefulSetSpec

type StatefulSetSpec struct {
	Replicas             *int32                            `json:"replicas"`                         // 副本数量
	Selector             *metav1.LabelSelector             `json:"selector"`                         // 标签选择器
	Template             *corev1.PodTemplateSpec           `json:"template"`                         // Pod模板
	VolumeClaimTemplates []corev1.PersistentVolumeClaim    `json:"volume_claim_templates,omitempty"` // 卷声明模板
	ServiceName          string                            `json:"service_name"`                     // 服务名称
	PodManagementPolicy  *appsv1.PodManagementPolicyType   `json:"pod_management_policy,omitempty"`  // Pod管理策略
	UpdateStrategy       *appsv1.StatefulSetUpdateStrategy `json:"update_strategy,omitempty"`        // 更新策略
	RevisionHistoryLimit *int32                            `json:"revision_history_limit,omitempty"` // 历史版本限制
	MinReadySeconds      *int32                            `json:"min_ready_seconds,omitempty"`      // 最小就绪时间
}

StatefulSetSpec 创建/更新StatefulSet时的配置信息

type StatusDistributionItem

type StatusDistributionItem struct {
	Status int   `json:"status"`
	Count  int64 `json:"count"`
}

StatusDistributionItem 状态码分布项

type StringList

type StringList []string

StringList 用于存储字符串数组,支持多种数据库格式

func (StringList) MarshalJSON

func (s StringList) MarshalJSON() ([]byte, error)

MarshalJSON 实现 json.Marshaler 接口

func (*StringList) Scan

func (s *StringList) Scan(val interface{}) error

Scan 实现 sql.Scanner 接口

func (*StringList) UnmarshalJSON

func (s *StringList) UnmarshalJSON(data []byte) error

UnmarshalJSON 实现 json.Unmarshaler 接口

func (StringList) Value

func (s StringList) Value() (driver.Value, error)

Value 实现 driver.Valuer 接口

type Subject

type Subject struct {
	Kind      string `json:"kind"`
	Name      string `json:"name"`
	Namespace string `json:"namespace,omitempty"`
	APIGroup  string `json:"api_group,omitempty"`
}

Subject 主体(用户、组或服务账户)

type SubmitWorkorderInstanceReq

type SubmitWorkorderInstanceReq struct {
	ID int `json:"id" form:"id" binding:"required,min=1"`
}

提交工单

type SwitchNodeScheduleReq

type SwitchNodeScheduleReq struct {
	ClusterID int    `json:"cluster_id" binding:"required"`       // 集群ID
	NodeName  string `json:"node_name" binding:"required"`        // 节点名称
	Enable    int8   `json:"enable" binding:"required,oneof=1 2"` // 是否启用调度
}

SwitchNodeScheduleReq 切换节点调度状态请求

type System

type System struct {
	Model
	Hostname       string  `json:"hostname" gorm:"type:varchar(255);comment:主机名"`         // 主机名
	OS             string  `json:"os" gorm:"type:varchar(100);comment:操作系统"`              // 操作系统
	OSVersion      string  `json:"os_version" gorm:"type:varchar(100);comment:操作系统版本"`    // 操作系统版本
	Arch           string  `json:"arch" gorm:"type:varchar(50);comment:系统架构"`             // 系统架构
	CPUModel       string  `json:"cpu_model" gorm:"type:varchar(255);comment:CPU型号"`      // CPU型号
	CPUCores       int     `json:"cpu_cores" gorm:"comment:CPU核心数"`                       // CPU核心数
	CPUUsage       float64 `json:"cpu_usage" gorm:"comment:CPU使用率"`                       // CPU使用率
	MemoryTotal    uint64  `json:"memory_total" gorm:"comment:总内存MB"`                     // 总内存(MB)
	MemoryUsed     uint64  `json:"memory_used" gorm:"comment:已用内存MB"`                     // 已用内存(MB)
	MemoryUsage    float64 `json:"memory_usage" gorm:"comment:内存使用率"`                     // 内存使用率
	DiskTotal      uint64  `json:"disk_total" gorm:"comment:总磁盘空间GB"`                     // 总磁盘空间(GB)
	DiskUsed       uint64  `json:"disk_used" gorm:"comment:已用磁盘空间GB"`                     // 已用磁盘空间(GB)
	DiskUsage      float64 `json:"disk_usage" gorm:"comment:磁盘使用率"`                       // 磁盘使用率
	NetworkIn      uint64  `json:"network_in" gorm:"comment:网络入流量MB"`                     // 网络入流量(MB)
	NetworkOut     uint64  `json:"network_out" gorm:"comment:网络出流量MB"`                    // 网络出流量(MB)
	Uptime         uint64  `json:"uptime" gorm:"comment:系统运行时长秒"`                         // 系统运行时长(秒)
	LoadAvg1       float64 `json:"load_avg_1" gorm:"comment:1分钟负载"`                       // 1分钟平均负载
	LoadAvg5       float64 `json:"load_avg_5" gorm:"comment:5分钟负载"`                       // 5分钟平均负载
	LoadAvg15      float64 `json:"load_avg_15" gorm:"comment:15分钟负载"`                     // 15分钟平均负载
	ProcessCount   int     `json:"process_count" gorm:"comment:进程数"`                      // 进程数
	LastUpdateTime int64   `json:"last_update_time" gorm:"comment:最后更新时间;autoUpdateTime"` // 最后更新时间
}

System 系统硬件信息

type SystemInfoResponse

type SystemInfoResponse struct {
	*System
	MemoryUsageFormatted string `json:"memory_usage_formatted"` // 格式化的内存使用情况
	DiskUsageFormatted   string `json:"disk_usage_formatted"`   // 格式化的磁盘使用情况
	UptimeFormatted      string `json:"uptime_formatted"`       // 格式化的运行时间
	SystemStatus         string `json:"system_status"`          // 系统状态
}

SystemInfoResponse 系统信息响应结构

type TestSendWorkorderNotificationReq

type TestSendWorkorderNotificationReq struct {
	NotificationID int    `json:"notification_id" binding:"required"`
	Recipient      string `json:"recipient"` // 可选,如果不提供则使用默认测试地址
}

TestSendWorkorderNotificationReq 测试发送工单通知

type TimeRange

type TimeRange struct {
	Start time.Time `json:"start"` // 开始时间
	End   time.Time `json:"end"`   // 结束时间
}

TimeRange 时间范围

type TokenRequest

type TokenRequest struct {
	RefreshToken string `json:"refreshToken" binding:"required"`           // 刷新令牌
	UserID       int    `json:"user_id" binding:"required"`                // 用户ID
	Username     string `json:"username" binding:"required"`               // 用户名
	Ssid         string `json:"ssid" binding:"required"`                   // 会话ID
	AccountType  int8   `json:"account_type" binding:"required,oneof=1 2"` // 账号类型 1普通用户 2服务账号
}

TokenRequest 刷新令牌请求

type TreeLocalResource

type TreeLocalResource struct {
	Model
	Name           string         `json:"name" gorm:"type:varchar(100);comment:资源名称"`
	Status         ResourceStatus `json:"status" gorm:"type:tinyint(1);comment:资源状态;default:1"`
	Environment    string         `json:"environment" gorm:"type:varchar(50);comment:环境标识,如dev,prod"`
	Description    string         `json:"description" gorm:"type:text;comment:资源描述"`
	Tags           StringList     `json:"tags" gorm:"type:varchar(500);comment:资源标签集合"`
	Cpu            int            `json:"cpu" gorm:"comment:CPU核数"`
	Memory         int            `json:"memory" gorm:"comment:内存大小,单位GiB"`
	Disk           int            `json:"disk" gorm:"comment:系统盘大小,单位GiB"`
	IpAddr         string         `json:"ip_addr" gorm:"type:varchar(45);comment:主IP地址"`
	Port           int            `json:"port" gorm:"comment:端口号;default:22"`
	Username       string         `json:"username" gorm:"type:varchar(100);comment:用户名;default:root"`
	Password       string         `json:"-" gorm:"type:varchar(500);comment:密码,加密存储"`
	CreateUserID   int            `json:"create_user_id" gorm:"comment:创建者ID;default:0"`
	CreateUserName string         `json:"create_user_name" gorm:"type:varchar(100);comment:创建者姓名"`
	Key            string         `json:"key" gorm:"type:text;comment:密钥"`
	AuthMode       AuthMode       `json:"auth_mode" gorm:"type:tinyint(1);comment:认证方式,1:密码,2:密钥;default:1"`
	OsType         string         `json:"os_type" gorm:"type:varchar(50);comment:操作系统类型,如win,linux"`
	OSName         string         `json:"os_name" gorm:"type:varchar(100);comment:操作系统名称"`
	ImageName      string         `json:"image_name" gorm:"type:varchar(100);comment:镜像名称"`
	TreeNodes      []*TreeNode    `json:"tree_nodes" gorm:"many2many:cl_tree_node_local"`
}

func (*TreeLocalResource) TableName

func (t *TreeLocalResource) TableName() string

type TreeNode

type TreeNode struct {
	Model
	Name               string               `json:"name" gorm:"type:varchar(50);not null;comment:节点名称"`      // 节点名称
	ParentID           int                  `json:"parent_id" gorm:"index;comment:父节点ID;default:0"`          // 父节点ID
	Level              int                  `json:"level" gorm:"comment:节点层级,默认在第1层;default:1"`              // 节点层级
	Description        string               `json:"description" gorm:"type:text;comment:节点描述"`               // 节点描述
	CreateUserID       int                  `json:"create_user_id" gorm:"comment:创建者ID;default:0"`           // 创建者ID
	CreateUserName     string               `json:"create_user_name" gorm:"type:varchar(100);comment:创建者姓名"` // 创建者姓名
	Status             TreeNodeStatus       `json:"status" gorm:"default:1;comment:节点状态, 1:活跃 2:非活跃"`        // 节点状态
	AdminUsers         []User               `json:"admins" gorm:"many2many:cl_tree_node_admin;"`             // 管理员多对多关系
	MemberUsers        []User               `json:"members" gorm:"many2many:cl_tree_node_member;"`           // 成员多对多关系
	IsLeaf             int8                 `json:"is_leaf" gorm:"comment:是否为叶子节点1:是 2:不是;default:2"`        // 是否为叶子节点
	Children           []*TreeNode          `json:"children" gorm:"-"`                                       // 子节点列表
	TreeLocalResources []*TreeLocalResource `json:"tree_local_resources" gorm:"many2many:cl_tree_node_local;"`
}

TreeNode 服务树节点结构

func (*TreeNode) TableName

func (t *TreeNode) TableName() string

type TreeNodeMemberType

type TreeNodeMemberType int8
const (
	AdminRole TreeNodeMemberType = iota + 1
	MemberRole
)

type TreeNodeStatisticsResp

type TreeNodeStatisticsResp struct {
	TotalNodes     int `json:"total_nodes"`     // 节点总数
	TotalResources int `json:"total_resources"` // 资源总数
	TotalAdmins    int `json:"total_admins"`    // 管理员总数
	TotalMembers   int `json:"total_members"`   // 成员总数
	ActiveNodes    int `json:"active_nodes"`    // 活跃节点数
	InactiveNodes  int `json:"inactive_nodes"`  // 非活跃节点数
}

TreeNodeStatisticsResp 服务树统计响应

type TreeNodeStatus

type TreeNodeStatus int8
const (
	ACTIVE TreeNodeStatus = iota + 1
	INACTIVE
)

type TypeDistributionItem

type TypeDistributionItem struct {
	Type  string `json:"type"`
	Count int64  `json:"count"`
}

TypeDistributionItem 操作类型分布项

type UnBindTreeLocalResourceReq

type UnBindTreeLocalResourceReq struct {
	ID          int   `json:"id" form:"id"`
	TreeNodeIDs []int `json:"tree_node_ids" form:"tree_node_ids"`
}

type UnbindTreeNodeResourceReq

type UnbindTreeNodeResourceReq struct {
	NodeID     int `json:"node_id" binding:"required"`
	ResourceID int `json:"resource_id" binding:"required"`
}

UnbindTreeNodeResourceReq 解绑资源请求

type UpdateApiRequest

type UpdateApiRequest struct {
	ID          int    `json:"id" binding:"required,gt=0"`    // API ID
	Name        string `json:"name" binding:"required"`       // API名称
	Path        string `json:"path" binding:"required"`       // API路径
	Method      int    `json:"method" binding:"required"`     // 请求方法
	Description string `json:"description"`                   // API描述
	Version     string `json:"version"`                       // API版本
	Category    int    `json:"category"`                      // API分类
	IsPublic    int    `json:"is_public" binding:"oneof=1 2"` // 是否公开
}

type UpdateClusterReq

type UpdateClusterReq struct {
	ID                   int          `json:"id" form:"id" uri:"id" binding:"required" comment:"集群ID"`
	Name                 string       `json:"name" binding:"required,min=1,max=200"` // 集群名称
	CpuRequest           string       `json:"cpu_request,omitempty"`                 // CPU 请求量
	CpuLimit             string       `json:"cpu_limit,omitempty"`                   // CPU 限制量
	MemoryRequest        string       `json:"memory_request,omitempty"`              // 内存请求量
	MemoryLimit          string       `json:"memory_limit,omitempty"`                // 内存限制量
	RestrictNamespace    StringList   `json:"restrict_namespace"`                    // 资源限制命名空间
	Env                  Env          `json:"env,omitempty"`                         // 集群环境
	Version              string       `json:"version,omitempty"`                     // 集群版本
	ApiServerAddr        string       `json:"api_server_addr,omitempty"`             // API Server 地址
	KubeConfigContent    string       `json:"kube_config_content,omitempty"`         // kubeConfig 内容
	ActionTimeoutSeconds int          `json:"action_timeout_seconds,omitempty"`      // 操作超时时间(秒)
	Tags                 KeyValueList `json:"tags,omitempty"`                        // 标签
}

UpdateClusterReq 更新集群请求

type UpdateClusterRoleBindingByYamlReq

type UpdateClusterRoleBindingByYamlReq struct {
	ClusterID   int    `json:"cluster_id" binding:"required" comment:"集群ID"`
	Name        string `json:"name" binding:"required" comment:"ClusterRoleBinding名称"`
	YamlContent string `json:"yaml_content" binding:"required" comment:"YAML内容"`
}

UpdateClusterRoleBindingByYamlReq 通过YAML更新ClusterRoleBinding请求

type UpdateClusterRoleBindingReq

type UpdateClusterRoleBindingReq struct {
	ClusterID   int               `json:"cluster_id" binding:"required" comment:"集群ID"`
	Name        string            `json:"name" binding:"required" comment:"ClusterRoleBinding名称"`
	Labels      map[string]string `json:"labels" comment:"标签"`
	Annotations map[string]string `json:"annotations" comment:"注解"`
	RoleRef     RoleRef           `json:"role_ref" binding:"required" comment:"角色引用"`
	Subjects    []Subject         `json:"subjects" binding:"required" comment:"主体列表"`
}

UpdateClusterRoleBindingReq 更新ClusterRoleBinding请求

type UpdateClusterRoleByYamlReq

type UpdateClusterRoleByYamlReq struct {
	ClusterID   int    `json:"cluster_id" binding:"required" comment:"集群ID"`
	Name        string `json:"name" binding:"required" comment:"ClusterRole名称"`
	YamlContent string `json:"yaml_content" binding:"required" comment:"YAML内容"`
}

UpdateClusterRoleByYamlReq 通过YAML更新ClusterRole请求

type UpdateClusterRoleReq

type UpdateClusterRoleReq struct {
	ClusterID   int               `json:"cluster_id" binding:"required" comment:"集群ID"`
	Name        string            `json:"name" binding:"required" comment:"ClusterRole名称"`
	Labels      map[string]string `json:"labels" comment:"标签"`
	Annotations map[string]string `json:"annotations" comment:"注解"`
	Rules       []PolicyRule      `json:"rules" binding:"required" comment:"权限规则列表"`
}

UpdateClusterRoleReq 更新ClusterRole请求

type UpdateConfigMapByYamlReq

type UpdateConfigMapByYamlReq struct {
	ClusterID int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	Namespace string `json:"namespace" binding:"required" comment:"命名空间"`                    // 命名空间
	Name      string `json:"name" form:"name" binding:"required" comment:"ConfigMap名称"`      // ConfigMap名称
	YAML      string `json:"yaml" binding:"required" comment:"YAML内容"`                       // YAML内容
}

UpdateConfigMapByYamlReq 通过YAML更新ConfigMap请求

type UpdateConfigMapReq

type UpdateConfigMapReq struct {
	ClusterID   int               `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	Name        string            `json:"name" form:"name" binding:"required" comment:"ConfigMap名称"`      // ConfigMap名称
	Namespace   string            `json:"namespace" form:"namespace" binding:"required" comment:"命名空间"`   // 命名空间
	Data        map[string]string `json:"data" comment:"字符串数据"`                                           // 字符串数据
	BinaryData  map[string][]byte `json:"binary_data" comment:"二进制数据"`                                    // 二进制数据
	Labels      map[string]string `json:"labels" comment:"标签"`                                            // 标签
	Annotations map[string]string `json:"annotations" comment:"注解"`                                       // 注解
}

UpdateConfigMapReq 更新ConfigMap请求

type UpdateCronJobReq

type UpdateCronJobReq struct {
	ID             int          `json:"id" form:"id" binding:"required"`
	Name           string       `json:"name" binding:"required,min=1,max=100"`
	Description    string       `json:"description" binding:"max=500"`
	JobType        CronJobType  `json:"job_type" binding:"required,oneof=1 2 3 4 5"`
	Schedule       string       `json:"schedule" binding:"required"`
	Command        string       `json:"command"`
	Args           StringList   `json:"args"`
	WorkDir        string       `json:"work_dir"`
	Environment    KeyValueList `json:"environment"`
	HTTPMethod     string       `json:"http_method"`
	HTTPUrl        string       `json:"http_url"`
	HTTPHeaders    KeyValueList `json:"http_headers"`
	HTTPBody       string       `json:"http_body"`
	ScriptType     string       `json:"script_type"`
	ScriptContent  string       `json:"script_content"`
	SSHResourceID  *int         `json:"ssh_resource_id"`
	SSHCommand     string       `json:"ssh_command"`
	SSHWorkDir     string       `json:"ssh_work_dir"`
	SSHEnvironment KeyValueList `json:"ssh_environment"`
	Timeout        int          `json:"timeout" binding:"omitempty,min=1,max=3600"`
	MaxRetry       int          `json:"max_retry" binding:"omitempty,min=0,max=10"`
}

UpdateCronJobReq 更新定时任务请求

type UpdateDaemonSetByYamlReq

type UpdateDaemonSetByYamlReq struct {
	ClusterID int    `json:"cluster_id"`              // 集群ID
	Namespace string `json:"namespace"`               // 命名空间
	Name      string `json:"name"`                    // DaemonSet名称
	YAML      string `json:"yaml" binding:"required"` // YAML内容
}

UpdateDaemonSetByYamlReq 通过YAML更新DaemonSet请求

type UpdateDaemonSetReq

type UpdateDaemonSetReq struct {
	ClusterID   int               `json:"cluster_id"`  // 集群ID
	Name        string            `json:"name"`        // DaemonSet名称
	Namespace   string            `json:"namespace"`   // 命名空间
	Images      []string          `json:"images"`      // 容器镜像列表
	Labels      map[string]string `json:"labels"`      // 标签
	Annotations map[string]string `json:"annotations"` // 注解
	Spec        DaemonSetSpec     `json:"spec"`        // DaemonSet规格
	YAML        string            `json:"yaml"`        // YAML内容
}

UpdateDaemonSetReq 更新DaemonSet请求

type UpdateDeploymentByYamlReq

type UpdateDeploymentByYamlReq struct {
	ClusterID int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	Namespace string `json:"namespace" binding:"required" comment:"命名空间"`                    // 命名空间
	Name      string `json:"name" form:"name" binding:"required" comment:"Deployment名称"`     // Deployment名称
	YAML      string `json:"yaml" binding:"required" comment:"YAML内容"`                       // YAML内容
}

UpdateDeploymentByYamlReq 通过YAML更新Deployment请求

type UpdateDeploymentReq

type UpdateDeploymentReq struct {
	ClusterID   int               `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	Name        string            `json:"name" form:"name" binding:"required" comment:"Deployment名称"`     // Deployment名称
	Namespace   string            `json:"namespace" form:"namespace" binding:"required" comment:"命名空间"`   // 命名空间
	Replicas    int32             `json:"replicas" comment:"副本数量"`                                        // 副本数量
	Images      []string          `json:"images" comment:"容器镜像列表"`                                        // 容器镜像列表
	Labels      map[string]string `json:"labels" comment:"标签"`                                            // 标签
	Annotations map[string]string `json:"annotations" comment:"注解"`                                       // 注解
	Spec        DeploymentSpec    `json:"spec" comment:"Deployment规格"`                                    // Deployment规格
}

UpdateDeploymentReq 更新Deployment请求

type UpdateIngressByYamlReq

type UpdateIngressByYamlReq struct {
	ClusterID int    `json:"cluster_id" binding:"required"` // 集群ID
	Namespace string `json:"namespace" binding:"required"`  // 命名空间
	Name      string `json:"name" binding:"required"`       // Ingress名称
	YAML      string `json:"yaml" binding:"required"`       // YAML内容
}

UpdateIngressByYamlReq 通过YAML更新Ingress请求

type UpdateIngressReq

type UpdateIngressReq struct {
	ClusterID        int               `json:"cluster_id"`         // 集群ID
	Name             string            `json:"name"`               // Ingress名称
	Namespace        string            `json:"namespace"`          // 命名空间
	IngressClassName *string           `json:"ingress_class_name"` // Ingress类名
	Rules            []IngressRule     `json:"rules"`              // Ingress规则
	TLS              []IngressTLS      `json:"tls"`                // TLS配置
	Labels           map[string]string `json:"labels"`             // 标签
	Annotations      map[string]string `json:"annotations"`        // 注解
}

UpdateIngressReq 更新Ingress请求

type UpdateMonitorAlertManagerPoolReq

type UpdateMonitorAlertManagerPoolReq struct {
	ID                    int        `json:"id" binding:"required"`
	Name                  string     `json:"name" binding:"required,min=1,max=50"`
	AlertManagerInstances StringList `json:"alert_manager_instances" binding:"required,min=1"`
	ResolveTimeout        string     `json:"resolve_timeout" binding:"omitempty"`
	GroupWait             string     `json:"group_wait" binding:"omitempty"`
	GroupInterval         string     `json:"group_interval" binding:"omitempty"`
	RepeatInterval        string     `json:"repeat_interval" binding:"omitempty"`
	GroupBy               StringList `json:"group_by" binding:"omitempty"`
	Receiver              string     `json:"receiver" binding:"required,min=1,max=100"`
}

UpdateMonitorAlertManagerPoolReq 更新AlertManager实例池请求

type UpdateMonitorAlertRuleReq

type UpdateMonitorAlertRuleReq struct {
	ID          int               `json:"id" form:"id" binding:"required"`
	Name        string            `json:"name" binding:"required,min=1,max=50"`
	PoolID      int               `json:"pool_id" binding:"required"`
	SendGroupID int               `json:"send_group_id" binding:"required"`
	IpAddress   string            `json:"ip_address"`
	Enable      int8              `json:"enable" binding:"omitempty,oneof=1 2"`
	Expr        string            `json:"expr" binding:"required"`
	Severity    AlertRuleSeverity `json:"severity" binding:"omitempty,oneof=1 2 3"`
	GrafanaLink string            `json:"grafana_link"`
	ForTime     string            `json:"for_time" binding:"required"`
	Labels      StringList        `json:"labels"`
	Annotations StringList        `json:"annotations"`
}

UpdateMonitorAlertRuleReq 更新告警规则请求

type UpdateMonitorConfigReq

type UpdateMonitorConfigReq struct {
	ID            int    `json:"id" binding:"required"`
	Name          string `json:"name" binding:"required,min=1,max=100"`
	PoolID        int    `json:"pool_id" binding:"omitempty"`
	InstanceIP    string `json:"instance_ip" binding:"omitempty"`
	ConfigType    int8   `json:"config_type" binding:"omitempty,oneof=1 2 3 4 5"`
	ConfigContent string `json:"config_content" binding:"omitempty"`
	Status        int8   `json:"status" binding:"omitempty,oneof=1 2"`
}

UpdateMonitorConfigReq 更新监控配置请求

type UpdateMonitorOnDutyGroupReq

type UpdateMonitorOnDutyGroupReq struct {
	ID          int    `json:"id" form:"id" binding:"required"`
	Name        string `json:"name" binding:"required,min=1,max=50"`
	ShiftDays   int    `json:"shift_days" binding:"required,min=1"`
	UserIDs     []int  `json:"user_ids" binding:"required,min=1"`
	Description string `json:"description" binding:"max=255"`
	Enable      *int8  `json:"enable" binding:"omitempty,oneof=1 2"`
}

UpdateMonitorOnDutyGroupReq 更新值班组信息请求

type UpdateMonitorRecordRuleReq

type UpdateMonitorRecordRuleReq struct {
	ID        int        `json:"id" form:"id" binding:"required"`
	Name      string     `json:"name" binding:"required,min=1,max=50"`
	PoolID    int        `json:"pool_id" binding:"required"`
	IpAddress string     `json:"ip_address"`
	Enable    int8       `json:"enable" binding:"omitempty,oneof=1 2"`
	Expr      string     `json:"expr" binding:"required"`
	Labels    StringList `json:"labels"`
}

UpdateMonitorRecordRuleReq 更新记录规则请求

type UpdateMonitorScrapeJobReq

type UpdateMonitorScrapeJobReq struct {
	ID                       int                  `json:"id" form:"id" binding:"required"`
	Name                     string               `json:"name" binding:"required,min=1,max=50"`
	Enable                   int8                 `json:"enable"`
	ServiceDiscoveryType     ServiceDiscoveryType `json:"service_discovery_type"`
	MetricsPath              string               `json:"metrics_path"`
	Scheme                   string               `json:"scheme"`
	ScrapeInterval           int                  `json:"scrape_interval"`
	ScrapeTimeout            int                  `json:"scrape_timeout"`
	PoolID                   int                  `json:"pool_id"`
	RelabelConfigsYamlString string               `json:"relabel_configs_yaml_string"`
	RefreshInterval          int                  `json:"refresh_interval"`
	Port                     int                  `json:"port"`
	IpAddress                string               `json:"ip_address"`
	KubeConfigFilePath       string               `json:"kube_config_file_path"`
	TlsCaFilePath            string               `json:"tls_ca_file_path"`
	TlsCaContent             string               `json:"tls_ca_content"`
	BearerToken              string               `json:"bearer_token"`
	BearerTokenFile          string               `json:"bearer_token_file"`
	KubernetesSdRole         string               `json:"kubernetes_sd_role"`
	TreeNodeIDs              StringList           `json:"tree_node_ids"`
	Tags                     StringList           `json:"tags"`
}

type UpdateMonitorScrapePoolReq

type UpdateMonitorScrapePoolReq struct {
	ID                   int        `json:"id" form:"id" binding:"required"`
	Name                 string     `json:"name" binding:"required,min=1,max=50"`
	UserID               int        `json:"user_id"`
	ScrapeInterval       int        `json:"scrape_interval"`
	ScrapeTimeout        int        `json:"scrape_timeout"`
	RemoteTimeoutSeconds int        `json:"remote_timeout_seconds"`
	SupportAlert         int8       `json:"support_alert"`
	SupportRecord        int8       `json:"support_record"`
	PrometheusInstances  StringList `json:"prometheus_instances"`
	Tags                 StringList `json:"tags"`
	RemoteWriteUrl       string     `json:"remote_write_url"`
	RemoteReadUrl        string     `json:"remote_read_url"`
	AlertManagerUrl      string     `json:"alert_manager_url"`
	RuleFilePath         string     `json:"rule_file_path"`
	RecordFilePath       string     `json:"record_file_path"`
}

type UpdateMonitorSendGroupReq

type UpdateMonitorSendGroupReq struct {
	ID                  int        `json:"id" form:"id" binding:"required"`
	Name                string     `json:"name" binding:"required,min=1,max=50"`
	NameZh              string     `json:"name_zh" binding:"required,min=1,max=50"`
	Enable              int8       `json:"enable" binding:"omitempty,oneof=1 2"`
	PoolID              int        `json:"pool_id" binding:"required"`
	OnDutyGroupID       int        `json:"on_duty_group_id"`
	StaticReceiveUsers  []*User    `json:"static_receive_users"`
	FeiShuQunRobotToken string     `json:"fei_shu_qun_robot_token" binding:"max=255"`
	RepeatInterval      string     `json:"repeat_interval" binding:"max=50"`
	SendResolved        int8       `json:"send_resolved" binding:"omitempty,oneof=1 2"`
	NotifyMethods       StringList `json:"notify_methods"`
	NeedUpgrade         int8       `json:"need_upgrade" binding:"omitempty,oneof=1 2"`
	FirstUpgradeUsers   []*User    `json:"first_upgrade_users"`
	UpgradeMinutes      int        `json:"upgrade_minutes" binding:"min=0"`
	SecondUpgradeUsers  []*User    `json:"second_upgrade_users"`
}

UpdateMonitorSendGroupReq 更新发送组请求

type UpdatePVByYamlReq

type UpdatePVByYamlReq struct {
	ClusterID int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	Name      string `json:"name" form:"name" binding:"required" comment:"PV名称"`             // PV名称
	YAML      string `json:"yaml" binding:"required" comment:"YAML内容"`                       // YAML内容
}

UpdatePVByYamlReq 通过YAML更新PV请求

type UpdatePVCByYamlReq

type UpdatePVCByYamlReq struct {
	ClusterID int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	Namespace string `json:"namespace" binding:"required" comment:"命名空间"`                    // 命名空间
	Name      string `json:"name" form:"name" binding:"required" comment:"PVC名称"`            // PVC名称
	YAML      string `json:"yaml" binding:"required" comment:"YAML内容"`                       // YAML内容
}

UpdatePVCByYamlReq 通过YAML更新PVC请求

type UpdatePVCReq

type UpdatePVCReq struct {
	ClusterID   int               `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	Namespace   string            `json:"namespace" form:"namespace" binding:"required" comment:"命名空间"`   // 命名空间
	Name        string            `json:"name" form:"name" binding:"required" comment:"PVC名称"`            // PVC名称
	Labels      map[string]string `json:"labels" comment:"标签"`                                            // 标签
	Annotations map[string]string `json:"annotations" comment:"注解"`                                       // 注解
	Spec        PVCSpec           `json:"spec" comment:"PVC规格"`                                           // PVC规格
}

UpdatePVCReq 更新PVC请求

type UpdatePVReq

type UpdatePVReq struct {
	ClusterID     int                    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	Name          string                 `json:"name" form:"name" binding:"required" comment:"PV名称"`             // PV名称
	Capacity      string                 `json:"capacity" comment:"存储容量"`                                        // 存储容量
	AccessModes   []string               `json:"access_modes" comment:"访问模式"`                                    // 访问模式
	ReclaimPolicy string                 `json:"reclaim_policy" comment:"回收策略"`                                  // 回收策略
	StorageClass  string                 `json:"storage_class" comment:"存储类"`                                    // 存储类
	VolumeMode    string                 `json:"volume_mode" comment:"卷模式"`                                      // 卷模式
	VolumeSource  map[string]interface{} `json:"volume_source" comment:"卷源配置"`                                   // 卷源配置
	NodeAffinity  map[string]interface{} `json:"node_affinity" comment:"节点亲和性"`                                  // 节点亲和性
	Labels        map[string]string      `json:"labels" comment:"标签"`                                            // 标签
	Annotations   map[string]string      `json:"annotations" comment:"注解"`                                       // 注解
}

UpdatePVReq 更新PV请求

type UpdatePodByYamlReq

type UpdatePodByYamlReq struct {
	ClusterID int    `json:"cluster_id" binding:"required"` // 集群ID
	Namespace string `json:"namespace" binding:"required"`  // 命名空间
	Name      string `json:"name" binding:"required"`       // Pod名称
	YAML      string `json:"yaml" binding:"required"`       // YAML内容
}

UpdatePodByYamlReq 通过YAML更新Pod请求

type UpdatePodReq

type UpdatePodReq struct {
	ClusterID   int               `json:"cluster_id"`  // 集群ID
	Name        string            `json:"name"`        // Pod名称
	Namespace   string            `json:"namespace"`   // 命名空间
	Labels      map[string]string `json:"labels"`      // 标签
	Annotations map[string]string `json:"annotations"` // 注解
}

UpdatePodReq 更新Pod请求

type UpdateProfileReq

type UpdateProfileReq struct {
	ID           int    `json:"id" form:"id" binding:"required"`                  // 用户ID
	RealName     string `json:"real_name" binding:"required"`                     // 真实姓名
	Desc         string `json:"desc"`                                             // 描述
	Avatar       string `json:"avatar"`                                           // 用户头像
	Mobile       string `json:"mobile" binding:"required"`                        // 手机号
	Email        string `json:"email"`                                            // 邮箱
	FeiShuUserId string `json:"fei_shu_user_id"`                                  // 飞书用户ID
	AccountType  int8   `json:"account_type" binding:"required,oneof=1 2"`        // 账号类型
	HomePath     string `json:"home_path" binding:"required"`                     // 默认首页
	Enable       int8   `json:"enable" binding:"omitempty,oneof=1 2" default:"1"` // 用户状态
}

UpdateProfileReq 更新用户信息请求

type UpdateResourceByYamlReq

type UpdateResourceByYamlReq struct {
	ClusterID int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	Namespace string `json:"namespace" binding:"required" comment:"命名空间"`                    // 命名空间
	Name      string `json:"name" binding:"required" comment:"资源名称"`                         // 资源名称
	YAML      string `json:"yaml" binding:"required" comment:"YAML内容"`                       // YAML内容
}

UpdateResourceByYamlReq 通过YAML更新K8s资源的通用请求

type UpdateRoleBindingByYamlReq

type UpdateRoleBindingByYamlReq struct {
	ClusterID   int    `json:"cluster_id" binding:"required" comment:"集群ID"`
	Namespace   string `json:"namespace" binding:"required" comment:"命名空间"`
	Name        string `json:"name" binding:"required" comment:"RoleBinding名称"`
	YamlContent string `json:"yaml_content" binding:"required" comment:"YAML内容"`
}

UpdateRoleBindingByYamlReq 通过YAML更新RoleBinding请求

type UpdateRoleBindingReq

type UpdateRoleBindingReq struct {
	ClusterID   int               `json:"cluster_id" binding:"required" comment:"集群ID"`
	Namespace   string            `json:"namespace" binding:"required" comment:"命名空间"`
	Name        string            `json:"name" binding:"required" comment:"RoleBinding名称"`
	Labels      map[string]string `json:"labels" comment:"标签"`
	Annotations map[string]string `json:"annotations" comment:"注解"`
	RoleRef     RoleRef           `json:"role_ref" binding:"required" comment:"角色引用"`
	Subjects    []Subject         `json:"subjects" binding:"required" comment:"主体列表"`
}

UpdateRoleBindingReq 更新RoleBinding请求

type UpdateRoleByYamlReq

type UpdateRoleByYamlReq struct {
	ClusterID   int    `json:"cluster_id" binding:"required" comment:"集群ID"`
	Namespace   string `json:"namespace" binding:"required" comment:"命名空间"`
	Name        string `json:"name" binding:"required" comment:"Role名称"`
	YamlContent string `json:"yaml_content" binding:"required" comment:"YAML内容"`
}

UpdateRoleByYamlReq 通过YAML更新Role请求

type UpdateRoleReq

type UpdateRoleReq struct {
	ClusterID   int               `json:"cluster_id" binding:"required" comment:"集群ID"`
	Namespace   string            `json:"namespace" binding:"required" comment:"命名空间"`
	Name        string            `json:"name" binding:"required" comment:"Role名称"`
	Labels      map[string]string `json:"labels" comment:"标签"`
	Annotations map[string]string `json:"annotations" comment:"注解"`
	Rules       []PolicyRule      `json:"rules" binding:"required" comment:"权限规则列表"`
}

UpdateRoleReq 更新Role请求

type UpdateRoleRequest

type UpdateRoleRequest struct {
	ID          int    `json:"id" form:"id" binding:"required,gt=0"` // 角色ID
	Name        string `json:"name" binding:"required,max=50"`       // 角色名称
	Code        string `json:"code" binding:"required,max=50"`       // 角色编码
	Description string `json:"description" binding:"max=500"`        // 角色描述
	Status      int    `json:"status" binding:"oneof=0 1"`           // 状态
	ApiIds      []int  `json:"api_ids"`                              // 关联的API ID列表
}

UpdateRoleRequest 更新角色请求结构体

type UpdateSecretByYamlReq

type UpdateSecretByYamlReq struct {
	ClusterID int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	Namespace string `json:"namespace" binding:"required" comment:"命名空间"`                    // 命名空间
	Name      string `json:"name" form:"name" binding:"required" comment:"Secret名称"`         // Secret名称
	YAML      string `json:"yaml" binding:"required" comment:"YAML内容"`                       // YAML内容
}

UpdateSecretByYamlReq 通过YAML更新Secret请求

type UpdateSecretReq

type UpdateSecretReq struct {
	ClusterID   int               `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	Name        string            `json:"name" form:"name" binding:"required" comment:"Secret名称"`         // Secret名称
	Namespace   string            `json:"namespace" form:"namespace" binding:"required" comment:"命名空间"`   // 命名空间
	Data        map[string][]byte `json:"data" comment:"加密数据"`                                            // 加密数据
	StringData  map[string]string `json:"string_data" comment:"明文数据"`                                     // 明文数据
	Labels      map[string]string `json:"labels" comment:"标签"`                                            // 标签
	Annotations map[string]string `json:"annotations" comment:"注解"`                                       // 注解
}

UpdateSecretReq 更新Secret请求

type UpdateServiceAccountByYamlReq

type UpdateServiceAccountByYamlReq struct {
	ClusterID   int    `json:"cluster_id" binding:"required" comment:"集群ID"`
	Namespace   string `json:"namespace" binding:"required" comment:"命名空间"`
	Name        string `json:"name" binding:"required" comment:"ServiceAccount名称"`
	YamlContent string `json:"yaml_content" binding:"required" comment:"YAML内容"`
}

UpdateServiceAccountByYamlReq 通过YAML更新ServiceAccount请求

type UpdateServiceAccountReq

type UpdateServiceAccountReq struct {
	ClusterID                    int               `json:"cluster_id" binding:"required" comment:"集群ID"`
	Namespace                    string            `json:"namespace" binding:"required" comment:"命名空间"`
	Name                         string            `json:"name" binding:"required" comment:"ServiceAccount名称"`
	Labels                       map[string]string `json:"labels" comment:"标签"`
	Annotations                  map[string]string `json:"annotations" comment:"注解"`
	AutomountServiceAccountToken *bool             `json:"automount_service_account_token" comment:"是否自动挂载服务账户令牌"`
	ImagePullSecrets             []string          `json:"image_pull_secrets" comment:"镜像拉取密钥列表"`
	Secrets                      []string          `json:"secrets" comment:"关联的Secret列表"`
}

UpdateServiceAccountReq 更新ServiceAccount请求

type UpdateServiceByYamlReq

type UpdateServiceByYamlReq struct {
	ClusterID int    `json:"cluster_id" binding:"required"` // 集群ID
	YAML      string `json:"yaml" binding:"required"`       // YAML内容
	Namespace string `json:"namespace" binding:"required"`  // 命名空间
	Name      string `json:"name" binding:"required"`       // Service名称
}

type UpdateServiceReq

type UpdateServiceReq struct {
	ClusterID   int               `json:"cluster_id"`  // 集群ID
	Name        string            `json:"name"`        // Service名称
	Namespace   string            `json:"namespace"`   // 命名空间
	Type        string            `json:"type"`        // Service类型
	Ports       []ServicePort     `json:"ports"`       // 端口配置
	Selector    map[string]string `json:"selector"`    // Pod选择器
	Labels      map[string]string `json:"labels"`      // 标签
	Annotations map[string]string `json:"annotations"` // 注解
	YAML        string            `json:"yaml"`        // YAML内容
}

UpdateServiceReq 更新Service请求

type UpdateStatefulSetByYamlReq

type UpdateStatefulSetByYamlReq struct {
	ClusterID int    `json:"cluster_id"`              // 集群ID
	Namespace string `json:"namespace"`               // 命名空间
	Name      string `json:"name"`                    // StatefulSet名称
	YAML      string `json:"yaml" binding:"required"` // YAML内容
}

UpdateStatefulSetByYamlReq 通过YAML更新StatefulSet请求

type UpdateStatefulSetReq

type UpdateStatefulSetReq struct {
	ClusterID   int               `json:"cluster_id"`   // 集群ID
	Name        string            `json:"name"`         // StatefulSet名称
	Namespace   string            `json:"namespace"`    // 命名空间
	Replicas    int32             `json:"replicas"`     // 副本数量
	ServiceName string            `json:"service_name"` // 服务名称
	Images      []string          `json:"images"`       // 容器镜像列表
	Labels      map[string]string `json:"labels"`       // 标签
	Annotations map[string]string `json:"annotations"`  // 注解
	Spec        StatefulSetSpec   `json:"spec"`         // StatefulSet规格
	YAML        string            `json:"yaml"`         // YAML内容
}

UpdateStatefulSetReq 更新StatefulSet请求

type UpdateTreeLocalResourceReq

type UpdateTreeLocalResourceReq struct {
	ID          int        `json:"id" form:"id"`
	Name        string     `json:"name"`
	Environment string     `json:"environment"`
	Description string     `json:"description"`
	Tags        StringList `json:"tags"`
	IpAddr      string     `json:"ip_addr"`
	Port        int        `json:"port"`
	OsType      string     `json:"os_type"`
	OSName      string     `json:"os_name"`
	ImageName   string     `json:"image_name"`
	Username    string     `json:"username"`
	Password    string     `json:"password"`
	Key         string     `json:"key"`
	AuthMode    AuthMode   `json:"auth_mode"`
}

UpdateTreeLocalReq 更新本地树资源请求

type UpdateTreeNodeReq

type UpdateTreeNodeReq struct {
	ID          int            `json:"id" form:"id" binding:"required"`
	Name        string         `json:"name" form:"name" binding:"required,min=1,max=50"`
	ParentID    int            `json:"parent_id" form:"parent_id"`
	Description string         `json:"description"`
	Status      TreeNodeStatus `json:"status" binding:"omitempty,oneof=1 2"`
	IsLeaf      int8           `json:"is_leaf" form:"is_leaf" binding:"omitempty,oneof=1 2"`
}

UpdateTreeNodeReq 更新节点请求

type UpdateTreeNodeStatusReq

type UpdateTreeNodeStatusReq struct {
	ID     int            `json:"id" binding:"required"`
	Status TreeNodeStatus `json:"status" binding:"required,oneof=1 2"`
}

UpdateTreeNodeStatusReq 更新节点状态请求

type UpdateWorkorderCategoryReq

type UpdateWorkorderCategoryReq struct {
	ID          int    `json:"id" binding:"required,min=1"`
	Name        string `json:"name" binding:"required,min=1,max=100"`
	Description string `json:"description" binding:"omitempty,max=500"`
	Status      int8   `json:"status" binding:"required,oneof=1 2"`
}

UpdateWorkorderCategoryReq 更新工单分类请求

type UpdateWorkorderFormDesignReq

type UpdateWorkorderFormDesignReq struct {
	ID          int        `json:"id" binding:"required,min=1"`
	Name        string     `json:"name" binding:"omitempty,min=1,max=200"`
	Description string     `json:"description" binding:"omitempty,max=1000"`
	Schema      FormSchema `json:"schema" binding:"omitempty"`
	Status      int8       `json:"status" binding:"omitempty,oneof=1 2 3"`
	CategoryID  *int       `json:"category_id" binding:"omitempty,min=1"`
	Tags        StringList `json:"tags" binding:"omitempty"`
	IsTemplate  int8       `json:"is_template" binding:"omitempty,oneof=1 2"`
}

UpdateWorkorderFormDesignReq 更新工单表单设计请求

type UpdateWorkorderInstanceCommentReq

type UpdateWorkorderInstanceCommentReq struct {
	ID       int    `json:"id" binding:"required,min=1"`
	Content  string `json:"content" binding:"required,min=1,max=2000"`
	Status   int8   `json:"status" binding:"omitempty,oneof=1 2 3"`
	IsSystem int8   `json:"is_system" binding:"omitempty,oneof=1 2"`
}

UpdateWorkorderInstanceCommentReq 更新工单实例评论请求

type UpdateWorkorderInstanceReq

type UpdateWorkorderInstanceReq struct {
	ID          int        `json:"id" binding:"required,min=1"`
	Title       string     `json:"title" binding:"omitempty,min=1,max=200"`
	Description string     `json:"description" binding:"omitempty,max=2000"`
	Priority    int8       `json:"priority" binding:"omitempty,oneof=1 2 3"`
	Tags        StringList `json:"tags" binding:"omitempty"`
	DueDate     *time.Time `json:"due_date" binding:"omitempty"`
	Status      int8       `json:"status" binding:"omitempty,oneof=1 2 3 4 5 6"`
	AssigneeID  *int       `json:"assignee_id" binding:"omitempty,min=1"`
	FormData    JSONMap    `json:"form_data" binding:"omitempty"`
	CompletedAt *time.Time `json:"completed_at" binding:"omitempty"`
}

更新工单请求

type UpdateWorkorderInstanceTimelineReq

type UpdateWorkorderInstanceTimelineReq struct {
	ID           int    `json:"id" binding:"required,min=1"`
	ActionDetail string `json:"action_detail" binding:"omitempty"`
	Comment      string `json:"comment" binding:"omitempty,max=2000"`
}

UpdateWorkorderInstanceTimelineReq 更新工单操作时间线请求

type UpdateWorkorderNotificationReq

type UpdateWorkorderNotificationReq struct {
	ID               int        `json:"id" binding:"required"`
	Name             string     `json:"name"`
	Description      string     `json:"description"`
	ProcessID        *int       `json:"process_id"`
	TemplateID       *int       `json:"template_id"`
	CategoryID       *int       `json:"category_id"`
	EventTypes       StringList `json:"event_types"`
	TriggerType      string     `json:"trigger_type"`
	TriggerCondition JSONMap    `json:"trigger_condition"`
	Channels         StringList `json:"channels"`
	RecipientTypes   StringList `json:"recipient_types"`
	RecipientUsers   StringList `json:"recipient_users"`
	RecipientRoles   StringList `json:"recipient_roles"`
	RecipientDepts   StringList `json:"recipient_depts"`
	MessageTemplate  string     `json:"message_template"`
	SubjectTemplate  string     `json:"subject_template"`
	ScheduledTime    *time.Time `json:"scheduled_time"`
	RepeatInterval   *int       `json:"repeat_interval"`
	MaxRetries       int        `json:"max_retries"`
	RetryInterval    int        `json:"retry_interval"`
	Status           int8       `json:"status"`
	Priority         int8       `json:"priority"`
	IsDefault        int8       `json:"is_default" binding:"omitempty,oneof=1 2"`
	Settings         JSONMap    `json:"settings"`
}

UpdateWorkorderNotificationReq 更新通知配置

type UpdateWorkorderProcessReq

type UpdateWorkorderProcessReq struct {
	ID           int               `json:"id" binding:"required,min=1"`
	Name         string            `json:"name" binding:"omitempty,min=1,max=200"`
	Description  string            `json:"description" binding:"omitempty,max=1000"`
	FormDesignID int               `json:"form_design_id" binding:"omitempty,min=1"`
	Definition   ProcessDefinition `json:"definition" binding:"omitempty"`
	Status       int8              `json:"status" binding:"omitempty,oneof=1 2 3"`
	CategoryID   *int              `json:"category_id" binding:"omitempty,min=1"`
	Tags         StringList        `json:"tags" binding:"omitempty"`
	IsDefault    int8              `json:"is_default" binding:"omitempty,oneof=1 2"`
}

UpdateWorkorderProcessReq 更新工单流程请求

type UpdateWorkorderTemplateReq

type UpdateWorkorderTemplateReq struct {
	ID            int        `json:"id" binding:"required,min=1"`
	Name          string     `json:"name" binding:"omitempty,min=1,max=200"`
	Description   string     `json:"description" binding:"omitempty,max=1000"`
	ProcessID     int        `json:"process_id" binding:"omitempty,min=1"`
	FormDesignID  int        `json:"form_design_id" binding:"omitempty,min=1"`
	DefaultValues JSONMap    `json:"default_values" binding:"omitempty"`
	Status        int8       `json:"status" binding:"omitempty,oneof=1 2"`
	CategoryID    *int       `json:"category_id" binding:"omitempty,min=1"`
	Tags          StringList `json:"tags" binding:"omitempty"`
}

UpdateWorkorderTemplateReq 更新工单模板请求

type User

type User struct {
	Model
	Username     string `json:"username" gorm:"type:varchar(100);not null;comment:用户登录名"`                             // 用户登录名,唯一且非空
	Password     string `json:"-" gorm:"type:varchar(255);not null;comment:用户登录密码"`                                   // 用户登录密码,非空,JSON序列化时忽略
	RealName     string `json:"real_name" gorm:"type:varchar(100);comment:用户真实姓名"`                                    // 用户真实姓名
	Domain       string `json:"domain" gorm:"type:varchar(100);default:'default';comment:用户域"`                        // 用户域,默认default
	Desc         string `json:"desc" gorm:"type:text;comment:用户描述"`                                                   // 用户描述,支持较长文本
	Avatar       string `json:"avatar" gorm:"type:longblob;comment:用户头像"`                                             // 用户头像
	Mobile       string `json:"mobile" gorm:"type:varchar(20);comment:手机号"`                                           // 手机号,添加唯一索引
	Email        string `json:"email" gorm:"type:varchar(100);comment:邮箱"`                                            // 邮箱,添加唯一索引
	FeiShuUserId string `json:"fei_shu_user_id" gorm:"type:varchar(50);comment:飞书用户ID"`                               // 飞书用户ID,添加唯一索引
	AccountType  int8   `json:"account_type" gorm:"default:1;comment:账号类型 1普通用户 2服务账号" binding:"omitempty,oneof=1 2"` // 账号类型,使用int8节省空间
	HomePath     string `json:"home_path" gorm:"type:varchar(255);default:'/';comment:登录后的默认首页"`                      // 登录后的默认首页,添加默认值
	Enable       int8   `json:"enable" gorm:"default:1;comment:用户状态 1正常 2冻结" binding:"omitempty,oneof=1 2"`           // 用户状态,使用int8节省空间
	Apis         []*Api `json:"apis" gorm:"many2many:cl_user_apis;comment:关联接口"`                                      // 多对多关联接口
}

User 用户模型

func (*User) TableName

func (u *User) TableName() string

type UserLoginReq

type UserLoginReq struct {
	Username string `json:"username" binding:"required"` // 用户名
	Password string `json:"password" binding:"required"` // 密码
}

UserLoginReq 用户登录请求

type UserRole

type UserRole struct {
	ID     int `json:"id" gorm:"primaryKey;autoIncrement;comment:主键ID"`
	UserID int `json:"user_id" gorm:"not null;index;comment:用户ID"`
	RoleID int `json:"role_id" gorm:"not null;index;comment:角色ID"`
}

UserRole 用户角色关联表

func (*UserRole) TableName

func (r *UserRole) TableName() string

type UserSignUpReq

type UserSignUpReq struct {
	Username     string `json:"username" binding:"required"`                      // 用户名
	Password     string `json:"password" binding:"required,min=6"`                // 密码,至少6位
	Mobile       string `json:"mobile" binding:"required"`                        // 手机号
	Email        string `json:"email"`                                            // 邮箱
	RealName     string `json:"real_name" binding:"required"`                     // 真实姓名
	Avatar       string `json:"avatar"`                                           // 用户头像
	Desc         string `json:"desc"`                                             // 用户描述
	FeiShuUserId string `json:"fei_shu_user_id"`                                  // 飞书用户ID
	AccountType  int8   `json:"account_type" binding:"required,oneof=1 2"`        // 账号类型 1普通用户 2服务账号
	HomePath     string `json:"home_path" binding:"omitempty" default:"/"`        // 默认首页
	Enable       int8   `json:"enable" binding:"omitempty,oneof=1 2" default:"1"` // 用户状态 1正常 2冻结
}

UserSignUpReq 用户注册请求

type UserStatistics

type UserStatistics struct {
	AdminCount      int64 `json:"admin_count"`       // 管理员数量
	ActiveUserCount int64 `json:"active_user_count"` // 活跃用户数量
}

UserStatistics 用户统计

type ValidateScheduleReq

type ValidateScheduleReq struct {
	Schedule string `json:"schedule" form:"schedule" binding:"required"`
}

type ValidateScheduleResp

type ValidateScheduleResp struct {
	Valid        bool       `json:"valid"`                    // 是否有效
	ErrorMessage string     `json:"error_message,omitempty"`  // 错误信息
	NextRunTimes StringList `json:"next_run_times,omitempty"` // 下次运行时间预览
}

type ValidateYamlReq

type ValidateYamlReq struct {
	YAML string `json:"yaml" binding:"required" comment:"YAML内容"` // YAML内容
}

ValidateYamlReq 验证YAML格式的请求

type WorkorderCategory

type WorkorderCategory struct {
	Model
	Name         string `json:"name" gorm:"column:name;type:varchar(100);not null;index;comment:分类名称"`
	Status       int8   `json:"status" gorm:"column:status;not null;default:1;index;comment:状态:1-启用,2-禁用"`
	Description  string `json:"description" gorm:"column:description;type:varchar(500);comment:分类描述"`
	OperatorID   int    `json:"operator_id" gorm:"column:operator_id;not null;index;comment:操作人ID"`
	OperatorName string `json:"operator_name" gorm:"column:operator_name;type:varchar(100);not null;index;comment:操作人名称"`
}

WorkorderCategory 工单分类实体

func (WorkorderCategory) TableName

func (WorkorderCategory) TableName() string

TableName 指定工单分类表名

type WorkorderFormDesign

type WorkorderFormDesign struct {
	Model
	Name         string             `json:"name" gorm:"column:name;type:varchar(200);not null;index;comment:表单名称"`
	Description  string             `json:"description" gorm:"column:description;type:varchar(1000);comment:表单描述"`
	Schema       JSONMap            `json:"schema" gorm:"column:schema;type:json;not null;comment:表单JSON结构"`
	Status       int8               `json:"status" gorm:"column:status;not null;default:1;index;comment:状态:1-草稿,2-已发布,3-已归档"`
	CategoryID   *int               `json:"category_id" gorm:"column:category_id;index;comment:分类ID"`
	OperatorID   int                `json:"operator_id" gorm:"column:operator_id;not null;index;comment:操作人ID"`
	OperatorName string             `json:"operator_name" gorm:"column:operator_name;type:varchar(100);not null;index;comment:操作人名称"`
	Tags         StringList         `json:"tags" gorm:"column:tags;comment:标签"`
	IsTemplate   int8               `json:"is_template" gorm:"column:is_template;not null;default:1;comment:是否为模板:1-是,2-否"`
	Category     *WorkorderCategory `json:"category" gorm:"foreignKey:CategoryID;references:ID"`
}

WorkorderFormDesign 工单表单设计实体

func (WorkorderFormDesign) TableName

func (WorkorderFormDesign) TableName() string

TableName 指定工单表单设计表名

type WorkorderInstance

type WorkorderInstance struct {
	Model
	Title         string     `json:"title" gorm:"column:title;type:varchar(200);not null;index;comment:工单标题"`
	SerialNumber  string     `json:"serial_number" gorm:"column:serial_number;type:varchar(50);not null;uniqueIndex;comment:工单编号"`
	ProcessID     int        `json:"process_id" gorm:"column:process_id;not null;index;comment:流程ID"`
	CurrentStepID *string    `json:"current_step_id" gorm:"column:current_step_id;type:varchar(50);index;comment:当前步骤ID"`
	FormData      JSONMap    `json:"form_data" gorm:"column:form_data;type:json;comment:表单数据"`
	Status        int8       `json:"status" gorm:"column:status;not null;default:1;index;comment:状态"`
	Priority      int8       `json:"priority" gorm:"column:priority;not null;default:2;index;comment:优先级:1-高,2-中,3-低"`
	OperatorID    int        `json:"operator_id" gorm:"column:operator_id;not null;index;comment:操作人ID"`
	OperatorName  string     `json:"operator_name" gorm:"column:operator_name;type:varchar(100);not null;comment:操作人名称"`
	AssigneeID    *int       `json:"assignee_id" gorm:"column:assignee_id;index;comment:当前处理人ID"`
	Description   string     `json:"description" gorm:"column:description;type:text;comment:详细描述"`
	Tags          StringList `json:"tags" gorm:"column:tags;comment:标签"`
	DueDate       *time.Time `json:"due_date" gorm:"column:due_date;index;comment:截止时间"`
	CompletedAt   *time.Time `json:"completed_at" gorm:"column:completed_at;comment:完成时间"`

	// 关联字段
	Process  *WorkorderProcess           `json:"process,omitempty" gorm:"foreignKey:ProcessID;references:ID"`
	Comments []WorkorderInstanceComment  `json:"comments,omitempty" gorm:"foreignKey:InstanceID;references:ID"`
	FlowLogs []WorkorderInstanceFlow     `json:"flow_logs,omitempty" gorm:"foreignKey:InstanceID;references:ID"`
	Timeline []WorkorderInstanceTimeline `json:"timeline,omitempty" gorm:"foreignKey:InstanceID;references:ID"`
}

WorkorderInstance 工单

func (WorkorderInstance) TableName

func (WorkorderInstance) TableName() string

type WorkorderInstanceComment

type WorkorderInstanceComment struct {
	Model
	InstanceID   int                        `json:"instance_id" gorm:"column:instance_id;not null;index;comment:工单实例ID"`
	OperatorID   int                        `json:"operator_id" gorm:"column:operator_id;not null;index;comment:操作人ID"`
	OperatorName string                     `json:"operator_name" gorm:"column:operator_name;type:varchar(100);not null;comment:操作人名称"`
	Content      string                     `json:"content" gorm:"column:content;type:text;not null;comment:评论内容"`
	ParentID     *int                       `json:"parent_id,omitempty" gorm:"column:parent_id;index;comment:父评论ID,如果没有父评论,则不传"`
	Type         string                     `json:"type" gorm:"column:type;type:varchar(20);not null;default:'normal';comment:评论类型"`
	Status       int8                       `json:"status" gorm:"column:status;not null;default:1;index;comment:状态:1-正常,2-已删除,3-已隐藏"`
	IsSystem     int8                       `json:"is_system" gorm:"column:is_system;not null;default:2;comment:是否系统评论:1-是,2-否"`
	Children     []WorkorderInstanceComment `json:"children,omitempty" gorm:"-"`
}

WorkorderInstanceComment 工单实例评论实体

func (WorkorderInstanceComment) TableName

func (WorkorderInstanceComment) TableName() string

TableName 指定工单实例评论表名

type WorkorderInstanceFlow

type WorkorderInstanceFlow struct {
	Model
	InstanceID     int    `json:"instance_id" gorm:"column:instance_id;not null;index;comment:工单实例ID"`
	Action         string `json:"action" gorm:"column:action;type:varchar(32);not null;comment:流转动作"`
	OperatorID     int    `json:"operator_id" gorm:"column:operator_id;not null;index;comment:操作人ID"`
	OperatorName   string `json:"operator_name" gorm:"column:operator_name;type:varchar(100);not null;comment:操作人名称"`
	FromStatus     int8   `json:"from_status" gorm:"column:from_status;not null;comment:变更前状态"`
	ToStatus       int8   `json:"to_status" gorm:"column:to_status;not null;comment:变更后状态"`
	Comment        string `json:"comment" gorm:"column:comment;type:varchar(1000);comment:审批意见或处理说明"`
	IsSystemAction int8   `json:"is_system_action" gorm:"column:is_system_action;not null;default:2;comment:是否为系统自动操作:1-是,2-否"`
}

WorkorderInstanceFlow 工单状态流转记录 - 专注于状态变更的业务流程

func (WorkorderInstanceFlow) TableName

func (WorkorderInstanceFlow) TableName() string

type WorkorderInstanceTimeline

type WorkorderInstanceTimeline struct {
	Model
	InstanceID   int    `` /* 170-byte string literal not displayed */
	Action       string `` /* 135-byte string literal not displayed */
	OperatorID   int    `` /* 130-byte string literal not displayed */
	OperatorName string `json:"operator_name" gorm:"column:operator_name;type:varchar(100);comment:操作人名称"`
	ActionDetail string `json:"action_detail" gorm:"column:action_detail;type:text;comment:操作详情(JSON格式)"`
	Comment      string `json:"comment" gorm:"column:comment;type:varchar(2000);comment:操作备注或说明"`
	RelatedID    *int   `json:"related_id" gorm:"column:related_id;index;comment:关联记录ID(如评论ID、附件ID等)"`
}

WorkorderInstanceTimeline 工单操作时间线 - 记录所有操作历史和审计日志

func (WorkorderInstanceTimeline) TableName

func (WorkorderInstanceTimeline) TableName() string

type WorkorderNotification

type WorkorderNotification struct {
	Model
	Name             string     `json:"name" gorm:"column:name;type:varchar(200);not null;index;comment:通知配置名称"`
	Description      string     `json:"description" gorm:"column:description;type:varchar(1000);comment:通知配置描述"`
	ProcessID        *int       `json:"process_id" gorm:"column:process_id;index;comment:关联流程ID"`
	TemplateID       *int       `json:"template_id" gorm:"column:template_id;index;comment:关联模板ID"`
	CategoryID       *int       `json:"category_id" gorm:"column:category_id;index;comment:关联分类ID"`
	EventTypes       StringList `json:"event_types" gorm:"column:event_types;type:text;not null;comment:触发事件类型"`
	TriggerType      string     `json:"trigger_type" gorm:"column:trigger_type;type:varchar(20);not null;default:'immediate';comment:触发类型"`
	TriggerCondition JSONMap    `json:"trigger_condition" gorm:"column:trigger_condition;type:json;comment:触发条件"`
	Channels         StringList `json:"channels" gorm:"column:channels;type:text;not null;comment:通知渠道"`
	RecipientTypes   StringList `json:"recipient_types" gorm:"column:recipient_types;type:text;not null;comment:接收人类型"`
	RecipientUsers   StringList `json:"recipient_users" gorm:"column:recipient_users;type:text;comment:自定义接收人用户ID"`
	RecipientRoles   StringList `json:"recipient_roles" gorm:"column:recipient_roles;type:text;comment:接收人角色ID"`
	RecipientDepts   StringList `json:"recipient_depts" gorm:"column:recipient_depts;type:text;comment:接收人部门ID"`
	MessageTemplate  string     `json:"message_template" gorm:"column:message_template;type:text;not null;comment:消息模板"`
	SubjectTemplate  string     `json:"subject_template" gorm:"column:subject_template;type:varchar(500);comment:主题模板"`
	ScheduledTime    *time.Time `json:"scheduled_time" gorm:"column:scheduled_time;comment:定时发送时间"`
	RepeatInterval   *int       `json:"repeat_interval" gorm:"column:repeat_interval;comment:重复间隔(分钟)"`
	MaxRetries       int        `json:"max_retries" gorm:"column:max_retries;not null;default:3;comment:最大重试次数"`
	RetryInterval    int        `json:"retry_interval" gorm:"column:retry_interval;not null;default:5;comment:重试间隔(分钟)"`
	Status           int8       `json:"status" gorm:"column:status;not null;default:1;index;comment:状态:1-启用,2-禁用"`
	Priority         int8       `json:"priority" gorm:"column:priority;not null;default:2;comment:优先级:1-高,2-中,3-低"`
	OperatorID       int        `json:"operator_id" gorm:"column:operator_id;not null;index;comment:操作人ID"`
	IsDefault        int8       `json:"is_default" gorm:"column:is_default;not null;default:2;comment:是否默认配置:1-是,2-否"`
	Settings         JSONMap    `json:"settings" gorm:"column:settings;type:json;comment:通知设置"`
}

工单通知配置

func (WorkorderNotification) TableName

func (WorkorderNotification) TableName() string

type WorkorderNotificationChannel

type WorkorderNotificationChannel struct {
	Channels StringList `json:"channels"`
}

type WorkorderNotificationLog

type WorkorderNotificationLog struct {
	Model
	NotificationID int        `json:"notification_id" gorm:"not null;index;comment:通知配置ID"`
	InstanceID     *int       `json:"instance_id" gorm:"index;comment:工单实例ID"`
	EventType      string     `json:"event_type" gorm:"type:varchar(50);not null;index;comment:触发事件类型"`
	Channel        string     `json:"channel" gorm:"type:varchar(20);not null;index;comment:发送渠道"`
	RecipientType  string     `json:"recipient_type" gorm:"type:varchar(20);not null;comment:接收人类型"`
	RecipientID    string     `json:"recipient_id" gorm:"type:varchar(100);not null;index;comment:接收人ID"`
	RecipientName  string     `json:"recipient_name" gorm:"type:varchar(200);comment:接收人名称"`
	RecipientAddr  string     `json:"recipient_addr" gorm:"type:varchar(500);not null;comment:接收人地址"`
	Subject        string     `json:"subject" gorm:"type:varchar(500);comment:消息主题"`
	Content        string     `json:"content" gorm:"type:text;not null;comment:发送内容"`
	Status         int8       `json:"status" gorm:"not null;index;comment:发送状态:1-待发送,2-发送中,3-发送成功,4-发送失败"`
	ErrorMessage   string     `json:"error_message" gorm:"type:text;comment:错误信息"`
	ResponseData   JSONMap    `json:"response_data" gorm:"type:json;comment:响应数据"`
	SendAt         time.Time  `json:"send_at" gorm:"not null;comment:发送时间"`
	DeliveredAt    *time.Time `json:"delivered_at" gorm:"comment:送达时间"`
	ReadAt         *time.Time `json:"read_at" gorm:"comment:阅读时间"`
	Cost           *float64   `json:"cost" gorm:"comment:发送成本"`
	RetryCount     int        `json:"retry_count" gorm:"not null;default:0;comment:重试次数"`
	NextRetryAt    *time.Time `json:"next_retry_at" gorm:"comment:下次重试时间"`
	SenderID       int        `json:"sender_id" gorm:"not null;comment:发送人ID"`
	ExtendedData   JSONMap    `json:"extended_data" gorm:"type:json;comment:扩展数据"`
}

工单通知发送记录

func (WorkorderNotificationLog) TableName

func (WorkorderNotificationLog) TableName() string

type WorkorderNotificationQueue

type WorkorderNotificationQueue struct {
	Model
	NotificationID int        `json:"notification_id" gorm:"not null;index;comment:通知配置ID"`
	InstanceID     *int       `json:"instance_id" gorm:"index;comment:工单实例ID"`
	EventType      string     `json:"event_type" gorm:"type:varchar(50);not null;index;comment:触发事件类型"`
	Channel        string     `json:"channel" gorm:"type:varchar(20);not null;comment:发送渠道"`
	RecipientType  string     `json:"recipient_type" gorm:"type:varchar(20);not null;comment:接收人类型"`
	RecipientID    string     `json:"recipient_id" gorm:"type:varchar(100);not null;comment:接收人ID"`
	RecipientAddr  string     `json:"recipient_addr" gorm:"type:varchar(500);not null;comment:接收人地址"`
	Subject        string     `json:"subject" gorm:"type:varchar(500);comment:消息主题"`
	Content        string     `json:"content" gorm:"type:text;not null;comment:发送内容"`
	Priority       int8       `json:"priority" gorm:"not null;default:2;index;comment:优先级:1-高,2-中,3-低"`
	Status         int8       `json:"status" gorm:"not null;default:1;index;comment:状态:1-待处理,2-处理中,3-处理成功,4-处理失败"`
	ScheduledAt    time.Time  `json:"scheduled_at" gorm:"not null;index;comment:计划发送时间"`
	ProcessedAt    *time.Time `json:"processed_at" gorm:"comment:处理时间"`
	RetryCount     int        `json:"retry_count" gorm:"not null;default:0;comment:重试次数"`
	NextRetryAt    *time.Time `json:"next_retry_at" gorm:"index;comment:下次重试时间"`
	ErrorMessage   string     `json:"error_message" gorm:"type:text;comment:错误信息"`
	ExtendedData   JSONMap    `json:"extended_data" gorm:"type:json;comment:扩展数据"`
}

工单通知队列

func (WorkorderNotificationQueue) TableName

func (WorkorderNotificationQueue) TableName() string

type WorkorderProcess

type WorkorderProcess struct {
	Model
	Name         string               `json:"name" gorm:"column:name;type:varchar(200);not null;index;comment:流程名称"`
	Description  string               `json:"description" gorm:"column:description;type:varchar(1000);comment:流程描述"`
	FormDesignID int                  `json:"form_design_id" gorm:"column:form_design_id;not null;index;comment:关联表单设计ID"`
	Definition   JSONMap              `json:"definition" gorm:"column:definition;type:json;not null;comment:流程JSON定义"`
	Status       int8                 `json:"status" gorm:"column:status;not null;default:1;index;comment:状态:1-草稿,2-已发布,3-已归档"`
	CategoryID   *int                 `json:"category_id" gorm:"column:category_id;index;comment:分类ID"`
	OperatorID   int                  `json:"operator_id" gorm:"column:operator_id;not null;index;comment:操作人ID"`
	OperatorName string               `json:"operator_name" gorm:"column:operator_name;type:varchar(100);not null;index;comment:操作人名称"`
	Tags         StringList           `json:"tags" gorm:"column:tags;comment:标签"`
	IsDefault    int8                 `json:"is_default" gorm:"column:is_default;not null;default:2;comment:是否为默认流程:1-是,2-否"`
	Category     *WorkorderCategory   `json:"category" gorm:"foreignKey:CategoryID;references:ID;comment:分类"`
	FormDesign   *WorkorderFormDesign `json:"form_design" gorm:"foreignKey:FormDesignID;references:ID;comment:关联表单设计"`
}

WorkorderProcess 工单流程实体

func (WorkorderProcess) TableName

func (WorkorderProcess) TableName() string

TableName 指定工单流程表名

type WorkorderTemplate

type WorkorderTemplate struct {
	Model
	Name          string               `json:"name" gorm:"column:name;type:varchar(200);not null;index;comment:模板名称"`
	Description   string               `json:"description" gorm:"column:description;type:varchar(1000);comment:模板描述"`
	ProcessID     int                  `json:"process_id" gorm:"column:process_id;not null;index;comment:关联的流程ID"`
	FormDesignID  int                  `json:"form_design_id" gorm:"column:form_design_id;not null;index;comment:关联的表单设计ID"`
	DefaultValues JSONMap              `json:"default_values" gorm:"column:default_values;type:json;comment:默认值JSON"`
	Status        int8                 `json:"status" gorm:"column:status;not null;default:1;index;comment:状态:1-启用,2-禁用"`
	CategoryID    *int                 `json:"category_id" gorm:"column:category_id;index;comment:分类ID"`
	OperatorID    int                  `json:"operator_id" gorm:"column:operator_id;not null;index;comment:操作人ID"`
	OperatorName  string               `json:"operator_name" gorm:"column:operator_name;type:varchar(100);not null;comment:操作人名称"`
	Tags          StringList           `json:"tags" gorm:"column:tags;comment:标签"`
	Process       *WorkorderProcess    `json:"process" gorm:"foreignKey:ProcessID;references:ID"`
	Category      *WorkorderCategory   `json:"category" gorm:"foreignKey:CategoryID;references:ID"`
	FormDesign    *WorkorderFormDesign `json:"form_design" gorm:"foreignKey:FormDesignID;references:ID"`
}

WorkorderTemplate 工单模板实体

func (WorkorderTemplate) TableName

func (WorkorderTemplate) TableName() string

type WriteOffReq

type WriteOffReq struct {
	Username string `json:"username" binding:"required"` // 用户名
	Password string `json:"password" binding:"required"` // 密码
}

WriteOffReq 注销账号请求

type YamlTaskCreateReq

type YamlTaskCreateReq struct {
	Name       string     `json:"name" binding:"required,min=1,max=50" comment:"任务名称"`            // 任务名称
	UserID     int        `json:"user_id" comment:"创建者用户ID"`                                      // 创建者用户ID
	TemplateID int        `json:"template_id" binding:"required" comment:"模板ID"`                  // 模板ID
	ClusterID  int        `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	Variables  StringList `json:"variables" comment:"YAML变量"`                                     // YAML变量
}

YamlTaskCreateReq 创建YAML任务请求

type YamlTaskDeleteReq

type YamlTaskDeleteReq struct {
	ID        int `json:"id" binding:"required" comment:"任务ID"`                           // 任务ID
	ClusterID int `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
}

YamlTaskDeleteReq 删除YAML任务请求

type YamlTaskExecuteReq

type YamlTaskExecuteReq struct {
	ID        int  `json:"id" binding:"required" comment:"任务ID"`                           // 任务ID
	DryRun    bool `json:"dry_run" comment:"是否为试运行"`                                       // 是否为试运行
	UserID    int  `json:"user_id" comment:"用户ID"`                                         // 用户ID
	ClusterID int  `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
}

YamlTaskExecuteReq 执行YAML任务请求

type YamlTaskListReq

type YamlTaskListReq struct {
	ListReq
	ClusterID  int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	TemplateID int    `json:"template_id" form:"template_id" comment:"模板ID"`                  // 模板ID
	Status     string `json:"status" form:"status" comment:"任务状态"`                            // 任务状态
	Name       string `json:"name" form:"name" comment:"任务名称"`                                // 任务名称过滤
}

YamlTaskListReq 获取YAML任务列表请求

type YamlTaskUpdateReq

type YamlTaskUpdateReq struct {
	ID         int        `json:"id" binding:"required" comment:"任务ID"`
	Name       string     `json:"name" binding:"required,min=1,max=255" comment:"YAML任务名称"`
	UserID     int        `json:"user_id" comment:"创建者用户ID"`
	TemplateID int        `json:"template_id" comment:"关联的模板ID"`
	ClusterID  int        `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"`
	Variables  StringList `json:"variables" comment:"yaml变量,格式k=v,k=v"`
}

YamlTaskUpdateReq 更新YAML任务请求

type YamlTemplateCheckReq

type YamlTemplateCheckReq struct {
	Name      string `json:"name" binding:"required,min=1,max=50" comment:"模板名称"`            // 模板名称
	Content   string `json:"content" binding:"required" comment:"YAML模板内容"`                  // YAML模板内容
	ClusterID int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
}

YamlTemplateCheckReq 检查YAML模板请求

type YamlTemplateCreateReq

type YamlTemplateCreateReq struct {
	Name      string `json:"name" binding:"required,min=1,max=50" comment:"模板名称"`            // 模板名称
	UserID    int    `json:"user_id" comment:"创建者用户ID"`                                      // 创建者用户ID(从token中获取)
	Content   string `json:"content" binding:"required" comment:"YAML模板内容"`                  // YAML模板内容
	ClusterID int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
}

YamlTemplateCreateReq 创建YAML模板请求

type YamlTemplateDeleteReq

type YamlTemplateDeleteReq struct {
	ID        int `json:"id" binding:"required" comment:"模板ID"`                           // 模板ID
	ClusterID int `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
	UserID    int `json:"user_id" comment:"用户ID"`                                         // 用户ID
}

YamlTemplateDeleteReq 删除YAML模板请求

type YamlTemplateDetailReq

type YamlTemplateDetailReq struct {
	ID        int `json:"id" binding:"required" comment:"模板ID"`                           // 模板ID
	ClusterID int `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
}

YamlTemplateDetailReq 获取YAML模板详情请求

type YamlTemplateListReq

type YamlTemplateListReq struct {
	ListReq
	ClusterID int `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
}

YamlTemplateListReq 获取YAML模板列表请求

type YamlTemplateUpdateReq

type YamlTemplateUpdateReq struct {
	ID        int    `json:"id" binding:"required" comment:"模板ID"`                           // 模板ID
	Name      string `json:"name" binding:"required,min=1,max=50" comment:"模板名称"`            // 模板名称
	UserID    int    `json:"user_id" comment:"创建者用户ID"`                                      // 创建者用户ID(从token中获取)
	Content   string `json:"content" binding:"required" comment:"YAML模板内容"`                  // YAML模板内容
	ClusterID int    `json:"cluster_id" form:"cluster_id" binding:"required" comment:"集群ID"` // 集群ID
}

YamlTemplateUpdateReq 更新YAML模板请求

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL