forked from JointCloud/pcm-coordinator
1393 lines
51 KiB
Plaintext
1393 lines
51 KiB
Plaintext
syntax = "v1"
|
||
|
||
info(
|
||
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"`
|
||
}
|
||
)
|
||
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"`
|
||
}
|
||
)
|
||
|
||
type (
|
||
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"`
|
||
}
|
||
)
|
||
|
||
type (
|
||
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"`
|
||
}
|
||
)
|
||
|
||
type (
|
||
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"`
|
||
}
|
||
)
|
||
|
||
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"`
|
||
}
|
||
)
|
||
|
||
type remoteResp {
|
||
Code int `json:"code"`
|
||
Message string `json:"message"`
|
||
Data interface{} `json:"data"`
|
||
}
|
||
|
||
type (
|
||
clustersLoadReq {
|
||
ClusterName string `form:"clusterName"`
|
||
}
|
||
clustersLoadResp {
|
||
Data interface{} `json:"data"`
|
||
}
|
||
)
|
||
|
||
type (
|
||
syncClusterLoadReq {
|
||
clusterLoadRecords []ClusterLoadRecord `json:"clusterLoadRecords"`
|
||
}
|
||
ClusterLoadRecord {
|
||
AdapterId int64 `json:"adapterId,optional"`
|
||
ClusterName string `json:"clusterName,optional"`
|
||
CpuAvail float64 `json:"cpuAvail,optional"`
|
||
CpuTotal float64 `json:"cpuTotal,optional"`
|
||
CpuUtilisation float64 `json:"cpuUtilisation,optional"`
|
||
MemoryAvail float64 `json:"memoryAvail,optional"`
|
||
MemoryUtilisation float64 `json:"memoryUtilisation,optional"`
|
||
MemoryTotal float64 `json:"memoryTotal,optional"`
|
||
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"`
|
||
}
|
||
)
|
||
|
||
type (
|
||
getClusterListReq {
|
||
AdapterId int64 `form:"adapterId"`
|
||
}
|
||
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"`
|
||
}
|
||
)
|
||
|
||
type (
|
||
GeneralTaskReq {
|
||
Token string `json:"token,optional"`
|
||
UserId int64 `json:"userId,optional"`
|
||
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"`
|
||
UserIp string `json:"userIp,optional"`
|
||
}
|
||
|
||
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"`
|
||
}
|
||
|
||
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"`
|
||
}
|
||
|
||
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"`
|
||
}
|
||
)
|
||
|
||
|
||
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,optional"`
|
||
VmName string `json:"vm_name,optional"`
|
||
}
|
||
TaskVm {
|
||
Image string `json:"image"`
|
||
Flavor string `json:"flavor"`
|
||
Uuid string `json:"uuid"`
|
||
Platform string `json:"platform"`
|
||
}
|
||
VmOption {
|
||
AdapterId string `json:"adapterId"`
|
||
VmClusterIds []string `json:"vmClusterIds"`
|
||
Replicas int64 `json:"replicas,optional"`
|
||
Name string `json:"name"`
|
||
//ResourceType string `json:"resourceType"`
|
||
//TaskType string `json:"taskType"`
|
||
Strategy string `json:"strategy"`
|
||
ClusterToStaticWeight map[string]int32 `json:"clusterToStaticWeight"`
|
||
MatchLabels map[string]string `json:"matchLabels,optional"`
|
||
StaticWeightMap map[string]int32 `json:"staticWeightMap,optional"`
|
||
CreateMulServer []CreateMulDomainServer `json:"createMulServer,optional"`
|
||
}
|
||
|
||
CreateMulDomainServer {
|
||
Platform string `json:"platform,optional"`
|
||
name string `json:"name,optional"`
|
||
min_count int64 `json:"min_count,optional"`
|
||
imageRef string `json:"imageRef,optional"`
|
||
flavorRef string `json:"flavorRef,optional"`
|
||
uuid string `json:"uuid,optional"`
|
||
ClusterId string `json:"clusterId,optional"`
|
||
}
|
||
commitVmTaskResp {
|
||
Code int32 `json:"code"`
|
||
Msg string `json:"msg"`
|
||
}
|
||
ScheduleVmResult {
|
||
ClusterId string `json:"clusterId"`
|
||
TaskId string `json:"taskId"`
|
||
Strategy string `json:"strategy"`
|
||
Replica int32 `json:"replica"`
|
||
Msg string `json:"msg"`
|
||
}
|
||
VmTask {
|
||
Id string `json:"id" copier:"Id"`
|
||
Links []VmLinks `json:"links" copier:"Links"`
|
||
OSDCFDiskConfig string `json:"OS_DCF_diskConfig" copier:"OSDCFDiskConfig"`
|
||
SecurityGroups []VmSecurity_groups_server `json:"security_groups" copier:"SecurityGroups"`
|
||
AdminPass string `json:"adminPass" copier:"AdminPass"`
|
||
}
|
||
VmLinks {
|
||
Href string `json:"href " copier:"Href"`
|
||
Rel string `json:"rel" copier:"Rel"`
|
||
}
|
||
// commitVmTaskReq {
|
||
// Name string `json:"name"`
|
||
// NsID string `json:"nsID"`
|
||
// Replicas int64 `json:"replicas,optional"`
|
||
// MatchLabels map[string]string `json:"matchLabels,optional"`
|
||
// AdapterId string `json:"adapterId,optional"`
|
||
// ClusterType string `json:"clusterType,optional"`
|
||
// //Virtual Machine Section
|
||
// CreateMulServer []CreateMulDomainServer `json:"createMulServer,optional"`
|
||
// }
|
||
// CreateMulDomainServer {
|
||
// Platform string `json:"platform,optional"`
|
||
// Name string `json:"name,optional"`
|
||
// Min_count int64 `json:"min_count,optional"`
|
||
// ImageRef string `json:"imageRef,optional"`
|
||
// FlavorRef string `json:"flavorRef,optional"`
|
||
// Uuid string `json:"uuid,optional"`
|
||
// }
|
||
// commitVmTaskResp {
|
||
// // VmTask []VmTask `json:"vmTask" copier:"VmTask"`
|
||
// TaskId int64 `json:"taskId"`
|
||
// Code int32 `json:"code"`
|
||
// Msg string `json:"msg"`
|
||
// }
|
||
// VmTask {
|
||
// Id string `json:"id" copier:"Id"`
|
||
// Links []VmLinks `json:"links" copier:"Links"`
|
||
// OSDCFDiskConfig string `json:"OS_DCF_diskConfig" copier:"OSDCFDiskConfig"`
|
||
// SecurityGroups []VmSecurity_groups_server `json:"security_groups" copier:"SecurityGroups"`
|
||
// AdminPass string `json:"adminPass" copier:"AdminPass"`
|
||
// }
|
||
// VmLinks {
|
||
// Href string `json:"href " copier:"Href"`
|
||
// Rel string `json:"rel" copier:"Rel"`
|
||
// }
|
||
|
||
VmSecurity_groups_server {
|
||
Name string `json:"name" copier:"Name"`
|
||
}
|
||
)
|
||
|
||
type (
|
||
asynCommitAiTaskReq {
|
||
Name string `json:"name,optional"`
|
||
AdapterIds []string `json:"adapterIds,optional"`
|
||
ClusterIds []string `json:"clusterIds,optional"`
|
||
Strategy string `json:"strategy,optional"`
|
||
StaticWeightMap map[string]int32 `json:"staticWeightMap,optional"`
|
||
Replicas int64 `json:"replicas,optional"`
|
||
ImageId string `json:"imageId,optional"`
|
||
Command string `json:"command,optional"`
|
||
FlavorId string `json:"flavorId,optional"`
|
||
Status string `json:"status,optional"`
|
||
ClusterId int64 `json:"clusterId,optional"`
|
||
AdapterId string `json:"adapterId,optional"`
|
||
}
|
||
|
||
asynCommitAiTaskResp {
|
||
Code int32 `json:"code"`
|
||
Msg string `json:"msg"`
|
||
TaskId int64 `json:"taskId"`
|
||
}
|
||
)
|
||
|
||
type (
|
||
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"`
|
||
}
|
||
)
|
||
|
||
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"`
|
||
}
|
||
)
|
||
|
||
// 任务列表参数
|
||
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"`
|
||
}
|
||
|
||
pageTaskReq {
|
||
UserId int64 `form:"userId,optional"`
|
||
Name string `form:"name,optional"`
|
||
Type string `form:"type,optional"`
|
||
UserName string `form:"userName,optional"`
|
||
PageInfo
|
||
}
|
||
|
||
TaskModel {
|
||
Id int64 `json:"id,omitempty,string" db:"id"` // id
|
||
Name string `json:"name,omitempty" db:"name"` // 作业名称
|
||
Description string `json:"description,omitempty" db:"description"` // 作业描述
|
||
Status string `json:"status,omitempty" db:"status"` // 作业状态
|
||
Strategy int64 `json:"strategy" db:"strategy"` // 策略
|
||
SynergyStatus int64 `json:"synergyStatus" db:"synergy_status"` // 协同状态(0-未协同、1-已协同)
|
||
CommitTime string `json:"commitTime,omitempty" db:"commit_time"` // 提交时间
|
||
StartTime string `json:"startTime,omitempty" db:"start_time"` // 开始时间
|
||
EndTime string `json:"endTime,omitempty" db:"end_time"` // 结束运行时间
|
||
RunningTime int64 `json:"runningTime" db:"running_time"` // 已运行时间(单位秒)
|
||
YamlString string `json:"yamlString,omitempty" db:"yaml_string"`
|
||
Result string `json:"result,omitempty" db:"result"` // 作业结果
|
||
DeletedAt string `json:"deletedAt,omitempty" gorm:"index" db:"deleted_at"`
|
||
NsID string `json:"nsId,omitempty" db:"ns_id"`
|
||
TenantId string `json:"tenantId,omitempty" db:"tenant_id"`
|
||
CreatedTime string `json:"createdTime,omitempty" db:"created_time" gorm:"autoCreateTime"`
|
||
UpdatedTime string `json:"updatedTime,omitempty" db:"updated_time"`
|
||
AdapterTypeDict string `json:"adapterTypeDict" db:"adapter_type_dict" gorm:"adapter_type_dict"` //适配器类型(对应字典表的值
|
||
TaskTypeDict string `json:"taskTypeDict" db:"task_type_dict" gorm:"task_type_dict"` //任务类型(对应字典表的值
|
||
UserId int64 `json:"userId,omitempty" db:"user_id"`
|
||
}
|
||
)
|
||
|
||
// 任务列表参数
|
||
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"`
|
||
}
|
||
)
|
||
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"`
|
||
}
|
||
)
|
||
|
||
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"`
|
||
}
|
||
)
|
||
|
||
|
||
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 getClusterByIdReq {
|
||
ClusterId int32 `path:"clusterId"`
|
||
}
|
||
|
||
type getClusterByIdResp {
|
||
ClusterInfo ClusterInfo `json:"clusterInfo"`
|
||
}
|
||
|
||
|
||
|
||
type ScreenInfoResp {
|
||
StorageUsed float32 `json:"storageUsed"`
|
||
StorageUsing float32 `json:"storageUsing"`
|
||
UsageRate float32 `json:"usageRate"`
|
||
UsingRate float32 `json:"usingRate"`
|
||
ApiDelay string `json:"apiDelay"`
|
||
SchedulerTimes int `json:"schedulerTimes"`
|
||
SchedulerErr int `json:"schedulerErr"`
|
||
ApiTimes string `json:"apiTimes"`
|
||
CenterCount int `json:"centerCount"`
|
||
ComputingPower float64 `json:"computingPower"`
|
||
ClusterCount int `json:"clusterCount"`
|
||
RunningCount int `json:"runningCount"`
|
||
CardCount int `json:"cardCount"`
|
||
RunningTime int `json:"runningTime"`
|
||
}
|
||
|
||
|
||
type (
|
||
cpResp {
|
||
POpsAtFp16 float32 `json:"pOpsAtFp16"`
|
||
}
|
||
|
||
GiResp {
|
||
CpuNum int32 `json:"cpuNum,optional"`
|
||
MemoryInGib int32 `json:"memoryInGib,optional"`
|
||
StorageInGib int32 `json:"storageInGib,optional"`
|
||
}
|
||
)
|
||
|
||
type (
|
||
DomainResourceResp {
|
||
TotalCount int `json:"totalCount"`
|
||
DomainResourceList []DomainResource `json:"domainResourceList"`
|
||
}
|
||
DomainResource {
|
||
Id int64 `json:"id"` // id
|
||
DomainId string `json:"domainId"` // 资源域id
|
||
DomainName string `json:"domainName"` // 资源域名称
|
||
JobCount int64 `json:"jobCount"` // 资源域任务数量
|
||
DomainSource int64 `json:"domainSource"` // 资源域数据来源:0-nudt,1-鹏城
|
||
Stack string `json:"stack"` // 技术栈
|
||
ResourceType string `json:"resourceType"` // 资源类型
|
||
Cpu float64 `json:"cpu"` // cpu使用率
|
||
Memory float64 `json:"memory"` // 内存使用率
|
||
Disk float64 `json:"disk"` // 存储使用率
|
||
NodeCount float64 `json:"nodeCount"` //节点使用率
|
||
// DeleteFlag int64 `json:"delete_flag"` // 是否删除 0:未删除,1:已经删除
|
||
Description string `json:"description"` //集群描述
|
||
ClusterName string `json:"clusterName"` //集群名称
|
||
CpuTotal float64 `json:"cpuTotal"` //cpu总核数
|
||
MemoryTotal float64 `json:"memoryTotal"` //内存总量Gi
|
||
DiskTotal float64 `json:"diskTotal"` //存储总量GB
|
||
NodeTotal float64 `json:"nodeTotal"` //容器节点数
|
||
CpuUsage float64 `json:"cpuUsage"` //cpu已使用核数
|
||
MemoryUsage float64 `json:"memoryUsage"` //内存已使用Gi
|
||
DiskUsage float64 `json:"diskUsage"` //存储已使用GB
|
||
NodeUsage float64 `json:"nodeUsage"` //容器节点已使用
|
||
}
|
||
)
|
||
|
||
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"` //集群总数
|
||
}
|
||
)
|
||
|
||
//jccSchedule容器集群资源监控 > start
|
||
|
||
type NodeAssetsResp {
|
||
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
|
||
}
|
||
|
||
type participantListResp {
|
||
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"`
|
||
}
|
||
|
||
// 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"`
|
||
}
|
||
)
|
||
|
||
//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"`
|
||
}
|
||
|
||
AppTaskResp {
|
||
Data interface{} `json:"data"`
|
||
}
|
||
)
|
||
|
||
type (
|
||
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"`
|
||
}
|
||
|
||
AppResp {
|
||
Code int `json:"code,omitempty"`
|
||
Msg string `json:"msg,omitempty"`
|
||
Data interface{} `json:"data,omitempty"`
|
||
}
|
||
)
|
||
|
||
type (
|
||
AdapterQueryReq {
|
||
Id string `form:"id,optional" db:"id"`
|
||
Name string `form:"name,optional"`
|
||
Type string `form:"type,optional"`
|
||
ResourceType string `form:"resourceType,optional"`
|
||
Nickname string `form:"nickname,optional"`
|
||
Version string `form:"version,optional"`
|
||
Server string `form:"server,optional"`
|
||
PageInfo
|
||
}
|
||
AdapterRelationQueryReq {
|
||
Id string `form:"id,optional" db:"id"`
|
||
Name string `form:"name,optional"`
|
||
Type string `form:"type,optional"`
|
||
ResourceType string `form:"resourceType,optional"`
|
||
Nickname string `form:"nickname,optional"`
|
||
Version string `form:"version,optional"`
|
||
Server string `form:"server,optional"`
|
||
}
|
||
AdapterReq {
|
||
Id string `json:"id,optional" db:"id"`
|
||
Name string `json:"name,optional"`
|
||
Type string `json:"type,optional"`
|
||
ResourceType string `json:"resourceType,optional"`
|
||
Nickname string `json:"nickname,optional"`
|
||
Version string `json:"version,optional"`
|
||
Server string `json:"server,optional"`
|
||
}
|
||
AdapterCreateReq {
|
||
Id string `json:"id,optional" db:"id"`
|
||
Name string `json:"name"`
|
||
Type string `json:"type"`
|
||
ResourceType string `json:"resourceType"`
|
||
Nickname string `json:"nickname"`
|
||
Version string `json:"version"`
|
||
Server string `json:"server"`
|
||
}
|
||
AdapterDelReq {
|
||
Id string `form:"id,optional" db:"id"`
|
||
}
|
||
AdapterInfo {
|
||
Id string `json:"id,omitempty" db:"id"`
|
||
Name string `json:"name,omitempty" db:"name"`
|
||
Type string `json:"type,omitempty" db:"type"`
|
||
ResourceType string `json:"resourceType,omitempty" db:"resource_type"`
|
||
Nickname string `json:"nickname,omitempty" db:"nickname"`
|
||
Version string `json:"version,omitempty" db:"version"`
|
||
Server string `json:"server,omitempty" db:"server"`
|
||
CreateTime string `json:"createTime,omitempty" db:"create_time" gorm:"autoCreateTime"`
|
||
}
|
||
AdapterResp {
|
||
Id string `json:"id,omitempty" db:"id"`
|
||
Name string `json:"name,omitempty" db:"name"`
|
||
Type string `json:"type,omitempty" db:"type"`
|
||
ResourceType string `json:"resourceType,omitempty" db:"resource_type"`
|
||
Nickname string `json:"nickname,omitempty" db:"nickname"`
|
||
Version string `json:"version,omitempty" db:"version"`
|
||
Server string `json:"server,omitempty" db:"server"`
|
||
CreateTime string `json:"createTime,omitempty" db:"create_time" gorm:"autoCreateTime"`
|
||
InfoName string `json:"info_name,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"`
|
||
StorageSchedule string `form:"storageSchedule,optional"`
|
||
PageInfo
|
||
}
|
||
|
||
ClusterCreateReq {
|
||
Id string `json:"id,optional"`
|
||
AdapterId string `json:"adapterId,optional"`
|
||
Name string `json:"name,optional"`
|
||
Nickname string `json:"nickname,optional"`
|
||
Description string `json:"description,optional"`
|
||
Server string `json:"server,optional"`
|
||
MonitorServer string `json:"monitorServer,optional"`
|
||
Username string `json:"username,optional"`
|
||
Password string `json:"password,optional"`
|
||
Token string `json:"token,optional"`
|
||
Ak string `json:"ak,optional"`
|
||
Sk string `json:"sk,optional"`
|
||
Region []string `json:"region,optional"`
|
||
ProjectId string `json:"projectId,optional"`
|
||
Version string `json:"version,optional"`
|
||
Label string `json:"label,optional"`
|
||
OwnerId string `json:"ownerId,omitempty,optional"`
|
||
AuthType string `json:"authType,optional"`
|
||
ProducerDict string `json:"producerDict,optional"`
|
||
RegionDict string `json:"regionDict,optional"`
|
||
RegionName string `json:"regionName,optional"`
|
||
Environment map[string]string `json:"environment,optional"`
|
||
CostType string `json:"costType,optional"`
|
||
Price int `json:"price,optional"`
|
||
}
|
||
ClusterInfo {
|
||
Id string `json:"id,omitempty" db:"id"`
|
||
AdapterId int64 `json:"adapterId,omitempty,string" db:"adapter_id"`
|
||
Name string `json:"name,omitempty" db:"name"`
|
||
Nickname string `json:"nickname,omitempty" db:"nickname"`
|
||
Description string `json:"description,omitempty" db:"description"`
|
||
Server string `json:"server,omitempty" db:"server"`
|
||
MonitorServer string `json:"monitorServer,omitempty" db:"monitor_server"`
|
||
Username string `json:"username,omitempty" db:"username"`
|
||
Password string `json:"password,omitempty" db:"password"`
|
||
Token string `json:"token,omitempty" db:"token"`
|
||
Ak string `json:"ak,omitempty" db:"ak"`
|
||
Sk string `json:"sk,omitempty" db:"sk"`
|
||
Region string `json:"region,omitempty" db:"region"`
|
||
ProjectId string `json:"projectId,omitempty" db:"project_id"`
|
||
Version string `json:"version,omitempty" db:"version"`
|
||
Label string `json:"label,omitempty" db:"label"`
|
||
OwnerId string `json:"ownerId,omitempty" db:"owner_id"`
|
||
AuthType string `json:"authType,omitempty" db:"auth_type"`
|
||
ProducerDict string `json:"producerDict,omitempty" db:"producer_dict"`
|
||
RegionDict string `json:"regionDict,omitempty" db:"region_dict"`
|
||
Location string `json:"location,omitempty" db:"location"`
|
||
CreateTime string `json:"createTime,omitempty" db:"created_time" gorm:"autoCreateTime"`
|
||
EnvPath string `json:"envPath,omitempty" db:"env_path"`
|
||
EnvLdPath string `json:"envLdPath,omitempty" db:"env_ld_path"`
|
||
WorkDir string `json:"workDir,omitempty" db:"work_dir"`
|
||
ProxyAddress string `json:"proxyAddress,omitempty" db:"proxy_address"`
|
||
}
|
||
)
|
||
|
||
type ClusterDelReq {
|
||
Id string `form:"id,optional"`
|
||
}
|
||
|
||
type ClusterResp {
|
||
List ClusterInfo `json:"list,omitempty"`
|
||
}
|
||
|
||
type ClusterListResp {
|
||
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"`
|
||
}
|
||
|
||
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"`
|
||
}
|
||
|
||
type adapterInfoNameReq {
|
||
AdapterId string `form:"adapterId,optional"`
|
||
}
|
||
|
||
type adapterInfoNameReqResp {
|
||
Code int32 `json:"code,omitempty"`
|
||
Msg string `json:"msg,omitempty"`
|
||
ErrorMsg string `json:"errorMsg,omitempty"`
|
||
InfoList InfoList `json:"infoList,omitempty"`
|
||
}
|
||
|
||
type InfoList {
|
||
Type string `json:"type,omitempty"`
|
||
ResourceType string `json:"resource_type,omitempty"`
|
||
TName string `json:"name,omitempty"`
|
||
InfoName string `json:"info_name,omitempty"`
|
||
}
|
||
|
||
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"`
|
||
}
|
||
|
||
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"`
|
||
}
|
||
|
||
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"`
|
||
}
|
||
|
||
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"`
|
||
}
|
||
|
||
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"`
|
||
}
|
||
|
||
DictItems {
|
||
List []DictItemInfo `json:"list,omitempty"`
|
||
}
|
||
|
||
DictCodeReq {
|
||
DictCode string `path:"dictCode"`
|
||
}
|
||
)
|
||
|
||
type (
|
||
CId {
|
||
Id string `path:"id":"id,omitempty" validate:"required"`
|
||
}
|
||
|
||
CIds {
|
||
Ids []string `json:"ids,omitempty" validate:"required"`
|
||
}
|
||
|
||
FId {
|
||
Id string `form:"id":"id,omitempty" validate:"required"`
|
||
}
|
||
)
|
||
|
||
type (
|
||
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"`
|
||
}
|
||
)
|
||
|
||
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"` // 更新时间
|
||
}
|
||
|
||
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"`
|
||
}
|
||
|
||
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"`
|
||
}
|
||
|
||
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"`
|
||
}
|
||
|
||
PushTaskInfoResp {
|
||
Code int64 `json:"code"`
|
||
Msg string `json:"msg"`
|
||
}
|
||
)
|
||
|
||
type (
|
||
PushResourceInfoReq {
|
||
AdapterId int64 `json:"adapterId"`
|
||
ResourceStats []ResourceStats `json:"resourceStats"`
|
||
}
|
||
|
||
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 {
|
||
}
|
||
|
||
ListNoticeResp {
|
||
Code int64 `json:"code"`
|
||
Msg string `json:"msg"`
|
||
Data []NoticeInfo `json:"data"`
|
||
}
|
||
|
||
PushNoticeReq {
|
||
NoticeInfo NoticeInfo `json:"noticeInfo"`
|
||
}
|
||
|
||
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"`
|
||
}
|
||
|
||
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"`
|
||
}
|
||
|
||
type TaskStatusResp {
|
||
Succeeded int `json:"Succeeded"`
|
||
Failed int `json:"Failed"`
|
||
Running int `json:"Running"`
|
||
Saved int `json:"Saved"`
|
||
}
|
||
|
||
type (
|
||
TaskDetailsResp {
|
||
Name string `json:"name"`
|
||
description string `json:"description"`
|
||
StartTime string `json:"startTime"`
|
||
EndTime string `json:"endTime"`
|
||
Strategy int64 `json:"strategy"`
|
||
SynergyStatus int64 `json:"synergyStatus"`
|
||
ClusterInfos []*ClusterInfo `json:"clusterInfos"`
|
||
SubTaskInfos []*SubTaskInfo `json:"subTaskInfos"`
|
||
TaskTypeDict string `json:"taskTypeDict"`
|
||
AdapterTypeDict string `json:"adapterTypeDict"`
|
||
}
|
||
|
||
SubTaskInfo {
|
||
Id string `json:"id" db:"id"`
|
||
Name string `json:"name" db:"name"`
|
||
ClusterId string `json:"clusterId" db:"cluster_id"`
|
||
ClusterName string `json:"clusterName" db:"cluster_name"`
|
||
Status string `json:"status" db:"status"`
|
||
Remark string `json:"remark" db:"remark"`
|
||
InferUrl string `json:"inferUrl"`
|
||
WorkDir string `json:"workDir"`
|
||
}
|
||
)
|
||
|
||
type (
|
||
CommonResp {
|
||
Code int `json:"code,omitempty"`
|
||
Msg string `json:"msg,omitempty"`
|
||
Data interface{} `json:"data,omitempty"`
|
||
}
|
||
)
|
||
|
||
type ResourceCost {
|
||
ID int64 `json:"id" gorm:"column:id;primaryKey;autoIncrement"`
|
||
ResourceID int64 `json:"resourceId" gorm:"column:resource_id"`
|
||
Price int `json:"price" gorm:"column:price"`
|
||
CostType string `json:"costType" gorm:"column:cost_type"`
|
||
ResourceType string `json:"resourceType" gorm:"column:resource_type"`
|
||
}
|
||
|
||
type ResourceCostRecord {
|
||
ID int64 `json:"id" gorm:"column:id;primaryKey;autoIncrement"`
|
||
ResourcePriceID int64 `json:"resourcePriceId" gorm:"column:resource_price_id"`
|
||
UserId int64 `json:"userId" gorm:"column:user_id"`
|
||
Amount int `json:"amount" gorm:"column:amount"`
|
||
StartTime string `json:"startTime" gorm:"column:start_time"`
|
||
EndTime string `json:"endTime" gorm:"column:end_time"`
|
||
Status int `json:"status" gorm:"column:status"`
|
||
UsageHours string `json:"usageHours" gorm:"column:usage_hours"`
|
||
}
|