Put Trigger
- Print
- PDF
Put Trigger
- Print
- PDF
Article Summary
Share feedback
Thanks for sharing your feedback!
Available in Classic and VPC
Creates or edits Cloud Functions triggers.
Requests
Describes parameters, headers, and body information for the request.
Request URL
PUT {CLOUD_FUNCTIONS_API_URL}/triggers/{triggerName}
Content-Type: application/json; charset=utf-8
x-ncp-apigw-timestamp: {Timestamp}
x-ncp-iam-access-key: {Sub Account Access Key}
x-ncp-apigw-signature-v2: {API Gateway Signature}
Path Variables
Parameter name | Type | Required | Description | Service limits |
---|---|---|---|---|
triggerName | String | Y | Trigger name | Strings of up to 50 characters consisting of English letters, numbers, hyphens (-), and underscores (_) |
Request parameters
Request parameters are as follows:
Parameter name | Type | Required | Description | Service limits |
---|---|---|---|---|
platform | String | N | Platform type - options: vpc/classic - default: vpc | |
type | String | N | Trigger type - options: basic/cron/github/insight/iot/object_storage/source_commit - default: basic | Cannot change to a different type |
Request bodies
Common fields
Field name | Type | Required | Description | Service limits |
---|---|---|---|---|
description | String | N | Trigger description | Up to 3000 bytes |
parameters | Object | N | Trigger default parameter - JSON format. In the form of {"key" : "value"} - Parameter application priority when running an action ** #1: the runtime parameters delivered at time of running ** #2: the default parameters of the connected trigger ** #3: the default parameters of the action ** #4: the default parameters of the included package |
Basic trigger
See Common fields
Field name | Type | Required | Description | Service limits |
---|---|---|---|---|
link | Object[] | N | API Gateway information for creating external link address | |
link[].productName | String | Y | Product name of the API Gateway for creating external link address | |
link[].apiName | String | Y | API name of API Gateway for creating external link address | |
link[].stageName | String | Y | Stage name of the API Gateway for creating external link address | |
link[].authentication | String | N | Authentication method of API Gateway for creating external link address - options: NONE/IAM - default: IAM |
Cron trigger
See Common fields
Field name | Type | Required | Description | Service limits |
---|---|---|---|---|
cronOption | String | Y | Cron execution options | See Cron trigger execution option |
GitHub trigger
See Common fields
Field name | Type | Required | Description | Service limits |
---|---|---|---|---|
credential | Object | Y | GitHub information | |
credential.username | String | Y | GitHub username | |
credential.accessToken | String | Y | GitHub access token | |
credential.repository | String | Y | GitHub repository | Must be written in the "repository name" or "Organization/repository name" format, not the URL format |
events | String[] | Y | Types of events to be triggered - options: "*", "check_run", "check_suite", "commit_comment", "create", "delete", "deployment", "deployment_status", "fork", "gollum", "issue_comment", "issues", "label", "member", "milestone", "page_build", "project_card", "project_column", "project", "public", "pull_request_review_comment", "pull_request_review_thread", "pull_request_review", "pull_request", "push", "repository", "repository_import", "repository_vulnerability_alert", "release", "status", "team_add", "watch", "branch_protection_rule", "code_scanning_alert", "deploy_key", "discussion_comment", "discussion", "meta", "package", "registry_package", "release", "secret_scanning_alert_location", "secret_scanning_alert", "security_and_analysis", "star", "workflow_job", "workflow_run" | |
link | Object | - | API Gateway information for creating external link address | - Creation: required - Edit: no change/addition/deletion allowed |
link.productName | String | Y | Product name of the API Gateway for creating external link address | |
link.apiName | String | Y | API name of the API Gateway for creating external link address | |
link.stageName | String | Y | Stage name of the API Gateway for creating external link address |
Cloud Insight trigger
See Common fields
Field name | Type | Required | Description | Service limits |
---|---|---|---|---|
insightLink | Object[] | N | Information on the Cloud Insight Event Rule to connect | |
insightLink[].prodKey | String | Y | prodKey of Cloud Insight Event Rule | |
insightLink[].ruleGrpId | String | Y | ruleGrpId of Cloud Insight Event Rule | |
insightLink[].reminderTime | Integer | N | Reminder notification cycle (in minutes) of Cloud Insight Event Rule - options: 5 ~ 720 | |
insightLink[].enableNotiWhenEventClose | Boolean | N | Whether to call Cloud Insight Event Rule when the event ends - default: false |
Cloud IoT Core trigger
See Common fields
Field name | Type | Required | Description | Service limits |
---|---|---|---|---|
iotLink | Object[] | N | Information on the Cloud IoT Core rule to connect | |
iotLink[].ruleName | String | Y | Name of the Cloud IoT Core rule | |
iotLink[].type | String | N | Action type of the Cloud IoT Core rule - options: M (action) - default: M |
Object Storage trigger
Caution
If the action connected to the object storage trigger uses the same bucket as the object storage event rule, increased usage and excessive costs may occur due to recursive calls.
See Common fields
Field name | Type | Required | Description | Service limits |
---|---|---|---|---|
objectStorageLink | Object[] | N | Information on the Object Storage Event Rule to connect | |
objectStorageLink[].bucketName | String | Y | Name of the Object Storage bucket | |
objectStorageLink[].eventRuleName | String | Y | Name of the Object Storage Event Rule |
SourceCommit trigger
Note
SourceCommit-type trigger is supported only for Korea Region and VPC platforms.
See Common fields
Field name | Type | Required | Description | Service limits |
---|---|---|---|---|
sourceCommitLink | Object[] | N | Webhook information of the SourceCommit repository to connect | |
sourceCommitLink[].enable | Boolean | N | Activation status of SourceCommit webhook - default: true | |
sourceCommitLink[].repositoryName | String | Y | Name of the SourceCommit repository | |
sourceCommitLink[].webhookName | String | Y | Name of the SourceCommit webhook |
Responses
Response bodies
Common fields
Field name | Type | Description | Note |
---|---|---|---|
content.name | String | Trigger name | |
content.resourceId | String | Trigger resource ID | |
content.triggerType | String | Trigger type | |
content.namespace | String | Namespace of the user | |
content.description | String | Trigger description | |
content.parameters | Object | Trigger default parameter | |
content.rules | Object | Connection information of the trigger action |
Basic trigger
See Common fields
Cron trigger
See Common fields
Field name | Type | Description | Note |
---|---|---|---|
content.cronOption | String | Cron execution options |
GitHub trigger
See Common fields
Field name | Type | Description | Note |
---|---|---|---|
content.credential | Object | GitHub information | |
content.credential.username | String | GitHub username | |
content.credential.accessToken | String | GitHub access token | |
content.credential.repository | String | GitHub repository | |
content.events | String[] | Types of events to be triggered |
Cloud Insight trigger
See Common fields
Field name | Type | Description | Note |
---|---|---|---|
content.credential | Object | GitHub information | |
content.insightLink | Object[] | Information on the connected Cloud Insight Event Rule | |
content.insightLink[].prodKey | String | prodKey of the connected Cloud Insight Event Rule | |
content.insightLink[].ruleGrpId | String | ruleGrpld of the connected Cloud Insight Event Rule | |
content.insightLink[].reminderTime | Integer | Reminder notification cycle (in minutes) of the connected Cloud Insight Event Rule | |
content.insightLink[].enableNotiWhenEventClose | Boolean | Whether to call the connected Cloud Insight Event Rule when the event ends |
Cloud IoT Core trigger
See Common fields
Field name | Type | Description | Note |
---|---|---|---|
content.iotLink | Object[] | Connected Cloud IoT Core rule information | |
content.iotLink[].ruleName | String | Name of the connected Cloud IoT Core rule | |
content.iotLink[].type | String | Action type of the connected Cloud IoT Core rule |
Object Storage trigger
See Common fields
Field name | Type | Description | Note |
---|---|---|---|
content.objectStorageLink | Object[] | Information on the connected Object Storage Event Rule | |
content.objectStorageLink[].bucketName | String | Name of the connected Object Storage bucket | |
content.objectStorageLink[].eventRuleName | String | Name of the connected Object Storage Event Rule |
SourceCommit trigger
See Common fields
Field name | Type | Description | Note |
---|---|---|---|
content.sourceCommitLink | Object[] | Webhook information of the connected SourceCommit repository | |
content.sourceCommitLink[].enable | Boolean | Activation status of the connected SourceCommit webhook | |
content.sourceCommitLink[].repositoryName | String | Name of the connected SourceCommit repository | |
content.sourceCommitLink[].webhookName | String | Name of the connected SourceCommit webhook |
Errors
HTTP status code | Errors | Error message | Description |
---|---|---|---|
400 | 80500 | TRIGGER_INVALID_NAME | Invalid trigger name |
400 | 80502 | TRIGGER_PLATFORM_MISMATCH | Cannot change the trigger's platform |
400 | 80503 | TRIGGER_INVALID_TYPE | Invalid trigger type |
400 | 80504 | TRIGGER_TYPE_MISMATCH | Cannot change the trigger's type |
400 | 80505 | TRIGGER_BODY_INVALID_TYPE | Invalid request body field type |
400 | 80506 | TRIGGER_BODY_MISSING_FIELD | Required request body field omitted |
400 | 80507 | TRIGGER_BODY_INVALID_VALUE | Invalid request body field values |
400 | 80700 | NO_APIGW_SUBSCRIPTION | API Gateway service subscription required |
403 | 80002 | SUB_ACC_NO_PERMISSION | Detailed permission error |
422 | 80508 | TRIGGER_COUNT_EXCEED | Exceeded the maximum number of triggers |
- | 80005 | INTEGRATION_EXCEPTION | Integration service subscription required |
Examples
Request examples
curl -X PUT "https://cloudfunctions.apigw.ntruss.com/ncf/api/v2/triggers/mytrigger?platform=vpc&type=basic"
-H "Content-Type: application/json"
-H "x-ncp-iam-access-key: Y0Z9EG0lKoeWAQCSHRtM"
-H "x-ncp-apigw-timestamp: 1546398302273"
-H "x-ncp-apigw-signature-v2: VXjaLhHB2CdowCrqDNYg7w7GR3TYxZzM2eIZ+i3IH0Q="
-d '<See the following>'
{
"description" : "My trigger",
"parameters": {
"name": "Cloud Functions",
"place": "NCloud"
},
"link": [
{
"productName": "functions",
"apiName": "api",
"stageName": "v1",
"authentication": "IAM"
}
]
}
Response examples
{
"content": {
"description": "My trigger",
"name": "mytrigger",
"namespace": "kHbJQSZDDh3m",
"parameters": {
"name": "Cloud Functions",
"place": "NCloud"
},
"resourceId": "xWnct",
"rules": {},
"triggerType": "basic"
}
}
Was this article helpful?