创建队列
接口功能介绍
在指定资源组内创建一个指定规格的队列
接口约束
无
URI
POST /v4/cwai/queue/create
路径参数
无
Query参数
无
请求参数
请求头header参数
参数 | 是否必填 | 参数类型 | 说明 | 示例值 | 下级对象 |
---|---|---|---|---|---|
regionID | 是 | String | 区域的唯一ID | xxx-xxx-yyyzzz |
请求体body参数
参数 | 是否必填 | 参数类型 | 说明 | 示例值 | 下级对象 |
---|---|---|---|---|---|
name | 是 | String | 队列名称 | queue-demo | |
resourceGroupID | 是 | String | 资源组唯一ID | asdfdd44-3a45-11ee-b1cf-525400c96778 | |
resourceGroupName | 是 | String | 资源组名称 | cluster-demo | |
regionID | 是 | String | 区域唯一ID | 81f7728662dd11ec810800155d307d5b | |
queueType | 是 | String | 队列类型 | NVIDIA-A100-SXM4-40GB 1卡 1C 1G | |
count | 是 | Integer | 队列含单位规格个数,queueType*count应与cpu,memory,gpu总和一致 | 10 | |
cpu | 是 | Integer | 该队列的CPU配额 | 64 | |
memory | 是 | Integer | 该队列的内存配额 | 128G | |
gpu | 是 | Integer | 该队列的GPU卡数配额 | 16 | |
comment | 否 | String | 备注信息 | test-1 |
响应参数
参数 | 是否必填 | 参数类型 | 说明 | 示例值 | 下级对象 |
---|---|---|---|---|---|
statusCode | 是 | Integer | 请求成功(800)或者失败(900) | 800 | |
errorCode | 否 | String | 错误代码 | Cwai.Api.xxxx | |
message | 否 | String | 错误信息的英文描述 | Invalid Request | |
returnObj | 否 | Object | 返回创建队列信息 | returnObj |
表returnObj
参数 | 是否必填 | 参数类型 | 说明 | 示例值 | 下级对象 |
---|---|---|---|---|---|
queueID | 是 | String | 队列唯一ID | d0dc8ddc8e3e11eca6200242ac110004 |
请求示例
POST https://cwai-global.ctapi.ctyun.cn/openapi/v4/cwai/queue/create
Content-Type:application/json
regionID:81f7728662dd11ec810800155d307d5b
请求体body
{
"name ": "queue-demo",
"resourceGroupID": "asdfdd44-3a45-11ee-b1cf-525400c96778",
"resourceGroupName": "cluster-demo",
"regionID": "d0dc8ddc8e3e11eca6200242ac110003",
"queueType":"NVIDIA-A100-SXM4-40GB 1卡 1C 1G",
"count": 10,
"cpu": "64",
"memory": "128G",
"gpu": "16",
"comment": "test"
}
响应示例
HTTP/1.1 200 OK
Content-Type:application/json
{
"statusCode": 800,
"returnObj": {
"queueID": "f46388253705401e9c8bd2c96a1ac4ec"
}
}
错误参数返回示例
HTTP/1.1 200 OK
Content-Type:application/json
{
"statusCode": 900,
"errorCode": "Cwai.Api.BadRequest",
"message": "***",
}
内部服务错误返回示例
TTP/1.1 200 OK
Content-Type:application/json
{
"statusCode": 900,
"errorCode": "Cwai.Api.InternalServerError",
"message": "***",
}
状态码
状态码 | 描述 |
---|---|
200 | 表示请求成功 |
错误码
错误码 | 描述 |
---|---|
Cwai.Api.BadRequest | 错误请求 |
Cwai.Api.NotFound | 资源不存在 |
Cwai.Api.StatusUnauthorized | 状态未授权 |
Cwai.Api.InternalServerError | 内部错误 |