查询p端列表信息

Former-commit-id: 4da76886f5de6c1939d5d9011acc37fc237d4043
This commit is contained in:
zhangwei 2023-09-06 16:22:20 +08:00
parent 7313ee2446
commit ae939a78a0
4 changed files with 82 additions and 48 deletions

View File

@ -402,17 +402,17 @@ type (
}
)
type(
ComputilityStatisticsResp{
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"` //集群总数
DomainSum int64 `json:"domainSum"` //域总数
TotalComputility float64 `json:"totalComputility"` //算力总和
ClusterNum int64 `json:"clusterNum"` //集群总数
}
)
@ -458,13 +458,13 @@ type NodeAsset {
}
type SaveHashcatReq {
CrackTaskId string `json:"crackTaskId"` // 任务id
CrackTaskId string `json:"crackTaskId"` // 任务id
CrackContainerId string `json:"crackContainerId"` // 容器id
CrackStatus string `json:"crackStatus"` // 状态
CrackStartTime string `json:"crackStartTime"` //开始时间
CrackEstimatedTime string `json:"crackEstimatedTime"` // 预计时间
CrackProgress string `json:"crackProgress"` // 进度
CrackResult string `json:"crackResult"` // 结果
CrackStatus string `json:"crackStatus"` // 状态
CrackStartTime string `json:"crackStartTime"` //开始时间
CrackEstimatedTime string `json:"crackEstimatedTime"` // 预计时间
CrackProgress string `json:"crackProgress"` // 进度
CrackResult string `json:"crackResult"` // 结果
}
type getHashcatHandlerReq {
@ -476,11 +476,23 @@ type getHashcatHandlerResp {
}
type HashCat {
CrackTaskId string `json:"crackTaskId"` // 任务id
CrackTaskId string `json:"crackTaskId"` // 任务id
CrackContainerId string `json:"crackContainerId"` // 容器id
CrackStatus string `json:"crackStatus"` // 状态
CrackStartTime string `json:"crackStartTime"` //开始时间
CrackEstimatedTime string `json:"crackEstimatedTime"` // 预计时间
CrackProgress string `json:"crackProgress"` // 进度
CrackResult string `json:"crackResult"` // 结果
CrackStatus string `json:"crackStatus"` // 状态
CrackStartTime string `json:"crackStartTime"` //开始时间
CrackEstimatedTime string `json:"crackEstimatedTime"` // 预计时间
CrackProgress string `json:"crackProgress"` // 进度
CrackResult string `json:"crackResult"` // 结果
}
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"`
}

View File

@ -23,57 +23,61 @@ info(
group : core
)
service pcm {
@handler participantListHandler
get /core/participantList () returns (participantListResp)
@handler scheduleTaskByYamlHandler
post /core/scheduleTaskByYaml (scheduleTaskByYamlReq) returns ()
@handler scheduleTaskHandler
post /core/scheduleTask (scheduleTaskReq) returns ()
@handler TaskListHandler
get /core/taskList () returns (taskListResp)
@handler JobTotalHandler
get /core/jobTotal () returns (jobTotalResp)
@handler listCenterHandler
get /core/listCenter () returns (listCenterResp)
@handler listClusterHandler
get /core/listCluster/:centerId (listClusterReq) returns (listClusterResp)
@handler submitJobHandler
post /core/submitJob (submitJobReq) returns (submitJobResp)
@handler getRegionHandler
get /core/getRegion () returns (getRegionResp)
@handler listRegionHandler
get /core/listRegion () returns (listRegionResp)
@handler getComputingPowerHandler
get /core/getComputingPower returns (cpResp)
@handler getGeneralInfoHandler
get /core/getGeneralInfo () returns (GiResp)
@handler listDomainResourceHandler
get /core/listDomainResource returns (DomainResourceResp)
@handler getResourcePanelConfigHandler
get /core/getResourcePanelConfigHandler () returns (ResourcePanelConfigResp)
@handler putResourcePanelConfigHandler
put /core/resourcePanelConfigHandler (ResourcePanelConfigReq) returns ()
@handler getComputilityStatisticsHandler
get /core/getComputilityStatistics () returns (ComputilityStatisticsResp)
@handler nodeAssetsHandler
get /core/assets () returns (NodeAssetsResp)
@handler saveHashcatHandler
post /core/saveHashcat (SaveHashcatReq) returns ()
@handler getHashcatHandler
get /core/getHashcat/:crackTaskId (getHashcatHandlerReq) returns (getHashcatHandlerResp)
}
@ -86,10 +90,10 @@ service pcm {
service pcm {
@handler listJobHandler
get /hpc/listJob (listJobReq) returns (listJobResp)
@handler listHistoryJobHandler
get /hpc/listHistoryJob (listHistoryJobReq) returns (listHistoryJobResp)
@handler queueAssetsHandler
get /queue/assets () returns (QueueAssetsResp)
}
@ -102,7 +106,7 @@ service pcm {
service pcm {
@handler cloudListHandler
get /task/list () returns (cloudListResp)
@handler deleteYamlHandler
get /cloud/DeleteYaml (ApplyReq) returns (DeleteResp)
}
@ -115,10 +119,10 @@ service pcm {
service pcm {
@handler listDataSetHandler
get /ai/listDataSet/:projectId (DataSetReq) returns (DataSetResp)
@handler CreateDataSetHandler
post /ai/createDataSet/:projectId (CreateDataSetReq) returns (CreateDataSetResp)
@handler DeleteDataSetHandler
delete /ai/deleteDataSet/:projectId/:datasetId (DeleteDataSetReq) returns (DeleteDataSetResp)
// creat task 创建导入任务
@ -149,7 +153,7 @@ service pcm {
// ShowAlgorithmByUuid 展示算法详情
@handler ShowAlgorithmByUuid
get /ai/ShowAlgorithmByUuid/:projectId/:algorithmId (ShowAlgorithmByUuidReq) returns (ShowAlgorithmByUuidResp)
// creat export task 创建导出任务
@handler CreateExportTaskHandler
post /ai/CreateExportTask/:projectId/:datasetId (CreateExportTaskReq) returns (ExportTaskDataResp)
@ -157,11 +161,11 @@ service pcm {
get /ai/GetExportTasksOfDataset/:projectId/:datasetId (GetExportTasksOfDatasetReq) returns (GetExportTasksOfDatasetResp)
@handler GetExportTaskStatusOfDatasetHandler
get /ai/GetExportTaskStatusOfDataset/:projectId/:resourceId/:taskId (GetExportTaskStatusOfDatasetReq) returns (GetExportTaskStatusOfDatasetResp)
// create processor task 创建处理任务
@handler CreateProcessorTaskHandler
post /ai/CreateProcessorTask (CreateProcessorTaskReq) returns (CreateProcessorTaskResp)
// create service 创建服务
@handler CreateServiceHandler
post /ai/CreateService/:projectId (CreateServiceReq) returns (CreateServiceResp)
@ -177,7 +181,7 @@ service pcm {
// ListClusters查询专属资源池列表
@handler ListClustersHandler
get /ai/ListClusters (ListClustersReq) returns (ListClustersResp)
/******************Notebook Method start*************************/
@handler listNotebookHandler
get /ai/listNotebook (ListNotebookReq) returns (ListNotebookResp)
@ -192,7 +196,7 @@ service pcm {
@handler mountNotebookStorageHandler
post /ai/mountNotebookStorage (MountNotebookStorageReq) returns (MountNotebookStorageResp)
/******************Notebook Method end*************************/
/******************Visualization Job Method start*************************/
@handler getVisualizationJobHandler
get /ai/getVisualizationJob (GetVisualizationJobReq) returns (GetVisualizationJobResp)
@ -223,16 +227,16 @@ service pcm {
service pcm {
@handler uploadHandler
post /upload () returns ()
@handler chunkHandler
post /chunk () returns ()
@handler imageListHandler
get /image/list () returns (imageListResp)
@handler dataSetCheckHandler
get /dataSet/check/:fileMd5 (checkReq) returns (checkResp)
@handler uploadDataSetHandler
post /dataSet/upload () returns ()
}

View File

@ -19,6 +19,11 @@ import (
func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
server.AddRoutes(
[]rest.Route{
{
Method: http.MethodGet,
Path: "/core/participantList",
Handler: core.ParticipantListHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/core/scheduleTaskByYaml",

View File

@ -454,6 +454,19 @@ type HashCat struct {
CrackResult string `json:"crackResult"` // 结果
}
type ParticipantListResp struct {
Participants []Participant `json:"participants"`
}
type Participant struct {
Id int64 `json:"id"`
Name string `json:"name"`
Address string `json:"address"`
MetricsUrl string `json:"metricsUrl"`
TenantName string `json:"tenantName"`
TypeName string `json:"typeName"`
}
type Job struct {
SlurmVersion string `json:"slurmVersion"`
Name string `json:"name"`