Browse Source

调整查询资源接口

pull/53/head
JeshuaRen 5 months ago
parent
commit
ce554566a0
2 changed files with 12 additions and 1 deletions
  1. +9
    -1
      sdks/pcmscheduler/jobset.go
  2. +3
    -0
      sdks/pcmscheduler/models.go

+ 9
- 1
sdks/pcmscheduler/jobset.go View File

@@ -11,7 +11,8 @@ import (
)

type GetClusterInfoReq struct {
IDs []schsdk.ClusterID `json:"clusterIDs"`
Type string `json:"type"`
IDs []schsdk.ClusterID `json:"clusterIDs"`
}

func (c *Client) GetClusterInfo(req GetClusterInfoReq, token string) ([]ClusterDetail, error) {
@@ -20,7 +21,14 @@ func (c *Client) GetClusterInfo(req GetClusterInfoReq, token string) ([]ClusterD
return nil, err
}

resourceType := Train
if req.Type != "" {
resourceType = req.Type
}
resp, err := http2.PostJSON(targetUrl, http2.RequestParam{
Body: GetClusterInfoReq{
Type: resourceType,
},
Header: map[string]string{
"Authorization": token,
},


+ 3
- 0
sdks/pcmscheduler/models.go View File

@@ -97,6 +97,9 @@ const (
NodeTypeAICreate = "ai_job_create"
NodeTypeAIJobRun = "ai_job_run"
NodeTypeNotify = "notify"

Inference = "Inference"
Train = "Train"
)

type TaskID int64


Loading…
Cancel
Save