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.
The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.
Parameter Name | Required | Type | Description |
---|---|---|---|
Action | Yes | String | Common Params. The value used for this API: CreateInvoker. |
Version | Yes | String | Common Params. The value used for this API: 2020-10-28. |
Region | No | String | Common Params. This parameter is not required for this API. |
Name | Yes | String | Invoker name. |
Type | Yes | String | Invoker type. It can only be SCHEDULE (recurring invokers). |
CommandId | Yes | String | Remote command ID. |
InstanceIds.N | Yes | Array of String | ID of the instance bound to the trigger. Up to 100 IDs are allowed. |
Username | No | String | The user who executes the command. |
Parameters | No | String | Custom parameters of the command. |
ScheduleSettings | No | ScheduleSettings | Settings required for a recurring invoker. |
Parameter Name | Type | Description |
---|---|---|
InvokerId | String | Invoker ID. |
RequestId | String | The unique request ID, which is returned for each request. RequestId is required for locating a problem. |
Execute command cmd-m7uma92n on instance ins-yx05ky8j at 2021-09-01 00:00:00 UTC+8
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"
}
}
{
"Response": {
"RequestId": "97268137-e0f7-477d-833b-766273d0ea47",
"InvokerId": "ivk-le1g3x2h"
}
}
Execute command cmd-m7uma92n on instance ins-yx05ky8j at 00:00:00 UTC+8 on the first day of every month
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 * *"
}
}
{
"Response": {
"RequestId": "d1d7ce29-b6ac-436d-93e0-b454f096cc50",
"InvokerId": "ivk-n0t6rxtv"
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
Error Code | Description |
---|---|
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. |
ResourceNotFound.CommandNotFound | The command does not exist. |
ResourceNotFound.InstanceNotFound | The instance does not exist. |
ResourceUnavailable.AgentNotInstalled | TAT Agent is not installed. |
本页内容是否解决了您的问题?