- Print
- PDF
Put trigger
- Print
- PDF
Available in Classic and VPC
Create or edit a Cloud Functions trigger.
Request
The following describes the request format for the endpoint. The request format is as follows:
Method | URI |
---|---|
PUT | /triggers/{triggerName} |
Request headers
For headers common to all Cloud Functions APIs, see Cloud Functions common headers.
Request path parameters
The following describes the parameters.
Field | Type | Required | Description |
---|---|---|---|
triggerName | String | Required | Trigger name
|
Request query parameters
The following describes the parameters.
Field | Type | Required | Description |
---|---|---|---|
platform | String | Optional | Platform type
|
type | String | Optional | Trigger type
|
Request body
The following describes the request body.
Basic trigger
The following describes the request body for basic triggers.
Field | Type | Required | Description |
---|---|---|---|
trigger | Object | Required | Trigger information |
trigger.description | String | Optional | Trigger description (byte)
|
trigger.parameters | Object | Optional | Default parameters of the trigger
|
link | Object | Conditional | API Gateway information
|
link.productId | String | Conditional | API Gateway's product ID |
link.apiName | String | Conditional | API Gateway's API name |
link.stageName | String | Conditional | API Gateway's stage name |
link.authentication | String | Optional | API Gateway's authentication method
|
cron trigger
The following describes the request body for cron triggers.
Field | Type | Required | Description |
---|---|---|---|
trigger | Object | Required | Trigger information |
trigger.description | String | Optional | Trigger description (byte)
|
trigger.cronOption | String | Required | cron execution option |
trigger.parameters | Object | Optional | Default parameters of the trigger
|
GitHub trigger
The following describes the request body for GitHub triggers.
Field | Type | Required | Description |
---|---|---|---|
trigger | Object | Required | Trigger information |
trigger.description | String | Optional | Trigger description
|
trigger.parameters | Object | Optional | Default parameters of the trigger
|
trigger.credentials.username | String | Required | GitHub user name |
trigger.credentials.accessToken | String | Required | GitHub access token |
trigger.credentials.repository | String | Required | GitHub repository
|
trigger.events | Array | Required | Event to trigger
|
link | Object | Conditional | API Gateway information
|
link.productId | String | Conditional | API Gateway's product ID |
link.apiName | String | Conditional | API Gateway API name |
link.stageName | String | Conditional | API Gateway's stage name |
Cloud Insight trigger
The following describes the request body for Cloud Insight triggers.
Field | Type | Required | Description |
---|---|---|---|
trigger | Object | Required | Trigger information |
trigger.description | String | Optional | Trigger description (byte)
|
trigger.parameters | Object | Optional | Default parameters of the trigger
|
trigger.insightLink | Object[] | Required | Cloud Insight information |
trigger.insightLink[].prodKey | String | Required | Cloud Insight event rule's prodKey |
trigger.insightLink[].ruleGrpId | String | Required | Cloud Insight event rule's prodKey |
trigger.insightLink[].reminderTime | Integer | Optional | Reminder notification interval for Cloud Insight event rules (minutes)
|
trigger.insightLink[].enableNotiWhenEventClose | Boolean | Optional | Whether to call Cloud Insight event rules at the end of an event
|
Cloud IoT Core trigger
The following describes the request body for Cloud IoT Core triggers.
Field | Type | Required | Description |
---|---|---|---|
trigger | Object | Required | Trigger information |
trigger.description | String | Optional | Trigger description (byte)
|
trigger.parameters | Object | Optional | Default parameters of the trigger
|
trigger.iotLink | Object[] | Required | Cloud IoT Core information |
trigger.iotLink[].ruleName | String | Required | Cloud IoT Core rule's name |
Object Storage trigger
The following describes the request body for Object Storage triggers.
If an action attached to an Object Storage trigger uses the same bucket as an Object Storage event rule, recursive calls can result in increased usage and excessive costs.
Field | Type | Required | Description |
---|---|---|---|
trigger | Object | Required | Trigger information |
trigger.description | String | Optional | Trigger description (byte)
|
trigger.parameters | Object | Optional | Default parameters of the trigger
|
trigger.objectStorageLink | Object[] | Required | Object Storage information |
trigger.objectStorageLink[].bucketName | String | Required | Object Storage's bucket name |
trigger.objectStorageLink[].eventRuleName | String | Required | Object Storage's event rule name |
SourceCommit trigger
The following describes the request body for creating or editing SourceCommit triggers.
SourceCommit triggers are supported only on the VPC platform of the Korea Region.
Field | Type | Required | Description |
---|---|---|---|
trigger | Object | Required | Trigger information |
trigger.description | String | Optional | Trigger description (byte)
|
trigger.parameters | Object | Optional | Default parameters of the trigger
|
trigger.sourceCommitLink | Object[] | Required | SourceCommit information |
trigger.sourceCommitLink[].enable | Boolean | Optional | SourceCommit webhook activation status
|
trigger.sourceCommitLink[].repositoryName | String | Required | SourceCommit repository name |
trigger.sourceCommitLink[].webhookName | String | Required | SourceCommit webhook name |
Request example
The following is a sample request.
curl --location --request PUT 'https://cloudfunctions.apigw.ntruss.com/api/v2/triggers/trigger002?platform=vpc' \
--header 'Content-Type: application/json' \
--header 'x-ncp-apigw-timestamp: {Timestamp}' \
--header 'x-ncp-iam-access-key: {Sub Account Access Key}' \
--header 'x-ncp-apigw-signature-v2: {API Gateway Signature}' \
--data '<See below>'
{
"trigger": {
"description": "cron Trigger",
"cronOption": "0 10 * * *",
"parameters": {
}
}
}
Response
The following describes the response format.
Response body
The following describes the response body for requested triggers.
Basic trigger
The following describes the response body for basic triggers.
Field | Type | Description |
---|---|---|
content.name | String | Trigger name |
content.namespace | String | User namespace |
content.description | String | Description of the trigger |
content.triggerType | String | Trigger type |
content.resourceId | String | Trigger's resource ID |
content.parameters | Object | Default parameter of the trigger |
content.rules | String | Trigger action association information |
Cron trigger
The following describes the response body for Cron triggers.
Field | Type | Description |
---|---|---|
content.cronOptions | String | Trigger cron execution option |
content.description | String | Description of the trigger |
content.name | String | Trigger name |
content.namespace | String | User namespace |
content.parameters | Object | Default parameter of the trigger |
content.resourceId | String | Trigger's resource ID |
content.rules | String | Trigger action association information |
content.triggerType | String | Trigger type |
GitHub trigger
The following describes the response body for GitHub triggers.
Field | Type | Description |
---|---|---|
content.credentials | Object | Trigger GitHub integration information |
content.description | String | Description of the trigger |
content.events | String | Trigger's execution GitHub event option |
content.name | String | Trigger name |
content.namespace | String | User namespace |
content.parameters | Object | Default parameter of the trigger |
content.resourceId | String | - |
content.rules | String | Trigger action association information |
link.stageName | String | Trigger type |
Cloud Insight trigger
The following describes the response body for Cloud Insight triggers.
Field | Type | Description |
---|---|---|
content.description | String | Description of the trigger |
content.name | String | Trigger name |
content.namespace | String | User namespace |
content.parameters | Object | Default parameter of the trigger |
content.insightLink | Object[] | Connected Cloud Insight event rule information |
content.insightLink[].prodKey | String | Cloud Insight event rule's prodKey |
content.insightLink[].ruleGrpId | String | Cloud Insight event rule's groupId |
content.insightLink[].reminderTime | Integer | Reminder notification interval for Cloud Insight event rules (minutes) |
content.insightLink[].enableNotiWhenEventClose | Boolean | Whether to call Cloud Insight event rules at the end of an event |
content.resourceId | String | - |
content.rules | String | - |
content.triggerType | String | - |
Cloud IoT Core trigger
The following describes the response body for Cloud IoT Core triggers.
Field | Type | Description |
---|---|---|
content.description | String | Description of the trigger |
content.name | String | Trigger name |
content.namespace | String | User namespace |
content.parameters | Object | Default parameter of the trigger |
content.iotLink | Object[] | Connected Cloud IoT Core rule information |
content.iotLink[].ruleName | String | Cloud IoT Core rule name |
content.resourceId | String | Trigger's resource ID |
content.rules | String | Trigger action association information |
content.triggerType | String | Trigger type |
Object Storage trigger
The following describes the response body for Object Storage triggers.
Field | Type | Description |
---|---|---|
content.description | String | Description of the trigger |
content.name | String | Trigger name |
content.namespace | String | User namespace |
content.parameters | Object | Default parameter of the trigger |
content.objectStorageLink | Object[] | Connected Object Storage event rule information |
content.objectStorageLink[].bucketName | String | Object Storage event rule's bucket name |
content.objectStorageLink[].eventRuleName | String | Object Storage event rule name |
content.resourceId | String | Trigger's resource ID |
content.rules | String | Trigger action association information |
content.triggerType | String | Trigger type |
SourceCommit trigger
The following describes the response body for SourceCommit triggers.
Field | Type | Description |
---|---|---|
content.description | String | Description of the trigger |
content.name | String | Trigger name |
content.namespace | String | User namespace |
content.parameters | Object | Default parameter of the trigger |
content.sourceCommitLink | Object[] | Repository information of the connected SourceCommit |
content.sourceCommitLink[].enable | Boolean | SourceCommit webhook activation status |
content.sourceCommitLink[].repositoryName | String | SourceCommit repository name |
content.sourceCommitLink[].webhookName | String | Source Commit webhook name |
content.resourceId | String | Trigger's resource ID |
content.rules | String | Trigger action association information |
content.triggerType | String | Trigger type |
Response status codes
For response status codes common to NAVER Cloud Platform, see Ncloud API response status codes.
Response example
The following is a sample response.
{
"content": {
"cronOption": "0 10 * * *",
"description": "cron Trigger",
"limits": {},
"name": "trigger002",
"namespace": "****YBNz****",
"parameters": {},
"resourceId": "Nu3**",
"rules": {},
"triggerType": "Cron"
}
}