Notebook
查询Notebook资源
1.接口说明
接口路径:/ac/openapi/v2/resources/accelerators
请求方式:GET
请求数据类型:
接口描述:查询Notebook资源信息
2.请求消息
请求参数:
Headers:
| 名称 | 类型 | 必填 | 描述 | 示例 |
|---|---|---|---|---|
| token | string | 是 | 接口凭证 | eyJhbGciOiJIUzI1N... |
参数:
| 名称 | 类型 | 必填 | 描述 | 示例 |
|---|---|---|---|---|
| clusterIds | array | 是 | 区域ID | 11250,20057 |
| resourceId | string | 否 | 资源ID | Intel8458P-88C-2T-8*L20 |
3.请求示例
cURL请求示例
shell
curl --location 'https://scnet-demo.accloud.cn/ac/openapi/v2/resources/accelerators?clusterIds=11250&resourceId=Intel8458P-88C-2T-8*L20' \
--header 'token: <Token>' \
--data ''Java请求示例
java
import okhttp3.*;
public class GetAcceleratorsDemo {
public static final String TOKEN = "<Token>";
public static final String URL = "https://scnet-demo.accloud.cn/ac/openapi/v2/resources/accelerators?clusterIds=11250&resourceId=Intel8458P-88C-2T-8*L20";
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient().newBuilder().build();
Request request = new Request.Builder()
.url(URL)
.method("GET", null)
.addHeader("token", TOKEN)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}Python请求示例
python
import requests
url = "https://scnet-demo.accloud.cn/ac/openapi/v2/resources/accelerators?clusterIds=11250&resourceId=Intel8458P-88C-2T-8*L20"
payload = {}
headers = {
"token": "<Token>"
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)4.响应消息
返回参数:
| 名称 | 类型 | 描述 | 示例 |
|---|---|---|---|
| msg | string | 信息 | success |
| code | string | 状态码 | 0 |
| data | array | ||
| id | string | 资源ID | |
| resourceGroupCode | string | 资源分组code | nvl20normalc1691523 |
| resourceGroupName | string | 资源分组名称 | nvl20normal |
| clusterId | string | 区域ID | 11250 |
| clusterName | string | 区域名称 | 华东一区【昆山】 |
| maxNum | int | 单节点最大卡数 | 8 |
| maxFreeNum | int | 单节点最大空闲卡数 | 0 |
| cpuNumber | string | 核心数 | 10核 |
| ramSize | string | 内存大小 | 220GB |
| goodsId | string | 商品ID | 792536159556206592 |
| resourceId | String | 资源ID | Intel8458P-88C-2T-8*L20 |
| resourceType | string | 资源类型 | GPU |
| resourceName | string | 资源名称 | NVIDIA L20 显存48GB PCIE |
| resourceSpec | string | 资源详情 | {\"memory\": \"2048GB\", \"类别\": \"552\", \"cpuCore\": \"88核\", \"gpuModel\": \"L20\", \"gpuMemory\": \"48GB\", \"processor\": \"2*Intel 8458P 44C\", \"cudaVersion\": \"12.2\", \"应用场景\": \"人工智能\"} |
返回示例:
json
{
"code": "0",
"msg": "success",
"data": [
{
"id": "12",
"resourceGroupCode": "nvl20normalc1691523",
"resourceGroupName": "nvl20normal",
"clusterId": 11250,
"clusterName": "华东一区【昆山】",
"maxNum": 8,
"maxFreeNum": 0,
"cpuNumber": "10核",
"ramSize": "220GB",
"goodsId": "792536159556206592",
"resourceId": "Intel8458P-88C-2T-8*L20",
"resourceType": "GPU",
"resourceName": "NVIDIA L20 显存48GB PCIE",
"resourceSpec": "{\"memory\": \"2048GB\", \"类别\": \"552\", \"cpuCore\": \"88核\", \"gpuModel\": \"L20\", \"gpuMemory\": \"48GB\", \"processor\": \"2*Intel 8458P 44C\", \"cudaVersion\": \"12.2\", \"应用场景\": \"人工智能\"}"
}
]
}5.错误码
| 错误码 | 说明 |
|---|---|
| 0 | 成功 |
| 10001 | 内部错误 |
| 10003 | 参数不全 |
| 10004 | 参数无效 |
| 10007 | 用户已被冻结 |
| 10008 | 权限不足 |
| 10009 | 没有权限访问接口 |
| 10010 | 文件校验失败 |
| 10011 | 文件过大 |
| 10012 | 连接中断 |
| 716865 | 创建任务错误 |