接口请求域名: tat.intl.tencentcloudapi.com 。
此接口用于查询命令详情。
默认接口请求频率限制:20次/秒。
以下请求参数列表仅列出了接口请求参数和部分公共参数,完整公共参数列表见 公共请求参数。
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| Action | 是 | String | 公共参数,本接口取值:DescribeCommands。 |
| Version | 是 | String | 公共参数,本接口取值:2020-10-28。 |
| Region | 是 | String | 公共参数,详见产品支持的 地域列表。 |
| CommandIds.N | 否 | Array of String | 命令ID列表,每次请求的上限为100。参数不支持同时指定 CommandIds 和 Filters 。 |
| Filters.N | 否 | Array of Filter | 过滤条件。 - command-id - String - 是否必填:否 -(过滤条件)按照命令ID过滤。 - command-name - String - 是否必填:否 -(过滤条件)按照命令名称过滤。 - command-type - String - 是否必填:否 -(过滤条件)按照命令类型过滤,取值为 SHELL、POWERSHELL、BAT。 - scene-id - String - 是否必填:否 -(过滤条件)按照场景ID过滤。可通过 DescribeScenes(查询场景) 接口获取场景ID。 - created-by - String - 是否必填:否 -(过滤条件)按照命令创建者过滤,取值为 TAT 或 USER。TAT 代表公共命令,USER 代表由用户创建的命令。 - tag-key - String - 是否必填:否 -(过滤条件)按照标签键进行过滤。 - tag-value - String - 是否必填:否 -(过滤条件)按照标签值进行过滤。 - tag:tag-key - String - 是否必填:否 -(过滤条件)按照标签键值对进行过滤。 tag-key使用具体的标签键进行替换。使用请参考示例4 每次请求的 Filters 的上限为10, Filter.Values 的上限为5。参数不支持同时指定 CommandIds 和 Filters 。 |
| Limit | 否 | Integer | 返回数量,默认为20,最大值为100。关于 Limit 的更进一步介绍请参考 API 简介中的相关小节。 |
| Offset | 否 | Integer | 偏移量,默认为0。关于 Offset 的更进一步介绍请参考 API 简介中的相关小节。 |
| 参数名称 | 类型 | 描述 |
|---|---|---|
| TotalCount | Integer | 符合条件的命令总数。 |
| CommandSet | Array of Command | 命令详情列表。 |
| RequestId | String | 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 |
POST / HTTP/1.1
Host: tat.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeCommands
<公共请求参数>
{
"CommandIds": [
"cmd-dvstpcyy"
],
"Offset": 0,
"Limit": 20
}
{
"Response": {
"RequestId": "eb973a12-71e3-4c0c-b1d8-4b863e5f5daf",
"TotalCount": 1,
"CommandSet": [
{
"CommandId": "cmd-dvstpcyy",
"CommandName": "run-command",
"Description": "whoami",
"FormattedDescription": "",
"CreatedBy": "USER",
"Content": "d2hvYW1p",
"CommandType": "SHELL",
"WorkingDirectory": "/root/",
"Timeout": 60,
"EnableParameter": false,
"DefaultParameters": "{\"varA\": \"222\"}",
"DefaultParameterConfs": [],
"Scenes": [],
"Username": "root",
"Tags": [
{
"Value": "test-key",
"Key": "test-value"
}
],
"CreatedTime": "2020-11-02T02:48:11+00:00",
"UpdatedTime": "2020-11-02T02:48:11+00:00",
"OutputCOSBucketUrl": "https://BucketName-123454321.cos.ap-beijing.myqcloud.com",
"OutputCOSKeyPrefix": "logs"
}
]
}
}
POST / HTTP/1.1
Host: tat.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeCommands
<公共请求参数>
{
"Offset": 0,
"Limit": 1,
"Filters": [
{
"Name": "created-by",
"Values": [
"USER"
]
}
]
}
{
"Response": {
"RequestId": "6b215093-e1f6-4803-b84a-a230849e88d1",
"TotalCount": 2,
"CommandSet": [
{
"CommandId": "cmd-hb2q34lk",
"CommandName": "second-command",
"Description": "ps",
"FormattedDescription": "",
"DefaultParameterConfs": [],
"Scenes": [],
"CreatedBy": "USER",
"Content": "cHM=",
"CommandType": "SHELL",
"WorkingDirectory": "/root/",
"Timeout": 60,
"EnableParameter": true,
"DefaultParameters": "{\"varA\": \"222\"}",
"Username": "root",
"Tags": [
{
"Value": "test-key",
"Key": "test-value"
}
],
"CreatedTime": "2020-10-30T07:19:52+00:00",
"UpdatedTime": "2020-10-30T07:19:52+00:00",
"OutputCOSBucketUrl": "https://BucketName-123454321.cos.ap-beijing.myqcloud.com",
"OutputCOSKeyPrefix": "logs"
}
]
}
}
POST / HTTP/1.1
Host: tat.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeCommands
<公共请求参数>
{
"Offset": 0,
"Limit": 20,
"Filters": [
{
"Name": "command-name",
"Values": [
"second-command",
"first-command"
]
}
]
}
{
"Response": {
"RequestId": "6b215093-e1f6-4803-b84a-a230849e88d1",
"TotalCount": 2,
"CommandSet": [
{
"CommandId": "cmd-hb2q34lk",
"CommandName": "second-command",
"Description": "ps",
"FormattedDescription": "",
"DefaultParameterConfs": [],
"Scenes": [],
"CreatedBy": "USER",
"Content": "cHM=",
"CommandType": "SHELL",
"WorkingDirectory": "/root/",
"Timeout": 60,
"EnableParameter": false,
"DefaultParameters": "{\"varA\": \"222\"}",
"Username": "root",
"Tags": [
{
"Value": "test-key",
"Key": "test-value"
}
],
"CreatedTime": "2020-10-30T07:19:52+00:00",
"UpdatedTime": "2020-10-30T07:19:52+00:00",
"OutputCOSBucketUrl": "https://BucketName-123454321.cos.ap-beijing.myqcloud.com",
"OutputCOSKeyPrefix": "aa/bb/cc"
},
{
"CommandId": "cmd-63usjhmq",
"CommandName": "first-command",
"Description": "hello world!",
"FormattedDescription": "",
"DefaultParameterConfs": [],
"Scenes": [],
"CreatedBy": "USER",
"Content": "cHM=",
"CommandType": "SHELL",
"WorkingDirectory": "/root",
"Timeout": 600,
"EnableParameter": false,
"DefaultParameters": "{\"varA\": \"222\"}",
"Username": "root",
"Tags": [
{
"Value": "test-key",
"Key": "test-value"
}
],
"CreatedTime": "2020-10-26T11:26:07+00:00",
"UpdatedTime": "2020-11-09T08:12:45+00:00",
"OutputCOSBucketUrl": "https://BucketName-123454321.cos.ap-beijing.myqcloud.com",
"OutputCOSKeyPrefix": "logs"
}
]
}
}
POST / HTTP/1.1
Host: tat.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeCommands
<公共请求参数>
{
"Filters": [
{
"Values": [
"test-value"
],
"Name": "tag:test-key"
}
]
}
{
"Response": {
"RequestId": "33d3d954-f73a-4a7f-869b-8792bc7a6f13",
"TotalCount": 1,
"CommandSet": [
{
"CommandId": "cmd-38ps9q4p",
"CommandName": "tag-test-1",
"Description": "",
"FormattedDescription": "",
"DefaultParameterConfs": [],
"Scenes": [],
"CreatedBy": "USER",
"Content": "cHMK",
"CommandType": "SHELL",
"WorkingDirectory": "/root",
"Timeout": 60,
"EnableParameter": false,
"DefaultParameters": "{\"varA\": \"222\"}",
"Username": "root",
"Tags": [
{
"Key": "test-key",
"Value": "test-value"
}
],
"CreatedTime": "2021-05-12T02:49:04Z",
"UpdatedTime": "2021-05-12T02:49:04Z",
"OutputCOSBucketUrl": "https://BucketName-123454321.cos.ap-beijing.myqcloud.com",
"OutputCOSKeyPrefix": "images"
}
]
}
}
云 API 3.0 提供了配套的开发工具集(SDK),支持多种编程语言,能更方便的调用 API。
以下仅列出了接口业务逻辑相关的错误码,其他错误码详见 公共错误码。
| 错误码 | 描述 |
|---|---|
| InternalError | 内部错误。 |
| InvalidParameter | 参数错误。 |
| InvalidParameter.ConflictParameter | 参数冲突。 |
| InvalidParameterValue | 参数取值错误。 |
| InvalidParameterValue.InvalidCommandId | CommandId 无效。 |
| InvalidParameterValue.InvalidFilter | Filter 无效。 |
| UnauthorizedOperation.CamAuthFailed | CAM鉴权失败。 |
| UnauthorizedOperation.InvalidToken | Token 无效。 |
| UnauthorizedOperation.MFAExpired | Multi-Factor Authentication(MFA) 过期。 |
| UnauthorizedOperation.MFANotFound | Multi-Factor Authentication(MFA) 不存在。 |
文档反馈