Put Trigger
    • PDF

    Put Trigger

    • PDF

    Article Summary

    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 nameTypeRequiredDescriptionService limits
    triggerNameStringYTrigger nameStrings of up to 50 characters consisting of English letters, numbers, hyphens (-), and underscores (_)

    Request parameters

    Request parameters are as follows:

    Parameter nameTypeRequiredDescriptionService limits
    platformStringNPlatform type
    - options: vpc/classic
    - default: vpc
    typeStringNTrigger type
    - options: basic/cron/github/insight/iot/object_storage/source_commit
    - default: basic
    Cannot change to a different type

    Request bodies

    Common fields

    Field nameTypeRequiredDescriptionService limits
    descriptionStringNTrigger descriptionUp to 3000 bytes
    parametersObjectNTrigger 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 nameTypeRequiredDescriptionService limits
    linkObject[]NAPI Gateway information for creating external link address
    link[].productNameStringYProduct name of the API Gateway for creating external link address
    link[].apiNameStringYAPI name of API Gateway for creating external link address
    link[].stageNameStringYStage name of the API Gateway for creating external link address
    link[].authenticationStringNAuthentication method of API Gateway for creating external link address
    - options: NONE/IAM
    - default: IAM

    Cron trigger

    See Common fields

    Field nameTypeRequiredDescriptionService limits
    cronOptionStringYCron execution optionsSee Cron trigger execution option

    GitHub trigger

    See Common fields

    Field nameTypeRequiredDescriptionService limits
    credentialObjectYGitHub information
    credential.usernameStringYGitHub username
    credential.accessTokenStringYGitHub access token
    credential.repositoryStringYGitHub repositoryMust be written in the "repository name" or "Organization/repository name" format, not the URL format
    eventsString[]YTypes 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"
    linkObject-API Gateway information for creating external link address- Creation: required
    - Edit: no change/addition/deletion allowed
    link.productNameStringYProduct name of the API Gateway for creating external link address
    link.apiNameStringYAPI name of the API Gateway for creating external link address
    link.stageNameStringYStage name of the API Gateway for creating external link address

    Cloud Insight trigger

    See Common fields

    Field nameTypeRequiredDescriptionService limits
    insightLinkObject[]NInformation on the Cloud Insight Event Rule to connect
    insightLink[].prodKeyStringYprodKey of Cloud Insight Event Rule
    insightLink[].ruleGrpIdStringYruleGrpId of Cloud Insight Event Rule
    insightLink[].reminderTimeIntegerNReminder notification cycle (in minutes) of Cloud Insight Event Rule
    - options: 5 ~ 720
    insightLink[].enableNotiWhenEventCloseBooleanNWhether to call Cloud Insight Event Rule when the event ends
    - default: false

    Cloud IoT Core trigger

    See Common fields

    Field nameTypeRequiredDescriptionService limits
    iotLinkObject[]NInformation on the Cloud IoT Core rule to connect
    iotLink[].ruleNameStringYName of the Cloud IoT Core rule
    iotLink[].typeStringNAction 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 nameTypeRequiredDescriptionService limits
    objectStorageLinkObject[]NInformation on the Object Storage Event Rule to connect
    objectStorageLink[].bucketNameStringYName of the Object Storage bucket
    objectStorageLink[].eventRuleNameStringYName 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 nameTypeRequiredDescriptionService limits
    sourceCommitLinkObject[]NWebhook information of the SourceCommit repository to connect
    sourceCommitLink[].enableBooleanNActivation status of SourceCommit webhook
    - default: true
    sourceCommitLink[].repositoryNameStringYName of the SourceCommit repository
    sourceCommitLink[].webhookNameStringYName of the SourceCommit webhook

    Responses

    Response bodies

    Common fields

    Field nameTypeDescriptionNote
    content.nameStringTrigger name
    content.resourceIdStringTrigger resource ID
    content.triggerTypeStringTrigger type
    content.namespaceStringNamespace of the user
    content.descriptionStringTrigger description
    content.parametersObjectTrigger default parameter
    content.rulesObjectConnection information of the trigger action

    Basic trigger

    See Common fields

    Cron trigger

    See Common fields

    Field nameTypeDescriptionNote
    content.cronOptionStringCron execution options

    GitHub trigger

    See Common fields

    Field nameTypeDescriptionNote
    content.credentialObjectGitHub information
    content.credential.usernameStringGitHub username
    content.credential.accessTokenStringGitHub access token
    content.credential.repositoryStringGitHub repository
    content.eventsString[]Types of events to be triggered

    Cloud Insight trigger

    See Common fields

    Field nameTypeDescriptionNote
    content.credentialObjectGitHub information
    content.insightLinkObject[]Information on the connected Cloud Insight Event Rule
    content.insightLink[].prodKeyStringprodKey of the connected Cloud Insight Event Rule
    content.insightLink[].ruleGrpIdStringruleGrpld of the connected Cloud Insight Event Rule
    content.insightLink[].reminderTimeIntegerReminder notification cycle (in minutes) of the connected Cloud Insight Event Rule
    content.insightLink[].enableNotiWhenEventCloseBooleanWhether to call the connected Cloud Insight Event Rule when the event ends

    Cloud IoT Core trigger

    See Common fields

    Field nameTypeDescriptionNote
    content.iotLinkObject[]Connected Cloud IoT Core rule information
    content.iotLink[].ruleNameStringName of the connected Cloud IoT Core rule
    content.iotLink[].typeStringAction type of the connected Cloud IoT Core rule

    Object Storage trigger

    See Common fields

    Field nameTypeDescriptionNote
    content.objectStorageLinkObject[]Information on the connected Object Storage Event Rule
    content.objectStorageLink[].bucketNameStringName of the connected Object Storage bucket
    content.objectStorageLink[].eventRuleNameStringName of the connected Object Storage Event Rule

    SourceCommit trigger

    See Common fields

    Field nameTypeDescriptionNote
    content.sourceCommitLinkObject[]Webhook information of the connected SourceCommit repository
    content.sourceCommitLink[].enableBooleanActivation status of the connected SourceCommit webhook
    content.sourceCommitLink[].repositoryNameStringName of the connected SourceCommit repository
    content.sourceCommitLink[].webhookNameStringName of the connected SourceCommit webhook

    Errors

    HTTP status codeErrorsError messageDescription
    40080500TRIGGER_INVALID_NAMEInvalid trigger name
    40080502TRIGGER_PLATFORM_MISMATCHCannot change the trigger's platform
    40080503TRIGGER_INVALID_TYPEInvalid trigger type
    40080504TRIGGER_TYPE_MISMATCHCannot change the trigger's type
    40080505TRIGGER_BODY_INVALID_TYPEInvalid request body field type
    40080506TRIGGER_BODY_MISSING_FIELDRequired request body field omitted
    40080507TRIGGER_BODY_INVALID_VALUEInvalid request body field values
    40080700NO_APIGW_SUBSCRIPTIONAPI Gateway service subscription required
    40380002SUB_ACC_NO_PERMISSIONDetailed permission error
    42280508TRIGGER_COUNT_EXCEEDExceeded the maximum number of triggers
    -80005INTEGRATION_EXCEPTIONIntegration 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?

    What's Next
    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.