Documentation
¶
Index ¶
- Constants
- type AddToolToBlacklistReq
- type AddToolToWhitelistReq
- type AddTreeNodeMemberReq
- type AdvancedSearchOptions
- type Affinity
- type AffinityRule
- type AlertRuleSeverity
- type Api
- type ApiStatistics
- type AppliedTimeout
- type ApproveWorkorderInstanceReq
- type ArchiveAuditLogsRequest
- type AssignRoleApiRequest
- type AssignRoleRequest
- type AssignRolesToUserRequest
- type AssignWorkorderInstanceReq
- type AuditLog
- type AuditLogBatch
- type AuditStatistics
- type AuditTypeInfo
- type AuthMode
- type BatchDeleteK8sCronjobRequest
- type BatchDeleteK8sInstanceReq
- type BatchDeleteK8sInstanceResp
- type BatchDeleteReq
- type BatchDeleteRequest
- type BatchRestartK8sInstanceReq
- type BatchRestartK8sInstanceResp
- type BindClusterRoleToServiceAccountRequest
- type BindRoleToServiceAccountRequest
- type BindTreeLocalResourceReq
- type BindTreeNodeResourceReq
- type CallToolReq
- type ChangePasswordReq
- type ChatCompletionResponse
- type ChatMessage
- type CheckTreeNodePermissionReq
- type CheckUserPermissionRequest
- type ClusterNamespaces
- type ConditionalTimeout
- type ConnectMCPReq
- type ConnectTerminalResourceReq
- type ContainerCore
- type CreateApiRequest
- type CreateAuditLogRequest
- type CreateClusterRoleBindingRequest
- type CreateClusterRoleRequest
- type CreateK8sAppRequest
- type CreateK8sCronjobRequest
- type CreateK8sInstanceReq
- type CreateK8sInstanceResp
- type CreateK8sProjectRequest
- type CreateK8sRoleRequest
- type CreateMCPConfigReq
- type CreateMonitorAlertManagerPoolReq
- type CreateMonitorAlertRuleReq
- type CreateMonitorConfigReq
- type CreateMonitorOnDutyGroupChangeReq
- type CreateMonitorOnDutyGroupReq
- type CreateMonitorRecordRuleReq
- type CreateMonitorScrapeJobReq
- type CreateMonitorScrapePoolReq
- type CreateMonitorSendGroupReq
- type CreateNamespaceRequest
- type CreateRoleBindingRequest
- type CreateRoleRequest
- type CreateServiceAccountRequest
- type CreateToolBlacklistReq
- type CreateToolReq
- type CreateToolWhitelistReq
- type CreateTreeLocalResourceReq
- type CreateTreeNodeReq
- type CreateWorkorderCategoryReq
- type CreateWorkorderFormDesignReq
- type CreateWorkorderInstanceCommentReq
- type CreateWorkorderInstanceFlowReq
- type CreateWorkorderInstanceReq
- type CreateWorkorderInstanceTimelineReq
- type CreateWorkorderNotificationReq
- type CreateWorkorderProcessReq
- type CreateWorkorderTemplateReq
- type DeleteApiRequest
- type DeleteAuditLogRequest
- type DeleteClusterRoleBindingRequest
- type DeleteClusterRoleRequest
- type DeleteK8sRoleRequest
- type DeleteMCPConfigReq
- type DeleteMonitorAlertManagerPoolReq
- type DeleteMonitorAlertRuleReq
- type DeleteMonitorConfigReq
- type DeleteMonitorOnDutyGroupReq
- type DeleteMonitorRecordRuleReq
- type DeleteMonitorScrapeJobReq
- type DeleteMonitorScrapePoolReq
- type DeleteMonitorSendGroupReq
- type DeleteRoleBindingRequest
- type DeleteRoleRequest
- type DeleteServiceAccountRequest
- type DeleteToolBlacklistReq
- type DeleteToolReq
- type DeleteToolWhitelistReq
- type DeleteTreeLocalResourceReq
- type DeleteTreeNodeReq
- type DeleteUserReq
- type DeleteWorkorderCategoryReq
- type DeleteWorkorderFormDesignReq
- type DeleteWorkorderInstanceCommentReq
- type DeleteWorkorderInstanceReq
- type DeleteWorkorderInstanceTimelineReq
- type DeleteWorkorderNotificationReq
- type DeleteWorkorderProcessReq
- type DeleteWorkorderTemplateReq
- type DetailWorkorderCategoryReq
- type DetailWorkorderFormDesignReq
- type DetailWorkorderInstanceCommentReq
- type DetailWorkorderInstanceFlowReq
- type DetailWorkorderInstanceReq
- type DetailWorkorderInstanceTimelineReq
- type DetailWorkorderNotificationReq
- type DetailWorkorderProcessReq
- type DetailWorkorderTemplateReq
- type DisconnectMCPReq
- type EffectChange
- type EffectTransition
- type EnableSwitchMonitorAlertRuleReq
- type EnableSwitchMonitorRecordRuleReq
- type Event
- type EventAlertClaimReq
- type EventAlertSilenceReq
- type EventAlertUnSilenceReq
- type EvictionPolicy
- type EvictionSummary
- type FormField
- type FormSchema
- type GetApiRequest
- type GetAuditLogDetailRequest
- type GetInstanceCommentsTreeReq
- type GetK8sAppListRequest
- type GetK8sCronjobListRequest
- type GetK8sInstanceByAppReq
- type GetK8sInstanceByAppResp
- type GetK8sInstanceListReq
- type GetK8sInstanceListResp
- type GetK8sInstanceReq
- type GetK8sInstanceResp
- type GetK8sProjectListRequest
- type GetMCPConfigReq
- type GetMCPConfigsReq
- type GetMCPStatusReq
- type GetMonitorAlertEventListReq
- type GetMonitorAlertManagerPoolListReq
- type GetMonitorAlertManagerPoolReq
- type GetMonitorAlertRuleListReq
- type GetMonitorAlertRuleReq
- type GetMonitorConfigByInstanceReq
- type GetMonitorConfigListReq
- type GetMonitorConfigReq
- type GetMonitorOnDutyGroupChangeListReq
- type GetMonitorOnDutyGroupFuturePlanReq
- type GetMonitorOnDutyGroupListReq
- type GetMonitorOnDutyGroupReq
- type GetMonitorOnDutyHistoryReq
- type GetMonitorRecordRuleListReq
- type GetMonitorRecordRuleReq
- type GetMonitorScrapeJobDetailReq
- type GetMonitorScrapeJobListReq
- type GetMonitorScrapePoolDetailReq
- type GetMonitorScrapePoolListReq
- type GetMonitorSendGroupListReq
- type GetMonitorSendGroupReq
- type GetPermCodeReq
- type GetRoleApiRequest
- type GetRoleRequest
- type GetRoleUsersRequest
- type GetToolBlacklistReq
- type GetToolBlacklistsReq
- type GetToolReq
- type GetToolWhitelistReq
- type GetToolWhitelistsReq
- type GetToolsReq
- type GetTreeLocalResourceDetailReq
- type GetTreeLocalResourceListReq
- type GetTreeNodeChildNodesReq
- type GetTreeNodeDetailReq
- type GetTreeNodeListReq
- type GetTreeNodeMembersReq
- type GetUserDetailReq
- type GetUserListReq
- type GetUserPermissionsRequest
- type GetUserRolesRequest
- type GetUserTreeNodesReq
- type HistoryMessage
- type HourlyTrendItem
- type ItemDef
- type JSONMap
- type K8sAffinityVisualizationRequest
- type K8sAffinityVisualizationResponse
- type K8sApp
- type K8sCluster
- type K8sClusterNodesRequest
- type K8sClusterRole
- type K8sClusterRoleBinding
- type K8sConfigMapHotReloadRequest
- type K8sConfigMapRequest
- type K8sConfigMapRollbackRequest
- type K8sConfigMapVersion
- type K8sConfigMapVersionRequest
- type K8sContainerExecHistory
- type K8sContainerExecHistoryRequest
- type K8sContainerExecHistoryResponse
- type K8sContainerExecRequest
- type K8sContainerExecResponse
- type K8sContainerFile
- type K8sContainerFileDeleteRequest
- type K8sContainerFileEditRequest
- type K8sContainerFileUploadRequest
- type K8sContainerFilesRequest
- type K8sContainerFilesResponse
- type K8sContainerLogEntry
- type K8sContainerLogsExportRequest
- type K8sContainerLogsRequest
- type K8sContainerLogsResponse
- type K8sContainerPort
- type K8sContainerSession
- type K8sContainerTerminalRequest
- type K8sContainerTerminalResponse
- type K8sCronjob
- type K8sCronjobPodResponse
- type K8sCronjobRequest
- type K8sDaemonSetRequest
- type K8sDaemonSetStatus
- type K8sDeploymentRequest
- type K8sEndpointRequest
- type K8sEndpointStatus
- type K8sEnvVar
- type K8sHTTPGetAction
- type K8sIngressRequest
- type K8sIngressStatus
- type K8sInstance
- type K8sJobHistory
- type K8sJobRequest
- type K8sJobStatus
- type K8sLabelBatchRequest
- type K8sLabelComplianceRequest
- type K8sLabelComplianceResponse
- type K8sLabelHistoryRequest
- type K8sLabelHistoryResponse
- type K8sLabelPolicyRequest
- type K8sLabelRequest
- type K8sLabelResponse
- type K8sLabelRule
- type K8sLabelSelector
- type K8sLabelSelectorRequest
- type K8sLabelSelectorRequirement
- type K8sLimitRangeRequest
- type K8sLimitRangeStatus
- type K8sNetworkPolicyRequest
- type K8sNetworkPolicyStatus
- type K8sNode
- type K8sNodeAffinityRequest
- type K8sNodeAffinityResponse
- type K8sNodeAffinityValidationRequest
- type K8sNodeAffinityValidationResponse
- type K8sNodeRelationship
- type K8sNodeSelectorRequirement
- type K8sNodeSelectorTerm
- type K8sNodeTaintRequest
- type K8sNodeTaintResponse
- type K8sOneVolume
- type K8sPVCRequest
- type K8sPVCStatus
- type K8sPVRequest
- type K8sPVStatus
- type K8sPod
- type K8sPodAffinityRequest
- type K8sPodAffinityResponse
- type K8sPodAffinityTerm
- type K8sPodAffinityTermSpec
- type K8sPodAffinityValidationRequest
- type K8sPodAffinityValidationResponse
- type K8sPodAntiAffinityTerm
- type K8sPodContainer
- type K8sPodListResponse
- type K8sPodRelationship
- type K8sPodRequest
- type K8sPreferredSchedulingTerm
- type K8sProbe
- type K8sProject
- type K8sResourceList
- type K8sResourceQuotaRequest
- type K8sResourceQuotaStatus
- type K8sResourceQuotaUsage
- type K8sRole
- type K8sRoleBinding
- type K8sSecretEncryptionRequest
- type K8sSecretRequest
- type K8sSecretStatus
- type K8sServiceAccount
- type K8sServiceRequest
- type K8sStatefulSetRequest
- type K8sStatefulSetScaleRequest
- type K8sStatefulSetStatus
- type K8sStorageClassRequest
- type K8sStorageClassStatus
- type K8sTaint
- type K8sTaintEffectConfig
- type K8sTaintEffectManagementRequest
- type K8sTaintEffectManagementResponse
- type K8sTaintTolerationRequest
- type K8sTaintTolerationResponse
- type K8sTaintTolerationValidationRequest
- type K8sTaintTolerationValidationResponse
- type K8sToleration
- type K8sTolerationConfigRequest
- type K8sTolerationSpec
- type K8sTolerationTemplate
- type K8sTolerationTimeRequest
- type K8sTolerationTimeResponse
- type K8sVolumeMount
- type K8sWeightedPodAffinityTerm
- type K8sYamlTask
- type K8sYamlTemplate
- type KeyValueItem
- type LabelK8sNodesRequest
- type ListApisRequest
- type ListAuditLogsRequest
- type ListReq
- type ListResp
- type ListRolesRequest
- type ListWorkorderCategoryReq
- type ListWorkorderFormDesignReq
- type ListWorkorderInstanceCommentReq
- type ListWorkorderInstanceFlowReq
- type ListWorkorderInstanceReq
- type ListWorkorderInstanceTimelineReq
- type ListWorkorderNotificationLogReq
- type ListWorkorderNotificationQueueReq
- type ListWorkorderNotificationReq
- type ListWorkorderProcessReq
- type ListWorkorderTemplateReq
- type LocalObjectReference
- type MCPConfig
- type Model
- type MonitorAlertEvent
- type MonitorAlertEventStatus
- type MonitorAlertManagerPool
- type MonitorAlertRule
- type MonitorConfig
- type MonitorOnDutyChange
- type MonitorOnDutyGroup
- type MonitorOnDutyHistory
- type MonitorOnDutyOne
- type MonitorRecordRule
- type MonitorScrapeJob
- type MonitorScrapePool
- type MonitorSendGroup
- type MoveTreeNodeReq
- type Namespace
- type NoExecuteConfig
- type NoScheduleConfig
- type NotificationConfig
- type ObjectReference
- type OneEvent
- type PodEvictionInfo
- type PolicyRule
- type PreferNoScheduleConfig
- type Probe
- type ProcessConnection
- type ProcessDefinition
- type ProcessStep
- type ProfileReq
- type PromqlAlertRuleExprCheckReq
- type PromqlRecordRuleExprCheckReq
- type PropertyDef
- type RecentActivityItem
- type RejectWorkorderInstanceReq
- type RemoveToolFromBlacklistReq
- type RemoveToolFromWhitelistReq
- type RemoveTreeNodeMemberReq
- type Resource
- type ResourceRequirements
- type ResourceStatus
- type RetryConfig
- type RevokeRoleApiRequest
- type RevokeRoleRequest
- type RevokeRolesFromUserRequest
- type Role
- type RoleApi
- type RoleRef
- type ScheduleK8sNodesRequest
- type SearchAuditLogsRequest
- type ServiceAccountPermissions
- type ServiceAccountToken
- type ServiceAccountTokenRequest
- type ServiceDiscoveryType
- type StatusDistributionItem
- type StreamResponse
- type StringList
- type Subject
- type SubmitWorkorderInstanceReq
- type Taint
- type TaintK8sNodesRequest
- type TestMCPConnectionReq
- type TestSendWorkorderNotificationReq
- type TimeScalingPolicy
- type TimeValidationResult
- type TokenRequest
- type Toleration
- type TolerationCondition
- type TolerationTimeConfig
- type Tool
- type ToolBlacklist
- type ToolParameters
- type ToolWhitelist
- type TransitionRule
- type TreeLocalResource
- type TreeNode
- type TreeNodeMemberType
- type TreeNodeStatisticsResp
- type TreeNodeStatus
- type TypeDistributionItem
- type UnBindTreeLocalResourceReq
- type UnbindClusterRoleFromServiceAccountRequest
- type UnbindRoleFromServiceAccountRequest
- type UnbindTreeNodeResourceReq
- type UpdateApiRequest
- type UpdateClusterRoleBindingRequest
- type UpdateClusterRoleRequest
- type UpdateK8sAppRequest
- type UpdateK8sCronjobRequest
- type UpdateK8sInstanceReq
- type UpdateK8sInstanceResp
- type UpdateK8sProjectRequest
- type UpdateK8sRoleRequest
- type UpdateMCPConfigReq
- type UpdateMonitorAlertManagerPoolReq
- type UpdateMonitorAlertRuleReq
- type UpdateMonitorConfigReq
- type UpdateMonitorOnDutyGroupReq
- type UpdateMonitorRecordRuleReq
- type UpdateMonitorScrapeJobReq
- type UpdateMonitorScrapePoolReq
- type UpdateMonitorSendGroupReq
- type UpdateNamespaceRequest
- type UpdateProfileReq
- type UpdateRoleBindingRequest
- type UpdateRoleRequest
- type UpdateServiceAccountRequest
- type UpdateToolBlacklistReq
- type UpdateToolReq
- type UpdateToolWhitelistReq
- type UpdateTreeLocalResourceReq
- type UpdateTreeNodeReq
- type UpdateTreeNodeStatusReq
- type UpdateWorkorderCategoryReq
- type UpdateWorkorderFormDesignReq
- type UpdateWorkorderInstanceCommentReq
- type UpdateWorkorderInstanceReq
- type UpdateWorkorderInstanceTimelineReq
- type UpdateWorkorderNotificationReq
- type UpdateWorkorderProcessReq
- type UpdateWorkorderTemplateReq
- type User
- type UserLoginReq
- type UserRole
- type UserSignUpReq
- type UserStatistics
- type Volume
- type WSResponse
- type WorkorderCategory
- type WorkorderFormDesign
- type WorkorderInstance
- type WorkorderInstanceComment
- type WorkorderInstanceFlow
- type WorkorderInstanceTimeline
- type WorkorderNotification
- type WorkorderNotificationLog
- type WorkorderNotificationQueue
- type WorkorderProcess
- type WorkorderTemplate
- type WriteOffReq
Constants ¶
const ( ConfigTypePrometheus int8 = 1 // Prometheus 主配置 ConfigTypeAlertManager int8 = 2 // AlertManager 主配置 ConfigTypeAlertRule int8 = 3 // 告警规则配置 ConfigTypeRecordRule int8 = 4 // 预聚合规则配置 ConfigTypeWebhookFile int8 = 5 // webhook file )
配置类型常量
const ( ConfigStatusActive int8 = 1 // 激活状态 ConfigStatusInactive int8 = 2 // 非激活状态 )
配置状态常量
const ( IsLeafYes int8 = 1 // 是叶子节点 IsLeafNo int8 = 2 // 不是叶子节点 )
叶子节点标识常量,提升可读性,避免魔法数字
const ( CategoryStatusEnabled int8 = 1 // 启用 CategoryStatusDisabled int8 = 2 // 禁用 )
const ( FormDesignStatusDraft int8 = 1 // 草稿 FormDesignStatusPublished int8 = 2 // 已发布 FormDesignStatusArchived int8 = 3 // 已归档 )
const ( FormFieldTypeText = "text" // 文本输入 FormFieldTypeNumber = "number" // 数字输入 FormFieldTypePassword = "password" // 密码输入 FormFieldTypeTextarea = "textarea" // 多行文本 FormFieldTypeSelect = "select" // 下拉选择 FormFieldTypeRadio = "radio" // 单选框 FormFieldTypeCheckbox = "checkbox" // 复选框 FormFieldTypeDate = "date" // 日期选择 FormFieldTypeSwitch = "switch" // 开关 )
const ( InstanceStatusDraft int8 = 1 // 草稿 InstanceStatusPending int8 = 2 // 待处理 InstanceStatusProcessing int8 = 3 // 处理中 InstanceStatusCompleted int8 = 4 // 已完成 InstanceStatusRejected int8 = 5 // 已拒绝 InstanceStatusCancelled int8 = 6 // 已取消 )
工单状态
const ( PriorityLow int8 = 1 // 低 PriorityNormal int8 = 2 // 普通 PriorityHigh int8 = 3 // 高 )
工单优先级
const ( CommentTypeNormal = "normal" // 普通评论 CommentTypeSystem = "system" // 系统评论 )
评论类型常量
const ( CommentStatusNormal int8 = 1 // 正常 CommentStatusDeleted int8 = 2 // 已删除 CommentStatusHidden int8 = 3 // 已隐藏 )
评论状态常量
const ( FlowActionSubmit = "submit" // 提交工单 FlowActionApprove = "approve" // 审批通过 FlowActionReject = "reject" // 审批拒绝 FlowActionAssign = "assign" // 指派处理人 FlowActionCancel = "cancel" // 取消工单 FlowActionComplete = "complete" // 完成工单 FlowActionReturn = "return" // 退回工单 )
工单状态流转动作类型常量 - 仅包含状态变更相关操作
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" // 催办提醒 )
时间线操作类型常量 - 包含所有操作记录
const ( ProcessStatusDraft int8 = 1 // 草稿 ProcessStatusPublished int8 = 2 // 已发布 ProcessStatusArchived int8 = 3 // 已归档 )
流程状态常量
const ( ProcessStepTypeStart = "start" // 开始 ProcessStepTypeApproval = "approval" // 审批 ProcessStepTypeTask = "task" // 任务 ProcessStepTypeEnd = "end" // 结束 )
流程步骤类型常量
const ( ActionStart = "start" // 开始动作 ActionApprove = "approve" // 审批动作 ActionReject = "reject" // 驳回动作 ActionComplete = "complete" // 完成动作 ActionNotify = "notify" // 通知动作 )
可执行动作常量
const ( AssigneeTypeUser = "user" // 用户类型 AssigneeTypeGroup = "system" // 系统类型 )
受理人类型常量
const ( TemplateStatusEnabled int8 = 1 // 启用 TemplateStatusDisabled int8 = 2 // 禁用 )
模板状态常量
const ( TemplateVisibilityPrivate = "private" // 私有 TemplateVisibilityPublic = "public" // 公开 )
模板可见性常量
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddToolToBlacklistReq ¶
type AddToolToBlacklistReq struct { ID int `json:"id" binding:"required"` // 黑名单ID ToolID int `json:"tool_id" binding:"required"` // 工具ID }
AddToolToBlacklistReq 添加工具到黑名单请求
type AddToolToWhitelistReq ¶
type AddToolToWhitelistReq struct { ID int `json:"id" binding:"required"` // 白名单ID ToolName string `json:"tool_name" binding:"required"` // 工具名称 }
AddToolToWhitelistReq 添加工具到白名单请求
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 Affinity ¶
type Affinity struct { NodeAffinity []AffinityRule `json:"node_affinity,omitempty"` // 节点亲和性 PodAffinity []AffinityRule `json:"pod_affinity,omitempty"` // Pod亲和性 PodAntiAffinity []AffinityRule `json:"pod_anti_affinity,omitempty"` // Pod反亲和性 }
type AffinityRule ¶
type AlertRuleSeverity ¶
type AlertRuleSeverity int8
const ( AlertRuleSeverityInfo AlertRuleSeverity = iota + 1 AlertRuleSeverityWarning AlertRuleSeverityCritical )
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:关联用户"` // 多对多关联用户 }
type ApiStatistics ¶
type AppliedTimeout ¶
type AppliedTimeout struct { TaintKey string `json:"taint_key"` // 污点键 Effect string `json:"effect"` // 效果 TimeoutValue *int64 `json:"timeout_value"` // 超时值 AppliedCondition string `json:"applied_condition"` // 应用条件 Source string `json:"source"` // 来源 }
AppliedTimeout 应用的超时
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 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 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 审计日志模型 - 优化存储结构
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 BatchDeleteK8sCronjobRequest ¶
type BatchDeleteK8sCronjobRequest struct {
CronjobIDs []int64 `json:"cronjob_ids" binding:"required"`
}
BatchDeleteK8sCronjobRequest 批量删除 CronJob 的请求
type BatchDeleteK8sInstanceReq ¶
type BatchDeleteK8sInstanceReq struct {
Instances []K8sInstance `json:"instances" binding:"required,min=1"` // 实例列表
}
type BatchDeleteK8sInstanceResp ¶
type BatchDeleteK8sInstanceResp struct {
DeletedCount int `json:"deleted_count"` // 成功删除的实例数量
}
type BatchDeleteReq ¶
type BatchDeleteReq struct {
IDs []int `json:"ids" binding:"required"`
}
type BatchDeleteRequest ¶
type BatchDeleteRequest struct {
IDs []int `json:"ids" binding:"required,min=1,max=100"`
}
BatchDeleteRequest 批量删除请求
type BatchRestartK8sInstanceReq ¶
type BatchRestartK8sInstanceReq struct {
Instances []K8sInstance `json:"instances" binding:"required,min=1"` // 实例列表
}
type BatchRestartK8sInstanceResp ¶
type BatchRestartK8sInstanceResp struct {
RestartedCount int `json:"restarted_count"` // 成功重启的实例数量
}
type BindClusterRoleToServiceAccountRequest ¶
type BindClusterRoleToServiceAccountRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群ID ServiceAccountName string `json:"service_account_name" binding:"required"` // ServiceAccount 名称 Namespace string `json:"namespace" binding:"required"` // 命名空间 ClusterRoleName string `json:"cluster_role_name" binding:"required"` // ClusterRole 名称 ClusterRoleBindingName string `json:"cluster_role_binding_name,omitempty"` // ClusterRoleBinding 名称,可选 }
BindClusterRoleToServiceAccountRequest 绑定 ClusterRole 到 ServiceAccount 请求
type BindRoleToServiceAccountRequest ¶
type BindRoleToServiceAccountRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群ID ServiceAccountName string `json:"service_account_name" binding:"required"` // ServiceAccount 名称 Namespace string `json:"namespace" binding:"required"` // 命名空间 RoleName string `json:"role_name" binding:"required"` // Role 名称 RoleBindingName string `json:"role_binding_name,omitempty"` // RoleBinding 名称,可选 }
BindRoleToServiceAccountRequest 绑定 Role 到 ServiceAccount 请求
type BindTreeNodeResourceReq ¶
type BindTreeNodeResourceReq struct { NodeID int `json:"node_id" binding:"required"` ResourceIDs []int `json:"resource_ids" binding:"required,min=1"` }
BindTreeNodeResourceReq 绑定资源请求
type CallToolReq ¶
type CallToolReq struct { Name string `json:"name" binding:"required"` // 工具名称 Arguments map[string]interface{} `json:"arguments"` // 工具调用参数 }
CallToolReq 调用工具请求
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 ChatCompletionResponse ¶
type ChatCompletionResponse struct {
Answer string `json:"answer"`
}
ChatCompletionResponse 聊天完成响应
type ChatMessage ¶
type ChatMessage struct { Role string `json:"role"` Style string `json:"style"` Question string `json:"question"` ChatHistory []HistoryMessage `json:"chatHistory"` }
ChatMessage 聊天消息请求
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 ClusterNamespaces ¶
type ClusterNamespaces struct { ClusterName string `json:"cluster_name"` // 集群名称 ClusterId int `json:"cluster_id"` // 集群ID Namespaces []Namespace `json:"namespaces"` // 命名空间列表 }
ClusterNamespaces 表示一个集群及其命名空间列表
type ConditionalTimeout ¶
type ConditionalTimeout struct { Condition string `json:"condition"` // 条件 TimeoutValue *int64 `json:"timeout_value"` // 超时值 Priority int `json:"priority"` // 优先级 ApplyToEffects []string `json:"apply_to_effects"` // 应用到效果 }
ConditionalTimeout 条件超时
type ConnectMCPReq ¶
type ConnectMCPReq struct {
ID int `json:"id" binding:"required"` // MCP配置ID
}
ConnectMCPReq 连接MCP服务请求
type ConnectTerminalResourceReq ¶
ConnectTerminalReq 连接终端请求
type ContainerCore ¶
type ContainerCore struct { Name string `json:"name,omitempty" gorm:"comment:容器名称"` // 容器名称 CPU string `json:"cpu,omitempty" gorm:"comment:CPU 资源限制"` // CPU 资源限制(如 "100m", "0.5") Memory string `json:"memory,omitempty" gorm:"comment:内存资源限制"` // 内存资源限制(如 "512Mi", "2Gi") CPURequest string `json:"cpu_request,omitempty" gorm:"comment:CPU 资源请求"` // CPU 资源请求 MemRequest string `json:"mem_request,omitempty" gorm:"comment:内存资源请求"` // 内存资源请求 Command []string `json:"command,omitempty" gorm:"serializer:json;comment:容器启动命令"` // 容器启动命令 Args []string `json:"args,omitempty" gorm:"serializer:json;comment:容器启动参数"` // 容器启动参数 Envs map[string]string `json:"envs,omitempty" gorm:"serializer:json;comment:环境变量"` // 环境变量 PullPolicy string `json:"pull_policy,omitempty" gorm:"comment:镜像拉取策略"` // 镜像拉取策略 Volumes []Volume `json:"volumes,omitempty" gorm:"serializer:json;comment:挂载卷"` // 挂载卷 }
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 CreateClusterRoleBindingRequest ¶
type CreateClusterRoleBindingRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群ID Name string `json:"name" binding:"required"` // ClusterRoleBinding 名称 Labels StringList `json:"labels,omitempty"` // 标签 Annotations StringList `json:"annotations,omitempty"` // 注解 Subjects []Subject `json:"subjects" binding:"required"` // 绑定的主体 RoleRef RoleRef `json:"role_ref" binding:"required"` // 角色引用 }
CreateClusterRoleBindingRequest 创建 ClusterRoleBinding 请求
type CreateClusterRoleRequest ¶
type CreateClusterRoleRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群ID Name string `json:"name" binding:"required"` // ClusterRole 名称 Labels StringList `json:"labels,omitempty"` // 标签 Annotations StringList `json:"annotations,omitempty"` // 注解 Rules []PolicyRule `json:"rules" binding:"required"` // 策略规则 }
CreateClusterRoleRequest 创建 ClusterRole 请求
type CreateK8sAppRequest ¶
type CreateK8sAppRequest struct { Name string `json:"name" binding:"required,min=1,max=200"` // 应用名称 K8sProjectID int64 `json:"k8s_project_id" binding:"required"` // 关联的 Kubernetes 项目ID UserID int `json:"user_id" binding:"required"` // 创建者用户ID Cluster string `json:"cluster" binding:"required"` // 所属集群名称 ServiceType string `json:"service_type,omitempty"` // 服务类型 Namespace string `json:"namespace" binding:"required"` // Kubernetes 命名空间 ContainerCore `json:"containerCore"` // 容器核心配置 }
CreateK8sAppRequest 创建 Kubernetes 应用的请求
type CreateK8sCronjobRequest ¶
type CreateK8sCronjobRequest struct { Name string `json:"name" binding:"required,min=1,max=200"` // 定时任务名称 Cluster string `json:"cluster" binding:"required"` // 所属集群 TreeNodeID int `json:"tree_node_id,omitempty"` // 关联的树节点ID(可选) UserID int `json:"user_id" binding:"required"` // 创建者用户ID K8sProjectID int `json:"k8s_project_id" binding:"required"` // 关联的 Kubernetes 项目ID Namespace string `json:"namespace" binding:"required"` // 命名空间 Schedule string `json:"schedule" binding:"required"` // 调度表达式 Image string `json:"image" binding:"required"` // 镜像 Commands StringList `json:"commands,omitempty"` // 启动命令组 Args StringList `json:"args,omitempty"` // 启动参数 }
CreateK8sCronjobRequest 创建 CronJob 的请求
type CreateK8sInstanceReq ¶
type CreateK8sInstanceReq struct { Name string `json:"name" binding:"required,min=1,max=200"` // 实例名称 UserID int `json:"user_id" binding:"required"` // 创建者用户ID ClusterID int `json:"cluster_id" binding:"required"` // 所属集群ID ContainerCore ContainerCore `json:"containerCore" binding:"required"` // 容器配置 Image string `json:"image" binding:"required"` // 镜像 Replicas int `json:"replicas,omitempty"` // 副本数量 K8sAppID int `json:"k8s_app_id" binding:"required"` // 关联的 Kubernetes 应用ID,修正字段名称 Namespace string `json:"namespace,omitempty"` // 命名空间 Type string `json:"type,omitempty"` // 实例类型(Deployment/StatefulSet/DaemonSet) Strategy string `json:"strategy,omitempty"` // 部署策略 ServiceName string `json:"service_name,omitempty"` // 关联的服务名称 Labels map[string]string `json:"labels,omitempty"` // K8s标签 Annotations map[string]string `json:"annotations,omitempty"` // K8s注解 LivenessProbe *Probe `json:"liveness_probe,omitempty"` // 存活探针 ReadinessProbe *Probe `json:"readiness_probe,omitempty"` // 就绪探针 StartupProbe *Probe `json:"startup_probe,omitempty"` // 启动探针 NodeSelector map[string]string `json:"node_selector,omitempty"` // 节点选择器 Affinity *Affinity `json:"affinity,omitempty"` // 亲和性配置 Tolerations []Toleration `json:"tolerations,omitempty"` // 容忍配置 Volumes []Volume `json:"volumes,omitempty"` // 卷配置,添加缺失的卷配置字段 }
type CreateK8sInstanceResp ¶
type CreateK8sInstanceResp struct { }
type CreateK8sProjectRequest ¶
type CreateK8sProjectRequest struct { Name string `json:"name" binding:"required,min=1,max=200"` // 项目名称 NameZh string `json:"name_zh" binding:"required,min=1,max=500"` // 项目中文名称 Cluster string `json:"cluster" binding:"required"` // 所属集群名称 TreeNodeID int `json:"tree_node_id,omitempty"` // 关联的树节点ID(可选) UserID int `json:"user_id" binding:"required"` // 创建者用户ID }
CreateK8sProjectRequest 创建 Kubernetes 项目的请求
type CreateK8sRoleRequest ¶
type CreateK8sRoleRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群ID Name string `json:"name" binding:"required"` // Role 名称 Namespace string `json:"namespace" binding:"required"` // 命名空间 Labels StringList `json:"labels,omitempty"` // 标签 Annotations StringList `json:"annotations,omitempty"` // 注解 Rules []PolicyRule `json:"rules" binding:"required"` // 策略规则 }
CreateK8sRoleRequest 创建 Kubernetes Role 请求
type CreateMCPConfigReq ¶
type CreateMCPConfigReq struct {
URL string `json:"url" binding:"required"` // MCP服务URL
}
CreateMCPConfigReq 创建MCP配置请求
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 CreateNamespaceRequest ¶
type CreateNamespaceRequest struct { ClusterId int `json:"cluster_id" binding:"required"` Name string `json:"namespace" binding:"required"` Labels []string `json:"labels,omitempty"` // 命名空间标签 Annotations []string `json:"annotations,omitempty"` // 命名空间注解 }
CreateNamespaceRequest 创建新的命名空间请求结构体
type CreateRoleBindingRequest ¶
type CreateRoleBindingRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群ID Name string `json:"name" binding:"required"` // RoleBinding 名称 Namespace string `json:"namespace" binding:"required"` // 命名空间 Labels StringList `json:"labels,omitempty"` // 标签 Annotations StringList `json:"annotations,omitempty"` // 注解 Subjects []Subject `json:"subjects" binding:"required"` // 绑定的主体 RoleRef RoleRef `json:"role_ref" binding:"required"` // 角色引用 }
CreateRoleBindingRequest 创建 RoleBinding 请求
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 CreateServiceAccountRequest ¶
type CreateServiceAccountRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群ID Name string `json:"name" binding:"required"` // ServiceAccount 名称 Namespace string `json:"namespace" binding:"required"` // 命名空间 Labels StringList `json:"labels,omitempty"` // 标签 Annotations StringList `json:"annotations,omitempty"` // 注解 Secrets []LocalObjectReference `json:"secrets,omitempty"` // 关联的 Secret ImagePullSecrets []LocalObjectReference `json:"image_pull_secrets,omitempty"` // 镜像拉取 Secret AutomountServiceAccountToken *bool `json:"automount_service_account_token,omitempty"` // 是否自动挂载服务账户令牌 }
CreateServiceAccountRequest 创建 ServiceAccount 请求
type CreateToolBlacklistReq ¶
type CreateToolBlacklistReq struct {
Tools []string `json:"tools" binding:"required"` // 黑名单工具列表
}
CreateToolBlacklistReq 创建工具黑名单请求
type CreateToolReq ¶
type CreateToolReq struct { Name string `json:"name" binding:"required"` // 工具名称 Description string `json:"description" binding:"required"` // 工具描述 Parameters ToolParameters `json:"parameters"` // 工具参数定义 Metadata map[string]interface{} `json:"metadata"` // 工具元数据 }
CreateToolReq 创建工具请求
type CreateToolWhitelistReq ¶
type CreateToolWhitelistReq struct {
Tools []string `json:"tools" binding:"required"` // 白名单工具列表
}
CreateToolWhitelistReq 创建工具白名单请求
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 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 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 DeleteClusterRoleBindingRequest ¶
type DeleteClusterRoleBindingRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群ID Name string `json:"name" binding:"required"` // ClusterRoleBinding 名称 }
DeleteClusterRoleBindingRequest 删除 ClusterRoleBinding 请求
type DeleteClusterRoleRequest ¶
type DeleteClusterRoleRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群ID Name string `json:"name" binding:"required"` // ClusterRole 名称 }
DeleteClusterRoleRequest 删除 ClusterRole 请求
type DeleteK8sRoleRequest ¶
type DeleteK8sRoleRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群ID Name string `json:"name" binding:"required"` // Role 名称 Namespace string `json:"namespace" binding:"required"` // 命名空间 }
DeleteK8sRoleRequest 删除 Kubernetes Role 请求
type DeleteMCPConfigReq ¶
type DeleteMCPConfigReq struct {
ID int `json:"id" form:"id" binding:"required"` // MCP配置ID
}
DeleteMCPConfigReq 删除MCP配置请求
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 DeleteRoleBindingRequest ¶
type DeleteRoleBindingRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群ID Name string `json:"name" binding:"required"` // RoleBinding 名称 Namespace string `json:"namespace" binding:"required"` // 命名空间 }
DeleteRoleBindingRequest 删除 RoleBinding 请求
type DeleteRoleRequest ¶
type DeleteRoleRequest struct {
ID int `json:"id" form:"id" binding:"required,gt=0"` // 角色ID
}
DeleteRoleRequest 删除角色请求结构体
type DeleteServiceAccountRequest ¶
type DeleteServiceAccountRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群ID Name string `json:"name" binding:"required"` // ServiceAccount 名称 Namespace string `json:"namespace" binding:"required"` // 命名空间 }
DeleteServiceAccountRequest 删除 ServiceAccount 请求
type DeleteToolBlacklistReq ¶
type DeleteToolBlacklistReq struct {
ID int `json:"id" form:"id" binding:"required"` // 黑名单ID
}
DeleteToolBlacklistReq 删除工具黑名单请求
type DeleteToolReq ¶
type DeleteToolReq struct {
Name string `json:"name" form:"name" binding:"required"` // 工具名称
}
DeleteToolReq 删除工具请求
type DeleteToolWhitelistReq ¶
type DeleteToolWhitelistReq struct {
ID int `json:"id" form:"id" binding:"required"` // 白名单ID
}
DeleteToolWhitelistReq 删除工具白名单请求
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" 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 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 DisconnectMCPReq ¶
type DisconnectMCPReq struct {
ID int `json:"id" binding:"required"` // MCP配置ID
}
DisconnectMCPReq 断开MCP服务请求
type EffectChange ¶
type EffectChange struct { TaintKey string `json:"taint_key"` // 污点键 OldEffect string `json:"old_effect"` // 旧效果 NewEffect string `json:"new_effect"` // 新效果 ChangeReason string `json:"change_reason"` // 变化原因 ChangeTime time.Time `json:"change_time"` // 变化时间 }
EffectChange 效果变化
type EffectTransition ¶
type EffectTransition struct { AllowTransition bool `json:"allow_transition"` // 允许转换 TransitionRules []TransitionRule `json:"transition_rules"` // 转换规则 TransitionDelay *int64 `json:"transition_delay"` // 转换延迟 }
EffectTransition 效果转换配置
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 Event ¶
type Event struct { Reason string `json:"reason"` // 事件原因 Message string `json:"message"` // 事件消息 Type string `json:"type"` // 事件类型,例如 Normal, Warning FirstTimestamp time.Time `json:"first_timestamp"` // 第一次发生时间 LastTimestamp time.Time `json:"last_timestamp"` // 最后一次发生时间 Count int32 `json:"count"` // 事件发生次数 Source core.EventSource `json:"source"` // 事件来源 }
Event 命名空间事件响应结构体
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 EvictionPolicy ¶
type EvictionPolicy struct { Strategy string `json:"strategy"` // 策略 (immediate, graceful, delayed) MaxEvictionRate string `json:"max_eviction_rate"` // 最大驱逐率 PodDisruptionBudget string `json:"pod_disruption_budget"` // Pod中断预算 RescheduleAttempts int `json:"reschedule_attempts"` // 重调度尝试次数 }
EvictionPolicy 驱逐策略
type EvictionSummary ¶
type EvictionSummary struct { TotalPods int `json:"total_pods"` // 总Pod数 EvictedPods int `json:"evicted_pods"` // 已驱逐Pod数 FailedEvictions int `json:"failed_evictions"` // 失败驱逐数 PendingEvictions int `json:"pending_evictions"` // 待驱逐数 RescheduledPods int `json:"rescheduled_pods"` // 重调度Pod数 AverageEvictionTime float64 `json:"average_eviction_time"` // 平均驱逐时间 }
EvictionSummary 驱逐摘要
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 GetInstanceCommentsTreeReq ¶
type GetInstanceCommentsTreeReq struct {
ID int `json:"id" form:"id" binding:"required,min=1"`
}
GetInstanceCommentsTreeReq 获取工单实例评论树请求
type GetK8sAppListRequest ¶
type GetK8sAppListRequest struct { ProjectID int64 `json:"project_id,omitempty"` // 项目ID过滤 ClusterName string `json:"cluster_name,omitempty"` // 集群名称过滤 Namespace string `json:"namespace,omitempty"` // 命名空间过滤 Name string `json:"name,omitempty"` // 名称过滤(模糊查询) Page int `json:"page,omitempty"` // 分页页码 PageSize int `json:"page_size,omitempty"` // 分页大小 }
GetK8sAppListRequest 获取 Kubernetes 应用列表的请求
type GetK8sCronjobListRequest ¶
type GetK8sCronjobListRequest struct { ProjectID int64 `json:"project_id,omitempty"` // 项目ID过滤 ClusterName string `json:"cluster_name,omitempty"` // 集群名称过滤 Namespace string `json:"namespace,omitempty"` // 命名空间过滤 Name string `json:"name,omitempty"` // 名称过滤(模糊查询) Page int `json:"page,omitempty"` // 分页页码 PageSize int `json:"page_size,omitempty"` // 分页大小 }
GetK8sCronjobListRequest 获取 CronJob 列表的请求
type GetK8sInstanceByAppReq ¶
type GetK8sInstanceByAppResp ¶
type GetK8sInstanceByAppResp struct { Total int `json:"total"` // 总记录数 Items []interface{} `json:"items"` // 实例运行状态列表 }
type GetK8sInstanceListReq ¶
type GetK8sInstanceListReq struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群ID Namespace string `json:"namespace,omitempty" form:"namespace"` // 命名空间过滤 AppID int `json:"app_id,omitempty" form:"app_id"` // 应用ID过滤 Name string `json:"name,omitempty" form:"name"` // 名称过滤(模糊查询) Page int `json:"page,omitempty" form:"page" binding:"min=1"` // 分页页码 PageSize int `json:"page_size,omitempty" form:"page_size" binding:"min=1,max=100"` // 分页大小 Type string `json:"type,omitempty" form:"type"` // 实例类型过滤(Deployment/StatefulSet/DaemonSet/Job/CronJob) }
type GetK8sInstanceListResp ¶
type GetK8sInstanceListResp struct { Total int `json:"total"` // 总记录数 Items []K8sInstance `json:"items"` // 实例列表 }
type GetK8sInstanceReq ¶
type GetK8sInstanceResp ¶
type GetK8sInstanceResp struct {
Item interface{} `json:"item"` // Kubernetes 实例信息
}
type GetK8sProjectListRequest ¶
type GetK8sProjectListRequest struct { ClusterName string `json:"cluster_name,omitempty"` // 集群名称过滤 Name string `json:"name,omitempty"` // 名称过滤(模糊查询) TreeNodeID int `json:"tree_node_id,omitempty"` // 树节点ID过滤 Page int `json:"page,omitempty"` // 分页页码 PageSize int `json:"page_size,omitempty"` // 分页大小 }
GetK8sProjectListRequest 获取 Kubernetes 项目列表的请求
type GetMCPConfigReq ¶
type GetMCPConfigReq struct {
ID int `json:"id" form:"id" binding:"required"` // MCP配置ID
}
GetMCPConfigReq 获取MCP配置请求
type GetMCPConfigsReq ¶
type GetMCPConfigsReq struct { ListReq URL string `json:"url" form:"url" binding:"omitempty"` // MCP服务URL筛选 }
GetMCPConfigsReq 获取MCP配置列表请求
type GetMCPStatusReq ¶
type GetMCPStatusReq struct {
ID int `json:"id" binding:"required"` // MCP配置ID
}
GetMCPStatusReq 获取MCP服务状态请求
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 GetMonitorScrapePoolDetailReq ¶
type GetMonitorScrapePoolDetailReq struct {
ID int `json:"id" form:"id" binding:"required"`
}
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 GetPermCodeReq ¶
type GetPermCodeReq struct {
ID int `json:"id" binding:"required"` // 用户ID
}
GetPermCodeReq 获取权限码请求
type GetRoleApiRequest ¶
type GetRoleApiRequest struct {
ID int `json:"id"` // 角色ID
}
type GetRoleRequest ¶
type GetRoleRequest struct {
ID int `json:"id"` // 角色ID
}
GetRoleRequest 获取角色请求结构体
type GetRoleUsersRequest ¶
type GetRoleUsersRequest struct {
ID int `json:"id"` // 角色ID
}
type GetToolBlacklistReq ¶
type GetToolBlacklistReq struct {
ID int `json:"id" form:"id" binding:"required"` // 黑名单ID
}
GetToolBlacklistReq 获取工具黑名单请求
type GetToolBlacklistsReq ¶
type GetToolBlacklistsReq struct {
ListReq
}
GetToolBlacklistsReq 获取工具黑名单列表请求
type GetToolReq ¶
type GetToolReq struct {
Name string `json:"name" form:"name" binding:"required"` // 工具名称
}
GetToolReq 获取单个工具请求
type GetToolWhitelistReq ¶
type GetToolWhitelistReq struct {
ID int `json:"id" form:"id" binding:"required"` // 白名单ID
}
GetToolWhitelistReq 获取工具白名单请求
type GetToolWhitelistsReq ¶
type GetToolWhitelistsReq struct {
ListReq
}
GetToolWhitelistsReq 获取工具白名单列表请求
type GetToolsReq ¶
type GetToolsReq struct { ListReq Name string `json:"name" form:"name" binding:"omitempty"` // 工具名称筛选 Description string `json:"description" form:"description" binding:"omitempty"` // 工具描述筛选 }
GetToolsReq 获取工具列表请求
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 `uri:"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 HistoryMessage ¶
type HistoryMessage struct { Role string `json:"role"` // user 或 assistant Content string `json:"content"` // 消息内容 }
HistoryMessage 聊天历史中的消息
type HourlyTrendItem ¶
HourlyTrendItem 小时趋势项
type ItemDef ¶
type ItemDef struct { Type string `json:"type,omitempty"` // 项类型 Enum []interface{} `json:"enum,omitempty"` // 枚举值 }
ItemDef 数组项定义
type JSONMap ¶
type JSONMap map[string]interface{}
JSONMap 自定义JSON类型,用于处理map[string]interface{}
type K8sAffinityVisualizationRequest ¶
type K8sAffinityVisualizationRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群ID,必填 Namespace string `json:"namespace"` // 命名空间,可选 ResourceType string `json:"resource_type"` // 资源类型,可选 ResourceName string `json:"resource_name"` // 资源名称,可选 VisualizationType string `json:"visualization_type"` // 可视化类型 (node_affinity, pod_affinity, taint_toleration) IncludeDetails bool `json:"include_details"` // 是否包含详细信息 }
K8sAffinityVisualizationRequest 亲和性可视化请求
type K8sAffinityVisualizationResponse ¶
type K8sAffinityVisualizationResponse struct { ClusterID int `json:"cluster_id"` // 集群ID Namespace string `json:"namespace"` // 命名空间 Visualization map[string]interface{} `json:"visualization"` // 可视化数据 GeneratedTime time.Time `json:"generated_time"` // 生成时间 }
K8sAffinityVisualizationResponse 亲和性可视化响应
type K8sApp ¶
type K8sApp struct { Model Name string `json:"name" binding:"required,min=1,max=200" gorm:"size:100;comment:应用名称"` // 应用名称 K8sProjectID int `json:"k8s_project_id" gorm:"comment:关联的 Kubernetes 项目ID"` // 关联的 Kubernetes 项目ID TreeNodeID int `json:"tree_node_id" gorm:"comment:关联的树节点ID"` // 关联的树节点ID UserID int `json:"user_id" gorm:"comment:创建者用户ID"` // 创建者用户ID Cluster string `json:"cluster" gorm:"size:100;comment:所属集群名称"` // 所属集群名称 K8sInstances []K8sInstance `json:"k8s_instances" gorm:"foreignKey:K8sAppID;comment:关联的 Kubernetes 实例"` // 关联的 Kubernetes 实例 ServiceType string `json:"service_type,omitempty" gorm:"comment:服务类型"` // 服务类型 Namespace string `json:"namespace,omitempty" gorm:"comment:Kubernetes 命名空间"` // Kubernetes 命名空间 ContainerCore `json:"containerCore"` // 容器核心配置 }
K8sApp 面向运维的 Kubernetes 应用
type K8sCluster ¶
type K8sCluster struct { Model Name string `json:"name" binding:"required,min=1,max=200" gorm:"size:100;comment:集群名称"` // 集群名称 NameZh string `json:"name_zh" binding:"required,min=1,max=500" gorm:"size:100;comment:集群中文名称"` // 集群中文名称 UserID int `json:"user_id" gorm:"comment:创建者用户ID"` // 创建者用户ID CpuRequest string `json:"cpu_request,omitempty" gorm:"comment:CPU 请求量"` // CPU 请求量 CpuLimit string `json:"cpu_limit,omitempty" gorm:"comment:CPU 限制量"` // CPU 限制量 MemoryRequest string `json:"memory_request,omitempty" gorm:"comment:内存请求量"` // 内存请求量 MemoryLimit string `json:"memory_limit,omitempty" gorm:"comment:内存限制量"` // 内存限制量 RestrictedNameSpace StringList `json:"restricted_name_space" gorm:"comment:资源限制命名空间"` // 资源限制命名空间 Status string `json:"status" gorm:"comment:集群状态"` // 集群状态 Env string `json:"env,omitempty" gorm:"comment:集群环境,例如 prod, stage, dev, rc, 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:操作超时时间(秒)"` // 操作超时时间(秒) }
K8sCluster Kubernetes 集群的配置
func (*K8sCluster) TableName ¶
func (k8sCluster *K8sCluster) TableName() string
type K8sClusterNodesRequest ¶
type K8sClusterNodesRequest struct { ClusterId int `json:"cluster_id" binding:"required"` // 集群id,必填 NodeName string `json:"node_name" binding:"required"` // 节点名称列表,必填 }
K8sClusterNodesRequest 定义集群节点请求的基础结构
type K8sClusterRole ¶
type K8sClusterRole struct { Name string `json:"name"` // ClusterRole 名称 UID string `json:"uid"` // 唯一标识符 Labels StringList `json:"labels,omitempty" gorm:"serializer:json;comment:标签"` // 标签 Annotations StringList `json:"annotations,omitempty" gorm:"serializer:json;comment:注解"` // 注解 Rules []PolicyRule `json:"rules" gorm:"serializer:json;comment:策略规则"` // 策略规则 CreatedAt time.Time `json:"created_at"` // 创建时间 }
K8sClusterRole Kubernetes ClusterRole 资源
type K8sClusterRoleBinding ¶
type K8sClusterRoleBinding struct { Name string `json:"name"` // ClusterRoleBinding 名称 UID string `json:"uid"` // 唯一标识符 Labels StringList `json:"labels,omitempty" gorm:"serializer:json;comment:标签"` // 标签 Annotations StringList `json:"annotations,omitempty" gorm:"serializer:json;comment:注解"` // 注解 Subjects []Subject `json:"subjects" gorm:"serializer:json;comment:绑定的主体"` // 绑定的主体 RoleRef RoleRef `json:"role_ref" gorm:"serializer:json;comment:角色引用"` // 角色引用 CreatedAt time.Time `json:"created_at"` // 创建时间 }
K8sClusterRoleBinding Kubernetes ClusterRoleBinding 资源
type K8sConfigMapHotReloadRequest ¶
type K8sConfigMapHotReloadRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群ID Namespace string `json:"namespace" binding:"required"` // 命名空间 ConfigMapName string `json:"configmap_name" binding:"required"` // ConfigMap 名称 ReloadType string `json:"reload_type"` // 重载类型 (pods, deployments, all) TargetSelector map[string]string `json:"target_selector"` // 目标选择器 }
K8sConfigMapHotReloadRequest ConfigMap 热更新请求
type K8sConfigMapRequest ¶
type K8sConfigMapRequest struct { ClusterId int `json:"cluster_id" binding:"required"` // 集群id,必填 Namespace string `json:"namespace"` // 命名空间,可选, 删除用 ConfigMapNames []string `json:"config_map_names"` // ConfigMap 名称,可选, 删除用 ConfigMap *core.ConfigMap `json:"config_map"` // ConfigMap 对象, 可选 }
K8sConfigMapRequest ConfigMap 相关请求结构
type K8sConfigMapRollbackRequest ¶
type K8sConfigMapRollbackRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群ID Namespace string `json:"namespace" binding:"required"` // 命名空间 ConfigMapName string `json:"configmap_name" binding:"required"` // ConfigMap 名称 TargetVersion string `json:"target_version" binding:"required"` // 目标版本 }
K8sConfigMapRollbackRequest ConfigMap 回滚请求
type K8sConfigMapVersion ¶
type K8sConfigMapVersion struct { Version string `json:"version"` // 版本号 Description string `json:"description"` // 版本描述 ConfigMap *core.ConfigMap `json:"config_map"` // ConfigMap 对象 CreationTimestamp time.Time `json:"creation_timestamp"` // 创建时间 Author string `json:"author"` // 创建者 }
K8sConfigMapVersion ConfigMap 版本信息
type K8sConfigMapVersionRequest ¶
type K8sConfigMapVersionRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群ID Namespace string `json:"namespace" binding:"required"` // 命名空间 ConfigMapName string `json:"configmap_name" binding:"required"` // ConfigMap 名称 Version string `json:"version"` // 版本号 Description string `json:"description"` // 版本描述 ConfigMap *core.ConfigMap `json:"config_map"` // ConfigMap 对象 }
K8sConfigMapVersionRequest ConfigMap 版本管理请求
type K8sContainerExecHistory ¶
type K8sContainerExecHistory struct { Model SessionId string `json:"session_id" gorm:"size:100;comment:会话ID"` // 会话ID ClusterId int `json:"cluster_id" gorm:"index;comment:集群ID"` // 集群ID Namespace string `json:"namespace" gorm:"size:100;comment:命名空间"` // 命名空间 PodName string `json:"pod_name" gorm:"size:200;comment:Pod名称"` // Pod名称 ContainerName string `json:"container_name" gorm:"size:200;comment:容器名称"` // 容器名称 Command string `json:"command" gorm:"type:text;comment:执行的命令"` // 执行的命令 UserId int `json:"user_id" gorm:"index;comment:执行用户ID"` // 执行用户ID UserName string `json:"user_name" gorm:"size:100;comment:执行用户名"` // 执行用户名 ExitCode int `json:"exit_code" gorm:"comment:退出码"` // 退出码 ExecutionTime float64 `json:"execution_time" gorm:"comment:执行时间(秒)"` // 执行时间(秒) Stdout string `json:"stdout" gorm:"type:text;comment:标准输出"` // 标准输出 Stderr string `json:"stderr" gorm:"type:text;comment:标准错误输出"` // 标准错误输出 Status string `json:"status" gorm:"size:50;comment:执行状态"` // 执行状态:success, failed, timeout ErrorMessage string `json:"error_message" gorm:"type:text;comment:错误信息"` // 错误信息 ExecutedAt string `json:"executed_at" gorm:"comment:执行时间"` // 执行时间 SessionType string `json:"session_type" gorm:"size:50;comment:会话类型"` // 会话类型:exec, terminal }
K8sContainerExecHistory 容器执行历史记录
type K8sContainerExecHistoryRequest ¶
type K8sContainerExecHistoryRequest struct { ClusterId int `json:"cluster_id"` // 集群ID Namespace string `json:"namespace"` // 命名空间 PodName string `json:"pod_name"` // Pod名称 ContainerName string `json:"container_name"` // 容器名称 UserId int `json:"user_id"` // 用户ID Status string `json:"status"` // 执行状态 StartTime string `json:"start_time"` // 开始时间 EndTime string `json:"end_time"` // 结束时间 Limit int `json:"limit"` // 限制数量 Offset int `json:"offset"` // 偏移量 }
K8sContainerExecHistoryRequest 获取执行历史请求
type K8sContainerExecHistoryResponse ¶
type K8sContainerExecHistoryResponse struct { History []K8sContainerExecHistory `json:"history"` // 历史记录列表 TotalCount int `json:"total_count"` // 总数 }
K8sContainerExecHistoryResponse 执行历史响应
type K8sContainerExecRequest ¶
type K8sContainerExecRequest struct { ClusterId int `json:"cluster_id" binding:"required"` // 集群ID Namespace string `json:"namespace" binding:"required"` // 命名空间 PodName string `json:"pod_name" binding:"required"` // Pod名称 ContainerName string `json:"container_name" binding:"required"` // 容器名称 Command []string `json:"command" binding:"required"` // 执行的命令 Timeout int `json:"timeout"` // 执行超时时间(秒) WorkingDir string `json:"working_dir"` // 工作目录 }
K8sContainerExecRequest 容器执行命令请求
type K8sContainerExecResponse ¶
type K8sContainerExecResponse struct { SessionId string `json:"session_id"` // 会话ID Stdout string `json:"stdout"` // 标准输出 Stderr string `json:"stderr"` // 标准错误输出 ExitCode int `json:"exit_code"` // 退出码 ExecutionTime float64 `json:"execution_time"` // 执行时间(秒) }
K8sContainerExecResponse 容器执行命令响应
type K8sContainerFile ¶
type K8sContainerFile struct { Name string `json:"name"` // 文件名 Path string `json:"path"` // 文件路径 Size int64 `json:"size"` // 文件大小 Type string `json:"type"` // 文件类型:file, directory Permissions string `json:"permissions"` // 文件权限 ModifiedTime string `json:"modified_time"` // 修改时间 }
K8sContainerFile 容器文件信息
type K8sContainerFileDeleteRequest ¶
type K8sContainerFileDeleteRequest struct { ClusterId int `json:"cluster_id" binding:"required"` // 集群ID Namespace string `json:"namespace" binding:"required"` // 命名空间 PodName string `json:"pod_name" binding:"required"` // Pod名称 ContainerName string `json:"container_name" binding:"required"` // 容器名称 Path string `json:"path" binding:"required"` // 文件路径 Recursive bool `json:"recursive"` // 是否递归删除 }
K8sContainerFileDeleteRequest 文件删除请求
type K8sContainerFileEditRequest ¶
type K8sContainerFileEditRequest struct { ClusterId int `json:"cluster_id" binding:"required"` // 集群ID Namespace string `json:"namespace" binding:"required"` // 命名空间 PodName string `json:"pod_name" binding:"required"` // Pod名称 ContainerName string `json:"container_name" binding:"required"` // 容器名称 Path string `json:"path" binding:"required"` // 文件路径 Content string `json:"content" binding:"required"` // 文件内容 Backup bool `json:"backup"` // 是否备份 }
K8sContainerFileEditRequest 文件编辑请求
type K8sContainerFileUploadRequest ¶
type K8sContainerFileUploadRequest struct { ClusterId int `json:"cluster_id" binding:"required"` // 集群ID Namespace string `json:"namespace" binding:"required"` // 命名空间 PodName string `json:"pod_name" binding:"required"` // Pod名称 ContainerName string `json:"container_name" binding:"required"` // 容器名称 Path string `json:"path" binding:"required"` // 目标路径 Overwrite bool `json:"overwrite"` // 是否覆盖 }
K8sContainerFileUploadRequest 文件上传请求
type K8sContainerFilesRequest ¶
type K8sContainerFilesRequest struct { ClusterId int `json:"cluster_id" binding:"required"` // 集群ID Namespace string `json:"namespace" binding:"required"` // 命名空间 PodName string `json:"pod_name" binding:"required"` // Pod名称 ContainerName string `json:"container_name" binding:"required"` // 容器名称 Path string `json:"path"` // 文件路径 Recursive bool `json:"recursive"` // 是否递归 }
K8sContainerFilesRequest 文件管理请求
type K8sContainerFilesResponse ¶
type K8sContainerFilesResponse struct {
Files []K8sContainerFile `json:"files"` // 文件列表
}
K8sContainerFilesResponse 文件列表响应
type K8sContainerLogEntry ¶
type K8sContainerLogEntry struct { Timestamp string `json:"timestamp"` // 时间戳 Level string `json:"level"` // 日志级别 Message string `json:"message"` // 日志消息 ContainerName string `json:"container_name"` // 容器名称 PodName string `json:"pod_name"` // Pod名称 Namespace string `json:"namespace"` // 命名空间 }
K8sContainerLogEntry 容器日志条目
type K8sContainerLogsExportRequest ¶
type K8sContainerLogsExportRequest struct { ClusterId int `json:"cluster_id" binding:"required"` // 集群ID Namespace string `json:"namespace" binding:"required"` // 命名空间 PodName string `json:"pod_name" binding:"required"` // Pod名称 ContainerName string `json:"container_name" binding:"required"` // 容器名称 Format string `json:"format"` // 导出格式:json, csv, txt StartTime string `json:"start_time"` // 开始时间 EndTime string `json:"end_time"` // 结束时间 Filters map[string]interface{} `json:"filters"` // 过滤条件 }
K8sContainerLogsExportRequest 日志导出请求
type K8sContainerLogsRequest ¶
type K8sContainerLogsRequest struct { ClusterId int `json:"cluster_id" binding:"required"` // 集群ID Namespace string `json:"namespace" binding:"required"` // 命名空间 PodName string `json:"pod_name" binding:"required"` // Pod名称 ContainerName string `json:"container_name" binding:"required"` // 容器名称 Tail int `json:"tail"` // 返回的日志行数 Since string `json:"since"` // 开始时间 Until string `json:"until"` // 结束时间 Level string `json:"level"` // 日志级别 Search string `json:"search"` // 搜索关键词 Follow bool `json:"follow"` // 是否跟踪 }
K8sContainerLogsRequest 容器日志请求
type K8sContainerLogsResponse ¶
type K8sContainerLogsResponse struct { Logs []K8sContainerLogEntry `json:"logs"` // 日志列表 Total int `json:"total"` // 总数 HasMore bool `json:"has_more"` // 是否有更多 }
K8sContainerLogsResponse 容器日志响应
type K8sContainerPort ¶
type K8sContainerPort struct { Name string `json:"name,omitempty" gorm:"size:100;comment:端口名称"` // 端口名称(可选) ContainerPort int `json:"container_port" binding:"required" gorm:"comment:容器端口号"` // 容器端口号 Protocol string `json:"protocol,omitempty" gorm:"size:10;comment:协议类型"` // 协议类型,例如 "TCP", "UDP" }
K8sContainerPort 容器的端口配置
type K8sContainerSession ¶
type K8sContainerSession struct { Model SessionId string `json:"session_id" gorm:"size:100;unique;comment:会话ID"` // 会话ID ClusterId int `json:"cluster_id" gorm:"index;comment:集群ID"` // 集群ID Namespace string `json:"namespace" gorm:"size:100;comment:命名空间"` // 命名空间 PodName string `json:"pod_name" gorm:"size:200;comment:Pod名称"` // Pod名称 ContainerName string `json:"container_name" gorm:"size:200;comment:容器名称"` // 容器名称 UserId int `json:"user_id" gorm:"index;comment:用户ID"` // 用户ID UserName string `json:"user_name" gorm:"size:100;comment:用户名"` // 用户名 SessionType string `json:"session_type" gorm:"size:50;comment:会话类型"` // 会话类型:exec, terminal Status string `json:"status" gorm:"size:50;comment:会话状态"` // 会话状态:active, closed, expired StartTime string `json:"start_time" gorm:"comment:开始时间"` // 开始时间 EndTime string `json:"end_time" gorm:"comment:结束时间"` // 结束时间 LastActivity string `json:"last_activity" gorm:"comment:最后活动时间"` // 最后活动时间 TTY bool `json:"tty" gorm:"comment:是否为TTY"` // 是否为TTY WorkingDir string `json:"working_dir" gorm:"size:500;comment:工作目录"` // 工作目录 }
K8sContainerSession 容器会话管理
type K8sContainerTerminalRequest ¶
type K8sContainerTerminalRequest struct { ClusterId int `json:"cluster_id" binding:"required"` // 集群ID Namespace string `json:"namespace" binding:"required"` // 命名空间 PodName string `json:"pod_name" binding:"required"` // Pod名称 ContainerName string `json:"container_name" binding:"required"` // 容器名称 TTY bool `json:"tty"` // 是否分配TTY Stdin bool `json:"stdin"` // 是否支持标准输入 WorkingDir string `json:"working_dir"` // 工作目录 }
K8sContainerTerminalRequest 终端会话请求
type K8sContainerTerminalResponse ¶
type K8sContainerTerminalResponse struct { SessionId string `json:"session_id"` // 会话ID WebSocketURL string `json:"websocket_url"` // WebSocket连接URL }
K8sContainerTerminalResponse 终端会话响应
type K8sCronjob ¶
type K8sCronjob struct { Model Name string `json:"name" binding:"required,min=1,max=200" gorm:"size:100;comment:定时任务名称"` // 定时任务名称 Cluster string `json:"cluster,omitempty" gorm:"size:100;comment:所属集群"` // 所属集群 TreeNodeID int `json:"tree_node_id" gorm:"comment:关联的树节点ID"` // 关联的树节点ID UserID int `json:"user_id" gorm:"comment:创建者用户ID"` // 创建者用户ID K8sProjectID int `json:"k8s_project_id" gorm:"comment:关联的 Kubernetes 项目ID"` // 关联的 Kubernetes 项目ID Namespace string `json:"namespace,omitempty" gorm:"comment:命名空间"` // 命名空间 Schedule string `json:"schedule,omitempty" gorm:"comment:调度表达式"` // 调度表达式 Image string `json:"image,omitempty" gorm:"comment:镜像"` // 镜像 Commands StringList `json:"commands,omitempty" gorm:"comment:启动命令组"` // 启动命令组 Args StringList `json:"args,omitempty" gorm:"comment:启动参数,空格分隔"` // 启动参数 }
K8sCronjob Kubernetes 定时任务的配置
func (*K8sCronjob) TableName ¶
func (k *K8sCronjob) TableName() string
type K8sCronjobPodResponse ¶
type K8sCronjobPodResponse struct { Pod *K8sPod `json:"pod"` // Pod 信息 LogData string `json:"log_data"` // 日志数据 }
K8sCronjobPodResponse CronJob Pod 响应
type K8sCronjobRequest ¶
type K8sCronjobRequest struct { ClusterId int `json:"cluster_id" binding:"required"` // 集群id,必填 Namespace string `json:"namespace" binding:"required"` // 命名空间,必填 CronjobNames []string `json:"cronjob_names,omitempty"` // CronJob 名称,可选 CronjobYaml *batchv1.CronJob `json:"cronjob_yaml,omitempty"` // CronJob 对象, 可选 }
K8sCronjobRequest CronJob 相关请求结构
type K8sDaemonSetRequest ¶
type K8sDaemonSetRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群名称,必填 Namespace string `json:"namespace" binding:"required"` // 命名空间,必填 DaemonSetNames []string `json:"daemonset_names"` // DaemonSet 名称,可选 DaemonSetYaml *appsv1.DaemonSet `json:"daemonset_yaml"` // DaemonSet 对象, 可选 }
K8sDaemonSetRequest DaemonSet 相关请求结构
type K8sDaemonSetStatus ¶
type K8sDaemonSetStatus struct { Name string `json:"name"` // DaemonSet 名称 Namespace string `json:"namespace"` // 命名空间 DesiredNumberScheduled int32 `json:"desired_number_scheduled"` // 期望调度的节点数 CurrentNumberScheduled int32 `json:"current_number_scheduled"` // 当前调度的节点数 NumberReady int32 `json:"number_ready"` // 就绪的Pod数 UpdatedNumberScheduled int32 `json:"updated_number_scheduled"` // 已更新的调度数 NumberAvailable int32 `json:"number_available"` // 可用的Pod数 NumberMisscheduled int32 `json:"number_misscheduled"` // 错误调度的Pod数 ObservedGeneration int64 `json:"observed_generation"` // 观察到的代数 CreationTimestamp time.Time `json:"creation_timestamp"` // 创建时间 }
K8sDaemonSetStatus DaemonSet 状态响应
type K8sDeploymentRequest ¶
type K8sDeploymentRequest struct { ClusterId int `json:"cluster_id" binding:"required"` // 集群名称,必填 Namespace string `json:"namespace" binding:"required"` // 命名空间,必填 DeploymentNames []string `json:"deployment_names"` // Deployment 名称,可选 DeploymentYaml *appsv1.Deployment `json:"deployment_yaml"` // Deployment 对象, 可选 }
K8sDeploymentRequest Deployment 相关请求结构
type K8sEndpointRequest ¶
type K8sEndpointRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群名称,必填 Namespace string `json:"namespace" binding:"required"` // 命名空间,必填 EndpointNames []string `json:"endpoint_names"` // Endpoint 名称,可选 EndpointYaml *core.Endpoints `json:"endpoint_yaml"` // Endpoint 对象, 可选 }
K8sEndpointRequest Endpoint 相关请求结构
type K8sEndpointStatus ¶
type K8sEndpointStatus struct { Name string `json:"name"` // Endpoint 名称 Namespace string `json:"namespace"` // 命名空间 Subsets []core.EndpointSubset `json:"subsets"` // 端点子集 Addresses []string `json:"addresses"` // 端点地址列表 Ports []core.EndpointPort `json:"ports"` // 端点端口列表 ServiceName string `json:"service_name"` // 关联的服务名称 HealthyEndpoints int `json:"healthy_endpoints"` // 健康端点数量 UnhealthyEndpoints int `json:"unhealthy_endpoints"` // 不健康端点数量 CreationTimestamp time.Time `json:"creation_timestamp"` // 创建时间 }
K8sEndpointStatus Endpoint 状态响应
type K8sEnvVar ¶
type K8sEnvVar struct { Name string `json:"name" binding:"required" gorm:"size:100;comment:环境变量名称"` // 环境变量名称 Value string `json:"value" gorm:"size:500;comment:环境变量值"` // 环境变量值 }
K8sEnvVar 环境变量的键值对
type K8sHTTPGetAction ¶
type K8sHTTPGetAction struct { Path string `json:"path" binding:"required" gorm:"size:255;comment:探测路径"` // 探测路径,必填,长度限制为255字符 Port int `json:"port" binding:"required" gorm:"comment:探测端口号"` // 探测端口号,必填 Scheme string `json:"scheme,omitempty" gorm:"size:10;comment:协议类型"` // 协议类型,例如 "HTTP", "HTTPS",长度限制为10字符 }
K8sHTTPGetAction HTTP GET 探测动作
type K8sIngressRequest ¶
type K8sIngressRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群名称,必填 Namespace string `json:"namespace" binding:"required"` // 命名空间,必填 IngressNames []string `json:"ingress_names"` // Ingress 名称,可选 IngressYaml *networkingv1.Ingress `json:"ingress_yaml"` // Ingress 对象, 可选 }
K8sIngressRequest Ingress 相关请求结构
type K8sIngressStatus ¶
type K8sIngressStatus struct { Name string `json:"name"` // Ingress 名称 Namespace string `json:"namespace"` // 命名空间 IngressClass *string `json:"ingress_class"` // Ingress 类 Rules []networkingv1.IngressRule `json:"rules"` // Ingress 规则 TLS []networkingv1.IngressTLS `json:"tls"` // TLS 配置 Hosts []string `json:"hosts"` // 主机列表 Paths []string `json:"paths"` // 路径列表 LoadBalancer networkingv1.IngressLoadBalancerStatus `json:"load_balancer"` // 负载均衡器状态 CreationTimestamp time.Time `json:"creation_timestamp"` // 创建时间 }
K8sIngressStatus Ingress 状态响应
type K8sInstance ¶
type K8sInstance struct { Model Name string `json:"name" binding:"required,min=1,max=200" gorm:"size:100;comment:实例名称"` // 实例名称 UserID int `json:"user_id" gorm:"comment:创建者用户ID"` // 创建者用户ID ClusterID int `json:"cluster_id" gorm:"comment:所属集群ID"` // 所属集群ID ContainerCore `json:"containerCore" gorm:"embedded"` // 容器配置 Image string `json:"image,omitempty" gorm:"comment:镜像"` // 镜像 Replicas int `json:"replicas,omitempty" gorm:"default:1;comment:副本数量"` // 副本数量 K8sAppID int `json:"k8s_app_id" gorm:"index;comment:关联的 Kubernetes 应用ID"` // 关联的 Kubernetes 应用ID,修正字段名称为k8s_app_id Namespace string `json:"namespace,omitempty" gorm:"index;comment:Kubernetes 命名空间"` // 命名空间 Type string `json:"type,omitempty" gorm:"default:Deployment;comment:实例类型"` // 实例类型(Deployment/StatefulSet/DaemonSet) Status string `json:"status,omitempty" gorm:"-"` // 运行状态(运行时查询,不存储) AvailableReplicas int `json:"available_replicas,omitempty" gorm:"-"` // 可用副本数(运行时查询) Strategy string `json:"strategy,omitempty" gorm:"default:RollingUpdate;comment:部署策略"` // 部署策略(RollingUpdate/Recreate) ServiceName string `json:"service_name,omitempty" gorm:"comment:关联服务名称"` // 关联的服务名称 Labels map[string]string `json:"labels,omitempty" gorm:"serializer:json;comment:标签"` // K8s标签 Annotations map[string]string `json:"annotations,omitempty" gorm:"serializer:json;comment:注解"` // K8s注解 // 健康检查 LivenessProbe *Probe `json:"liveness_probe,omitempty" gorm:"serializer:json;comment:存活探针"` // 存活探针 ReadinessProbe *Probe `json:"readiness_probe,omitempty" gorm:"serializer:json;comment:就绪探针"` // 就绪探针 StartupProbe *Probe `json:"startup_probe,omitempty" gorm:"serializer:json;comment:启动探针"` // 启动探针 // 高级配置 NodeSelector map[string]string `json:"node_selector,omitempty" gorm:"serializer:json;comment:节点选择器"` // 节点选择器 Affinity *Affinity `json:"affinity,omitempty" gorm:"serializer:json;comment:亲和性配置"` // 亲和性配置 Tolerations []Toleration `json:"tolerations,omitempty" gorm:"serializer:json;comment:容忍配置"` // 容忍配置 // 关联信息 CreatedByUser string `json:"created_by_user,omitempty" gorm:"-"` // 创建者用户名(关联查询) ClusterName string `json:"cluster_name,omitempty" gorm:"-"` // 集群名称(关联查询) AppName string `json:"app_name,omitempty" gorm:"-"` // 应用名称(关联查询) }
func (K8sInstance) TableName ¶
func (i K8sInstance) TableName() string
type K8sJobHistory ¶
type K8sJobHistory struct { Name string `json:"name"` // Job 名称 Namespace string `json:"namespace"` // 命名空间 Status string `json:"status"` // 状态 (Pending, Running, Succeeded, Failed) Active int32 `json:"active"` // 活跃的Pod数 Succeeded int32 `json:"succeeded"` // 成功的Pod数 Failed int32 `json:"failed"` // 失败的Pod数 StartTime *time.Time `json:"start_time"` // 开始时间 CompletionTime *time.Time `json:"completion_time"` // 完成时间 Duration string `json:"duration"` // 执行时长 CreationTimestamp time.Time `json:"creation_timestamp"` // 创建时间 }
K8sJobHistory Job 执行历史
type K8sJobRequest ¶
type K8sJobRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群名称,必填 Namespace string `json:"namespace" binding:"required"` // 命名空间,必填 JobNames []string `json:"job_names"` // Job 名称,可选 JobYaml *batchv1.Job `json:"job_yaml"` // Job 对象, 可选 }
K8sJobRequest Job 相关请求结构
type K8sJobStatus ¶
type K8sJobStatus struct { Name string `json:"name"` // Job 名称 Namespace string `json:"namespace"` // 命名空间 Phase string `json:"phase"` // Job 阶段 (Pending, Running, Succeeded, Failed) Active int32 `json:"active"` // 活跃的Pod数 Succeeded int32 `json:"succeeded"` // 成功的Pod数 Failed int32 `json:"failed"` // 失败的Pod数 Completions *int32 `json:"completions"` // 期望完成数 Parallelism *int32 `json:"parallelism"` // 并行度 BackoffLimit *int32 `json:"backoff_limit"` // 重试限制 ActiveDeadlineSeconds *int64 `json:"active_deadline_seconds"` // 活跃截止时间(秒) StartTime *time.Time `json:"start_time"` // 开始时间 CompletionTime *time.Time `json:"completion_time"` // 完成时间 CreationTimestamp time.Time `json:"creation_timestamp"` // 创建时间 }
K8sJobStatus Job 状态响应
type K8sLabelBatchRequest ¶
type K8sLabelBatchRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群ID,必填 Namespace string `json:"namespace"` // 命名空间,可选 ResourceType string `json:"resource_type" binding:"required"` // 资源类型,必填 ResourceNames []string `json:"resource_names"` // 资源名称列表 Operation string `json:"operation" binding:"required"` // 操作类型 (add, update, delete) Labels map[string]string `json:"labels"` // 标签键值对 LabelSelector map[string]string `json:"label_selector"` // 标签选择器(用于批量选择) }
K8sLabelBatchRequest 批量标签操作请求
type K8sLabelComplianceRequest ¶
type K8sLabelComplianceRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群ID,必填 Namespace string `json:"namespace"` // 命名空间,可选 ResourceType string `json:"resource_type"` // 资源类型,可选 PolicyName string `json:"policy_name"` // 策略名称,可选 CheckAll bool `json:"check_all"` // 是否检查所有资源 }
K8sLabelComplianceRequest 标签合规性检查请求
type K8sLabelComplianceResponse ¶
type K8sLabelComplianceResponse struct { ResourceType string `json:"resource_type"` // 资源类型 ResourceName string `json:"resource_name"` // 资源名称 Namespace string `json:"namespace"` // 命名空间 PolicyName string `json:"policy_name"` // 策略名称 Compliant bool `json:"compliant"` // 是否合规 ViolationReason string `json:"violation_reason"` // 违规原因 MissingLabels []string `json:"missing_labels"` // 缺失的标签 ExtraLabels []string `json:"extra_labels"` // 多余的标签 CheckTime time.Time `json:"check_time"` // 检查时间 }
K8sLabelComplianceResponse 标签合规性检查响应
type K8sLabelHistoryRequest ¶
type K8sLabelHistoryRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群ID,必填 Namespace string `json:"namespace"` // 命名空间,可选 ResourceType string `json:"resource_type"` // 资源类型,可选 ResourceName string `json:"resource_name"` // 资源名称,可选 StartTime *time.Time `json:"start_time"` // 开始时间 EndTime *time.Time `json:"end_time"` // 结束时间 Limit int `json:"limit"` // 限制数量 }
K8sLabelHistoryRequest 标签历史记录请求
type K8sLabelHistoryResponse ¶
type K8sLabelHistoryResponse struct { ID int `json:"id"` // 记录ID ClusterID int `json:"cluster_id"` // 集群ID Namespace string `json:"namespace"` // 命名空间 ResourceType string `json:"resource_type"` // 资源类型 ResourceName string `json:"resource_name"` // 资源名称 Operation string `json:"operation"` // 操作类型 OldLabels map[string]string `json:"old_labels"` // 原标签 NewLabels map[string]string `json:"new_labels"` // 新标签 ChangedBy string `json:"changed_by"` // 修改者 ChangeTime time.Time `json:"change_time"` // 修改时间 ChangeReason string `json:"change_reason"` // 修改原因 }
K8sLabelHistoryResponse 标签历史记录响应
type K8sLabelPolicyRequest ¶
type K8sLabelPolicyRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群ID,必填 Namespace string `json:"namespace"` // 命名空间,可选 PolicyName string `json:"policy_name" binding:"required"` // 策略名称,必填 PolicyType string `json:"policy_type"` // 策略类型 (required, forbidden, preferred) ResourceType string `json:"resource_type"` // 资源类型 LabelRules []K8sLabelRule `json:"label_rules"` // 标签规则 Enabled bool `json:"enabled"` // 是否启用 Description string `json:"description"` // 策略描述 }
K8sLabelPolicyRequest 标签策略请求
type K8sLabelRequest ¶
type K8sLabelRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群ID,必填 Namespace string `json:"namespace"` // 命名空间,可选 ResourceType string `json:"resource_type" binding:"required"` // 资源类型,必填 ResourceName string `json:"resource_name"` // 资源名称,可选 Labels map[string]string `json:"labels"` // 标签键值对 Annotations map[string]string `json:"annotations"` // 注解键值对 LabelSelector map[string]string `json:"label_selector"` // 标签选择器 Operation string `json:"operation"` // 操作类型 (add, update, delete) ResourceNames []string `json:"resource_names"` // 批量操作的资源名称列表 }
K8sLabelRequest 标签管理相关请求结构
type K8sLabelResponse ¶
type K8sLabelResponse struct { ResourceType string `json:"resource_type"` // 资源类型 ResourceName string `json:"resource_name"` // 资源名称 Namespace string `json:"namespace"` // 命名空间 Labels map[string]string `json:"labels"` // 标签键值对 Annotations map[string]string `json:"annotations"` // 注解键值对 CreationTimestamp time.Time `json:"creation_timestamp"` // 创建时间 }
K8sLabelResponse 标签管理响应结构
type K8sLabelRule ¶
type K8sLabelRule struct { Key string `json:"key"` // 标签键 Values []string `json:"values"` // 标签值列表 Operator string `json:"operator"` // 操作符 (In, NotIn, Exists, DoesNotExist) Required bool `json:"required"` // 是否必需 Description string `json:"description"` // 规则描述 }
K8sLabelRule 标签规则
type K8sLabelSelector ¶
type K8sLabelSelector struct { MatchLabels map[string]string `json:"match_labels"` // 匹配标签 MatchExpressions []K8sLabelSelectorRequirement `json:"match_expressions"` // 匹配表达式 }
K8sLabelSelector 标签选择器
type K8sLabelSelectorRequest ¶
type K8sLabelSelectorRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群ID,必填 Namespace string `json:"namespace"` // 命名空间,可选 ResourceType string `json:"resource_type" binding:"required"` // 资源类型,必填 LabelSelector map[string]string `json:"label_selector"` // 标签选择器 FieldSelector string `json:"field_selector"` // 字段选择器 Limit int `json:"limit"` // 限制数量 }
K8sLabelSelectorRequest 标签选择器查询请求
type K8sLabelSelectorRequirement ¶
type K8sLabelSelectorRequirement struct { Key string `json:"key"` // 键 Operator string `json:"operator"` // 操作符 (In, NotIn, Exists, DoesNotExist) Values []string `json:"values"` // 值列表 }
K8sLabelSelectorRequirement 标签选择器要求
type K8sLimitRangeRequest ¶
type K8sLimitRangeRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群ID,必填 Namespace string `json:"namespace" binding:"required"` // 命名空间,必填 LimitRangeNames []string `json:"limit_range_names"` // LimitRange 名称列表,批量删除用 LimitRangeYaml *core.LimitRange `json:"limit_range_yaml"` // LimitRange 对象,可选 }
K8sLimitRangeRequest LimitRange 相关请求结构
type K8sLimitRangeStatus ¶
type K8sLimitRangeStatus struct { Name string `json:"name"` // LimitRange 名称 Namespace string `json:"namespace"` // 命名空间 Limits []core.LimitRangeItem `json:"limits"` // 限制项列表 CreationTimestamp time.Time `json:"creation_timestamp"` // 创建时间 }
K8sLimitRangeStatus LimitRange 状态响应
type K8sNetworkPolicyRequest ¶
type K8sNetworkPolicyRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群名称,必填 Namespace string `json:"namespace" binding:"required"` // 命名空间,必填 NetworkPolicyNames []string `json:"network_policy_names"` // NetworkPolicy 名称,可选 NetworkPolicyYaml *networkingv1.NetworkPolicy `json:"network_policy_yaml"` // NetworkPolicy 对象, 可选 }
K8sNetworkPolicyRequest NetworkPolicy 相关请求结构
type K8sNetworkPolicyStatus ¶
type K8sNetworkPolicyStatus struct { Name string `json:"name"` // NetworkPolicy 名称 Namespace string `json:"namespace"` // 命名空间 PodSelector *metav1.LabelSelector `json:"pod_selector"` // Pod 选择器 PolicyTypes []networkingv1.PolicyType `json:"policy_types"` // 策略类型 (Ingress/Egress) Ingress []networkingv1.NetworkPolicyIngressRule `json:"ingress"` // 入站规则 Egress []networkingv1.NetworkPolicyEgressRule `json:"egress"` // 出站规则 CreationTimestamp time.Time `json:"creation_timestamp"` // 创建时间 }
K8sNetworkPolicyStatus NetworkPolicy 状态响应
type K8sNode ¶
type K8sNode struct { Name string `json:"name" binding:"required,min=1,max=200" gorm:"size:100;comment:节点名称"` // 节点名称 ClusterID int `json:"cluster_id" gorm:"index;not null;comment:所属集群ID"` // 所属集群ID Status string `json:"status" gorm:"comment:节点状态,例如 Ready, NotReady, SchedulingDisabled"` // 节点状态 ScheduleEnable bool `json:"schedule_enable" gorm:"comment:节点是否可调度"` // 节点是否可调度 Roles []string `json:"roles" gorm:"type:text;serializer:json;comment:节点角色,例如 master, worker"` // 节点角色 Age string `json:"age" gorm:"comment:节点存在时间,例如 5d"` // 节点存在时间 IP string `json:"ip" gorm:"comment:节点内部IP"` // 节点内部IP PodNum int `json:"pod_num" gorm:"comment:节点上的 Pod 数量"` // 节点上的 Pod 数量 CpuRequestInfo string `json:"cpu_request_info" gorm:"comment:CPU 请求信息,例如 500m/2"` // CPU 请求信息 CpuLimitInfo string `json:"cpu_limit_info" gorm:"comment:CPU 限制信息,例如 1/2"` // CPU 限制信息 CpuUsageInfo string `json:"cpu_usage_info" gorm:"comment:CPU 使用信息,例如 300m/2 (15%)"` // CPU 使用信息 MemoryRequestInfo string `json:"memory_request_info" gorm:"comment:内存请求信息,例如 1Gi/8Gi"` // 内存请求信息 MemoryLimitInfo string `json:"memory_limit_info" gorm:"comment:内存限制信息,例如 2Gi/8Gi"` // 内存限制信息 MemoryUsageInfo string `json:"memory_usage_info" gorm:"comment:内存使用信息,例如 1.5Gi/8Gi (18.75%)"` // 内存使用信息 PodNumInfo string `json:"pod_num_info" gorm:"comment:Pod 数量信息,例如 10/50 (20%)"` // Pod 数量信息 CpuCores string `json:"cpu_cores" gorm:"comment:CPU 核心信息,例如 2/4"` // CPU 核心信息 MemGibs string `json:"mem_gibs" gorm:"comment:内存信息,例如 8Gi/16Gi"` // 内存信息 EphemeralStorage string `json:"ephemeral_storage" gorm:"comment:临时存储信息,例如 100Gi/200Gi"` // 临时存储信息 KubeletVersion string `json:"kubelet_version" gorm:"comment:Kubelet 版本"` // Kubelet 版本 CriVersion string `json:"cri_version" gorm:"comment:容器运行时接口版本"` // 容器运行时接口版本 OsVersion string `json:"os_version" gorm:"comment:操作系统版本"` // 操作系统版本 KernelVersion string `json:"kernel_version" gorm:"comment:内核版本"` // 内核版本 Labels []string `json:"labels" gorm:"type:text;serializer:json;comment:节点标签列表"` // 节点标签列表 LabelsFront string `json:"labels_front" gorm:"-"` // 前端显示的标签字符串,格式为多行 key=value TaintsFront string `json:"taints_front" gorm:"-"` // 前端显示的 Taints 字符串,格式为多行 key=value:Effect LabelPairs map[string]string `json:"label_pairs" gorm:"-"` // 标签键值对映射 Annotation map[string]string `json:"annotation" gorm:"type:text;serializer:json;comment:注解键值对映射"` // 注解键值对映射 Conditions []core.NodeCondition `json:"conditions" gorm:"-"` // 节点条件列表 Taints []core.Taint `json:"taints" gorm:"-"` // 节点 Taints 列表 Events []OneEvent `json:"events" gorm:"-"` // 节点相关事件列表,包含最近的事件信息 CreatedAt time.Time `json:"created_at" gorm:"comment:创建时间"` // 创建时间 UpdatedAt time.Time `json:"updated_at" gorm:"comment:更新时间"` // 更新时间 }
K8sNode Kubernetes 节点
type K8sNodeAffinityRequest ¶
type K8sNodeAffinityRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群ID,必填 Namespace string `json:"namespace" binding:"required"` // 命名空间,必填 ResourceType string `json:"resource_type" binding:"required"` // 资源类型,必填 ResourceName string `json:"resource_name" binding:"required"` // 资源名称,必填 RequiredAffinity []K8sNodeSelectorTerm `json:"required_affinity"` // 硬亲和性规则 PreferredAffinity []K8sPreferredSchedulingTerm `json:"preferred_affinity"` // 软亲和性规则 NodeSelector map[string]string `json:"node_selector"` // 节点选择器 Operation string `json:"operation"` // 操作类型 (add, update, delete) }
K8sNodeAffinityRequest 节点亲和性请求
type K8sNodeAffinityResponse ¶
type K8sNodeAffinityResponse struct { ResourceType string `json:"resource_type"` // 资源类型 ResourceName string `json:"resource_name"` // 资源名称 Namespace string `json:"namespace"` // 命名空间 RequiredAffinity []K8sNodeSelectorTerm `json:"required_affinity"` // 硬亲和性规则 PreferredAffinity []K8sPreferredSchedulingTerm `json:"preferred_affinity"` // 软亲和性规则 NodeSelector map[string]string `json:"node_selector"` // 节点选择器 CreationTimestamp time.Time `json:"creation_timestamp"` // 创建时间 }
K8sNodeAffinityResponse 节点亲和性响应
type K8sNodeAffinityValidationRequest ¶
type K8sNodeAffinityValidationRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群ID,必填 Namespace string `json:"namespace"` // 命名空间,可选 RequiredAffinity []K8sNodeSelectorTerm `json:"required_affinity"` // 硬亲和性规则 PreferredAffinity []K8sPreferredSchedulingTerm `json:"preferred_affinity"` // 软亲和性规则 NodeSelector map[string]string `json:"node_selector"` // 节点选择器 SimulateScheduling bool `json:"simulate_scheduling"` // 是否模拟调度 }
K8sNodeAffinityValidationRequest 节点亲和性验证请求
type K8sNodeAffinityValidationResponse ¶
type K8sNodeAffinityValidationResponse struct { Valid bool `json:"valid"` // 是否有效 MatchingNodes []string `json:"matching_nodes"` // 匹配的节点列表 ValidationErrors []string `json:"validation_errors"` // 验证错误 Suggestions []string `json:"suggestions"` // 建议 SchedulingResult string `json:"scheduling_result"` // 调度结果 ValidationTime time.Time `json:"validation_time"` // 验证时间 }
K8sNodeAffinityValidationResponse 节点亲和性验证响应
type K8sNodeRelationship ¶
type K8sNodeRelationship struct { SourceNode string `json:"source_node"` // 源节点 TargetNode string `json:"target_node"` // 目标节点 RelationshipType string `json:"relationship_type"` // 关系类型 Labels map[string]string `json:"labels"` // 标签 Taints []K8sTaint `json:"taints"` // 污点 Strength float64 `json:"strength"` // 关系强度 }
K8sNodeRelationship 节点关系
type K8sNodeSelectorRequirement ¶
type K8sNodeSelectorRequirement struct { Key string `json:"key"` // 键 Operator string `json:"operator"` // 操作符 (In, NotIn, Exists, DoesNotExist, Gt, Lt) Values []string `json:"values"` // 值列表 }
K8sNodeSelectorRequirement 节点选择器要求
type K8sNodeSelectorTerm ¶
type K8sNodeSelectorTerm struct { MatchExpressions []K8sNodeSelectorRequirement `json:"match_expressions"` // 匹配表达式 MatchFields []K8sNodeSelectorRequirement `json:"match_fields"` // 匹配字段 }
K8sNodeSelectorTerm 节点选择器条件
type K8sNodeTaintRequest ¶
type K8sNodeTaintRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群ID,必填 NodeName string `json:"node_name" binding:"required"` // 节点名称,必填 Taints []K8sTaint `json:"taints"` // 污点列表 Operation string `json:"operation"` // 操作类型 (add, update, delete) }
K8sNodeTaintRequest 节点污点管理请求
type K8sNodeTaintResponse ¶
type K8sNodeTaintResponse struct { NodeName string `json:"node_name"` // 节点名称 Taints []K8sTaint `json:"taints"` // 污点列表 AffectedPods []string `json:"affected_pods"` // 受影响的 Pod 列表 Operation string `json:"operation"` // 操作类型 OperationTime time.Time `json:"operation_time"` // 操作时间 }
K8sNodeTaintResponse 节点污点管理响应
type K8sOneVolume ¶
type K8sOneVolume struct { Type string `json:"type" gorm:"comment:卷类型,如 hostPath, configMap, emptyDir, pvc"` // 卷类型 Name string `json:"name" gorm:"size:100;comment:卷名称"` // 卷名称 MountPath string `json:"mount_path" gorm:"size:255;comment:挂载路径"` // 挂载路径 SubPath string `json:"sub_path,omitempty" gorm:"size:255;comment:子路径"` // 子路径(可选) PvcName string `json:"pvc_name,omitempty" gorm:"size:100;comment:PVC名称,当类型为 pvc 时使用"` // PVC名称(可选) CmName string `json:"cm_name,omitempty" gorm:"size:100;comment:ConfigMap名称,当类型为 configMap 时使用"` // ConfigMap名称(可选) HostPath string `json:"host_path,omitempty" gorm:"size:255;comment:Host路径,当类型为 hostPath 时使用"` // Host路径(可选) HostPathType string `json:"host_path_type,omitempty" gorm:"size:50;comment:Host路径类型,当类型为 hostPath 时使用"` // Host路径类型(可选) }
K8sOneVolume 单个卷的配置
type K8sPVCRequest ¶
type K8sPVCRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群名称,必填 Namespace string `json:"namespace" binding:"required"` // 命名空间,必填 PVCNames []string `json:"pvc_names"` // PVC 名称,可选 PVCYaml *core.PersistentVolumeClaim `json:"pvc_yaml"` // PVC 对象, 可选 }
K8sPVCRequest PersistentVolumeClaim 相关请求结构
type K8sPVCStatus ¶
type K8sPVCStatus struct { Name string `json:"name"` // PVC 名称 Namespace string `json:"namespace"` // 命名空间 Phase core.PersistentVolumeClaimPhase `json:"phase"` // 阶段 (Pending, Bound, Lost) VolumeName string `json:"volume_name"` // 绑定的 PV 名称 Capacity map[core.ResourceName]string `json:"capacity"` // 分配的容量 RequestedStorage string `json:"requested_storage"` // 请求的存储容量 StorageClass *string `json:"storage_class"` // 存储类 VolumeMode *core.PersistentVolumeMode `json:"volume_mode"` // 卷模式 AccessModes []core.PersistentVolumeAccessMode `json:"access_modes"` // 访问模式 CreationTimestamp time.Time `json:"creation_timestamp"` // 创建时间 }
K8sPVCStatus PersistentVolumeClaim 状态响应
type K8sPVRequest ¶
type K8sPVRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群名称,必填 PVNames []string `json:"pv_names"` // PV 名称,可选 PVYaml *core.PersistentVolume `json:"pv_yaml"` // PV 对象, 可选 }
K8sPVRequest PersistentVolume 相关请求结构
type K8sPVStatus ¶
type K8sPVStatus struct { Name string `json:"name"` // PV 名称 Capacity map[core.ResourceName]string `json:"capacity"` // 容量 Phase core.PersistentVolumePhase `json:"phase"` // 阶段 (Available, Bound, Released, Failed) ClaimRef *core.ObjectReference `json:"claim_ref"` // 绑定的 PVC 引用 ReclaimPolicy core.PersistentVolumeReclaimPolicy `json:"reclaim_policy"` // 回收策略 StorageClass string `json:"storage_class"` // 存储类 VolumeMode *core.PersistentVolumeMode `json:"volume_mode"` // 卷模式 AccessModes []core.PersistentVolumeAccessMode `json:"access_modes"` // 访问模式 CreationTimestamp time.Time `json:"creation_timestamp"` // 创建时间 }
K8sPVStatus PersistentVolume 状态响应
type K8sPod ¶
type K8sPod struct { Model Name string `json:"name" binding:"required,min=1,max=200" gorm:"size:200;comment:Pod 名称"` // Pod 名称 Namespace string `json:"namespace" binding:"required,min=1,max=200" gorm:"size:200;comment:Pod 所属的命名空间"` // Pod 所属的命名空间 Status string `json:"status" gorm:"comment:Pod 状态,例如 Running, Pending"` // Pod 状态,例如 "Running", "Pending" NodeName string `json:"node_name" gorm:"index;comment:Pod 所在节点名称"` // Pod 所在节点名称 Labels map[string]string `json:"labels" gorm:"type:text;serializer:json;comment:Pod 标签键值对"` // Pod 标签键值对 Annotations map[string]string `json:"annotations" gorm:"type:text;serializer:json;comment:Pod 注解键值对"` // Pod 注解键值对 Containers []K8sPodContainer `json:"containers" gorm:"-"` // Pod 内的容器信息,前端使用 }
K8sPod 单个 Pod 的模型
type K8sPodAffinityRequest ¶
type K8sPodAffinityRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群ID,必填 Namespace string `json:"namespace" binding:"required"` // 命名空间,必填 ResourceType string `json:"resource_type" binding:"required"` // 资源类型,必填 ResourceName string `json:"resource_name" binding:"required"` // 资源名称,必填 PodAffinity []K8sPodAffinityTerm `json:"pod_affinity"` // Pod 亲和性 PodAntiAffinity []K8sPodAffinityTerm `json:"pod_anti_affinity"` // Pod 反亲和性 TopologyKey string `json:"topology_key"` // 拓扑键 Operation string `json:"operation"` // 操作类型 (add, update, delete) }
K8sPodAffinityRequest Pod 亲和性请求
type K8sPodAffinityResponse ¶
type K8sPodAffinityResponse struct { ResourceType string `json:"resource_type"` // 资源类型 ResourceName string `json:"resource_name"` // 资源名称 Namespace string `json:"namespace"` // 命名空间 PodAffinity []K8sPodAffinityTerm `json:"pod_affinity"` // Pod 亲和性 PodAntiAffinity []K8sPodAffinityTerm `json:"pod_anti_affinity"` // Pod 反亲和性 TopologyKey string `json:"topology_key"` // 拓扑键 TopologyDomains []string `json:"topology_domains"` // 拓扑域列表 CreationTimestamp time.Time `json:"creation_timestamp"` // 创建时间 }
K8sPodAffinityResponse Pod 亲和性响应
type K8sPodAffinityTerm ¶
type K8sPodAffinityTerm struct { LabelSelector K8sLabelSelector `json:"label_selector"` // 标签选择器 Namespaces []string `json:"namespaces"` // 命名空间列表 TopologyKey string `json:"topology_key"` // 拓扑键 NamespaceSelector *K8sLabelSelector `json:"namespace_selector"` // 命名空间选择器 Weight int32 `json:"weight,omitempty"` // 权重(仅用于软亲和性) }
K8sPodAffinityTerm Pod 亲和性条件
type K8sPodAffinityTermSpec ¶
type K8sPodAffinityTermSpec struct { LabelSelector *K8sLabelSelector `json:"label_selector"` // 标签选择器 Namespaces []string `json:"namespaces"` // 命名空间列表 TopologyKey string `json:"topology_key"` // 拓扑键 NamespaceSelector *K8sLabelSelector `json:"namespace_selector"` // 命名空间选择器 }
K8sPodAffinityTermSpec Pod 亲和性条件规格
type K8sPodAffinityValidationRequest ¶
type K8sPodAffinityValidationRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群ID,必填 Namespace string `json:"namespace"` // 命名空间,可选 PodAffinity *K8sPodAffinityTerm `json:"pod_affinity"` // Pod 亲和性 PodAntiAffinity *K8sPodAntiAffinityTerm `json:"pod_anti_affinity"` // Pod 反亲和性 SimulateScheduling bool `json:"simulate_scheduling"` // 是否模拟调度 }
K8sPodAffinityValidationRequest Pod 亲和性验证请求
type K8sPodAffinityValidationResponse ¶
type K8sPodAffinityValidationResponse struct { Valid bool `json:"valid"` // 是否有效 MatchingPods []string `json:"matching_pods"` // 匹配的 Pod 列表 ValidationErrors []string `json:"validation_errors"` // 验证错误 Suggestions []string `json:"suggestions"` // 建议 SchedulingResult string `json:"scheduling_result"` // 调度结果 ValidationTime time.Time `json:"validation_time"` // 验证时间 }
K8sPodAffinityValidationResponse Pod 亲和性验证响应
type K8sPodAntiAffinityTerm ¶
type K8sPodAntiAffinityTerm struct { RequiredDuringSchedulingIgnoredDuringExecution []K8sPodAffinityTermSpec `json:"required_during_scheduling_ignored_during_execution"` // 硬反亲和性 PreferredDuringSchedulingIgnoredDuringExecution []K8sWeightedPodAffinityTerm `json:"preferred_during_scheduling_ignored_during_execution"` // 软反亲和性 }
K8sPodAntiAffinityTerm Pod 反亲和性条件
type K8sPodContainer ¶
type K8sPodContainer struct { Name string `json:"name" binding:"required,min=1,max=200" gorm:"size:200;comment:容器名称"` // 容器名称 Image string `json:"image" binding:"required" gorm:"size:500;comment:容器镜像"` // 容器镜像 Command StringList `json:"command,omitempty" gorm:"type:text;serializer:json;comment:启动命令组"` // 启动命令组 Args StringList `json:"args,omitempty" gorm:"type:text;serializer:json;comment:启动参数,空格分隔"` // 启动参数 Envs []K8sEnvVar `json:"envs,omitempty" gorm:"type:text;serializer:json;comment:环境变量组"` // 环境变量组 Ports []K8sContainerPort `json:"ports,omitempty" gorm:"type:text;serializer:json;comment:容器端口配置"` // 容器端口配置 Resources ResourceRequirements `json:"resources,omitempty" gorm:"type:text;serializer:json;comment:资源请求与限制"` // 资源请求与限制 VolumeMounts []K8sVolumeMount `json:"volume_mounts,omitempty" gorm:"type:text;serializer:json;comment:卷挂载配置"` // 卷挂载配置 LivenessProbe *K8sProbe `json:"liveness_probe,omitempty" gorm:"type:text;serializer:json;comment:存活探测配置"` // 存活探测配置 ReadinessProbe *K8sProbe `json:"readiness_probe,omitempty" gorm:"type:text;serializer:json;comment:就绪探测配置"` // 就绪探测配置 ImagePullPolicy string `json:"image_pull_policy,omitempty" gorm:"size:50;comment:镜像拉取策略"` // 镜像拉取策略,例如 "Always", "IfNotPresent", "Never" }
K8sPodContainer Pod 中单个容器的模型
type K8sPodListResponse ¶
type K8sPodListResponse struct { Pods []K8sPod `json:"pods"` // Pod 列表 TotalCount int `json:"total_count"` // 总数 }
K8sPodListResponse Pod 列表响应
type K8sPodRelationship ¶
type K8sPodRelationship struct { SourcePod string `json:"source_pod"` // 源 Pod TargetPod string `json:"target_pod"` // 目标 Pod RelationshipType string `json:"relationship_type"` // 关系类型 (affinity, anti-affinity) TopologyKey string `json:"topology_key"` // 拓扑键 Labels map[string]string `json:"labels"` // 标签 Weight int32 `json:"weight"` // 权重 Namespace string `json:"namespace"` // 命名空间 }
K8sPodRelationship Pod 关系
type K8sPodRequest ¶
type K8sPodRequest struct { ClusterId int `json:"cluster_id" binding:"required"` // 集群名称,必填 Pod *core.Pod `json:"pod"` // Pod 对象 }
K8sPodRequest 创建 Pod 的请求结构
type K8sPreferredSchedulingTerm ¶
type K8sPreferredSchedulingTerm struct { Weight int32 `json:"weight"` // 权重 (1-100) Preference K8sNodeSelectorTerm `json:"preference"` // 偏好条件 }
K8sPreferredSchedulingTerm 优先调度条件
type K8sProbe ¶
type K8sProbe struct { HTTPGet *K8sHTTPGetAction `json:"http_get,omitempty" gorm:"type:text;serializer:json;comment:HTTP GET 探测配置"` // HTTP GET 探测 // TCPSocket 和 Exec 探测也可以根据需要添加 InitialDelaySeconds int `json:"initial_delay_seconds" gorm:"comment:探测初始延迟时间(秒)"` // 探测初始延迟时间 PeriodSeconds int `json:"period_seconds" gorm:"comment:探测间隔时间(秒)"` // 探测间隔时间 TimeoutSeconds int `json:"timeout_seconds" gorm:"comment:探测超时时间(秒)"` // 探测超时时间 SuccessThreshold int `json:"success_threshold" gorm:"comment:探测成功阈值"` // 探测成功阈值 FailureThreshold int `json:"failure_threshold" gorm:"comment:探测失败阈值"` // 探测失败阈值 }
K8sProbe 探测配置
type K8sProject ¶
type K8sProject struct { Model Name string `json:"name" binding:"required,min=1,max=200" gorm:"size:100;comment:项目名称"` // 项目名称 NameZh string `json:"name_zh" binding:"required,min=1,max=500" gorm:"size:100;comment:项目中文名称"` // 项目中文名称 Cluster string `json:"cluster" gorm:"size:100;comment:所属集群名称"` // 所属集群名称 TreeNodeID int `json:"tree_node_id" gorm:"comment:关联的树节点ID"` // 关联的树节点ID UserID int `json:"user_id" gorm:"comment:创建者用户ID"` // 创建者用户ID K8sApps []K8sApp `json:"k8s_apps,omitempty" gorm:"foreignKey:K8sProjectID;comment:关联的 Kubernetes 应用"` // 关联的 Kubernetes 应用 }
K8sProject Kubernetes 项目的配置
func (*K8sProject) TableName ¶
func (*K8sProject) TableName() string
type K8sResourceList ¶
type K8sResourceQuotaRequest ¶
type K8sResourceQuotaRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群ID,必填 Namespace string `json:"namespace" binding:"required"` // 命名空间,必填 ResourceQuotaNames []string `json:"resource_quota_names"` // ResourceQuota 名称列表,批量删除用 ResourceQuotaYaml *core.ResourceQuota `json:"resource_quota_yaml"` // ResourceQuota 对象,可选 }
K8sResourceQuotaRequest ResourceQuota 相关请求结构
type K8sResourceQuotaStatus ¶
type K8sResourceQuotaStatus struct { Name string `json:"name"` // ResourceQuota 名称 Namespace string `json:"namespace"` // 命名空间 Hard map[string]string `json:"hard"` // 资源配额限制 Used map[string]string `json:"used"` // 当前使用量 Scopes []string `json:"scopes"` // 资源范围 CreationTimestamp time.Time `json:"creation_timestamp"` // 创建时间 }
K8sResourceQuotaStatus ResourceQuota 状态响应
type K8sResourceQuotaUsage ¶
type K8sResourceQuotaUsage struct { Name string `json:"name"` // ResourceQuota 名称 Namespace string `json:"namespace"` // 命名空间 Hard map[string]string `json:"hard"` // 资源配额限制 Used map[string]string `json:"used"` // 当前使用量 UsagePercentage map[string]float64 `json:"usage_percentage"` // 使用率百分比 CreationTimestamp time.Time `json:"creation_timestamp"` // 创建时间 }
K8sResourceQuotaUsage ResourceQuota 使用情况响应
type K8sRole ¶
type K8sRole struct { Name string `json:"name"` // Role 名称 Namespace string `json:"namespace"` // 命名空间 UID string `json:"uid"` // 唯一标识符 Labels StringList `json:"labels,omitempty" gorm:"serializer:json;comment:标签"` // 标签 Annotations StringList `json:"annotations,omitempty" gorm:"serializer:json;comment:注解"` // 注解 Rules []PolicyRule `json:"rules" gorm:"serializer:json;comment:策略规则"` // 策略规则 CreatedAt time.Time `json:"created_at"` // 创建时间 }
K8sRole Kubernetes Role 资源
type K8sRoleBinding ¶
type K8sRoleBinding struct { Name string `json:"name"` // RoleBinding 名称 Namespace string `json:"namespace"` // 命名空间 UID string `json:"uid"` // 唯一标识符 Labels StringList `json:"labels,omitempty" gorm:"serializer:json;comment:标签"` // 标签 Annotations StringList `json:"annotations,omitempty" gorm:"serializer:json;comment:注解"` // 注解 Subjects []Subject `json:"subjects" gorm:"serializer:json;comment:绑定的主体"` // 绑定的主体 RoleRef RoleRef `json:"role_ref" gorm:"serializer:json;comment:角色引用"` // 角色引用 CreatedAt time.Time `json:"created_at"` // 创建时间 }
K8sRoleBinding Kubernetes RoleBinding 资源
type K8sSecretEncryptionRequest ¶
type K8sSecretEncryptionRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群ID Namespace string `json:"namespace" binding:"required"` // 命名空间 Name string `json:"name" binding:"required"` // Secret 名称 Type core.SecretType `json:"type"` // Secret 类型 Data map[string]string `json:"data"` // 明文数据 StringData map[string]string `json:"string_data"` // 字符串数据 Immutable *bool `json:"immutable"` // 是否不可变 }
K8sSecretEncryptionRequest Secret 加密请求
type K8sSecretRequest ¶
type K8sSecretRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群名称,必填 Namespace string `json:"namespace" binding:"required"` // 命名空间,必填 SecretNames []string `json:"secret_names"` // Secret 名称,可选 SecretYaml *core.Secret `json:"secret_yaml"` // Secret 对象, 可选 }
K8sSecretRequest Secret 相关请求结构
type K8sSecretStatus ¶
type K8sSecretStatus struct { Name string `json:"name"` // Secret 名称 Namespace string `json:"namespace"` // 命名空间 Type core.SecretType `json:"type"` // Secret 类型 DataKeys []string `json:"data_keys"` // 数据键列表(不包含敏感值) DataSize int `json:"data_size"` // 数据总大小 Immutable *bool `json:"immutable"` // 是否不可变 CreationTimestamp time.Time `json:"creation_timestamp"` // 创建时间 }
K8sSecretStatus Secret 状态响应
type K8sServiceAccount ¶
type K8sServiceAccount struct { Name string `json:"name"` // ServiceAccount 名称 Namespace string `json:"namespace"` // 命名空间 UID string `json:"uid"` // 唯一标识符 Labels StringList `json:"labels,omitempty" gorm:"serializer:json;comment:标签"` // 标签 Annotations StringList `json:"annotations,omitempty" gorm:"serializer:json;comment:注解"` // 注解 Secrets []LocalObjectReference `json:"secrets,omitempty" gorm:"serializer:json;comment:关联的 Secret"` // 关联的 Secret ImagePullSecrets []LocalObjectReference `json:"image_pull_secrets,omitempty" gorm:"serializer:json;comment:镜像拉取 Secret"` // 镜像拉取 Secret AutomountServiceAccountToken *bool `json:"automount_service_account_token,omitempty"` // 是否自动挂载服务账户令牌 CreatedAt time.Time `json:"created_at"` // 创建时间 }
K8sServiceAccount Kubernetes ServiceAccount 资源
type K8sServiceRequest ¶
type K8sServiceRequest struct { ClusterId int `json:"cluster_id" binding:"required"` // 集群id,必填 Namespace string `json:"namespace"` // 命名空间,必填 ServiceNames []string `json:"service_names"` // Service 名称,可选 ServiceYaml *core.Service `json:"service_yaml"` // Service 对象, 可选 }
K8sServiceRequest Service 相关请求结构
type K8sStatefulSetRequest ¶
type K8sStatefulSetRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群名称,必填 Namespace string `json:"namespace" binding:"required"` // 命名空间,必填 StatefulSetNames []string `json:"statefulset_names"` // StatefulSet 名称,可选 StatefulSetYaml *appsv1.StatefulSet `json:"statefulset_yaml"` // StatefulSet 对象, 可选 }
K8sStatefulSetRequest StatefulSet 相关请求结构
type K8sStatefulSetScaleRequest ¶
type K8sStatefulSetScaleRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群名称,必填 Namespace string `json:"namespace" binding:"required"` // 命名空间,必填 StatefulSetName string `json:"statefulset_name" binding:"required"` // StatefulSet 名称,必填 Replicas int32 `json:"replicas" binding:"required"` // 副本数量,必填 }
K8sStatefulSetScaleRequest StatefulSet 扩缩容请求结构
type K8sStatefulSetStatus ¶
type K8sStatefulSetStatus struct { Name string `json:"name"` // StatefulSet 名称 Namespace string `json:"namespace"` // 命名空间 Replicas int32 `json:"replicas"` // 期望副本数 ReadyReplicas int32 `json:"ready_replicas"` // 就绪副本数 CurrentReplicas int32 `json:"current_replicas"` // 当前副本数 UpdatedReplicas int32 `json:"updated_replicas"` // 已更新副本数 AvailableReplicas int32 `json:"available_replicas"` // 可用副本数 CurrentRevision string `json:"current_revision"` // 当前修订版本 UpdateRevision string `json:"update_revision"` // 更新修订版本 ObservedGeneration int64 `json:"observed_generation"` // 观察到的代数 CreationTimestamp time.Time `json:"creation_timestamp"` // 创建时间 }
K8sStatefulSetStatus StatefulSet 状态响应
type K8sStorageClassRequest ¶
type K8sStorageClassRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群名称,必填 StorageClassNames []string `json:"storage_class_names"` // StorageClass 名称,可选 StorageClassYaml *storagev1.StorageClass `json:"storage_class_yaml"` // StorageClass 对象, 可选 }
K8sStorageClassRequest StorageClass 相关请求结构
type K8sStorageClassStatus ¶
type K8sStorageClassStatus struct { Name string `json:"name"` // StorageClass 名称 Provisioner string `json:"provisioner"` // 存储提供者 Parameters map[string]string `json:"parameters"` // 存储参数 ReclaimPolicy *core.PersistentVolumeReclaimPolicy `json:"reclaim_policy"` // 回收策略 VolumeBindingMode *storagev1.VolumeBindingMode `json:"volume_binding_mode"` // 卷绑定模式 AllowVolumeExpansion *bool `json:"allow_volume_expansion"` // 是否允许卷扩展 CreationTimestamp time.Time `json:"creation_timestamp"` // 创建时间 }
K8sStorageClassStatus StorageClass 状态响应
type K8sTaint ¶
type K8sTaint struct { Key string `json:"key"` // 键 Value string `json:"value"` // 值 Effect string `json:"effect"` // 效果 (NoSchedule, PreferNoSchedule, NoExecute) }
K8sTaint 污点
type K8sTaintEffectConfig ¶
type K8sTaintEffectConfig struct { NoScheduleConfig NoScheduleConfig `json:"no_schedule_config"` // NoSchedule配置 PreferNoScheduleConfig PreferNoScheduleConfig `json:"prefer_no_schedule_config"` // PreferNoSchedule配置 NoExecuteConfig NoExecuteConfig `json:"no_execute_config"` // NoExecute配置 EffectTransition EffectTransition `json:"effect_transition"` // 效果转换 }
K8sTaintEffectConfig 污点效果配置
type K8sTaintEffectManagementRequest ¶
type K8sTaintEffectManagementRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群ID,必填 NodeName string `json:"node_name"` // 节点名称,可选 NodeSelector map[string]string `json:"node_selector"` // 节点选择器 TaintEffectConfig K8sTaintEffectConfig `json:"taint_effect_config"` // 污点效果配置 BatchOperation bool `json:"batch_operation"` // 批量操作 GracePeriod *int64 `json:"grace_period"` // 优雅期限 ForceEviction bool `json:"force_eviction"` // 强制驱逐 }
K8sTaintEffectManagementRequest 污点效果管理请求
type K8sTaintEffectManagementResponse ¶
type K8sTaintEffectManagementResponse struct { NodeName string `json:"node_name"` // 节点名称 AffectedPods []PodEvictionInfo `json:"affected_pods"` // 受影响的Pod信息 EffectChanges []EffectChange `json:"effect_changes"` // 效果变化 EvictionSummary EvictionSummary `json:"eviction_summary"` // 驱逐摘要 OperationTime time.Time `json:"operation_time"` // 操作时间 Status string `json:"status"` // 状态 Warnings []string `json:"warnings"` // 警告 }
K8sTaintEffectManagementResponse 污点效果管理响应
type K8sTaintTolerationRequest ¶
type K8sTaintTolerationRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群ID,必填 Namespace string `json:"namespace" binding:"required"` // 命名空间,必填 ResourceType string `json:"resource_type" binding:"required"` // 资源类型,必填 ResourceName string `json:"resource_name" binding:"required"` // 资源名称,必填 Tolerations []K8sToleration `json:"tolerations"` // 容忍度列表 NodeTaints []K8sTaint `json:"node_taints"` // 节点污点列表(用于验证) Operation string `json:"operation"` // 操作类型 (add, update, delete) }
K8sTaintTolerationRequest 污点容忍请求
type K8sTaintTolerationResponse ¶
type K8sTaintTolerationResponse struct { ResourceType string `json:"resource_type"` // 资源类型 ResourceName string `json:"resource_name"` // 资源名称 Namespace string `json:"namespace"` // 命名空间 Tolerations []K8sToleration `json:"tolerations"` // 容忍度列表 CompatibleNodes []string `json:"compatible_nodes"` // 兼容的节点列表 CreationTimestamp time.Time `json:"creation_timestamp"` // 创建时间 }
K8sTaintTolerationResponse 污点容忍响应
type K8sTaintTolerationValidationRequest ¶
type K8sTaintTolerationValidationRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群ID,必填 Namespace string `json:"namespace"` // 命名空间,可选 Tolerations []K8sToleration `json:"tolerations"` // 容忍度列表 NodeName string `json:"node_name"` // 节点名称,可选 CheckAllNodes bool `json:"check_all_nodes"` // 是否检查所有节点 SimulateScheduling bool `json:"simulate_scheduling"` // 是否模拟调度 }
K8sTaintTolerationValidationRequest 污点容忍验证请求
type K8sTaintTolerationValidationResponse ¶
type K8sTaintTolerationValidationResponse struct { Valid bool `json:"valid"` // 是否有效 CompatibleNodes []string `json:"compatible_nodes"` // 兼容的节点列表 IncompatibleNodes []string `json:"incompatible_nodes"` // 不兼容的节点列表 ValidationErrors []string `json:"validation_errors"` // 验证错误 Suggestions []string `json:"suggestions"` // 建议 SchedulingResult string `json:"scheduling_result"` // 调度结果 ValidationTime time.Time `json:"validation_time"` // 验证时间 }
K8sTaintTolerationValidationResponse 污点容忍验证响应
type K8sToleration ¶
type K8sToleration struct { Key string `json:"key"` // 键 Operator string `json:"operator"` // 操作符 (Exists, Equal) Value string `json:"value"` // 值 Effect string `json:"effect"` // 效果 (NoSchedule, PreferNoSchedule, NoExecute) TolerationSeconds *int64 `json:"toleration_seconds"` // 容忍时间(秒) }
K8sToleration 容忍度
type K8sTolerationConfigRequest ¶
type K8sTolerationConfigRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群ID,必填 Namespace string `json:"namespace"` // 命名空间,可选 ResourceType string `json:"resource_type"` // 资源类型,可选 ResourceName string `json:"resource_name"` // 资源名称,可选 TolerationTemplate K8sTolerationTemplate `json:"toleration_template"` // 容忍度模板 ApplyToExisting bool `json:"apply_to_existing"` // 是否应用到现有资源 AutoUpdate bool `json:"auto_update"` // 是否自动更新 Description string `json:"description"` // 配置描述 }
K8sTolerationConfigRequest 容忍度配置请求
type K8sTolerationSpec ¶
type K8sTolerationSpec struct { Key string `json:"key"` // 键 Operator string `json:"operator"` // 操作符 (Exists, Equal) Value string `json:"value"` // 值 Effect string `json:"effect"` // 效果 (NoSchedule, PreferNoSchedule, NoExecute) TolerationSeconds *int64 `json:"toleration_seconds"` // 容忍时间(秒) Priority int `json:"priority"` // 优先级 Conditions []TolerationCondition `json:"conditions"` // 容忍条件 Metadata map[string]string `json:"metadata"` // 元数据 }
K8sTolerationSpec 增强的容忍度规格
type K8sTolerationTemplate ¶
type K8sTolerationTemplate struct { Name string `json:"name"` // 模板名称 Tolerations []K8sTolerationSpec `json:"tolerations"` // 容忍度规格列表 DefaultTolerationTime *int64 `json:"default_toleration_time"` // 默认容忍时间 EffectPriority []string `json:"effect_priority"` // 效果优先级 AutoCleanup bool `json:"auto_cleanup"` // 自动清理 Tags map[string]string `json:"tags"` // 标签 }
K8sTolerationTemplate 容忍度模板
type K8sTolerationTimeRequest ¶
type K8sTolerationTimeRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群ID,必填 Namespace string `json:"namespace"` // 命名空间,可选 ResourceType string `json:"resource_type"` // 资源类型,可选 ResourceName string `json:"resource_name"` // 资源名称,可选 TimeConfig TolerationTimeConfig `json:"time_config"` // 时间配置 GlobalSettings bool `json:"global_settings"` // 全局设置 OverrideExisting bool `json:"override_existing"` // 覆盖现有 }
K8sTolerationTimeRequest 容忍时间设置请求
type K8sTolerationTimeResponse ¶
type K8sTolerationTimeResponse struct { ResourceType string `json:"resource_type"` // 资源类型 ResourceName string `json:"resource_name"` // 资源名称 Namespace string `json:"namespace"` // 命名空间 AppliedTimeouts []AppliedTimeout `json:"applied_timeouts"` // 应用的超时 ValidationResults []TimeValidationResult `json:"validation_results"` // 验证结果 CreationTimestamp time.Time `json:"creation_timestamp"` // 创建时间 Status string `json:"status"` // 状态 }
K8sTolerationTimeResponse 容忍时间设置响应
type K8sVolumeMount ¶
type K8sVolumeMount struct { Name string `json:"name" binding:"required" gorm:"size:100;comment:卷名称"` // 卷名称,必填,长度限制为100字符 MountPath string `json:"mount_path" binding:"required" gorm:"size:255;comment:挂载路径"` // 挂载路径,必填,长度限制为255字符 ReadOnly bool `json:"read_only,omitempty" gorm:"comment:是否只读"` // 是否只读 SubPath string `json:"sub_path,omitempty" gorm:"size:255;comment:子路径"` // 子路径(可选),长度限制为255字符 }
K8sVolumeMount 卷的挂载配置
type K8sWeightedPodAffinityTerm ¶
type K8sWeightedPodAffinityTerm struct { Weight int32 `json:"weight"` // 权重 (1-100) PodAffinityTerm K8sPodAffinityTermSpec `json:"pod_affinity_term"` // Pod 亲和性条件 }
K8sWeightedPodAffinityTerm 带权重的 Pod 亲和性条件
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,omitempty" gorm:"comment:集群名称"` // 集群名称 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,omitempty" gorm:"type:text;comment:yaml 模板内容"` // YAML 模板内容 ClusterId int `json:"cluster_id,omitempty" gorm:"comment:对应集群id"` }
K8sYamlTemplate Kubernetes YAML 模板的配置
func (*K8sYamlTemplate) TableName ¶
func (r *K8sYamlTemplate) TableName() string
type KeyValueItem ¶
type LabelK8sNodesRequest ¶
type LabelK8sNodesRequest struct { *K8sClusterNodesRequest ModType string `json:"mod_type" binding:"required,oneof=add del"` // 操作类型,必填,值为 "add" 或 "del" Labels []string `json:"labels" binding:"required"` // 标签键值对,必填 }
LabelK8sNodesRequest 定义为节点添加标签的请求结构
type ListApisRequest ¶
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 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 ListRolesRequest ¶
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 LocalObjectReference ¶
type LocalObjectReference struct {
Name string `json:"name,omitempty"` // 对象名称
}
LocalObjectReference 本地对象引用
type MCPConfig ¶
type MCPConfig struct { Model URL string `json:"url" gorm:"type:varchar(255)"` // MCP服务URL Whitelist *ToolWhitelist `json:"whitelist,omitempty" gorm:"-"` // 工具白名单 Blacklist *ToolBlacklist `json:"blacklist,omitempty" gorm:"-"` // 工具黑名单 }
MCPConfig MCP配置
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:删除时间"` }
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 监控配置模型 - 由 cache 自动生成和管理
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 Namespace ¶
type Namespace struct { Name string `json:"name"` // 命名空间名称 UID string `json:"uid"` // 命名空间唯一标识符 Status string `json:"status"` // 命名空间状态,例如 Active CreationTime time.Time `json:"creation_time"` // 创建时间 Labels []string `json:"labels,omitempty"` // 命名空间标签 Annotations []string `json:"annotations,omitempty"` // 命名空间注解 }
Namespace 命名空间响应结构体
type NoExecuteConfig ¶
type NoExecuteConfig struct { Enabled bool `json:"enabled"` // 是否启用 EvictionTimeout *int64 `json:"eviction_timeout"` // 驱逐超时 GracefulEviction bool `json:"graceful_eviction"` // 优雅驱逐 EvictionPolicy EvictionPolicy `json:"eviction_policy"` // 驱逐策略 RetryConfig RetryConfig `json:"retry_config"` // 重试配置 }
NoExecuteConfig NoExecute效果配置
type NoScheduleConfig ¶
type NoScheduleConfig struct { Enabled bool `json:"enabled"` // 是否启用 ExceptionPods []string `json:"exception_pods"` // 例外Pod列表 GracefulHandling bool `json:"graceful_handling"` // 优雅处理 NotificationConfig NotificationConfig `json:"notification_config"` // 通知配置 }
NoScheduleConfig NoSchedule效果配置
type NotificationConfig ¶
type NotificationConfig struct { Enabled bool `json:"enabled"` // 是否启用 Channels []string `json:"channels"` // 通知渠道 Template string `json:"template"` // 通知模板 Severity string `json:"severity"` // 严重程度 }
NotificationConfig 通知配置
type ObjectReference ¶
type ObjectReference struct { Kind string `json:"kind,omitempty"` // 对象类型 Namespace string `json:"namespace,omitempty"` // 命名空间 Name string `json:"name,omitempty"` // 对象名称 UID string `json:"uid,omitempty"` // 唯一标识符 APIVersion string `json:"api_version,omitempty"` // API 版本 ResourceVersion string `json:"resource_version,omitempty"` // 资源版本 FieldPath string `json:"field_path,omitempty"` // 字段路径 }
ObjectReference Kubernetes 对象引用
type OneEvent ¶
type OneEvent struct { Type string `json:"type"` // 事件类型,例如 "Normal", "Warning" Component string `json:"component"` // 事件的组件来源,例如 "kubelet" Reason string `json:"reason"` // 事件的原因,例如 "NodeReady" Message string `json:"message"` // 事件的详细消息 FirstTime string `json:"first_time"` // 事件第一次发生的时间,例如 "2024-04-27T10:00:00Z" LastTime string `json:"last_time"` // 事件最近一次发生的时间,例如 "2024-04-27T12:00:00Z" Object string `json:"object"` // 事件关联的对象信息,例如 "kind:Node name:node-1" Count int `json:"count"` // 事件发生的次数 }
type PodEvictionInfo ¶
type PodEvictionInfo struct { PodName string `json:"pod_name"` // Pod名称 Namespace string `json:"namespace"` // 命名空间 EvictionReason string `json:"eviction_reason"` // 驱逐原因 EvictionTime *time.Time `json:"eviction_time"` // 驱逐时间 RescheduleAttempts int `json:"reschedule_attempts"` // 重调度尝试 NewNodeName string `json:"new_node_name"` // 新节点名称 Status string `json:"status"` // 状态 }
PodEvictionInfo Pod驱逐信息
type PolicyRule ¶
type PolicyRule struct { Verbs []string `json:"verbs" gorm:"serializer:json;comment:允许的操作动词"` // 允许的操作动词,如 get, list, create, update, delete APIGroups []string `json:"api_groups" gorm:"serializer:json;comment:API 组"` // API 组,如 "", "apps", "extensions" Resources []string `json:"resources" gorm:"serializer:json;comment:资源类型"` // 资源类型,如 pods, services, deployments ResourceNames []string `json:"resource_names,omitempty" gorm:"serializer:json;comment:特定资源名称"` // 特定资源名称 NonResourceURLs []string `json:"non_resource_urls,omitempty" gorm:"serializer:json;comment:非资源URL"` // 非资源URL,如 "/healthz" }
PolicyRule RBAC 策略规则
type PreferNoScheduleConfig ¶
type PreferNoScheduleConfig struct { Enabled bool `json:"enabled"` // 是否启用 PreferenceWeight int32 `json:"preference_weight"` // 偏好权重 FallbackStrategy string `json:"fallback_strategy"` // 回退策略 MonitoringEnabled bool `json:"monitoring_enabled"` // 监控启用 }
PreferNoScheduleConfig PreferNoSchedule效果配置
type Probe ¶
type Probe struct { Type string `json:"type"` // 探针类型(http/tcp/exec) Path string `json:"path,omitempty"` // HTTP路径 Port int `json:"port,omitempty"` // 端口 Command []string `json:"command,omitempty"` // 执行命令 InitialDelaySeconds int `json:"initial_delay_seconds,omitempty"` // 初始延迟秒数 TimeoutSeconds int `json:"timeout_seconds,omitempty"` // 超时秒数 PeriodSeconds int `json:"period_seconds,omitempty"` // 检测周期 SuccessThreshold int `json:"success_threshold,omitempty"` // 成功阈值 FailureThreshold int `json:"failure_threshold,omitempty"` // 失败阈值 }
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 PropertyDef ¶
type PropertyDef struct { Type string `json:"type,omitempty"` // 属性类型 Description string `json:"description,omitempty"` // 属性描述 Default interface{} `json:"default,omitempty"` // 默认值 Enum []interface{} `json:"enum,omitempty"` // 枚举值 Minimum *float64 `json:"minimum,omitempty"` // 最小值 Maximum *float64 `json:"maximum,omitempty"` // 最大值 Items *ItemDef `json:"items,omitempty"` // 数组项定义 }
PropertyDef 参数属性定义
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 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 RemoveToolFromBlacklistReq ¶
type RemoveToolFromBlacklistReq struct { ID int `json:"id" binding:"required"` // 黑名单ID ToolID int `json:"tool_id" binding:"required"` // 工具ID }
RemoveToolFromBlacklistReq 从黑名单移除工具请求
type RemoveToolFromWhitelistReq ¶
type RemoveToolFromWhitelistReq struct { ID int `json:"id" binding:"required"` // 白名单ID ToolName string `json:"tool_name" binding:"required"` // 工具名称 }
RemoveToolFromWhitelistReq 从白名单移除工具请求
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 Resource ¶
type Resource struct { Type string `json:"type"` // 资源类型,例如 Pod, Service, Deployment Name string `json:"name"` // 资源名称 Namespace string `json:"namespace"` // 所属命名空间 Status string `json:"status"` // 资源状态,例如 Running, Pending CreationTime time.Time `json:"creation_time"` // 创建时间 }
Resource 命名空间中的资源响应结构体
type ResourceRequirements ¶
type ResourceRequirements struct { Requests K8sResourceList `json:"requests,omitempty" gorm:"type:text;serializer:json;comment:资源请求"` // 资源请求 Limits K8sResourceList `json:"limits,omitempty" gorm:"type:text;serializer:json;comment:资源限制"` // 资源限制 }
type ResourceStatus ¶
type ResourceStatus int8
const ( RUNNING ResourceStatus = iota + 1 STOPPED STARTING STOPPING RESTARTING DELETING ERROR )
type RetryConfig ¶
type RetryConfig struct { MaxRetries int `json:"max_retries"` // 最大重试次数 RetryInterval *int64 `json:"retry_interval"` // 重试间隔 BackoffStrategy string `json:"backoff_strategy"` // 退避策略 RetryConditions []string `json:"retry_conditions"` // 重试条件 }
RetryConfig 重试配置
type RevokeRoleApiRequest ¶
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 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:关联用户"` // 多对多关联用户 }
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权限关联表
type RoleRef ¶
type RoleRef struct { APIGroup string `json:"api_group" binding:"required"` // API 组,通常为 "rbac.authorization.k8s.io" Kind string `json:"kind" binding:"required,oneof=Role ClusterRole"` // 角色类型:Role 或 ClusterRole Name string `json:"name" binding:"required"` // 角色名称 }
RoleRef RBAC 角色引用
type ScheduleK8sNodesRequest ¶
type ScheduleK8sNodesRequest struct { *K8sClusterNodesRequest ScheduleEnable bool `json:"schedule_enable"` }
ScheduleK8sNodesRequest 定义调度节点的请求结构
type SearchAuditLogsRequest ¶
type SearchAuditLogsRequest struct { ListAuditLogsRequest Advanced *AdvancedSearchOptions `json:"advanced"` }
SearchAuditLogsRequest 审计日志搜索请求
type ServiceAccountPermissions ¶
type ServiceAccountPermissions struct { ServiceAccountName string `json:"service_account_name"` // ServiceAccount 名称 Namespace string `json:"namespace"` // 命名空间 Roles []K8sRole `json:"roles,omitempty"` // 绑定的 Role ClusterRoles []K8sClusterRole `json:"cluster_roles,omitempty"` // 绑定的 ClusterRole RoleBindings []K8sRoleBinding `json:"role_bindings,omitempty"` // 相关的 RoleBinding ClusterRoleBindings []K8sClusterRoleBinding `json:"cluster_role_bindings,omitempty"` // 相关的 ClusterRoleBinding }
ServiceAccountPermissions ServiceAccount 权限信息
type ServiceAccountToken ¶
type ServiceAccountToken struct {
Token string `json:"token"` // Token 内容
}
ServiceAccountToken ServiceAccount Token 响应
type ServiceAccountTokenRequest ¶
type ServiceAccountTokenRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群ID ServiceAccountName string `json:"service_account_name" binding:"required"` // ServiceAccount 名称 Namespace string `json:"namespace" binding:"required"` // 命名空间 ExpirationSeconds *int64 `json:"expiration_seconds,omitempty"` // 过期时间(秒) }
ServiceAccountTokenRequest 创建 ServiceAccount Token 请求
type ServiceDiscoveryType ¶
type ServiceDiscoveryType int8
const ( ServiceDiscoveryTypeK8s ServiceDiscoveryType = iota + 1 ServiceDiscoveryTypeHttp ServiceDiscoveryTypeStatic )
type StatusDistributionItem ¶
StatusDistributionItem 状态码分布项
type StreamResponse ¶
type StreamResponse struct { Content string `json:"content"` Error string `json:"error,omitempty"` Done bool `json:"done"` ToolName string `json:"toolName"` ToolDesc string `json:"toolDesc"` }
StreamResponse 流式响应
type StringList ¶
type StringList []string
func (StringList) MarshalJSON ¶
func (m StringList) MarshalJSON() ([]byte, error)
MarshalJSON 将 StringList 序列化为 JSON
func (*StringList) UnmarshalJSON ¶
func (m *StringList) UnmarshalJSON(data []byte) error
UnmarshalJSON 将 JSON 反序列化为 StringList
type Subject ¶
type Subject struct { Kind string `json:"kind" binding:"required,oneof=User Group ServiceAccount"` // 主体类型:User, Group, ServiceAccount APIGroup string `json:"api_group,omitempty"` // API 组,User和Group为"rbac.authorization.k8s.io",ServiceAccount为"" Name string `json:"name" binding:"required"` // 主体名称 Namespace string `json:"namespace,omitempty"` // ServiceAccount 所在的命名空间 }
Subject RBAC 主体
type SubmitWorkorderInstanceReq ¶
type SubmitWorkorderInstanceReq struct {
ID int `json:"id" form:"id" binding:"required,min=1"`
}
提交工单请求
type TaintK8sNodesRequest ¶
type TaintK8sNodesRequest struct { *K8sClusterNodesRequest ModType string `json:"mod_type"` // 操作类型,值为 "add" 或 "del" TaintYaml string `json:"taint_yaml,omitempty"` // 可选的 Taint YAML 字符串,用于验证或其他用途 }
TaintK8sNodesRequest 定义为节点添加或删除 Taint 的请求结构
type TestMCPConnectionReq ¶
type TestMCPConnectionReq struct {
URL string `json:"url" binding:"required"` // MCP服务URL
}
TestMCPConnectionReq 测试MCP连接请求
type TestSendWorkorderNotificationReq ¶
type TestSendWorkorderNotificationReq struct { NotificationID int `json:"notification_id" binding:"required"` Recipient string `json:"recipient" binding:"required"` }
TestSendWorkorderNotificationReq 测试发送工单通知
type TimeScalingPolicy ¶
type TimeScalingPolicy struct { PolicyType string `json:"policy_type"` // 策略类型 (fixed, linear, exponential) ScalingFactor float64 `json:"scaling_factor"` // 缩放因子 BaseTime *int64 `json:"base_time"` // 基础时间 MaxScaledTime *int64 `json:"max_scaled_time"` // 最大缩放时间 ScalingConditions []string `json:"scaling_conditions"` // 缩放条件 }
TimeScalingPolicy 时间缩放策略
type TimeValidationResult ¶
type TimeValidationResult struct { TaintKey string `json:"taint_key"` // 污点键 IsValid bool `json:"is_valid"` // 是否有效 ValidationMessage string `json:"validation_message"` // 验证消息 RecommendedTimeout *int64 `json:"recommended_timeout"` // 推荐超时 ValidationTime time.Time `json:"validation_time"` // 验证时间 }
TimeValidationResult 时间验证结果
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 Toleration ¶
type TolerationCondition ¶
type TolerationCondition struct { Type string `json:"type"` // 条件类型 Status string `json:"status"` // 状态 LastTransitionTime time.Time `json:"last_transition_time"` // 最后转换时间 Reason string `json:"reason"` // 原因 Message string `json:"message"` // 消息 }
TolerationCondition 容忍条件
type TolerationTimeConfig ¶
type TolerationTimeConfig struct { DefaultTolerationTime *int64 `json:"default_toleration_time"` // 默认容忍时间 MaxTolerationTime *int64 `json:"max_toleration_time"` // 最大容忍时间 MinTolerationTime *int64 `json:"min_toleration_time"` // 最小容忍时间 TimeScalingPolicy TimeScalingPolicy `json:"time_scaling_policy"` // 时间缩放策略 ConditionalTimeouts []ConditionalTimeout `json:"conditional_timeouts"` // 条件超时 TimeZoneHandling string `json:"timezone_handling"` // 时区处理 }
TolerationTimeConfig 容忍时间配置
type Tool ¶
type Tool struct { Name string `json:"name"` // 工具名称 Description string `json:"description"` // 工具描述 Parameters ToolParameters `json:"parameters"` // 工具参数定义 Metadata map[string]interface{} `json:"metadata"` // 工具元数据 }
Tool 工具定义
type ToolBlacklist ¶
ToolBlacklist 工具黑名单
type ToolParameters ¶
type ToolParameters struct { Type string `json:"type"` // 参数类型 Properties map[string]PropertyDef `json:"properties,omitempty"` // 参数属性定义 Required []string `json:"required,omitempty"` // 必需的参数列表 }
ToolParameters 工具参数定义
type ToolWhitelist ¶
ToolWhitelist 工具白名单
type TransitionRule ¶
type TransitionRule struct { FromEffect string `json:"from_effect"` // 源效果 ToEffect string `json:"to_effect"` // 目标效果 Condition string `json:"condition"` // 条件 AutoApply bool `json:"auto_apply"` // 自动应用 }
TransitionRule 转换规则
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 服务树节点结构
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 TypeDistributionItem ¶
TypeDistributionItem 操作类型分布项
type UnbindClusterRoleFromServiceAccountRequest ¶
type UnbindClusterRoleFromServiceAccountRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群ID ServiceAccountName string `json:"service_account_name" binding:"required"` // ServiceAccount 名称 ClusterRoleBindingName string `json:"cluster_role_binding_name" binding:"required"` // ClusterRoleBinding 名称 }
UnbindClusterRoleFromServiceAccountRequest 解绑 ClusterRole 从 ServiceAccount 请求
type UnbindRoleFromServiceAccountRequest ¶
type UnbindRoleFromServiceAccountRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群ID ServiceAccountName string `json:"service_account_name" binding:"required"` // ServiceAccount 名称 Namespace string `json:"namespace" binding:"required"` // 命名空间 RoleBindingName string `json:"role_binding_name" binding:"required"` // RoleBinding 名称 }
UnbindRoleFromServiceAccountRequest 解绑 Role 从 ServiceAccount 请求
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 UpdateClusterRoleBindingRequest ¶
type UpdateClusterRoleBindingRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群ID Name string `json:"name" binding:"required"` // ClusterRoleBinding 名称 Labels StringList `json:"labels,omitempty"` // 标签 Annotations StringList `json:"annotations,omitempty"` // 注解 Subjects []Subject `json:"subjects" binding:"required"` // 绑定的主体 RoleRef RoleRef `json:"role_ref" binding:"required"` // 角色引用 }
UpdateClusterRoleBindingRequest 更新 ClusterRoleBinding 请求
type UpdateClusterRoleRequest ¶
type UpdateClusterRoleRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群ID Name string `json:"name" binding:"required"` // ClusterRole 名称 Labels StringList `json:"labels,omitempty"` // 标签 Annotations StringList `json:"annotations,omitempty"` // 注解 Rules []PolicyRule `json:"rules" binding:"required"` // 策略规则 }
UpdateClusterRoleRequest 更新 ClusterRole 请求
type UpdateK8sAppRequest ¶
type UpdateK8sAppRequest struct { ID int64 `json:"id" binding:"required"` Name string `json:"name" binding:"required,min=1,max=200"` // 应用名称 K8sProjectID int64 `json:"k8s_project_id" binding:"required"` // 关联的 Kubernetes 项目ID Cluster string `json:"cluster" binding:"required"` // 所属集群名称 ServiceType string `json:"service_type,omitempty"` // 服务类型 Namespace string `json:"namespace" binding:"required"` // Kubernetes 命名空间 ContainerCore `json:"containerCore"` // 容器核心配置 }
UpdateK8sAppRequest 更新 Kubernetes 应用的请求
type UpdateK8sCronjobRequest ¶
type UpdateK8sCronjobRequest struct { ID int64 `json:"id" binding:"required"` Name string `json:"name" binding:"required,min=1,max=200"` // 定时任务名称 Cluster string `json:"cluster" binding:"required"` // 所属集群 TreeNodeID int `json:"tree_node_id,omitempty"` // 关联的树节点ID(可选) K8sProjectID int `json:"k8s_project_id" binding:"required"` // 关联的 Kubernetes 项目ID Namespace string `json:"namespace" binding:"required"` // 命名空间 Schedule string `json:"schedule" binding:"required"` // 调度表达式 Image string `json:"image" binding:"required"` // 镜像 Commands StringList `json:"commands,omitempty"` // 启动命令组 Args StringList `json:"args,omitempty"` // 启动参数 }
UpdateK8sCronjobRequest 更新 CronJob 的请求
type UpdateK8sInstanceReq ¶
type UpdateK8sInstanceReq struct { ID int `json:"id" binding:"required"` // 实例ID Name string `json:"name" binding:"required,min=1,max=200"` // 实例名称 UserID int `json:"user_id" binding:"required"` // 创建者用户ID ClusterID int `json:"cluster_id" binding:"required"` // 所属集群ID ContainerCore ContainerCore `json:"containerCore" binding:"required"` // 容器配置 Image string `json:"image" binding:"required"` // 镜像 Replicas int `json:"replicas,omitempty"` // 副本数量 K8sAppID int `json:"k8s_appId" binding:"required"` // 关联的 Kubernetes 应用ID Namespace string `json:"namespace,omitempty"` // 命名空间 Type string `json:"type,omitempty"` // 实例类型(Deployment/StatefulSet/DaemonSet) Strategy string `json:"strategy,omitempty"` // 部署策略 ServiceName string `json:"service_name,omitempty"` // 关联的服务名称 Labels map[string]string `json:"labels,omitempty"` // K8s标签 Annotations map[string]string `json:"annotations,omitempty"` // K8s注解 LivenessProbe *Probe `json:"liveness_probe,omitempty"` // 存活探针 ReadinessProbe *Probe `json:"readiness_probe,omitempty"` // 就绪探针 StartupProbe *Probe `json:"startup_probe,omitempty"` // 启动探针 NodeSelector map[string]string `json:"node_selector,omitempty"` // 节点选择器 Affinity *Affinity `json:"affinity,omitempty"` // 亲和性配置 Tolerations []Toleration `json:"tolerations,omitempty"` // 容忍配置 }
type UpdateK8sInstanceResp ¶
type UpdateK8sInstanceResp struct {
InstanceID int `json:"instance_id"` // 实例ID
}
type UpdateK8sProjectRequest ¶
type UpdateK8sProjectRequest struct { ID int64 `json:"id" binding:"required"` Name string `json:"name" binding:"required,min=1,max=200"` // 项目名称 NameZh string `json:"name_zh" binding:"required,min=1,max=500"` // 项目中文名称 Cluster string `json:"cluster" binding:"required"` // 所属集群名称 TreeNodeID int `json:"tree_node_id,omitempty"` // 关联的树节点ID(可选) }
UpdateK8sProjectRequest 更新 Kubernetes 项目的请求
type UpdateK8sRoleRequest ¶
type UpdateK8sRoleRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群ID Name string `json:"name" binding:"required"` // Role 名称 Namespace string `json:"namespace" binding:"required"` // 命名空间 Labels StringList `json:"labels,omitempty"` // 标签 Annotations StringList `json:"annotations,omitempty"` // 注解 Rules []PolicyRule `json:"rules" binding:"required"` // 策略规则 }
UpdateK8sRoleRequest 更新 Kubernetes Role 请求
type UpdateMCPConfigReq ¶
type UpdateMCPConfigReq struct { ID int `json:"id" binding:"required"` // MCP配置ID URL string `json:"url" binding:"required"` // MCP服务URL }
UpdateMCPConfigReq 更新MCP配置请求
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 UpdateNamespaceRequest ¶
type UpdateNamespaceRequest struct { ClusterId int `json:"cluster_id" binding:"required"` Name string `json:"namespace" binding:"required"` Labels []string `json:"labels,omitempty"` // 命名空间标签 Annotations []string `json:"annotations,omitempty"` // 命名空间注解 }
UpdateNamespaceRequest 更新命名空间请求结构体
type UpdateProfileReq ¶
type UpdateProfileReq struct { ID int `json:"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 UpdateRoleBindingRequest ¶
type UpdateRoleBindingRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群ID Name string `json:"name" binding:"required"` // RoleBinding 名称 Namespace string `json:"namespace" binding:"required"` // 命名空间 Labels StringList `json:"labels,omitempty"` // 标签 Annotations StringList `json:"annotations,omitempty"` // 注解 Subjects []Subject `json:"subjects" binding:"required"` // 绑定的主体 RoleRef RoleRef `json:"role_ref" binding:"required"` // 角色引用 }
UpdateRoleBindingRequest 更新 RoleBinding 请求
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 UpdateServiceAccountRequest ¶
type UpdateServiceAccountRequest struct { ClusterID int `json:"cluster_id" binding:"required"` // 集群ID Name string `json:"name" binding:"required"` // ServiceAccount 名称 Namespace string `json:"namespace" binding:"required"` // 命名空间 Labels StringList `json:"labels,omitempty"` // 标签 Annotations StringList `json:"annotations,omitempty"` // 注解 Secrets []LocalObjectReference `json:"secrets,omitempty"` // 关联的 Secret ImagePullSecrets []LocalObjectReference `json:"image_pull_secrets,omitempty"` // 镜像拉取 Secret AutomountServiceAccountToken *bool `json:"automount_service_account_token,omitempty"` // 是否自动挂载服务账户令牌 }
UpdateServiceAccountRequest 更新 ServiceAccount 请求
type UpdateToolBlacklistReq ¶
type UpdateToolBlacklistReq struct { ID int `json:"id" binding:"required"` // 黑名单ID Tools []string `json:"tools" binding:"required"` // 黑名单工具列表 }
UpdateToolBlacklistReq 更新工具黑名单请求
type UpdateToolReq ¶
type UpdateToolReq struct { Name string `json:"name" binding:"required"` // 工具名称 Description string `json:"description"` // 工具描述 Parameters ToolParameters `json:"parameters"` // 工具参数定义 Metadata map[string]interface{} `json:"metadata"` // 工具元数据 }
UpdateToolReq 更新工具请求
type UpdateToolWhitelistReq ¶
type UpdateToolWhitelistReq struct { ID int `json:"id" binding:"required"` // 白名单ID Tools []string `json:"tools" binding:"required"` // 白名单工具列表 }
UpdateToolWhitelistReq 更新工具白名单请求
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:"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"` Tags StringList `json:"tags" binding:"omitempty"` IsTemplate int8 `json:"is_template" binding:"required,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:"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"` Tags StringList `json:"tags" binding:"omitempty"` IsDefault int8 `json:"is_default" binding:"required,oneof=1 2"` }
UpdateWorkorderProcessReq 更新工单流程请求
type UpdateWorkorderTemplateReq ¶
type UpdateWorkorderTemplateReq struct { ID int `json:"id" binding:"required,min=1"` 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:"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:varchar(255);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 用户模型
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 用户角色关联表
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 Volume ¶
type Volume struct { Name string `json:"name"` // 卷名称 Type string `json:"type"` // 卷类型(ConfigMap, Secret, PVC, EmptyDir等) MountPath string `json:"mount_path"` // 挂载路径 SubPath string `json:"sub_path,omitempty"` // 子路径 ReadOnly bool `json:"read_only,omitempty"` // 是否只读 SourceName string `json:"source_name,omitempty"` // 源资源名称(如ConfigMap名称) Size string `json:"size,omitempty"` // 存储大小 }
type WSResponse ¶
type WSResponse struct { Type string `json:"type"` // message 或 error Content string `json:"content,omitempty"` Error string `json:"error,omitempty"` Done bool `json:"done"` }
WSResponse WebSocket响应格式
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 工单分类实体
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"` 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:优先级"` 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:完成时间"` // 关联查询字段 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:状态"` Priority int8 `json:"priority" gorm:"column:priority;not null;default:2;comment:优先级"` 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 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:发送状态"` 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:优先级"` Status int8 `json:"status" gorm:"not null;default:1;index;comment:状态"` 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 工单流程实体
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 注销账号请求
Source Files
¶
- ai.go
- api.go
- audit.go
- general.go
- k8s.go
- k8s_affinity.go
- k8s_app.go
- k8s_cluster.go
- k8s_configmap.go
- k8s_container_exec.go
- k8s_cronjob.go
- k8s_daemonset.go
- k8s_endpoint.go
- k8s_ingress.go
- k8s_instance.go
- k8s_job.go
- k8s_label.go
- k8s_network_policy.go
- k8s_node.go
- k8s_pod.go
- k8s_project.go
- k8s_pv.go
- k8s_pvc.go
- k8s_rbac.go
- k8s_resource_quota.go
- k8s_secret.go
- k8s_serviceaccount.go
- k8s_statefulset.go
- k8s_storage_class.go
- k8s_tainttoleration.go
- k8s_volume.go
- k8s_yaml.go
- mcp.go
- prometheus_alert_event.go
- prometheus_alert_pool.go
- prometheus_alert_rule.go
- prometheus_config.go
- prometheus_onduty_group.go
- prometheus_record_rule.go
- prometheus_scrape_job.go
- prometheus_scrape_pool.go
- prometheus_send_group.go
- role.go
- tree_local.go
- tree_node.go
- user.go
- workorder_category.go
- workorder_form_design.go
- workorder_instance.go
- workorder_instance_comment.go
- workorder_instance_flow.go
- workorder_instance_time_line.go
- workorder_notification.go
- workorder_process.go
- workorder_template.go