CreateTrigger

Last updated: 2019-08-18 22:55:00

1. API Description

API request domain name: scf.tencentcloudapi.com.

The API creates a new trigger based on the input parameters.

Default API request frequency limit: 100 times/second.

2. Input Parameters

The following parameters are required for requesting this API, including action-specific parameters and common parameters. For more information about common parameters for all requests, see Common Request Parameters.

Parameter name Required Type Description
Action Yes String Common parameter; the name of this API: CreateTrigger
Version Yes String Common parameter; the version of this API: 2018-04-16
Region Yes String Common parameters; for details, see the Region List.
FunctionName Yes String Name of the function bound with the new trigger
TriggerName Yes String Name of the new trigger. For a timer trigger, the name supports up to 100 characters including letters, numbers, dashes and underscores; for other triggers, see the descriptions of parameters bound with the specific trigger
Type Yes String Type of the trigger; currently, COS, CMQ, timer and CKafka types are supported
TriggerDesc No String The parameter corresponding to the trigger. For a timer trigger, its content is a Linux cron expression; for other triggers, see the description of the specific trigger
Qualifier No String Version of the function

3. Output Parameters

Parameter name Type Description
RequestId String The ID of the request. Each request returns a unique ID. The RequestId is required to troubleshoot issues.

4. Sample

Creating a Trigger

You use this function to create a trigger.

Input Sample Code

https://scf.tencentcloudapi.com/?Action=CreateTrigger
&FunctionName=<FunctionName>
&TriggleName=<TriggerName>
&Type=timer
&TriggerDesc=*/2****
&<Common request parameter>

Output Sample Code

{
    "Response": {
        "RequestId": "eac6b301-a322-493a-8e36-83b295459397"
    }
}

5. Developer Resources

API Explorer

This tool provides various capabilities such as online call, signature verification, SDK code generation, and quick API retrieval that significantly reduce the difficulty of using TencentCloud API.

SDK

TencentCloud API 3.0 integrates software development toolkits (SDKs) that support various programming languages to make it easier for you to call the APIs.

TCCLI

6. Error Codes

The following error codes are API business logic-related. For other error codes, see Common Error Codes.

Error Code Description
InternalError.System Internal system error.
InvalidParameterValue An invalid value was declared for the input parameter.
InvalidParameterValue.Cdn An invalid value was declared for the input parameter: Cdn
InvalidParameterValue.Ckafka An invalid value was declared for the input parameter: CKafka
InvalidParameterValue.Cos An invalid value was declared for the input parameter: COS
InvalidParameterValue.TriggerDesc An invalid value was declared for the input parameter: TriggerDesc
InvalidParameterValue.TriggerName An invalid value was declared for the input parameter: TriggerName
InvalidParameterValue.Type An invalid value was declared for the input parameter: Type
LimitExceeded.Cdn CDN usage exceeds the upper limit.
LimitExceeded.FunctionOnTopic The number of functions under the same topic exceeds the upper limit.
LimitExceeded.Trigger The number of triggers exceeds the upper limit.
ResourceInUse.Cdn CDN is in use.
ResourceInUse.Cmq CMQ is in use.
ResourceInUse.Cos COS is in use.
ResourceNotFound.Cdn CDN does not exist.
ResourceNotFound.Ckafka CKafka does not exist.
ResourceNotFound.Cmq CMQ does not exist.
ResourceNotFound.Cos COS does not exist.
ResourceNotFound.FunctionName Function does not exist.
ResourceNotFound.FunctionVersion Function version does not exist.
UnauthorizedOperation.CAM CAM authentication failed.
UnsupportedOperation.Cdn CDN is not supported.
UnsupportedOperation.Cos COS operation is not supported.
UnsupportedOperation.Trigger Trigger operation is not supported.