メソッドの変更
    • PDF

    メソッドの変更

    • PDF

    記事の要約

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

    ユーザー定義したメソッドの設定を変更します。

    リクエスト

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

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

    リクエストヘッダ

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

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

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

    フィールドタイプ必須の有無説明
    product-idStringRequiredAPIが属する Product ID
    api-idStringRequired変更対象の API ID
    resource-idStringRequiredAPI内対象リソースの ID
    method-nameStringRequired対象メソッドのタイプ
    • ANY | GET | POST | PUT | DELETE | PATCH | OPTIONS | HEAD

    リクエスト構文

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

    {
      "methodDescription" : "methodDescription",
      "httpEndPoint" : {
        "method" : "ANY",
        "stream" : true,
        "url" : "url"
      },
      "mockEndPoint" : {
        "headers" : {
          "key" : "value"
        },
        "response" : "response",
        "httpStatus" : 0
      },
      "ncpEndPoint" : {
        "method" : "ANY",
        "stream" : true,
        "service" : "service",
        "actionId" : "actionId",
        "region" : "KR",
        "url" : "url",
        "actionName" : "actionName"
      },
      "requiredApiKey" : {
        "required" : true
      },
      "validation" : {
        "headers" : [ "headers" ],
        "queryStrings" : [ "queryStrings" ],
        "type" : "NONE"
      },
      "authentication" : {
        "authorizerId" : "authorizerId",
        "platform" : "NONE"
      }
    }
    

    リクエストボディ

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

    フィールドタイプ必須の有無説明
    methodDescriptionStringOptionalメソッドの説明
    • 0~300文字
    httpEndPointStringConditionalHTTP(S)エンドポイントの呼び出し結果を返すエンドポイントタイプ
    • mockEndPointncpEndPointhttpEndPointの中から択一
    httpEndPoint.methodStringConditionalバックエンドサーバにリクエストするメソッドタイプ
    • ANY | GET | POST | PUT | DELETE | PATCH | OPTIONS | HEAD
    • httpEndPointタイプ選択時、必ず入力
    httpEndPoint.streamBooleanConditionalStream機能の使用有無
    • true | false
      • true: Stream機能を使用。ファイルアップロードのようなリクエストの場合、使用。レスポンス時間は5分、リクエストサイズは最大100MBに制限。
      • false: Stream機能を使用しない。レスポンス時間は30秒、リクエストサイズは10MBに制限。
    • httpEndPointタイプ選択時、必ず入力
    httpEndPoint.urlStringConditionalバックエンドサーバにリクエストする URLパス
    • ドメインを除く
    • リソースパス変数とリクエストパラメータで定義したクエリ文字列とヘッドを使用可能。使用時は「{}」を使って定義。
    • 1~1500文字
    • httpEndPointタイプ選択時、必ず入力
    mockEndPointStringConditionalAPI Gatewayで設定した値を返すエンドポイントタイプ
    • mockEndPointncpEndPointhttpEndPointの中から択一
    mockEndPoint.httpStatusIntegerConditionalレスポンスステータスコード
    • mockEndPointタイプ選択時、必ず入力
    • HTTPの Response Status Codeに対応する値
    mockEndPoint.headersMap<String、String>Optionalレスポンスに含めるヘッダ
    • ヘッダ Key、Value形式
    mockEndPoint.responseStringOptionalレスポンスに表示するデータ
    • 0~1500文字
    ncpEndPointStringConditionalNAVERクラウドプラットフォームのサービスを利用して値を返すエンドポイントタイプ
    • mockEndPointncpEndPointhttpEndPointの中から択一
    ncpEndPoint.serviceStringConditionalレスポンスの返しに使用する NAVERクラウドプラットフォームのサービス
    • Cloud Functionsサービスを利用可能
    • ncpEndPointタイプ選択時、必ず入力
    ncpEndPoint.regionStringConditionalCloud Functionsサービスのサポートリージョンコード
    • KR | JPN | SGN
    • ncpEndPointタイプ選択時、必ず入力
    ncpEndPoint.actionIdStringConditionalCloud Functionsサービスのアクション ID
    • ncpEndPointタイプ選択時、必ず入力
    ncpEndPoint.actionNameStringConditionalCloud Functionsサービスのアクション名
    • ncpEndPointタイプ選択時、必ず入力
    ncpEndPoint.urlStringConditionalCloud Functionsサービスの URLパス
    • ncpEndPointタイプ選択時、必ず入力
    ncpEndPoint.methodStringOptionalCloud Functionsサービスでリクエストするメソッドタイプ
    • ANY | GET | POST | PUT | DELETE | PATCH | OPTIONS | HEAD
    ncpEndPoint.streamBooleanConditionalStream機能の使用有無
    • true | false
      • true: Stream機能を使用
      • false: Stream機能を使用しない
    • ncpEndPointタイプ選択時、必ず入力
    requiredApiKeyStringRequiredAPI key使用情報
    requiredApiKey.requiredBooleanRequiredAPI keyの使用有無
    • true | false
      • true: API keyを使用
      • false: API keyを使用しない。Productサブスクリプション方法と Usage Planが適用されない
    validationStringRequired有効性検査情報
    validation.typeStringRequired有効性検査の範囲
    • NONE | QUERYSTRING_HEADERS
      • NONE: 有効性検査を実行しない
      • QUERYSTRING_HEADERS: クエリ文字列とヘッドの有効性検査を実行
    validation.headersList<String>Conditional有効性検査対象の必須ヘッダリスト
    • QUERYSTRING_HEADERS選択時、入力
    validation.queryStringsList<String>Conditional有効性検査対象の必須クエリ文字列リスト
    • QUERYSTRING_HEADERS選択時、入力
    authenticationStringRequired認証情報
    authentication.platformStringRequired認証方法の設定
    • NONE | IAM | AUTHORIZER
      • NONE: 認証を使用しない
      • IAM: NAVERクラウドプラットフォームが提供する IAM認証を使用
      • AUTHORIZER: 予め作成済みの Authorizerを使用
    authentication.authorizerIdStringConditional認証方法として Authorizerを使用する場合、その Authorizerの ID

    リクエスト例

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

    curl --location --request PATCH 'https://apigateway.apigw.ntruss.com/api/v1/products/********o9/apis/cvcohvd2xj/resources/p1hiuvmwv3/methods/OPTIONS' \
    --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 '{
      "mockEndPoint": {
        "httpStatus": 400,
        "response": "user error"
      },
        "authentication": {
        "platform": "NONE"
      },
      "requiredApiKey": {
        "required": true
      },
      "validation": {
        "type": "NONE"
      }
    }'
    

    レスポンス

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

    レスポンス構文

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

    {
      "method" : {
        "methodDescription" : "methodDescription",
        "resourceId" : "resourceId",
        "useBodyWhenFormData" : true,
        "modifier" : "modifier",
        "resourcePath" : "resourcePath",
        "methodName" : "ANY",
        "ncpEndPoint" : {
          "method" : "ANY",
          "stream" : true,
          "service" : "service",
          "actionId" : "actionId",
          "region" : "KR",
          "url" : "url",
          "actionName" : "actionName"
        },
        "requiredApiKey" : {
          "required" : true
        },
        "mockEndPoint" : {
          "headers" : {
            "key" : "headers"
          },
          "response" : "response",
          "httpStatus" : 0
        },
        "produces" : "produces",
        "tenantId" : "tenantId",
        "consumers" : "consumers",
        "apiId" : "apiId",
        "validation" : {
          "headers" : [ "headers" ],
          "queryStrings" : [ "queryStrings" ],
          "type" : "NONE"
        },
        "authentication" : {
          "authorizerId" : "authorizerId",
          "platform" : "NONE"
        },
        "httpEndPoint" : {
          "method" : "ANY",
          "stream" : true,
          "url" : "url"
        }
      }
    }
    

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

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

    レスポンス例

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

    {
      "method": {
        "apiId": "cvcohvd2xj",
        "resourceId": "p1hiuvmwv3",
        "methodName": "GET",
        "useBodyWhenFormData": false,
        "validation": {
          "type": "NONE"
        },
        "authentication": {
          "platform": "NONE"
        },
        "requiredApiKey": {
          "required": true
        },
        "mockEndPoint": {
          "httpStatus": 400,
          "response": "user error"
        },
        "tenantId": "********65ec41039ce6668c2058b8a9",
        "modifier": "********-7fcd-11ec-a6ba-246e9659184c"
      }
    }
    

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

    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.