diff --git a/desc/core/pcm-core.api b/desc/core/pcm-core.api index 29aa3110..86052596 100644 --- a/desc/core/pcm-core.api +++ b/desc/core/pcm-core.api @@ -1,113 +1,112 @@ syntax = "v1" info( - title: "gateway" - desc: "gateway端微服务" - author: "zhouqj" - email: "450705171@qq.com" + title: "gateway" + desc: "gateway端微服务" + author: "zhouqj" + email: "450705171@qq.com" ) type ( - getRegionResp { - Code int32 `json:"code"` - Msg string `json:"msg"` - Data RegionNum `json:"data"` - } - RegionNum { - RegionSum int64 `json:"regionSum"` - SoftStackSum int64 `json:"softStackSum"` - } + getRegionResp { + Code int32 `json:"code"` + Msg string `json:"msg"` + Data RegionNum `json:"data"` + } + RegionNum { + RegionSum int64 `json:"regionSum"` + SoftStackSum int64 `json:"softStackSum"` + } ) type ( - centerResourcesResp { - CentersIndex []CenterIndex `json:"centersIndex"` - } - CenterIndex { - Id int64 `json:"id"` - Name string `json:"name"` - Cpu string `json:"cpu"` - Memory string `json:"memory"` - Storage string `json:"storage"` - CenterType string `json:"centerType"` - } + centerResourcesResp { + CentersIndex []CenterIndex `json:"centersIndex"` + } + CenterIndex { + Id int64 `json:"id"` + Name string `json:"name"` + Cpu string `json:"cpu"` + Memory string `json:"memory"` + Storage string `json:"storage"` + CenterType string `json:"centerType"` + } ) type ( - HomeOverviewReq { + HomeOverviewReq { - } - HomeOverviewResp { - Code int `json:"code"` - Message string `json:"message"` - Data HomeOverviewData `json:"data"` - } - HomeOverviewData{ - AdaptSum int64 `json:"adaptSum"` - ClusterSum int64 `json:"clusterSum"` - StorageSum float32 `json:"storageSum"` - TaskSum int64 `json:"taskSum"` - } + } + HomeOverviewResp { + Code int `json:"code"` + Message string `json:"message"` + Data HomeOverviewData `json:"data"` + } + HomeOverviewData { + AdaptSum int64 `json:"adaptSum"` + ClusterSum int64 `json:"clusterSum"` + StorageSum float32 `json:"storageSum"` + TaskSum int64 `json:"taskSum"` + } ) type ( - PublicImageReq { + PublicImageReq { - } - PublicImageResp { - Code int `json:"code"` - Message string `json:"message"` - ImageDict []ImageDict `json:"imageRDict"` - } - ImageDict { - Id int `json:"id"` - PublicImageName string `json:"public_image_name"` - } + } + PublicImageResp { + Code int `json:"code"` + Message string `json:"message"` + ImageDict []ImageDict `json:"imageRDict"` + } + ImageDict { + Id int `json:"id"` + PublicImageName string `json:"public_image_name"` + } ) type ( - PublicFlavorReq { + PublicFlavorReq { - } - PublicFlavorResp { - Code int `json:"code"` - Message string `json:"message"` - FlavorDict []FlavorDict `json:"flavorDict"` - } - FlavorDict { - Id int `json:"id"` - PublicFlavorName string `json:"public_flavor_name"` - } + } + PublicFlavorResp { + Code int `json:"code"` + Message string `json:"message"` + FlavorDict []FlavorDict `json:"flavorDict"` + } + FlavorDict { + Id int `json:"id"` + PublicFlavorName string `json:"public_flavor_name"` + } ) type ( - PublicNetworkReq { - - } - PublicNetworkResp { - Code int `json:"code"` - Message string `json:"message"` - NetworkDict []NetworkDict `json:"networkDict"` - } - NetworkDict { - Id int `json:"id"` - PublicNetworkName string `json:"public_netWork_name"` - } + PublicNetworkReq { + } + PublicNetworkResp { + Code int `json:"code"` + Message string `json:"message"` + NetworkDict []NetworkDict `json:"networkDict"` + } + NetworkDict { + Id int `json:"id"` + PublicNetworkName string `json:"public_netWork_name"` + } ) type remoteResp { - Code int `json:"code"` - Message string `json:"message"` - Data interface{} `json:"data"` + Code int `json:"code"` + Message string `json:"message"` + Data interface{} `json:"data"` } type ( - clustersLoadReq { - ClusterName string `form:"clusterName"` - } - clustersLoadResp { - Data interface{} `json:"data"` - } + clustersLoadReq { + ClusterName string `form:"clusterName"` + } + clustersLoadResp { + Data interface{} `json:"data"` + } ) type ( @@ -126,1185 +125,1193 @@ type ( DiskAvail float64 `json:"diskAvail,optional"` DiskTotal float64 `json:"diskTotal,optional"` DiskUtilisation float64 `json:"diskUtilisation,optional"` - PodsUtilisation float64 `json:"podsUtilisation,optional"` - PodsCount int64 `json:"podsCount,optional"` - PodsTotal int64 `json:"podsTotal,optional"` + PodsUtilisation float64 `json:"podsUtilisation,optional"` + PodsCount int64 `json:"podsCount,optional"` + PodsTotal int64 `json:"podsTotal,optional"` } ) type ( - getClusterListReq { - Id int64 `form:"id"` - } - getClusterListResp { - Clusters []ClusterInfo `json:"clusters"` - } + getClusterListReq { + Id int64 `form:"id"` + } + getClusterListResp { + Clusters []ClusterInfo `json:"clusters"` + } ) type ( - listRegionResp { - Code int32 `json:"code"` - Msg string `json:"msg"` - Data []Region `json:"data"` - } - Region { - RegionName string `json:"RegionName"` // 域名 - SoftStack string `json:"SoftStack"` // 软件栈 - SlurmNum int64 `json:"SlurmNum"` // 超算域适配slurm数量 - AdaptorInterfaceSum int64 `json:"AdaptorInterfaceSum"` // 适配接口数量 - RunningJobs int64 `json:"runningJobs"` - } + listRegionResp { + Code int32 `json:"code"` + Msg string `json:"msg"` + Data []Region `json:"data"` + } + Region { + RegionName string `json:"RegionName"` // 域名 + SoftStack string `json:"SoftStack"` // 软件栈 + SlurmNum int64 `json:"SlurmNum"` // 超算域适配slurm数量 + AdaptorInterfaceSum int64 `json:"AdaptorInterfaceSum"` // 适配接口数量 + RunningJobs int64 `json:"runningJobs"` + } ) type ( GeneralTaskReq { - Name string `json:"name"` - AdapterIds []string `json:"adapterIds"` - ClusterIds []string `json:"clusterIds"` - Strategy string `json:"strategy"` - StaticWeightMap map[string]int32 `json:"staticWeightMap,optional"` - ReqBody []string `json:"reqBody"` - Replicas int64 `json:"replicas,string"` + Name string `json:"name"` + AdapterIds []string `json:"adapterIds"` + ClusterIds []string `json:"clusterIds"` + Strategy string `json:"strategy"` + StaticWeightMap map[string]int32 `json:"staticWeightMap,optional"` + ReqBody []string `json:"reqBody"` + Replicas int64 `json:"replicas,string"` } - PodLogsReq { - TaskId string `json:"taskId"` - TaskName string `json:"taskName"` - ClusterId string `json:"clusterId"` - ClusterName string `json:"clusterName"` - AdapterId string `json:"adapterId"` - AdapterName string `json:"adapterName"` - PodName string `json:"podName"` - stream bool `json:"stream"` - - } + PodLogsReq { + TaskId string `json:"taskId"` + TaskName string `json:"taskName"` + ClusterId string `json:"clusterId"` + ClusterName string `json:"clusterName"` + AdapterId string `json:"adapterId"` + AdapterName string `json:"adapterName"` + PodName string `json:"podName"` + stream bool `json:"stream"` + } ) type deleteTaskReq { - Id int64 `path:"id"` + Id int64 `path:"id"` } type commitTaskReq { - Name string `json:"name"` - NsID string `json:"nsID"` - Replicas int64 `json:"replicas,optional"` - MatchLabels map[string]string `json:"matchLabels,optional"` - YamlList []string `json:"yamlList"` - ClusterName string `json:"clusterName"` + Name string `json:"name"` + NsID string `json:"nsID"` + Replicas int64 `json:"replicas,optional"` + MatchLabels map[string]string `json:"matchLabels,optional"` + YamlList []string `json:"yamlList"` + ClusterName string `json:"clusterName"` } type ( - scheduleTaskByYamlReq { - Name string `yaml:"name"` - Description string `yaml:"description"` - TenantId int64 `yaml:"tenantId"` - NsID string `yaml:"nsID"` - Tasks []TaskYaml `yaml:"tasks"` - } - TaskYaml { - Replicas int64 `yaml:"replicas"` - TaskId int64 `yaml:"taskId"` - NsID string `yaml:"nsID"` - TaskType string `yaml:"taskType"` - ParticipantId int64 `yaml:"participantId"` - MatchLabels map[string]string `yaml:"matchLabels"` - Metadata interface{} `yaml:"metadata"` - } + scheduleTaskByYamlReq { + Name string `yaml:"name"` + Description string `yaml:"description"` + TenantId int64 `yaml:"tenantId"` + NsID string `yaml:"nsID"` + Tasks []TaskYaml `yaml:"tasks"` + } + TaskYaml { + Replicas int64 `yaml:"replicas"` + TaskId int64 `yaml:"taskId"` + NsID string `yaml:"nsID"` + TaskType string `yaml:"taskType"` + ParticipantId int64 `yaml:"participantId"` + MatchLabels map[string]string `yaml:"matchLabels"` + Metadata interface{} `yaml:"metadata"` + } ) type ( - commitVmTaskReq { - Name string `json:"name"` - AdapterIds []string `json:"adapterIds,optional"` - ClusterIds []string `json:"clusterIds"` - Strategy string `json:"strategy"` - StaticWeightMap map[string]int32 `json:"staticWeightMap,optional"` - MinCount int64 `json:"min_count,optional"` - ImageRef int64 `json:"imageRef,optional"` - FlavorRef int64 `json:"flavorRef,optional"` - Uuid int64 `json:"uuid,optional"` - Replicas int64 `json:"replicas,string"` - VmName string `json:"vm_name,optional"` - } - TaskVm { - Image string `json:"image"` - Flavor string `json:"flavor"` - Uuid string `json:"uuid"` - Platform string `json:"platform"` - } - VmOption { - AdapterId string `json:"adapterId"` - VmClusterIds []string `json:"vmClusterIds"` - Replicas int64 `json:"replicas,optional"` - Name string `json:"name"` - //ResourceType string `json:"resourceType"` - //TaskType string `json:"taskType"` - Strategy string `json:"strategy"` - ClusterToStaticWeight map[string]int32 `json:"clusterToStaticWeight"` - MatchLabels map[string]string `json:"matchLabels,optional"` - StaticWeightMap map[string]int32 `json:"staticWeightMap,optional"` - CreateMulServer []CreateMulDomainServer `json:"createMulServer,optional"` - } + commitVmTaskReq { + Name string `json:"name"` + AdapterIds []string `json:"adapterIds,optional"` + ClusterIds []string `json:"clusterIds"` + Strategy string `json:"strategy"` + StaticWeightMap map[string]int32 `json:"staticWeightMap,optional"` + MinCount int64 `json:"min_count,optional"` + ImageRef int64 `json:"imageRef,optional"` + FlavorRef int64 `json:"flavorRef,optional"` + Uuid int64 `json:"uuid,optional"` + Replicas int64 `json:"replicas,string"` + VmName string `json:"vm_name,optional"` + } + TaskVm { + Image string `json:"image"` + Flavor string `json:"flavor"` + Uuid string `json:"uuid"` + Platform string `json:"platform"` + } + VmOption { + AdapterId string `json:"adapterId"` + VmClusterIds []string `json:"vmClusterIds"` + Replicas int64 `json:"replicas,optional"` + Name string `json:"name"` + //ResourceType string `json:"resourceType"` + //TaskType string `json:"taskType"` + Strategy string `json:"strategy"` + ClusterToStaticWeight map[string]int32 `json:"clusterToStaticWeight"` + MatchLabels map[string]string `json:"matchLabels,optional"` + StaticWeightMap map[string]int32 `json:"staticWeightMap,optional"` + CreateMulServer []CreateMulDomainServer `json:"createMulServer,optional"` + } - CreateMulDomainServer { - Platform string `json:"platform,optional"` - name string `json:"name,optional"` - min_count int64 `json:"min_count,optional"` - imageRef string `json:"imageRef,optional"` - flavorRef string `json:"flavorRef,optional"` - uuid string `json:"uuid,optional"` - ClusterId string `json:"clusterId,optional"` - } - commitVmTaskResp { - Code int32 `json:"code"` - Msg string `json:"msg"` - } - ScheduleVmResult { - ClusterId string `json:"clusterId"` - TaskId string `json:"taskId"` - Strategy string `json:"strategy"` - Replica int32 `json:"replica"` - Msg string `json:"msg"` - } - VmTask{ - Id string `json:"id" copier:"Id"` - Links []VmLinks `json:"links" copier:"Links"` - OSDCFDiskConfig string `json:"OS_DCF_diskConfig" copier:"OSDCFDiskConfig"` - SecurityGroups []VmSecurity_groups_server `json:"security_groups" copier:"SecurityGroups"` - AdminPass string `json:"adminPass" copier:"AdminPass"` - } - VmLinks { - Href string `json:"href " copier:"Href"` - Rel string `json:"rel" copier:"Rel"` - } -// commitVmTaskReq { -// Name string `json:"name"` -// NsID string `json:"nsID"` -// Replicas int64 `json:"replicas,optional"` -// MatchLabels map[string]string `json:"matchLabels,optional"` -// AdapterId string `json:"adapterId,optional"` -// ClusterType string `json:"clusterType,optional"` -// //Virtual Machine Section -// CreateMulServer []CreateMulDomainServer `json:"createMulServer,optional"` -// } -// CreateMulDomainServer { -// Platform string `json:"platform,optional"` -// Name string `json:"name,optional"` -// Min_count int64 `json:"min_count,optional"` -// ImageRef string `json:"imageRef,optional"` -// FlavorRef string `json:"flavorRef,optional"` -// Uuid string `json:"uuid,optional"` -// } -// commitVmTaskResp { -// // VmTask []VmTask `json:"vmTask" copier:"VmTask"` -// TaskId int64 `json:"taskId"` -// Code int32 `json:"code"` -// Msg string `json:"msg"` -// } -// VmTask { -// Id string `json:"id" copier:"Id"` -// Links []VmLinks `json:"links" copier:"Links"` -// OSDCFDiskConfig string `json:"OS_DCF_diskConfig" copier:"OSDCFDiskConfig"` -// SecurityGroups []VmSecurity_groups_server `json:"security_groups" copier:"SecurityGroups"` -// AdminPass string `json:"adminPass" copier:"AdminPass"` -// } -// VmLinks { -// Href string `json:"href " copier:"Href"` -// Rel string `json:"rel" copier:"Rel"` -// } + CreateMulDomainServer { + Platform string `json:"platform,optional"` + name string `json:"name,optional"` + min_count int64 `json:"min_count,optional"` + imageRef string `json:"imageRef,optional"` + flavorRef string `json:"flavorRef,optional"` + uuid string `json:"uuid,optional"` + ClusterId string `json:"clusterId,optional"` + } + commitVmTaskResp { + Code int32 `json:"code"` + Msg string `json:"msg"` + } + ScheduleVmResult { + ClusterId string `json:"clusterId"` + TaskId string `json:"taskId"` + Strategy string `json:"strategy"` + Replica int32 `json:"replica"` + Msg string `json:"msg"` + } + VmTask { + Id string `json:"id" copier:"Id"` + Links []VmLinks `json:"links" copier:"Links"` + OSDCFDiskConfig string `json:"OS_DCF_diskConfig" copier:"OSDCFDiskConfig"` + SecurityGroups []VmSecurity_groups_server `json:"security_groups" copier:"SecurityGroups"` + AdminPass string `json:"adminPass" copier:"AdminPass"` + } + VmLinks { + Href string `json:"href " copier:"Href"` + Rel string `json:"rel" copier:"Rel"` + } + // commitVmTaskReq { + // Name string `json:"name"` + // NsID string `json:"nsID"` + // Replicas int64 `json:"replicas,optional"` + // MatchLabels map[string]string `json:"matchLabels,optional"` + // AdapterId string `json:"adapterId,optional"` + // ClusterType string `json:"clusterType,optional"` + // //Virtual Machine Section + // CreateMulServer []CreateMulDomainServer `json:"createMulServer,optional"` + // } + // CreateMulDomainServer { + // Platform string `json:"platform,optional"` + // Name string `json:"name,optional"` + // Min_count int64 `json:"min_count,optional"` + // ImageRef string `json:"imageRef,optional"` + // FlavorRef string `json:"flavorRef,optional"` + // Uuid string `json:"uuid,optional"` + // } + // commitVmTaskResp { + // // VmTask []VmTask `json:"vmTask" copier:"VmTask"` + // TaskId int64 `json:"taskId"` + // Code int32 `json:"code"` + // Msg string `json:"msg"` + // } + // VmTask { + // Id string `json:"id" copier:"Id"` + // Links []VmLinks `json:"links" copier:"Links"` + // OSDCFDiskConfig string `json:"OS_DCF_diskConfig" copier:"OSDCFDiskConfig"` + // SecurityGroups []VmSecurity_groups_server `json:"security_groups" copier:"SecurityGroups"` + // AdminPass string `json:"adminPass" copier:"AdminPass"` + // } + // VmLinks { + // Href string `json:"href " copier:"Href"` + // Rel string `json:"rel" copier:"Rel"` + // } - VmSecurity_groups_server { - Name string `json:"name" copier:"Name"` - } + VmSecurity_groups_server { + Name string `json:"name" copier:"Name"` + } ) type ( - scheduleTaskByYamlResp { - TaskId int64 `json:"taskId"` - } + scheduleTaskByYamlResp { + TaskId int64 `json:"taskId"` + } ) type ( - scheduleTaskReq { - Name string `json:"name"` - Synergy string `json:"synergy"` - Description string `json:"description"` - Strategy string `json:"strategy"` - Tasks []TaskInfo `json:"tasks"` - } - TaskInfo { - TaskId int64 `json:"taskId,optional"` - TaskType string `json:"taskType,optional"` - MatchLabels map[string]string `json:"matchLabels"` - ParticipantId int64 `json:"participantId"` - Metadata interface{} `json:"metadata"` - } + scheduleTaskReq { + Name string `json:"name"` + Synergy string `json:"synergy"` + Description string `json:"description"` + Strategy string `json:"strategy"` + Tasks []TaskInfo `json:"tasks"` + } + TaskInfo { + TaskId int64 `json:"taskId,optional"` + TaskType string `json:"taskType,optional"` + MatchLabels map[string]string `json:"matchLabels"` + ParticipantId int64 `json:"participantId"` + Metadata interface{} `json:"metadata"` + } ) type ( - jobTotalResp { - AllCardRunTime float64 `json:"allCardRunTime"` - AllJobCount float64 `json:"allJobCount"` - AllJobRunTime float64 `json:"allJobRunTime"` - TrainJobs []TrainJob `json:"trainJobs"` - } - TrainJob { - Name string `json:"name"` - Status string `json:"status"` - ParticipantName string `json:"participantName"` - SynergyStatus string `json:"synergyStatus"` - Strategy int `json:"strategy"` - } + jobTotalResp { + AllCardRunTime float64 `json:"allCardRunTime"` + AllJobCount float64 `json:"allJobCount"` + AllJobRunTime float64 `json:"allJobRunTime"` + TrainJobs []TrainJob `json:"trainJobs"` + } + TrainJob { + Name string `json:"name"` + Status string `json:"status"` + ParticipantName string `json:"participantName"` + SynergyStatus string `json:"synergyStatus"` + Strategy int `json:"strategy"` + } ) // 任务列表参数 type ( - taskListReq { - PageNum int `form:"pageNum"` - PageSize int `form:"pageSize"` - } - taskListResp { - TotalCount int64 `json:"totalCount"` // 任务总数 - NormalCount int64 `json:"normalCount"` // 正常任务数 - AlarmCount int64 `json:"alarmCount"` // 任务告警数 - Tasks []Task `json:"tasks"` - } - Task { - Id int64 `json:"id"` - Name string `json:"name"` - Status string `json:"status"` - TaskType string `json:"taskType"` - StartTime string `json:"startTime"` - EndTime string `json:"endTime"` - ParticipantStatus string `json:"participantStatus"` - ParticipantId int64 `json:"participantId"` - ParticipantName string `json:"participantName"` - } + taskListReq { + PageNum int `form:"pageNum"` + PageSize int `form:"pageSize"` + } + taskListResp { + TotalCount int64 `json:"totalCount"` // 任务总数 + NormalCount int64 `json:"normalCount"` // 正常任务数 + AlarmCount int64 `json:"alarmCount"` // 任务告警数 + Tasks []Task `json:"tasks"` + } + Task { + Id int64 `json:"id"` + Name string `json:"name"` + Status string `json:"status"` + TaskType string `json:"taskType"` + StartTime string `json:"startTime"` + EndTime string `json:"endTime"` + ParticipantStatus string `json:"participantStatus"` + ParticipantId int64 `json:"participantId"` + ParticipantName string `json:"participantName"` + } - pageTaskReq { - Name string `form:"name,optional"` - PageInfo - } + pageTaskReq { + Name string `form:"name,optional"` + PageInfo + } - TaskModel { - Id int64 `json:"id,omitempty,string" db:"id"` // id - Name string `json:"name,omitempty" db:"name"` // 作业名称 - Description string `json:"description,omitempty" db:"description"` // 作业描述 - Status string `json:"status,omitempty" db:"status"` // 作业状态 - Strategy int64 `json:"strategy" db:"strategy"` // 策略 - SynergyStatus int64 `json:"synergyStatus" db:"synergy_status"` // 协同状态(0-未协同、1-已协同) - CommitTime string `json:"commitTime,omitempty" db:"commit_time"` // 提交时间 - StartTime string `json:"startTime,omitempty" db:"start_time"` // 开始时间 - EndTime string `json:"endTime,omitempty" db:"end_time"` // 结束运行时间 - RunningTime int64 `json:"runningTime" db:"running_time"` // 已运行时间(单位秒) - YamlString string `json:"yamlString,omitempty" db:"yaml_string"` - Result string `json:"result,omitempty" db:"result"` // 作业结果 - DeletedAt string `json:"deletedAt,omitempty" gorm:"index" db:"deleted_at"` - NsID string `json:"nsId,omitempty" db:"ns_id"` - TenantId string `json:"tenantId,omitempty" db:"tenant_id"` - CreatedTime string `json:"createdTime,omitempty" db:"created_time" gorm:"autoCreateTime"` - UpdatedTime string `json:"updatedTime,omitempty" db:"updated_time"` - AdapterTypeDict string `json:"adapterTypeDict" db:"adapter_type_dict" gorm:"adapter_type_dict"` //适配器类型(对应字典表的值 - TaskTypeDict string `json:"taskTypeDict" db:"task_type_dict" gorm:"task_type_dict"` //任务类型(对应字典表的值 - } + TaskModel { + Id int64 `json:"id,omitempty,string" db:"id"` // id + Name string `json:"name,omitempty" db:"name"` // 作业名称 + Description string `json:"description,omitempty" db:"description"` // 作业描述 + Status string `json:"status,omitempty" db:"status"` // 作业状态 + Strategy int64 `json:"strategy" db:"strategy"` // 策略 + SynergyStatus int64 `json:"synergyStatus" db:"synergy_status"` // 协同状态(0-未协同、1-已协同) + CommitTime string `json:"commitTime,omitempty" db:"commit_time"` // 提交时间 + StartTime string `json:"startTime,omitempty" db:"start_time"` // 开始时间 + EndTime string `json:"endTime,omitempty" db:"end_time"` // 结束运行时间 + RunningTime int64 `json:"runningTime" db:"running_time"` // 已运行时间(单位秒) + YamlString string `json:"yamlString,omitempty" db:"yaml_string"` + Result string `json:"result,omitempty" db:"result"` // 作业结果 + DeletedAt string `json:"deletedAt,omitempty" gorm:"index" db:"deleted_at"` + NsID string `json:"nsId,omitempty" db:"ns_id"` + TenantId string `json:"tenantId,omitempty" db:"tenant_id"` + CreatedTime string `json:"createdTime,omitempty" db:"created_time" gorm:"autoCreateTime"` + UpdatedTime string `json:"updatedTime,omitempty" db:"updated_time"` + AdapterTypeDict string `json:"adapterTypeDict" db:"adapter_type_dict" gorm:"adapter_type_dict"` //适配器类型(对应字典表的值 + TaskTypeDict string `json:"taskTypeDict" db:"task_type_dict" gorm:"task_type_dict"` //任务类型(对应字典表的值 + } ) // 任务列表参数 type ( - taskDetailReq { - TaskId int64 `path:"taskId"` - } - taskDetailResp { - CpuCores float64 `json:"cpuCores"` - CpuRate float64 `json:"cpuRate"` - CpuLimit float64 `json:"cpuLimit"` - GpuCores float64 `json:"gpuCores"` - GpuRate float64 `json:"gpuRate"` - GpuLimit float64 `json:"gpuLimit"` - MemoryTotal float64 `json:"memoryTotal"` - MemoryRate float64 `json:"memoryRate"` - MemoryLimit float64 `json:"memoryLimit"` - } + taskDetailReq { + TaskId int64 `path:"taskId"` + } + taskDetailResp { + CpuCores float64 `json:"cpuCores"` + CpuRate float64 `json:"cpuRate"` + CpuLimit float64 `json:"cpuLimit"` + GpuCores float64 `json:"gpuCores"` + GpuRate float64 `json:"gpuRate"` + GpuLimit float64 `json:"gpuLimit"` + MemoryTotal float64 `json:"memoryTotal"` + MemoryRate float64 `json:"memoryRate"` + MemoryLimit float64 `json:"memoryLimit"` + } ) type ( - listCenterResp { - Code int32 `json:"code"` - Msg string `json:"msg"` - Data CenterData `json:"data"` - } - CenterData { - TotalCount int `json:"totalCount"` - Centers []Center `json:"centers"` - } - Center { - Id int64 `json:"id"` - CenterSource string `json:"centerSource"` - SourceId string `json:"sourceId"` - Name string `json:"name"` - Description string `json:"description"` - Type string `json:"type"` - Area string `json:"area"` - City string `json:"city"` - Longitude float64 `json:"longitude"` - Latitude float64 `json:"latitude"` - Status string `json:"status"` - UserNum int64 `json:"userNum"` - DeletedFlag int64 `json:"deletedFlag"` - CloudClusterNum int64 `json:"cloudClusterNum"` - CloudNodeNum int64 `json:"cloudNodeNum"` - CloudCpuNum int64 `json:"cloudCpuNum"` - CloudGpuNum int64 `json:"cloudGpuNum"` - CloudMngFlops int64 `json:"cloudMngFlops"` - CloudUmngFlops int64 `json:"cloudUmngFlops"` - CloudMngStorage int64 `json:"cloudMngStorage"` - CloudUmngStorage int64 `json:"cloudUmngStorage"` - AiClusterNum int64 `json:"aiClusterNum"` - AiNodeNum int64 `json:"aiNodeNum"` - AiCpuNum int64 `json:"aiCpuNum"` - AiGpuNum int64 `json:"aiGpuNum"` - AiMngFlops int64 `json:"aiMngFlops"` - AiUmngFlops int64 `json:"aiUmngFlops"` - AiMngStorage int64 `json:"aiMngStorage"` - AiUmngStorage int64 `json:"aiUmngStorage"` - HpcClusterNum int64 `json:"hpcClusterNum"` - HpcNodeNum int64 `json:"hpcNodeNum"` - HpcCpuNum int64 `json:"hpcCpuNum"` - HpcGpuNum int64 `json:"hpcGpuNum"` - HpcMngFlops int64 `json:"hpcMngFlops"` - HpcUmngFlops int64 `json:"hpcUmngFlops"` - HpcMngStorage int64 `json:"hpcMngStorage"` - HpcUmngStorage int64 `json:"hpcUmngStorage"` - Edwc bool `json:"edwc"` - Ydyl bool `json:"ydyl"` - HubCode int64 `json:"hubCode"` - } + listCenterResp { + Code int32 `json:"code"` + Msg string `json:"msg"` + Data CenterData `json:"data"` + } + CenterData { + TotalCount int `json:"totalCount"` + Centers []Center `json:"centers"` + } + Center { + Id int64 `json:"id"` + CenterSource string `json:"centerSource"` + SourceId string `json:"sourceId"` + Name string `json:"name"` + Description string `json:"description"` + Type string `json:"type"` + Area string `json:"area"` + City string `json:"city"` + Longitude float64 `json:"longitude"` + Latitude float64 `json:"latitude"` + Status string `json:"status"` + UserNum int64 `json:"userNum"` + DeletedFlag int64 `json:"deletedFlag"` + CloudClusterNum int64 `json:"cloudClusterNum"` + CloudNodeNum int64 `json:"cloudNodeNum"` + CloudCpuNum int64 `json:"cloudCpuNum"` + CloudGpuNum int64 `json:"cloudGpuNum"` + CloudMngFlops int64 `json:"cloudMngFlops"` + CloudUmngFlops int64 `json:"cloudUmngFlops"` + CloudMngStorage int64 `json:"cloudMngStorage"` + CloudUmngStorage int64 `json:"cloudUmngStorage"` + AiClusterNum int64 `json:"aiClusterNum"` + AiNodeNum int64 `json:"aiNodeNum"` + AiCpuNum int64 `json:"aiCpuNum"` + AiGpuNum int64 `json:"aiGpuNum"` + AiMngFlops int64 `json:"aiMngFlops"` + AiUmngFlops int64 `json:"aiUmngFlops"` + AiMngStorage int64 `json:"aiMngStorage"` + AiUmngStorage int64 `json:"aiUmngStorage"` + HpcClusterNum int64 `json:"hpcClusterNum"` + HpcNodeNum int64 `json:"hpcNodeNum"` + HpcCpuNum int64 `json:"hpcCpuNum"` + HpcGpuNum int64 `json:"hpcGpuNum"` + HpcMngFlops int64 `json:"hpcMngFlops"` + HpcUmngFlops int64 `json:"hpcUmngFlops"` + HpcMngStorage int64 `json:"hpcMngStorage"` + HpcUmngStorage int64 `json:"hpcUmngStorage"` + Edwc bool `json:"edwc"` + Ydyl bool `json:"ydyl"` + HubCode int64 `json:"hubCode"` + } ) type ( - listClusterReq { - CenterId int32 `path:"centerId"` - } - listClusterResp { - Code int32 `json:"code"` - Msg string `json:"msg"` - Data ClusterData `json:"data"` - } - ClusterData { - TotalCount int `json:"totalCount"` - Clusters []ComputeCluster `json:"clusters"` - } - ComputeCluster { - Id int64 `json:"id"` - Name string `json:"name"` - Type string `json:"type"` - JcceDomainId int64 `json:"jcceDomainId"` - JcceDomainName string `json:"jcceDomainName"` - Longitude float64 `json:"longitude"` - Latitude float64 `json:"latitude"` - Description string `json:"description"` - } + listClusterReq { + CenterId int32 `path:"centerId"` + } + listClusterResp { + Code int32 `json:"code"` + Msg string `json:"msg"` + Data ClusterData `json:"data"` + } + ClusterData { + TotalCount int `json:"totalCount"` + Clusters []ComputeCluster `json:"clusters"` + } + ComputeCluster { + Id int64 `json:"id"` + Name string `json:"name"` + Type string `json:"type"` + JcceDomainId int64 `json:"jcceDomainId"` + JcceDomainName string `json:"jcceDomainName"` + Longitude float64 `json:"longitude"` + Latitude float64 `json:"latitude"` + Description string `json:"description"` + } ) type ScreenChartResp { - ComputingPower []int `json:"computingPower"` - CpuAvg []int `json:"cpuAvg"` - CpuLoad []int `json:"cpuLoad"` - MemoryLoad []int `json:"memoryLoad"` - MemoryAvg []int `json:"memoryAvg"` - CenterName string `json:"centerName"` + ComputingPower []int `json:"computingPower"` + CpuAvg []int `json:"cpuAvg"` + CpuLoad []int `json:"cpuLoad"` + MemoryLoad []int `json:"memoryLoad"` + MemoryAvg []int `json:"memoryAvg"` + CenterName string `json:"centerName"` +} + +type getClusterByIdReq { + ClusterId int32 `path:"clusterId"` +} + +type getClusterByIdResp { + ClusterInfo ClusterInfo `json:"clusterInfo"` } type ScreenInfoResp { - StorageUsed float32 `json:"storageUsed"` - StorageUsing float32 `json:"storageUsing"` - UsageRate float32 `json:"usageRate"` - UsingRate float32 `json:"usingRate"` - ApiDelay string `json:"apiDelay"` - SchedulerTimes int `json:"schedulerTimes"` - SchedulerErr int `json:"schedulerErr"` - ApiTimes string `json:"apiTimes"` - CenterCount int `json:"centerCount"` - ComputingPower float64 `json:"computingPower"` - ClusterCount int `json:"clusterCount"` - RunningCount int `json:"runningCount"` - CardCount int `json:"cardCount"` - RunningTime int `json:"runningTime"` + StorageUsed float32 `json:"storageUsed"` + StorageUsing float32 `json:"storageUsing"` + UsageRate float32 `json:"usageRate"` + UsingRate float32 `json:"usingRate"` + ApiDelay string `json:"apiDelay"` + SchedulerTimes int `json:"schedulerTimes"` + SchedulerErr int `json:"schedulerErr"` + ApiTimes string `json:"apiTimes"` + CenterCount int `json:"centerCount"` + ComputingPower float64 `json:"computingPower"` + ClusterCount int `json:"clusterCount"` + RunningCount int `json:"runningCount"` + CardCount int `json:"cardCount"` + RunningTime int `json:"runningTime"` } type ( - cpResp { - POpsAtFp16 float32 `json:"pOpsAtFp16"` - } + cpResp { + POpsAtFp16 float32 `json:"pOpsAtFp16"` + } - GiResp { - CpuNum int32 `json:"cpuNum,optional"` - MemoryInGib int32 `json:"memoryInGib,optional"` - StorageInGib int32 `json:"storageInGib,optional"` - } + GiResp { + CpuNum int32 `json:"cpuNum,optional"` + MemoryInGib int32 `json:"memoryInGib,optional"` + StorageInGib int32 `json:"storageInGib,optional"` + } ) type ( - DomainResourceResp { - TotalCount int `json:"totalCount"` - DomainResourceList []DomainResource `json:"domainResourceList"` - } - DomainResource { - Id int64 `json:"id"` // id - DomainId string `json:"domainId"` // 资源域id - DomainName string `json:"domainName"` // 资源域名称 - JobCount int64 `json:"jobCount"` // 资源域任务数量 - DomainSource int64 `json:"domainSource"` // 资源域数据来源:0-nudt,1-鹏城 - Stack string `json:"stack"` // 技术栈 - ResourceType string `json:"resourceType"` // 资源类型 - Cpu float64 `json:"cpu"` // cpu使用率 - Memory float64 `json:"memory"` // 内存使用率 - Disk float64 `json:"disk"` // 存储使用率 - NodeCount float64 `json:"nodeCount"` //节点使用率 - // DeleteFlag int64 `json:"delete_flag"` // 是否删除 0:未删除,1:已经删除 - Description string `json:"description"` //集群描述 - ClusterName string `json:"clusterName"` //集群名称 - CpuTotal float64 `json:"cpuTotal"` //cpu总核数 - MemoryTotal float64 `json:"memoryTotal"` //内存总量Gi - DiskTotal float64 `json:"diskTotal"` //存储总量GB - NodeTotal float64 `json:"nodeTotal"` //容器节点数 - CpuUsage float64 `json:"cpuUsage"` //cpu已使用核数 - MemoryUsage float64 `json:"memoryUsage"` //内存已使用Gi - DiskUsage float64 `json:"diskUsage"` //存储已使用GB - NodeUsage float64 `json:"nodeUsage"` //容器节点已使用 - } + DomainResourceResp { + TotalCount int `json:"totalCount"` + DomainResourceList []DomainResource `json:"domainResourceList"` + } + DomainResource { + Id int64 `json:"id"` // id + DomainId string `json:"domainId"` // 资源域id + DomainName string `json:"domainName"` // 资源域名称 + JobCount int64 `json:"jobCount"` // 资源域任务数量 + DomainSource int64 `json:"domainSource"` // 资源域数据来源:0-nudt,1-鹏城 + Stack string `json:"stack"` // 技术栈 + ResourceType string `json:"resourceType"` // 资源类型 + Cpu float64 `json:"cpu"` // cpu使用率 + Memory float64 `json:"memory"` // 内存使用率 + Disk float64 `json:"disk"` // 存储使用率 + NodeCount float64 `json:"nodeCount"` //节点使用率 + // DeleteFlag int64 `json:"delete_flag"` // 是否删除 0:未删除,1:已经删除 + Description string `json:"description"` //集群描述 + ClusterName string `json:"clusterName"` //集群名称 + CpuTotal float64 `json:"cpuTotal"` //cpu总核数 + MemoryTotal float64 `json:"memoryTotal"` //内存总量Gi + DiskTotal float64 `json:"diskTotal"` //存储总量GB + NodeTotal float64 `json:"nodeTotal"` //容器节点数 + CpuUsage float64 `json:"cpuUsage"` //cpu已使用核数 + MemoryUsage float64 `json:"memoryUsage"` //内存已使用Gi + DiskUsage float64 `json:"diskUsage"` //存储已使用GB + NodeUsage float64 `json:"nodeUsage"` //容器节点已使用 + } ) type ( - ResourcePanelConfigReq { - Id int64 `json:"id"` //id - Title string `json:"title"` //标题 - TitleColor string `json:"titleColor"` //标题色 - MainColor string `json:"mainColor"` //主色调 - MainColor2 string `json:"mainColor2"` //次主色调 - TextColor string `json:"textColor"` //文字颜色 - BackgroundColor string `json:"backgroundColor"` //背景底色 - Center string `json:"center"` //中心点 - CenterPosition string `json:"centerPosition"` //comment 中心点坐标 - ProvinceBgColor string `json:"provinceBgColor"` //三级地图底色 - StatusIng string `json:"statusIng"` //接入中图标 - StatusUn string `json:"statusUn"` //未接入图标 - StatusEnd string `json:"statusEnd"` //已接入图标 - TitleIcon string `json:"titleIcon"` //标题底图 - SubTitleIcon string `json:"subTitleIcon"` //小标题底图 - NumberBg string `json:"numberBg"` //数字底图 - TaskBg string `json:"taskBg"` //任务底图 - } + ResourcePanelConfigReq { + Id int64 `json:"id"` //id + Title string `json:"title"` //标题 + TitleColor string `json:"titleColor"` //标题色 + MainColor string `json:"mainColor"` //主色调 + MainColor2 string `json:"mainColor2"` //次主色调 + TextColor string `json:"textColor"` //文字颜色 + BackgroundColor string `json:"backgroundColor"` //背景底色 + Center string `json:"center"` //中心点 + CenterPosition string `json:"centerPosition"` //comment 中心点坐标 + ProvinceBgColor string `json:"provinceBgColor"` //三级地图底色 + StatusIng string `json:"statusIng"` //接入中图标 + StatusUn string `json:"statusUn"` //未接入图标 + StatusEnd string `json:"statusEnd"` //已接入图标 + TitleIcon string `json:"titleIcon"` //标题底图 + SubTitleIcon string `json:"subTitleIcon"` //小标题底图 + NumberBg string `json:"numberBg"` //数字底图 + TaskBg string `json:"taskBg"` //任务底图 + } - ResourcePanelConfigResp { - Id int64 `json:"id"` //id - Title string `json:"title"` //标题, - TitleColor string `json:"titleColor"` //标题色, - MainColor string `json:"mainColor"` //主色调, - MainColor2 string `json:"mainColor2"` //次主色调, - TextColor string `json:"textColor"` //文字颜色, - BackgroundColor string `json:"backgroundColor"` //背景底色, - Center string `json:"center"` //中心点, - CenterPosition string `json:"centerPosition"` //comment 中心点坐标, - ProvinceBgColor string `json:"provinceBgColor"` //三级地图底色, - StatusIng string `json:"statusIng"` //接入中图标, - StatusUn string `json:"statusUn"` //未接入图标, - StatusEnd string `json:"statusEnd"` //已接入图标, - TitleIcon string `json:"titleIcon"` //标题底图, - SubTitleIcon string `json:"subTitleIcon"` //小标题底图, - NumberBg string `json:"numberBg"` //数字底图, - TaskBg string `json:"taskBg"` //任务底图, - CreateTime string `json:"createTime"` //创建时间, - UpdateTime string `json:"updateTime"` //更新时间 - } + ResourcePanelConfigResp { + Id int64 `json:"id"` //id + Title string `json:"title"` //标题, + TitleColor string `json:"titleColor"` //标题色, + MainColor string `json:"mainColor"` //主色调, + MainColor2 string `json:"mainColor2"` //次主色调, + TextColor string `json:"textColor"` //文字颜色, + BackgroundColor string `json:"backgroundColor"` //背景底色, + Center string `json:"center"` //中心点, + CenterPosition string `json:"centerPosition"` //comment 中心点坐标, + ProvinceBgColor string `json:"provinceBgColor"` //三级地图底色, + StatusIng string `json:"statusIng"` //接入中图标, + StatusUn string `json:"statusUn"` //未接入图标, + StatusEnd string `json:"statusEnd"` //已接入图标, + TitleIcon string `json:"titleIcon"` //标题底图, + SubTitleIcon string `json:"subTitleIcon"` //小标题底图, + NumberBg string `json:"numberBg"` //数字底图, + TaskBg string `json:"taskBg"` //任务底图, + CreateTime string `json:"createTime"` //创建时间, + UpdateTime string `json:"updateTime"` //更新时间 + } ) type ( - ComputilityStatisticsResp { - Code int32 `json:"code,omitempty"` - Msg string `json:"msg,omitempty"` - ErrorMsg string `json:"ErrorMsg,omitempty"` - ComputilityStatistics ComputilityStatistics `json:"data"` //容器节点已使用 - } - ComputilityStatistics { - DomainSum int64 `json:"domainSum"` //域总数 - TotalComputility float64 `json:"totalComputility"` //算力总和 - ClusterNum int64 `json:"clusterNum"` //集群总数 - } + ComputilityStatisticsResp { + Code int32 `json:"code,omitempty"` + Msg string `json:"msg,omitempty"` + ErrorMsg string `json:"ErrorMsg,omitempty"` + ComputilityStatistics ComputilityStatistics `json:"data"` //容器节点已使用 + } + ComputilityStatistics { + DomainSum int64 `json:"domainSum"` //域总数 + TotalComputility float64 `json:"totalComputility"` //算力总和 + ClusterNum int64 `json:"clusterNum"` //集群总数 + } ) //jccSchedule容器集群资源监控 > start type NodeAssetsResp { - NodeAssets []NodeAsset `json:"nodeAssets"` + NodeAssets []NodeAsset `json:"nodeAssets"` } type NodeAsset { - Name string `json:"Name"` //租户名称 - NodeName string `json:"NodeName"` // 节点名称 - CpuTotal int64 `json:"CpuTotal"` // cpu核数 - CpuUsable float64 `json:"CpuUsable"` // cpu可用率 - DiskTotal int64 `json:"DiskTotal"` // 磁盘空间 - DiskAvail int64 `json:"DiskAvail"` // 磁盘可用空间 - MemTotal int64 `json:"MemTotal"` // 内存总数 - MemAvail int64 `json:"MemAvail"` // 内存可用数 - GpuTotal int64 `json:"GpuTotal"` // gpu总数 - GpuAvail int64 `json:"GpuAvail"` // gpu可用数 - ParticipantId int64 `json:"ParticipantId"` // 集群动态信息id + Name string `json:"Name"` //租户名称 + NodeName string `json:"NodeName"` // 节点名称 + CpuTotal int64 `json:"CpuTotal"` // cpu核数 + CpuUsable float64 `json:"CpuUsable"` // cpu可用率 + DiskTotal int64 `json:"DiskTotal"` // 磁盘空间 + DiskAvail int64 `json:"DiskAvail"` // 磁盘可用空间 + MemTotal int64 `json:"MemTotal"` // 内存总数 + MemAvail int64 `json:"MemAvail"` // 内存可用数 + GpuTotal int64 `json:"GpuTotal"` // gpu总数 + GpuAvail int64 `json:"GpuAvail"` // gpu可用数 + ParticipantId int64 `json:"ParticipantId"` // 集群动态信息id } type participantListResp { - Participants []Participant `json:"participants"` + Participants []Participant `json:"participants"` } type Participant { - Id int64 `json:"id"` - Name string `json:"name"` - Address string `json:"address"` - MetricsUrl string `json:"metricsUrl"` - TenantName string `json:"tenantName"` - TypeName string `json:"typeName"` + Id int64 `json:"id"` + Name string `json:"name"` + Address string `json:"address"` + MetricsUrl string `json:"metricsUrl"` + TenantName string `json:"tenantName"` + TypeName string `json:"typeName"` } // apps列表参数 type ( - AppListReq { - NsID string `form:"nsID"` - } - AppListResp { - Apps []App `json:"apps"` //应用列表 - } - Replica { - ClusterName string `json:"clusterName"` - Replica int32 `json:"replica"` - } - App { - Id int64 `json:"id,optional" db:"id"` - Name string `json:"name,optional"` - Status string `json:"status,optional"` - CreateTime string `json:"createTime,optional"` - MinReplicas string `json:"minReplicas,optional"` - MaxReplicas string `json:"maxReplicas,optional"` - AppLocations []AppLocation `json:"appLocations,optional"` - } - AppLocation { - ParticipantId string `json:"participantId,optional" db:"participant_id"` - ParticipantName string `json:"participantName,optional" db:"participant_name"` - Kind string `json:"kind,optional" db:"kind"` - } + AppListReq { + NsID string `form:"nsID"` + } + AppListResp { + Apps []App `json:"apps"` //应用列表 + } + Replica { + ClusterName string `json:"clusterName"` + Replica int32 `json:"replica"` + } + App { + Id int64 `json:"id,optional" db:"id"` + Name string `json:"name,optional"` + Status string `json:"status,optional"` + CreateTime string `json:"createTime,optional"` + MinReplicas string `json:"minReplicas,optional"` + MaxReplicas string `json:"maxReplicas,optional"` + AppLocations []AppLocation `json:"appLocations,optional"` + } + AppLocation { + ParticipantId string `json:"participantId,optional" db:"participant_id"` + ParticipantName string `json:"participantName,optional" db:"participant_name"` + Kind string `json:"kind,optional" db:"kind"` + } ) //apps 详情参数 type ( - AppDetailReq { - Name string `path:"appName"` - NsID string `form:"nsID"` - } - AppDetailResp { - CpuCores float64 `json:"cpuCores"` - CpuRate float64 `json:"cpuRate"` - CpuLimit float64 `json:"cpuLimit"` - GpuCores float64 `json:"gpuCores"` - GpuRate float64 `json:"gpuRate"` - GpuLimit float64 `json:"gpuLimit"` - MemoryTotal float64 `json:"memoryTotal"` - MemoryRate float64 `json:"memoryRate"` - MemoryLimit float64 `json:"memoryLimit"` - } + AppDetailReq { + Name string `path:"appName"` + NsID string `form:"nsID"` + } + AppDetailResp { + CpuCores float64 `json:"cpuCores"` + CpuRate float64 `json:"cpuRate"` + CpuLimit float64 `json:"cpuLimit"` + GpuCores float64 `json:"gpuCores"` + GpuRate float64 `json:"gpuRate"` + GpuLimit float64 `json:"gpuLimit"` + MemoryTotal float64 `json:"memoryTotal"` + MemoryRate float64 `json:"memoryRate"` + MemoryLimit float64 `json:"memoryLimit"` + } - AppTaskResp { - Data interface{} `json:"data"` - } + AppTaskResp { + Data interface{} `json:"data"` + } ) type ( - DeleteAppReq { - Name string `form:"name"` - NsID string `form:"nsID"` - } + DeleteAppReq { + Name string `form:"name"` + NsID string `form:"nsID"` + } - DeleteAppResp { - Code int `json:"code,omitempty"` - Msg string `json:"msg,omitempty"` - Data interface{} `json:"data,omitempty"` - } + DeleteAppResp { + Code int `json:"code,omitempty"` + Msg string `json:"msg,omitempty"` + Data interface{} `json:"data,omitempty"` + } - AppResp { - Code int `json:"code,omitempty"` - Msg string `json:"msg,omitempty"` - Data interface{} `json:"data,omitempty"` - } + AppResp { + Code int `json:"code,omitempty"` + Msg string `json:"msg,omitempty"` + Data interface{} `json:"data,omitempty"` + } ) type ( - AdapterQueryReq { - Id string `form:"id,optional" db:"id"` - Name string `form:"name,optional"` - Type string `form:"type,optional"` - ResourceType string `form:"resourceType,optional"` - Nickname string `form:"nickname,optional"` - Version string `form:"version,optional"` - Server string `form:"server,optional"` - PageInfo - } - AdapterRelationQueryReq { - Id string `form:"id,optional" db:"id"` - Name string `form:"name,optional"` - Type string `form:"type,optional"` - ResourceType string `form:"resourceType,optional"` - Nickname string `form:"nickname,optional"` - Version string `form:"version,optional"` - Server string `form:"server,optional"` - } - AdapterReq { - Id string `json:"id,optional" db:"id"` - Name string `json:"name,optional"` - Type string `json:"type,optional"` - ResourceType string `json:"resourceType,optional"` - Nickname string `json:"nickname,optional"` - Version string `json:"version,optional"` - Server string `json:"server,optional"` - } - AdapterCreateReq { - Id string `json:"id,optional" db:"id"` - Name string `json:"name"` - Type string `json:"type"` - ResourceType string `json:"resourceType"` - Nickname string `json:"nickname"` - Version string `json:"version"` - Server string `json:"server"` - } - AdapterDelReq { - Id string `form:"id,optional" db:"id"` - } - AdapterInfo { - Id string `json:"id,omitempty" db:"id"` - Name string `json:"name,omitempty" db:"name"` - Type string `json:"type,omitempty" db:"type"` - ResourceType string `json:"resourceType,omitempty" db:"resource_type"` - Nickname string `json:"nickname,omitempty" db:"nickname"` - Version string `json:"version,omitempty" db:"version"` - Server string `json:"server,omitempty" db:"server"` - CreateTime string `json:"createTime,omitempty" db:"create_time" gorm:"autoCreateTime"` - } - AdapterResp { - Id string `json:"id,omitempty" db:"id"` - Name string `json:"name,omitempty" db:"name"` - Type string `json:"type,omitempty" db:"type"` - ResourceType string `json:"resourceType,omitempty" db:"resource_type"` - Nickname string `json:"nickname,omitempty" db:"nickname"` - Version string `json:"version,omitempty" db:"version"` - Server string `json:"server,omitempty" db:"server"` - CreateTime string `json:"createTime,omitempty" db:"create_time" gorm:"autoCreateTime"` - } - AdapterListResp { - List []AdapterInfo `json:"list,omitempty"` - } - AdapterRelationResp { - List []*ClusterRelationInfo `json:"list,omitempty"` - } - AdapterRelation { - Id string `json:"id,omitempty" db:"id"` - Name string `json:"name,omitempty" db:"name"` - Type string `json:"type,omitempty" db:"type"` - ResourceType string `json:"resourceType" db:"resource_type"` - Nickname string `json:"nickname,omitempty" db:"nickname"` - Version string `json:"version,omitempty" db:"version"` - Server string `json:"server,omitempty" db:"server"` - CreateTime string `json:"createTime,omitempty" db:"create_time" gorm:"autoCreateTime"` - Clusters []*ClusterInfo `json:"clusters,omitempty"` - } + AdapterQueryReq { + Id string `form:"id,optional" db:"id"` + Name string `form:"name,optional"` + Type string `form:"type,optional"` + ResourceType string `form:"resourceType,optional"` + Nickname string `form:"nickname,optional"` + Version string `form:"version,optional"` + Server string `form:"server,optional"` + PageInfo + } + AdapterRelationQueryReq { + Id string `form:"id,optional" db:"id"` + Name string `form:"name,optional"` + Type string `form:"type,optional"` + ResourceType string `form:"resourceType,optional"` + Nickname string `form:"nickname,optional"` + Version string `form:"version,optional"` + Server string `form:"server,optional"` + } + AdapterReq { + Id string `json:"id,optional" db:"id"` + Name string `json:"name,optional"` + Type string `json:"type,optional"` + ResourceType string `json:"resourceType,optional"` + Nickname string `json:"nickname,optional"` + Version string `json:"version,optional"` + Server string `json:"server,optional"` + } + AdapterCreateReq { + Id string `json:"id,optional" db:"id"` + Name string `json:"name"` + Type string `json:"type"` + ResourceType string `json:"resourceType"` + Nickname string `json:"nickname"` + Version string `json:"version"` + Server string `json:"server"` + } + AdapterDelReq { + Id string `form:"id,optional" db:"id"` + } + AdapterInfo { + Id string `json:"id,omitempty" db:"id"` + Name string `json:"name,omitempty" db:"name"` + Type string `json:"type,omitempty" db:"type"` + ResourceType string `json:"resourceType,omitempty" db:"resource_type"` + Nickname string `json:"nickname,omitempty" db:"nickname"` + Version string `json:"version,omitempty" db:"version"` + Server string `json:"server,omitempty" db:"server"` + CreateTime string `json:"createTime,omitempty" db:"create_time" gorm:"autoCreateTime"` + } + AdapterResp { + Id string `json:"id,omitempty" db:"id"` + Name string `json:"name,omitempty" db:"name"` + Type string `json:"type,omitempty" db:"type"` + ResourceType string `json:"resourceType,omitempty" db:"resource_type"` + Nickname string `json:"nickname,omitempty" db:"nickname"` + Version string `json:"version,omitempty" db:"version"` + Server string `json:"server,omitempty" db:"server"` + CreateTime string `json:"createTime,omitempty" db:"create_time" gorm:"autoCreateTime"` + } + AdapterListResp { + List []AdapterInfo `json:"list,omitempty"` + } + AdapterRelationResp { + List []*ClusterRelationInfo `json:"list,omitempty"` + } + AdapterRelation { + Id string `json:"id,omitempty" db:"id"` + Name string `json:"name,omitempty" db:"name"` + Type string `json:"type,omitempty" db:"type"` + ResourceType string `json:"resourceType" db:"resource_type"` + Nickname string `json:"nickname,omitempty" db:"nickname"` + Version string `json:"version,omitempty" db:"version"` + Server string `json:"server,omitempty" db:"server"` + CreateTime string `json:"createTime,omitempty" db:"create_time" gorm:"autoCreateTime"` + Clusters []*ClusterInfo `json:"clusters,omitempty"` + } ) type ( - ClusterReq { - Id string `form:"id,optional"` - AdapterId string `form:"adapterId,optional"` - Name string `form:"name,optional"` - Nickname string `form:"nickname,optional"` - Description string `form:"description,optional"` - Server string `form:"server,optional"` - MonitorServer string `form:"monitorServer,optional"` - Username string `form:"username,optional"` - Password string `form:"password,optional"` - Token string `form:"token,optional"` - Ak string `form:"ak,optional"` - Sk string `form:"sk,optional"` - Region string `form:"region,optional"` - ProjectId string `form:"projectId,optional"` - Version string `form:"version,optional"` - Label string `form:"label,optional"` - OwnerId string `form:"ownerId,omitempty,optional"` - AuthType string `form:"authType,optional"` - Type string `form:"type,optional"` - ProducerDict string `form:"producerDict,optional"` - RegionDict string `form:"regionDict,optional"` - ResourceType string `form:"resourceType,optional"` - PageInfo - } + ClusterReq { + Id string `form:"id,optional"` + AdapterId string `form:"adapterId,optional"` + Name string `form:"name,optional"` + Nickname string `form:"nickname,optional"` + Description string `form:"description,optional"` + Server string `form:"server,optional"` + MonitorServer string `form:"monitorServer,optional"` + Username string `form:"username,optional"` + Password string `form:"password,optional"` + Token string `form:"token,optional"` + Ak string `form:"ak,optional"` + Sk string `form:"sk,optional"` + Region string `form:"region,optional"` + ProjectId string `form:"projectId,optional"` + Version string `form:"version,optional"` + Label string `form:"label,optional"` + OwnerId string `form:"ownerId,omitempty,optional"` + AuthType string `form:"authType,optional"` + Type string `form:"type,optional"` + ProducerDict string `form:"producerDict,optional"` + RegionDict string `form:"regionDict,optional"` + ResourceType string `form:"resourceType,optional"` + PageInfo + } - ClusterCreateReq { - Id string `json:"id,optional"` - AdapterId string `json:"adapterId,optional"` - Name string `json:"name,optional"` - Nickname string `json:"nickname,optional"` - Description string `json:"description,optional"` - Server string `json:"server,optional"` - MonitorServer string `json:"monitorServer,optional"` - Username string `json:"username,optional"` - Password string `json:"password,optional"` - Token string `json:"token,optional"` - Ak string `json:"ak,optional"` - Sk string `json:"sk,optional"` - Region []string `json:"region,optional"` - ProjectId string `json:"projectId,optional"` - Version string `json:"version,optional"` - Label string `json:"label,optional"` - OwnerId string `json:"ownerId,omitempty,optional"` - AuthType string `json:"authType,optional"` - ProducerDict string `json:"producerDict,optional"` - RegionDict string `json:"regionDict,optional"` - RegionName string `json:"regionName,optional"` - Environment map[string]string `json:"environment,optional"` - } - ClusterInfo { - Id string `json:"id,omitempty" db:"id"` - AdapterId string `json:"adapterId,omitempty" db:"adapter_id"` - Name string `json:"name,omitempty" db:"name"` - Nickname string `json:"nickname,omitempty" db:"nickname"` - Description string `json:"description,omitempty" db:"description"` - Server string `json:"server,omitempty" db:"server"` - MonitorServer string `json:"monitorServer,omitempty" db:"monitor_server"` - Username string `json:"username,omitempty" db:"username"` - Password string `json:"password,omitempty" db:"password"` - Token string `json:"token,omitempty" db:"token"` - Ak string `json:"ak,omitempty" db:"ak"` - Sk string `json:"sk,omitempty" db:"sk"` - Region string `json:"region,omitempty" db:"region"` - ProjectId string `json:"projectId,omitempty" db:"project_id"` - Version string `json:"version,omitempty" db:"version"` - Label string `json:"label,omitempty" db:"label"` - OwnerId string `json:"ownerId,omitempty" db:"owner_id"` - AuthType string `json:"authType,omitempty" db:"auth_type"` - ProducerDict string `json:"producerDict,omitempty" db:"producer_dict"` - RegionDict string `json:"regionDict,omitempty" db:"region_dict"` - Location string `json:"location,omitempty" db:"location"` - CreateTime string `json:"createTime,omitempty" db:"created_time" gorm:"autoCreateTime"` - Environment map[string]string `json:"environment,omitempty" db:"environment"` - } + ClusterCreateReq { + Id string `json:"id,optional"` + AdapterId string `json:"adapterId,optional"` + Name string `json:"name,optional"` + Nickname string `json:"nickname,optional"` + Description string `json:"description,optional"` + Server string `json:"server,optional"` + MonitorServer string `json:"monitorServer,optional"` + Username string `json:"username,optional"` + Password string `json:"password,optional"` + Token string `json:"token,optional"` + Ak string `json:"ak,optional"` + Sk string `json:"sk,optional"` + Region []string `json:"region,optional"` + ProjectId string `json:"projectId,optional"` + Version string `json:"version,optional"` + Label string `json:"label,optional"` + OwnerId string `json:"ownerId,omitempty,optional"` + AuthType string `json:"authType,optional"` + ProducerDict string `json:"producerDict,optional"` + RegionDict string `json:"regionDict,optional"` + RegionName string `json:"regionName,optional"` + Environment map[string]string `json:"environment,optional"` + } + ClusterInfo { + Id string `json:"id,omitempty" db:"id"` + AdapterId string `json:"adapterId,omitempty" db:"adapter_id"` + Name string `json:"name,omitempty" db:"name"` + Nickname string `json:"nickname,omitempty" db:"nickname"` + Description string `json:"description,omitempty" db:"description"` + Server string `json:"server,omitempty" db:"server"` + MonitorServer string `json:"monitorServer,omitempty" db:"monitor_server"` + Username string `json:"username,omitempty" db:"username"` + Password string `json:"password,omitempty" db:"password"` + Token string `json:"token,omitempty" db:"token"` + Ak string `json:"ak,omitempty" db:"ak"` + Sk string `json:"sk,omitempty" db:"sk"` + Region string `json:"region,omitempty" db:"region"` + ProjectId string `json:"projectId,omitempty" db:"project_id"` + Version string `json:"version,omitempty" db:"version"` + Label string `json:"label,omitempty" db:"label"` + OwnerId string `json:"ownerId,omitempty" db:"owner_id"` + AuthType string `json:"authType,omitempty" db:"auth_type"` + ProducerDict string `json:"producerDict,omitempty" db:"producer_dict"` + RegionDict string `json:"regionDict,omitempty" db:"region_dict"` + Location string `json:"location,omitempty" db:"location"` + CreateTime string `json:"createTime,omitempty" db:"created_time" gorm:"autoCreateTime"` + Environment map[string]string `json:"environment,omitempty" db:"environment"` + } ) type ClusterDelReq { - Id string `form:"id,optional"` + Id string `form:"id,optional"` } type ClusterResp { - List ClusterInfo `json:"list,omitempty"` + List ClusterInfo `json:"list,omitempty"` } type ClusterListResp { - List []ClusterInfo `json:"list,omitempty"` + List []ClusterInfo `json:"list,omitempty"` } type clusterSumReq { } type clusterSumReqResp { - PodSum int `json:"podSum,omitempty"` - VmSum int `json:"vmSum,omitempty"` - AdapterSum int `json:"AdapterSum,omitempty"` - TaskSum int `json:"TaskSum,omitempty"` + PodSum int `json:"podSum,omitempty"` + VmSum int `json:"vmSum,omitempty"` + AdapterSum int `json:"AdapterSum,omitempty"` + TaskSum int `json:"TaskSum,omitempty"` } type ClusterRelationInfo { - Id string `json:"id,omitempty" db:"id"` - Name string `json:"name,omitempty" db:"name"` - Type string `json:"type,omitempty" db:"type"` - Nickname string `json:"nickname,omitempty" db:"nickname"` - Version string `json:"version,omitempty" db:"version"` - Server string `json:"server,omitempty" db:"server"` - CreateTime string `json:"createTime,omitempty" db:"create_time" gorm:"autoCreateTime"` - CId string `json:"cId,omitempty" db:"id"` - CAdapterId string `json:"cAdapterId,omitempty" db:"adapter_id"` - CName string `json:"cName,omitempty" db:"name"` - CNickname string `json:"cNickname,omitempty" db:"nickname"` - CDescription string `json:"cDescription,omitempty" db:"description"` - CServer string `json:"cServer,omitempty" db:"server"` - CMonitorServer string `json:"cMonitorServer,omitempty" db:"monitor_server"` - CUsername string `json:"cUsername,omitempty" db:"username"` - CPassword string `json:"cPassword,omitempty" db:"password"` - CToken string `json:"cToken,omitempty" db:"token"` - CAk string `json:"cAk,omitempty" db:"ak"` - CSk string `json:"cSk,omitempty" db:"sk"` - CRegion string `json:"cRegion,omitempty" db:"region"` - CProjectId string `json:"cProjectId,omitempty" db:"project_id"` - CVersion string `json:"cVersion,omitempty" db:"version"` - CLabel string `json:"cLabel,omitempty" db:"label"` - COwnerId string `json:"cOwnerId,omitempty" db:"owner_id"` - CAuthType string `json:"cAuthType,omitempty" db:"auth_type"` - CRegionDict string `json:"cRegionDict,omitempty" db:"-"` - CProducerDict string `json:"cProducerDict,omitempty" db:"-"` - CCreateTime string `json:"cCreateTime,omitempty" db:"created_time" gorm:"autoCreateTime"` + Id string `json:"id,omitempty" db:"id"` + Name string `json:"name,omitempty" db:"name"` + Type string `json:"type,omitempty" db:"type"` + Nickname string `json:"nickname,omitempty" db:"nickname"` + Version string `json:"version,omitempty" db:"version"` + Server string `json:"server,omitempty" db:"server"` + CreateTime string `json:"createTime,omitempty" db:"create_time" gorm:"autoCreateTime"` + CId string `json:"cId,omitempty" db:"id"` + CAdapterId string `json:"cAdapterId,omitempty" db:"adapter_id"` + CName string `json:"cName,omitempty" db:"name"` + CNickname string `json:"cNickname,omitempty" db:"nickname"` + CDescription string `json:"cDescription,omitempty" db:"description"` + CServer string `json:"cServer,omitempty" db:"server"` + CMonitorServer string `json:"cMonitorServer,omitempty" db:"monitor_server"` + CUsername string `json:"cUsername,omitempty" db:"username"` + CPassword string `json:"cPassword,omitempty" db:"password"` + CToken string `json:"cToken,omitempty" db:"token"` + CAk string `json:"cAk,omitempty" db:"ak"` + CSk string `json:"cSk,omitempty" db:"sk"` + CRegion string `json:"cRegion,omitempty" db:"region"` + CProjectId string `json:"cProjectId,omitempty" db:"project_id"` + CVersion string `json:"cVersion,omitempty" db:"version"` + CLabel string `json:"cLabel,omitempty" db:"label"` + COwnerId string `json:"cOwnerId,omitempty" db:"owner_id"` + CAuthType string `json:"cAuthType,omitempty" db:"auth_type"` + CRegionDict string `json:"cRegionDict,omitempty" db:"-"` + CProducerDict string `json:"cProducerDict,omitempty" db:"-"` + CCreateTime string `json:"cCreateTime,omitempty" db:"created_time" gorm:"autoCreateTime"` } type ( - DictInfo { - Id string `json:"id,omitempty"` - DictName string `json:"dictName,omitempty"` - DictCode string `json:"dictCode,omitempty"` - Description string `json:"description,omitempty"` - Type string `json:"type,omitempty" db:"type"` - Status string `json:"status,omitempty" db:"status"` - CreateTime string `json:"createTime,omitempty" db:"created_time" gorm:"autoCreateTime"` - } + DictInfo { + Id string `json:"id,omitempty"` + DictName string `json:"dictName,omitempty"` + DictCode string `json:"dictCode,omitempty"` + Description string `json:"description,omitempty"` + Type string `json:"type,omitempty" db:"type"` + Status string `json:"status,omitempty" db:"status"` + CreateTime string `json:"createTime,omitempty" db:"created_time" gorm:"autoCreateTime"` + } - DictReq { - Id string `form:"id,optional"` - DictName string `form:"dictName,optional"` - DictCode string `form:"dictCode,optional"` - Description string `form:"description,optional"` - Type string `form:"type,optional"` - Status string `form:"status,optional"` - PageInfo - } + DictReq { + Id string `form:"id,optional"` + DictName string `form:"dictName,optional"` + DictCode string `form:"dictCode,optional"` + Description string `form:"description,optional"` + Type string `form:"type,optional"` + Status string `form:"status,optional"` + PageInfo + } - DictEditReq { - Id string `json:"id,optional"` - DictName string `json:"dictName,optional"` - DictCode string `json:"dictCode,optional"` - Description string `json:"description,optional"` - Type string `json:"type,optional"` - Status string `json:"status,optional"` - } + DictEditReq { + Id string `json:"id,optional"` + DictName string `json:"dictName,optional"` + DictCode string `json:"dictCode,optional"` + Description string `json:"description,optional"` + Type string `json:"type,optional"` + Status string `json:"status,optional"` + } - DictResp { - Id string `json:"id,omitempty"` - DictName string `json:"dictName,omitempty"` - DictCode string `json:"dictCode,omitempty"` - Description string `json:"description,omitempty"` - Type string `json:"type,omitempty"` - Status string `json:"status,omitempty"` - CreateTime string `json:"createTime,omitempty" db:"created_time" gorm:"autoCreateTime"` - DictItemInfo []*DictItemInfo `json:"dictItemInfo,omitempty"` - } + DictResp { + Id string `json:"id,omitempty"` + DictName string `json:"dictName,omitempty"` + DictCode string `json:"dictCode,omitempty"` + Description string `json:"description,omitempty"` + Type string `json:"type,omitempty"` + Status string `json:"status,omitempty"` + CreateTime string `json:"createTime,omitempty" db:"created_time" gorm:"autoCreateTime"` + DictItemInfo []*DictItemInfo `json:"dictItemInfo,omitempty"` + } - Dicts { - List []DictInfo `json:"list,omitempty"` - } + Dicts { + List []DictInfo `json:"list,omitempty"` + } - DictItemInfo { - Id string `json:"id,omitempty"` - DictId string `json:"dictId,omitempty"` - ItemText string `json:"itemText,omitempty"` - ItemValue string `json:"itemValue,omitempty"` - Description string `json:"description,omitempty"` - SortOrder string `json:"sortOrder,omitempty"` - ParentId string `json:"parentId,omitempty"` - Status string `json:"status,omitempty" db:"status"` - CreateTime string `json:"createTime,omitempty" db:"created_time" gorm:"autoCreateTime"` - Children []DictItemInfo `json:"children,omitempty" gorm:"-"` - } + DictItemInfo { + Id string `json:"id,omitempty"` + DictId string `json:"dictId,omitempty"` + ItemText string `json:"itemText,omitempty"` + ItemValue string `json:"itemValue,omitempty"` + Description string `json:"description,omitempty"` + SortOrder string `json:"sortOrder,omitempty"` + ParentId string `json:"parentId,omitempty"` + Status string `json:"status,omitempty" db:"status"` + CreateTime string `json:"createTime,omitempty" db:"created_time" gorm:"autoCreateTime"` + Children []DictItemInfo `json:"children,omitempty" gorm:"-"` + } - DictItemReq { - Id string `form:"id,optional"` - DictId string `form:"dictId,optional"` - ItemText string `form:"itemText,optional"` - ItemValue string `form:"itemValue,optional"` - Description string `form:"description,optional"` - SortOrder string `form:"sortOrder,optional"` - Type string `form:"type,optional"` - ParentId string `form:"parentId,optional"` - Status string `form:"status,optional"` - } + DictItemReq { + Id string `form:"id,optional"` + DictId string `form:"dictId,optional"` + ItemText string `form:"itemText,optional"` + ItemValue string `form:"itemValue,optional"` + Description string `form:"description,optional"` + SortOrder string `form:"sortOrder,optional"` + Type string `form:"type,optional"` + ParentId string `form:"parentId,optional"` + Status string `form:"status,optional"` + } - DictItemEditReq { - Id string `json:"id,optional"` - DictId string `json:"dictId,optional"` - ItemText string `json:"itemText,optional"` - ItemValue string `json:"itemValue,optional"` - Description string `json:"description,optional"` - SortOrder string `json:"sortOrder,optional"` - ParentId string `json:"parentId,optional"` - Status string `json:"status,optional"` - } + DictItemEditReq { + Id string `json:"id,optional"` + DictId string `json:"dictId,optional"` + ItemText string `json:"itemText,optional"` + ItemValue string `json:"itemValue,optional"` + Description string `json:"description,optional"` + SortOrder string `json:"sortOrder,optional"` + ParentId string `json:"parentId,optional"` + Status string `json:"status,optional"` + } - DictItemResp { - Id string `json:"id,omitempty"` - DictId string `json:"dictId,omitempty"` - ItemText string `json:"itemText,omitempty"` - ItemValue string `json:"itemValue,omitempty"` - Description string `json:"description,omitempty"` - SortOrder string `json:"sortOrder,omitempty"` - ParentId string `json:"parentId,omitempty"` - Status string `json:"status,omitempty"` - CreateTime string `json:"createTime,omitempty" db:"created_time" gorm:"autoCreateTime"` - DictInfo *DictInfo `json:"dictInfo,omitempty"` - } + DictItemResp { + Id string `json:"id,omitempty"` + DictId string `json:"dictId,omitempty"` + ItemText string `json:"itemText,omitempty"` + ItemValue string `json:"itemValue,omitempty"` + Description string `json:"description,omitempty"` + SortOrder string `json:"sortOrder,omitempty"` + ParentId string `json:"parentId,omitempty"` + Status string `json:"status,omitempty"` + CreateTime string `json:"createTime,omitempty" db:"created_time" gorm:"autoCreateTime"` + DictInfo *DictInfo `json:"dictInfo,omitempty"` + } - DictItems { - List []DictItemInfo `json:"list,omitempty"` - } + DictItems { + List []DictItemInfo `json:"list,omitempty"` + } - DictCodeReq { - DictCode string `path:"dictCode"` - } + DictCodeReq { + DictCode string `path:"dictCode"` + } ) type ( - CId { - Id string `path:"id":"id,omitempty" validate:"required"` - } + CId { + Id string `path:"id":"id,omitempty" validate:"required"` + } - CIds { - Ids []string `json:"ids,omitempty" validate:"required"` - } + CIds { + Ids []string `json:"ids,omitempty" validate:"required"` + } - FId { - Id string `form:"id":"id,omitempty" validate:"required"` - } + FId { + Id string `form:"id":"id,omitempty" validate:"required"` + } ) type ( - PageInfo { - PageNum int `form:"pageNum"` - PageSize int `form:"pageSize"` - } + PageInfo { + PageNum int `form:"pageNum"` + PageSize int `form:"pageSize"` + } - PageResult { - List interface{} `json:"list,omitempty"` - Total int64 `json:"total,omitempty"` - PageNum int `json:"pageNum,omitempty"` - PageSize int `json:"pageSize,omitempty"` - } - ListResult{ - List interface{} `json:"list,omitempty"` - } + PageResult { + List interface{} `json:"list,omitempty"` + Total int64 `json:"total,omitempty"` + PageNum int `json:"pageNum,omitempty"` + PageSize int `json:"pageSize,omitempty"` + } + ListResult { + List interface{} `json:"list,omitempty"` + } ) type ( - HpcInfo { - Id int64 `json:"id"` // id - TaskId int64 `json:"task_id"` // 任务id - JobId string `json:"job_id"` // 作业id(在第三方系统中的作业id) - AdapterId int64 `json:"adapter_id"` // 执行任务的适配器id - ClusterId int64 `json:"cluster_id"` // 执行任务的集群id - ClusterType string `json:"cluster_type"` // 执行任务的集群类型 - Name string `json:"name"` // 名称 - Status string `json:"status"` // 状态 - CmdScript string `json:"cmd_script"` - StartTime string `json:"start_time"` // 开始时间 - RunningTime int64 `json:"running_time"` // 运行时间 - DerivedEs string `json:"derived_es"` - Cluster string `json:"cluster"` - BlockId int64 `json:"block_id"` - AllocNodes int64 `json:"alloc_nodes"` - AllocCpu int64 `json:"alloc_cpu"` - CardCount int64 `json:"card_count"` // 卡数 - Version string `json:"version"` - Account string `json:"account"` - WorkDir string `json:"work_dir"` // 工作路径 - AssocId int64 `json:"assoc_id"` - ExitCode int64 `json:"exit_code"` - WallTime string `json:"wall_time"` // 最大运行时间 - Result string `json:"result"` // 运行结果 - DeletedAt string `json:"deleted_at"` // 删除时间 - YamlString string `json:"yaml_string"` - AppType string `json:"app_type"` // 应用类型 - AppName string `json:"app_name"` // 应用名称 - Queue string `json:"queue"` // 队列名称 - SubmitType string `json:"submit_type"` // cmd(命令行模式) - NNode string `json:"n_node"` // 节点个数(当指定该参数时,GAP_NODE_STRING必须为"") - StdOutFile string `json:"std_out_file"` // 工作路径/std.err.%j - StdErrFile string `json:"std_err_file"` // 工作路径/std.err.%j - StdInput string `json:"std_input"` - Environment string `json:"environment"` - DeletedFlag int64 `json:"deleted_flag"` // 是否删除(0-否,1-是) - CreatedBy int64 `json:"created_by"` // 创建人 - CreateTime string `json:"created_time"` // 创建时间 - UpdatedBy int64 `json:"updated_by"` // 更新人 - UpdateTime string `json:"updated_time"` // 更新时间 - } + HpcInfo { + Id int64 `json:"id"` // id + TaskId int64 `json:"task_id"` // 任务id + JobId string `json:"job_id"` // 作业id(在第三方系统中的作业id) + AdapterId int64 `json:"adapter_id"` // 执行任务的适配器id + ClusterId int64 `json:"cluster_id"` // 执行任务的集群id + ClusterType string `json:"cluster_type"` // 执行任务的集群类型 + Name string `json:"name"` // 名称 + Status string `json:"status"` // 状态 + CmdScript string `json:"cmd_script"` + StartTime string `json:"start_time"` // 开始时间 + RunningTime int64 `json:"running_time"` // 运行时间 + DerivedEs string `json:"derived_es"` + Cluster string `json:"cluster"` + BlockId int64 `json:"block_id"` + AllocNodes int64 `json:"alloc_nodes"` + AllocCpu int64 `json:"alloc_cpu"` + CardCount int64 `json:"card_count"` // 卡数 + Version string `json:"version"` + Account string `json:"account"` + WorkDir string `json:"work_dir"` // 工作路径 + AssocId int64 `json:"assoc_id"` + ExitCode int64 `json:"exit_code"` + WallTime string `json:"wall_time"` // 最大运行时间 + Result string `json:"result"` // 运行结果 + DeletedAt string `json:"deleted_at"` // 删除时间 + YamlString string `json:"yaml_string"` + AppType string `json:"app_type"` // 应用类型 + AppName string `json:"app_name"` // 应用名称 + Queue string `json:"queue"` // 队列名称 + SubmitType string `json:"submit_type"` // cmd(命令行模式) + NNode string `json:"n_node"` // 节点个数(当指定该参数时,GAP_NODE_STRING必须为"") + StdOutFile string `json:"std_out_file"` // 工作路径/std.err.%j + StdErrFile string `json:"std_err_file"` // 工作路径/std.err.%j + StdInput string `json:"std_input"` + Environment string `json:"environment"` + DeletedFlag int64 `json:"deleted_flag"` // 是否删除(0-否,1-是) + CreatedBy int64 `json:"created_by"` // 创建人 + CreateTime string `json:"created_time"` // 创建时间 + UpdatedBy int64 `json:"updated_by"` // 更新人 + UpdateTime string `json:"updated_time"` // 更新时间 + } - CloudInfo { - Participant int64 `json:"participant,omitempty"` - Id int64 `json:"id,omitempty"` - TaskId int64 `json:"taskId,omitempty"` - ApiVersion string `json:"apiVersion,omitempty"` - Kind string `json:"kind,omitempty"` - Namespace string `json:"namespace,omitempty"` - Name string `json:"name,omitempty"` - Status string `json:"status,omitempty"` - StartTime string `json:"startTime,omitempty"` - RunningTime int64 `json:"runningTime,omitempty"` - Result string `json:"result,omitempty"` - YamlString string `json:"yamlString,omitempty"` - } + CloudInfo { + Participant int64 `json:"participant,omitempty"` + Id int64 `json:"id,omitempty"` + TaskId int64 `json:"taskId,omitempty"` + ApiVersion string `json:"apiVersion,omitempty"` + Kind string `json:"kind,omitempty"` + Namespace string `json:"namespace,omitempty"` + Name string `json:"name,omitempty"` + Status string `json:"status,omitempty"` + StartTime string `json:"startTime,omitempty"` + RunningTime int64 `json:"runningTime,omitempty"` + Result string `json:"result,omitempty"` + YamlString string `json:"yamlString,omitempty"` + } - AiInfo { - ParticipantId int64 `json:"participantId,omitempty"` - TaskId int64 `json:"taskId,omitempty"` - ProjectId string `json:"project_id,omitempty"` - Name string `json:"name,omitempty"` - Status string `json:"status,omitempty"` - StartTime string `json:"startTime,omitempty"` - RunningTime int64 `json:"runningTime,omitempty"` - Result string `json:"result,omitempty"` - JobId string `json:"jobId,omitempty"` - CreateTime string `json:"createTime,omitempty"` - ImageUrl string `json:"imageUrl,omitempty"` - Command string `json:"command,omitempty"` - FlavorId string `json:"flavorId,omitempty"` - SubscriptionId string `json:"subscriptionId,omitempty"` - ItemVersionId string `json:"itemVersionId,omitempty"` - } + AiInfo { + ParticipantId int64 `json:"participantId,omitempty"` + TaskId int64 `json:"taskId,omitempty"` + ProjectId string `json:"project_id,omitempty"` + Name string `json:"name,omitempty"` + Status string `json:"status,omitempty"` + StartTime string `json:"startTime,omitempty"` + RunningTime int64 `json:"runningTime,omitempty"` + Result string `json:"result,omitempty"` + JobId string `json:"jobId,omitempty"` + CreateTime string `json:"createTime,omitempty"` + ImageUrl string `json:"imageUrl,omitempty"` + Command string `json:"command,omitempty"` + FlavorId string `json:"flavorId,omitempty"` + SubscriptionId string `json:"subscriptionId,omitempty"` + ItemVersionId string `json:"itemVersionId,omitempty"` + } - VmInfo { - ParticipantId int64 `json:"participantId,omitempty"` - TaskId int64 `json:"taskId,omitempty"` - Name string `json:"name,omitempty"` - FlavorRef string `json:"flavor_ref,omitempty"` - ImageRef string `json:"image_ref,omitempty"` - NetworkUuid string `json:"network_uuid,omitempty"` - BlockUuid string `json:"block_uuid,omitempty"` - SourceType string `json:"source_type,omitempty"` - DeleteOnTermination bool `json:"delete_on_termination,omitempty"` - Status string `json:"status,omitempty"` - MinCount string `json:"min_count,omitempty"` - Platform string `json:"platform,omitempty"` - Uuid string `json:"uuid,omitempty"` - } + VmInfo { + ParticipantId int64 `json:"participantId,omitempty"` + TaskId int64 `json:"taskId,omitempty"` + Name string `json:"name,omitempty"` + FlavorRef string `json:"flavor_ref,omitempty"` + ImageRef string `json:"image_ref,omitempty"` + NetworkUuid string `json:"network_uuid,omitempty"` + BlockUuid string `json:"block_uuid,omitempty"` + SourceType string `json:"source_type,omitempty"` + DeleteOnTermination bool `json:"delete_on_termination,omitempty"` + Status string `json:"status,omitempty"` + MinCount string `json:"min_count,omitempty"` + Platform string `json:"platform,omitempty"` + Uuid string `json:"uuid,omitempty"` + } ) type ( - PullTaskInfoReq { - AdapterId int64 `form:"adapterId"` - } + PullTaskInfoReq { + AdapterId int64 `form:"adapterId"` + } - PullTaskInfoResp { - HpcInfoList []*HpcInfo `json:"HpcInfoList,omitempty"` - CloudInfoList []*CloudInfo `json:"CloudInfoList,omitempty"` - AiInfoList []*AiInfo `json:"AiInfoList,omitempty"` - VmInfoList []*VmInfo `json:"VmInfoList,omitempty"` - } + PullTaskInfoResp { + HpcInfoList []*HpcInfo `json:"HpcInfoList,omitempty"` + CloudInfoList []*CloudInfo `json:"CloudInfoList,omitempty"` + AiInfoList []*AiInfo `json:"AiInfoList,omitempty"` + VmInfoList []*VmInfo `json:"VmInfoList,omitempty"` + } ) type ( - PushTaskInfoReq { - AdapterId int64 `json:"adapterId"` - HpcInfoList []*HpcInfo `json:"hpcInfoList"` - CloudInfoList []*CloudInfo `json:"cloudInfoList"` - AiInfoList []*AiInfo `json:"aiInfoList"` - VmInfoList []*VmInfo `json:"vmInfoList"` - } + PushTaskInfoReq { + AdapterId int64 `json:"adapterId"` + HpcInfoList []*HpcInfo `json:"hpcInfoList"` + CloudInfoList []*CloudInfo `json:"cloudInfoList"` + AiInfoList []*AiInfo `json:"aiInfoList"` + VmInfoList []*VmInfo `json:"vmInfoList"` + } - PushTaskInfoResp { - Code int64 `json:"code"` - Msg string `json:"msg"` - } + PushTaskInfoResp { + Code int64 `json:"code"` + Msg string `json:"msg"` + } ) type ( - PushResourceInfoReq { - AdapterId int64 `json:"adapterId"` - ResourceStats []ResourceStats `json:"resourceStats"` - } + PushResourceInfoReq { + AdapterId int64 `json:"adapterId"` + ResourceStats []ResourceStats `json:"resourceStats"` + } - PushResourceInfoResp { - Code int64 `json:"code"` - Msg string `json:"msg"` - } + PushResourceInfoResp { + Code int64 `json:"code"` + Msg string `json:"msg"` + } ) type ( - NoticeInfo { - AdapterId int64 `json:"adapterId"` - AdapterName string `json:"adapterName"` - ClusterId int64 `json:"clusterId"` - ClusterName string `json:"clusterName"` - NoticeType string `json:"noticeType"` - TaskName string `json:"taskName"` - Incident string `json:"incident"` - } - ListNoticeReq {} + NoticeInfo { + AdapterId int64 `json:"adapterId"` + AdapterName string `json:"adapterName"` + ClusterId int64 `json:"clusterId"` + ClusterName string `json:"clusterName"` + NoticeType string `json:"noticeType"` + TaskName string `json:"taskName"` + Incident string `json:"incident"` + } + ListNoticeReq{ + } - ListNoticeResp { - Code int64 `json:"code"` - Msg string `json:"msg"` - Data []NoticeInfo `json:"data"` - } + ListNoticeResp { + Code int64 `json:"code"` + Msg string `json:"msg"` + Data []NoticeInfo `json:"data"` + } - PushNoticeReq { - NoticeInfo NoticeInfo `json:"noticeInfo"` - } + PushNoticeReq { + NoticeInfo NoticeInfo `json:"noticeInfo"` + } - PushNoticeResp { - Code int64 `json:"code"` - Msg string `json:"msg"` - } + PushNoticeResp { + Code int64 `json:"code"` + Msg string `json:"msg"` + } ) type ResourceStats { - ClusterId int64 `json:"clusterId"` - Name string `json:"name"` - CpuCoreAvail int64 `json:"cpuCoreAvail"` - CpuCoreTotal int64 `json:"cpuCoreTotal"` - MemAvail float64 `json:"memAvail"` - MemTotal float64 `json:"memTotal"` - DiskAvail float64 `json:"diskAvail"` - DiskTotal float64 `json:"diskTotal"` - GpuAvail int64 `json:"gpuAvail"` - CardsAvail []*Card `json:"cardsAvail"` - CpuCoreHours float64 `json:"cpuCoreHours"` - Balance float64 `json:"balance"` + ClusterId int64 `json:"clusterId"` + Name string `json:"name"` + CpuCoreAvail int64 `json:"cpuCoreAvail"` + CpuCoreTotal int64 `json:"cpuCoreTotal"` + MemAvail float64 `json:"memAvail"` + MemTotal float64 `json:"memTotal"` + DiskAvail float64 `json:"diskAvail"` + DiskTotal float64 `json:"diskTotal"` + GpuAvail int64 `json:"gpuAvail"` + CardsAvail []*Card `json:"cardsAvail"` + CpuCoreHours float64 `json:"cpuCoreHours"` + Balance float64 `json:"balance"` } type Card { - Platform string `json:"platform"` - Type string `json:"type"` - Name string `json:"name"` - TOpsAtFp16 float64 `json:"TOpsAtFp16"` - CardHours float64 `json:"cardHours"` - CardNum int32 `json:"cardNum"` + Platform string `json:"platform"` + Type string `json:"type"` + Name string `json:"name"` + TOpsAtFp16 float64 `json:"TOpsAtFp16"` + CardHours float64 `json:"cardHours"` + CardNum int32 `json:"cardNum"` } type TaskStatusResp { - Succeeded int `json:"Succeeded"` - Failed int `json:"Failed"` - Running int `json:"Running"` - Saved int `json:"Saved"` + Succeeded int `json:"Succeeded"` + Failed int `json:"Failed"` + Running int `json:"Running"` + Saved int `json:"Saved"` } type ( - TaskDetailsResp { - Name string `json:"name"` - description string `json:"description"` - StartTime string `json:"startTime"` - EndTime string `json:"endTime"` - Strategy int64 `json:"strategy"` - SynergyStatus int64 `json:"synergyStatus"` - ClusterInfos []*ClusterInfo `json:"clusterInfos"` - SubTaskInfos []*SubTaskInfo `json:"subTaskInfos"` - TaskTypeDict string `json:"taskTypeDict"` - AdapterTypeDict string `json:"adapterTypeDict"` - } + TaskDetailsResp { + Name string `json:"name"` + description string `json:"description"` + StartTime string `json:"startTime"` + EndTime string `json:"endTime"` + Strategy int64 `json:"strategy"` + SynergyStatus int64 `json:"synergyStatus"` + ClusterInfos []*ClusterInfo `json:"clusterInfos"` + SubTaskInfos []*SubTaskInfo `json:"subTaskInfos"` + TaskTypeDict string `json:"taskTypeDict"` + AdapterTypeDict string `json:"adapterTypeDict"` + } - SubTaskInfo{ - Id string `json:"id" db:"id"` - Name string `json:"name" db:"name"` - ClusterId string `json:"clusterId" db:"cluster_id"` - ClusterName string `json:"clusterName" db:"cluster_name"` - Status string `json:"status" db:"status"` - Remark string `json:"remark" db:"remark"` - InferUrl string `json:"inferUrl"` - } + SubTaskInfo { + Id string `json:"id" db:"id"` + Name string `json:"name" db:"name"` + ClusterId string `json:"clusterId" db:"cluster_id"` + ClusterName string `json:"clusterName" db:"cluster_name"` + Status string `json:"status" db:"status"` + Remark string `json:"remark" db:"remark"` + InferUrl string `json:"inferUrl"` + } ) type ( - CommonResp { - Code int `json:"code,omitempty"` - Msg string `json:"msg,omitempty"` - Data interface{} `json:"data,omitempty"` - } + CommonResp { + Code int `json:"code,omitempty"` + Msg string `json:"msg,omitempty"` + Data interface{} `json:"data,omitempty"` + } ) \ No newline at end of file diff --git a/desc/hpc/pcm-hpc.api b/desc/hpc/pcm-hpc.api index 36b3e350..ae66c763 100644 --- a/desc/hpc/pcm-hpc.api +++ b/desc/hpc/pcm-hpc.api @@ -10,12 +10,13 @@ info( type ( commitHpcTaskReq { - Name string `json:"name"` // paratera:jobName - Account string `json:"account,optional"` + ClusterId int64 `json:"clusterId,optional"` + Name string `json:"name"` + Account string `json:"account,optional"` Description string `json:"description,optional"` TenantId int64 `json:"tenantId,optional"` TaskId int64 `json:"taskId,optional"` - AdapterIds []string `json:"adapterIds"` + AdapterIds []string `json:"adapterIds,optional"` MatchLabels map[string]string `json:"matchLabels,optional"` CardCount int64 `json:"cardCount,optional"` WorkDir string `json:"workDir,optional"` //paratera:workingDir diff --git a/desc/pcm.api b/desc/pcm.api index a290e399..9e3e7054 100644 --- a/desc/pcm.api +++ b/desc/pcm.api @@ -166,6 +166,10 @@ service pcm { @doc "screen" @handler getScreenChartHandler get /core/getScreenChart returns (ScreenChartResp) + + @doc "根据集群id获取集群信息" + @handler getClusterByIdHandler + get /core/getClusterById (getClusterByIdReq)returns (getClusterByIdResp) } //hpc二级接口 diff --git a/go.mod b/go.mod index ff69f054..9714bf04 100644 --- a/go.mod +++ b/go.mod @@ -24,6 +24,7 @@ require ( gitlink.org.cn/JointCloud/pcm-openstack v0.0.0-20240403033338-e7edabad4203 gitlink.org.cn/JointCloud/pcm-slurm v0.0.0-20240301080743-8b94bbaf57f5 gitlink.org.cn/jcce-pcm/pcm-participant-ceph v0.0.0-20230904090036-24fc730ec87d + gitlink.org.cn/jcce-pcm/utils v0.0.1 go.opentelemetry.io/otel/trace v1.30.0 gonum.org/v1/gonum v0.11.0 google.golang.org/grpc v1.66.2 diff --git a/go.sum b/go.sum index 620dd342..49d6c8a1 100644 --- a/go.sum +++ b/go.sum @@ -478,6 +478,8 @@ gitlink.org.cn/JointCloud/pcm-slurm v0.0.0-20240301080743-8b94bbaf57f5 h1:+/5vnz gitlink.org.cn/JointCloud/pcm-slurm v0.0.0-20240301080743-8b94bbaf57f5/go.mod h1:97AlUXN13g9UN3+9/DzCHpeoU5sbdyv0IQuTEHNexzQ= gitlink.org.cn/jcce-pcm/pcm-participant-ceph v0.0.0-20230904090036-24fc730ec87d h1:DHjl/rLuH2gKYtY0MKMGNQDHFT12APg25RlMUQo+tHk= gitlink.org.cn/jcce-pcm/pcm-participant-ceph v0.0.0-20230904090036-24fc730ec87d/go.mod h1:r/KLzUpupCV5jdxSfgDhc2pVjP0fBi3VhAWRttsBn30= +gitlink.org.cn/jcce-pcm/utils v0.0.1 h1:3PH93Z/JFTH5JRO9MFf3dD1Gnd12aGiIIViWBlQGuhE= +gitlink.org.cn/jcce-pcm/utils v0.0.1/go.mod h1:5cwaaqM0+HK5GXVbYozGlWvgwoUby0KytdvhbwQW1ks= go.etcd.io/etcd/api/v3 v3.5.16 h1:WvmyJVbjWqK4R1E+B12RRHz3bRGy9XVfh++MgbN+6n0= go.etcd.io/etcd/api/v3 v3.5.16/go.mod h1:1P4SlIP/VwkDmGo3OlOD7faPeP8KDIFhqvciH5EfN28= go.etcd.io/etcd/client/pkg/v3 v3.5.16 h1:ZgY48uH6UvB+/7R9Yf4x574uCO3jIx0TRDyetSfId3Q= diff --git a/internal/handler/cloud/clusterinfohandler.go b/internal/handler/cloud/clusterinfohandler.go deleted file mode 100644 index 1838a89b..00000000 --- a/internal/handler/cloud/clusterinfohandler.go +++ /dev/null @@ -1,25 +0,0 @@ -package cloud - -import ( - "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/internal/logic/cloud" - "gitlink.org.cn/JointCloud/pcm-coordinator/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/internal/types" -) - -func ClusterInfoHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ClusterInfoReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := cloud.NewClusterInfoLogic(r.Context(), svcCtx) - resp, err := l.ClusterInfo(&req) - result.HttpResult(r, w, resp, err) - } -} diff --git a/internal/handler/core/getclusterbyidhandler.go b/internal/handler/core/getclusterbyidhandler.go new file mode 100644 index 00000000..45a0a80d --- /dev/null +++ b/internal/handler/core/getclusterbyidhandler.go @@ -0,0 +1,28 @@ +package core + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/internal/logic/core" + "gitlink.org.cn/JointCloud/pcm-coordinator/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/internal/types" +) + +func GetClusterByIdHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.GetClusterByIdReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := core.NewGetClusterByIdLogic(r.Context(), svcCtx) + resp, err := l.GetClusterById(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/internal/handler/routes.go b/internal/handler/routes.go index eab19fdb..0891a8f8 100644 --- a/internal/handler/routes.go +++ b/internal/handler/routes.go @@ -199,6 +199,11 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { Path: "/core/getScreenChart", Handler: core.GetScreenChartHandler(serverCtx), }, + { + Method: http.MethodGet, + Path: "/core/getClusterById", + Handler: core.GetClusterByIdHandler(serverCtx), + }, }, rest.WithPrefix("/pcm/v1"), ) diff --git a/internal/logic/cloud/clusterinfologic.go b/internal/logic/cloud/clusterinfologic.go deleted file mode 100644 index c926d8e5..00000000 --- a/internal/logic/cloud/clusterinfologic.go +++ /dev/null @@ -1,30 +0,0 @@ -package cloud - -import ( - "context" - - "gitlink.org.cn/JointCloud/pcm-coordinator/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/internal/types" - - "github.com/zeromicro/go-zero/core/logx" -) - -type ClusterInfoLogic struct { - logx.Logger - ctx context.Context - svcCtx *svc.ServiceContext -} - -func NewClusterInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ClusterInfoLogic { - return &ClusterInfoLogic{ - Logger: logx.WithContext(ctx), - ctx: ctx, - svcCtx: svcCtx, - } -} - -func (l *ClusterInfoLogic) ClusterInfo(req *types.ClusterInfoReq) (resp *types.ClusterInfoResp, err error) { - // todo: add your logic here and delete this line - - return -} diff --git a/internal/logic/core/getclusterbyidlogic.go b/internal/logic/core/getclusterbyidlogic.go new file mode 100644 index 00000000..d622f5da --- /dev/null +++ b/internal/logic/core/getclusterbyidlogic.go @@ -0,0 +1,35 @@ +package core + +import ( + "context" + "github.com/pkg/errors" + + "gitlink.org.cn/JointCloud/pcm-coordinator/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type GetClusterByIdLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewGetClusterByIdLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetClusterByIdLogic { + return &GetClusterByIdLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *GetClusterByIdLogic) GetClusterById(req *types.GetClusterByIdReq) (resp *types.GetClusterByIdResp, err error) { + resp = &types.GetClusterByIdResp{} + tx := l.svcCtx.DbEngin.Raw("select * from t_cluster where id = ?", req.ClusterId).Scan(&resp) + if tx.Error != nil { + logx.Errorf(tx.Error.Error()) + return nil, errors.New("cluster create failed") + } + return resp, nil +} diff --git a/internal/logic/hpc/commithpctasklogic.go b/internal/logic/hpc/commithpctasklogic.go index 9edd9665..db06e78d 100644 --- a/internal/logic/hpc/commithpctasklogic.go +++ b/internal/logic/hpc/commithpctasklogic.go @@ -4,7 +4,6 @@ import ( "context" "errors" clientCore "gitlink.org.cn/JointCloud/pcm-coordinator/client" - "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/constants" "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/models" "k8s.io/apimachinery/pkg/util/json" "math/rand" @@ -36,10 +35,6 @@ func (l *CommitHpcTaskLogic) CommitHpcTask(req *types.CommitHpcTaskReq) (resp *t taskModel := models.Task{ Name: req.Name, Description: req.Description, - Status: constants.Saved, - Strategy: 0, - SynergyStatus: 0, - CommitTime: time.Now(), AdapterTypeDict: "2", } @@ -76,7 +71,6 @@ func (l *CommitHpcTaskLogic) CommitHpcTask(req *types.CommitHpcTaskReq) (resp *t ClusterId: uint(clusterId), ClusterName: clusterName, Name: taskModel.Name, - Status: "Saved", CmdScript: req.CmdScript, StartTime: time.Now().String(), CardCount: req.CardCount, @@ -92,11 +86,6 @@ func (l *CommitHpcTaskLogic) CommitHpcTask(req *types.CommitHpcTaskReq) (resp *t StdErrFile: req.StdErrFile, StdInput: req.StdInput, Partition: req.Partition, - DeletedFlag: 0, - CreatedBy: 0, - CreatedTime: time.Now(), - UpdatedBy: 0, - UpdatedTime: time.Now(), Environment: string(env), } @@ -112,7 +101,6 @@ func (l *CommitHpcTaskLogic) CommitHpcTask(req *types.CommitHpcTaskReq) (resp *t NoticeType: "create", TaskName: req.Name, Incident: "任务创建中", - CreatedTime: time.Now(), } result := l.svcCtx.DbEngin.Table("t_notice").Create(¬iceInfo) if result.Error != nil { diff --git a/internal/types/types.go b/internal/types/types.go index 2b93206e..21579b4b 100644 --- a/internal/types/types.go +++ b/internal/types/types.go @@ -456,6 +456,14 @@ type ScreenChartResp struct { CenterName string `json:"centerName"` } +type GetClusterByIdReq struct { + ClusterId int32 `path:"clusterId"` +} + +type GetClusterByIdResp struct { + ClusterInfo ClusterInfo `json:"clusterInfo"` +} + type ScreenInfoResp struct { StorageUsed float32 `json:"storageUsed"` StorageUsing float32 `json:"storageUsing"` @@ -1226,12 +1234,13 @@ type CommonResp struct { } type CommitHpcTaskReq struct { - Name string `json:"name"` // paratera:jobName + ClusterId int64 `json:"clusterId,optional"` + Name string `json:"name"` Account string `json:"account,optional"` Description string `json:"description,optional"` TenantId int64 `json:"tenantId,optional"` TaskId int64 `json:"taskId,optional"` - AdapterIds []string `json:"adapterIds"` + AdapterIds []string `json:"adapterIds,optional"` MatchLabels map[string]string `json:"matchLabels,optional"` CardCount int64 `json:"cardCount,optional"` WorkDir string `json:"workDir,optional"` //paratera:workingDir