Available in Classic and VPC
Create or edit a Cloud Functions trigger.
Request
This section describes the request format. The method and URI are as follows:
| Method | URI |
|---|---|
| PUT | /api/v2/triggers/{triggerName} |
Request headers
For information about the headers common to all Cloud Functions APIs, see Cloud Functions request headers.
Request path parameters
You can use the following path parameters with your request:
| Field | Type | Required | Description |
|---|---|---|---|
triggerName |
String | Required | Trigger name
|
Request query parameters
You can use the following query parameters with your request:
| Field | Type | Required | Description |
|---|---|---|---|
platform |
String | Optional | Platform type
|
type |
String | Required | Trigger type
|
Request body
You can include the following data in the body of your request:
cron trigger
The following describes the request body for cron triggers.
| Field | Type | Required | Description |
|---|---|---|---|
trigger |
Object | Required | Information of the trigger |
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 | Information of the trigger |
trigger.description |
String | Optional | Trigger description
|
trigger.parameters |
Object | Optional | Default parameters of the trigger
|
trigger.credentials.username |
String | Required | GitHub username |
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 | Information of the trigger |
trigger.description |
String | Optional | Trigger description (byte)
|
trigger.parameters |
Object | Optional | Default parameters of the trigger
|
trigger.insightLink |
Array | Required | Cloud Insight information: insightLink |
insightLink
The following describes insightLink.
| Field | Type | Required | Description |
|---|---|---|---|
prodKey |
String | Required | Cloud Insight event rule's prodKey |
ruleGrpId |
String | Required | Cloud Insight event rule's ruleGrpId |
reminderTime |
Integer | Optional | Cloud Insight event rule's reminder notification frequency (minute)
|
enableNotiWhenEventClose |
Boolean | Optional | Whether to call Cloud Insight event rules at the end of an event
|
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 | Information of the trigger |
trigger.description |
String | Optional | Trigger description (byte)
|
trigger.parameters |
Object | Optional | Default parameters of the trigger
|
trigger.objectStorageLink |
Array | Required | Object Storage information: objectStorageLink |
objectStorageLink
The following describes objectStorageLink.
| Field | Type | Required | Description |
|---|---|---|---|
bucketName |
String | Required | Object Storage's bucket name |
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 | Information of the trigger |
trigger.description |
String | Optional | Trigger description (byte)
|
trigger.parameters |
Object | Optional | Default parameters of the trigger
|
trigger.sourceCommitLink |
Array | Required | SourceCommit information: sourceCommitLink |
sourceCommitLink
The following describes sourceCommitLink.
| Field | Type | Required | Description |
|---|---|---|---|
enable |
Boolean | Optional | Webhook activation status of SourceCommit
|
repositoryName |
String | Required | SourceCommit repository name |
webhookName |
String | Required | SourceCommit webhook name |
Request example
The request example is as follows:
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 '{
"trigger": {
"description": "cron Trigger",
"cronOption": "0 10 * * *",
"parameters": {
}
}
}'
Response
This section describes the response format.
Response body
The following describes the response body for requested triggers.
Cron trigger
The following describes the response body for Cron triggers.
| Field | Type | Required | Description |
|---|---|---|---|
content.cronOptions |
String | - | Trigger cron execution option |
content.description |
String | - | Trigger description |
content.name |
String | - | Trigger name |
content.namespace |
String | - | Namespace of the user |
content.parameters |
Object | - | Default parameters of the trigger |
content.resourceId |
String | - | Trigger's resource ID |
content.rules |
String | - | Trigger action connection information |
content.triggerType |
String | - | Trigger type |
GitHub trigger
The following describes the response body for GitHub triggers.
| Field | Type | Required | Description |
|---|---|---|---|
content.credentials |
Object | - | Trigger GitHub integration information |
content.description |
String | - | Trigger description |
content.events |
String | - | Trigger's execution GitHub event option |
content.name |
String | - | Trigger name |
content.namespace |
String | - | Namespace of the user |
content.parameters |
Object | - | Default parameters of the trigger |
content.resourceId |
String | - | Trigger's resource ID |
content.rules |
String | - | Trigger action connection information |
link.stageName |
String | - | Trigger type |
Cloud Insight trigger
The following describes the response body for Cloud Insight triggers.
| Field | Type | Required | Description |
|---|---|---|---|
content.description |
String | - | Trigger description |
content.name |
String | - | Trigger name |
content.namespace |
String | - | Namespace of the user |
content.parameters |
Object | - | Default parameters of the trigger |
content.insightLink |
Array | - | Event rule information of the connected Cloud Insight: insightLink |
content.resourceId |
String | - | Trigger's resource ID |
content.rules |
String | - | Trigger action connection information |
content.triggerType |
String | - | Trigger type |
insightLink
The following describes insightLink.
| Field | Type | Required | Description |
|---|---|---|---|
prodKey |
String | - | Cloud Insight event rule's prodKey |
ruleGrpId |
String | - | Cloud Insight event rule's groupId |
reminderTime |
Integer | - | Cloud Insight event rule's reminder notification frequency (minute) |
enableNotiWhenEventClose |
Boolean | - | Whether to call Cloud Insight event rules at the end of an event |
Object Storage trigger
The following describes the response body for Object Storage triggers.
| Field | Type | Required | Description |
|---|---|---|---|
content.description |
String | - | Trigger description |
content.name |
String | - | Trigger name |
content.namespace |
String | - | Namespace of the user |
content.parameters |
Object | - | Default parameters of the trigger |
content.objectStorageLink |
Array | - | Event rule information of the connected Object Storage: objectStorageLink |
content.resourceId |
String | - | Trigger's resource ID |
content.rules |
String | - | Trigger action connection information |
content.triggerType |
String | - | Trigger type |
objectStorageLink
The following describes objectStorageLink.
| Field | Type | Required | Description |
|---|---|---|---|
bucketName |
String | - | Object Storage event rule's bucket name |
eventRuleName |
String | - | Object Storage event rule name |
SourceCommit trigger
The following describes the response body for SourceCommit triggers.
| Field | Type | Required | Description |
|---|---|---|---|
content.description |
String | - | Trigger description |
content.name |
String | - | Trigger name |
content.namespace |
String | - | Namespace of the user |
content.parameters |
Object | - | Default parameters of the trigger |
content.sourceCommitLink |
Array | - | Repository information of the connected SourceCommit: sourceCommitLink |
content.resourceId |
String | - | Trigger's resource ID |
content.rules |
String | - | Trigger action connection information |
content.triggerType |
String | - | Trigger type |
sourceCommitLink
The following describes sourceCommitLink.
| Field | Type | Required | Description |
|---|---|---|---|
enable |
Boolean | - | SourceCommit webhook activation status |
repositoryName |
String | - | SourceCommit repository name |
webhookName |
String | - | SourceCommit webhook name |
Response status codes
For response status codes common to NAVER Cloud Platform, see Ncloud API response status codes.
Response example
The response example is as follows:
{
"content": {
"cronOption": "0 10 * * *",
"description": "cron Trigger",
"limits": {},
"name": "trigger002",
"namespace": "****YBNz****",
"parameters": {},
"resourceId": "Nu3**",
"rules": {},
"triggerType": "Cron"
}
}