基本信息

Action:/qai/aicp/resource/template

Method: PUT

Content-Type:application/json

请求参数

参数 类型 描述 是否必须

name

string

资源节点名称。

yes

cpu

number

CPU 核心数。

yes

memory

number

内存大小。

yes

gpu

number

GPU 数量。

yes

gpu_memory

number

GPU 显存大小。

yes

rg_id

string

资源组 ID。

yes

ib

number

InfiniBand 支持状态。

yes

rg_node_id

string

资源节点 ID。

yes

pod_type

array

支持的 Pod 类型列表。其中 instance 为容器实例, job 为训练作业, infer 为推理服务

yes

gpu_list

array<string>

GPU 设备 ID 列表。

yes

gpu_name

string

GPU 型号名称。

yes

show_user

array<string>

有权限查看该资源的用户 ID 列表。

yes

hashrate_allocation

number

算力分配比例。

yes

data_disk_size

number

数据磁盘大小。

yes

cpu_manufacturer

string

CPU 制造商。

yes

cpu_model

string

CPU 具体型号。

yes

spec_type

string

资源规格类型,可输入 common(通用调度)、share_gpu(共享调度)、vgpu(显存切分)、only_cpu(CPU 调度),默认值为 common

yes

tmp_id

number

临时 ID。

yes

响应参数

此接口仅包含公共响应参数,可参见前文内容

请求示例

curl -X 'PUT' \
  'https://ai.coreshub.cn/qai/aicp/resource/template' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "data": [
    {
      "name": "",
      "cpu": 0,
      "memory": 0,
      "gpu": 0,
      "gpu_memory": 0,
      "rg_id": "string",
      "ib": 0,
      "rg_node_id": "",
      "pod_type": [
        "job"
      ],
      "gpu_list": [
        "string"
      ],
      "gpu_name": "string",
      "show_user": [
        "string"
      ],
      "hashrate_allocation": 0,
      "data_disk_size": 0,
      "cpu_manufacturer": "string",
      "cpu_model": "string",
      "spec_type": "common",
      "tmp_id": 0
    }
  ]
}'

响应示例

{
  "ret_code": 0,
  "message": "success",
  "meta": {
    "X_REQUEST_ID": "string",
    "X_REQUEST_USER": "string"
  }
}