forked from JointCloud/pcm-coordinator
31 lines
946 B
Go
31 lines
946 B
Go
package slurmer
|
|
|
|
import (
|
|
pbslurm "code.gitlink.org.cn/JCCE/PCM.git/adaptor/pcm_slurm/gen/idl"
|
|
"code.gitlink.org.cn/JCCE/PCM.git/adaptor/pcm_slurm/service/tianhe"
|
|
"context"
|
|
)
|
|
|
|
func (slurmStruct SlurmStruct) GetAllJobs(ctx context.Context, req *pbslurm.JobInfoMsgReq) (*pbslurm.JobInfoMsgResp, error) {
|
|
job_info_msg := tianhe.Get_all_jobs()
|
|
var resp = pbslurm.JobInfoMsgResp{}
|
|
resp.JobInfoMsg = &job_info_msg
|
|
|
|
return &resp, nil
|
|
}
|
|
|
|
func (slurmStruct SlurmStruct) GetJob(ctx context.Context, req *pbslurm.JobInfoMsgReq) (*pbslurm.JobInfoMsgResp, error) {
|
|
job_info_msg := tianhe.Get_job(req.JobId)
|
|
var resp = pbslurm.JobInfoMsgResp{}
|
|
resp.JobInfoMsg = &job_info_msg
|
|
|
|
return &resp, nil
|
|
}
|
|
|
|
func (slurmStruct SlurmStruct) DeleteJob(ctx context.Context, req *pbslurm.DeleteJobReq) (*pbslurm.DeleteJobResp, error) {
|
|
errorCode := tianhe.Delete_job(req.JobId)
|
|
var resp = pbslurm.DeleteJobResp{}
|
|
resp.ErrorCode = errorCode
|
|
return &resp, nil
|
|
}
|