forked from JointCloud/pcm-ac
36 lines
1015 B
Go
36 lines
1015 B
Go
package logic
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"github.com/zeromicro/go-zero/core/logx"
|
|
"gitlink.org.cn/JointCloud/pcm-ac/hpcAC"
|
|
"gitlink.org.cn/JointCloud/pcm-ac/internal/common"
|
|
"gitlink.org.cn/JointCloud/pcm-ac/internal/pkg/utils"
|
|
"gitlink.org.cn/JointCloud/pcm-ac/internal/svc"
|
|
)
|
|
|
|
type QueryQueueDetailsLogic struct {
|
|
ctx context.Context
|
|
svcCtx *svc.ServiceContext
|
|
logx.Logger
|
|
}
|
|
|
|
func NewQueryQueueDetailsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *QueryQueueDetailsLogic {
|
|
return &QueryQueueDetailsLogic{
|
|
ctx: ctx,
|
|
svcCtx: svcCtx,
|
|
Logger: logx.WithContext(ctx),
|
|
}
|
|
}
|
|
|
|
// QueryQueueDetails 查询队列资源详细信息
|
|
func (l *QueryQueueDetailsLogic) QueryQueueDetails(in *hpcAC.QueueReq) (*hpcAC.QueueDetailsResp, error) {
|
|
resp := hpcAC.QueueDetailsResp{}
|
|
url := fmt.Sprintf("/hpc/openapi/v2/userquotas/queues?strJobManagerID=%s", in.StrJobManagerID)
|
|
token := common.GetToken()
|
|
_, _ = utils.Get(token, common.HpcCenterUrlPrefix(), url, nil, nil, &resp)
|
|
|
|
return &resp, nil
|
|
}
|