MENU
      Stageメソッド設定を上書きする

        Stageメソッド設定を上書きする


        記事の要約

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

        指定した Stageのメソッド設定を新たに指定したメソッド設定で上書きします。

        リクエスト

        リクエスト形式を説明します。リクエスト形式は次の通りです。

        メソッドURI
        PATCH/products/{product-id}/apis/{api-id}/stages/{stage-id}/deployments/{deployment-no}/resources/{resource-id}/methods/{method-name}

        リクエストヘッダ

        API Gatewayで共通して使用されるヘッダの詳細は、API Gatewayのリクエストヘッダをご参照ください。

        リクエストパスパラメータ

        パラメータの説明は次の通りです。

        フィールドタイプ必須の有無説明
        product-idStringRequiredProduct ID
        api-idStringRequiredAPI ID
        stage-idStringRequiredStage ID
        deployment-noLongRequiredDeployment番号
        resource-idStringRequiredStageの Resource ID
        method-nameStringRequired設定を上書きする対象のメソッド
        • ANY | GET | POST | PUT | DELETE | PATCH | OPTIONS | HEAD

        リクエスト構文

        リクエスト構文は次の通りです。

        {
            "cacheTtlSec" : 0,
            "throttleRps" : 6,
            "isInherit" : true,
            "endpointDomain" : "endpointDomain"
        }
        JSON

        リクエストボディ

        リクエストボディの説明は次の通りです。

        フィールドタイプ必須の有無説明
        cacheTtlSecIntegerOptionalAPIキャッシュ TTL
        • 0~3600秒
        throttleRpsIntegerOptionalメソッド別1秒当たりのリクエスト数の限度
        • 0~2,147,483,647
        isInheritBooleanRequiredStage基本設定を遵守するかどうか
        • true | false
          • true: 遵守する
          • false: 遵守しない
        endpointDomainStringOptionalエンドポイントドメイン

        リクエスト例

        リクエストのサンプルコードは次の通りです。

        curl --location --request PATCH 'https://apigateway.apigw.ntruss.com/api/v1/products/***3kew***/apis/***hhdy***/stages/***sd32***/deployments/250***/resources/***uku7***/methods/GET' \
        --header 'x-ncp-apigw-timestamp: {Timestamp}' \
        --header 'x-ncp-iam-access-key: {Access Key}' \
        --header 'x-ncp-apigw-signature-v2: {API Gateway Signature}' \
        --header 'Content-Type: application/json' \
        --data '{
            "cacheTtlSec" : 0,
            "throttleRps" : 6,
            "isInherit" : true,
            "endpointDomain" : "https://test.****"
        }'
        Curl

        レスポンス

        レスポンス形式を説明します。

        レスポンス構文

        レスポンス構文は次の通りです。

        {
            "stageMethod" : {
                "resourceId" : "resourceId",
                "endpointCode" : "endpointCode",
                "resourcePath" : "resourcePath",
                "methodName" : "ANY",
                "isInherit" : true,
                "methodCode" : "methodCode",
                "endpointDomain" : "endpointDomain",
                "cacheTtlSec" : 0,
                "restUrl" : "restUrl",
                "throttleRps" : 1,
                "endpointActionId" : "endpointActionId",
                "invokeUrl" : "invokeUrl",
                "stageDeploymentNo" : 6,
                "endpointConfigJson" : "endpointConfigJson"
            }
        }
        JSON

        レスポンスステータスコード

        API Gatewayで共通して使用されるレスポンスステータスコードの詳細は、API Gatewayのレスポンスステータスコードをご参照ください。

        レスポンス例

        レスポンスのサンプルコードは次の通りです。

        {
          "stageMethod": {
            "stageDeploymentNo": 256366,
            "methodName": "PUT",
            "methodCode": "0003",
            "resourceId": "1lynl7fvad",
            "invokeUrl": "https://rl5qpeuk8w.apigw.ntruss.com/new_api/test/",
            "restUrl": "test - PUT /",
            "endpointCode": "0007",
            "endpointConfigJson": "{\"httpStatus\":200,\"response\":\"\",\"headers\":{}}",
            "isInherit": true
          }
        }
        JSON

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

        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.