You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

middleware.go 811 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. package jcs
  2. import (
  3. "gitlink.org.cn/JointCloud/pcm-openi/common"
  4. )
  5. type JobStatusReportReq struct {
  6. TaskName string `json:"taskName"`
  7. TaskID string `json:"taskID"`
  8. Messages []*ReportMessage `json:"messages"`
  9. }
  10. type ReportMessage struct {
  11. Status bool `json:"status"`
  12. Message string `json:"message"`
  13. ClusterID string `json:"clusterID"`
  14. Output string `json:"output"`
  15. }
  16. func StatusReport(url string, report *JobStatusReportReq) error {
  17. resp := struct {
  18. Code int `json:"code"`
  19. Msg string `json:"msg"`
  20. Data interface{} `json:"data"`
  21. }{}
  22. req := common.GetRestyRequest(common.TIMEOUT)
  23. _, err := req.
  24. SetHeader("Content-Type", "application/json").
  25. SetBody(&report).
  26. SetResult(&resp).
  27. Post(url)
  28. if err != nil {
  29. return err
  30. }
  31. return nil
  32. }

PCM is positioned as Software stack over Cloud, aiming to build the standards and ecology of heterogeneous cloud collaboration for JCC in a non intrusive and autonomous peer-to-peer manner.