Signed-off-by: jagger <cossjie@foxmail.com>
This commit is contained in:
jagger 2025-04-09 15:45:18 +08:00
parent 0392ad0b61
commit e08af3984a
3 changed files with 11 additions and 16 deletions

View File

@ -18,6 +18,7 @@ type (
OperateType string `json:"operateType,optional"`
Parameters map[string]string `json:"parameters"`
CustomParams map[string]string `json:"customParams"`
ScriptContent string `json:"scriptContent,optional"`
}
)

View File

@ -76,14 +76,7 @@ func (c *ParticipantHpc) SubmitTask(ctx context.Context, req types.CommitHpcTask
resp := types.CommitHpcTaskResp{}
httpClient := resty.New().R()
_, err := httpClient.SetHeader("Content-Type", "application/json").
SetBody(map[string]interface{}{
"name": req.Name, // 应用名称: BWA/lammps
"backend": req.Backend, // 后端类型slurm/sugonac
"app": req.App, // 超算应用: bwa/lammps
"operateType": req.OperateType, // 应用内操作类型: bwa:构建索引/对比序列
"parameters": req.Parameters, // 通用参数
"customParams": req.CustomParams, // 各平台自定义参数
}).
SetBody(req).
SetResult(&resp).
Post(reqUrl)
if err != nil {

View File

@ -1307,14 +1307,15 @@ type ResourceCostRecord struct {
}
type CommitHpcTaskReq struct {
Name string `json:"name"`
Backend string `json:"backend"`
ClusterId string `json:"clusterId"`
App string `json:"app"`
Description string `json:"description,optional"`
OperateType string `json:"operateType,optional"`
Parameters map[string]string `json:"parameters"`
CustomParams map[string]string `json:"customParams"`
Name string `json:"name"`
Backend string `json:"backend"`
ClusterId string `json:"clusterId"`
App string `json:"app"`
Description string `json:"description,optional"`
OperateType string `json:"operateType,optional"`
Parameters map[string]string `json:"parameters"`
CustomParams map[string]string `json:"customParams"`
ScriptContent string `json:"scriptContent,optional"`
}
type CommitHpcTaskResp struct {