For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/jen.gilbert/astro-base/ja/api/latest/usage-metering/update-a-usage-quota.md. A documentation index is available at /llms.txt.
Language
Datadog site

Update a usage quota

警告Note: This endpoint is in Preview and is subject to change. If you have any feedback, contact Datadog support.
PATCHhttps://api.datadoghq.com/api/v2/usage/quotas/{quota_namespace}/{id}https://api.us3.datadoghq.com/api/v2/usage/quotas/{quota_namespace}/{id}https://api.us5.datadoghq.com/api/v2/usage/quotas/{quota_namespace}/{id}https://api.datadoghq.eu/api/v2/usage/quotas/{quota_namespace}/{id}https://api.ap1.datadoghq.com/api/v2/usage/quotas/{quota_namespace}/{id}https://api.ap2.datadoghq.com/api/v2/usage/quotas/{quota_namespace}/{id}https://api.uk1.datadoghq.com/api/v2/usage/quotas/{quota_namespace}/{id}https://api.ddog-gov.com/api/v2/usage/quotas/{quota_namespace}/{id}https://api.us2.ddog-gov.com/api/v2/usage/quotas/{quota_namespace}/{id}

概要

Updates the supplied fields on a usage quota and leaves omitted fields unchanged. For an organization-wide quota, pending_usage_limit schedules a limit for the next usage period. The quota must belong to the caller's organization or one of its descendants, and its opaque identifier must belong to the requested quota namespace. Requires the billing_edit permission.

This endpoint requires the billing_edit permission.

OAuth apps require the billing_edit authorization scope to access this endpoint.

引数

パスパラメーター

名前
タイプ
説明
quota_namespace [required]
string

The product-specific namespace whose usage quotas are being managed.

id [required]
string

The opaque quota identifier returned by a previous list or create request. Clients must pass this value verbatim.

リクエスト

Body Data (required)

The usage quota fields to update. Omitting an attribute leaves its current value unchanged.

フィールド
タイプ
説明
data [required]
object

A usage quota resource to update.

応答

OK

Response containing a usage quota.

フィールド
タイプ
説明
data [required]
object

A usage quota resource.

コード例

Update a usage quota
# Path parameters
export quota_namespace="ai_credits"
export id="MTIzNB9haV9jcmVkaXRzH3VzZXJfaGFuZGxlOl9fQUxMX18"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/usage/quotas/${quota_namespace}/${id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "enforced": false,
      "usage_limit": 120000
    },
    "id": "MTIzNB9haV9jcmVkaXRzH3VzZXJfaGFuZGxlOl9fQUxMX18",
    "type": "quotas"
  }
}
EOF
# Path parameters
export quota_namespace="ai_credits"
export id="MTIzNB9haV9jcmVkaXRzH3VzZXJfaGFuZGxlOl9fQUxMX18"

# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/usage/quotas/${quota_namespace}/${id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "enforced": false,
      "usage_limit": 120000
    },
    "id": "MTIzNB9haV9jcmVkaXRzH3VzZXJfaGFuZGxlOl9fQUxMX18",
    "type": "quotas"
  }
}
EOF
# Path parameters
export quota_namespace="ai_credits"
export id="MTIzNB9haV9jcmVkaXRzH3VzZXJfaGFuZGxlOl9fQUxMX18"

# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/usage/quotas/${quota_namespace}/${id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "enforced": false,
      "usage_limit": 120000
    },
    "id": "MTIzNB9haV9jcmVkaXRzH3VzZXJfaGFuZGxlOl9fQUxMX18",
    "type": "quotas"
  }
}
EOF
# Path parameters
export quota_namespace="ai_credits"
export id="MTIzNB9haV9jcmVkaXRzH3VzZXJfaGFuZGxlOl9fQUxMX18"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/usage/quotas/${quota_namespace}/${id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "enforced": false,
      "usage_limit": 120000
    },
    "id": "MTIzNB9haV9jcmVkaXRzH3VzZXJfaGFuZGxlOl9fQUxMX18",
    "type": "quotas"
  }
}
EOF
# Path parameters
export quota_namespace="ai_credits"
export id="MTIzNB9haV9jcmVkaXRzH3VzZXJfaGFuZGxlOl9fQUxMX18"

# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/usage/quotas/${quota_namespace}/${id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "enforced": false,
      "usage_limit": 120000
    },
    "id": "MTIzNB9haV9jcmVkaXRzH3VzZXJfaGFuZGxlOl9fQUxMX18",
    "type": "quotas"
  }
}
EOF
# Path parameters
export quota_namespace="ai_credits"
export id="MTIzNB9haV9jcmVkaXRzH3VzZXJfaGFuZGxlOl9fQUxMX18"

# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/usage/quotas/${quota_namespace}/${id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "enforced": false,
      "usage_limit": 120000
    },
    "id": "MTIzNB9haV9jcmVkaXRzH3VzZXJfaGFuZGxlOl9fQUxMX18",
    "type": "quotas"
  }
}
EOF
# Path parameters
export quota_namespace="ai_credits"
export id="MTIzNB9haV9jcmVkaXRzH3VzZXJfaGFuZGxlOl9fQUxMX18"

# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/usage/quotas/${quota_namespace}/${id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "enforced": false,
      "usage_limit": 120000
    },
    "id": "MTIzNB9haV9jcmVkaXRzH3VzZXJfaGFuZGxlOl9fQUxMX18",
    "type": "quotas"
  }
}
EOF
# Path parameters
export quota_namespace="ai_credits"
export id="MTIzNB9haV9jcmVkaXRzH3VzZXJfaGFuZGxlOl9fQUxMX18"

# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/usage/quotas/${quota_namespace}/${id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "enforced": false,
      "usage_limit": 120000
    },
    "id": "MTIzNB9haV9jcmVkaXRzH3VzZXJfaGFuZGxlOl9fQUxMX18",
    "type": "quotas"
  }
}
EOF
# Path parameters
export quota_namespace="ai_credits"
export id="MTIzNB9haV9jcmVkaXRzH3VzZXJfaGFuZGxlOl9fQUxMX18"

# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/usage/quotas/${quota_namespace}/${id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "enforced": false,
      "usage_limit": 120000
    },
    "id": "MTIzNB9haV9jcmVkaXRzH3VzZXJfaGFuZGxlOl9fQUxMX18",
    "type": "quotas"
  }
}
EOF