Put Trigger
    • PDF

    Put Trigger

    • PDF

    Article Summary

    Classic/VPC環境で利用できます。

    Cloud Functionsトリガーを作成、変更します。

    リクエスト

    リクエストのためのパラメータ、ヘッダ、ボディ情報について説明します。

    リクエスト 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

    パラメータ名タイプ必須有無説明制限事項
    triggerNameStringYトリガー名英数字、ハイフン(-)、アンダースコア(_)で構成された50字以内の文字列

    リクエストパラメータ

    リクエストパラメータは次の通りです。

    パラメータ名タイプ必須有無説明制限事項
    platformStringNプラットフォームタイプ
    - options: vpc/classic
    - default: vpc
    typeStringNトリガータイプ
    - options: basic/cron/github/insight/iot/object_storage/source_commit
    - default: basic
    他のタイプに変更不可

    リクエストボディ

    共通フィールド

    フィールド名タイプ必須有無説明制限事項
    descriptionStringNトリガーの説明最大3000byte
    parametersObjectNトリガーのデフォルトパラメータ
    - JSON形式。{"key" : "value"}の形式
    - アクション実行時のパラメータ適用優先順位
    ** 1位: 実行時点で伝達されるランタイムパラメータ
    ** 2位: 関連付けられたトリガーのデフォルトパラメータ
    ** 3位: アクションのデフォルトパラメータ
    ** 4位: 含まれるパッケージのデフォルトパラメータ

    Basicトリガー

    共通フィールドを参照

    フィールド名タイプ必須有無説明制限事項
    linkObject[]N外部アクセスアドレス作成用の API Gateway情報
    link[].productNameStringY外部アクセスアドレス作成用の API Gatewayの Product名
    link[].apiNameStringY外部アクセスアドレス作成用の API Gatewayの API名
    link[].stageNameStringY外部アクセスアドレス作成用の API Gatewayの Stage名
    link[].authenticationStringN外部アクセスアドレスを作成するための API Gatewayの認証方式
    - options: NONE/IAM
    - default: IAM

    Cronトリガー

    共通フィールドを参照

    フィールド名タイプ必須有無説明制限事項
    cronOptionStringYCron実行オプションCronトリガー実行オプションを参照

    GitHubトリガー

    共通フィールドを参照

    フィールド名タイプ必須有無説明制限事項
    credentialObjectYGitHub情報
    credential.usernameStringYGitHubユーザー名
    credential.accessTokenStringYGitHubアクセストークン
    credential.repositoryStringYGithubリポジトリURL形式ではなく「リポジトリ名」あるいは「Organization/リポジトリ名」形式で作成が必要
    eventsString[]Yトリガーするイベントの種類
    - 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情報- 作成: 必須
    - 変更: 変更/追加/削除不可
    link.productNameStringY外部アクセスアドレス作成用の API Gatewayの Product名
    link.apiNameStringY外部アクセスアドレス作成用の API Gatewayの API名
    link.stageNameStringY外部アクセスアドレス作成用の API Gatewayの Stage名

    Cloud Insightトリガー

    共通フィールドを参照

    フィールド名タイプ必須有無説明制限事項
    insightLinkObject[]N関連付ける Cloud Insight Event Rule情報
    insightLink[].prodKeyStringYCloud Insight Event Ruleの prodKey
    insightLink[].ruleGrpIdStringYCloud Insight Event Ruleの ruleGrpId
    insightLink[].reminderTimeIntegerNCloud Insight Event Ruleのリマインド通知周期(分単位)
    - options: 5 ~ 720
    insightLink[].enableNotiWhenEventCloseBooleanNCloud Insight Event Ruleの Event終了時の呼び出し有無
    - default: false

    Cloud IoT Coreトリガー

    共通フィールドを参照

    フィールド名タイプ必須有無説明制限事項
    iotLinkObject[]N関連付ける Cloud IoT Coreルール情報
    iotLink[].ruleNameStringYCloud IoT Coreルール名
    iotLink[].typeStringNCloud IoT Coreルールのアクションタイプ
    - options: M(アクション)
    - default: M

    Object Storageトリガー

    注意

    Object Storage Triggerに関連付けられたアクションが Object Storage Event Ruleと同じ Bucketを使用する場合、再帰呼び出しによる使用量の増加および過剰な請求が発生する可能性があります。

    共通フィールドを参照

    フィールド名タイプ必須有無説明制限事項
    objectStorageLinkObject[]N関連付ける Object Storage Event Ruleの情報
    objectStorageLink[].bucketNameStringYObject Storageの Bucket名
    objectStorageLink[].eventRuleNameStringYObject Storageの Event Rule名

    SourceCommitトリガー

    参考

    SourceCommitタイプトリガーは韓国リージョン、VPCプラットフォームのみサポートします。

    共通フィールドを参照

    フィールド名タイプ必須有無説明制限事項
    sourceCommitLinkObject[]N関連付ける SourceCommitリポジトリのウェブフック情報
    sourceCommitLink[].enableBooleanNSourceCommitウェブフックの有効化有無
    - default: true
    sourceCommitLink[].repositoryNameStringYSourceCommitのリポジトリ名
    sourceCommitLink[].webhookNameStringYSourceCommitのウェブフック名

    レスポンス

    レスポンスボディ

    共通フィールド

    フィールド名タイプ説明備考
    content.nameStringトリガー名
    content.resourceIdStringトリガー Resource ID
    content.triggerTypeStringトリガータイプ
    content.namespaceStringユーザーの名前空間
    content.descriptionStringトリガーの説明
    content.parametersObjectトリガーのデフォルトパラメータ
    content.rulesObjectトリガーアクションの関連付け情報

    Basicトリガー

    共通フィールドを参照

    Cronトリガー

    共通フィールドを参照

    フィールド名タイプ説明備考
    content.cronOptionStringCron実行オプション

    GitHubトリガー

    共通フィールドを参照

    フィールド名タイプ説明備考
    content.credentialObjectGitHub情報
    content.credential.usernameStringGitHubユーザー名
    content.credential.accessTokenStringGitHubアクセストークン
    content.credential.repositoryStringGithubリポジトリ
    content.eventsString[]トリガーするイベントの種類

    Cloud Insightトリガー

    共通フィールドを参照

    フィールド名タイプ説明備考
    content.credentialObjectGitHub情報
    content.insightLinkObject[]関連付けられた Cloud Insight Event Rule情報
    content.insightLink[].prodKeyString関連付けられた Cloud Insight Event Ruleの prodKey
    content.insightLink[].ruleGrpIdString関連付けられた Cloud Insight Event Ruleの ruleGrpId
    content.insightLink[].reminderTimeInteger関連付けられた Cloud Insight Event Ruleのリマインド通知周期(分単位)
    content.insightLink[].enableNotiWhenEventCloseBoolean関連付けられた Cloud Insight Event Ruleの Event終了時の呼び出し有無

    Cloud IoT Coreトリガー

    共通フィールドを参照

    フィールド名タイプ説明備考
    content.iotLinkObject[]関連付けられた Cloud IoT Coreルール情報
    content.iotLink[].ruleNameString関連付けられた Cloud IoT Coreルール名
    content.iotLink[].typeString関連付けられた Cloud IoT Coreルールのアクションタイプ

    Object Storageトリガー

    共通フィールドを参照

    フィールド名タイプ説明備考
    content.objectStorageLinkObject[]関連付けられた Object Storage Event Ruleの情報
    content.objectStorageLink[].bucketNameString関連付けられた Object Storageの Bucket名
    content.objectStorageLink[].eventRuleNameString関連付けられた Object storageの Event Rule名

    SourceCommitトリガー

    共通フィールドを参照

    フィールド名タイプ説明備考
    content.sourceCommitLinkObject[]関連付けられた SourceCommitリポジトリのウェブフック情報
    content.sourceCommitLink[].enableBoolean関連付けられた SourceCommitウェブフックの有効化有無
    content.sourceCommitLink[].repositoryNameString関連付けられた SourceCommitのリポジトリ名
    content.sourceCommitLink[].webhookNameString関連付けられた SourceCommitのウェブフック名

    エラーコード

    HTTP状態コードエラーコードエラーメッセージ説明
    40080500TRIGGER_INVALID_NAME不正なトリガー名
    40080502TRIGGER_PLATFORM_MISMATCHトリガーのプラットフォーム変更不可
    40080503TRIGGER_INVALID_TYPE不正なトリガータイプ
    40080504TRIGGER_TYPE_MISMATCHトリガーのタイプ変更不可
    40080505TRIGGER_BODY_INVALID_TYPE不正なリクエストボディのフィールドタイプ
    40080506TRIGGER_BODY_MISSING_FIELDリクエストボディの必須フィールド漏れ
    40080507TRIGGER_BODY_INVALID_VALUE不正なリクエストボディのフィールド値
    40080700NO_APIGW_SUBSCRIPTIONAPI Gatewayサービスご利用の申し込みが必要
    40380002SUB_ACC_NO_PERMISSION詳細権限エラー
    42280508TRIGGER_COUNT_EXCEED最大トリガー数超過
    -80005INTEGRATION_EXCEPTION連携サービスご利用の申し込みが必要

    リクエスト例

    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 '<下を参照>'
    
    {
        "description" : "My trigger",
        "parameters": {
            "name": "Cloud Functions",
            "place": "NCloud"
        },
        "link": [
            {
                "productName": "functions",
                "apiName": "api",
                "stageName": "v1",
                "authentication": "IAM"
            }
        ]
    }
    

    レスポンス例

    {
        "content": {
            "description": "My trigger",
            "name": "mytrigger",
            "namespace": "kHbJQSZDDh3m",
            "parameters": {
                "name": "Cloud Functions",
                "place": "NCloud"
            },
            "resourceId": "xWnct",
            "rules": {},
            "triggerType": "basic"
        }
    }
    

    この記事は役に立ちましたか?

    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.