Tencent Cloud Automation Tools

Tencent Cloud Automation Tools
API Documentation
Product Documentation©2013-2022 Tencent Cloud. All rights reserved.

Page 1 of 158

Tencent Cloud Automation Tools

Copyright Notice©2013-2024 Tencent Cloud. All rights reserved.
Copyright in this document is exclusively owned by Tencent Cloud. You must not reproduce, modify, copy or distributein any way, in whole or in part, the contents of this document without Tencent Cloud's the prior written consent.
Trademark Notice

All trademarks associated with Tencent Cloud and its services are owned by Tencent Cloud Computing (Beijing)
Company Limited and its affiliated companies. Trademarks of third parties referred to in this document are owned bytheir respective proprietors.
Service Statement
This document is intended to provide users with general information about Tencent Cloud's products and services
only and does not form part of Tencent Cloud's terms and conditions. Tencent Cloud's products or services are
subject to change. Specific products and services and the standards applicable to them are exclusively provided for in
Tencent Cloud's applicable terms and conditions.

©2013-2022 Tencent Cloud. All rights reserved.

Page 2 of 158

Tencent Cloud Automation Tools

Contents
API Documentation
History
Introduction
API Category
Making API Requests
Request Structure
Common Params
Signature v3
Signature
Responses
Remote Command APIs
EnableInvoker
CreateInvoker
DescribeCommands
DescribeAutomationAgentStatus
DeleteCommand
CreateCommand
DescribeInvocationTasks
CancelInvocation
DescribeInvocations
InvokeCommand
ModifyCommand
ModifyInvoker
DeleteInvoker
PreviewReplacedCommandContent
DisableInvoker
DescribeInvokers
DescribeInvokerRecords
RunCommand
Region APIs
DescribeRegions
Data Types
Error Codes©2013-2022 Tencent Cloud. All rights reserved.

Page 3 of 158

Tencent Cloud Automation Tools

API Documentation
History：

Last updated 2023-03-14 16:55:44

Release 2
Release time: 2023-03-14 16:53:02
Release updates:
Improvement to existing documentation.
Modified data structures:
AutomationAgentInfo
New members:SupportFeatures
CommandDocument
New members:OutputCOSBucketUrl, OutputCOSKeyPrefix

Release 1
Release time: 2022-04-24 16:57:09
Release updates:
Improvement to existing documentation.
New APIs:
CancelInvocation
CreateCommand
CreateInvoker
DeleteCommand
DeleteInvoker
DescribeAutomationAgentStatus
DescribeCommands
DescribeInvocationTasks
DescribeInvocations
DescribeInvokerRecords©2013-2022 Tencent Cloud. All rights reserved.

Page 4 of 158

Tencent Cloud Automation Tools

DescribeInvokers
DescribeRegions
DisableInvoker
EnableInvoker
InvokeCommand
ModifyCommand
ModifyInvoker
PreviewReplacedCommandContent
RunCommand
New data structures:
AutomationAgentInfo
CommandCommandDocument
FilterInvocation
InvocationTask
InvocationTaskBasicInfo
Invoker
InvokerRecord
RegionInfo
ScheduleSettings
Tag
TaskResult©2013-2022 Tencent Cloud. All rights reserved.

Page 5 of 158

Tencent Cloud Automation Tools

Introduction：

Last updated 2023-03-14 16:55:43
Efficient and secure native Ops and deployment tool.

©2013-2022 Tencent Cloud. All rights reserved.

Page 6 of 158

Tencent Cloud Automation Tools

API Category：

Last updated 2023-03-14 16:55:43

Remote Command APIs
API Name

FeatureFrequency Limit

CancelInvocation

Cancels the execution of a command

20

CreateCommand

Creates a command

20

CreateInvoker

Creates an invoker

20

DeleteCommand

Deletes a command

20

DeleteInvoker

Deletes an invoker

20

DescribeAutomationAgentStatus

Queries the agent status

20

DescribeCommands

Queries command details

20

DescribeInvocationTasks

Queries the execution tasks

20

DescribeInvocations

Queries the execution activities

20

DescribeInvokerRecords

Queries the execution history of an invoker

20

DescribeInvokers

Queries invokers

20

DisableInvoker

Disables an invoker

20

EnableInvoker

Enables an invoker

20

InvokeCommand

Triggers a command

20

ModifyCommand

Modifies a command

20

ModifyInvoker

Modifies an invoker

20

PreviewReplacedCommandContent

Previews a command

20

RunCommand

Executes a command

20©2013-2022 Tencent Cloud. All rights reserved.

Page 7 of 158

Tencent Cloud Automation Tools

Region APIs
API Name

FeatureFrequency Limit

DescribeRegions

Queries regions that support TAT

20©2013-2022 Tencent Cloud. All rights reserved.

Page 8 of 158

Tencent Cloud Automation Tools

Making API Requests
Request Structure：

Last updated 2023-03-14 16:55:44

1. Service Address
The API supports access from either a nearby region (at tat.tencentcloudapi.com) or a specified region (at tat.apguangzhou.tencentcloudapi.com for Guangzhou, for example).
We recommend using the domain name to access the nearest server. When you call an API, the request is
automatically resolved to a server in the region nearest to the location where the API is initiated. For example, when
you initiate an API request in Guangzhou, this domain name is automatically resolved to a Guangzhou server, theresult is the same as that of specifying the region in the domain like "tat.ap-guangzhou.tencentcloudapi.com".
Note: For latency-sensitive businesses, we recommend that you specify the region in the domain name.
Tencent Cloud currently supports the following regions:
Hosted region
Local access region (recommended, only for non-financial availability
zones)

Domain nametat.tencentcloudapi.com

South China (Guangzhou)

tat.apguangzhou.tencentcloudapi.com

East China (Shanghai)tat.ap-shanghai.tencentcloudapi.com

North China (Beijing)tat.ap-beijing.tencentcloudapi.com

Southwest China (Chengdu)

tat.ap-chengdu.tencentcloudapi.com

Southwest China (Chongqing)Hong Kong, Macao, Taiwan (Hong Kong, China)

tat.apchongqing.tencentcloudapi.com
tat.aphongkong.tencentcloudapi.com

Southeast Asia (Singapore)tat.apsingapore.tencentcloudapi.com

Southeast Asia (Bangkok)

tat.ap-bangkok.tencentcloudapi.com©2013-2022 Tencent Cloud. All rights reserved.

Page 9 of 158

Tencent Cloud Automation Tools

South Asia (Mumbai)

tat.ap-mumbai.tencentcloudapi.com

Northeast Asia (Seoul)

tat.ap-seoul.tencentcloudapi.com

Northeast Asia (Tokyo)

tat.ap-tokyo.tencentcloudapi.com

U.S. East Coast (Virginia)

tat.na-ashburn.tencentcloudapi.com

U.S. West Coast (Silicon Valley)

tat.nasiliconvalley.tencentcloudapi.com

North America (Toronto)

tat.na-toronto.tencentcloudapi.com

Europe (Frankfurt)

tat.eu-frankfurt.tencentcloudapi.com

2. Communications Protocol
All the Tencent Cloud APIs communicate via HTTPS, providing highly secure communication tunnels.

3. Request Methods
Supported HTTP request methods:
POST (recommended)GETThe Content-Type types supported by POST requests:
application/json (recommended). The TC3-HMAC-SHA256 signature algorithm must be used.
application/x-www-form-urlencoded. The HmacSHA1 or HmacSHA256 signature algorithm must be used.
multipart/form-data (only supported by certain APIs). You must use TC3-HMAC-SHA256 to calculate the signature.
The size of a GET request packet is up to 32 KB. The size of a POST request is up to 1 MB when the HmacSHA1 or
HmacSHA256 signature algorithm is used, and up to 10 MB when TC3-HMAC-SHA256 is used.

4. Character Encoding
Only UTF-8 encoding is used.

©2013-2022 Tencent Cloud. All rights reserved.

Page 10 of 158

Tencent Cloud Automation Tools

Common Params：

Last updated 2023-03-14 16:55:44
Common parameters are used for all APIs authenticating requestors. Common parameters must be included in all API
requests, and they will not be described in individual API documents.
The exact contents of the common parameters will vary depending on the version of the signature method you use.

Common parameters for Signature Algorithm v3
When the TC3-HMAC-SHA256 algorithm is used, the common parameters should be uniformly placed in the HTTP
request header, as shown below:
Parameter
Name

Type

Required

Description
The name of the API for the desired operation. For the specific value, see

X-TC-Action

X-TCRegion

X-TCTimestamp

StringStringYes

Yes

description of common parameter Action in the input parameters in r
documentation. For example, the API for querying the CVM instance list is
DescribeInstances .
Region parameter, which is used to identify the region to which the data ywork with belongs. For values supported for an API, see the description oparameter Region in the input parameters in related API documentati
parameter is not required for some APIs (which will be indicated in related
documentation), and will not take effect even it is passed.

Integer

X-TCVersion

StringAuthorization

StringYes

Yes

The current UNIX timestamp that records the time when the API request w
for example, 1529223702. Note: If the difference between the UNIX times
server time is greater than 5 minutes, a signature expiration error may occ
API version of the action. For the valid values, see the description of the cparameter Version in the API documentation. For example, the versi
2017-03-12.

Yes

The HTTP authentication request header, for example:
TC3-HMAC-SHA256 Credential=AKIDEXAMPLE/Date/service/tc3_requ
SignedHeaders=content-type;host,Signature=fe5f80f77d5fa3beca038a248ff027d0445342fe2855ddc96317
Here:- TC3-HMAC-SHA256: Signature method, currently fixed as this value;- Credential: Signature credential; AKIDEXAMPLE is the SecretId; Date is
UTC time, and this value must match the value of X-TC-Timestamp (a co©2013-2022 Tencent Cloud. All rights reserved.

Page 11 of 158

Tencent Cloud Automation Tools

parameter) in UTC time format; service is the name of the product/service
generally a domain name prefix. For example, a domain name cvm.tencen
refers to the CVM product and the value would be cvm;
- SignedHeaders: The headers that contains the authentication informatio
type and host are the required headers;- Signature: Signature digest.

X-TC-Token

String

No

The token used for a temporary certificate. It must be used with a tempora
can obtain the temporary key and token by calling a CAM API. No token ia long-term key.

Assuming you want to query the list of Cloud Virtual Machine instances in the Guangzhou region, the request structurein the form of request URL, request header and request body may be as follows:
Example of an HTTP GET request structure:https://cvm.tencentcloudapi.com/?Limit=10&Offset=0
Authorization: TC3-HMAC-SHA256 Credential=AKIDz8krbsJ5yKBZQpn74WFkmLPx3EXAMPLE/20
18-10-09/cvm/tc3_request, SignedHeaders=content-type;host, Signature=5da7a33f6993
f0614b047e5df4582db9e9bf4672ba50567dba16c6ccf174c474
Content-Type: application/x-www-form-urlencoded
Host: cvm.tencentcloudapi.com
X-TC-Action: DescribeInstances
X-TC-Version: 2017-03-12
X-TC-Timestamp: 1539084154
X-TC-Region: ap-guangzhou
The following example shows you how to structure an HTTP POST (application/json) request:
https://cvm.tencentcloudapi.com/
Authorization: TC3-HMAC-SHA256 Credential=AKIDEXAMPLE/2018-05-30/cvm/tc3_request,
SignedHeaders=content-type;host, Signature=582c400e06b5924a6f2b5d7d672d79c15b1316
2d9279b0855cfba6789a8edb4c
Content-Type: application/json
Host: cvm.tencentcloudapi.com
X-TC-Action: DescribeInstances
X-TC-Version: 2017-03-12
X-TC-Timestamp: 1527672334
X-TC-Region: ap-guangzhou{"Offset":0,"Limit":10}
Example of an HTTP POST (multipart/form-data) request structure (only supported by specific APIs):©2013-2022 Tencent Cloud. All rights reserved.

Page 12 of 158

Tencent Cloud Automation Tools

https://cvm.tencentcloudapi.com/
Authorization: TC3-HMAC-SHA256 Credential=AKIDEXAMPLE/2018-05-30/cvm/tc3_request,
SignedHeaders=content-type;host, Signature=582c400e06b5924a6f2b5d7d672d79c15b1316
2d9279b0855cfba6789a8edb4c
Content-Type: multipart/form-data; boundary=58731222010402
Host: cvm.tencentcloudapi.com
X-TC-Action: DescribeInstances
X-TC-Version: 2017-03-12
X-TC-Timestamp: 1527672334
X-TC-Region: ap-guangzhou--58731222010402
Content-Disposition: form-data; name="Offset"
0--58731222010402
Content-Disposition: form-data; name="Limit"
10--58731222010402--

Common parameters for Signature Algorithm v1
To adopt the HmacSHA1 and HmacSHA256 signature methods, common parameters must be put into the request
string, as shown below:
Parameter NameType

Required

Description
The name of the API for the desired operation. For the specificvalue, see the description of common parameter Action in the

ActionStringYes

input parameters in related API documentation. For example, theAPI for querying the CVM instance list is
DescribeInstances .
Region parameter, which is used to identify the region to which
the data you want to work with belongs. For values supported for
an API, see the description of common parameter Region in

RegionStringYes

the input parameters in related API documentation. Note: Thisparameter is not required for some APIs (which will be indicated inrelated API documentation), and will not take effect even if it ispassed.

©2013-2022 Tencent Cloud. All rights reserved.

Page 13 of 158

Tencent Cloud Automation Tools

Timestamp

IntegerYes

The current UNIX timestamp that records the time when the API
request was initiated, for example, 1529223702. If the difference
between the value and the current system time is too large, asignature expiration error may occur.
A random positive integer used along with Timestamp to

Nonce

Integer

Yes

SecretId

StringYes

The identifying SecretId obtained on the Cloud API Key page. A
SecretId corresponds to a unique SecretKey which is used togenerate the request signature (Signature).

Yes

Request signature used to verify the validity of this request. This iscalculated based on the actual input parameters. For more
information about how this is calculated, see the API
authentication documentation.

Signature

VersionStringStringYes

prevent replay attacks.

API version of the action. For the valid values, see the descriptionof the common input parameter Version in the API
documentation. For example, the version of CVM is 2017-03-12.

SignatureMethod

StringNo

Signature method. Currently, only HmacSHA256 and HmacSHA1
are supported. The HmacSHA256 algorithm is used to verify thesignature only when this parameter is specified as HmacSHA256.
In other cases, the signature is verified with HmacSHA1.

Token

String

No

The token used for a temporary certificate. It must be used with atemporary key. You can obtain the temporary key and token bycalling a CAM API. No token is required for a long-term key.

Assuming you want to query the list of Cloud Virtual Machine instances in the Guangzhou region, the request structurein the form of request URL, request header and request body may be as follows:
Example of an HTTP GET request structure:https://cvm.tencentcloudapi.com/?Action=DescribeInstances&Version=2017-03-12&Sign
atureMethod=HmacSHA256&Timestamp=1527672334&Signature=37ac2f4fde00b0ac9bd9eadeb45
9b1bbee224158d66e7ae5fcadb70b2d181d02&Region=ap-guangzhou&Nonce=23823223&SecretId=AKIDEXAMPLE
Host: cvm.tencentcloudapi.com
Content-Type: application/x-www-form-urlencoded
Example of an HTTP POST request structure:©2013-2022 Tencent Cloud. All rights reserved.

Page 14 of 158

Tencent Cloud Automation Tools

https://cvm.tencentcloudapi.com/
Host: cvm.tencentcloudapi.com
Content-Type: application/x-www-form-urlencoded
Action=DescribeInstances&Version=2017-03-12&SignatureMethod=HmacSHA256&Timestamp=
1527672334&Signature=37ac2f4fde00b0ac9bd9eadeb459b1bbee224158d66e7ae5fcadb70b2d18
1d02&Region=ap-guangzhou&Nonce=23823223&SecretId=AKIDEXAMPLE©2013-2022 Tencent Cloud. All rights reserved.

Page 15 of 158

Tencent Cloud Automation Tools

Signature v3：

Last updated 2022-05-23 15:21:24
TencentCloud API authenticates every single request, i.e., the request must be signed using the security credentials inthe designated steps. Each request has to contain the signature information (Signature) in the common request
parameters and be sent in the specified way and format.

Applying for Security Credentials
The security credential used in this document is a key, which includes a SecretId and a SecretKey. Each user canhave up to two pairs of keys.
SecretId: Used to identify the API caller, which is just like a username.
SecretKey: Used to authenticate the API caller, which is just like a password.
You must keep your security credentials private and avoid disclosure; otherwise, your assets may becompromised. If they are disclosed, please disable them as soon as possible.
You can apply for the security credentials through the following steps:
1. Log in to the Tencent Cloud Console.
2. Go to the TencentCloud API Key console page.
3. On the TencentCloud API Key page, click Create to create a SecretId/SecretKey pair.

Using the Resources for Developers
TencentCloud API comes with SDKs for seven commonly used programming languages, including Python, Java,
PHP, Go, NodeJS and .NET. In addition, it provides API Explorer which enables online call, signature verification, andSDK code generation. If you have any troubles calculating a signature, consult these resources.

TC3-HMAC-SHA256 Signature Algorithm
Compatible with the previous HmacSHA1 and HmacSHA256 signature algorithms, the TC3-HMAC-SHA256
signature algorithm is more secure and supports larger requests and JSON format with better performance. We
recommend using TC3-HMAC-SHA256 to calculate the signature.
TencentCloud API supports both GET and POST requests. For the GET method, only the Content-Type:application/x-www-form-urlencoded protocol format is supported. For the POST method, two protocol formats,©2013-2022 Tencent Cloud. All rights reserved.

Page 16 of 158

Tencent Cloud Automation Tools

Content-Type: application/json and Content-Type: multipart/form-data, are supported. The JSON format is supported
by default for all business APIs, and the multipart format is supported only for specific business APIs. In this case, theAPI cannot be called in JSON format. See the specific business API documentation for more information. The POST
method is recommended, as there is no difference in the results of both the methods, but the GET method only
supports request packets up to 32 KB.
The following uses querying the list of CVM instances in the Guangzhou region as an example to describe the steps ofsignature splicing. We chose this API because:
1. CVM is activated by default, and this API is often used;
2. It is read-only and does not change the status of existing resources;
3. It covers many types of parameters, which allows it to be used to demonstrate how to use arrays containing data
structures.
In the example, we try to choose common parameters and API parameters that are prone to mistakes. When you
actually call an API, please use parameters based on the actual conditions. The parameters vary by API. Do not copy
the parameters and values in this example.
Assuming that your SecretId and SecretKey are AKIDz8krbsJ5yKBZQpn74WFkmLPx3******* andGu5t9xGARNpq86cd98joQYCN3******* , respectively, if you want to view the status of the instance in the
Guangzhou region whose CVM instance name is "unnamed" and have only one data entry returned, then the request
may be:curl -X POST https://cvm.tencentcloudapi.com \-H "Authorization: TC3-HMAC-SHA256 Credential=AKIDz8krbsJ5yKBZQpn74WFkmLPx3*******/2019-02-25/cvm/tc3_request, SignedHeaders=content-type;host, Signature=c492e8e4
1437e97a620b728c301bb8d17e7dc0c17eeabce80c20cd70fc3a78ff" \-H "Content-Type: application/json; charset=utf-8" \-H "Host: cvm.tencentcloudapi.com" \-H "X-TC-Action: DescribeInstances" \-H "X-TC-Timestamp: 1551113065" \-H "X-TC-Version: 2017-03-12" \-H "X-TC-Region: ap-guangzhou" \-d '{"Limit": 1, "Filters": [{"Values": ["unnamed"], "Name": "instance-name"}]}'The signature calculation process is explained in detail below.

1. Concatenating the CanonicalRequest String
Concatenate the canonical request string (CanonicalRequest) in the following pseudocode format:
CanonicalRequest =HTTPRequestMethod + '\n' +CanonicalURI + '\n' +©2013-2022 Tencent Cloud. All rights reserved.

Page 17 of 158

Tencent Cloud Automation Tools

CanonicalQueryString + '\n' +CanonicalHeaders + '\n' +SignedHeaders + '\n' +HashedRequestPayload
Field Name

Explanation

HTTPRequestMethod

HTTP request method (GET or POST). This example uses POST .

CanonicalURI

URI parameter. Slash ("/") is used for API 3.0.
The query string in the URL of the originating HTTP request. This is always an empty st“” for POST requests, and is the string after the question mark (?) for GET requests. Fo

CanonicalQueryString。

example: Limit=10&Offset=0
Note: CanonicalQueryString must be URL-encoded, referencing RFC3986, theUTF8 character set. We recommend using the programming language library. All specia
characters must be encoded and capitalized.
Header information for signature calculation, including at least two headers of host
content-type . Custom headers can be added to participate in the signature proce
improve the uniqueness and security of the request.
Concatenation rules:
1. Both the key and value of the header should be converted to lowercase with the lead

CanonicalHeaders

and trailing spaces removed, so they are concatenated in the format of key:value\nformat;2. If there are multiple headers, they should be sorted in ASCII ascending order by theheader keys (lowercase).
The calculation result in this example is content-type:application/json;
charset=utf-8\nhost:cvm.tencentcloudapi.com\n .
Note: content-type must match the actually sent content. In some programming
languages, a charset value would be added even if it is not specified. In this case, therequest sent is different from the one signed, and the sever will return an error indicating
signature verification failed.
Header information for signature calculation, indicating which headers of the request
participate in the signature process (they must each individually correspond to the headin CanonicalHeaders). Content-type and host are required headers.

SignedHeaders

Concatenation rules:
1. Both the key and value of the header should be converted to lowercase;
2. If there are multiple headers, they should be sorted in ASCII ascending order by theheader keys (lowercase) and separated by semicolons (;).
The value in this example is content-type;hostHashedRequestPayload

Hash value of the request payload (i.e., the body, such as {"Limit": 1, "Filter©2013-2022 Tencent Cloud. All rights reserved.

Page 18 of 158

Tencent Cloud Automation Tools[{"Values": ["unnamed"], "Name": "instance-name"}]} in this example
The pseudocode for calculation is
Lowercase(HexEncode(Hash.SHA256(RequestPayload))) by SHA256 hashing the payof the HTTP request, performing hexadecimal encoding, and finally converting the enco
string to lowercase letters. For GET requests, RequestPayload is always an empt
string. The calculation result in this example is
99d58dfbc6745f6747f36bfca17dee5e6881dc0428a0a36f96199342bc5b49

According to the rules above, the CanonicalRequest string obtained in the example is as follows:

POST/
content-type:application/json; charset=utf-8
host:cvm.tencentcloudapi.com
content-type;host
99d58dfbc6745f6747f36bfca17dee5e6881dc0428a0a36f96199342bc5b4907

2. Concatenating the String to Be Signed
The string to sign is concatenated as follows:
StringToSign =Algorithm + \n +RequestTimestamp + \n +CredentialScope + \n +HashedCanonicalRequest
Field Name

Explanation

Algorithm

Signature algorithm, which is currently always TC3-HMAC-SHA256 .
Request timestamp, i.e., the value of the common parameter X-TC-Timestamp in

RequestTimestamp

request header, which is the UNIX timestamp of the current time in seconds, such as1551113065 in this example.
Scope of the credential in the format of Date/service/tc3_request , including
date, requested service and termination string (tc3_request). Date is a date in UT

CredentialScopetime, whose value should match the UTC date converted by the common
parameter X-TC-Timestamp ; service is the product name, which should mthe domain name of the product called. The calculation result in this example is 201
25/cvm/tc3_request .

©2013-2022 Tencent Cloud. All rights reserved.

Page 19 of 158

Tencent Cloud Automation Tools

HashedCanonicalRequest

Hash value of the CanonicalRequest string concatenated in the steps above. The
pseudocode for calculation is Lowercase(HexEncode(Hash.SHA256(CanonicalRequ
The calculation result in this example is2815843035062fffda5fd6f2a44ea8a34818b0dc46f024b8b3786976a3ad

Note:

1. Date has to be calculated from the timestamp "X-TC-Timestamp" and the time zone is UTC+0. If you add
the system's local time zone information (such as UTC+8), calls can succeed both day and night but willdefinitely fail at 00:00. For example, if the timestamp is 1551113065 and the time in UTC+8 is 2019-02-26
00:44:25, the UTC+0 date in the calculated Date value should be 2019-02-25 instead of 2019-02-26.
2. Timestamp must be the same as your current system time, and your system time and standard time must be
synced; if the difference between Timestamp and your current system time is larger than five minutes, therequest will fail. If your system time is out of sync with the standard time for a while, the request will fail andreturn a signature expiration error.

According to the preceding rules, the string to be signed obtained in the example is as follows:
TC3-HMAC-SHA256
1551113065
2019-02-25/cvm/tc3_request
2815843035062fffda5fd6f2a44ea8a34818b0dc46f024b8b3786976a3adda7a

3. Calculating the Signature
1. Calculate the derived signature key with the following pseudocode:

SecretKey = "Gu5t9xGARNpq86cd98joQYCN3*******"
SecretDate = HMAC_SHA256("TC3" + SecretKey, Date)
SecretService = HMAC_SHA256(SecretDate, Service)
SecretSigning = HMAC_SHA256(SecretService, "tc3_request")
Field Name

Explanation

SecretKey

The original SecretKey, i.e., Gu5t9xGARNpq86cd98joQYCN3******* .

Date

The Date field information in Credential , such as 2019-02-25 in this example.

©2013-2022 Tencent Cloud. All rights reserved.

Page 20 of 158

Tencent Cloud Automation Tools

Service

Value in the Service field in Credential , such as cvm in this example.

2. Calculate the signature with the following pseudocode:

Signature = HexEncode(HMAC_SHA256(SecretSigning, StringToSign))

4. Concatenating the Authorization
The Authorization is concatenated as follows:

Authorization =Algorithm + ' ' +'Credential=' + SecretId + '/' + CredentialScope + ', ' +'SignedHeaders=' + SignedHeaders + ', ' +'Signature=' + Signature
Field Name

Explanation

Algorithm

Signature algorithm, which is always TC3-HMAC-SHA256 .

SecretId

The SecretId in the key pair, i.e., AKIDz8krbsJ5yKBZQpn74WFkmLPx3******* .

CredentialScope

SignedHeadersSignature

Credential scope (see above). The calculation result in this example is 2019-0225/cvm/tc3_request .
Header information for signature calculation (see above), such as content-type;hostin this example.
Signature value. The calculation result in this example isc492e8e41437e97a620b728c301bb8d17e7dc0c17eeabce80c20cd70fc3a78ff .

According to the rules above, the value obtained in the example is:TC3-HMAC-SHA256 Credential=AKIDz8krbsJ5yKBZQpn74WFkmLPx3*******/2019-02-25/cvm/tc
3_request, SignedHeaders=content-type;host, Signature=c492e8e41437e97a620b728c301
bb8d17e7dc0c17eeabce80c20cd70fc3a78ff
The following example shows a finished authorization header:
POST https://cvm.tencentcloudapi.com/
Authorization: TC3-HMAC-SHA256 Credential=AKIDz8krbsJ5yKBZQpn74WFkmLPx3*******/20
19-02-25/cvm/tc3_request, SignedHeaders=content-type;host, Signature=c492e8e41437
e97a620b728c301bb8d17e7dc0c17eeabce80c20cd70fc3a78ff©2013-2022 Tencent Cloud. All rights reserved.

Page 21 of 158

Tencent Cloud Automation Tools

Content-Type: application/json; charset=utf-8
Host: cvm.tencentcloudapi.com
X-TC-Action: DescribeInstances
X-TC-Version: 2017-03-12
X-TC-Timestamp: 1551113065
X-TC-Region: ap-guangzhou{"Limit": 1, "Filters": [{"Values": ["unnamed"], "Name": "instance-name"}]}5. Signature Demo
When calling API 3.0, you are recommended to use the corresponding Tencent Cloud SDK 3.0 which encapsulates
the signature process, enabling you to focus on only the specific APIs provided by the product when developing. See
SDK Center for more information. Currently, the following programming languages are supported:
PythonJava
PHP
Go
NodeJS.NET
To further explain the signing process, we will use a programming language to implement the process describedabove. The request domain name, API and parameter values in the sample are used here. This goal of this example isonly to provide additional clarification for the signature process, please see the SDK for actual usage.
The final output URL might be: https://cvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=apguangzhou&SecretId=AKIDz8krbsJ5yKBZQpn74WFkmLPx3*******&Signature=EliP9YW3pW28FpsEdkXt%2F%2B
WcGeI%3D&Timestamp=1465185768&Version=2017-03-12.
Note: The key in the example is fictitious, and the timestamp is not the current time of the system, so if this URL is
opened in the browser or called using commands such as curl, an authentication error will be returned: Signature
expired. In order to get a URL that can work properly, you need to replace the SecretId and SecretKey in the example
with your real credentials and use the current time of the system as the Timestamp.
Note: In the example below, even if you use the same programming language, the order of the parameters in the URL
may be different for each execution. However, the order does not matter, as long as all the parameters are included in
the URL and the signature is calculated correctly.
Note: The following code is only applicable to API 3.0. It cannot be directly used in other signature processes. Even
with an older API, signature calculation errors may occur due to the differences in details. Please refer to thecorresponding documentation.

©2013-2022 Tencent Cloud. All rights reserved.

Page 22 of 158

Tencent Cloud Automation Tools

Java
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;
import java.util.TreeMap;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import javax.xml.bind.DatatypeConverter;
public class TencentCloudAPITC3Demo {private final static Charset UTF8 = StandardCharsets.UTF_8;
private final static String SECRET_ID = "AKIDz8krbsJ5yKBZQpn74WFkmLPx3*******";
private final static String SECRET_KEY = "Gu5t9xGARNpq86cd98joQYCN3*******";
private final static String CT_JSON = "application/json; charset=utf-8";
public static byte[] hmac256(byte[] key, String msg) throws Exception {Mac mac = Mac.getInstance("HmacSHA256");
SecretKeySpec secretKeySpec = new SecretKeySpec(key, mac.getAlgorithm());
mac.init(secretKeySpec);
return mac.doFinal(msg.getBytes(UTF8));}
public static String sha256Hex(String s) throws Exception {MessageDigest md = MessageDigest.getInstance("SHA-256");
byte[] d = md.digest(s.getBytes(UTF8));
return DatatypeConverter.printHexBinary(d).toLowerCase();}public static void main(String[] args) throws Exception {String service = "cvm";
String host = "cvm.tencentcloudapi.com";
String region = "ap-guangzhou";String action = "DescribeInstances";
String version = "2017-03-12";
String algorithm = "TC3-HMAC-SHA256";
String timestamp = "1551113065";//String timestamp = String.valueOf(System.currentTimeMillis() / 1000);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");// Pay attention to the time zone; otherwise, errors may occur
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
String date = sdf.format(new Date(Long.valueOf(timestamp + "000")));// ************* Step 1: Concatenate the CanonicalRequest string *************©2013-2022 Tencent Cloud. All rights reserved.

Page 23 of 158

Tencent Cloud Automation Tools

String httpRequestMethod = "POST";
String canonicalUri = "/";
String canonicalQueryString = "";String canonicalHeaders = "content-type:application/json; charset=utf-8\n" + "host:" + host + "\n";String signedHeaders = "content-type;host";
String payload = "{\"Limit\": 1, \"Filters\": [{\"Values\": [\"unnamed\"], \"Name\": \"instance-name\"}]}";
String hashedRequestPayload = sha256Hex(payload);
String canonicalRequest = httpRequestMethod + "\n" + canonicalUri + "\n" + canoni
calQueryString + "\n"+ canonicalHeaders + "\n" + signedHeaders + "\n" + hashedRequestPayload;
System.out.println(canonicalRequest);// ************* Step 2: Concatenate the string to sign *************
String credentialScope = date + "/" + service + "/" + "tc3_request";
String hashedCanonicalRequest = sha256Hex(canonicalRequest);
String stringToSign = algorithm + "\n" + timestamp + "\n" + credentialScope +"\n" + hashedCanonicalRequest;
System.out.println(stringToSign);// ************* Step 3: Calculate the signature *************
byte[] secretDate = hmac256(("TC3" + SECRET_KEY).getBytes(UTF8), date);byte[] secretService = hmac256(secretDate, service);byte[] secretSigning = hmac256(secretService, "tc3_request");String signature = DatatypeConverter.printHexBinary(hmac256(secretSigning, string
ToSign)).toLowerCase();
System.out.println(signature);// ************* Step 4: Concatenate the Authorization *************
String authorization = algorithm + " " + "Credential=" + SECRET_ID + "/" + creden
tialScope + ", "+ "SignedHeaders=" + signedHeaders + ", " + "Signature=" + signature;
System.out.println(authorization);
TreeMap<String, String> headers = new TreeMap<String, String>();headers.put("Authorization", authorization);headers.put("Content-Type", CT_JSON);headers.put("Host", host);
headers.put("X-TC-Action", action);headers.put("X-TC-Timestamp", timestamp);
headers.put("X-TC-Version", version);headers.put("X-TC-Region", region);
StringBuilder sb = new StringBuilder();sb.append("curl -X POST https://").append(host)©2013-2022 Tencent Cloud. All rights reserved.

Page 24 of 158

Tencent Cloud Automation Tools.append(" -H \"Authorization: ").append(authorization).append("\"").append(" -H \"Content-Type: application/json; charset=utf-8\"").append(" -H \"Host: ").append(host).append("\"").append(" -H \"X-TC-Action: ").append(action).append("\"").append(" -H \"X-TC-Timestamp: ").append(timestamp).append("\"").append(" -H \"X-TC-Version: ").append(version).append("\"").append(" -H \"X-TC-Region: ").append(region).append("\"").append(" -d '").append(payload).append("'");
System.out.println(sb.toString());}}

Python# -*- coding: utf-8 -*import hashlib, hmac, json, os, sys, timefrom datetime import datetime# Key Parameters
secret_id = "AKIDz8krbsJ5yKBZQpn74WFkmLPx3*******"
secret_key = "Gu5t9xGARNpq86cd98joQYCN3*******"
service = "cvm"host = "cvm.tencentcloudapi.com"
endpoint = "https://" + hostregion = "ap-guangzhou"
action = "DescribeInstances"version = "2017-03-12"
algorithm = "TC3-HMAC-SHA256"#timestamp = int(time.time())
timestamp = 1551113065
date = datetime.utcfromtimestamp(timestamp).strftime("%Y-%m-%d")params = {"Limit": 1, "Filters": [{"Name": "instance-name", "Values": ["unnamed"]}]}# ************* Step 1: Concatenate the CanonicalRequest string *************
http_request_method = "POST"
canonical_uri = "/"canonical_querystring = ""ct = "application/json; charset=utf-8"
payload = json.dumps(params)
canonical_headers = "content-type:%s\nhost:%s\n" % (ct, host)signed_headers = "content-type;host"hashed_request_payload = hashlib.sha256(payload.encode("utf-8")).hexdigest()
canonical_request = (http_request_method + "\n" +canonical_uri + "\n" +©2013-2022 Tencent Cloud. All rights reserved.

Page 25 of 158

Tencent Cloud Automation Tools

canonical_querystring + "\n" +canonical_headers + "\n" +signed_headers + "\n" +hashed_request_payload)
print(canonical_request)# ************* Step 2: Concatenate the string to sign *************
credential_scope = date + "/" + service + "/" + "tc3_request"
hashed_canonical_request = hashlib.sha256(canonical_request.encode("utf-8")).hexd
igest()
string_to_sign = (algorithm + "\n" +str(timestamp) + "\n" +credential_scope + "\n" +hashed_canonical_request)
print(string_to_sign)# ************* Step 3: Calculate the Signature *************# Function for computing signature digest
def sign(key, msg):
return hmac.new(key, msg.encode("utf-8"), hashlib.sha256).digest()
secret_date = sign(("TC3" + secret_key).encode("utf-8"), date)secret_service = sign(secret_date, service)secret_signing = sign(secret_service, "tc3_request")
signature = hmac.new(secret_signing, string_to_sign.encode("utf-8"), hashlib.sha256).hexdigest()
print(signature)# ************* Step 4: Concatenate the Authorization *************
authorization = (algorithm + " " +"Credential=" + secret_id + "/" + credential_scope + ", " +"SignedHeaders=" + signed_headers + ", " +"Signature=" + signature)
print(authorization)
print('curl -X POST ' + endpoint+ ' -H "Authorization: ' + authorization + '"'+ ' -H "Content-Type: application/json; charset=utf-8"'+ ' -H "Host: ' + host + '"'+ ' -H "X-TC-Action: ' + action + '"'+ ' -H "X-TC-Timestamp: ' + str(timestamp) + '"'+ ' -H "X-TC-Version: ' + version + '"'+ ' -H "X-TC-Region: ' + region + '"'+ " -d '" + payload + "'")

Golang©2013-2022 Tencent Cloud. All rights reserved.

Page 26 of 158

Tencent Cloud Automation Tools

package main
import ("crypto/hmac""crypto/sha256""encoding/hex""fmt""time")
func sha256hex(s string) string {b := sha256.Sum256([]byte(s))
return hex.EncodeToString(b[:])}func hmacsha256(s, key string) string {hashed := hmac.New(sha256.New, []byte(key))hashed.Write([]byte(s))
return string(hashed.Sum(nil))}func main() {secretId := "AKIDz8krbsJ5yKBZQpn74WFkmLPx3*******"
secretKey := "Gu5t9xGARNpq86cd98joQYCN3*******"
host := "cvm.tencentcloudapi.com"
algorithm := "TC3-HMAC-SHA256"
service := "cvm"version := "2017-03-12"
action := "DescribeInstances"
region := "ap-guangzhou"//var timestamp int64 = time.Now().Unix()
var timestamp int64 = 1551113065// step 1: build canonical request string
httpRequestMethod := "POST"
canonicalURI := "/"canonicalQueryString := ""canonicalHeaders := "content-type:application/json; charset=utf-8\n" + "host:" +host + "\n"signedHeaders := "content-type;host"
payload := `{"Limit": 1, "Filters": [{"Values": ["unnamed"], "Name": "instance-name"}]}`
hashedRequestPayload := sha256hex(payload)
canonicalRequest := fmt.Sprintf("%s\n%s\n%s\n%s\n%s\n%s",
httpRequestMethod,
canonicalURI,©2013-2022 Tencent Cloud. All rights reserved.

Page 27 of 158

Tencent Cloud Automation Tools

canonicalQueryString,canonicalHeaders,signedHeaders,hashedRequestPayload)
fmt.Println(canonicalRequest)// step 2: build string to sign
date := time.Unix(timestamp, 0).UTC().Format("2006-01-02")
credentialScope := fmt.Sprintf("%s/%s/tc3_request", date, service)hashedCanonicalRequest := sha256hex(canonicalRequest)
string2sign := fmt.Sprintf("%s\n%d\n%s\n%s",
algorithm,
timestamp,
credentialScope,
hashedCanonicalRequest)
fmt.Println(string2sign)// step 3: sign string
secretDate := hmacsha256(date, "TC3"+secretKey)
secretService := hmacsha256(service, secretDate)secretSigning := hmacsha256("tc3_request", secretService)signature := hex.EncodeToString([]byte(hmacsha256(string2sign, secretSigning)))
fmt.Println(signature)// step 4: build authorization
authorization := fmt.Sprintf("%s Credential=%s/%s, SignedHeaders=%s, Signature=%s",algorithm,
secretId,
credentialScope,
signedHeaders,signature)
fmt.Println(authorization)
curl := fmt.Sprintf(`curl -X POST https://%s\-H "Authorization: %s"\
-H "Content-Type: application/json; charset=utf-8"\-H "Host: %s" -H "X-TC-Action: %s"\
-H "X-TC-Timestamp: %d"\
-H "X-TC-Version: %s"\
-H "X-TC-Region: %s"\-d '%s'`, host, authorization, host, action, timestamp, version, region, payload)
fmt.Println(curl)}

PHP©2013-2022 Tencent Cloud. All rights reserved.

Page 28 of 158

Tencent Cloud Automation Tools<?php$secretId = "AKIDz8krbsJ5yKBZQpn74WFkmLPx3*******";$secretKey = "Gu5t9xGARNpq86cd98joQYCN3*******";$host = "cvm.tencentcloudapi.com";$service = "cvm";$version = "2017-03-12";$action = "DescribeInstances";$region = "ap-guangzhou";// $timestamp = time();$timestamp = 1551113065;$algorithm = "TC3-HMAC-SHA256";// step 1: build canonical request string$httpRequestMethod = "POST";$canonicalUri = "/";
$canonicalQueryString = "";$canonicalHeaders = "content-type:application/json; charset=utf-8\n"."host:".$host."\n";$signedHeaders = "content-type;host";$payload = '{"Limit": 1, "Filters": [{"Values": ["unnamed"], "Name": "instance-name"}]}';$hashedRequestPayload = hash("SHA256", $payload);$canonicalRequest = $httpRequestMethod."\n".$canonicalUri."\n".$canonicalQueryString."\n".$canonicalHeaders."\n".$signedHeaders."\n".$hashedRequestPayload;
echo $canonicalRequest.PHP_EOL;// step 2: build string to sign
$date = gmdate("Y-m-d", $timestamp);$credentialScope = $date."/".$service."/tc3_request";$hashedCanonicalRequest = hash("SHA256", $canonicalRequest);$stringToSign = $algorithm."\n".$timestamp."\n".$credentialScope."\n".$hashedCanonicalRequest;
echo $stringToSign.PHP_EOL;// step 3: sign string$secretDate = hash_hmac("SHA256", $date, "TC3".$secretKey, true);$secretService = hash_hmac("SHA256", $service, $secretDate, true);$secretSigning = hash_hmac("SHA256", "tc3_request", $secretService, true);$signature = hash_hmac("SHA256", $stringToSign, $secretSigning);
echo $signature.PHP_EOL;©2013-2022 Tencent Cloud. All rights reserved.

Page 29 of 158

Tencent Cloud Automation Tools// step 4: build authorization$authorization = $algorithm." Credential=".$secretId."/".$credentialScope.", SignedHeaders=content-type;host, Signature=".$signature;echo $authorization.PHP_EOL;$curl = "curl -X POST https://".$host.' -H "Authorization: '.$authorization.'"'.' -H "Content-Type: application/json; charset=utf-8"'.' -H "Host: '.$host.'"'.' -H "X-TC-Action: '.$action.'"'.' -H "X-TC-Timestamp: '.$timestamp.'"'.' -H "X-TC-Version: '.$version.'"'.' -H "X-TC-Region: '.$region.'"'." -d '".$payload."'";
echo $curl.PHP_EOL;

Ruby# -*- coding: UTF-8 -*# require ruby>=2.3.0
require 'digest'
require 'json'
require 'time'require 'openssl'# Key Parameters
secret_id = 'AKIDz8krbsJ5yKBZQpn74WFkmLPx3*******'
secret_key = 'Gu5t9xGARNpq86cd98joQYCN3*******'
service = 'cvm'
host = 'cvm.tencentcloudapi.com'
endpoint = 'https://' + hostregion = 'ap-guangzhou'
action = 'DescribeInstances'version = '2017-03-12'
algorithm = 'TC3-HMAC-SHA256'# timestamp = Time.now.to_i
timestamp = 1551113065
date = Time.at(timestamp).utc.strftime('%Y-%m-%d')# ************* Step 1: Concatenate the CanonicalRequest string *************
http_request_method = 'POST'
canonical_uri = '/'canonical_querystring = ''©2013-2022 Tencent Cloud. All rights reserved.

Page 30 of 158

Tencent Cloud Automation Tools

canonical_headers = "content-type:application/json; charset=utf-8\nhost:#{host}\n"signed_headers = 'content-type;host'# params = { 'Limit' => 1, 'Filters' => [{ 'Name' => 'instance-name', 'Values' =>['unnamed'] }] }# payload = JSON.generate(params, { 'ascii_only' => true, 'space' => ' ' })# json will generate in random order, to get specified result in example, we hard-code it here.
payload = '{"Limit": 1, "Filters": [{"Values": ["unnamed"], "Name": "instance-name"}]}'
hashed_request_payload = Digest::SHA256.hexdigest(payload)
canonical_request = [http_request_method,
canonical_uri,canonical_querystring,canonical_headers,signed_headers,hashed_request_payload,].join("\n")puts canonical_request# ************* Step 2: Concatenate the string to sign *************
credential_scope = date + '/' + service + '/' + 'tc3_request'
hashed_request_payload = Digest::SHA256.hexdigest(canonical_request)
string_to_sign = [algorithm,
timestamp.to_s,
credential_scope,
hashed_request_payload,].join("\n")puts string_to_sign# ************* Step 3: Calculate the Signature *************
digest = OpenSSL::Digest.new('sha256')secret_date = OpenSSL::HMAC.digest(digest, 'TC3' + secret_key, date)secret_service = OpenSSL::HMAC.digest(digest, secret_date, service)secret_signing = OpenSSL::HMAC.digest(digest, secret_service, 'tc3_request')
signature = OpenSSL::HMAC.hexdigest(digest, secret_signing, string_to_sign)
puts signature# ************* Step 4: Concatenate the Authorization *************
authorization = "#{algorithm} Credential=#{secret_id}/#{credential_scope}, Signed
Headers=#{signed_headers}, Signature=#{signature}"puts authorization
puts 'curl -X POST ' + endpoint \©2013-2022 Tencent Cloud. All rights reserved.

Page 31 of 158

Tencent Cloud Automation Tools+ ' -H "Authorization: ' + authorization + '"' \+ ' -H "Content-Type: application/json; charset=utf-8"' \+ ' -H "Host: ' + host + '"' \+ ' -H "X-TC-Action: ' + action + '"' \+ ' -H "X-TC-Timestamp: ' + timestamp.to_s + '"' \+ ' -H "X-TC-Version: ' + version + '"' \+ ' -H "X-TC-Region: ' + region + '"' \+ " -d '" + payload + "'"DotNetusing System;
using System.Collections.Generic;using System.Security.Cryptography;
using System.Text;
public class Application{
public static string SHA256Hex(string s){
using (SHA256 algo = SHA256.Create()){
byte[] hashbytes = algo.ComputeHash(Encoding.UTF8.GetBytes(s));
StringBuilder builder = new StringBuilder();for (int i = 0; i < hashbytes.Length; ++i){
builder.Append(hashbytes[i].ToString("x2"));}
return builder.ToString();}}
public static byte[] HmacSHA256(byte[] key, byte[] msg){
using (HMACSHA256 mac = new HMACSHA256(key)){
return mac.ComputeHash(msg);}}
public static Dictionary<String, String> BuildHeaders(string secretid,
string secretkey, string service, string endpoint, string region,
string action, string version, DateTime date, string requestPayload){
string datestr = date.ToString("yyyy-MM-dd");
DateTime startTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);
long requestTimestamp = (long)Math.Round((date - startTime).TotalMilliseconds, Mi©2013-2022 Tencent Cloud. All rights reserved.

Page 32 of 158

Tencent Cloud Automation Tools

dpointRounding.AwayFromZero) / 1000;// ************* Step 1: Concatenate the CanonicalRequest string *************
string algorithm = "TC3-HMAC-SHA256";
string httpRequestMethod = "POST";
string canonicalUri = "/";
string canonicalQueryString = "";string contentType = "application/json";string canonicalHeaders = "content-type:" + contentType + "; charset=utf-8\n" +"host:" + endpoint + "\n";string signedHeaders = "content-type;host";
string hashedRequestPayload = SHA256Hex(requestPayload);string canonicalRequest = httpRequestMethod + "\n"+ canonicalUri + "\n"+ canonicalQueryString + "\n"+ canonicalHeaders + "\n"+ signedHeaders + "\n"+ hashedRequestPayload;
Console.WriteLine(canonicalRequest);
Console.WriteLine("----------------------------------");// ************ Step 2: Concatenate the string to sign *************
string credentialScope = datestr + "/" + service + "/" + "tc3_request";
string hashedCanonicalRequest = SHA256Hex(canonicalRequest);
string stringToSign = algorithm + "\n" + requestTimestamp.ToString() + "\n" + cre
dentialScope + "\n" + hashedCanonicalRequest;
Console.WriteLine(stringToSign);
Console.WriteLine("----------------------------------");// ************* Step 3: Calculate the signature *************
byte[] tc3SecretKey = Encoding.UTF8.GetBytes("TC3" + secretkey);byte[] secretDate = HmacSHA256(tc3SecretKey, Encoding.UTF8.GetBytes(datestr));byte[] secretService = HmacSHA256(secretDate, Encoding.UTF8.GetBytes(service));byte[] secretSigning = HmacSHA256(secretService, Encoding.UTF8.GetBytes("tc3_request"));
byte[] signatureBytes = HmacSHA256(secretSigning, Encoding.UTF8.GetBytes(stringTo
Sign));
string signature = BitConverter.ToString(signatureBytes).Replace("-", "").ToLower();
Console.WriteLine(signature);
Console.WriteLine("----------------------------------");// ************* Step 4: Concatenate the Authorization *************
string authorization = algorithm + " "+ "Credential=" + secretid + "/" + credentialScope + ", "+ "SignedHeaders=" + signedHeaders + ", "+ "Signature=" + signature;
Console.WriteLine(authorization);©2013-2022 Tencent Cloud. All rights reserved.

Page 33 of 158

Tencent Cloud Automation Tools

Console.WriteLine("----------------------------------");
Dictionary<string, string> headers = new Dictionary<string, string>();headers.Add("Authorization", authorization);headers.Add("Host", endpoint);
headers.Add("Content-Type", contentType + "; charset=utf-8");
headers.Add("X-TC-Timestamp", requestTimestamp.ToString());
headers.Add("X-TC-Version", version);headers.Add("X-TC-Action", action);headers.Add("X-TC-Region", region);
return headers;}public static void Main(string[] args){// SecretID and SecretKey
string SECRET_ID = "AKIDz8krbsJ5yKBZQpn74WFkmLPx3*******";
string SECRET_KEY = "Gu5t9xGARNpq86cd98joQYCN3*******";
string service = "cvm";
string endpoint = "cvm.tencentcloudapi.com";string region = "ap-guangzhou";string action = "DescribeInstances";
string version = "2017-03-12";// The timestamp `2019-02-26 00:44:25` used here is only for reference. In a proj
ect, use the following parameter:// DateTime date = DateTime.UtcNow;// Enter the correct time zone. We recommend using UTC timestamp to avoid errors.
DateTime date = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc).AddSeconds(1551113065);
string requestPayload = "{\"Limit\": 1, \"Filters\": [{\"Values\": [\"\\u672a\\u5
47d\\u540d\"], \"Name\": \"instance-name\"}]}";
Dictionary<string, string> headers = BuildHeaders(SECRET_ID, SECRET_KEY, service, endpoint, region, action, version, date, requestPayload);
Console.WriteLine("POST https://cvm.tencentcloudapi.com");foreach (KeyValuePair<string, string> kv in headers){Console.WriteLine(kv.Key + ": " + kv.Value);}
Console.WriteLine();Console.WriteLine(requestPayload);}}©2013-2022 Tencent Cloud. All rights reserved.

Page 34 of 158

Tencent Cloud Automation Tools

NodeJS
const crypto = require('crypto');function sha256(message, secret = '', encoding) {const hmac = crypto.createHmac('sha256', secret)return hmac.update(message).digest(encoding)}
function getHash(message, encoding = 'hex') {const hash = crypto.createHash('sha256')
return hash.update(message).digest(encoding)}
function getDate(timestamp) {const date = new Date(timestamp * 1000)
const year = date.getUTCFullYear()const month = ('0' + (date.getUTCMonth() + 1)).slice(-2)
const day = ('0' + date.getUTCDate()).slice(-2)
return `${year}-${month}-${day}`}function main(){const SECRET_ID = "AKIDz8krbsJ5yKBZQpn74WFkmLPx3*******"
const SECRET_KEY = "Gu5t9xGARNpq86cd98joQYCN3*******"
const endpoint = "cvm.tencentcloudapi.com"
const service = "cvm"
const region = "ap-guangzhou"
const action = "DescribeInstances"
const version = "2017-03-12"//const timestamp = getTime()
const timestamp = 1551113065
const date = getDate(timestamp)// ************* Step 1: Concatenate the CanonicalRequest string *************
const signedHeaders = "content-type;host"const payload = "{\"Limit\": 1, \"Filters\": [{\"Values\": [\"unnamed\"], \"Name\": \"instance-name\"}]}"
const hashedRequestPayload = getHash(payload);
const httpRequestMethod = "POST"
const canonicalUri = "/"const canonicalQueryString = ""const canonicalHeaders = "content-type:application/json; charset=utf-8\n" + "host:" + endpoint + "\n"const canonicalRequest = httpRequestMethod + "\n"©2013-2022 Tencent Cloud. All rights reserved.

Page 35 of 158

Tencent Cloud Automation Tools+ canonicalUri + "\n"+ canonicalQueryString + "\n"+ canonicalHeaders + "\n"+ signedHeaders + "\n"+ hashedRequestPayload
console.log(canonicalRequest)
console.log("----------------------------")// ************* Step 2: Concatenate the string to sign *************
const algorithm = "TC3-HMAC-SHA256"
const hashedCanonicalRequest = getHash(canonicalRequest);
const credentialScope = date + "/" + service + "/" + "tc3_request"
const stringToSign = algorithm + "\n" +timestamp + "\n" +credentialScope + "\n" +hashedCanonicalRequest
console.log(stringToSign)
console.log("----------------------------")// ************* Step 3: Calculate the signature *************
const kDate = sha256(date, 'TC3' + SECRET_KEY)
const kService = sha256(service, kDate)
const kSigning = sha256('tc3_request', kService)
const signature = sha256(stringToSign, kSigning, 'hex')
console.log(signature)
console.log("----------------------------")// ************* Step 4: Concatenate the Authorization *************
const authorization = algorithm + " " +"Credential=" + SECRET_ID + "/" + credentialScope + ", " +"SignedHeaders=" + signedHeaders + ", " +"Signature=" + signature
console.log(authorization)
console.log("----------------------------")
const Call_Information = 'curl -X POST ' + "https://" + endpoint+ ' -H "Authorization: ' + authorization + '"'+ ' -H "Content-Type: application/json; charset=utf-8"'+ ' -H "Host: ' + endpoint + '"'+ ' -H "X-TC-Action: ' + action + '"'+ ' -H "X-TC-Timestamp: ' + timestamp.toString() + '"'+ ' -H "X-TC-Version: ' + version + '"'+ ' -H "X-TC-Region: ' + region + '"'+ " -d '" + payload + "'"console.log(Call_Information)}main()©2013-2022 Tencent Cloud. All rights reserved.

Page 36 of 158

Tencent Cloud Automation Tools

C++#include <iostream>#include <iomanip>#include <sstream>#include <string>#include <stdio.h>#include <time.h>#include <openssl/sha.h>#include <openssl/hmac.h>using namespace std;
string get_data(int64_t &timestamp){
string utcDate;char buff[20] = {0};// time_t timenow;
struct tm sttime;
sttime = *gmtime(&timestamp);
strftime(buff, sizeof(buff), "%Y-%m-%d", &sttime);
utcDate = string(buff);
return utcDate;}string int2str(int64_t n){
std::stringstream ss;
ss << n;return ss.str();}string sha256Hex(const string &str){
char buf[3];unsigned char hash[SHA256_DIGEST_LENGTH];
SHA256_CTX sha256;
SHA256_Init(&sha256);
SHA256_Update(&sha256, str.c_str(), str.size());
SHA256_Final(hash, &sha256);
std::string NewString = "";for(int i = 0; i < SHA256_DIGEST_LENGTH; i++){snprintf(buf, sizeof(buf), "%02x", hash[i]);NewString = NewString + buf;}
return NewString;©2013-2022 Tencent Cloud. All rights reserved.

Page 37 of 158

Tencent Cloud Automation Tools}
string HmacSha256(const string &key, const string &input){
unsigned char hash[32];
HMAC_CTX *h;#if OPENSSL_VERSION_NUMBER < 0x10100000L
HMAC_CTX hmac;
HMAC_CTX_init(&hmac);h = &hmac;#else
h = HMAC_CTX_new();#endif
HMAC_Init_ex(h, &key[0], key.length(), EVP_sha256(), NULL);
HMAC_Update(h, ( unsigned char* )&input[0], input.length());
unsigned int len = 32;
HMAC_Final(h, hash, &len);#if OPENSSL_VERSION_NUMBER < 0x10100000L
HMAC_CTX_cleanup(h);#else
HMAC_CTX_free(h);#endif
std::stringstream ss;
ss << std::setfill('0');for (int i = 0; i < len; i++){ss << hash[i];}return (ss.str());}
string HexEncode(const string &input){
static const char* const lut = "0123456789abcdef";
size_t len = input.length();string output;
output.reserve(2 * len);for (size_t i = 0; i < len; ++i){
const unsigned char c = input[i];output.push_back(lut[c >> 4]);
output.push_back(lut[c & 15]);}©2013-2022 Tencent Cloud. All rights reserved.

Page 38 of 158

Tencent Cloud Automation Tools

return output;}
int main(){string SECRET_ID = "AKIDz8krbsJ5yKBZQpn74WFkmLPx3*******";
string SECRET_KEY = "Gu5t9xGARNpq86cd98joQYCN3*******";
string service = "cvm";
string host = "cvm.tencentcloudapi.com";string region = "ap-guangzhou";string action = "DescribeInstances";
string version = "2017-03-12";
int64_t timestamp = 1551113065;
string date = get_data(timestamp);// ************* Step 1: Concatenate the CanonicalRequest string *************
string httpRequestMethod = "POST";
string canonicalUri = "/";
string canonicalQueryString = "";string canonicalHeaders = "content-type:application/json; charset=utf-8\nhost:" +host + "\n";string signedHeaders = "content-type;host";
string payload = "{\"Limit\": 1, \"Filters\": [{\"Values\": [\"unnamed\"], \"Name\": \"instance-name\"}]}";
string hashedRequestPayload = sha256Hex(payload);string canonicalRequest = httpRequestMethod + "\n" + canonicalUri + "\n" + canoni
calQueryString + "\n"+ canonicalHeaders + "\n" + signedHeaders + "\n" + hashedRequestPayload;cout << canonicalRequest << endl;
cout << "-----------------------" << endl;// ************* Step 2: Concatenate the string to sign *************
string algorithm = "TC3-HMAC-SHA256";
string RequestTimestamp = int2str(timestamp);
string credentialScope = date + "/" + service + "/" + "tc3_request";
string hashedCanonicalRequest = sha256Hex(canonicalRequest);
string stringToSign = algorithm + "\n" + RequestTimestamp + "\n" + credentialScop
e + "\n" + hashedCanonicalRequest;
cout << stringToSign << endl;
cout << "-----------------------" << endl;// ************* Step 3: Calculate the signature ***************
string kKey = "TC3" + SECRET_KEY;
string kDate = HmacSha256(kKey, date);
string kService = HmacSha256(kDate, service);
string kSigning = HmacSha256(kService, "tc3_request");©2013-2022 Tencent Cloud. All rights reserved.

Page 39 of 158

Tencent Cloud Automation Tools

string signature = HexEncode(HmacSha256(kSigning, stringToSign));cout << signature << endl;
cout << "-----------------------" << endl;// ************* Step 4: Concatenate the Authorization *************
string authorization = algorithm + " " + "Credential=" + SECRET_ID + "/" + creden
tialScope + ", "+ "SignedHeaders=" + signedHeaders + ", " + "Signature=" + signature;cout << authorization << endl;
cout << "------------------------" << endl;
string headers = "curl -X POST https://" + host + "\n"+ " -H \"Authorization: " + authorization + "\n"+ " -H \"Content-Type: application/json; charset=utf-8\"" + "\n"+ " -H \"Host: " + host + "\n"+ " -H \"X-TC-Action: " + action + "\n"+ " -H \"X-TC-Timestamp: " + RequestTimestamp + "\n"+ " -H \"X-TC-Version: " + version + "\n"+ " -H \"X-TC-Region: " + region + "\n"+ " -d '" + payload;cout << headers << endl;
return 0;};

Signature Failure
The following situational error codes for signature failure may occur. Please resolve the errors accordingly.
Error CodeDescription

AuthFailure.SignatureExpire

Signature expired. Timestamp and server time cannot differ by more than fiveminutes.

AuthFailure.SecretIdNotFoundThe key does not exist. Please go to the console to check whether it isdisabled or you copied fewer or more characters.

AuthFailure.SignatureFailure

Signature error. It is possible that the signature was calculated incorrectly, thesignature does not match the content actually sent, or the SecretKey isincorrect.

AuthFailure.TokenFailure

Temporary certificate token error.

AuthFailure.InvalidSecretId

Invalid key (not a TencentCloud API key type).

©2013-2022 Tencent Cloud. All rights reserved.

Page 40 of 158

Tencent Cloud Automation Tools

Signature：

Last updated 2022-06-01 14:28:22
Tencent Cloud API authenticates each access request, i.e. each request needs to include authentication information(Signature) in the common parameters to verify the identity of the requester.
The Signature is generated by the security credentials which include SecretId and SecretKey. If you don't have thesecurity credentials yet, go to the TencentCloud API Key page to apply for them; otherwise, you cannot invoke theTencentCloud API.

1. Applying for Security Credentials
Before using the TencentCloud API for the first time, go to the TencentCloud API Key page to apply for security
credentials.
Security credentials consist of SecretId and SecretKey:
SecretId is used to identify the API requester.
SecretKey is used to encrypt the signature string and verify it on the server.
You must keep your security credentials private and avoid disclosure.
You can apply for the security credentials through the following steps:
1. Log in to the Tencent Cloud Console.
2. Go to the TencentCloud API Key page.
3. On the API Key Management page, click Create Key to create a SecretId/SecretKey pair.
Note: Each account can have up to two pairs of SecretId/SecretKey.

2. Generating a SignatureWith the SecretId and SecretKey, a signature can be generated. The following describes how to generate a signature:
Assume that the SecretId and SecretKey are:SecretId: AKIDz8krbsJ5yKBZQpn74WFkmLPx3*******
SecretKey: Gu5t9xGARNpq86cd98joQYCN3*******
Note: This is just an example. For actual operations, please use your own SecretId and SecretKey.

©2013-2022 Tencent Cloud. All rights reserved.

Page 41 of 158

Tencent Cloud Automation Tools

Take the Cloud Virtual Machine's request to view the instance list (DescribeInstances) as an example. When you
invoke this API, the request parameters may be as follows:
Parameter
nameDescription

Parameter value

Action

Method name

DescribeInstances

SecretId

Key ID

AKIDz8krbsJ5yKBZQpn74WFkmLPx3*******

Timestamp

Current timestamp

1465185768

Nonce

Random positive integer

11886

RegionRegion where the instance islocatedap-guangzhou

InstanceIds.0

ID of the instance to query

ins-09dx96dg

OffsetOffset0

Limit

Allowed maximum output

20

VersionAPI version number

2017-03-12

2.1. Sorting Parameters
First, sort all the request parameters in an ascending lexicographical order (ASCII code) by their names. Notes: (1)Parameters are sorted by their names instead of their values; (2) The parameters are sorted based on ASCII code, notin an alphabetical order or by values. For example, InstanceIds.2 should be arranged after InstanceIds.12. You cancomplete the sorting process using a sorting function in a programming language, such as the ksort function in PHP.
The parameters in the example are sorted as follows:{'Action' : 'DescribeInstances','InstanceIds.0' : 'ins-09dx96dg','Limit' : 20,'Nonce' : 11886,'Offset' : 0,
'Region' : 'ap-guangzhou','SecretId' : 'AKIDz8krbsJ5yKBZQpn74WFkmLPx3*******','Timestamp' : 1465185768,'Version': '2017-03-12',}©2013-2022 Tencent Cloud. All rights reserved.

Page 42 of 158

Tencent Cloud Automation Tools

When developing in another programming language, you can sort these sample parameters and it will work as long as
you obtain the same results.

2.2. Concatenating a Request String
This step generates a request string.
Format the request parameters sorted in the previous step into the form of "parameter name"="parameter value". For
example, for the Action parameter, its parameter name is "Action" and its parameter value is "DescribeInstances", so it
will become Action=DescribeInstances after formatted.
Note: The "parameter value" is the original value but not the value after URL encoding.
Then, concatenate the formatted parameters with "&". The resulting request string is as follows:
Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKIDz8krbsJ5yKBZQpn74WFkmLPx3*******&Timestamp=1465
185768&Version=2017-03-12

2.3. Concatenating the Signature Original String
This step generates a signature original string.
The signature original string consists of the following parameters:
1. HTTP method: POST and GET modes are supported, and GET is used here for the request. Please note that themethod name should be in all capital letters.
2. Request server: the domain name of the request to view the list of instances (DescribeInstances) is
cvm.tencentcloudapi.com. The actual request domain name varies by the module to which the API belongs. For
more information, see the instructions of the specific API.
3. Request path: The request path in the current version of TencentCloud API is fixed to /.
4. Request string: the request string generated in the previous step.
The concatenation rule of the signature original string is: Request method + request host + request path + ? + request
string
The concatenation result of the example is:

GETcvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&L
imit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKIDz8krbsJ5yKBZQpn74WF
kmLPx3*******&Timestamp=1465185768&Version=2017-03-12

2.4. Generating a Signature String
This step generates a signature string.
First, use the HMAC-SHA1 algorithm to sign the signature original string obtained in the previous step, and then©2013-2022 Tencent Cloud. All rights reserved.

Page 43 of 158

Tencent Cloud Automation Tools

encode the generated signature using Base64 to obtain the final signature.
The specific code is as follows with the PHP language being used as an example:$secretKey = 'Gu5t9xGARNpq86cd98joQYCN3*******';$srcStr = 'GETcvm.tencentcloudapi.com/?Action=DescribeInstances&InstanceIds.0=ins-09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=ap-guangzhou&SecretId=AKIDz8krbsJ5
yKBZQpn74WFkmLPx3*******&Timestamp=1465185768&Version=2017-03-12';$signStr = base64_encode(hash_hmac('sha1', $srcStr, $secretKey, true));echo $signStr;
The final signature is:zmmjn35mikh6pM3V7sUEuX4wyYM=
When developing in another programming language, you can sign and verify the original in the example above and it
works as long as you get the same results.

3. Encoding a Signature String
The generated signature string cannot be directly used as a request parameter and must be URL encoded.
For example, if the signature string generated in the previous step is zmmjn35mikh6pM3V7sUEuX4wyYM=, the final
signature string request parameter (Signature) is zmmjn35mikh6pM3V7sUEuX4wyYM%3D, which will be used togenerate the final request URL.
Note: If your request method is GET, or the request method is POST and the Content-Type isapplication/x-www-form-urlencoded, then all the request parameter values need to be URL encoded(except the parameter key and the symbol of =) when sending the request. Non-ASCII characters need to
be encoded with UTF-8 before URL encoding.
Note: The network libraries of some programming languages automatically URL encode all parameters, inwhich case there is no need to URL encode the signature string; otherwise, two rounds of URL encoding
will cause the signature to fail.
Note: Other parameter values also need to be encoded using RFC 3986. Use %XY in percent-encoding forspecial characters such as Chinese characters, where "X" and "Y" are hexadecimal characters (0-9 anduppercase A-F), and using lowercase will cause an error.

4. Signature Failure©2013-2022 Tencent Cloud. All rights reserved.

Page 44 of 158

Tencent Cloud Automation Tools

The following situational error codes for signature failure may occur. Please resolve the errors accordingly.
Error code

Error description

AuthFailure.SignatureExpire

The signature is expired

AuthFailure.SecretIdNotFoundThe key does not exist

AuthFailure.SignatureFailure

Signature error

AuthFailure.TokenFailure

Token error

AuthFailure.InvalidSecretId

Invalid key (not a TencentCloud API key type)

5. Signature Demo
When calling API 3.0, you are recommended to use the corresponding Tencent Cloud SDK 3.0 which encapsulates
the signature process, enabling you to focus on only the specific APIs provided by the product when developing. See
SDK Center for more information. Currently, the following programming languages are supported:
PythonJava
PHP
Go
NodeJS.NET
To further explain the signing process, we will use a programming language to implement the process describedabove. The request domain name, API and parameter values in the sample are used here. This goal of this example isonly to provide additional clarification for the signature process, please see the SDK for actual usage.
The final output URL might be: https://cvm.tencentcloudapi.com/?
Action=DescribeInstances&InstanceIds.0=ins09dx96dg&Limit=20&Nonce=11886&Offset=0&Region=apguangzhou&SecretId=AKIDz8krbsJ5yKBZQpn74WFkmLPx3*******&Signature=zmmjn35mikh6pM3V7s
UEuX4wyYM%3D&Timestamp=1465185768&Version=2017-03-12 .
Note: The key in the example is fictitious, and the timestamp is not the current time of the system, so if this URL is
opened in the browser or called using commands such as curl, an authentication error will be returned: Signature
expired. In order to get a URL that can work properly, you need to replace the SecretId and SecretKey in the example
with your real credentials and use the current time of the system as the Timestamp.

©2013-2022 Tencent Cloud. All rights reserved.

Page 45 of 158

Tencent Cloud Automation Tools

Note: In the example below, even if you use the same programming language, the order of the parameters in the URL
may be different for each execution. However, the order does not matter, as long as all the parameters are included in
the URL and the signature is calculated correctly.
Note: The following code is only applicable to API 3.0. It cannot be directly used in other signature processes. Even
with an older API, signature calculation errors may occur due to the differences in details. Please refer to thecorresponding documentation.

Java
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;import java.util.Random;
import java.util.TreeMap;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import javax.xml.bind.DatatypeConverter;
public class TencentCloudAPIDemo {private final static String CHARSET = "UTF-8";
public static String sign(String s, String key, String method) throws Exception {Mac mac = Mac.getInstance(method);
SecretKeySpec secretKeySpec = new SecretKeySpec(key.getBytes(CHARSET), mac.getAlg
orithm());
mac.init(secretKeySpec);
byte[] hash = mac.doFinal(s.getBytes(CHARSET));
return DatatypeConverter.printBase64Binary(hash);}public static String getStringToSign(TreeMap<String, Object> params) {StringBuilder s2s = new StringBuilder("GETcvm.tencentcloudapi.com/?");// When signing, the parameters need to be sorted in lexicographical order. TreeM
ap is used here to guarantee the correct order.
for (String k : params.keySet()) {s2s.append(k).append("=").append(params.get(k).toString()).append("&");}
return s2s.toString().substring(0, s2s.length() - 1);}
public static String getUrl(TreeMap<String, Object> params) throws UnsupportedEnc
odingException {StringBuilder url = new StringBuilder("https://cvm.tencentcloudapi.com/?");// There is no requirement for the order of the parameters in the actual request
URL.
for (String k : params.keySet()) {// The request string needs to be URL encoded. As the Key is all in English letters, only the value is URL encoded here.
url.append(k).append("=").append(URLEncoder.encode(params.get(k).toString(), CHAR
SET)).append("&");©2013-2022 Tencent Cloud. All rights reserved.

Page 46 of 158

Tencent Cloud Automation Tools}
return url.toString().substring(0, url.length() - 1);}
public static void main(String[] args) throws Exception {TreeMap<String, Object> params = new TreeMap<String, Object>(); // TreeMap enable
s automatic sorting// A random number should be used when actually calling, for example: params.put("Nonce", new Random().nextInt(java.lang.Integer.MAX_VALUE));params.put("Nonce", 11886); // Common parameter// The current time of the system should be used when actually calling, for examp
le: params.put("Timestamp", System.currentTimeMillis() / 1000);params.put("Timestamp", 1465185768); // Common parameterparams.put("SecretId", "AKIDz8krbsJ5yKBZQpn74WFkmLPx3*******"); // Common parameterparams.put("Action", "DescribeInstances"); // Common parameterparams.put("Version", "2017-03-12"); // Common parameterparams.put("Region", "ap-guangzhou"); // Common parameterparams.put("Limit", 20); // Business parameterparams.put("Offset", 0); // Business parameterparams.put("InstanceIds.0", "ins-09dx96dg"); // Business parameterparams.put("Signature", sign(getStringToSign(params), "Gu5t9xGARNpq86cd98joQYCN3*******", "HmacSHA1")); // Common parameter
System.out.println(getUrl(params));}}

PythonNote: If running in a Python 2 environment, the following requests dependency package must be installed first: pip
install requests .

# -*- coding: utf8 -*import base64
import hashlib
import hmac
import time
import requests
secret_id = "AKIDz8krbsJ5yKBZQpn74WFkmLPx3*******"
secret_key = "Gu5t9xGARNpq86cd98joQYCN3*******"
def get_string_to_sign(method, endpoint, params):
s = method + endpoint + "/?"
query_str = "&".join("%s=%s" % (k, params[k]) for k in sorted(params))
return s + query_str
def sign_str(key, s, method):
hmac_str = hmac.new(key.encode("utf8"), s.encode("utf8"), method).digest()
return base64.b64encode(hmac_str)©2013-2022 Tencent Cloud. All rights reserved.

Page 47 of 158

Tencent Cloud Automation Tools

if __name__ == '__main__':endpoint = "cvm.tencentcloudapi.com"
data = {'Action' : 'DescribeInstances','InstanceIds.0' : 'ins-09dx96dg','Limit' : 20,'Nonce' : 11886,'Offset' : 0,
'Region' : 'ap-guangzhou','SecretId' : secret_id,'Timestamp' : 1465185768, # int(time.time())'Version': '2017-03-12'}
s = get_string_to_sign("GET", endpoint, data)
data["Signature"] = sign_str(secret_key, s, hashlib.sha1)
print(data["Signature"])# An actual invocation would occur here, which may incur fees after success# resp = requests.get("https://" + endpoint, params=data)# print(resp.url)

Golangpackage main
import ("bytes""crypto/hmac""crypto/sha1""encoding/base64""fmt""sort")
func main() {secretId := "AKIDz8krbsJ5yKBZQpn74WFkmLPx3*******"
secretKey := "Gu5t9xGARNpq86cd98joQYCN3*******"
params := map[string]string{"Nonce": "11886","Timestamp": "1465185768","Region": "ap-guangzhou","SecretId": secretId,"Version": "2017-03-12","Action": "DescribeInstances","InstanceIds.0": "ins-09dx96dg","Limit": "20","Offset": "0",}var buf bytes.Buffer©2013-2022 Tencent Cloud. All rights reserved.

Page 48 of 158

Tencent Cloud Automation Tools

buf.WriteString("GET")
buf.WriteString("cvm.tencentcloudapi.com")buf.WriteString("/")
buf.WriteString("?")// sort keys by ascii asc orderkeys := make([]string, 0, len(params))
for k, _ := range params {keys = append(keys, k)}sort.Strings(keys)
for i := range keys {k := keys[i]buf.WriteString(k)buf.WriteString("=")
buf.WriteString(params[k])buf.WriteString("&")}
buf.Truncate(buf.Len() - 1)hashed := hmac.New(sha1.New, []byte(secretKey))hashed.Write(buf.Bytes())
fmt.Println(base64.StdEncoding.EncodeToString(hashed.Sum(nil)))
}

PHP
<?php
$secretId = "AKIDz8krbsJ5yKBZQpn74WFkmLPx3*******";$secretKey = "Gu5t9xGARNpq86cd98joQYCN3*******";$param["Nonce"] = 11886;//rand();$param["Timestamp"] = 1465185768;//time();$param["Region"] = "ap-guangzhou";$param["SecretId"] = $secretId;$param["Version"] = "2017-03-12";$param["Action"] = "DescribeInstances";$param["InstanceIds.0"] = "ins-09dx96dg";$param["Limit"] = 20;$param["Offset"] = 0;
ksort($param);$signStr = "GETcvm.tencentcloudapi.com/?";foreach ( $param as $key => $value ) {$signStr = $signStr . $key . "=" . $value . "&";}
$signStr = substr($signStr, 0, -1);
$signature = base64_encode(hash_hmac("sha1", $signStr, $secretKey, true));echo $signature.PHP_EOL;// need to install and enable curl extension in php.ini©2013-2022 Tencent Cloud. All rights reserved.

Page 49 of 158

Tencent Cloud Automation Tools// $param["Signature"] = $signature;// $url = "https://cvm.tencentcloudapi.com/?".http_build_query($param);// echo $url.PHP_EOL;// $ch = curl_init();// curl_setopt($ch, CURLOPT_URL, $url);// $output = curl_exec($ch);// curl_close($ch);// echo json_decode($output);Ruby# -*- coding: UTF-8 -*# require ruby>=2.3.0
require 'time'require 'openssl'
require 'base64'
secret_id = "AKIDz8krbsJ5yKBZQpn74WFkmLPx3*******"
secret_key = "Gu5t9xGARNpq86cd98joQYCN3*******"
method = 'GET'
endpoint = 'cvm.tencentcloudapi.com'
data = {'Action' => 'DescribeInstances','InstanceIds.0' => 'ins-09dx96dg','Limit' => 20,'Nonce' => 11886,'Offset' => 0,'Region' => 'ap-guangzhou','SecretId' => secret_id,'Timestamp' => 1465185768, # Time.now.to_i'Version' => '2017-03-12',}
sign = method + endpoint + '/?'
params = []data.sort.each do |item|
params << "#{item[0]}=#{item[1]}"endsign += params.join('&')
digest = OpenSSL::Digest.new('sha1')
data['Signature'] = Base64.encode64(OpenSSL::HMAC.digest(digest, secret_key, sign))puts data['Signature']# require 'net/http'# uri = URI('https://' + endpoint)# uri.query = URI.encode_www_form(data)# p uri©2013-2022 Tencent Cloud. All rights reserved.

Page 50 of 158

Tencent Cloud Automation Tools# res = Net::HTTP.get_response(uri)# puts res.body

DotNetusing System;
using System.Collections.Generic;using System.Net;
using System.Security.Cryptography;
using System.Text;
public class Application {public static string Sign(string signKey, string secret){string signRet = string.Empty;
using (HMACSHA1 mac = new HMACSHA1(Encoding.UTF8.GetBytes(signKey))){byte[] hash = mac.ComputeHash(Encoding.UTF8.GetBytes(secret));signRet = Convert.ToBase64String(hash);}return signRet;}
public static string MakeSignPlainText(SortedDictionary<string, string> requestParams, string requestMethod, string requestHost, string requestPath){string retStr = "";retStr += requestMethod;
retStr += requestHost;
retStr += requestPath;
retStr += "?";
string v = "";foreach (string key in requestParams.Keys){v += string.Format("{0}={1}&", key, requestParams[key]);}
retStr += v.TrimEnd('&');
return retStr;}
public static void Main(string[] args){
string SECRET_ID = "AKIDz8krbsJ5yKBZQpn74WFkmLPx3*******";
string SECRET_KEY = "Gu5t9xGARNpq86cd98joQYCN3*******";
string endpoint = "cvm.tencentcloudapi.com";string region = "ap-guangzhou";string action = "DescribeInstances";
string version = "2017-03-12";
double RequestTimestamp = 1465185768;©2013-2022 Tencent Cloud. All rights reserved.

Page 51 of 158

Tencent Cloud Automation Tools// long timestamp = ToTimestamp() / 1000;// string requestTimestamp = timestamp.ToString();
Dictionary<string, string> param = new Dictionary<string, string>();param.Add("Limit", "20");param.Add("Offset", "0");param.Add("InstanceIds.0", "ins-09dx96dg");
param.Add("Action", action);param.Add("Nonce", "11886");// param.Add("Nonce", Math.Abs(new Random().Next()).ToString());
param.Add("Timestamp", RequestTimestamp.ToString());
param.Add("Version", version);param.Add("SecretId", SECRET_ID);
param.Add("Region", region);
SortedDictionary<string, string> headers = new SortedDictionary<string, string>(param, StringComparer.Ordinal);
string sigInParam = MakeSignPlainText(headers, "GET", endpoint, "/");
Console.WriteLine(sigInParam);
string sigOutParam = Sign(SECRET_KEY, sigInParam);
Console.WriteLine("GET https://cvm.tencentcloudapi.com");foreach (KeyValuePair<string, string> kv in headers){Console.WriteLine(kv.Key + ": " + kv.Value);}
Console.WriteLine("Signature" + ": " + WebUtility.UrlEncode(sigOutParam));
Console.WriteLine();string result = "https://cvm.tencentcloudapi.com/?";foreach (KeyValuePair<string, string> kv in headers){
result += WebUtility.UrlEncode(kv.Key) + "=" + WebUtility.UrlEncode(kv.Value) +"&";}result += WebUtility.UrlEncode("Signature") + "=" + WebUtility.UrlEncode(sigOutPa
ram);
Console.WriteLine("GET " + result);}}

NodeJS
const crypto = require('crypto');function get_req_url(params, endpoint){
params['Signature'] = escape(params['Signature']);const url_strParam = sort_params(params)
return "https://" + endpoint + "/?" + url_strParam.slice(1);}function formatSignString(reqMethod, endpoint, path, strParam){©2013-2022 Tencent Cloud. All rights reserved.

Page 52 of 158

Tencent Cloud Automation Tools

let strSign = reqMethod + endpoint + path + "?" + strParam.slice(1);return strSign;}function sha1(secretKey, strsign){
let signMethodMap = {'HmacSHA1': "sha1"};
let hmac = crypto.createHmac(signMethodMap['HmacSHA1'], secretKey || "");
return hmac.update(Buffer.from(strsign, 'utf8')).digest('base64')}function sort_params(params){
let strParam = "";let keys = Object.keys(params);
keys.sort();for (let k in keys) {//k = k.replace(/_/g, '.');
strParam += ("&" + keys[k] + "=" + params[keys[k]]);}return strParam}function main(){const SECRET_ID = "AKIDz8krbsJ5yKBZQpn74WFkmLPx3*******"
const SECRET_KEY = "Gu5t9xGARNpq86cd98joQYCN3*******"
const endpoint = "cvm.tencentcloudapi.com"
const Region = "ap-guangzhou"
const Version = "2017-03-12"
const Action = "DescribeInstances"
const Timestamp = 1465185768// const Timestamp = Math.round(Date.now() / 1000)
const Nonce = 11886//const nonce = Math.round(Math.random() * 65535)
let params = {};params['Action'] = Action;
params['InstanceIds.0'] = 'ins-09dx96dg';
params['Limit'] = 20;
params['Offset'] = 0;params['Nonce'] = Nonce;params['Region'] = Region;
params['SecretId'] = SECRET_ID;
params['Timestamp'] = Timestamp;
params['Version'] = Version;
strParam = sort_params(params)
const reqMethod = "GET";
const path = "/";
strSign = formatSignString(reqMethod, endpoint, path, strParam)
console.log(strSign)
console.log("-----------------------")
params['Signature'] = sha1(SECRET_KEY, strSign)
console.log(params['Signature'])©2013-2022 Tencent Cloud. All rights reserved.

Page 53 of 158

Tencent Cloud Automation Tools

console.log("-----------------------")
const req_url = get_req_url(params, endpoint)
console.log(params['Signature'])console.log("-----------------------")
console.log(req_url)}
main()©2013-2022 Tencent Cloud. All rights reserved.

Page 54 of 158

Tencent Cloud Automation Tools

Responses：

Last updated 2022-05-23 15:21:52

Response for Successful Requests
For example, when calling CAM API (version: 2017-03-12) to view the status of instances (DescribeInstancesStatus),
if the request has succeeded, you may see the response as shown below:{"Response": {"TotalCount": 0,"InstanceStatusSet": [],"RequestId": "b5b41468-520d-4192-b42f-595cc34b6c1c"}}
The API will return Response , which contains RequestId , as long as it processes the request. It does notmatter if the request is successful or not.
RequestId is the unique ID of an API request. Contact us with this ID when an exception occurs.
Except for the fixed fields, all fields are action-specified. For the definitions of action-specified fields, see thecorresponding API documentation. In this example, TotalCount and InstanceStatusSet are the fields
specified by the API DescribeInstancesStatus . 0 TotalCount means that the requester owns 0 CVM
instance so the InstanceStatusSet is empty.

Response for Failed Requests
If the request has failed, you may see the response as shown below:{"Response": {"Error": {"Code": "AuthFailure.SignatureFailure","Message": "The provided credentials could not be validated. Please ensure your signature is correct."},"RequestId": "ed93f3cb-f35e-473f-b9f3-0d451b8b79c6"}}©2013-2022 Tencent Cloud. All rights reserved.

Page 55 of 158

Tencent Cloud Automation Tools

The presence of the Error field indicates that the request has failed. A response for a failed request will include
Error , Code and Message fields.
Code is the code of the error that helps you identify the cause and solution. There are two types of error codes
so you may find the code in either common error codes or API-specified error codes.
Message explains the cause of the error. Note that the returned messages are subject to service updates. The
information the messages provide may not be up-to-date and should not be the only source of reference.
RequestId is the unique ID of an API request. Contact us with this ID when an exception occurs.

Common Error Codes
If there is an Error field in the response, it means that the API call failed. The Code field in Error indicates the error
code. The following table lists the common error codes that all actions can return.
Error CodeDescription

AuthFailure.InvalidSecretId

Invalid key (not a TencentCloud API key type).

AuthFailure.MFAFailure

MFA failed.

AuthFailure.SecretIdNotFoundThe key does not exist.

AuthFailure.SignatureExpire

Signature expired.

AuthFailure.SignatureFailure

Signature error.

AuthFailure.TokenFailure

Token error.

AuthFailure.UnauthorizedOperation

The request does not have CAM authorization.

DryRunOperation

DryRun Operation. It means that the request would have succeeded, but
the DryRun parameter was used.

FailedOperation

Operation failed.

InternalError

Internal error.

InvalidAction

The API does not exist.

InvalidParameter

Incorrect parameter.

InvalidParameterValue

Invalid parameter value.

LimitExceeded

Quota limit exceeded.

MissingParameter

A parameter is missing.

©2013-2022 Tencent Cloud. All rights reserved.

Page 56 of 158

Tencent Cloud Automation Tools

NoSuchVersion

The API version does not exist.

RequestLimitExceeded

The number of requests exceeds the frequency limit.

ResourceInUse

Resource is in use.

ResourceInsufficientInsufficient resource.

ResourceNotFoundThe resource does not exist.

ResourceUnavailable

Resource is unavailable.

UnauthorizedOperation

Unauthorized operation.

UnknownParameter

Unknown parameter.

UnsupportedOperation

Unsupported operation.

UnsupportedProtocol

HTTPS request method error. Only GET and POST requests aresupported.

UnsupportedRegion

API does not support the requested region.

©2013-2022 Tencent Cloud. All rights reserved.

Page 57 of 158

Tencent Cloud Automation Tools

Remote Command APIs
EnableInvoker：

Last updated 2023-03-14 16:55:45

1. API Description
Domain name for API request: tat.tencentcloudapi.com.
This API is used to enable an invoker.
A maximum of 20 requests can be initiated per second for this API.
We recommend you to use API Explorer
Try itAPI Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation,
and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters
The following request parameter list only provides API request parameters and some common parameters. For thecomplete common parameter list, see Common Request Parameters.
Parameter Name

RequiredType

Description

ActionYes

StringCommon Params. The value used for this API: EnableInvoker.

VersionYes

StringCommon Params. The value used for this API: 2020-10-28.

RegionNo

StringCommon Params. This parameter is not required for this API.

InvokerId

YesStringID of the invoker to be enabled.

3. Output Parameters
Parameter
Name

Type

Description

RequestId

String

The unique request ID, which is returned for each request. RequestId is required for©2013-2022 Tencent Cloud. All rights reserved.

Page 58 of 158

Tencent Cloud Automation Tools

locating a problem.

4. Example
Example1 Enabling an invoker
Input Example
POST / HTTP/1.1
Host: tat.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: EnableInvoker<Common request parameters>{"InvokerId": "ivk-b7s3qa5l"}

Output Example{"Response": {"RequestId": "64119f65-18f5-47f3-a8d2-60d9fee593bf"}}

5. Developer Resources
SDK
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call
APIs.
Tencent Cloud SDK 3.0 for Python
Tencent Cloud SDK 3.0 for Java
Tencent Cloud SDK 3.0 for PHP
Tencent Cloud SDK 3.0 for Go
Tencent Cloud SDK 3.0 for NodeJS
Tencent Cloud SDK 3.0 for .NET
Tencent Cloud SDK 3.0 for C++©2013-2022 Tencent Cloud. All rights reserved.

Page 59 of 158

Tencent Cloud Automation Tools

Command Line Interface
Tencent Cloud CLI 3.0

6. Error CodeThe following only lists the error codes related to the API business logic. For other error codes, see Common Error
Codes.
Error CodeDescription

AuthFailure

CAM signature/authentication error.

InvalidParameterValue.InvalidInvokerId

Invalid InvokerId.

ResourceNotFoundThe resource does not exist.

©2013-2022 Tencent Cloud. All rights reserved.

Page 60 of 158

Tencent Cloud Automation Tools

CreateInvoker：

Last updated 2023-03-14 16:55:47

1. API Description
Domain name for API request: tat.tencentcloudapi.com.
This API is used to create an invoker.
A maximum of 20 requests can be initiated per second for this API.
We recommend you to use API Explorer
Try itAPI Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation,
and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters
The following request parameter list only provides API request parameters and some common parameters. For thecomplete common parameter list, see Common Request Parameters.
Parameter Name

RequiredType

Description

ActionYes

StringCommon Params. The value used for this API:
CreateInvoker.

VersionYes

StringCommon Params. The value used for this API: 202010-28.

RegionNo

StringName

YesStringType

YesStringCommandId

Yes

StringRemote command ID.

InstanceIds.N

Yes

Array of String

ID of the instance bound to the trigger. Up to 100 IDs
are allowed.

©2013-2022 Tencent Cloud. All rights reserved.

Common Params. This parameter is not required forthis API.
Invoker name.
Invoker type. It can only be SCHEDULE (recurring
invokers).

Page 61 of 158

Tencent Cloud Automation Tools

Username

No

String

The user who executes the command.

Parameters

No

StringCustom parameters of the command.

ScheduleSettings

No

ScheduleSettings

Settings required for a recurring invoker.

3. Output Parameters
Parameter
Name

Type

Description

InvokerId

StringInvoker ID.

RequestId

String

The unique request ID, which is returned for each request. RequestId is required forlocating a problem.

4. Example
Example1 Creating a run-once invoker
Execute command cmd-m7uma92n on instance ins-yx05ky8j at 2021-09-01 00:00:00 UTC+8
Input Example
POST / HTTP/1.1
Host: tat.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateInvoker<Common request parameters>{"Name": "test-invoker","CommandId": "cmd-m7uma92n","InstanceIds": ["ins-yx05ky8j"],"Type": "SCHEDULE","ScheduleSettings": {"Policy": "ONCE","InvokeTime": "2021-09-01T00:00:00+08:00"}}©2013-2022 Tencent Cloud. All rights reserved.

Page 62 of 158

Tencent Cloud Automation Tools

Output Example{"Response": {"RequestId": "97268137-e0f7-477d-833b-766273d0ea47","InvokerId": "ivk-le1g3x2h"}}

Example2 Creating an invoker that executes a command repeatedly
Execute command cmd-m7uma92n on instance ins-yx05ky8j at 00:00:00 UTC+8 on the first day of every month
Input Example
POST / HTTP/1.1
Host: tat.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateInvoker<Common request parameters>{"Name": "cron-invoker","CommandId": "cmd-m7uma92n","InstanceIds": ["ins-yx05ky8j"],"Type": "SCHEDULE","ScheduleSettings": {"Policy": "RECURRENCE","Recurrence": "0 0 1 * *"}}Output Example{"Response": {"RequestId": "d1d7ce29-b6ac-436d-93e0-b454f096cc50","InvokerId": "ivk-n0t6rxtv"}}©2013-2022 Tencent Cloud. All rights reserved.

Page 63 of 158

Tencent Cloud Automation Tools

5. Developer Resources
SDK
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call
APIs.
Tencent Cloud SDK 3.0 for Python
Tencent Cloud SDK 3.0 for Java
Tencent Cloud SDK 3.0 for PHP
Tencent Cloud SDK 3.0 for Go
Tencent Cloud SDK 3.0 for NodeJS
Tencent Cloud SDK 3.0 for .NET
Tencent Cloud SDK 3.0 for C++

Command Line Interface
Tencent Cloud CLI 3.0

6. Error CodeThe following only lists the error codes related to the API business logic. For other error codes, see Common Error
Codes.
Error CodeDescription

AuthFailure

CAM signature/authentication error.

InternalError

Internal error.

InvalidParameter

Invalid parameter.

InvalidParameterValue.InvalidCommandId

Invalid CommandId.

InvalidParameterValue.InvalidCronExpression

Invalid crontab expression.

InvalidParameterValue.InvalidInstanceId

Invalid instance ID.

InvalidParameterValue.InvalidTimeFormat

Invalid time format.

InvalidParameterValue.InvokeTimeExpired

API invocation expired.

InvalidParameterValue.ParameterInvalidJsonFormat

The parameter is not a valid JSON string.

©2013-2022 Tencent Cloud. All rights reserved.

Page 64 of 158

Tencent Cloud Automation Tools

ResourceNotFound.CommandNotFoundThe command does not exist.

ResourceNotFound.InstanceNotFoundThe instance does not exist.

ResourceUnavailable.AgentNotInstalled

TAT Agent is not installed.

©2013-2022 Tencent Cloud. All rights reserved.

Page 65 of 158

Tencent Cloud Automation Tools

DescribeCommands：

Last updated 2023-03-14 16:55:46

1. API Description
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.
We recommend you to use API Explorer
Try itAPI Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation,
and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters
The following request parameter list only provides API request parameters and some common parameters. For thecomplete common parameter list, see Common Request Parameters.
Parameter
Name

RequiredType

Description

ActionYes

StringCommon Params. The value used for this API:
DescribeCommands.

VersionYes

StringCommon Params. The value used for this API: 2020-10-28.

RegionNo

StringCommon Params. This parameter is not required for this API.

Array

List of command IDs. Up to 100 IDs are allowed for each request.

ofStringCommandIds and Filters cannot be specified at the same

CommandIds.N

Filters.N

No

No

Array
of
Filtertime.
Filter conditions.
command-id - String - Required: No - (Filter condition) Filterby the command ID.
command-name - String - Required: No - (Filter condition)
Filter by the command name.

©2013-2022 Tencent Cloud. All rights reserved.

Page 66 of 158

Tencent Cloud Automation Tools

command-type - String - Required: No - (Filter condition)
Filter by the command type. Valid values: SHELL or
POWERSHELL .
created-by - String - Required: No - (Filter condition) Filterby 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) Filterby 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 canhave up to 5 Filter.Values . CommandIds andFilters cannot be specified at the same time.
Number of returned results. It defaults to 20 . The maximum is
Limit

No

Integer

100. For more information on Limit , see the relevant section in
the API Overview.

OffsetNo

Integer

Offset. The default value is 0 . For more information on
Offset , see the relevant section in API Introduction.

3. Output Parameters
Parameter
Name

Type

Description

TotalCount

Integer

Total number of matching commands.

CommandSet

Array ofCommand

List of command details.

RequestId

String

The unique request ID, which is returned for each request. RequestId isrequired for locating a problem.

4. Example©2013-2022 Tencent Cloud. All rights reserved.

Page 67 of 158

Tencent Cloud Automation Tools

Example1 Querying a command with the specified CommandId
Input Example
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}

Output Example{"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"©2013-2022 Tencent Cloud. All rights reserved.

Page 68 of 158

Tencent Cloud Automation Tools

}
]
}
}

Example2 Querying commands with the command-name filter
Input Example
POST / 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"]}]}

Output Example{"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/",©2013-2022 Tencent Cloud. All rights reserved.

Page 69 of 158

Tencent Cloud Automation Tools"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"}]}}

Example3 Querying commands with the created-by filter
Input Example
POST / HTTP/1.1
Host: tat.tencentcloudapi.com
Content-Type: application/json©2013-2022 Tencent Cloud. All rights reserved.

Page 70 of 158

Tencent Cloud Automation Tools

X-TC-Action: DescribeCommands<Common request parameters>{"Offset": 0,"Limit": 1,"Filters": [{"Name": "created-by","Values": ["USER"]}]}

Output Example{"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"}]}}

Example4 Query commands with the tag:tag-key filter©2013-2022 Tencent Cloud. All rights reserved.

Page 71 of 158

Tencent Cloud Automation Tools

Input Example
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"}]}

Output Example{"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",©2013-2022 Tencent Cloud. All rights reserved.

Page 72 of 158

Tencent Cloud Automation Tools"UpdatedTime": "2021-05-12T02:49:04Z"}]}}

5. Developer Resources
SDK
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call
APIs.
Tencent Cloud SDK 3.0 for Python
Tencent Cloud SDK 3.0 for Java
Tencent Cloud SDK 3.0 for PHP
Tencent Cloud SDK 3.0 for Go
Tencent Cloud SDK 3.0 for NodeJS
Tencent Cloud SDK 3.0 for .NET
Tencent Cloud SDK 3.0 for C++

Command Line Interface
Tencent Cloud CLI 3.0

6. Error CodeThe following only lists the error codes related to the API business logic. For other error codes, see Common Error
Codes.
Error CodeDescription

InternalError

Internal error.

InvalidParameter

Invalid parameter.

InvalidParameter.ConflictParameter

Conflicting parameters.

InvalidParameterValue

Invalid parameter value.

InvalidParameterValue.InvalidCommandId

Invalid CommandId.

©2013-2022 Tencent Cloud. All rights reserved.

Page 73 of 158

Tencent Cloud Automation Tools

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.

©2013-2022 Tencent Cloud. All rights reserved.

Page 74 of 158

Tencent Cloud Automation Tools

DescribeAutomationAgentStatus：

Last updated 2023-03-14 16:55:47

1. API Description
Domain name for API request: tat.tencentcloudapi.com.
This API is used to query the status of the TAT agent.
A maximum of 20 requests can be initiated per second for this API.
We recommend you to use API Explorer
Try itAPI Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation,
and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters
The following request parameter list only provides API request parameters and some common parameters. For thecomplete common parameter list, see Common Request Parameters.
Parameter
Name

RequiredType

Description

ActionYes

StringCommon Params. The value used for this API:
DescribeAutomationAgentStatus.

VersionYes

StringCommon Params. The value used for this API: 2020-10-28.

RegionNo

StringCommon Params. This parameter is not required for this API.

InstanceIds.N

No

Array
of
StringList of instance IDs for the query.

Filters.N

No

Array
of
FilterFilter conditions.
agent-status - String - Required: No - (Filter condition)
Filter by agent status. Valid values: Online , Offline .
environment - String - Required: No - (Filter condition) Filterby the agent environment. Valid value: Linux .

©2013-2022 Tencent Cloud. All rights reserved.

Page 75 of 158

Tencent Cloud Automation Tools

instance-id - String - Required: No - (Filter condition) Filterby the instance ID.
Up to 10 Filters allowed in one request. For each filter, five
Filter.Values can be specified. InstanceIds andFilters cannot be specified at the same time.
Number of returned results. It defaults to 20 . The maximum is 100.
Limit

No

Integer

For more information on Limit , see the relevant section in the
API Overview.

OffsetNo

Integer

Offset. The default value is 0 . For more information on Offset ,see the relevant section in API Introduction.

3. Output Parameters
Parameter NameType

Description

AutomationAgentSet

Array of
AutomationAgentInfo

Agent information list.

TotalCount

Integer

Total number of matching agents.

RequestId

String

The unique request ID, which is returned for each request.
RequestId is required for locating a problem.

4. Example
Example1 Querying the agent status
Input Example
POST / HTTP/1.1
Host: tat.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeAutomationAgentStatus<Common request parameters>{"InstanceIds": ["lhins-ar5wyn4x"]}©2013-2022 Tencent Cloud. All rights reserved.

Page 76 of 158

Tencent Cloud Automation Tools

Output Example{"Response": {"RequestId": "520e7b93-904d-44de-a2dd-8e4c545be4ce","AutomationAgentSet": [{"InstanceId": "lhins-ar5wyn4x","Version": "0.1.0","LastHeartbeatTime": "2020-11-16T12:05:44+00:00","AgentStatus": "Online","Environment": "Linux"}],"TotalCount": 1}}

5. Developer Resources
SDK
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call
APIs.
Tencent Cloud SDK 3.0 for Python
Tencent Cloud SDK 3.0 for Java
Tencent Cloud SDK 3.0 for PHP
Tencent Cloud SDK 3.0 for Go
Tencent Cloud SDK 3.0 for NodeJS
Tencent Cloud SDK 3.0 for .NET
Tencent Cloud SDK 3.0 for C++

Command Line Interface
Tencent Cloud CLI 3.0

6. Error Code©2013-2022 Tencent Cloud. All rights reserved.

Page 77 of 158

Tencent Cloud Automation Tools

The following only lists the error codes related to the API business logic. For other error codes, see Common Error
Codes.
Error CodeDescription

InternalError

Internal error.

InvalidParameter

Invalid parameter.

InvalidParameter.ConflictParameter

Conflicting parameters.

InvalidParameterValue

Invalid parameter value.

InvalidParameterValue.InvalidFilter

Invalid filter.

InvalidParameterValue.InvalidInstanceId

Invalid instance ID.

InvalidParameterValue.LimitExceeded

Parameter limit exceeded.

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.

©2013-2022 Tencent Cloud. All rights reserved.

Page 78 of 158

Tencent Cloud Automation Tools

DeleteCommand：

Last updated 2023-03-14 16:55:47

1. API Description
Domain name for API request: tat.tencentcloudapi.com.
This API is used to delete a command.
Commands bound to an invoker cannot be deleted.
A maximum of 20 requests can be initiated per second for this API.
We recommend you to use API Explorer
Try itAPI Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation,
and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters
The following request parameter list only provides API request parameters and some common parameters. For thecomplete common parameter list, see Common Request Parameters.
Parameter Name

RequiredType

Description

ActionYes

StringCommon Params. The value used for this API: DeleteCommand.

VersionYes

StringCommon Params. The value used for this API: 2020-10-28.

RegionNo

StringCommon Params. This parameter is not required for this API.

CommandId

Yes

StringID of the command to be deleted.

3. Output Parameters
Parameter
Name

Type

Description

RequestId

String

The unique request ID, which is returned for each request. RequestId is required forlocating a problem.

©2013-2022 Tencent Cloud. All rights reserved.

Page 79 of 158

Tencent Cloud Automation Tools

4. Example
Example1 Deleting a command
Input Example
POST / HTTP/1.1
Host: tat.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DeleteCommand<Common request parameters>{"CommandId": "cmd-7efujjs6"}

Output Example{"Response": {"RequestId": "7f79b764-bc0f-471b-89c1-ca1b93cf7e8d"}}

5. Developer Resources
SDK
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call
APIs.
Tencent Cloud SDK 3.0 for Python
Tencent Cloud SDK 3.0 for Java
Tencent Cloud SDK 3.0 for PHP
Tencent Cloud SDK 3.0 for Go
Tencent Cloud SDK 3.0 for NodeJS
Tencent Cloud SDK 3.0 for .NET
Tencent Cloud SDK 3.0 for C++

Command Line Interface©2013-2022 Tencent Cloud. All rights reserved.

Page 80 of 158

Tencent Cloud Automation Tools

Tencent Cloud CLI 3.0

6. Error CodeThe following only lists the error codes related to the API business logic. For other error codes, see Common Error
Codes.
Error CodeDescription

InternalError

Internal error.

InvalidParameterValue

Invalid parameter value.

InvalidParameterValue.InvalidCommandId

Invalid CommandId.

ResourceNotFound.CommandNotFoundThe command does not exist.

ResourceUnavailable.CommandInExecuting

The command is being executed.

ResourceUnavailable.CommandInInvoker

The command has been bound to an invoker.

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.

©2013-2022 Tencent Cloud. All rights reserved.

Page 81 of 158

Tencent Cloud Automation Tools

CreateCommand：

Last updated 2023-03-14 16:55:47

1. API Description
Domain name for API request: tat.tencentcloudapi.com.
This API is used to create a command.
A maximum of 20 requests can be initiated per second for this API.
We recommend you to use API Explorer
Try itAPI Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation,
and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters
The following request parameter list only provides API request parameters and some common parameters. For thecomplete common parameter list, see Common Request Parameters.
Parameter Name

RequiredType

Description

ActionYes

StringCommon Params. The value used for this API:
CreateCommand.

VersionYes

StringCommon Params. The value used for this API: 2020-10-28.

RegionNo

StringCommon Params. This parameter is not required for thisAPI.

CommandName

Yes

StringCommand name. The name can be up to 60 bytes, andcontain [a-z], [A-Z], [0-9] and [_-.].

Content

Yes

StringBase64-encoded command. The maximum length is 64 KB.

Description

No

StringCommand description. The maximum length is 120
characters.

CommandType

No

String©2013-2022 Tencent Cloud. All rights reserved.

Command type. SHELL and POWERSHELL aresupported. The default value is SHELL .

Page 82 of 158

Tencent Cloud Automation Tools

WorkingDirectory

No

StringCommand execution path. The default value is /root for
SHELL commands and C:\Program
Files\qcloud\tat_agent\workdir for POWERSHELL
commands.

Timeout

EnableParameter

No

No

Integer

BooleanCommand timeout period. Default value: 60 seconds. Value
range: [1, 86400].
Whether to enable the custom parameter feature.
This cannot be modified once created.
Default value: false .
The default value of the custom parameter value when it isenabled. The field type is JSON encoded string. For
example, {"varA": "222"}.
key is the name of the custom parameter and value

DefaultParameters

No

Stringis the default value. Both key and value are strings.
If no parameter value is provided in the InvokeCommand
API, the default value 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 [-_].

Tags.N

Username

OutputCOSBucketUrl

No

No

No

Array of
Tag

Tags bound to the command. At most 10 tags are allowed.

String

The username used to execute the command on the CVM or
Lighthouse instance.
The principle of least privilege is the best practice for
permission management. We recommend you execute TAT
commands as a general user. By default, the root user isused to execute commands on Linux and the System user isused on Windows.

StringThe COS bucket URL for uploading logs. The URL must
start with https , such as https://BucketName123454321.cos.ap-beijing.myqcloud.com .

OutputCOSKeyPrefix

No

String©2013-2022 Tencent Cloud. All rights reserved.

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. Consecutive dots (.) and slashes (/) are not allowed. It
can not start with a slash (/).

Page 83 of 158

Tencent Cloud Automation Tools

3. Output Parameters
Parameter
Name

Type

Description

CommandId

StringCommand ID.

RequestId

String

The unique request ID, which is returned for each request. RequestId is required forlocating a problem.

4. Example
Example1 Creating a command
Input Example
POST / HTTP/1.1
Host: tat.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateCommand<Common request parameters>{"CommandName": "hello-command","Description": "hello world","Content": "bHM=","CommandType": "SHELL","WorkingDirectory": "/",
"Timeout": 60}

Output Example{"Response": {"RequestId": "9bea970a-0bab-495f-b0dd-de5eedfdf611","CommandId": "cmd-7efujjs6"}}©2013-2022 Tencent Cloud. All rights reserved.

Page 84 of 158

Tencent Cloud Automation Tools

5. Developer Resources
SDK
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call
APIs.
Tencent Cloud SDK 3.0 for Python
Tencent Cloud SDK 3.0 for Java
Tencent Cloud SDK 3.0 for PHP
Tencent Cloud SDK 3.0 for Go
Tencent Cloud SDK 3.0 for NodeJS
Tencent Cloud SDK 3.0 for .NET
Tencent Cloud SDK 3.0 for C++

Command Line Interface
Tencent Cloud CLI 3.0

6. Error CodeThe following only lists the error codes related to the API business logic. For other error codes, see Common Error
Codes.
Error CodeDescription

InternalError

Internal error.

InvalidParameter

Invalid parameter.

InvalidParameterValue

Invalid parameter value.

InvalidParameterValue.CommandContentInvalid

Invalid command content.

InvalidParameterValue.CommandNameDuplicatedDuplicate command name.

InvalidParameterValue.InvalidCommandName

Invalid command name.

InvalidParameterValue.InvalidContent

Invalid command.

InvalidParameterValue.InvalidOutputCOSBucketUrl

Invalid OutputCOSBucketUrl.

InvalidParameterValue.InvalidOutputCOSKeyPrefix

Invalid OutputCOSKeyPrefix.

©2013-2022 Tencent Cloud. All rights reserved.

Page 85 of 158

Tencent Cloud Automation Tools

InvalidParameterValue.InvalidUsername

Invalid username.

InvalidParameterValue.InvalidWorkingDirectory

Invalid command execution path.

InvalidParameterValue.ParameterDisabled
InvalidParameterValue.ParameterInvalidJsonFormat
InvalidParameterValue.ParameterKeyContainsInvalidChar

The custom parameter feature is notenabled.
The parameter is not a valid JSON string.
The parameter key contains invalidcharacters.

InvalidParameterValue.ParameterKeyDuplicatedDuplicate 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.Range

The parameter value is not in the valid
range.

InvalidParameterValue.SupportParametersOnlyIfEnableParameter

The custom parameter feature is notenabled.

InvalidParameterValue.TooLong

Length limit exceeded.

MissingParameter

Missing parameter.

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.

©2013-2022 Tencent Cloud. All rights reserved.

Page 86 of 158

Tencent Cloud Automation Tools

DescribeInvocationTasks：

Last updated 2023-03-14 16:55:46

1. API Description
Domain name for API request: tat.tencentcloudapi.com.
This API is used to query execution task details.
A maximum of 20 requests can be initiated per second for this API.
We recommend you to use API Explorer
Try itAPI Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation,
and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters
The following request parameter list only provides API request parameters and some common parameters. For thecomplete common parameter list, see Common Request Parameters.
Parameter Name

RequiredType

Description

ActionYes

StringCommon Params. The value used for this API:
DescribeInvocationTasks.

VersionYes

StringCommon Params. The value used for this API: 2020-10-28.

RegionNo

StringCommon Params. This parameter is not required for this API.

Array of

List of execution task IDs. Up to 100 IDs are allowed for eachrequest. InvocationTaskIds and Filters cannot

InvocationTaskIds.N

Filters.N

No

No

StringArray ofFilterbe specified at the same time.
Filter conditions.
invocation-id - String - Required: No - (Filter
condition) Filter by the execution activity ID.
invocation-task-id - String - Required: No (Filter condition) Filter by the execution task ID.
instance-id - String - Required: No - (Filter
condition) Filter by the instance ID.

©2013-2022 Tencent Cloud. All rights reserved.

Page 87 of 158

Tencent Cloud Automation Tools

command-id - String - Required: No - (Filter condition)
Filter by the command ID.
Up to 10 Filters are allowed for each request. Eachfilter can have up to five Filter.Values .
InvocationTaskIds and Filters cannot be
specified at the same time.
Number of returned results. It defaults to 20 . The
Limit

No

Integermaximum is 100. For more information on Limit , see therelevant section in the API Overview.

OffsetHideOutput

No

No

Integer

BooleanOffset. The default value is 0 . For more information on
Offset , see the relevant section in API Introduction.
Whether to hide the output. Valid values:
True (default): Hide the output
False : Show the output

3. Output Parameters
Parameter NameType

Description

TotalCount

Integer

Total number of matching execution tasks.

InvocationTaskSet

Array of
InvocationTask

List of execution tasks.

RequestId

String

The unique request ID, which is returned for each request. RequestId
is required for locating a problem.

4. Example
Example1 Query the details of all execution tasks by execution activity ID
Input Example
POST / HTTP/1.1
Host: tat.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeInvocationTasks<Common request parameters>©2013-2022 Tencent Cloud. All rights reserved.

Page 88 of 158

Tencent Cloud Automation Tools{"Offset": 0,"Limit": 10,"HideOutput": false,"Filters": [{"Name": "invocation-id","Values": ["inv-1vll7hda"]}]}

Output Example{"Response": {"RequestId": "a1df9725-51c6-466d-a038-4c86461a8e26","TotalCount": 3,"InvocationTaskSet": [{"CommandId": "cmd-13axrtuq","CommandDocument": {"Content": "d2hvYW1p","CommandType": "SHELL","Timeout": 1,"Username": "root","WorkingDirectory": "/root/"},"InvocationId": "inv-1vll7hda","InvocationTaskId": "invt-afwuqts2","TaskStatus": "SUCCESS","InstanceId": "ins-zj0f57ev","TaskResult": {"ExitCode": 0,"Output": "cm9vdAo=","Dropped": 0,"OutputUploadCOSErrorInfo": "","OutputUrl": "","ExecStartTime": "2020-11-05T07:49:58+00:00","ExecEndTime": "2020-11-05T07:50:04+00:00"},"ErrorInfo": "","InvocationSource": "xx","StartTime": "2020-11-05T07:49:58+00:00",©2013-2022 Tencent Cloud. All rights reserved.

Page 89 of 158

Tencent Cloud Automation Tools"EndTime": "2020-11-05T07:50:04+00:00","CreatedTime": "2020-11-05T07:49:56+00:00","UpdatedTime": "2020-11-05T07:50:06+00:00"},{"CommandId": "cmd-13axrtuq","CommandDocument": {"Content": "d2hvYW1p","CommandType": "SHELL","Timeout": 1,"Username": "root","WorkingDirectory": "/root/"},"InvocationId": "inv-1vll7hda","InvocationTaskId": "invt-08oe5fe2","TaskStatus": "SUCCESS","InstanceId": "ins-zj0f57ex","TaskResult": {"ExitCode": 0,"Output": "cm9vdAo=","Dropped": 0,"OutputUploadCOSErrorInfo": "","OutputUrl": "","ExecStartTime": "2020-11-05T07:49:58+00:00","ExecEndTime": "2020-11-05T07:50:04+00:00"},"ErrorInfo": "","InvocationSource": "xx","StartTime": "2020-11-05T07:49:58+00:00","EndTime": "2020-11-05T07:50:04+00:00","CreatedTime": "2020-11-05T07:49:56+00:00","UpdatedTime": "2020-11-05T07:50:06+00:00"},{"CommandId": "cmd-13axrtuq","CommandDocument": {"Content": "d2hvYW1p","CommandType": "SHELL","Timeout": 1,"Username": "root","WorkingDirectory": "/root/"},"InvocationId": "inv-1vll7hda","InvocationTaskId": "invt-91cpqs22","TaskStatus": "SUCCESS","InstanceId": "ins-zj0f57ew","TaskResult": {©2013-2022 Tencent Cloud. All rights reserved.

Page 90 of 158

Tencent Cloud Automation Tools"ExitCode": 0,"Output": "cm9vdAo=","Dropped": 0,"OutputUploadCOSErrorInfo": "","OutputUrl": "","ExecStartTime": "2020-11-05T07:49:58+00:00","ExecEndTime": "2020-11-05T07:50:04+00:00"},"ErrorInfo": "","InvocationSource": "xx","StartTime": "2020-11-05T07:49:58+00:00","EndTime": "2020-11-05T07:50:04+00:00","CreatedTime": "2020-11-05T07:49:56+00:00","UpdatedTime": "2020-11-05T07:50:06+00:00"}]}}

5. Developer Resources
SDK
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call
APIs.
Tencent Cloud SDK 3.0 for Python
Tencent Cloud SDK 3.0 for Java
Tencent Cloud SDK 3.0 for PHP
Tencent Cloud SDK 3.0 for Go
Tencent Cloud SDK 3.0 for NodeJS
Tencent Cloud SDK 3.0 for .NET
Tencent Cloud SDK 3.0 for C++

Command Line Interface
Tencent Cloud CLI 3.0

6. Error Code©2013-2022 Tencent Cloud. All rights reserved.

Page 91 of 158

Tencent Cloud Automation Tools

The following only lists the error codes related to the API business logic. For other error codes, see Common Error
Codes.
Error CodeDescription

InternalError

Internal error.

InvalidParameter

Invalid parameter.

InvalidParameter.ConflictParameter

Conflicting parameters.

InvalidParameterValue

Invalid parameter value.

InvalidParameterValue.InvalidCommandId

Invalid CommandId.

InvalidParameterValue.InvalidFilter

Invalid filter.

InvalidParameterValue.InvalidInstanceId

Invalid instance ID.

InvalidParameterValue.InvalidInvocationId

Invalid execution activity ID.

InvalidParameterValue.InvalidInvocationTaskId

Invalid execution task ID.

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.

©2013-2022 Tencent Cloud. All rights reserved.

Page 92 of 158

Tencent Cloud Automation Tools

CancelInvocation：

Last updated 2023-03-14 16:55:47

1. API Description
Domain name for API request: tat.tencentcloudapi.com.
This API is used to cancel the command executed on one or more CVM instances.
If the command has not been delivered to the TAT agent, the task status is PENDING , DELIVERING , or
DELIVER_DELAYED , and will be CANCELLED after the command is canceled.
If the command has been delivered to the TAT agent, the task status is RUNNING , and will be TERMINATED
after the command is canceled.
A maximum of 20 requests can be initiated per second for this API.
We recommend you to use API Explorer
Try itAPI Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation,
and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters
The following request parameter list only provides API request parameters and some common parameters. For thecomplete common parameter list, see Common Request Parameters.
Parameter
Name

RequiredType

Description

ActionYes

StringCommon Params. The value used for this API: CancelInvocation.

VersionYes

StringCommon Params. The value used for this API: 2020-10-28.

RegionNo

StringCommon Params. This parameter is not required for this API.

InvocationId

Yes

StringExecution activity ID

InstanceIds.N

No

Array of
String

Instance ID list. A maximum of 100 IDs are allowed. Supported
instance types:
CVM©2013-2022 Tencent Cloud. All rights reserved.

Page 93 of 158

Tencent Cloud Automation Tools

LIGHTHOUSE

3. Output Parameters
Parameter
Name
RequestId

Type

StringDescription
The unique request ID, which is returned for each request. RequestId is required forlocating a problem.

4. Example
Example1 Canceling the execution of a command
Input Example
POST / HTTP/1.1
Host: tat.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CancelInvocation<Common request parameters>{"InvocationId": "inv-ib2lld37","InstanceIds": ["ins-zcewfho0"]}

Output Example{"Response": {"RequestId": "b27421da-0ad4-4e11-b694-cda143606701"}}

5. Developer Resources©2013-2022 Tencent Cloud. All rights reserved.

Page 94 of 158

Tencent Cloud Automation Tools

SDK
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call
APIs.
Tencent Cloud SDK 3.0 for Python
Tencent Cloud SDK 3.0 for Java
Tencent Cloud SDK 3.0 for PHP
Tencent Cloud SDK 3.0 for Go
Tencent Cloud SDK 3.0 for NodeJS
Tencent Cloud SDK 3.0 for .NET
Tencent Cloud SDK 3.0 for C++

Command Line Interface
Tencent Cloud CLI 3.0

6. Error CodeThe following only lists the error codes related to the API business logic. For other error codes, see Common Error
Codes.
Error CodeDescription

InternalError

Internal error.

InvalidParameter

Invalid parameter.

InvalidParameterValue

Invalid parameter value.

InvalidParameterValue.InstanceIsNotRelatedToInvocation

The instance with this ID has no such execution
activity.

InvalidParameterValue.InvalidInvocationId

Invalid execution activity ID.

InvalidParameterValue.LimitExceeded

Parameter limit exceeded.

InvalidParameterValue.TooLong

Length limit exceeded.

LimitExceeded

Reached the quota limit.

MissingParameter

Missing parameter.

ResourceNotFound.InvocationNotFoundNo execution activity found.

©2013-2022 Tencent Cloud. All rights reserved.

Page 95 of 158

Tencent Cloud Automation Tools

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.

UnknownParameter

Unknown parameter error.

©2013-2022 Tencent Cloud. All rights reserved.

Page 96 of 158

Tencent Cloud Automation Tools

DescribeInvocations：

Last updated 2023-03-14 16:55:46

1. API Description
Domain name for API request: tat.tencentcloudapi.com.
This API is used to query execution activity details.
A maximum of 20 requests can be initiated per second for this API.
We recommend you to use API Explorer
Try itAPI Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation,
and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters
The following request parameter list only provides API request parameters and some common parameters. For thecomplete common parameter list, see Common Request Parameters.
Parameter

RequiredType

ActionYes

String

VersionYes

StringCommon Params. The value used for this API: 2020-10-28.

RegionNo

StringCommon Params. This parameter is not required for this API.

Array

List of execution activity IDs. Up to 100 IDs are allowed for eachofStringrequest. InvocationIds and Filters cannot be specified

Array
of

Filter conditions.
invocation-id - String - Required: No - (Filter condition)

FilterFilter by the execution activity ID.

Name

InvocationIds.N

Filters.N

No

No

Description
Common Params. The value used for this API:
DescribeInvocations.

at the same time.

command-id - String - Required: No - (Filter condition) Filterby the command ID.

©2013-2022 Tencent Cloud. All rights reserved.

Page 97 of 158

Tencent Cloud Automation Tools

command-created-by - String - Required: No - (Filter
condition) Filter by the command type. Valid values: TAT (publiccommands) or USER (custom commands).
instance-kind - String - Required: No - (Filter condition)
Filter by the instance type. Valid values: CVM or LIGHTHOUSE .
Up to 10 Filters are allowed for each request. Each filter canhave up to five Filter.Values . InvocationIds andFilters cannot be specified at the same time.
Number of returned results. It defaults to 20 . The maximum is
Limit

No

Integer

100. For more information on Limit , see the relevant section in
the API Overview.

OffsetNo

Integer

Offset. The default value is 0 . For more information on
Offset , see the relevant section in API Introduction.

3. Output Parameters
Parameter
Name

Type

Description

TotalCount

Integer

Total number of matching execution activities.

InvocationSet

Array of
Invocation

List of execution activities.

RequestId

String

The unique request ID, which is returned for each request. RequestId isrequired for locating a problem.

4. Example
Example1 Querying the execution activities
Input Example
POST / HTTP/1.1
Host: tat.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeInvocations<Common request parameters>©2013-2022 Tencent Cloud. All rights reserved.

Page 98 of 158

Tencent Cloud Automation Tools{"Offset": 0,"Limit": 1,"InvocationIds": ["inv-q4zp60g0"]}

Output Example{"Response": {"RequestId": "958a3603-d0c3-4c97-a37d-6bc24eacddac","TotalCount": 1,"InvocationSet": [{"CommandId": "cmd-9dxzty3m","CommandContent": "cHdk","CommandType": "SHELL","Timeout": 60,"InvocationSource": "USER","WorkingDirectory": "/root","InvocationId": "inv-q4zp60g0","InstanceKind": "CVM","InvocationStatus": "SUCCESS","Description": "Test Invocation","Parameters": "","DefaultParameters": "","Username": "root","OutputCOSKeyPrefix": "cosprefix","OutputCOSBucketUrl": "https://example-123456789.cos.ap-beijing.myqcloud.com","InvocationTaskBasicInfoSet": [{"InvocationTaskId": "invt-kakne8h2","TaskStatus": "SUCCESS","InstanceId": "ins-zj0f57ew"},{"InvocationTaskId": "invt-jc2onrxm","TaskStatus": "SUCCESS","InstanceId": "ins-zj0f57ex"},{"InvocationTaskId": "invt-6xmuisyq","TaskStatus": "SUCCESS","InstanceId": "ins-zj0f57ev"©2013-2022 Tencent Cloud. All rights reserved.

Page 99 of 158

Tencent Cloud Automation Tools}],"StartTime": "2020-11-09T07:21:59+00:00","EndTime": "2020-11-09T07:22:08+00:00","CreatedTime": "2020-11-09T07:21:59+00:00","UpdatedTime": "2020-11-09T07:22:08+00:00"}]}}

5. Developer Resources
SDK
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call
APIs.
Tencent Cloud SDK 3.0 for Python
Tencent Cloud SDK 3.0 for Java
Tencent Cloud SDK 3.0 for PHP
Tencent Cloud SDK 3.0 for Go
Tencent Cloud SDK 3.0 for NodeJS
Tencent Cloud SDK 3.0 for .NET
Tencent Cloud SDK 3.0 for C++

Command Line Interface
Tencent Cloud CLI 3.0

6. Error CodeThe following only lists the error codes related to the API business logic. For other error codes, see Common Error
Codes.
Error CodeDescription

InternalError

Internal error.

InvalidParameter

Invalid parameter.

InvalidParameter.ConflictParameter

Conflicting parameters.

©2013-2022 Tencent Cloud. All rights reserved.

Page 100 of 158

Tencent Cloud Automation Tools

InvalidParameterValue.InvalidCommandId

Invalid CommandId.

InvalidParameterValue.InvalidFilter

Invalid filter.

InvalidParameterValue.InvalidInvocationId

Invalid execution activity ID.

InvalidParameterValue.LimitExceeded

Parameter limit exceeded.

LimitExceeded.FilterValueExceeded

Too many Filter values.

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.

©2013-2022 Tencent Cloud. All rights reserved.

Page 101 of 158

Tencent Cloud Automation Tools

InvokeCommand：

Last updated 2023-03-14 16:55:45

1. API Description
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.
If the agent is not installed on the instance or is offline, an error is returned.
If the command type is not supported by the agent runtime environment, an error is returned.
The specified instance needs to be in a VPC network.
The specified instance needs to be in the RUNNING status.
Only one type of instances (CVM or Lighthouse) can be specified in a single request.
A maximum of 20 requests can be initiated per second for this API.
We recommend you to use API Explorer
Try itAPI Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation,
and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters
The following request parameter list only provides API request parameters and some common parameters. For thecomplete common parameter list, see Common Request Parameters.
Parameter Name

RequiredType

Description

ActionYes

StringCommon Params. The value used for this API:
InvokeCommand.

VersionYes

StringCommon Params. The value used for this API: 2020-10-28.

RegionNo

StringCommon Params. This parameter is not required for this API.

CommandId

Yes

StringID of the command to be triggered.

©2013-2022 Tencent Cloud. All rights reserved.

Page 102 of 158

Tencent Cloud Automation Tools

InstanceIds.N

Yes

Array

IDs of instances about to execute commands. At most 100

ofString

IDs are allowed.

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 isthe default value. Both key and value are strings.
Parameters

No

StringIf 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 [-_].
The username used to execute the command on the CVM or
Lighthouse instance.

Username

No

String

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, theUsername of the command is used by default.

WorkingDirectory

No

StringTimeout

No

Integer

OutputCOSBucketUrl

No

StringExecution path of the command. The WorkingDirectory of thecommand is used by default.
Command timeout period. Value range: [1, 86400]. The
Timeout of the command is used by default.
The COS bucket URL for uploading logs. The URL must startwith https , such as https://BucketName123454321.cos.ap-beijing.myqcloud.com .
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

OutputCOSKeyPrefix

No

Stringcharacters. 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 witha slash (/), and cannot contain consecutive slashes.

3. Output Parameters
Parameter
Name

Type

Description©2013-2022 Tencent Cloud. All rights reserved.

Page 103 of 158

Tencent Cloud Automation Tools

InvocationId

StringRequestId

StringExecution activity ID.
The unique request ID, which is returned for each request. RequestId is required forlocating a problem.

4. Example
Example1 Triggering a command on a Lighthouse instance
Input Example
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"]}

Output Example{"Response": {"RequestId": "41417f50-51b5-4c8d-85b7-f6c508cb228f","InvocationId": "inv-8xgjrytm"}}

5. Developer Resources
SDK
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call
APIs.
Tencent Cloud SDK 3.0 for Python©2013-2022 Tencent Cloud. All rights reserved.

Page 104 of 158

Tencent Cloud Automation Tools

Tencent Cloud SDK 3.0 for Java
Tencent Cloud SDK 3.0 for PHP
Tencent Cloud SDK 3.0 for Go
Tencent Cloud SDK 3.0 for NodeJS
Tencent Cloud SDK 3.0 for .NET
Tencent Cloud SDK 3.0 for C++

Command Line Interface
Tencent Cloud CLI 3.0

6. Error CodeThe following only lists the error codes related to the API business logic. For other error codes, see Common Error
Codes.
Error CodeDescription

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 thiscommand 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.

©2013-2022 Tencent Cloud. All rights reserved.

Page 105 of 158

Tencent Cloud Automation Tools

InvalidParameterValue.LackOfParameterInfo

The custom parameter feature is enabled,
but custom parameters are missing.

InvalidParameterValue.LimitExceeded
InvalidParameterValue.ParameterDisabled
InvalidParameterValue.ParameterInvalidJsonFormat
InvalidParameterValue.ParameterKeyContainsInvalidChar

Parameter limit exceeded.
The custom parameter feature is notenabled.
The parameter is not a valid JSON string.
The parameter key contains invalidcharacters.

InvalidParameterValue.ParameterKeyDuplicatedDuplicate 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 notenabled.

ResourceNotFound.CommandNotFoundThe command does not exist.

ResourceNotFound.InstanceNotFoundThe instance does not exist.

ResourceNotFound.RoleNotFoundThe 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

UnauthorizedOperation.MFANotFound©2013-2022 Tencent Cloud. All rights reserved.

The Multi-factor authentication (MFA)
code expired.
Multi-factor authentication (MFA) does
not exist.

Page 106 of 158

Tencent Cloud Automation Tools

ModifyCommand：

Last updated 2023-03-14 16:55:45

1. API Description
Domain name for API request: tat.tencentcloudapi.com.
This API is used to modify a command.
A maximum of 20 requests can be initiated per second for this API.
We recommend you to use API Explorer
Try itAPI Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation,
and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters
The following request parameter list only provides API request parameters and some common parameters. For thecomplete common parameter list, see Common Request Parameters.
Parameter Name

RequiredType

ActionYes

String

VersionYes

StringCommon Params. The value used for this API: 2020-10-28.

RegionNo

StringCommon Params. This parameter is not required for this API.

CommandId

Yes

StringCommand ID.

CommandName

No

StringCommand name. The name can be up to 60 bytes, andcontain [a-z], [A-Z], [0-9] and [_-.].

Description

No

StringContent

No

StringCommandType

No

String©2013-2022 Tencent Cloud. All rights reserved.

Description
Common Params. The value used for this API:
ModifyCommand.

Command description. The maximum length is 120
characters.
Base64-encoded command. The maximum length is 64 KB.
Command type. SHELL and POWERSHELL aresupported.

Page 107 of 158

Tencent Cloud Automation Tools

WorkingDirectory

No

StringCommand execution path.

Timeout

No

Integer

Command timeout period. Value range: [1, 86400].
The default value of the custom parameter value when it isenabled. The field type is JSON encoded string. For example,{"varA": "222"}.
All parameters are overwritten. All default values are required

DefaultParameters

No

Stringfor modification.
Modification is only allowed when EnableParameter istrue .
key is the name of the custom parameter and value isthe default value. Both key and value are strings.
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 [-_].
The username used to execute the command on the CVM or
Lighthouse instance.

Username

No

String

The principle of least privilege is the best practice for
permission management. We recommend you execute TAT
commands as a general user.
The COS bucket URL for uploading logs. The URL must start

OutputCOSBucketUrl

No

Stringwith https , such as https://BucketName123454321.cos.ap-beijing.myqcloud.com .
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

OutputCOSKeyPrefix

No

Stringcharacters. 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 witha slash (/), and cannot contain consecutive slashes.

3. Output Parameters
Parameter
Name
RequestId

Type

StringDescription
The unique request ID, which is returned for each request. RequestId is required forlocating a problem.

©2013-2022 Tencent Cloud. All rights reserved.

Page 108 of 158

Tencent Cloud Automation Tools

4. Example
Example1 Modifying a command
Input Example
POST / HTTP/1.1
Host: tat.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ModifyCommand<Common request parameters>{"CommandName": "second-command","Description": "hello world!","Content": "cHM=","CommandType": "SHELL","WorkingDirectory": "/",
"Timeout": 600,
"CommandId": "cmd-63usjhmq"}

Output Example{"Response": {"RequestId": "9bea970a-0bab-495f-b0dd-de5eedfdf611"}}

5. Developer Resources
SDK
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call
APIs.
Tencent Cloud SDK 3.0 for Python
Tencent Cloud SDK 3.0 for Java
Tencent Cloud SDK 3.0 for PHP
Tencent Cloud SDK 3.0 for Go
Tencent Cloud SDK 3.0 for NodeJS©2013-2022 Tencent Cloud. All rights reserved.

Page 109 of 158

Tencent Cloud Automation Tools

Tencent Cloud SDK 3.0 for .NET
Tencent Cloud SDK 3.0 for C++

Command Line Interface
Tencent Cloud CLI 3.0

6. Error CodeThe following only lists the error codes related to the API business logic. For other error codes, see Common Error
Codes.
Error CodeDescription

InternalError

Internal error.

InvalidParameter

Invalid parameter.

InvalidParameterValue

Invalid parameter value.

InvalidParameterValue.CommandContentInvalid

Invalid command content.

InvalidParameterValue.CommandNameDuplicatedDuplicate command name.

InvalidParameterValue.InvalidCommandId

Invalid CommandId.

InvalidParameterValue.InvalidCommandName

Invalid command name.

InvalidParameterValue.InvalidOutputCOSBucketUrl

Invalid OutputCOSBucketUrl.

InvalidParameterValue.InvalidOutputCOSKeyPrefix

Invalid OutputCOSKeyPrefix.

InvalidParameterValue.ParameterInvalidJsonFormat

The parameter is not a valid JSON string.

InvalidParameterValue.ParameterKeyContainsInvalidChar

The parameter key contains invalidcharacters.

InvalidParameterValue.ParameterKeyDuplicatedDuplicate 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.Range

The parameter value is not in the valid©2013-2022 Tencent Cloud. All rights reserved.

Page 110 of 158

Tencent Cloud Automation Tools

range.
InvalidParameterValue.SupportParametersOnlyIfEnableParameter

The custom parameter feature is notenabled.

InvalidParameterValue.TooLong

Length limit exceeded.

ResourceNotFound.CommandNotFoundThe command does not exist.

UnauthorizedOperation.CamAuthFailed

CAM authentication failed.

UnauthorizedOperation.InvalidToken

Invalid token.

UnauthorizedOperation.MFAExpired

The Multi-factor authentication (MFA)
code expired.

UnauthorizedOperation.MFANotFound©2013-2022 Tencent Cloud. All rights reserved.

Multi-factor authentication (MFA) does
not exist.

Page 111 of 158

Tencent Cloud Automation Tools

ModifyInvoker：

Last updated 2023-03-14 16:55:45

1. API Description
Domain name for API request: tat.tencentcloudapi.com.
This API is used to modify an invoker.
A maximum of 20 requests can be initiated per second for this API.
We recommend you to use API Explorer
Try itAPI Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation,
and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters
The following request parameter list only provides API request parameters and some common parameters. For thecomplete common parameter list, see Common Request Parameters.
Parameter Name

RequiredType

ActionYes

String

VersionYes

StringRegionNo

StringCommon Params. This parameter is not required forthis API.

InvokerId

YesStringID of the invoker to be modified.

Name

No

StringName of the invoker to be modified.

Type

No

StringCommandId

No

StringID of the command to be modified.

Username

No

String

The username to be modified.

©2013-2022 Tencent Cloud. All rights reserved.

Description
Common Params. The value used for this API:
ModifyInvoker.
Common Params. The value used for this API: 202010-28.

Invoker type. It can only be SCHEDULE (recurring
invokers).

Page 112 of 158

Tencent Cloud Automation Tools

Parameters

No

StringCustom parameters to be modified.

InstanceIds.N

No

Array of String

List of instance IDs to be modified. Up to 100 IDs areallowed.

ScheduleSettings

No

ScheduleSettings

Scheduled invoker settings to be modified.

3. Output Parameters
Parameter
Name

Type

RequestId

StringDescription
The unique request ID, which is returned for each request. RequestId is required forlocating a problem.

4. Example
Example1 Modifying an invoker
Input Example
POST / HTTP/1.1
Host: tat.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ModifyInvoker<Common request parameters>{"InvokerId": "ivk-b7s3qa5l","Parameters": "{\"var\": \"1\"}"}

Output Example{"Response": {"RequestId": "7f3acde8-196d-4be4-9fa7-359f79b026bc"}}©2013-2022 Tencent Cloud. All rights reserved.

Page 113 of 158

Tencent Cloud Automation Tools

5. Developer Resources
SDK
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call
APIs.
Tencent Cloud SDK 3.0 for Python
Tencent Cloud SDK 3.0 for Java
Tencent Cloud SDK 3.0 for PHP
Tencent Cloud SDK 3.0 for Go
Tencent Cloud SDK 3.0 for NodeJS
Tencent Cloud SDK 3.0 for .NET
Tencent Cloud SDK 3.0 for C++

Command Line Interface
Tencent Cloud CLI 3.0

6. Error CodeThe following only lists the error codes related to the API business logic. For other error codes, see Common Error
Codes.
Error CodeDescription

AuthFailure

CAM signature/authentication error.

InternalError

Internal error.

InvalidParameterValue.InconsistentInstance

Inconsistent instance type.

InvalidParameterValue.InvalidInstanceId

Invalid instance ID.

InvalidParameterValue.InvalidInvokerId

Invalid InvokerId.

InvalidParameterValue.ParameterDisabled

The custom parameter feature is not enabled.

InvalidParameterValue.ParameterInvalidJsonFormat

The parameter is not a valid JSON string.

ResourceNotFound.CommandNotFoundThe command does not exist.

ResourceNotFound.InstanceNotFoundThe instance does not exist.

©2013-2022 Tencent Cloud. All rights reserved.

Page 114 of 158

Tencent Cloud Automation Tools

ResourceUnavailable.AgentNotInstalled©2013-2022 Tencent Cloud. All rights reserved.

TAT Agent is not installed.

Page 115 of 158

Tencent Cloud Automation Tools

DeleteInvoker：

Last updated 2023-03-14 16:55:47

1. API Description
Domain name for API request: tat.tencentcloudapi.com.
This API is used to delete an invoker.
A maximum of 20 requests can be initiated per second for this API.
We recommend you to use API Explorer
Try itAPI Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation,
and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters
The following request parameter list only provides API request parameters and some common parameters. For thecomplete common parameter list, see Common Request Parameters.
Parameter Name

RequiredType

Description

ActionYes

StringCommon Params. The value used for this API: DeleteInvoker.

VersionYes

StringCommon Params. The value used for this API: 2020-10-28.

RegionNo

StringCommon Params. This parameter is not required for this API.

InvokerId

YesStringID of the invoker to be deleted.

3. Output Parameters
Parameter
Name

Type

RequestId

StringDescription
The unique request ID, which is returned for each request. RequestId is required forlocating a problem.

©2013-2022 Tencent Cloud. All rights reserved.

Page 116 of 158

Tencent Cloud Automation Tools

4. Example
Example1 Deleting an invoker
Input Example
POST / HTTP/1.1
Host: tat.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DeleteInvoker<Common request parameters>{"InvokerId": "ivk-b7s3qa5l"}

Output Example{"Response": {"RequestId": "bc16e010-7b50-4661-88e8-4d2c77d15558"}}

5. Developer Resources
SDK
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call
APIs.
Tencent Cloud SDK 3.0 for Python
Tencent Cloud SDK 3.0 for Java
Tencent Cloud SDK 3.0 for PHP
Tencent Cloud SDK 3.0 for Go
Tencent Cloud SDK 3.0 for NodeJS
Tencent Cloud SDK 3.0 for .NET
Tencent Cloud SDK 3.0 for C++

Command Line Interface©2013-2022 Tencent Cloud. All rights reserved.

Page 117 of 158

Tencent Cloud Automation Tools

Tencent Cloud CLI 3.0

6. Error CodeThe following only lists the error codes related to the API business logic. For other error codes, see Common Error
Codes.
Error CodeDescription

AuthFailure

CAM signature/authentication error.

InvalidParameterValue.InvalidInvokerId

Invalid InvokerId.

ResourceNotFoundThe resource does not exist.

©2013-2022 Tencent Cloud. All rights reserved.

Page 118 of 158

Tencent Cloud Automation Tools

PreviewReplacedCommandContent：

Last updated 2023-03-14 16:55:44

1. API Description
Domain name for API request: tat.tencentcloudapi.com.
This API is used to preview the command with custom parameters. The command is not executed.
A maximum of 20 requests can be initiated per second for this API.
We recommend you to use API Explorer
Try itAPI Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation,
and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters
The following request parameter list only provides API request parameters and some common parameters. For thecomplete common parameter list, see Common Request Parameters.
Parameter
Name

RequiredType

ActionYes

String

VersionYes

StringCommon Params. The value used for this API: 2020-10-28.

RegionNo

StringCommon Params. This parameter is not required for this API.

Description
Common Params. The value used for this API:
PreviewReplacedCommandContent.

Custom parameters for the preview. The field type is JSON encoded
string. For example, {"varA": "222"}.
key is the name of the custom parameter and "value" is its specified
value. Both "key" and "value" are strings.
Parameters

No

String

At most 20 custom parameters are supported.
The name of the custom parameter cannot exceed 64 characters andcan only contain [a-z], [A-Z], [0-9], [-_].
This parameter can be left empty if DefaultParameters is set for thepreviewed CommandId.

CommandId

No

String

The command to be previewed. If DefaultParameters is set, it is©2013-2022 Tencent Cloud. All rights reserved.

Page 119 of 158

Tencent Cloud Automation Tools

combined with Parameters and Parameters takes priority.
CommandId or Content must be specified.
Base64-encoded command to be previewed. The maximum length is 64
Content

No

StringKB.
CommandId or Content must be specified.

3. Output Parameters
Parameter NameType

Description

ReplacedContent

StringBase64-encoded command with custom parameters.

RequestId

String

The unique request ID, which is returned for each request. RequestId is required
for locating a problem.

4. Example
Example1 Previewing the result of replacing command content
Input Example
POST / HTTP/1.1
Host: tat.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: PreviewReplacedCommandContent<Common request parameters>{"Parameters": "{\"a\": \"123\"}","Content": "bHMge3thfX0KZWNobyB7e2J9fSB7e2N9fQ=="}

Output Example{"Response": {"RequestId": "0b4c6010-42a7-45cd-b8c3-daa7de930e82","ReplacedContent": "bHMgMTIzCmVjaG8ge3tifX0ge3tjfX0="}}©2013-2022 Tencent Cloud. All rights reserved.

Page 120 of 158

Tencent Cloud Automation Tools

5. Developer Resources
SDK
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call
APIs.
Tencent Cloud SDK 3.0 for Python
Tencent Cloud SDK 3.0 for Java
Tencent Cloud SDK 3.0 for PHP
Tencent Cloud SDK 3.0 for Go
Tencent Cloud SDK 3.0 for NodeJS
Tencent Cloud SDK 3.0 for .NET
Tencent Cloud SDK 3.0 for C++

Command Line Interface
Tencent Cloud CLI 3.0

6. Error CodeThe following only lists the error codes related to the API business logic. For other error codes, see Common Error
Codes.
Error CodeDescription

InvalidParameter.ConflictParameter

Conflicting parameters.

InvalidParameter.ParameterNameDuplicatedDuplicate parameter name.

InvalidParameterValue.CommandContentInvalid

Invalid command content.

InvalidParameterValue.CommandNameDuplicatedDuplicate command name.

InvalidParameterValue.InvalidCommandId

Invalid CommandId.

InvalidParameterValue.LackOfParameterInfo
InvalidParameterValue.LackOfParameters
InvalidParameterValue.ParameterDisabled©2013-2022 Tencent Cloud. All rights reserved.

The custom parameter feature is enabled,
but custom parameters are missing.
Parameters not provided.
The custom parameter feature is notenabled.

Page 121 of 158

Tencent Cloud Automation Tools

InvalidParameterValue.ParameterInvalidJsonFormat

The parameter is not a valid JSON string.

InvalidParameterValue.ParameterKeyContainsInvalidChar

The parameter key contains invalidcharacters.

InvalidParameterValue.ParameterKeyDuplicatedDuplicate 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.Range

The parameter value is not in the valid
range.

InvalidParameterValue.SupportParametersOnlyIfEnableParameter

The custom parameter feature is notenabled.

ResourceNotFound.CommandNotFoundThe command does not exist.

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.

©2013-2022 Tencent Cloud. All rights reserved.

Page 122 of 158

Tencent Cloud Automation Tools

DisableInvoker：

Last updated 2023-03-14 16:55:45

1. API Description
Domain name for API request: tat.tencentcloudapi.com.
This API is used to disable an invoker.
A maximum of 20 requests can be initiated per second for this API.
We recommend you to use API Explorer
Try itAPI Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation,
and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters
The following request parameter list only provides API request parameters and some common parameters. For thecomplete common parameter list, see Common Request Parameters.
Parameter Name

RequiredType

Description

ActionYes

StringCommon Params. The value used for this API: DisableInvoker.

VersionYes

StringCommon Params. The value used for this API: 2020-10-28.

RegionNo

StringCommon Params. This parameter is not required for this API.

InvokerId

YesStringID of the invoker to be disabled.

3. Output Parameters
Parameter
Name
RequestId

Type

StringDescription
The unique request ID, which is returned for each request. RequestId is required forlocating a problem.

©2013-2022 Tencent Cloud. All rights reserved.

Page 123 of 158

Tencent Cloud Automation Tools

4. Example
Example1 Disabling an invoker
Input Example
POST / HTTP/1.1
Host: tat.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DisableInvoker<Common request parameters>{"InvokerId": "ivk-b7s3qa5l"}

Output Example{"Response": {"RequestId": "a6c5b0bd-4273-47c0-8d34-c32822f3ccb0"}}

5. Developer Resources
SDK
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call
APIs.
Tencent Cloud SDK 3.0 for Python
Tencent Cloud SDK 3.0 for Java
Tencent Cloud SDK 3.0 for PHP
Tencent Cloud SDK 3.0 for Go
Tencent Cloud SDK 3.0 for NodeJS
Tencent Cloud SDK 3.0 for .NET
Tencent Cloud SDK 3.0 for C++

Command Line Interface©2013-2022 Tencent Cloud. All rights reserved.

Page 124 of 158

Tencent Cloud Automation Tools

Tencent Cloud CLI 3.0

6. Error CodeThe following only lists the error codes related to the API business logic. For other error codes, see Common Error
Codes.
Error CodeDescription

AuthFailure

CAM signature/authentication error.

InvalidParameterValue.InvalidInvokerId

Invalid InvokerId.

ResourceNotFoundThe resource does not exist.

©2013-2022 Tencent Cloud. All rights reserved.

Page 125 of 158

Tencent Cloud Automation Tools

DescribeInvokers：

Last updated 2023-03-14 16:55:46

1. API Description
Domain name for API request: tat.tencentcloudapi.com.
This API is used to query invoker details.
A maximum of 20 requests can be initiated per second for this API.
We recommend you to use API Explorer
Try itAPI Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation,
and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters
The following request parameter list only provides API request parameters and some common parameters. For thecomplete common parameter list, see Common Request Parameters.
Parameter

RequiredType

Description

ActionYes

StringCommon Params. The value used for this API: DescribeInvokers.

VersionYes

StringCommon Params. The value used for this API: 2020-10-28.

RegionNo

StringCommon Params. This parameter is not required for this API.

InvokerIds.N

No

Array of
StringList of invoker IDs.

Name

Filter conditions:invoker-id - String - Required: No - (Filter condition) Filter
Filters.N

No

Array ofFilterby the invoker ID.
command-id - String - Required: No - (Filter condition) Filterby the command ID.
type - String - Required: No - (Filter condition) Filter by the
invoker type.

©2013-2022 Tencent Cloud. All rights reserved.

Page 126 of 158

Tencent Cloud Automation Tools

Limit

No

IntegerNumber of returned results. Default value: 20. Maximum value: 100.

OffsetNo

Integer

Offset. Default value: 0.

3. Output Parameters
Parameter
Name
TotalCount
InvokerSet

RequestId

Type

Description

IntegerNumber of matching invokers.

Array of
InvokerStringInvoker information.
The unique request ID, which is returned for each request. RequestId is required
for locating a problem.

4. Example
Example1 Querying invokers
Input Example
POST / HTTP/1.1
Host: tat.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeInvokers<Common request parameters>{"Filters": [{"Name": "invoker-id","Values": ["ivk-b7s3qa5l"]}]}

Output Example©2013-2022 Tencent Cloud. All rights reserved.

Page 127 of 158

Tencent Cloud Automation Tools{"Response": {"RequestId": "a4c828cf-31c9-42d2-a558-2ad340a76ef0","TotalCount": 1,"InvokerSet": [{"InvokerId": "ivk-b7s3qa5l","Name": "test-invoker","Type": "SCHEDULE","CommandId": "cmd-m7uma92n","Username": "root","Parameters": "{\"var\": \"1\"}","InstanceIds": ["ins-yx05ky8j"],"Enable": false,"ScheduleSettings": {"Policy": "ONCE","Recurrence": "","InvokeTime": ""},"CreatedTime": "2021-08-30T06:42:02Z","UpdatedTime": "2021-09-09T12:07:00Z"}]}}

5. Developer Resources
SDK
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call
APIs.
Tencent Cloud SDK 3.0 for Python
Tencent Cloud SDK 3.0 for Java
Tencent Cloud SDK 3.0 for PHP
Tencent Cloud SDK 3.0 for Go
Tencent Cloud SDK 3.0 for NodeJS
Tencent Cloud SDK 3.0 for .NET
Tencent Cloud SDK 3.0 for C++©2013-2022 Tencent Cloud. All rights reserved.

Page 128 of 158

Tencent Cloud Automation Tools

Command Line Interface
Tencent Cloud CLI 3.0

6. Error CodeThe following only lists the error codes related to the API business logic. For other error codes, see Common Error
Codes.
Error CodeDescription

AuthFailure

CAM signature/authentication error.

InvalidParameter.ConflictParameter

Conflicting parameters.

InvalidParameterValue

Invalid parameter value.

InvalidParameterValue.InvalidFilter

Invalid filter.

InvalidParameterValue.InvalidInvokerId

Invalid InvokerId.

©2013-2022 Tencent Cloud. All rights reserved.

Page 129 of 158

Tencent Cloud Automation Tools

DescribeInvokerRecords：

Last updated 2023-03-14 16:55:46

1. API Description
Domain name for API request: tat.tencentcloudapi.com.
This API is used to query the execution history of an invoker.
A maximum of 20 requests can be initiated per second for this API.
We recommend you to use API Explorer
Try itAPI Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation,
and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters
The following request parameter list only provides API request parameters and some common parameters. For thecomplete common parameter list, see Common Request Parameters.
Parameter
Name

RequiredType

Description

ActionYes

StringCommon Params. The value used for this API:
DescribeInvokerRecords.

VersionYes

StringCommon Params. The value used for this API: 2020-10-28.

RegionNo

StringCommon Params. This parameter is not required for this API.

InvokerIds.N

No

Array of
StringList of invoker IDs. Up to 100 IDs are allowed.

Limit

No

IntegerNumber of returned results. Default value: 20. Maximum value:
100.

OffsetNo

Integer

Offset. Default value: 0.

3. Output Parameters©2013-2022 Tencent Cloud. All rights reserved.

Page 130 of 158

Tencent Cloud Automation Tools

Parameter NameType

Description

TotalCount

IntegerNumber of matching records.

InvokerRecordSet

RequestId

Array of
InvokerRecord
StringExecution history of an invoker.
The unique request ID, which is returned for each request. RequestId
is required for locating a problem.

4. Example
Example1 Querying the execution history of an invoker
Input Example
POST / HTTP/1.1
Host: tat.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeInvokerRecords<Common request parameters>{"InvokerIds": ["ivk-b7s3qa5l"],"Offset": 0,"Limit": 2}

Output Example{"Response": {"RequestId": "0398dcea-b3de-4ec9-8e78-976191e0a94f","TotalCount": 1443,"InvokerRecordSet": [{"InvokerId": "ivk-b7s3qa5l","Reason": "start an invocation at scheduled time.","InvocationId": "inv-l9l4orf1","Result": "SUCCESS","InvokeTime": "2021-09-06T09:33:05Z"},©2013-2022 Tencent Cloud. All rights reserved.

Page 131 of 158

Tencent Cloud Automation Tools{"InvokerId": "ivk-b7s3qa5l","Reason": "start an invocation at scheduled time.","InvocationId": "inv-7ojgezbd","Result": "SUCCESS","InvokeTime": "2021-09-06T09:30:05Z"}]}}

5. Developer Resources
SDK
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call
APIs.
Tencent Cloud SDK 3.0 for Python
Tencent Cloud SDK 3.0 for Java
Tencent Cloud SDK 3.0 for PHP
Tencent Cloud SDK 3.0 for Go
Tencent Cloud SDK 3.0 for NodeJS
Tencent Cloud SDK 3.0 for .NET
Tencent Cloud SDK 3.0 for C++

Command Line Interface
Tencent Cloud CLI 3.0

6. Error CodeThe following only lists the error codes related to the API business logic. For other error codes, see Common Error
Codes.
Error CodeDescription

AuthFailure

CAM signature/authentication error.

InvalidParameterValue

Invalid parameter value.

InvalidParameterValue.InvalidInvokerId

Invalid InvokerId.

©2013-2022 Tencent Cloud. All rights reserved.

Page 132 of 158

Tencent Cloud Automation Tools©2013-2022 Tencent Cloud. All rights reserved.

Page 133 of 158

Tencent Cloud Automation Tools

RunCommand：

Last updated 2023-03-14 16:55:44

1. API Description
Domain name for API request: tat.tencentcloudapi.com.
This API is used to execute a command and returns the execution activity ID (inv-xxxxxxxx) on success. Each
execution has one or more execution tasks (invt-xxxxxxxx) and each execution task indicates an execution record on a
CVM or Lighthouse instance.
If the agent is not installed on the instance or is offline, an error is returned.
If the command type is not supported by the agent runtime environment, an error is returned.
The specified instance needs to be in a VPC network.
The specified instance needs to be in the RUNNING status.
Only one type of instances (CVM or Lighthouse) can be specified in a single request.
A maximum of 20 requests can be initiated per second for this API.
We recommend you to use API Explorer
Try itAPI Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation,
and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters
The following request parameter list only provides API request parameters and some common parameters. For thecomplete common parameter list, see Common Request Parameters.
Parameter Name

RequiredType

Description

ActionYes

StringCommon Params. The value used for this API:
RunCommand.

VersionYes

StringCommon Params. The value used for this API: 2020-10-28.

RegionNo

StringCommon Params. This parameter is not required for thisAPI.

Content

Yes

StringBase64-encoded command. The maximum length is 64 KB.

©2013-2022 Tencent Cloud. All rights reserved.

Page 134 of 158

Tencent Cloud Automation Tools

InstanceIds.N

Yes

Array of
StringIDs of instances about to execute commands. Up to 100 IDs
are allowed. Supported instance types:
CVM
LIGHTHOUSE

CommandName

No

StringCommand name. The name can be up to 60 bytes, andcontain [a-z], [A-Z], [0-9] and [_-.].

Description

No

StringCommand description. The maximum length is 120
characters.

CommandType

No

StringCommand type. SHELL and POWERSHELL aresupported. The default value is SHELL .
Command execution path. The default value is /root for

WorkingDirectory

No

StringSHELL commands and C:\Program
Files\qcloud\tat_agent\workdir for POWERSHELL
commands.

Timeout

No

Integer

Command timeout period. Default value: 60 seconds. Value
range: [1, 86400].
Whether to save the command. Valid values:

SaveCommand

No

BooleanTrue : Save
False : Do not saveThe default value is False .
Whether to enable the custom parameter feature.

EnableParameter

No

BooleanThis cannot be modified once created.
Default value: false .
The default value of the custom parameter value when it isenabled. The field type is JSON encoded string. For
example, {"varA": "222"}.
key is the name of the custom parameter and value

DefaultParameters

No

Stringis the default value. Both key and value are strings.
If Parameters is not provided, the default values specified
here are 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 [-_].

Parameters

No

StringCustom parameters of 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.

©2013-2022 Tencent Cloud. All rights reserved.

Page 135 of 158

Tencent Cloud Automation Tools

If no parameter value is provided, theDefaultParameters 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 [-_].

Tags.NNo

Array ofTag

The tags of the command. It is available when
SaveCommand is True . A maximum of 10 tags areallowed.
The username used to execute the command on the CVM or
Lighthouse instance.
The principle of least privilege is the best practice for

Username

No

Stringpermission management. We recommend you execute TAT
commands as a general user. By default, the user root
is used to execute commands on Linux and the user
System is used on Windows.

OutputCOSBucketUrl

No

StringThe COS bucket URL for uploading logs. The URL must
start with https , such as https://BucketName123454321.cos.ap-beijing.myqcloud.com .
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

OutputCOSKeyPrefix

No

Stringcharacters. 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 witha slash (/), and cannot contain consecutive slashes.

3. Output Parameters
Parameter
Name

Type

Description

CommandId

StringCommand ID.

InvocationId

StringExecution activity ID.

RequestId

String

The unique request ID, which is returned for each request. RequestId is required forlocating a problem.

©2013-2022 Tencent Cloud. All rights reserved.

Page 136 of 158

Tencent Cloud Automation Tools

4. Example
Example1 Executing a command on multiple CVM instances
Input Example
POST / HTTP/1.1
Host: tat.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: RunCommand<Common request parameters>{"CommandName": "run-command","SaveCommand": false,"Description": "whoami","Content": "d2hvYW1p","CommandType": "SHELL","WorkingDirectory": "/root/","Timeout": 60,"InstanceIds": ["ins-zj0f57ew","ins-zj0f57ex","ins-zj0f57ev"]}

Output Example{"Response": {"RequestId": "f3e3a951-56b1-4042-af23-ba50223a8f60","CommandId": "cmd-5oa8jajm","InvocationId": "inv-mp6m9vmu"}}

5. Developer Resources
SDK
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to callAPIs.

©2013-2022 Tencent Cloud. All rights reserved.

Page 137 of 158

Tencent Cloud Automation Tools

Tencent Cloud SDK 3.0 for Python
Tencent Cloud SDK 3.0 for Java
Tencent Cloud SDK 3.0 for PHP
Tencent Cloud SDK 3.0 for Go
Tencent Cloud SDK 3.0 for NodeJS
Tencent Cloud SDK 3.0 for .NET
Tencent Cloud SDK 3.0 for C++

Command Line Interface
Tencent Cloud CLI 3.0

6. Error CodeThe following only lists the error codes related to the API business logic. For other error codes, see Common Error
Codes.
Error CodeDescription

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.

InvalidParameter.ParameterNameDuplicatedDuplicate parameter name.

InvalidParameterValue

Invalid parameter value.

InvalidParameterValue.AgentUnsupportedCommandType

TAT Agent does not support thiscommand type.

InvalidParameterValue.CommandContentInvalid

Invalid command content.

InvalidParameterValue.CommandNameDuplicatedDuplicate command name.

InvalidParameterValue.InconsistentInstance

Inconsistent instance type.

InvalidParameterValue.InvalidCommandName

Invalid command name.

InvalidParameterValue.InvalidContent

Invalid command.

©2013-2022 Tencent Cloud. All rights reserved.

Page 138 of 158

Tencent Cloud Automation Tools

InvalidParameterValue.InvalidInstanceId

Invalid instance ID.

InvalidParameterValue.InvalidOutputCOSBucketUrl

Invalid OutputCOSBucketUrl.

InvalidParameterValue.InvalidOutputCOSKeyPrefix

Invalid OutputCOSKeyPrefix.

InvalidParameterValue.InvalidUsername

Invalid username.

InvalidParameterValue.InvalidWorkingDirectory

Invalid command execution path.

InvalidParameterValue.LackOfParameterInfo
InvalidParameterValue.LimitExceeded
InvalidParameterValue.ParameterDisabled
InvalidParameterValue.ParameterInvalidJsonFormat
InvalidParameterValue.ParameterKeyContainsInvalidChar

The custom parameter feature is enabled,
but custom parameters are missing.
Parameter limit exceeded.
The custom parameter feature is notenabled.
The parameter is not a valid JSON string.
The parameter key contains invalidcharacters.

InvalidParameterValue.ParameterKeyDuplicatedDuplicate 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.Range

The parameter value is not in the valid
range.

InvalidParameterValue.SupportParametersOnlyIfEnableParameter

The custom parameter feature is notenabled.

InvalidParameterValue.TooLong

Length limit exceeded.

MissingParameter

Missing parameter.

ResourceNotFound.InstanceNotFoundThe instance does not exist.

ResourceNotFound.RoleNotFoundThe role does not exist.

ResourceUnavailable.AgentNotInstalled

TAT Agent is not installed.

ResourceUnavailable.AgentStatusNotOnline

TAT Agent is offline.

©2013-2022 Tencent Cloud. All rights reserved.

Page 139 of 158

Tencent Cloud Automation Tools

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

UnauthorizedOperation.MFANotFound©2013-2022 Tencent Cloud. All rights reserved.

The Multi-factor authentication (MFA)
code expired.
Multi-factor authentication (MFA) does
not exist.

Page 140 of 158

Tencent Cloud Automation Tools

Region APIs
DescribeRegions：

Last updated 2023-06-12 16:10:38

1. API Description
Domain name for API request: tat.tencentcloudapi.com.
This API is used to query the list of regions that supports TAT.
If the RegionState is AVAILABLE , it means that TAT is available in the region. If no value is returned, TAT is
not available in the region.
A maximum of 20 requests can be initiated per second for this API.
We recommend you to use API Explorer
Try itAPI Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation,
and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters
The following request parameter list only provides API request parameters and some common parameters. For thecomplete common parameter list, see Common Request Parameters.
Parameter Name

RequiredType

Description

ActionYes

StringCommon Params. The value used for this API: DescribeRegions.

VersionYes

StringCommon Params. The value used for this API: 2020-10-28.

RegionNo

StringCommon Params. This parameter is not required for this API.

3. Output Parameters
Parameter
Name

Type

Description©2013-2022 Tencent Cloud. All rights reserved.

Page 141 of 158

Tencent Cloud Automation Tools

Parameter
Name
TotalCount
RegionSet

RequestId

Type

Description

IntegerNumber of regions

Array ofRegionInfo
StringRegion information list
The unique request ID, which is returned for each request. RequestId isrequired for locating a problem.

4. Example
Example1 Querying regions that support TAT
Input Example
POST / HTTP/1.1
Host: tat.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeRegions<Common request parameters>{}

Output Example{"Response": {"TotalCount": 13,"RegionSet": [{"Region": "ap-guangzhou","RegionName": "Guangzhou","RegionState": "AVAILABLE"},{"Region": "ap-nanjing","RegionName": "Nanjing","RegionState": "AVAILABLE"},{"Region": "ap-shanghai","RegionName": "Shanghai",©2013-2022 Tencent Cloud. All rights reserved.

Page 142 of 158

Tencent Cloud Automation Tools"RegionState": "AVAILABLE"},{"Region": "ap-hongkong","RegionName": "Hong Kong (China)","RegionState": "AVAILABLE"},{"Region": "ap-beijing","RegionName": "Beijing","RegionState": "AVAILABLE"},{"Region": "ap-singapore","RegionName": "Singapore","RegionState": "AVAILABLE"},{"Region": "na-siliconvalley","RegionName": "Silicon Valley","RegionState": "AVAILABLE"},{"Region": "ap-chengdu","RegionName": "Chengdu","RegionState": "AVAILABLE"},{"Region": "eu-frankfurt","RegionName": "Frankfurt","RegionState": "AVAILABLE"},{"Region": "ap-seoul","RegionName": "Seoul","RegionState": "AVAILABLE"},{"Region": "ap-chongqing","RegionName": "Chongqing","RegionState": "AVAILABLE"},{"Region": "ap-mumbai","RegionName": "Mumbai","RegionState": "AVAILABLE"},©2013-2022 Tencent Cloud. All rights reserved.

Page 143 of 158

Tencent Cloud Automation Tools],"RequestId": "6fb7f9db-b7da-4cb8-a912-3a3b1690f3a6"}}

5. Developer Resources
SDK
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call
APIs.
Tencent Cloud SDK 3.0 for Python
Tencent Cloud SDK 3.0 for Java
Tencent Cloud SDK 3.0 for PHP
Tencent Cloud SDK 3.0 for Go
Tencent Cloud SDK 3.0 for NodeJS
Tencent Cloud SDK 3.0 for .NET
Tencent Cloud SDK 3.0 for C++

Command Line Interface
Tencent Cloud CLI 3.0

6. Error CodeThe following only lists the error codes related to the API business logic. For other error codes, see Common Error
Codes.
Error CodeDescription

InternalError

Internal error.

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.

©2013-2022 Tencent Cloud. All rights reserved.

Page 144 of 158

Tencent Cloud Automation Tools

Data Types：

Last updated 2023-03-14 16:55:48

AutomationAgentInfo
TAT agent information
Used by actions: DescribeAutomationAgentStatus.
Name

Type

Description

InstanceId

String

Instance ID.

VersionStringAgent version.

LastHeartbeatTime

Timestamp ISO8601

Last heartbeat time

StringAgent status. Valid values:
OnlineAgentStatus

OfflineAgent runtime environment. Valid values:
Environment

Linux : Linux instanceString

Windows : Windows instance
SupportFeatures

Array of String

Features supported by the TAT agent.

CommandCommand details.
Used by actions: DescribeCommands.
Name

Type

Description

CommandId

StringCommand ID.

CommandName

StringCommand name.

Description

StringCommand description.

Content

StringBase64-encoded command.

©2013-2022 Tencent Cloud. All rights reserved.

Page 145 of 158

Tencent Cloud Automation Tools

CommandType

StringCommand type.

WorkingDirectory

StringCommand execution path.

Timeout

Integer

Command timeout period.

CreatedTime

Timestamp
ISO8601

Command creation time.

UpdatedTime

Timestamp
ISO8601

Command update time.

EnableParameter

BooleanWhether to enable the custom parameter feature.

DefaultParameters

StringDefault custom parameter value.

FormattedDescription

StringCreatedBy

StringTags

Array ofTag

The list of tags bound to the command.

Username

String

The user who executes the command on the instance.

OutputCOSBucketUrl

StringThe COS bucket URL for uploading logs.

OutputCOSKeyPrefix

StringThe COS bucket directory where the logs are saved.

Formatted description of the command. This parameter is an empty
string for user commands and contains values for public commands.
Command creator. TAT indicates a public command and USER
indicates a personal command.

CommandDocument
Command execution details.
Used by actions: DescribeInvocationTasks.
Name

Type

Description

Content

StringBase64-encoded command.

CommandType

StringCommand type.

Timeout

Integer

Timeout period.

WorkingDirectory

StringExecution path.

©2013-2022 Tencent Cloud. All rights reserved.

Page 146 of 158

Tencent Cloud Automation Tools

Username

String

The user who executes the command.

OutputCOSBucketUrl

String

URL of the COS bucket to store the output

OutputCOSKeyPrefix

StringPrefix of the output file name

FilterKey-value pair filters for conditional filtering queries, such as filtering ID, name, and status.
If there are multiple Filter parameters, the relationship among them is the logical AND .
If there are multiple Values for the same Filter , the relationship among the Values for thesame Filter is the logical OR .
Take the DescribeInstances API as an example. You can use the following filters to query the instances whose
availability zone ( zone ) is Guangzhou 1 and billing method ( instance-charge-type ) is prepaid or
pay-as-you-go:

Filters.0.Name=zone&Filters.0.Values.0=ap-guangzhou-1&Filters.1.Name=instance-charge-type&Filters.1.Values.0=PREPAID&Filters.1.Values.1=POSTPAID_BY_HOUR
Used by actions: DescribeAutomationAgentStatus, DescribeCommands, DescribeInvocationTasks,
DescribeInvocations, DescribeInvokers.
Name

Type

Required

Description

Name

StringYes

Field to be filtered.

ValuesArray of String

Yes

Filter values of the field.

Invocation
Execution activity details.
Used by actions: DescribeInvocations.

©2013-2022 Tencent Cloud. All rights reserved.

Page 147 of 158

Tencent Cloud Automation Tools

Name

Type

Description

InvocationId

StringExecution activity ID.

CommandId

StringCommand ID.
Execution task status. Valid values:
PENDING: Pending
RUNNING: Running

InvocationStatus

String

SUCCESS: Success
FAILED: Failed
TIMEOUT: Command timed out
PARTIAL_FAILED: Partial failure

InvocationTaskBasicInfoSet

Array of
InvocationTaskBasicInfo

Execution task information list.

Description

StringExecution activity description.

StartTime

Timestamp ISO8601

Start time of the execution activity.

EndTimeTimestamp ISO8601

End time of the execution activity.

CreatedTime

Timestamp ISO8601

Time when the execution activity is created.

UpdatedTime

Timestamp ISO8601

Time when the execution activity is updated.

Parameters

StringValues of custom parameters.

DefaultParameters

StringDefault custom parameter value.

InstanceKind

StringType of the instance executing the command. Validvalues: CVM , LIGHTHOUSE .

Username

String

The user who executes the command on the
instance.

InvocationSource

String

Invocation source.

CommandContent

StringBase64-encoded command

CommandType

StringCommand type

Timeout

Integer

Command timeout period, in seconds.

WorkingDirectory

StringWorking directory for executing the command.

OutputCOSBucketUrl

StringThe COS bucket URL for uploading logs.

©2013-2022 Tencent Cloud. All rights reserved.

Page 148 of 158

Tencent Cloud Automation Tools

OutputCOSKeyPrefix

StringThe COS bucket directory where the logs are
saved.

InvocationTask
Execution task.
Used by actions: DescribeInvocationTasks.
Name

Type

Description

InvocationId

StringExecution activity ID.

InvocationTaskId

StringExecution task ID.

CommandId

StringCommand ID.
Execution task status. Valid values:
PENDING: Pending
DELIVERING: Delivering
DELIVER_DELAYED: Delivery delayed
DELIVER_FAILED: Delivery failed
START_FAILED: Failed to start the command

TaskStatus

StringRUNNING: Running
SUCCESS: Success
FAILED: Failed to execute the command. The exit code is
not 0 after execution.
TIMEOUT: Command timed out
TASK_TIMEOUT: Task timed out
CANCELLING: Canceling
CANCELLED: Canceled (canceled before execution)
TERMINATED: Terminated (canceled during execution)

InstanceId

String

Instance ID.

TaskResult

TaskResult

Execution result.

StartTime

EndTimeCreatedTime

Timestamp
ISO8601
Timestamp
ISO8601
Timestamp
ISO8601©2013-2022 Tencent Cloud. All rights reserved.

Start time of the execution task.

End time of the execution task.

Creation time.

Page 149 of 158

Tencent Cloud Automation Tools

UpdatedTime

Timestamp
ISO8601

Update time.

CommandDocument

CommandDocument

Command details of the execution task.

ErrorInfo

StringError message displayed when the execution task fails.

InvocationSource

String

Invocation source.

InvocationTaskBasicInfo
Execution task description.
Used by actions: DescribeInvocations.
Name

Type

Description

InvocationTaskId

StringExecution task ID.
Execution task status. Valid values:
PENDING: Pending
DELIVERING: Delivering
DELIVER_DELAYED: Delivery delayed
DELIVER_FAILED: Delivery failed
START_FAILED: Failed to start the command

TaskStatus

RUNNING: Running
SUCCESS: Success

String

FAILED: Failed to execute the command. The exit code is not 0 after
execution.
TIMEOUT: Command timed out
TASK_TIMEOUT: Task timed out
CANCELLING: Canceling
CANCELLED: Canceled (canceled before execution)
TERMINATED: Terminated (canceled during execution)
InstanceId

String

Instance ID.

Invoker
Invoker information.
Used by actions: DescribeInvokers.

©2013-2022 Tencent Cloud. All rights reserved.

Page 150 of 158

Tencent Cloud Automation Tools

Name

Type

Description

InvokerId

StringInvoker ID.

NameStringInvoker name.

Type

StringInvoker type.

CommandId

StringCommand ID.

Username

StringUsername.

Parameters

StringCustom parameters.

InstanceIds

Array of String

Instance ID list.

EnableBooleanWhether to enable the invoker.

ScheduleSettings

ScheduleSettings

Execution schedule of the invoker. This field is returned for recurring
invokers.
Note: This field may return null , indicating that no valid values
can be obtained.

CreatedTime

UpdatedTime

Timestamp
ISO8601
Timestamp
ISO8601

Creation time.

Modification time.

InvokerRecord
Execution history of the invoker.
Used by actions: DescribeInvokerRecords.
Name

Type

Description

InvokerId

StringInvoker ID.

InvokeTime

Timestamp ISO8601

Execution time.

ReasonStringExecution reason.

InvocationId

StringCommand execution ID.

ResultString

Trigger result.

©2013-2022 Tencent Cloud. All rights reserved.

Page 151 of 158

Tencent Cloud Automation Tools

RegionInfo
Information of a region.
Used by actions: DescribeRegions.
Name

Type

Description

RegionStringRegion name, such as ap-guangzhou

RegionName

StringRegion description, such as Guangzhou

RegionState

StringRegion status. AVAILABLE indicates the region is available.

ScheduleSettings
Settings of a scheduled invoker
Used by actions: CreateInvoker, DescribeInvokers, ModifyInvoker.
Name

Type

Required

Description
Execution policy:

PolicyStringYes

ONCE : Execute once
RECURRENCE : Execute repeatedly

Recurrence

InvokeTime

String

No

Timestamp
ISO8601

No

Trigger the crontab expression. This field is required if Policy
is RECURRENCE . The crontab expression is parsed in UTC+8.
The next execution time of the invoker. This field is required if
Policy is ONCE .

TagInformation on tags
Used by actions: CreateCommand, DescribeCommands, RunCommand.
Name

Type

©2013-2022 Tencent Cloud. All rights reserved.

Required

Description

Page 152 of 158

Tencent Cloud Automation Tools

Key

StringYes

Tag key.

Value

StringYes

Tag value.

TaskResult
Task result.
Used by actions: DescribeInvocationTasks.
Name

Type

Description

ExitCode

Integer

ExitCode of the execution.

OutputStringExecStartTime

Timestamp
ISO8601

Time when the execution is started.

ExecEndTime

Timestamp
ISO8601

Time when the execution is ended.

DroppedInteger

Dropped bytes of the command output.

OutputUrl

StringCOS URL of the logs.

OutputUploadCOSErrorInfo

StringError message for uploading logs to COS.

©2013-2022 Tencent Cloud. All rights reserved.

Base64-encoded command output. The maximum lengthis 24 KB.

Page 153 of 158

Tencent Cloud Automation Tools

Error Codes：

Last updated 2023-03-14 16:55:48

Feature Description
If there is an Error field in the response, it means that the API call failed. For example:{"Response": {"Error": {"Code": "AuthFailure.SignatureFailure","Message": "The provided credentials could not be validated. Please check your si
gnature is correct."},"RequestId": "ed93f3cb-f35e-473f-b9f3-0d451b8b79c6"}}
Code in Error indicates the error code, and Message indicates the specific information of the error.

Error Code List
Common Error Codes
Error CodeDescription

ActionOffline

This API has been deprecated.

AuthFailure.InvalidAuthorization

Authorization in the request header is invalid.

AuthFailure.InvalidSecretId

Invalid key (not a TencentCloud API key type).

AuthFailure.MFAFailure

MFA failed.

AuthFailure.SecretIdNotFound

AuthFailure.SignatureExpire©2013-2022 Tencent Cloud. All rights reserved.

Key does not exist. Check if the key has been
deleted or disabled in the console, and if not, checkif the key is correctly entered. Note that whitespaces
should not exist before or after the key.
Signature expired. Timestamp and server timecannot differ by more than five minutes. Please

Page 154 of 158

Tencent Cloud Automation Tools

ensure your current local time matches the standard
time.

AuthFailure.SignatureFailure

Invalid signature. Signature calculation error. Please
ensure you’ve followed the signature calculation
process described in the Signature API
documentation.

AuthFailure.TokenFailure

Token error.

AuthFailure.UnauthorizedOperation

The request is not authorized. For more information,
see the CAM documentation.
DryRun Operation. It means that the request would

DryRunOperation

have succeeded, but the DryRun parameter wasused.

FailedOperation

Operation failed.

InternalError

Internal error.

InvalidAction

The API does not exist.

InvalidParameter

Incorrect parameter.

InvalidParameterValue

Invalid parameter value.

InvalidRequest

The multipart format of the request body is incorrect.

IpInBlacklist

Your IP is in uin IP blacklist.

IpNotInWhitelistYour IP is not in uin IP whitelist.

LimitExceeded

Quota limit exceeded.

MissingParameter

A parameter is missing.

NoSuchProduct

The product does not exist.

NoSuchVersion

The API version does not exist.

RequestLimitExceeded

The number of requests exceeds the frequency limit.

RequestLimitExceeded.GlobalRegionUinLimitExceeded

Uin exceeds the frequency limit.

RequestLimitExceeded.IPLimitExceeded
RequestLimitExceeded.UinLimitExceeded©2013-2022 Tencent Cloud. All rights reserved.

The number of ip requests exceeds the frequency
limit.
The number of uin requests exceeds the frequency

Page 155 of 158

Tencent Cloud Automation Tools

limit.
RequestSizeLimitExceeded

The request size exceeds the upper limit.

ResourceInUse

Resource is in use.

ResourceInsufficientInsufficient resource.

ResourceNotFoundThe resource does not exist.

ResourceUnavailable

Resource is unavailable.

ResponseSizeLimitExceeded

The response size exceeds the upper limit.

ServiceUnavailable

Service is unavailable now.

UnauthorizedOperation

Unauthorized operation.

UnknownParameter

Unknown parameter.

UnsupportedOperation

Unsupported operation.

UnsupportedProtocol

HTTP(S) request protocol error; only GET and
POST requests are supported.

UnsupportedRegion

API does not support the requested region.

Service Error Codes
Error CodeDescription

AuthFailure

CAM signature/authentication error.

FailedOperation.CVMError

Failed to access the CVM.

FailedOperation.LighthouseError

Failed to access the Lighthouse instance.

InvalidParameter.ConflictParameter

Conflicting parameters.

InvalidParameter.InvalidUsername

Invalid username.

InvalidParameter.ParameterNameDuplicatedDuplicate parameter name.

InvalidParameterValue.AgentUnsupportedCommandType

TAT Agent does not support thiscommand type.

InvalidParameterValue.CommandContentInvalid

Invalid command content.

InvalidParameterValue.CommandNameDuplicatedDuplicate command name.

©2013-2022 Tencent Cloud. All rights reserved.

Page 156 of 158

Tencent Cloud Automation Tools

InvalidParameterValue.InconsistentInstance
InvalidParameterValue.InstanceIsNotRelatedToInvocation

Inconsistent instance type.
The instance with this ID has no suchexecution activity.

InvalidParameterValue.InvalidCommandId

Invalid CommandId.

InvalidParameterValue.InvalidCommandName

Invalid command name.

InvalidParameterValue.InvalidContent

Invalid command.

InvalidParameterValue.InvalidCronExpression

Invalid crontab expression.

InvalidParameterValue.InvalidFilter

Invalid filter.

InvalidParameterValue.InvalidInstanceId

Invalid instance ID.

InvalidParameterValue.InvalidInvocationId

Invalid execution activity ID.

InvalidParameterValue.InvalidInvocationTaskId

Invalid execution task ID.

InvalidParameterValue.InvalidInvokerId

Invalid InvokerId.

InvalidParameterValue.InvalidOutputCOSBucketUrl

Invalid OutputCOSBucketUrl.

InvalidParameterValue.InvalidOutputCOSKeyPrefix

Invalid OutputCOSKeyPrefix.

InvalidParameterValue.InvalidTimeFormat

Invalid time format.

InvalidParameterValue.InvalidUsername

Invalid username.

InvalidParameterValue.InvalidWorkingDirectory

Invalid command execution path.

InvalidParameterValue.InvokeTimeExpired

API invocation expired.

InvalidParameterValue.LackOfParameterInfo

The custom parameter feature is enabled,
but custom parameters are missing.

InvalidParameterValue.LackOfParameters

Parameters not provided.

InvalidParameterValue.LimitExceeded

Parameter limit exceeded.

InvalidParameterValue.ParameterDisabled
InvalidParameterValue.ParameterInvalidJsonFormat
InvalidParameterValue.ParameterKeyContainsInvalidChar©2013-2022 Tencent Cloud. All rights reserved.

The custom parameter feature is notenabled.
The parameter is not a valid JSON string.
The parameter key contains invalidcharacters.

Page 157 of 158

Tencent Cloud Automation Tools

InvalidParameterValue.ParameterKeyDuplicatedDuplicate 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.Range

The parameter value is not in the valid
range.

InvalidParameterValue.SupportParametersOnlyIfEnableParameter

The custom parameter feature is notenabled.

InvalidParameterValue.TooLong

Length limit exceeded.

LimitExceeded.FilterValueExceeded

Too many Filter values.

ResourceNotFound.CommandNotFoundThe command does not exist.

ResourceNotFound.InstanceNotFoundThe instance does not exist.

ResourceNotFound.InvocationNotFoundNo execution activity found.

ResourceNotFound.RoleNotFoundThe role does not exist.

ResourceUnavailable.AgentNotInstalled

TAT Agent is not installed.

ResourceUnavailable.AgentStatusNotOnline

TAT Agent is offline.

ResourceUnavailable.CommandInExecuting

The command is being executed.

ResourceUnavailable.CommandInInvoker

The command has been bound to an
invoker.

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

UnauthorizedOperation.MFANotFound©2013-2022 Tencent Cloud. All rights reserved.

The Multi-factor authentication (MFA)
code expired.
Multi-factor authentication (MFA) does
not exist.

Page 158 of 158