From f3686840279022d5816fa53ee910e6354aadb3b5 Mon Sep 17 00:00:00 2001 From: zhangwei <894646498@qq.com> Date: Sat, 22 Jun 2024 10:01:44 +0800 Subject: [PATCH 1/4] screen Former-commit-id: a4310fbb6c037860c5d7d2516bab004d595d41cc --- api/desc/core/pcm-core.api | 2097 +++++++++-------- api/desc/pcm.api | 17 +- api/desc/storage/pcm-storage.api | 38 +- .../handler/core/getdomainresourcehandler.go | 17 + .../handler/core/getscreencharthandler.go | 17 + .../handler/core/getscreeninfohandler.go | 17 + api/internal/handler/routes.go | 15 + .../storage/dailypowerscreenhandler.go | 15 +- .../storage/percentercomputerpowershandler.go | 15 +- .../logic/adapters/createclusterlogic.go | 3 +- .../logic/core/getdomainresourcelogic.go | 31 + .../logic/core/getscreenchartlogic.go | 30 + api/internal/logic/core/getscreeninfologic.go | 30 + .../logic/storage/dailypowerscreenlogic.go | 48 +- .../storage/percentercomputerpowerslogic.go | 45 +- api/internal/types/types.go | 61 +- 16 files changed, 1296 insertions(+), 1200 deletions(-) create mode 100644 api/internal/handler/core/getdomainresourcehandler.go create mode 100644 api/internal/handler/core/getscreencharthandler.go create mode 100644 api/internal/handler/core/getscreeninfohandler.go create mode 100644 api/internal/logic/core/getdomainresourcelogic.go create mode 100644 api/internal/logic/core/getscreenchartlogic.go create mode 100644 api/internal/logic/core/getscreeninfologic.go diff --git a/api/desc/core/pcm-core.api b/api/desc/core/pcm-core.api index 5e2ed765..8f437d55 100644 --- a/api/desc/core/pcm-core.api +++ b/api/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,1132 +125,1158 @@ 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 struct { - 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 struct { + 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 int `json:"adapterTypeDict" db:"create_time" gorm:"adapter_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 int `json:"adapterTypeDict" db:"create_time" gorm:"adapter_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 ( - 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 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"` +} + + + +type ScreenInfoResp { + StorageTotal float64 `json:"storageTotal"` + StorageAvail float64 `json:"storageAvail"` + 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 ( + 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 ( - 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"` //容器节点已使用 - } + 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"` //更新时间 + } ) 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"` //任务底图 - } - - 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 { - Data AdapterInfo `json:"data,omitempty"` - } - 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 { + Data AdapterInfo `json:"data,omitempty"` + } + 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"` - } - 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"` - CreateTime string `json:"createTime,omitempty" db:"created_time" gorm:"autoCreateTime"` - } + 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"` + } + 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"` + CreateTime string `json:"createTime,omitempty" db:"created_time" gorm:"autoCreateTime"` + } ) 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 struct{} + 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 struct { + } - 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"` - } + 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"` + } - 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"` - } + 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"` + } ) \ No newline at end of file diff --git a/api/desc/pcm.api b/api/desc/pcm.api index be94f6eb..ba92b4f5 100644 --- a/api/desc/pcm.api +++ b/api/desc/pcm.api @@ -153,6 +153,19 @@ service pcm { @doc "Get Public Network" @handler getPublicNetworkHandler get /core/getPublicNetwork (PublicNetworkReq) returns (PublicNetworkResp) + + @doc "screen" + @handler getDomainResourceHandler + get /core/getDomainResource returns (DomainResourceResp) + + @doc "screen" + @handler getScreenInfoHandler + get /core/getScreenInfo returns (ScreenInfoResp) + + @doc "screen" + @handler getScreenChartHandler + get /core/getScreenChart returns (ScreenChartResp) + } //hpc二级接口 @@ -379,11 +392,11 @@ service pcm { @doc "日常算力查询" @handler dailyPowerScreenHandler - get /storage/dailyPowerScreen (DailyPowerScreenReq) returns (DailyPowerScreenResp) + get /storage/dailyPowerScreen returns (DailyPowerScreenResp) @doc "算力中心算力情况" @handler perCenterComputerPowersHandler - get /storage/perCenterComputerPowers (PerCenterComputerPowersReq) returns (PerCenterComputerPowersResp) + get /storage/perCenterComputerPowers returns (PerCenterComputerPowersResp) } //openstack 接口 diff --git a/api/desc/storage/pcm-storage.api b/api/desc/storage/pcm-storage.api index 88086e79..2aaf5dbc 100644 --- a/api/desc/storage/pcm-storage.api +++ b/api/desc/storage/pcm-storage.api @@ -52,46 +52,14 @@ type ( /******************screen computing power Start*************************/ type ( - DailyPowerScreenReq { - - } - DailyPowerScreenResp { - TotalSize int32 `json:"totalSize" copier:"TotalSize"` - DailyComputerPowers []DailyComputerPowers `json:"dailyComputerPowers" copier:"DailyComputerPowers"` - Code int32 `json:"code,omitempty"` - Msg string `json:"msg,omitempty"` - ErrorMsg string `json:"ErrorMsg,omitempty"` - } - - DailyComputerPowers { - Date string `json:"date" copier:"Date"` - ComputerPower float32 `json:"computerPower" copier:"ComputerPower"` + // DailyComputerPowers []DailyComputerPowers `json:"dailyComputerPowers" copier:"DailyComputerPowers"` + chart interface{} `json:"chart"` } ) type ( - PerCenterComputerPowersReq { - - } PerCenterComputerPowersResp { - TotalSize int32 `json:"totalSize" copier:"TotalSize"` - PerCenterComputerPowers []PerCenterComputerPowers `json:"perCenterComputerPowers" copier:"PerCenterComputerPowers"` - AccOtJobInfo AccOtJobInfo `json:"accOtJobInfo" copier:"AccOtJobInfo"` - Code int32 `json:"code,omitempty"` - Msg string `json:"msg,omitempty"` - ErrorMsg string `json:"ErrorMsg,omitempty"` - } - - PerCenterComputerPowers { - CenterName string `json:"centerName" copier:"CenterName"` - ComputerPower float32 `json:"computerPower" copier:"ComputerPower"` - JobCount int32 `json:"jobCount" copier:"JobCount"` - CenterId string `json:"centerId" copier:"CenterId"` - } - AccOtJobInfo { - AccRunSec int32 `json:"accRunSec" copier:"AccRunSec"` - AccCardRunSec float32 `json:"accCardRunSec" copier:"AccCardRunSec"` - AccOtJobNum int32 `json:"accOtJobNum" copier:"AccOtJobNum"` + chart interface{} `json:"chart"` } ) diff --git a/api/internal/handler/core/getdomainresourcehandler.go b/api/internal/handler/core/getdomainresourcehandler.go new file mode 100644 index 00000000..6ab31112 --- /dev/null +++ b/api/internal/handler/core/getdomainresourcehandler.go @@ -0,0 +1,17 @@ +package core + +import ( + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "net/http" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/core" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" +) + +func GetDomainResourceHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + l := core.NewGetDomainResourceLogic(r.Context(), svcCtx) + resp, err := l.GetDomainResource() + result.HttpResult(r, w, resp, err) + } +} diff --git a/api/internal/handler/core/getscreencharthandler.go b/api/internal/handler/core/getscreencharthandler.go new file mode 100644 index 00000000..64f7ea93 --- /dev/null +++ b/api/internal/handler/core/getscreencharthandler.go @@ -0,0 +1,17 @@ +package core + +import ( + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "net/http" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/core" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" +) + +func GetScreenChartHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + l := core.NewGetScreenChartLogic(r.Context(), svcCtx) + resp, err := l.GetScreenChart() + result.HttpResult(r, w, resp, err) + } +} diff --git a/api/internal/handler/core/getscreeninfohandler.go b/api/internal/handler/core/getscreeninfohandler.go new file mode 100644 index 00000000..65a28a6e --- /dev/null +++ b/api/internal/handler/core/getscreeninfohandler.go @@ -0,0 +1,17 @@ +package core + +import ( + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "net/http" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/core" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" +) + +func GetScreenInfoHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + l := core.NewGetScreenInfoLogic(r.Context(), svcCtx) + resp, err := l.GetScreenInfo() + result.HttpResult(r, w, resp, err) + } +} diff --git a/api/internal/handler/routes.go b/api/internal/handler/routes.go index c8aecb33..97f47e17 100644 --- a/api/internal/handler/routes.go +++ b/api/internal/handler/routes.go @@ -183,6 +183,21 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { Path: "/core/getPublicNetwork", Handler: core.GetPublicNetworkHandler(serverCtx), }, + { + Method: http.MethodGet, + Path: "/core/getDomainResource", + Handler: core.GetDomainResourceHandler(serverCtx), + }, + { + Method: http.MethodGet, + Path: "/core/getScreenInfo", + Handler: core.GetScreenInfoHandler(serverCtx), + }, + { + Method: http.MethodGet, + Path: "/core/getScreenChart", + Handler: core.GetScreenChartHandler(serverCtx), + }, }, rest.WithPrefix("/pcm/v1"), ) diff --git a/api/internal/handler/storage/dailypowerscreenhandler.go b/api/internal/handler/storage/dailypowerscreenhandler.go index 878a536c..a71c2331 100644 --- a/api/internal/handler/storage/dailypowerscreenhandler.go +++ b/api/internal/handler/storage/dailypowerscreenhandler.go @@ -1,24 +1,17 @@ package storage import ( - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/storage" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" "net/http" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/storage" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" ) func DailyPowerScreenHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { - var req types.DailyPowerScreenReq - if err := httpx.Parse(r, &req); err != nil { - result.ParamErrorResult(r, w, err) - return - } - l := storage.NewDailyPowerScreenLogic(r.Context(), svcCtx) - resp, err := l.DailyPowerScreen(&req) + resp, err := l.DailyPowerScreen() result.HttpResult(r, w, resp, err) } } diff --git a/api/internal/handler/storage/percentercomputerpowershandler.go b/api/internal/handler/storage/percentercomputerpowershandler.go index 15c7d3a1..b21a330b 100644 --- a/api/internal/handler/storage/percentercomputerpowershandler.go +++ b/api/internal/handler/storage/percentercomputerpowershandler.go @@ -1,24 +1,17 @@ package storage import ( - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/storage" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" "net/http" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/storage" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" ) func PerCenterComputerPowersHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { - var req types.PerCenterComputerPowersReq - if err := httpx.Parse(r, &req); err != nil { - result.ParamErrorResult(r, w, err) - return - } - l := storage.NewPerCenterComputerPowersLogic(r.Context(), svcCtx) - resp, err := l.PerCenterComputerPowers(&req) + resp, err := l.PerCenterComputerPowers() result.HttpResult(r, w, resp, err) } } diff --git a/api/internal/logic/adapters/createclusterlogic.go b/api/internal/logic/adapters/createclusterlogic.go index bb2e0eb1..f8d8a356 100644 --- a/api/internal/logic/adapters/createclusterlogic.go +++ b/api/internal/logic/adapters/createclusterlogic.go @@ -57,9 +57,10 @@ func (l *CreateClusterLogic) CreateCluster(req *types.ClusterCreateReq) (resp *t ForceContentType("application/json"). Post(adapterServer + "/api/v1/cluster/info") if err != nil { + return nil, err } if response.IsError() { - + return nil, errors.New(string(response.Body())) } return } diff --git a/api/internal/logic/core/getdomainresourcelogic.go b/api/internal/logic/core/getdomainresourcelogic.go new file mode 100644 index 00000000..f7f2acb0 --- /dev/null +++ b/api/internal/logic/core/getdomainresourcelogic.go @@ -0,0 +1,31 @@ +package core + +import ( + "context" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type GetDomainResourceLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewGetDomainResourceLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetDomainResourceLogic { + return &GetDomainResourceLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *GetDomainResourceLogic) GetDomainResource() (resp *types.DomainResourceResp, err error) { + resp = &types.DomainResourceResp{} + l.svcCtx.DbEngin.Raw("select * from screen_domain where delete_flag = 0").Scan(&resp.DomainResourceList) + return resp, nil + +} diff --git a/api/internal/logic/core/getscreenchartlogic.go b/api/internal/logic/core/getscreenchartlogic.go new file mode 100644 index 00000000..9723a03c --- /dev/null +++ b/api/internal/logic/core/getscreenchartlogic.go @@ -0,0 +1,30 @@ +package core + +import ( + "context" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type GetScreenChartLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewGetScreenChartLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetScreenChartLogic { + return &GetScreenChartLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *GetScreenChartLogic) GetScreenChart() (resp *types.ScreenChartResp, err error) { + resp = &types.ScreenChartResp{} + l.svcCtx.DbEngin.Raw("select * from screen_chart").Scan(&resp) + return +} diff --git a/api/internal/logic/core/getscreeninfologic.go b/api/internal/logic/core/getscreeninfologic.go new file mode 100644 index 00000000..efeb6f5f --- /dev/null +++ b/api/internal/logic/core/getscreeninfologic.go @@ -0,0 +1,30 @@ +package core + +import ( + "context" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type GetScreenInfoLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewGetScreenInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetScreenInfoLogic { + return &GetScreenInfoLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *GetScreenInfoLogic) GetScreenInfo() (resp *types.ScreenInfoResp, err error) { + resp = &types.ScreenInfoResp{} + l.svcCtx.DbEngin.Raw("select * from screen").Scan(resp) + return +} diff --git a/api/internal/logic/storage/dailypowerscreenlogic.go b/api/internal/logic/storage/dailypowerscreenlogic.go index e07a8b3a..804b6b21 100644 --- a/api/internal/logic/storage/dailypowerscreenlogic.go +++ b/api/internal/logic/storage/dailypowerscreenlogic.go @@ -1,30 +1,13 @@ -/* - - Copyright (c) [2023] [pcm] - [pcm-coordinator] is licensed under Mulan PSL v2. - You can use this software according to the terms and conditions of the Mulan PSL v2. - You may obtain a copy of Mulan PSL v2 at: - http://license.coscl.org.cn/MulanPSL2 - THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - See the Mulan PSL v2 for more details. - -*/ - package storage import ( "context" - "github.com/jinzhu/copier" - "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" + "k8s.io/apimachinery/pkg/util/json" + "strings" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" - "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" - "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" - "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" - "gitlink.org.cn/jcce-pcm/pcm-participant-ceph/ceph" - "k8s.io/apimachinery/pkg/util/json" "github.com/zeromicro/go-zero/core/logx" ) @@ -43,20 +26,15 @@ func NewDailyPowerScreenLogic(ctx context.Context, svcCtx *svc.ServiceContext) * } } -func (l *DailyPowerScreenLogic) DailyPowerScreen(req *types.DailyPowerScreenReq) (resp *types.DailyPowerScreenResp, err error) { - // todo: add your logic here and delete this line - dailyPowerScreenReq := &ceph.DailyPowerScreenReq{} - err = copier.CopyWithOption(dailyPowerScreenReq, req, copier.Option{Converters: utils.Converters}) - DailyPowerScreenResp, err := l.svcCtx.CephRpc.DailyPowerScreen(l.ctx, dailyPowerScreenReq) - if err != nil { - return nil, errors.Wrapf(xerr.NewErrMsg("Failed to get db storage list"), "Failed to get db storage list err : %v ,req:%+v", err, req) - } - marshal, err := json.Marshal(&DailyPowerScreenResp) - if err != nil { - return nil, result.NewDefaultError(err.Error()) - } - json.Unmarshal(marshal, &resp) - err = copier.CopyWithOption(&resp, &DailyPowerScreenResp, copier.Option{Converters: utils.Converters}) +func (l *DailyPowerScreenLogic) DailyPowerScreen() (resp *types.DailyPowerScreenResp, err error) { + resp = &types.DailyPowerScreenResp{} + statusCode, body, err := httputils.HttpClientWithScreen(httputils.GET, "https://grampus.openi.org.cn/openapi/v1/sharescreen/computepower/dailytrend", strings.NewReader(``)) + if statusCode == 200 { + json.Unmarshal(body, &resp.Chart) + println(resp) + } else if statusCode != 200 { + return nil, err + } return resp, nil } diff --git a/api/internal/logic/storage/percentercomputerpowerslogic.go b/api/internal/logic/storage/percentercomputerpowerslogic.go index 669a3b6c..4813fbb1 100644 --- a/api/internal/logic/storage/percentercomputerpowerslogic.go +++ b/api/internal/logic/storage/percentercomputerpowerslogic.go @@ -1,30 +1,12 @@ -/* - - Copyright (c) [2023] [pcm] - [pcm-coordinator] is licensed under Mulan PSL v2. - You can use this software according to the terms and conditions of the Mulan PSL v2. - You may obtain a copy of Mulan PSL v2 at: - http://license.coscl.org.cn/MulanPSL2 - THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - See the Mulan PSL v2 for more details. - -*/ - package storage import ( "context" - "github.com/jinzhu/copier" - "github.com/pkg/errors" "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" - "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" - "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" - "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" - "gitlink.org.cn/jcce-pcm/pcm-participant-ceph/ceph" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils" "k8s.io/apimachinery/pkg/util/json" + "strings" "github.com/zeromicro/go-zero/core/logx" ) @@ -43,20 +25,15 @@ func NewPerCenterComputerPowersLogic(ctx context.Context, svcCtx *svc.ServiceCon } } -func (l *PerCenterComputerPowersLogic) PerCenterComputerPowers(req *types.PerCenterComputerPowersReq) (resp *types.PerCenterComputerPowersResp, err error) { - // todo: add your logic here and delete this line - perCenterComputerPowersReq := &ceph.PerCenterComputerPowersReq{} - err = copier.CopyWithOption(perCenterComputerPowersReq, req, copier.Option{Converters: utils.Converters}) - PerCenterComputerPowersResp, err := l.svcCtx.CephRpc.PerCenterComputerPowerScreen(l.ctx, perCenterComputerPowersReq) - if err != nil { - return nil, errors.Wrapf(xerr.NewErrMsg("Failed to get db storage list"), "Failed to get db storage list err : %v ,req:%+v", err, req) - } - marshal, err := json.Marshal(&PerCenterComputerPowersResp) - if err != nil { - return nil, result.NewDefaultError(err.Error()) - } - json.Unmarshal(marshal, &resp) - err = copier.CopyWithOption(&resp, &PerCenterComputerPowersResp, copier.Option{Converters: utils.Converters}) +func (l *PerCenterComputerPowersLogic) PerCenterComputerPowers() (resp *types.PerCenterComputerPowersResp, err error) { + resp = &types.PerCenterComputerPowersResp{} + statusCode, body, err := httputils.HttpClientWithScreen(httputils.GET, "https://grampus.openi.org.cn/openapi/v1/sharescreen/computepower/percenter", strings.NewReader(``)) + if statusCode == 200 { + json.Unmarshal(body, &resp.Chart) + println(resp) + } else if statusCode != 200 { + return nil, err + } return resp, nil } diff --git a/api/internal/types/types.go b/api/internal/types/types.go index e8f7fb77..8d95cdb0 100644 --- a/api/internal/types/types.go +++ b/api/internal/types/types.go @@ -456,6 +456,30 @@ type GiResp struct { StorageInGib int32 `json:"storageInGib,optional"` } +type ScreenChartResp struct { + 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 ScreenInfoResp struct { + StorageTotal float64 `json:"storageTotal"` + StorageAvail float64 `json:"storageAvail"` + 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 DomainResourceResp struct { TotalCount int `json:"totalCount"` DomainResourceList []DomainResource `json:"domainResourceList"` @@ -2905,45 +2929,12 @@ type AiCenterInfos struct { JobCount int32 `json:"jobCount" copier:"JobCount"` } -type DailyPowerScreenReq struct { -} - type DailyPowerScreenResp struct { - TotalSize int32 `json:"totalSize" copier:"TotalSize"` - DailyComputerPowers []DailyComputerPowers `json:"dailyComputerPowers" copier:"DailyComputerPowers"` - Code int32 `json:"code,omitempty"` - Msg string `json:"msg,omitempty"` - ErrorMsg string `json:"ErrorMsg,omitempty"` -} - -type DailyComputerPowers struct { - Date string `json:"date" copier:"Date"` - ComputerPower float32 `json:"computerPower" copier:"ComputerPower"` -} - -type PerCenterComputerPowersReq struct { + Chart interface{} `json:"chart"` } type PerCenterComputerPowersResp struct { - TotalSize int32 `json:"totalSize" copier:"TotalSize"` - PerCenterComputerPowers []PerCenterComputerPowers `json:"perCenterComputerPowers" copier:"PerCenterComputerPowers"` - AccOtJobInfo AccOtJobInfo `json:"accOtJobInfo" copier:"AccOtJobInfo"` - Code int32 `json:"code,omitempty"` - Msg string `json:"msg,omitempty"` - ErrorMsg string `json:"ErrorMsg,omitempty"` -} - -type PerCenterComputerPowers struct { - CenterName string `json:"centerName" copier:"CenterName"` - ComputerPower float32 `json:"computerPower" copier:"ComputerPower"` - JobCount int32 `json:"jobCount" copier:"JobCount"` - CenterId string `json:"centerId" copier:"CenterId"` -} - -type AccOtJobInfo struct { - AccRunSec int32 `json:"accRunSec" copier:"AccRunSec"` - AccCardRunSec float32 `json:"accCardRunSec" copier:"AccCardRunSec"` - AccOtJobNum int32 `json:"accOtJobNum" copier:"AccOtJobNum"` + Chart interface{} `json:"chart"` } type UploadImageReq struct { From 841e6c36f2571ea10226494db2ed620c95d29b35 Mon Sep 17 00:00:00 2001 From: zhangwei <894646498@qq.com> Date: Sat, 22 Jun 2024 16:54:32 +0800 Subject: [PATCH 2/4] screen Former-commit-id: 60c449340e91830d4c3676ac173eb47880938768 --- api/internal/logic/core/getscreenchartlogic.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/internal/logic/core/getscreenchartlogic.go b/api/internal/logic/core/getscreenchartlogic.go index 9723a03c..06085cf9 100644 --- a/api/internal/logic/core/getscreenchartlogic.go +++ b/api/internal/logic/core/getscreenchartlogic.go @@ -25,6 +25,9 @@ func NewGetScreenChartLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Ge func (l *GetScreenChartLogic) GetScreenChart() (resp *types.ScreenChartResp, err error) { resp = &types.ScreenChartResp{} - l.svcCtx.DbEngin.Raw("select * from screen_chart").Scan(&resp) + l.svcCtx.DbEngin.Raw("select cpu_avg from screen_chart").Scan(&resp.CpuAvg) + l.svcCtx.DbEngin.Raw("select cpu_load from screen_chart").Scan(&resp.CpuLoad) + l.svcCtx.DbEngin.Raw("select memory_avg from screen_chart").Scan(&resp.MemoryAvg) + l.svcCtx.DbEngin.Raw("select memory_load from screen_chart").Scan(&resp.MemoryLoad) return } From 6bdfa98ff01eaa08966f8d1dd86e2f3e2f71079b Mon Sep 17 00:00:00 2001 From: zhangwei <894646498@qq.com> Date: Sat, 22 Jun 2024 19:21:31 +0800 Subject: [PATCH 3/4] screen Former-commit-id: 3083efc6ab9cad58a256f8678aee3c4c2cf0a160 --- api/desc/core/pcm-core.api | 30 ++++++++++++++++++++++++++++++ api/internal/types/types.go | 26 ++++++++++++++------------ 2 files changed, 44 insertions(+), 12 deletions(-) diff --git a/api/desc/core/pcm-core.api b/api/desc/core/pcm-core.api index 038b716f..988899e9 100644 --- a/api/desc/core/pcm-core.api +++ b/api/desc/core/pcm-core.api @@ -504,6 +504,36 @@ type ( } ) + +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"` +} + + + +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"` +} + + type ( cpResp { POpsAtFp16 float32 `json:"pOpsAtFp16"` diff --git a/api/internal/types/types.go b/api/internal/types/types.go index 3432c695..f464d93a 100644 --- a/api/internal/types/types.go +++ b/api/internal/types/types.go @@ -446,16 +446,6 @@ type ComputeCluster struct { Description string `json:"description"` } -type CpResp struct { - POpsAtFp16 float32 `json:"pOpsAtFp16"` -} - -type GiResp struct { - CpuNum int32 `json:"cpuNum,optional"` - MemoryInGib int32 `json:"memoryInGib,optional"` - StorageInGib int32 `json:"storageInGib,optional"` -} - type ScreenChartResp struct { ComputingPower []int `json:"computingPower"` CpuAvg []int `json:"cpuAvg"` @@ -466,8 +456,10 @@ type ScreenChartResp struct { } type ScreenInfoResp struct { - StorageTotal float64 `json:"storageTotal"` - StorageAvail float64 `json:"storageAvail"` + 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"` @@ -480,6 +472,16 @@ type ScreenInfoResp struct { RunningTime int `json:"runningTime"` } +type CpResp struct { + POpsAtFp16 float32 `json:"pOpsAtFp16"` +} + +type GiResp struct { + CpuNum int32 `json:"cpuNum,optional"` + MemoryInGib int32 `json:"memoryInGib,optional"` + StorageInGib int32 `json:"storageInGib,optional"` +} + type DomainResourceResp struct { TotalCount int `json:"totalCount"` DomainResourceList []DomainResource `json:"domainResourceList"` From 6315d8c5e169cb4ea0cb1dd447607ef55ce5423e Mon Sep 17 00:00:00 2001 From: zhangwei <894646498@qq.com> Date: Fri, 28 Jun 2024 09:24:58 +0800 Subject: [PATCH 4/4] screen Former-commit-id: e5c25ffa600255cd2a5f6c2325104fbd46a43944 --- deploy/pcm.sql | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) diff --git a/deploy/pcm.sql b/deploy/pcm.sql index 70d6e42f..0904803e 100644 --- a/deploy/pcm.sql +++ b/deploy/pcm.sql @@ -945,4 +945,86 @@ CREATE TABLE `vm_openstack_overview` ( -- Records of vm_openstack_overview -- ---------------------------- +DROP TABLE IF EXISTS `screen`; +CREATE TABLE `screen` ( + `id` bigint NOT NULL COMMENT 'id', + `storage_used` float NULL DEFAULT NULL, + `storage_using` float NULL DEFAULT NULL, + `api_delay` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, + `scheduler_times` int NULL DEFAULT NULL, + `scheduler_err` int NULL DEFAULT NULL, + `api_times` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, + `center_count` int NULL DEFAULT NULL, + `computing_power` float NULL DEFAULT NULL, + `cluster_count` int NULL DEFAULT NULL, + `running_count` int NULL DEFAULT NULL, + `card_count` int NULL DEFAULT NULL, + `running_time` int NULL DEFAULT NULL, + `using_rate` float NULL DEFAULT NULL, + `usage_rate` float NULL DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of screen +-- ---------------------------- +INSERT INTO `screen` VALUES (1, 621.3, 163.8, '2.71', 5, 1, '1.71', 34, 112.08, 48, 138633, 478568, 138633, 0.209, 0.791); + +DROP TABLE IF EXISTS `screen_domain`; +CREATE TABLE `screen_domain` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id', + `domain_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '资源域id', + `domain_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '资源域名称', + `job_count` int NULL DEFAULT NULL COMMENT '资源域任务数量', + `domain_source` tinyint(1) NOT NULL DEFAULT 0 COMMENT '资源域数据来源:0-nudt,1-鹏城', + `stack` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '技术栈', + `resource_type` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '资源类型', + `cpu_usage` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, + `cpu_total` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT 'cpu', + `memory_usage` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, + `memory_total` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '内存', + `disk_usage` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, + `disk_total` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '存储', + `node_usage` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, + `node_total` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '节点数量', + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '数据创建时间', + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '数据更新时间', + `delete_flag` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否删除 0:未删除,1:已经删除', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1403 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '域资源信息' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of screen_domain +-- ---------------------------- +INSERT INTO `screen_domain` VALUES (1387, 'cloudbrain1', '鹏城云脑一号GPU计算中心', 0, 1, ' ', '智算中心', '12', '1160', '0.12', '129', '0.68', '10', '0.16', '12', '2023-08-19 20:50:02', '2023-08-19 20:50:02', 0); +INSERT INTO `screen_domain` VALUES (1388, 'xian-2', '寒武纪西安智算', 0, 1, ' ', '智算中心', '62', '2130', '0.23', '129', '0.38', '10', '0.66', '18', '2023-08-19 20:50:02', '2023-08-19 20:50:02', 0); +INSERT INTO `screen_domain` VALUES (1389, 'cloudbrain2', '云脑二号智算', 6, 1, ' ', '智算中心', '12', '9528', '0.22', '955', '0.55', '64', '0.3', '10', '2023-08-19 20:50:03', '2023-08-19 20:50:03', 0); +INSERT INTO `screen_domain` VALUES (1390, 'wuhan', '武汉智算', 720, 1, ' ', '智算中心', '87', '9216', '0.58', '40', '0.36', '6', '0.33', '3', '2023-08-19 20:50:03', '2023-08-19 20:50:03', 0); +INSERT INTO `screen_domain` VALUES (1391, 'pku', '北京大学GPU智算', 0, 1, ' ', '智算中心', '54', '2240', '0.27', '11', '0.28', '1', '0.5', '22', '2023-08-19 20:50:03', '2023-08-19 20:50:03', 0); +INSERT INTO `screen_domain` VALUES (1392, 'hefei', '中科类脑GPU智算', 388, 1, ' ', '智算中心', '23', '1952', '0.32', '22', '0.63', '14', '0.5', '12', '2023-08-19 20:50:03', '2023-08-19 20:50:03', 0); +INSERT INTO `screen_domain` VALUES (1393, 'hefei-1', '寒武纪合肥智算', 0, 1, ' ', '智算中心', '13', '1952', '0.33', '11', '0.36', '14', '0.57', '19', '2023-08-19 20:50:03', '2023-08-19 20:50:03', 0); +INSERT INTO `screen_domain` VALUES (1394, 'xian', '西安智算', 1472, 1, ' ', '智算中心', '45', '2304', '0.12', '96', '0.78', '7', '0.2', '5', '2023-08-19 20:50:03', '2023-08-19 20:50:03', 0); +INSERT INTO `screen_domain` VALUES (1395, 'xuchang', '中原智算', 2136, 1, ' ', '智算中心', '28', '7680', '0.11', '32', '0.85', '6', '0.52', '23', '2023-08-19 20:50:03', '2023-08-19 20:50:03', 0); + +DROP TABLE IF EXISTS `screen_chart`; +CREATE TABLE `screen_chart` ( + `id` int NOT NULL AUTO_INCREMENT, + `cpu_avg` int NULL DEFAULT NULL, + `cpu_load` int NULL DEFAULT NULL, + `memory_load` int NULL DEFAULT NULL, + `memory_avg` int NULL DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 8 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of screen_chart +-- ---------------------------- +INSERT INTO `screen_chart` VALUES (1, 20, 64, 128, 62); +INSERT INTO `screen_chart` VALUES (2, 75, 64, 256, 36); +INSERT INTO `screen_chart` VALUES (3, 73, 128, 128, 73); +INSERT INTO `screen_chart` VALUES (4, 63, 72, 64, 23); +INSERT INTO `screen_chart` VALUES (5, 38, 80, 256, 35); +INSERT INTO `screen_chart` VALUES (6, 26, 40, 64, 18); +INSERT INTO `screen_chart` VALUES (7, 36, 68, 128, 39); + SET FOREIGN_KEY_CHECKS = 1;