Put trigger
    • PDF

    Put trigger

    • PDF

    Article summary

    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:

    MethodURI
    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.

    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 | classic (default)
    typeStringOptionalTrigger type
    • basic (default) | cron | github | insight | iot | object_storage | source_commit
    • It can't be changed after creation

    Request body

    The following describes the request body.

    Basic trigger

    The following describes the request body for basic triggers.

    FieldTypeRequiredDescription
    triggerObjectRequiredTrigger information
    trigger.descriptionStringOptionalTrigger description (byte)
    • 0 - 3000
    trigger.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
    linkObjectConditionalAPI Gateway information
    • Valid only when creating a trigger, required
    link.productIdStringConditionalAPI Gateway's product ID
    link.apiNameStringConditionalAPI Gateway's API name
    link.stageNameStringConditionalAPI Gateway's stage name
    link.authenticationStringOptionalAPI Gateway's authentication method
    • NONE (default) | IAM

    cron trigger

    The following describes the request body for cron triggers.

    FieldTypeRequiredDescription
    triggerObjectRequiredTrigger information
    trigger.descriptionStringOptionalTrigger description (byte)
    • 0 - 3000
    trigger.cronOptionStringRequiredcron execution option
    trigger.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

    GitHub trigger

    The following describes the request body for GitHub triggers.

    FieldTypeRequiredDescription
    triggerObjectRequiredTrigger information
    trigger.descriptionStringOptionalTrigger description
    • 0 - 3000 bytes
    trigger.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
    trigger.credentials.usernameStringRequiredGitHub user name
    trigger.credentials.accessTokenStringRequiredGitHub access token
    trigger.credentials.repositoryStringRequiredGitHub repository
    • Enter the repository name or in the format of organization/repository name
    trigger.eventsArrayRequiredEvent 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, required
    link.productIdStringConditionalAPI Gateway's product ID
    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
    triggerObjectRequiredTrigger information
    trigger.descriptionStringOptionalTrigger description (byte)
    • 0 - 3000
    trigger.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
    trigger.insightLinkObject[]RequiredCloud Insight information
    trigger.insightLink[].prodKeyStringRequiredCloud Insight event rule's prodKey
    trigger.insightLink[].ruleGrpIdStringRequiredCloud Insight event rule's prodKey
    trigger.insightLink[].reminderTimeIntegerOptionalReminder notification interval for Cloud Insight event rules (minutes)
    • 5 - 720
    trigger.insightLink[].enableNotiWhenEventCloseBooleanOptionalWhether to call Cloud Insight event rules at the end of an event
    • true | false (default)

    Cloud IoT Core trigger

    The following describes the request body for Cloud IoT Core triggers.

    FieldTypeRequiredDescription
    triggerObjectRequiredTrigger information
    trigger.descriptionStringOptionalTrigger description (byte)
    • 0 - 3000
    trigger.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
    trigger.iotLinkObject[]RequiredCloud IoT Core information
    trigger.iotLink[].ruleNameStringRequiredCloud IoT Core rule's name

    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
    triggerObjectRequiredTrigger information
    trigger.descriptionStringOptionalTrigger description (byte)
    • 0 - 3000
    trigger.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
    trigger.objectStorageLinkObject[]RequiredObject Storage information
    trigger.objectStorageLink[].bucketNameStringRequiredObject Storage's bucket name
    trigger.objectStorageLink[].eventRuleNameStringRequiredObject Storage's event rule name

    SourceCommit trigger

    The following describes the request body for creating or editing SourceCommit triggers.

    Note

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

    FieldTypeRequiredDescription
    triggerObjectRequiredTrigger information
    trigger.descriptionStringOptionalTrigger description (byte)
    • 0 - 3000
    trigger.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
    trigger.sourceCommitLinkObject[]RequiredSourceCommit information
    trigger.sourceCommitLink[].enableBooleanOptionalSourceCommit webhook activation status
    • true (default) | false
      trigger.sourceCommitLink[].repositoryNameStringRequiredSourceCommit repository name
      trigger.sourceCommitLink[].webhookNameStringRequiredSourceCommit 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.

      FieldTypeDescription
      content.nameStringTrigger name
      content.namespaceStringUser namespace
      content.descriptionStringDescription of the trigger
      content.triggerTypeStringTrigger type
      content.resourceIdStringTrigger's resource ID
      content.parametersObjectDefault parameter of the trigger
      content.rulesStringTrigger action association information

      Cron trigger

      The following describes the response body for Cron triggers.

      FieldTypeDescription
      content.cronOptionsStringTrigger cron execution option
      content.descriptionStringDescription of the trigger
      content.nameStringTrigger name
      content.namespaceStringUser namespace
      content.parametersObjectDefault parameter of the trigger
      content.resourceIdStringTrigger's resource ID
      content.rulesStringTrigger action association information
      content.triggerTypeStringTrigger type

      GitHub trigger

      The following describes the response body for GitHub triggers.

      FieldTypeDescription
      content.credentialsObjectTrigger GitHub integration information
      content.descriptionStringDescription of the trigger
      content.eventsStringTrigger's execution GitHub event option
      content.nameStringTrigger name
      content.namespaceStringUser namespace
      content.parametersObjectDefault parameter of the trigger
      content.resourceIdString-
      content.rulesStringTrigger action association information
      link.stageNameStringTrigger type

      Cloud Insight trigger

      The following describes the response body for Cloud Insight triggers.

      FieldTypeDescription
      content.descriptionStringDescription of the trigger
      content.nameStringTrigger name
      content.namespaceStringUser namespace
      content.parametersObjectDefault parameter of the trigger
      content.insightLinkObject[]Connected Cloud Insight event rule information
      content.insightLink[].prodKeyStringCloud Insight event rule's prodKey
      content.insightLink[].ruleGrpIdStringCloud Insight event rule's groupId
      content.insightLink[].reminderTimeIntegerReminder notification interval for Cloud Insight event rules (minutes)
      content.insightLink[].enableNotiWhenEventCloseBooleanWhether to call Cloud Insight event rules at the end of an event
      content.resourceIdString-
      content.rulesString-
      content.triggerTypeString-

      Cloud IoT Core trigger

      The following describes the response body for Cloud IoT Core triggers.

      FieldTypeDescription
      content.descriptionStringDescription of the trigger
      content.nameStringTrigger name
      content.namespaceStringUser namespace
      content.parametersObjectDefault parameter of the trigger
      content.iotLinkObject[]Connected Cloud IoT Core rule information
      content.iotLink[].ruleNameStringCloud IoT Core rule name
      content.resourceIdStringTrigger's resource ID
      content.rulesStringTrigger action association information
      content.triggerTypeStringTrigger type

      Object Storage trigger

      The following describes the response body for Object Storage triggers.

      FieldTypeDescription
      content.descriptionStringDescription of the trigger
      content.nameStringTrigger name
      content.namespaceStringUser namespace
      content.parametersObjectDefault parameter of the trigger
      content.objectStorageLinkObject[]Connected Object Storage event rule information
      content.objectStorageLink[].bucketNameStringObject Storage event rule's bucket name
      content.objectStorageLink[].eventRuleNameStringObject Storage event rule name
      content.resourceIdStringTrigger's resource ID
      content.rulesStringTrigger action association information
      content.triggerTypeStringTrigger type

      SourceCommit trigger

      The following describes the response body for SourceCommit triggers.

      FieldTypeDescription
      content.descriptionStringDescription of the trigger
      content.nameStringTrigger name
      content.namespaceStringUser namespace
      content.parametersObjectDefault parameter of the trigger
      content.sourceCommitLinkObject[]Repository information of the connected SourceCommit
      content.sourceCommitLink[].enableBooleanSourceCommit webhook activation status
      content.sourceCommitLink[].repositoryNameStringSourceCommit repository name
      content.sourceCommitLink[].webhookNameStringSource Commit webhook name
      content.resourceIdStringTrigger's resource ID
      content.rulesStringTrigger action association information
      content.triggerTypeStringTrigger 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"
          }
      }
      

      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.