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.

gethpcappclusterlogic.go 999 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. package hpc
  2. import (
  3. "context"
  4. "github.com/rs/zerolog/log"
  5. "gitlink.org.cn/JointCloud/pcm-coordinator/internal/svc"
  6. "gitlink.org.cn/JointCloud/pcm-coordinator/internal/types"
  7. "github.com/zeromicro/go-zero/core/logx"
  8. )
  9. type GetHpcAppClusterLogic struct {
  10. logx.Logger
  11. ctx context.Context
  12. svcCtx *svc.ServiceContext
  13. }
  14. func NewGetHpcAppClusterLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetHpcAppClusterLogic {
  15. return &GetHpcAppClusterLogic{
  16. Logger: logx.WithContext(ctx),
  17. ctx: ctx,
  18. svcCtx: svcCtx,
  19. }
  20. }
  21. func (l *GetHpcAppClusterLogic) GetHpcAppCluster(req *types.HpcAppClusterReq) (resp *types.ListResult, err error) {
  22. resp = &types.ListResult{}
  23. var clusterIds []string
  24. err = l.svcCtx.DbEngin.Table("hpc_app_template").Distinct("cluster_id").
  25. Where(" app = ? and status = 1 and deleted_at is null", req.App).
  26. Find(&clusterIds).Error
  27. if err != nil {
  28. log.Error().Msgf("GetHpcAppCluster err:%v", err)
  29. return nil, err
  30. }
  31. resp.List = clusterIds
  32. return
  33. }

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.