token获取
使用scontrol token 获取token
XSLURM_JWT=`scontrol token`
USER=`whoami`
提交作业
curl -X POST ${SLURM_URL}/slurm/v0.0.38/job/submit \
-H "X-SLURM-USER-NAME:${USER}" \
-H "X-SLURM-USER-TOKEN:${XSLURM_JWT}" \
-H "Content-Type: application/json" \
-d @- <<- EOF
{
"script": "#!/bin/bash\nuptime",
"job": {
"name": "test slurmrestd job",
"environment": {"USER": "${USER}"},
"tasks": 1,
"nodes": "1",
"partition": "test",
"current_working_directory": "/root"
}
}
EOF
效果截图



853

被折叠的 条评论
为什么被折叠?



