|
- package jcs
-
- import (
- "gitlink.org.cn/JointCloud/pcm-openi/common"
- )
-
- type JobStatusReportReq struct {
- TaskName string `json:"taskName"`
- TaskID string `json:"taskID"`
- Messages []*ReportMessage `json:"messages"`
- }
- type ReportMessage struct {
- Status bool `json:"status"`
- Message string `json:"message"`
- ClusterID string `json:"clusterID"`
- Output string `json:"output"`
- }
-
- func StatusReport(url string, report *JobStatusReportReq) error {
- resp := struct {
- Code int `json:"code"`
- Msg string `json:"msg"`
- Data interface{} `json:"data"`
- }{}
-
- req := common.GetRestyRequest(common.TIMEOUT)
- _, err := req.
- SetHeader("Content-Type", "application/json").
- SetBody(&report).
- SetResult(&resp).
- Post(url)
-
- if err != nil {
- return err
- }
-
- return nil
- }
|