forked from JointCloud/JCC-CSScheduler
19 lines
658 B
Go
19 lines
658 B
Go
package mq
|
|
|
|
import (
|
|
"gitlink.org.cn/cloudream/common/consts/errorcode"
|
|
"gitlink.org.cn/cloudream/common/pkgs/logger"
|
|
"gitlink.org.cn/cloudream/common/pkgs/mq"
|
|
mgrmq "gitlink.org.cn/cloudream/scheduler/common/pkgs/mq/manager"
|
|
)
|
|
|
|
func (svc *Service) GetAllComputingCenter(msg *mgrmq.GetAllComputingCenter) (*mgrmq.GetAllComputingCenterResp, *mq.CodeMessage) {
|
|
ccs, err := svc.db.ComputingCenter().GetAll(svc.db.SQLCtx())
|
|
if err != nil {
|
|
logger.Warnf("getting all computing center: %s", err.Error())
|
|
return nil, mq.Failed(errorcode.OperationFailed, "get all computing center failed")
|
|
}
|
|
|
|
return mq.ReplyOK(mgrmq.NewGetAllComputingCenterResp(ccs))
|
|
}
|