接口功能介绍
调用此接口可以查询用户手动创建的云助手命令或者云助手公共命令
接口约束
无
URI
POST /v4/cloud-assistant/get-commands
路径参数
无
Query参数
无
请求参数
请求头header参数
无
请求体body参数
参数 | 是否必填 | 参数类型 | 说明 | 示例 | 下级对象 |
---|---|---|---|---|---|
regionID | 是 | String | 资源池ID | 88f8888888dd88ec888888888d888d8b | |
filters | 否 | Array of Objects | 过滤条件,json形式数组 | [{"key":"commandID","value":"a6a08d82-2f89-11ee-a2b7-774dd7c6ebaf"}] | filter |
isPublic | 否 | Boolean | 是否为公共市场命令 | false | |
pageNo | 否 | Integer | 当前页码,默认值为1 | 1 | |
pageSize | 否 | Integer | 分页查询时设置的每页行数,最大值为100,默认为10 | 10 |
表 filter
参数 | 是否必填 | 参数类型 | 说明 | 示例 | 下级对象 |
---|---|---|---|---|---|
key | 是 | String | 过滤条件的字段名,支持commandID、commandName、commandType | commandID | |
value | 是 | String | 过滤字段对应的值 | a6a08d82-2f89-11ee-a2b7-774dd7c6ebaf |
响应参数
参数 | 参数类型 | 说明 | 示例 | 下级对象 |
---|---|---|---|---|
statusCode | Integer | 返回状态码(800 为成功,900 为失败) | 800 | |
errorCode | String | 业务细分码,为product.module.code三段式码,详见错误码说明 | ||
message | String | 失败时的错误描述,一般为英文描述 | Param is null | |
description | String | 失败时的错误描述,一般为中文描述 | 请求参数错误 | |
returnObj | Object | 成功时返回的数据 | returnObj |
表 returnObj
参数 | 参数类型 | 说明 | 示例 | 下级对象 |
---|---|---|---|---|
pageNo | Integer | 当前页码 | 1 | |
totalCount | Integer | 命令总个数 | 100 | |
pageSize | Integer | 每页行数 | 10 | |
commands | Array of Objects | 命令列表 | command |
表 command
参数 | 参数类型 | 说明 | 示例 | 下级对象 |
---|---|---|---|---|
commandID | String | 命令ID | a6a08d82-2f89-11ee-a2b7-774dd7c6ebaf | |
commandName | String | 命令名称 | testName | |
description | String | 命令描述 | testDescription | |
commandType | String | 命令类型 | shell | |
commandContent | String | 命令内容 | test | |
workingDirectory | String | 命令在实例中的运行目录 | /home/user | |
timeout | Integer | 命令超时时间 | 60 | |
isPublic | Boolean | 是否是公共市场命令 | false | |
version | String | 公共市场命令的版本,仅公共市场命令有该字段 | ||
owner | String | 公共市场命令的提供者,仅公共市场命令有该字段 | ||
enabledParameter | Boolean | 是否使能自定义参数 | false | |
defaultParameter | String | 自定义参数默认值 | ||
createTime | String | 创建时间 | 2024-07-29T09:00:00Z | |
updateTime | String | 更新时间 | 2024-07-29T09:00:00Z |
枚举参数
无
请求示例
请求url
无
请求头header
无
请求体body
{
"regionID": "81f7728662dd11ec810800155d307d5b",
"filters": [{"key":"commandID","value":"a6a08d82-2f89-11ee-a2b7-774dd7c6ebaf"}],
"pageNo": 1,
"pageSize": 10
}
响应示例
{
"returnObj": {
"totalCount": 1,
"commands": [
{
"updateTime": "2025-02-20 17:09:35",
"description": "testDescription",
"workingDirectory": "/tmp",
"isPublic": false,
"commandName": "test-0221",
"commandID": "3e941a71-1fb0-4575-a3fe-c974205f7d8d",
"commandType": "shell",
"commandContent": "echo {{param-1}}",
"timeout": 30,
"defaultParameter": "[{\"value\": \"test\", \"description\": \"\\u53c2\\u65701\", \"key\": \"param-1\"}]",
"enabledParameter": true,
"createTime": "2025-02-20 17:09:35"
}
],
"pageNo": 1,
"pageSize": 10
},
"message": "SUCCESS",
"description": "成功",
"statusCode": 800
}
状态码
请参考 状态码
错误码
请参考 错误码