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.

server_pod.go 1.7 kB

3 years ago
3 years ago
3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. package server
  2. import (
  3. "context"
  4. "gitlink.org.cn/JCCE/PCM/adaptor/pod_adaptor/server/pod"
  5. "gitlink.org.cn/JCCE/PCM/lan_trans/idl/pbpod"
  6. "github.com/golang/glog"
  7. "google.golang.org/grpc/codes"
  8. "google.golang.org/grpc/status"
  9. )
  10. func (s *Server) CreatePod(ctx context.Context, req *pbpod.CreatePodReq) (*pbpod.CreatePodResp, error) {
  11. resp, err := pod.CreatePod(ctx, req)
  12. if err != nil {
  13. glog.Errorf("CreatePod error %+v", err)
  14. return nil, status.Errorf(codes.Internal, err.Error())
  15. }
  16. return resp, nil
  17. }
  18. func (s *Server) DeletePod(ctx context.Context, req *pbpod.DeletePodReq) (*pbpod.DeletePodResp, error) {
  19. resp, err := pod.DeletePod(ctx, req)
  20. if err != nil {
  21. glog.Errorf("DeletePod error %+v", err)
  22. return nil, status.Errorf(codes.Internal, err.Error())
  23. }
  24. return resp, nil
  25. }
  26. func (s *Server) ListPodDetail(ctx context.Context, req *pbpod.ListPodDetailReq) (*pbpod.ListPodDetailResp, error) {
  27. resp, err := pod.ListPodDetail(ctx, req)
  28. if err != nil {
  29. glog.Errorf("ListPodDetail error %+v", err)
  30. return nil, status.Errorf(codes.Internal, err.Error())
  31. }
  32. return resp, nil
  33. }
  34. func (s *Server) ListPod(ctx context.Context, req *pbpod.ListPodReq) (*pbpod.ListPodResp, error) {
  35. resp, err := pod.ListPod(ctx, req)
  36. if err != nil {
  37. glog.Errorf("ListPod error %+v", err)
  38. return nil, status.Errorf(codes.Internal, err.Error())
  39. }
  40. return resp, nil
  41. }
  42. func (s *Server) ListPodAll(ctx context.Context, req *pbpod.ListPodAllReq) (*pbpod.ListPodResp, error) {
  43. resp, err := pod.ListPodAll(ctx)
  44. if err != nil {
  45. glog.Errorf("ListPodAll error %+v", err)
  46. return nil, status.Errorf(codes.Internal, err.Error())
  47. }
  48. return resp, nil
  49. }

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.