作业

查询用户资源限制

1.接口说明

接口路径:/hpc/openapi/v2/userquotas/userlimit

请求方式:GET

请求数据类型:

接口描述:查询用户资源限制

2.请求消息

请求参数:

Headers:

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

参数:

名称 类型 必填 描述 示例
strJobManagerIDstring调度器ID1638523853

3.请求示例

cURL请求示例

curl --location 'https://api01.xxx.com:65106/hpc/openapi/v2/userquotas/userlimit?strJobManagerID=1638523853' \
--header 'Content-Type: application/json' \
--header 'token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb21wdXRlVXNlciI6InNsdXJtdGVzdCIsImFjY291bnRTdGF0dXMiOiJUcmlhbCIsImNyZWF0b3IiOiJhYyIsInJvbGUiOiIxIiwiZXhwaXJlVGltZSI6IjE2ODU2MDAyMjU2MTUiLCJjbHVzdGVySWQiOiIxMTExMiIsImludm9rZXIiOiI2MDQ4Y2U3YmExNWMyYWYyZThjZWMxMjk5MWVjMTNjZiIsInVzZXIiOiJzbHVybXRlc3QiLCJ1c2VySWQiOiIxMTY1NTA0ODU0MSJ9.iLCKJ8PnDDK0_SA2NPYm1WozUG8D5ojwFqFhwaJCDc8'

Java请求示例

import okhttp3.*;

public class QueryUserResourceLimitDemo {

    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/userlimit?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/userlimit?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.响应消息

返回参数:

名称 类型 描述 示例
codestring返回码,0为正常0
msgstring异常信息success
dataarray队列数组
userNamestring用户名称
accountNamestring用户所关联的默认的账号名
userMaxCpuLong用户最大CPU核数,单位:个,如果未做限制,则值为-1-1
userMaxDcuLong用户最大DCU卡数,单位:个,如果未做限制,则值为-1-1
userMaxGpuLong用户最大GPU卡数,单位:个,如果未做限制,则值为-1-1
userMaxMluLong用户最大MLU卡数,单位:个,如果未做限制,则值为-1-1
userMaxMemLong用户最大内存,单位:m,如果未做限制,则值为-1-1
userMaxNodeLong用户最大节点数,单位:个,如果未做限制,则值为-1-1
userMaxSubmitJobLong用户最大提交作业数,单位:个,如果未做限制,则值为-1-1
userMaxRunJobLong用户最大运行作业数,单位:个,如果未做限制,则值为-1-1
accountMaxCpuLong账户最大CPU核数,单位:个,如果未做限制,则值为-1-1
accountMaxDcuLong账户最大DCU卡数,单位:个,如果未做限制,则值为-1-1
accountMaxGpuLong账户最大GPU卡数,单位:个,如果未做限制,则值为-1-1
accountMaxMluLong账户最大MLU卡数,单位:个,如果未做限制,则值为-1-1
accountMaxMemLong账户最大内存,单位:m,如果未做限制,则值为-1-1
accountMaxNodeLong账户最大节点数,单位:个,如果未做限制,则值为-1-1
accountMaxSubmitJobLong账户最大提交作业数,单位:个,如果未做限制,则值为-1-1
accountMaxRunJobLong账户最大运行作业数,单位:个,如果未做限制,则值为-1-1
userMinCpuLong用户最小CPU核数,单位:个,如果未做限制,则值为-1-1
userMinNodeLong用户最小节点数,单位:个,如果未做限制,则值为-1-1
maxWallTimeLong用户关联的glod账号的机时,机时单位:s,如果未做限制,则值为-1-1

返回示例:

{
    "code": "0",
    "msg": "success",
    "data": {
        "userName": null,
        "accountName": null,
        "userMaxCpu": -1,
        "userMaxDcu": -1,
        "userMaxGpu": -1,
        "userMaxMlu": -1,
        "userMaxMem": -1,
        "userMaxNode": -1,
        "userMaxSubmitJob": -1,
        "userMaxRunJob": -1,
        "accountMaxCpu": -1,
        "accountMaxDcu": -1,
        "accountMaxGpu": -1,
        "accountMaxMlu": -1,
        "accountMaxMem": -1,
        "accountMaxNode": -1,
        "accountMaxSubmitJob": -1,
        "accountMaxRunJob": -1,
        "userMinCpu": -1,
        "userMinNode": -1,
        "maxWallTime": -1
    }
}

5.错误码

错误码 说明
0 成功
10001 内部错误
10003 参数不全
10004 参数无效
10007 用户已被冻结
10008 权限不足
10009 没有权限访问接口
10010 文件校验失败
10012 连接中断
10013 操作超时

results matching ""

    No results matching ""