作业

查询用户共享存储配额及使用量

1.接口说明

接口路径:/hpc/openapi/v2/parastor/quota/usernames/{username}

请求方式:GET

请求数据类型:

接口描述:查询用户的共享存储配额量及使用量

2.请求消息

请求参数:

Headers:

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

参数:

名称 类型 必填 描述 示例
usernamestring区域用户名test

3.请求示例

cURL请求示例

curl --location 'https://api01.xxx.com:65106/hpc/openapi/v2/parastor/quota/usernames/test' \
--header 'Content-Type: application/json' \
--header 'token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb21wdXRlVXNlciI6InNsdXJtdGVzdCIsImFjY291bnRTdGF0dXMiOiJUcmlhbCIsImNyZWF0b3IiOiJhYyIsInJvbGUiOiIxIiwiZXhwaXJlVGltZSI6IjE2ODYwMzY3NjA5NTQiLCJjbHVzdGVySWQiOiIxMTExMiIsImludm9rZXIiOiI2MDQ4Y2U3YmExNWMyYWYyZThjZWMxMjk5MWVjMTNjZiIsInVzZXIiOiJzbHVybXRlc3QiLCJ1c2VySWQiOiIxMTY1NTA0ODU0MSJ9.f7nvKA2DqTsXjqF90zblMhwx0zKPpITY0uuSG2ouKG0'

Java请求示例

import okhttp3.*;

public class QueryQuotaAndUsageOfSharedStorageDemo {

    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/parastor/quota/usernames/test")
                .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/parastor/quota/usernames/test"

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

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

print(response.text)

4.响应消息

返回参数:

名称 类型 描述 示例
codestring返回码,0为正常0
msgstring信息success
dataarray返回存储数组
usernamestring用户名test
pathstring共享存储配额路径/public/home/test
thresholddouble共享存储配额量,单位GB700
usagedouble共享存储使用量,单位GB398.56

返回示例:

{
    "code": "0",
    "msg": "success",
    "data": [{
        "username": "test",
        "path": "/public/home/test",
        "threshold": 700,
        "usage": 398.56
    }]
}

5.错误码

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

results matching ""

    No results matching ""