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.

containercreatehandler.go 861 B

3 months ago
1234567891011121314151617181920212223242526272829303132
  1. package cloud
  2. import (
  3. "gitlink.org.cn/JointCloud/pcm-coordinator/internal/logic/cloud"
  4. "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result"
  5. "io"
  6. "k8s.io/apimachinery/pkg/util/json"
  7. "net/http"
  8. "gitlink.org.cn/JointCloud/pcm-coordinator/internal/svc"
  9. container "gitlink.org.cn/JointCloud/pcm-coordinator/internal/types/cloud"
  10. )
  11. func ContainerCreateHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
  12. return func(w http.ResponseWriter, r *http.Request) {
  13. var req container.CreateParam
  14. body, err := io.ReadAll(r.Body)
  15. if err != nil {
  16. result.ParamErrorResult(r, w, err)
  17. return
  18. }
  19. if err = json.Unmarshal(body, &req); err != nil {
  20. result.ParamErrorResult(r, w, err)
  21. return
  22. }
  23. l := cloud.NewContainerCreateLogic(r.Context(), svcCtx)
  24. resp, err := l.ContainerCreate(&req)
  25. result.HttpResult(r, w, resp, err)
  26. }
  27. }

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.