作业
查询队列资源详细信息
1.接口说明
接口路径:/hpc/openapi/v2/userquotas/queues
请求方式:GET
请求数据类型:
接口描述:查询所有队列资源详细信息
2.请求消息
请求参数:
Headers:
名称 | 类型 | 必填 | 描述 | 示例 |
---|---|---|---|---|
token | string | 是 | 接口凭证 | eyJhbGciOiJIUzI1N... |
参数:
名称 | 类型 | 必填 | 描述 | 示例 |
---|---|---|---|---|
strJobManagerID | string | 是 | 调度器ID | 1638523853 |
3.请求示例
cURL请求示例
curl --location 'https://api01.xxx.com:65106/hpc/openapi/v2/userquotas/queues?strJobManagerID=1638523853' \
--header 'Content-Type: application/json' \
--header 'token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb21wdXRlVXNlciI6InNsdXJtdGVzdCIsImFjY291bnRTdGF0dXMiOiJUcmlhbCIsImNyZWF0b3IiOiJhYyIsInJvbGUiOiIxIiwiZXhwaXJlVGltZSI6IjE2ODU2MDAyMjU2MTUiLCJjbHVzdGVySWQiOiIxMTExMiIsImludm9rZXIiOiI2MDQ4Y2U3YmExNWMyYWYyZThjZWMxMjk5MWVjMTNjZiIsInVzZXIiOiJzbHVybXRlc3QiLCJ1c2VySWQiOiIxMTY1NTA0ODU0MSJ9.iLCKJ8PnDDK0_SA2NPYm1WozUG8D5ojwFqFhwaJCDc8'
Java请求示例
import okhttp3.*;
public class QueryQueueResourceListDemo {
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/userquotas/queues?strJobManagerID=1638523853")
.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/userquotas/queues?strJobManagerID=1638523853"
payload = {}
headers = {
'Content-Type': 'application/json',
'token': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb21wdXRlVXNlciI6InNsdXJtdGVzdCIsImFjY291bnRTdGF0dXMiOiJUcmlhbCIsImNyZWF0b3IiOiJhYyIsInJvbGUiOiIxIiwiZXhwaXJlVGltZSI6IjE2ODU2MDAyMjU2MTUiLCJjbHVzdGVySWQiOiIxMTExMiIsImludm9rZXIiOiI2MDQ4Y2U3YmExNWMyYWYyZThjZWMxMjk5MWVjMTNjZiIsInVzZXIiOiJzbHVybXRlc3QiLCJ1c2VySWQiOiIxMTY1NTA0ODU0MSJ9.iLCKJ8PnDDK0_SA2NPYm1WozUG8D5ojwFqFhwaJCDc8'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
4.响应消息
返回参数:
名称 | 类型 | 描述 | 示例 |
---|---|---|---|
code | string | 返回码,0为正常 | 0 |
msg | string | 异常信息 | success |
data | array | 队列数组 | |
queNodes | string | 队列节点总数 | 3 |
queMinNodect | string | 队列最小节点数 | 1 |
queMaxNgpus | string | 队列最大GPU卡数 | 0 |
queMaxPPN | string | 使用该队列作业最大CPU核心数 | 4 |
queChargeRate | string | 费率 | 1 |
queMaxNcpus | string | 用户最大可用核心数 | 4 |
queMaxNdcus | string | 队列总DCU卡数 | 0 |
queueName | string | 队列名称 | debug |
queMinNcpus | string | 队列最小CPU核数 | 1 |
queFreeNodes | string | 队列空闲节点数 | 1 |
queMaxNodect | string | 队列作业最大节点数 | 1 |
queMaxGpuPN | string | 队列单作业最大GPU卡数 | 0 |
queMaxWalltime | string | 队列最大运行时间 | unlimit |
queMaxDcuPN | string | 队列单作业最大DCU卡数 | 0 |
返回示例:
{
"code": "0",
"msg": "success",
"data": [
{
"queNodes": "1",
"queMinNodect": "1",
"queMaxNgpus": "0",
"queMaxPPN": "32",
"queChargeRate": "1",
"queMaxNcpus": "32",
"queMaxNdcus": "4",
"queueName": "debug",
"queMinNcpus": "1",
"queFreeNodes": "0",
"queMaxNodect": "1",
"queMaxGpuPN": "0",
"queMaxWalltime": "unlimit",
"queMaxDcuPN": "4"
},
{
"queNodes": "1",
"queMinNodect": "1",
"queMaxNgpus": "0",
"queMaxPPN": "32",
"queChargeRate": "1",
"queMaxNcpus": "32",
"queMaxNdcus": "4",
"queueName": "normal",
"queMinNcpus": "1",
"queFreeNodes": "0",
"queMaxNodect": "1",
"queMaxGpuPN": "0",
"queMaxWalltime": "unlimit",
"queMaxDcuPN": "4"
},
{
"queNodes": "1",
"queMinNodect": "1",
"queMaxNgpus": "0",
"queMaxPPN": "32",
"queChargeRate": "1",
"queMaxNcpus": "32",
"queMaxNdcus": "4",
"queueName": "operation",
"queMinNcpus": "1",
"queFreeNodes": "0",
"queMaxNodect": "1",
"queMaxGpuPN": "0",
"queMaxWalltime": "unlimit",
"queMaxDcuPN": "4"
}
]
}
5.错误码
错误码 | 说明 |
---|---|
0 | 成功 |
10001 | 内部错误 |
10003 | 参数不全 |
10004 | 参数无效 |
10007 | 用户已被冻结 |
10008 | 权限不足 |
10009 | 没有权限访问接口 |
10010 | 文件校验失败 |
10011 | 文件过大 |
10012 | 连接中断 |
10013 | 操作超时 |
815005 | 作业提交失败(调度系统没返回) |
815007 | 作业提交失败(调度系统sbatch失败) |