Domain name for API request: tat.tencentcloudapi.com.
This API is used to trigger a command on the specified instance and returns the execution activity ID (inv-xxxxxxxx) on success. Each execution activity has one or more execution tasks (invt-xxxxxxxx) and each execution task indicates an execution record on a CVM or Lighthouse instance.
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: InvokeCommand. |
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. |
CommandId | Yes | String | ID of the command to be triggered. |
InstanceIds.N | Yes | Array of String | IDs of instances about to execute commands. At most 100 IDs are allowed. |
Parameters | No | String | Custom parameters of the command. The field type is JSON encoded string. For example, {"varA": "222"}.key is the name of the custom parameter and value is the default value. Both key and value are strings.If no parameter value is provided, the DefaultParameters of the command is used. Up to 20 custom parameters are supported. The name of the custom parameter cannot exceed 64 characters and can contain [a-z], [A-Z], [0-9] and [-_]. |
Username | No | String | The username used to execute the command on the CVM or Lighthouse instance. The principle of the least privilege is the best practice for permission management. We recommend you execute TAT commands as a general user. If this is not specified, the Username of the command is used by default. |
WorkingDirectory | No | String | Execution path of the command. The WorkingDirectory of the command is used by default. |
Timeout | No | Integer | Command timeout period. Value range: [1, 86400]. The Timeout of the command is used by default. |
OutputCOSBucketUrl | No | String | The COS bucket URL for uploading logs. The URL must start with https , such as https://BucketName-123454321.cos.ap-beijing.myqcloud.com . |
OutputCOSKeyPrefix | No | String | The COS bucket directory where the logs are saved. Check below for the rules of the directory name. 1. It must be a combination of number, letters, and visible characters. Up to 60 characters are allowed. 2. Use a slash (/) to create a subdirectory. 3. ".." can not be used as the folder name. It cannot start with a slash (/), and cannot contain consecutive slashes. |
Parameter Name | Type | Description |
---|---|---|
InvocationId | String | Execution activity ID. |
RequestId | String | The unique request ID, which is returned for each request. RequestId is required for locating a problem. |
POST / HTTP/1.1
Host: tat.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: InvokeCommand
<Common request parameters>
{
"CommandId": "cmd-ffxdx79i",
"InstanceIds": [
"lhins-ar5wyn40"
]
}
{
"Response": {
"RequestId": "41417f50-51b5-4c8d-85b7-f6c508cb228f",
"InvocationId": "inv-8xgjrytm"
}
}
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 |
---|---|
FailedOperation.CVMError | Failed to access the CVM. |
FailedOperation.LighthouseError | Failed to access the Lighthouse instance. |
InternalError | Internal error. |
InvalidParameter | Invalid parameter. |
InvalidParameter.InvalidUsername | Invalid username. |
InvalidParameterValue | Invalid parameter value. |
InvalidParameterValue.AgentUnsupportedCommandType | TAT Agent does not support this command type. |
InvalidParameterValue.InconsistentInstance | Inconsistent instance type. |
InvalidParameterValue.InvalidCommandId | Invalid CommandId. |
InvalidParameterValue.InvalidInstanceId | Invalid instance ID. |
InvalidParameterValue.InvalidOutputCOSBucketUrl | Invalid OutputCOSBucketUrl. |
InvalidParameterValue.InvalidOutputCOSKeyPrefix | Invalid OutputCOSKeyPrefix. |
InvalidParameterValue.InvalidWorkingDirectory | Invalid command execution path. |
InvalidParameterValue.LackOfParameterInfo | The custom parameter feature is enabled, but custom parameters are missing. |
InvalidParameterValue.LimitExceeded | Parameter limit exceeded. |
InvalidParameterValue.ParameterDisabled | The custom parameter feature is not enabled. |
InvalidParameterValue.ParameterInvalidJsonFormat | The parameter is not a valid JSON string. |
InvalidParameterValue.ParameterKeyContainsInvalidChar | The parameter key contains invalid characters. |
InvalidParameterValue.ParameterKeyDuplicated | Duplicate parameter keys. |
InvalidParameterValue.ParameterKeyLenExceeded | The parameter key is too long. |
InvalidParameterValue.ParameterNumberExceeded | Too many parameters. |
InvalidParameterValue.ParameterValueNotString | The parameter value is not a string. |
InvalidParameterValue.SupportParametersOnlyIfEnableParameter | The custom parameter feature is not enabled. |
ResourceNotFound.CommandNotFound | The command does not exist. |
ResourceNotFound.InstanceNotFound | The instance does not exist. |
ResourceNotFound.RoleNotFound | The role does not exist. |
ResourceUnavailable.AgentNotInstalled | TAT Agent is not installed. |
ResourceUnavailable.AgentStatusNotOnline | TAT Agent is offline. |
ResourceUnavailable.InstanceStateNotRunning | The instance is not running. |
ResourceUnavailable.LighthouseUnsupportedRegion | Lighthouse is not supported in the region. |
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. |
Was this page helpful?