Usage Planの変更

Prev Next

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

ユーザーが指定した条件に基づいて Usage Planの情報を変更します。

リクエスト

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

メソッド URI
PUT /usage-plans/{usage-plan-id}

リクエストヘッダ

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

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

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

フィールド タイプ 必須の有無 説明
usage-plan-id String Required 変更対象のUsage Plan ID

リクエスト構文

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

{
    "monthQuotaRequest" : 6,
    "dayQuotaRequest" : 0,
    "usagePlanDescription" : "usagePlanDescription",
    "rateRps" : 1,
    "quotaCondition" : "quotaCondition",
    "usagePlanName" : "usagePlanName"
}

リクエストボディ

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

フィールド タイプ 必須の有無 説明
monthQuotaRequest Long Conditional 変更後の月別リクエスト処理限度(件/月)
  • 0~9,007,199,254,740,991
  • dayQuotaRequest入力時、必須
dayQuotaRequest Long Conditional 変更後の日別リクエスト処理限度(件/日)
  • 0~9,007,199,254,740,991
  • monthQuotaRequest入力時、必須
usagePlanDescription String Optional 変更後の Usage Planの説明
  • 0~50文字
rateRps Long Optional 変更後のリクエスト処理量(件/秒)
  • 1~2,147,483,647
quotaCondition String Optional 変更後の使用量制御条件
  • 2xx | 3xx | 4xx | 5xx | others
usagePlanName String Required 変更後の Usage Plan名
  • 0~45文字
  • 変更しない場合、既存の Usage Plan名を入力

リクエスト例

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

curl --location --request PUT 'https://apigateway.apigw.ntruss.com/api/v1/usage-plans/***wthl***' \
--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 '{
    "monthQuotaRequest": 15,
    "dayQuotaRequest": 10,
    "rateRps": 5,
    "quotaCondition": "2xx",
    "usagePlanDescription": "usageplan000",
    "usagePlanName": "usageplan000"
}'

レスポンス

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

レスポンス構文

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

{
    "usagePlan" : {
        "domainCode" : "domainCode",
        "usagePlanId" : "usagePlanId",
        "modifier" : "modifier",
        "associatedStagesCount" : 0,
        "dayQuotaRequest" : 6,
        "permission" : "permission",
        "rateRps" : 5,
        "usagePlanName" : "usagePlanName",
        "monthQuotaRequest" : 1,
        "tenantId" : "tenantId",
        "disabled" : true,
        "usagePlanDescription" : "usagePlanDescription",
        "quotaCondition" : "quotaCondition",
        "actionName" : "actionName"
    }
}

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

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

レスポンス例

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

{
    "usagePlan": {
        "tenantId": "***e230cebc1402ba89b148896951***",
        "usagePlanId": "***wthl***",
        "rateRps": 5,
        "usagePlanName": "usageplan000",
        "usagePlanDescription": "usageplan000",
        "dayQuotaRequest": 10,
        "quotaCondition" : "2xx",
        "monthQuotaRequest": 15,
        "domainCode": "PUB",
        "associatedStagesCount": 0
    }
}