最近更新时间:2023.11.20 19:41:56
首次发布时间:2023.09.04 15:43:18
调用DescribeCommands接口,查询批量作业命令列表。
名称 | 类型 | 是否必填 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | DescribeCommands | 要执行的操作,取值:DescribeCommands。 |
Version | String | 是 | 2020-04-01 | 接口的版本,取值:2020-04-01。 |
Provider | String | 否 | Volcengine | 查询不同命令类型的所有命令。取值:
|
CommandId | String | 否 | cmd-hz012yr52**** | 命令ID。 |
Name | String | 否 | updateAgent | 命令名称。 |
Type | String | 否 | Shell | 命令类型。取值:
|
Order | String | 否 | created_at | 返回命令的排序方式。取值:
说明
|
OrderAscending | Boolean | 否 | false | 指定返回命令按升序或降序排列。取值:
|
PageNumber | Integer | 否 | 1 | 当前页码。
|
PageSize | Integer | 否 | 10 | 分页查询时设置的每页行数。
|
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
PageSize | Integer | 1 | 每页展示命令数。 |
PageNumber | Integer | 10 | 命令列表页码。 |
TotalCount | Integer | 4 | 命令总个数。 |
Commands | Array of Struct | - | 符合条件的命令信息。具体请参见下表“Command 结构”。 |
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
Name | String | 安装云监控Agent | 命令名称。 |
CommandId | String | cmd-hz012yr52**** | 命令ID。 |
CreateAt | String | 2023-06-07T06:58:05Z | 命令创建时间。 |
UpdatedAt | String | 2023-06-07T06:58:05Z | 命令更新时间。 |
Type | String | Shell | 命令类型。 |
Timeout | Integer | 60 | 超时时间。 |
WorkingDir | String | /home | 执行路径。 |
Username | String | root | 执行用户。 |
Description | String | 这是一个命令描述。 | 命令描述。 |
Provider | String | Volcengine | 公共命令的提供者。取值:
说明 查询自定义命令时,该返回值为空。 |
CommandContent | String | IyEvYmluL2Jhc2******c3N3b3JkfX0iIHwgY2hwYXNzd2Q= | Base64编码后的命令内容。 |
EnableParameter | Boolean | false | 该命令是否启用自定义参数。取值:
|
ParameterDefinitions | Array of Struct | - | 自定义参数详细信息列表,具体请参见下表“ParameterDefinition 结构”。 |
InvocationTimes | Integer | 10 | 命令被调用次数。 |
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
Name | String | Param | 参数名称。 |
Type | String | String | 参数类型。取值:
|
Required | String | true | 是否必填。取值:
|
DefaultValue | String | - | 自定义参数默认值。 |
MinLength | Integer | 1 | 自定义参数值(字符串)的最小长度。 |
MaxLength | Integer | 50 | 自定义参数值(字符串)的最大长度。 |
MinValue | Integer | 10 | 自定义参数值(数值)的最小值。 |
MaxValue | Integer | 100 | 自定义参数值(数值)的最大值。 |
DecimalPrecision | Integer | 2 | 自定义参数值(数值)允许的小数点后位数。 |
GET /?Action=DescribeCommands&Version=2020-04-01&CommandId=cmd-4302d02424c5c8e10281e3a31**** HTTP/1.1 Host: open.volcengineapi.com Region: cn-beijing Service: ecs
{ "ResponseMetadata": { "RequestId": "202106111445100102252431000052****", "Action": "DescribeCommands", "Version": "2020-04-01", "Service": "ecs", "Region": "cn-beijing" }, "Result": { "pageNumber": 1, "pageSize": 10, "totalCount": 1, "commands": [ { "name": "修改Linux实例密码", "commandId": "cmd-yc1eagyk****", "createdAt": "2022-11-07T08:33:38Z", "updatedAt": "2022-11-07T08:33:38Z", "type": "Shell", "timeout": 60, "workingDir": "/home", "username": "root", "description": "脚本描述", "provider": "", "commandContent": "IyEvYmluL2Jhc2******c3N3b3JkfX0iIHwgY2hwYXNzd2Q=", "enableParameter": true, "parameterDefinitions": [ { "type": "String", "name": "username", "required": true, "defaultValue": "", "minLength": 1, "maxLength": 100, "minValue": "", "maxValue": "", "decimalPrecision": 0 }, { "type": "String", "name": "password", "required": true, "defaultValue": "", "minLength": 1, "maxLength": 100, "minValue": "", "maxValue": "", "decimalPrecision": 0 } ], "invocationTimes": 10 } ] } }