MENU
      Put Trigger

        Put Trigger


        Article summary

        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:

        MethodURI
        PUT/triggers/{triggerName}

        Request headers

        For information about the headers common to all Cloud Funtions APIs, see Common Cloud Functions headers.

        Request path parameters

        The following describes the parameters.

        FieldTypeRequiredDescription
        triggerNameStringRequiredTrigger name
        • 1 to 50 characters, including English letters, numbers, and special characters "-" and "_", and it can't start with "-"
        • It can't be duplicated with other resource (package, action, trigger) names

        Request query parameters

        The following describes the parameters.

        FieldTypeRequiredDescription
        platformStringOptionalPlatform type
        • vpc (default) | classic
        typeStringRequiredTrigger type
        • cron | github | insight | object_storage | source_commit | secret_manager
        • Can't be changed after creation

        Request body

        You can include the following data in the body of your request: If there are no fields in the request body, it should be requested as {} empty JSON object.

        Common

        The following describes the common request body.

        FieldTypeRequiredDescription
        descriptionStringOptionalTrigger description (byte)
        • 0 - 3000
        parametersObjectOptionalDefault parameters of the trigger
        • JSON in the form of {"key": "value"}
        • Priority of applying parameters when running triggers
          • 1st priority: runtime parameters passed at runtime
          • 2nd priority: default parameters of connected triggers
          • 3rd priority: default parameters in actions
          • 4th priority: default parameters of included packages

        cron trigger

        The following describes the request body for cron triggers.

        FieldTypeRequiredDescription
        cronOptionStringRequiredcron execution option

        GitHub trigger

        The following describes the request body for GitHub triggers.

        FieldTypeRequiredDescription
        credentialObjectRequiredGitHub information
        credential.usernameStringRequiredGitHub username
        credential.accessTokenStringRequiredGitHub access token
        credential.repositoryStringRequiredGitHub repository
        • Enter the repository name or in the format organization/repository name
        eventsString[]RequiredEvent to trigger
        • * | 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 | secret_scanning_alert_location | secret_scanning_alert | security_and_analysis | star | workflow_job | workflow_run
        linkObjectConditionalAPI Gateway information
        • Valid only when creating a trigger and required
        link.productNameStringConditionalAPI Gateway's product name
        link.apiNameStringConditionalAPI Gateway API name
        link.stageNameStringConditionalAPI Gateway's stage name

        Cloud Insight trigger

        The following describes the request body for Cloud Insight triggers.

        FieldTypeRequiredDescription
        insightLinkObject[]OptionalEvent rule information of the Cloud Insight to connect
        insightLink[].prodKeyStringConditionalCloud Insight event rule's prodKey
        • Required when entering insightLink
        insightLink[].ruleGrpIdStringConditionalCloud Insight event rule's ruleGrpId
        • Required when entering insightLink
        insightLink[].reminderTimeIntegerOptionalCloud Insight event rule's reminder notification frequency (minute)
        • 5 - 720
        insightLink[].enableNotiWhenEventCloseBooleanOptionalWhether to call Cloud Insight event rules at the end of an event
        • true | false (default)

        Object Storage trigger

        The following describes the request body for Object Storage triggers.

        Caution

        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.

        FieldTypeRequiredDescription
        objectStorageLinkObject[]RequiredEvent rule information of the Object Storage to connect
        objectStorageLink[].bucketNameStringRequiredObject Storage's bucket name
        objectStorageLink[].eventRuleNameStringRequiredObject Storage's event rule name

        SourceCommit trigger

        The following describes the request body for SourceCommit triggers.

        Note

        SourceCommit triggers are supported only on the VPC platform of the Korea Region.

        FieldTypeRequiredDescription
        sourceCommitLinkObject[]RequiredWebhook information for the SourceCommit repository to connect
        sourceCommitLink[].enableBooleanOptionalWebhook activation status of SourceCommit
        • true (default) | false
        sourceCommitLink[].repositoryNameStringRequiredSourceCommit repository name
        sourceCommitLink[].webhookNameStringRequiredSourceCommit webhook name

        Secret Manager trigger

        The following describes the request body for Secret Manager triggers.

        Note
        • Secret Manager triggers are supported only on the VPC platform of the Korea Region.
        • A trigger can have multiple secrets associated with it, but only one trigger can be associated with a secret.
        FieldTypeDescription
        secretManagerLinkObject[]Required
        secretManagerLink[].secretNameStringRequired

        Request example

        The request example is as follows:

        curl --location --request PUT 'https://cloudfunctions.apigw.ntruss.com/ncf/api/v2/triggers/trigger001?platform=vpc&type=cron' \
        --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>'
        Curl
        {
            "description": "Cron Trigger",
            "parameters": {
                "period": "daily"
            },
            "cronOption": "30 1 * * *"
        }
        JSON

        Response

        This section describes the response format.

        Response body

        The response body includes the following data:

        Common

        The common response body includes the following data:

        FieldTypeDescription
        content.nameStringTrigger name
        content.resourceIdStringTrigger's resource ID
        content.triggerTypeStringTrigger type
        content.namespaceStringNamespace of the user
        content.descriptionStringTrigger description
        content.parametersObjectDefault parameters of the trigger
        content.rulesObjectTrigger action connection information

        cron trigger

        The following describes the response body for cron triggers.

        FieldTypeDescription
        content.cronOptionStringCron execution option

        GitHub trigger

        The following describes the response body for GitHub triggers.

        FieldTypeDescription
        content.credentialObjectGitHub information
        content.credential.usernameStringGitHub username
        content.credential.accessTokenStringTrigger type
        content.namespaceStringGitHub access token
        content.credential.repositoryStringGitHub repository
        content.eventsString[]Type of events to trigger

        Cloud Insight trigger

        The following describes the response body for Cloud Insight triggers.

        FieldTypeDescription
        content.insightLinkObject[]Event rule information of the connected Cloud Insight
        content.insightLink[].prodKeyStringCloud Insight event rule's prodKey
        content.insightLink[].ruleGrpIdStringCloud Insight event's ruleGrpId
        content.insightLink[].reminderTimeIntegerCloud Insight event's reminder notification frequency (minute)
        content.insightLink[].enableNotiWhenEventCloseBooleanWhether 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.

        FieldTypeDescription
        content.objectStorageLinkObject[]Event rule information of the connected Object Storage
        content.objectStorageLink[].bucketNameStringObject Storage's bucket name
        content.objectStorageLink[].eventRuleNameStringObject Storage's event rule name

        SourceCommit trigger

        The following describes the response body for SourceCommit triggers.

        FieldTypeDescription
        content.sourceCommitLinkObject[]Webhook information for the connected SourceCommit repository
        content.sourceCommitLink[].enableBooleanSourceCommit webhook activation status
        content.sourceCommitLink[].repositoryNameStringSourceCommit repository name
        content.sourceCommitLink[].webhookNameStringSourceCommit webhook name

        Secret Manager trigger

        The following describes the response body for Secret Manager triggers.

        FieldTypeDescription
        content.secretManagerLinkObject[]Connected Secret Manager secret information
        content.secretManagerLink[].secretIdStringSecret Manager's secret ID

        Response status codes

        The following describes the response status codes.

        HTTP status codeCodeMessageDescription
        40080500TRIGGER_INVALID_NAMEInvalid trigger name
        40080502TRIGGER_PLATFORM_MISMATCHTrigger's platform can't be changed
        40080503TRIGGER_INVALID_TYPEInvalid trigger type
        40080504TRIGGER_TYPE_MISMATCHTrigger type can't be changed
        40080505TRIGGER_BODY_INVALID_TYPEInvalid request body field type
        40080506TRIGGER_BODY_MISSING_FIELDMissing required fields in the request body
        40080507TRIGGER_BODY_INVALID_VALUEInvalid request body field value
        40080700NO_APIGW_SUBSCRIPTIONNeed to subscribe to API Gateway
        40080710NO_INSIGHT_SUBSCRIPTIONNeed to subscribe to Cloud Insight
        40080711INSIGHT_INVALID_EVENT_RULEInvalid Cloud Insight event rule information
        40080730NO_OBJECT_STORAGE_SUBSCRIPTIONNeed to subscribe to Object Storage
        40080731OBJECT_STORAGE_INVALID_EVENT_RULEInvalid Object Storage event rule information
        40080740SOURCE_COMMIT_INVALID_WEBHOOKInvalid SourceCommit webhook information
        40080750NO_SECRET_MANGER_SUBSCRIPTIONNeed to subscribe to Secret Manager
        40080751SECRET_MANAGER_INVALID_SECRETInvalid Secret Manager secret information
        40080752SECRET_MANAGER_SECRET_ROTATINGSecret Manager secret being replaced
        40380002SUB_ACC_NO_PERMISSIONDetailed permission error
        40980011RESOURCE_NAME_CONFLICTDuplicate resource name
        42280508TRIGGER_COUNT_EXCEEDMaximum number of triggers exceeded
        -80005INTEGRATION_EXCEPTIONNeed to subscribe to the integrated service

        Response example

        The response example is as follows:

        {
            "content": {
                "description": "",
                "name": "trigger001",
                "namespace": "****YBNz****",
                "parameters": {
                    "period": "daily"
                },
                "resourceId": "4ci**",
                "rules": {
                    "****YBNz****/qr98**: {
                        "action": {
                            "name": "action001",
                            "path": "****YBNz****"
                        },
                        "status": "active"
                },
                "triggerType": "cron"
            }
        }
        JSON

        Was this article helpful?

        Changing your password will log you out immediately. Use the new password to log back in.
        First name must have atleast 2 characters. Numbers and special characters are not allowed.
        Last name must have atleast 1 characters. Numbers and special characters are not allowed.
        Enter a valid email
        Enter a valid password
        Your profile has been successfully updated.