作业

查询历史作业详情

1.接口说明

接口路径:/hpc/openapi/v2/historyjobs/{jobmanagerId}/{jobId}

请求方式:GET

请求数据类型:

接口描述:查询具体历史作业的详细信息

2.请求消息

请求参数:

Headers:

名称 类型 必填 描述 示例
tokenstring接口凭证eyJhbGciOiJIUzI1N...

参数:

名称 类型 必填 描述 示例
jobIdstring作业ID3
jobmanagerIdstring调度器ID1638523853
acctTimestring入账时间(结束时间),建议传入,能够提升查询性能2021-12-08 17:45:37

3.请求示例

cURL请求示例

curl --location 'https://api01.xxx.com:65106/hpc/openapi/v2/historyjobs/1638523853/35919' \
--header 'Content-Type: application/json' \
--header 'token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb21wdXRlVXNlciI6InNsdXJtdGVzdCIsImFjY291bnRTdGF0dXMiOiJUcmlhbCIsImNyZWF0b3IiOiJhYyIsInJvbGUiOiIxIiwiZXhwaXJlVGltZSI6IjE2ODU2MDAyMjU2MTUiLCJjbHVzdGVySWQiOiIxMTExMiIsImludm9rZXIiOiI2MDQ4Y2U3YmExNWMyYWYyZThjZWMxMjk5MWVjMTNjZiIsInVzZXIiOiJzbHVybXRlc3QiLCJ1c2VySWQiOiIxMTY1NTA0ODU0MSJ9.iLCKJ8PnDDK0_SA2NPYm1WozUG8D5ojwFqFhwaJCDc8'

Java请求示例

import okhttp3.*;

public class QueryHistoryJobDetailByIdDemo {

    public static final String TOKEN = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb21wdXRlVXNlciI6InNsdXJtdGVzdCIsImFjY291bnRTdGF0dXMiOiJUcmlhbCIsImNyZWF0b3IiOiJhYyIsInJvbGUiOiIxIiwiZXhwaXJlVGltZSI6IjE2ODY5MDg1MDkyMzEiLCJjbHVzdGVySWQiOiIxMTExMiIsImludm9rZXIiOiI2MDQ4Y2U3YmExNWMyYWYyZThjZWMxMjk5MWVjMTNjZiIsInVzZXIiOiJzbHVybXRlc3QiLCJ1c2VySWQiOiIxMTY1NTA0ODU0MSJ9.U7pZKgO_K6NuRwOWPxblDfgRpGeVxS-BYieOdLhGDK4";

    public static void main(String[] args) throws Exception {
        OkHttpClient client = new OkHttpClient().newBuilder()
                .build();
        Request request = new Request.Builder()
                .url("https://api01.xxx.com:65106/hpc/openapi/v2/historyjobs/1638523853/35919")
                .method("GET", null)
                .addHeader("Content-Type", "application/json")
                .addHeader("token", TOKEN)
                .build();
        Response response = client.newCall(request).execute();
        System.out.println(response.body().string());
    }
}

Python请求示例

import requests
import json

url = "https://api01.xxx.com:65106/hpc/openapi/v2/historyjobs/1638523853/35919"

payload = {}
headers = {
  'Content-Type': 'application/json',
  'token': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb21wdXRlVXNlciI6InNsdXJtdGVzdCIsImFjY291bnRTdGF0dXMiOiJUcmlhbCIsImNyZWF0b3IiOiJhYyIsInJvbGUiOiIxIiwiZXhwaXJlVGltZSI6IjE2ODU2MDAyMjU2MTUiLCJjbHVzdGVySWQiOiIxMTExMiIsImludm9rZXIiOiI2MDQ4Y2U3YmExNWMyYWYyZThjZWMxMjk5MWVjMTNjZiIsInVzZXIiOiJzbHVybXRlc3QiLCJ1c2VySWQiOiIxMTY1NTA0ODU0MSJ9.iLCKJ8PnDDK0_SA2NPYm1WozUG8D5ojwFqFhwaJCDc8'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

4.响应消息

返回参数:

名称 类型 描述 示例
msgstring信息success
codestring状态码0
dataobject历史作业对象
acctTimestring记账时间2021-11-03T13:56:56
appTypestring应用类型BASE
commandstring作业脚本的位置/public/home/test/BASE/STDIN_1104_175546/job_BASE.slurm
commandExiststring作业脚本是否存在true
cpuNuclearHourstringCPU核时0.1392
cpuNuclearSecstringCPU核秒501
cpuUnitPricedouble作业提交时当时的CPU单价1
dcuCardHourstringDCU卡时0
dcuCardSecstringDCU卡秒0
dcuUnitPricedouble作业提交时当时的DCU单价1
efficiencyCpustringCPU效率100.00%
exclusiveCputimelong作业独占的cputime,单位为秒,当作业为独占作业时有值,否则为00
exclusiveMemlong作业独占的mem ,单位kb,当作业为独占作业时有值,否则为00
exclusiveWalltimelong作业独占的walltime,单位为秒,当作业为独占作业时有值,否则为0 0
goldenablestring作业提交时当时的计费状态true/false/unknown
gpuCardHourstringGPU卡时0
gpuCardSecstringGPU卡秒0
gpuUnitPricedouble作业提交时当时的GPU单价1
groupNamestring用户组名test
historyAccountstring作业运行结束后当时作业提交者所属的账号test
historyQueueratestring作业提交时当时的队列费率1
isSinglejobstring是否为独占节点的作业false
jobCpuTimelong作业占用的CPU时间 ,单位为秒501
jobDcuNumlong作业使用的DCU数0
jobEndTimedate作业结束时间,对应属性end2021-11-04T18:04:10
jobExecGpusstring作业占用的Gpu节点
jobExecHoststring作业执行节点node248
jobExitStatuslong作业退出代码0
jobGpuNumlong作业使用的GPU核数0
jobIdstring作业ID12
jobMemUsedlong作业使用的物理内存数,单位kb3972
jobNamestring作业名STDIN_1104_175546
jobProcNumlong作业使用的处理器数(表示核数)1
jobQueueTimedate作业入队时间,对应记账属性qtime2021-11-04T17:55:49
jobReqCpudouble申请CPU1
jobReqDcudouble申请DCU0
jobReqGpudouble申请GPU0
jobReqMemstring申请内存2153M
jobReqNodesdouble申请节点数1
jobResponseTimelong作业响应时间JobEndTime-JobQueueTime,单位为秒501
jobStartTimedate作业启动时间,对应属性start2021-11-04T17:55:49
jobStatestring作业状态statE:退出,statC:完成,statDE:取消,statD:失败,statT:超时,statN:节点异常,statRQ:重新运行
jobVmemUsedlong作业使用的虚拟内存,单位kb1435680
jobWaitTimelong作业等待时间JobStartTime-JobQueueTime,单位为秒0
jobWalltimeUsedlong作业实际使用的Walltime,单位为秒501
jobmanagerIdlong区域ID1634819344
jobmanagerNamestring区域名称Cluster_node248
needNodesstring分配的节点名或节点数node248
nodectlong分配的节点数1
ownerstring作业拥有者test
queuestring队列debug
scalestring作业的规模
shareCputimelong作业共享的cputime,单位为秒,当作业为非独占作业时有值,否则为0501
shareMemlong作业共享的mem,单位kb,当作业为非独占作业时有值,否则为03972
shareWalltimelong作业共享的walltime,单位为秒,当作业为非独占作业时有值,否则为0501
isSinglejobboolean是否为独占节点的作业false
startCountstring作业的启动次数,在对应的数据库表中没有这个字段
userNamestring用户名test
walltimelong提交作业时请求的Walltime或系统默认的Walltime,单位为秒86400
workdirstring作业的工作路径/public/home/test/BASE/STDIN_1104_175546

返回示例:

{
    "code": "0",
    "msg": "success",
    "data": {
        "acctTime": "2021-12-10 15:14:28",
        "jobId": "24",
        "jobmanagerId": 1638523853,
        "jobmanagerName": "Cluster",
        "userName": "test",
        "groupName": "test",
        "jobName": "STDIN_0910_094758",
        "queue": "debug",
        "jobQueueTime": "2021-12-10 15:14:22",
        "jobStartTime": "2021-12-10 15:14:22",
        "owner": "test",
        "jobExecHost": "h04r3n07",
        "jobExecGpus": null,
        "needNodes": "h04r3n07",
        "nodect": 1,
        "walltime": 86400,
        "jobEndTime": "2021-12-10 15:14:28",
        "jobWaitTime": 0,
        "jobResponseTime": 6,
        "jobExitStatus": 0,
        "jobCpuTime": 6,
        "jobMemUsed": 3940,
        "jobVmemUsed": 1390000,
        "jobProcNum": 1,
        "jobGpuNum": 0,
        "jobWalltimeUsed": 6,
        "workdir": "/public/home/test/BASE/STDIN_1210_114429",
        "isSinglejob": false,
        "exclusiveWalltime": 0,
        "shareWalltime": 6,
        "exclusiveMem": 0,
        "shareMem": 3940,
        "exclusiveCputime": 0,
        "shareCputime": 6,
        "startCount": null,
        "historyQueuerate": 1.0,
        "historyAccount": null,
        "scale": null,
        "appType": "BASE",
        "goldenable": null,
        "cpuUnitPrice": 1.0,
        "gpuUnitPrice": 1.0,
        "dcuUnitPrice": 1.0,
        "jobDcuNum": 0,
        "command": "/public/home/test/BASE/STDIN_1210_114429/job_BASE.slurm",
        "jobReqMem": "3826M",
        "jobReqCpu": 1.0,
        "jobReqGpu": 0.0,
        "jobReqDcu": 0.0,
        "jobReqNodes": 1.0,
        "cpuNuclearHour": 0.0017,
        "cpuNuclearSec": 6.0,
        "gpuCardHour": 0.0,
        "gpuCardSec": 0.0,
        "dcuCardHour": 0.0,
        "dcuCardSec": 0.0,
        "commandExist": "true",
        "efficiencyCpu": "100.00%",
        "jobState": "statC",
        "stdout": null,
        "stderr": null,
        "jobExtAttr": null,
        "jobExecCpus": null,
        "jobExecDcus": null
    }
}

5.错误码

错误码 说明
0 成功
10001 内部错误
10003 参数不全
10004 参数无效
10007 用户已被冻结
10008 权限不足
10009 没有权限访问接口
10010 文件校验失败
10011 文件过大
10012 连接中断
10013 操作超时
815005 作业提交失败(调度系统没返回)
815007 作业提交失败(调度系统sbatch失败)

results matching ""

    No results matching ""