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_ecs.go 1.2 kB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package server
  2. import (
  3. "context"
  4. "gitlink.org.cn/JCCE/PCM/adaptor/vm_adaptor/server/ecs"
  5. "gitlink.org.cn/JCCE/PCM/lan_trans/idl/pbecs"
  6. "github.com/golang/glog"
  7. "google.golang.org/grpc/codes"
  8. "google.golang.org/grpc/status"
  9. )
  10. // ListEcsDetail return ecs detail
  11. func (s *Server) ListEcsDetail(ctx context.Context, req *pbecs.ListDetailReq) (*pbecs.ListDetailResp, error) {
  12. resp, err := ecs.ListDetail(ctx, req)
  13. if err != nil {
  14. glog.Errorf("ListEcsDetail error %+v", err)
  15. return nil, status.Errorf(codes.Internal, err.Error())
  16. }
  17. return resp, nil
  18. }
  19. //ListEcs return ecs list
  20. func (s *Server) ListEcs(ctx context.Context, req *pbecs.ListReq) (*pbecs.ListResp, error) {
  21. resp, err := ecs.List(ctx, req)
  22. if err != nil {
  23. glog.Errorf("ListEcs error %+v", err)
  24. return nil, status.Errorf(codes.Internal, err.Error())
  25. }
  26. return resp, nil
  27. }
  28. // ListEcsAll return all ecs
  29. func (s *Server) ListEcsAll(ctx context.Context, req *pbecs.ListAllReq) (*pbecs.ListResp, error) {
  30. resp, err := ecs.ListAll(ctx)
  31. if err != nil {
  32. glog.Errorf("ListEcsAll error %+v", err)
  33. return nil, status.Errorf(codes.Internal, err.Error())
  34. }
  35. return resp, nil
  36. }

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.