Domain name for API request: tat.tencentcloudapi.com.
This API is used to query command details.
A maximum of 20 requests can be initiated per second for this API.
The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.
Parameter Name | Required | Type | Description |
---|---|---|---|
Action | Yes | String | Common Params. The value used for this API: DescribeCommands. |
Version | Yes | String | Common Params. The value used for this API: 2020-10-28. |
Region | No | String | Common Params. This parameter is not required for this API. |
CommandIds.N | No | Array of String | List of command IDs. Up to 100 IDs are allowed for each request. CommandIds and Filters cannot be specified at the same time. |
Filters.N | No | Array of Filter | Filter conditions.command-id - String - Required: No - (Filter condition) Filter by the command ID.command-name - String - Required: No - (Filter condition) Filter by the command name.command-type - String - Required: No - (Filter condition) Filter by the command type. Valid values: SHELL or POWERSHELL .created-by - String - Required: No - (Filter condition) Filter by the creator. Valid values: TAT (public commands) or USER (custom commands).tag-key - String - Required: No - (Filter condition) Filter by the tag key.tag-value - String - Required: No - (Filter condition) Filter by the tag value.tag:tag-key - String - Required: No - (Filter) Filter by the tag key-value pair. The tag-key should be replaced with a specified tag key. For detailed usage, see sample 4.Up to 10 Filters are allowed in one request. Each filter can have up to 5 Filter.Values . CommandIds and Filters cannot be specified at the same time. |
Limit | No | Integer | Number of returned results. It defaults to 20 . The maximum is 100. For more information on Limit , see the relevant section in the API Overview. |
Offset | No | Integer | Offset. The default value is 0 . For more information on Offset , see the relevant section in API Introduction. |
Parameter Name | Type | Description |
---|---|---|
TotalCount | Integer | Total number of matching commands. |
CommandSet | Array of Command | List of command details. |
RequestId | String | The unique request ID, which is returned for each request. RequestId is required for locating a problem. |
CommandId
POST / HTTP/1.1
Host: tat.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeCommands
<Common request parameters>
{
"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": "",
"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"
}
]
}
}
command-name
filterPOST / HTTP/1.1
Host: tat.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeCommands
<Common request parameters>
{
"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": "",
"CreatedBy": "USER",
"Content": "cHM=",
"CommandType": "SHELL",
"WorkingDirectory": "/root/",
"Timeout": 60,
"EnableParameter": false,
"DefaultParameters": "",
"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"
},
{
"CommandId": "cmd-63usjhmq",
"CommandName": "first-command",
"Description": "hello world!",
"FormattedDescription": "",
"CreatedBy": "USER",
"Content": "cHM=",
"CommandType": "SHELL",
"WorkingDirectory": "/",
"Timeout": 600,
"EnableParameter": false,
"DefaultParameters": "",
"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"
}
]
}
}
created-by
filterPOST / HTTP/1.1
Host: tat.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeCommands
<Common request parameters>
{
"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": "",
"CreatedBy": "USER",
"Content": "cHM=",
"CommandType": "SHELL",
"WorkingDirectory": "/root/",
"Timeout": 60,
"EnableParameter": false,
"DefaultParameters": "",
"Username": "root",
"Tags": [],
"CreatedTime": "2020-10-30T07:19:52+00:00",
"UpdatedTime": "2020-10-30T07:19:52+00:00"
}
]
}
}
POST / HTTP/1.1
Host: tat.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeCommands
<Common request parameters>
{
"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": "",
"CreatedBy": "USER",
"Content": "cHMK",
"CommandType": "SHELL",
"WorkingDirectory": "/root",
"Timeout": 60,
"EnableParameter": false,
"DefaultParameters": "",
"Username": "root",
"Tags": [
{
"Key": "test-key",
"Value": "test-value"
}
],
"CreatedTime": "2021-05-12T02:49:04Z",
"UpdatedTime": "2021-05-12T02:49:04Z"
}
]
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
Error Code | Description |
---|---|
InternalError | Internal error. |
InvalidParameter | Invalid parameter. |
InvalidParameter.ConflictParameter | Conflicting parameters. |
InvalidParameterValue | Invalid parameter value. |
InvalidParameterValue.InvalidCommandId | Invalid CommandId. |
InvalidParameterValue.InvalidFilter | Invalid filter. |
UnauthorizedOperation.CamAuthFailed | CAM authentication failed. |
UnauthorizedOperation.InvalidToken | Invalid token. |
UnauthorizedOperation.MFAExpired | The Multi-factor authentication (MFA) code expired. |
UnauthorizedOperation.MFANotFound | Multi-factor authentication (MFA) does not exist. |
本页内容是否解决了您的问题?