Put Trigger
    • PDF

    Put Trigger

    • PDF

    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 | classic (default)
    typeStringRequiredTrigger type
    • cron | github | insight | object_storage | source_commit
    • Can't be changed after creation

    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.

    FieldTypeRequiredDescription
    triggerObjectRequiredInformation of the trigger
    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
    triggerObjectRequiredInformation of the trigger
    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 username
    trigger.credentials.accessTokenStringRequiredGitHub access token
    trigger.credentials.repositoryStringRequiredGitHub repository
    • Enter the repository name or in the format 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 and 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
    triggerObjectRequiredInformation of the trigger
    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 ruleGrpId
    trigger.insightLink[].reminderTimeIntegerOptionalCloud Insight event rule's reminder notification frequency (minute)
    • 5 - 720
    trigger.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
    triggerObjectRequiredInformation of the trigger
    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
    triggerObjectRequiredInformation of the trigger
    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[].enableBooleanOptionalWebhook activation status of SourceCommit
    • true (default) | false
      trigger.sourceCommitLink[].repositoryNameStringRequiredSourceCommit repository name
      trigger.sourceCommitLink[].webhookNameStringRequiredSourceCommit 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 '<See below>'
      
      {
          "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.

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

      GitHub trigger

      The following describes the response body for GitHub triggers.

      FieldTypeDescription
      content.credentialsObjectTrigger GitHub integration information
      content.descriptionStringTrigger description
      content.eventsStringTrigger's execution GitHub event option
      content.nameStringTrigger name
      content.namespaceStringNamespace of the user
      content.parametersObjectDefault parameters of the trigger
      content.resourceIdString-
      content.rulesStringTrigger action connection information
      link.stageNameStringTrigger type

      Cloud Insight trigger

      The following describes the response body for Cloud Insight triggers.

      FieldTypeDescription
      content.descriptionStringTrigger description
      content.nameStringTrigger name
      content.namespaceStringNamespace of the user
      content.parametersObjectDefault parameters of the trigger
      content.insightLinkObject[]Event rule information of the connected Cloud Insight
      content.insightLink[].prodKeyStringCloud Insight event rule's prodKey
      content.insightLink[].ruleGrpIdStringCloud Insight event rule's groupId
      content.insightLink[].reminderTimeIntegerCloud Insight event rule's reminder notification frequency (minute)
      content.insightLink[].enableNotiWhenEventCloseBooleanWhether to call Cloud Insight event rules at the end of an event
      content.resourceIdString-
      content.rulesString-
      content.triggerTypeString-

      Object Storage trigger

      The following describes the response body for Object Storage triggers.

      FieldTypeDescription
      content.descriptionStringTrigger description
      content.nameStringTrigger name
      content.namespaceStringNamespace of the user
      content.parametersObjectDefault parameters of the trigger
      content.objectStorageLinkObject[]Event rule information of the connected Object Storage
      content.objectStorageLink[].bucketNameStringObject Storage event rule's bucket name
      content.objectStorageLink[].eventRuleNameStringObject Storage event rule name
      content.resourceIdStringTrigger's resource ID
      content.rulesStringTrigger action connection information
      content.triggerTypeStringTrigger type

      SourceCommit trigger

      The following describes the response body for SourceCommit triggers.

      FieldTypeDescription
      content.descriptionStringTrigger description
      content.nameStringTrigger name
      content.namespaceStringNamespace of the user
      content.parametersObjectDefault parameters of the trigger
      content.sourceCommitLinkObject[]Repository information of the connected SourceCommit
      content.sourceCommitLink[].enableBooleanSourceCommit webhook activation status
      content.sourceCommitLink[].repositoryNameStringSourceCommit repository name
      content.sourceCommitLink[].webhookNameStringSourceCommit webhook name
      content.resourceIdStringTrigger's resource ID
      content.rulesStringTrigger action connection 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 response example is as follows:

      {
          "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.