|
|
|
@@ -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, |
|
|
|
}, |
|
|
|
|