For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/stefon.simmons/docs-astro-web-10435/ko/api/latest/usage-metering/create-or-update-usage-quotas.md. A documentation index is available at /llms.txt.
Language
Datadog site

사용량 쿼터 생성 또는 업데이트

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

개요

범위별로 하나 이상의 사용량 쿼터를 생성하거나 업데이트합니다. 제공된 범위에 대해 쿼터가 이미 존재하는 경우 업데이트되며, 그렇지 않으면 새 쿼터가 생성됩니다. user_access_manage, billing_edit 및 org_management 권한이 필요합니다.

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.

쿼리 문자열

이름
유형
설명
include_descendants
boolean

Whether to write every item in the request to the caller's organization and all of its descendant organizations, instead of only the caller's organization. Only descendants in the same datacenter are supported. For a user-handle scope, the quota is applied only to the caller's organization and to descendant organizations where that user handle exists; the item fails only if the handle exists in none of them.

Default: false

요청

Body Data (required)

생성하거나 업데이트할 사용량 쿼터입니다.

항목
유형
설명
data [required]
[object]

단일 리소스가 아닌 사용량 쿼터 리소스 배열을 포함하는 JSON:API 대량 요청입니다.

응답

OK. The response includes each item's result; see each item's error attribute for any that failed to write.

Response containing the result of a bulk usage quota create-or-update request. Returned with a 200 status regardless of whether individual items succeeded or failed; check each item's error attribute to determine its outcome.

항목
유형
설명
data [required]
[object]

The results of writing each usage quota in a bulk create-or-update request, in the same order as the request.

코드 예시

사용량 쿼터 생성 또는 업데이트
## Create or update quotas for the caller's organization.

# Path parameters
export quota_namespace="ai_credits"

# 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 POST "https://api.${DD_SITE}/api/v2/usage/quotas/${quota_namespace}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": [
    {
      "attributes": {
        "enforced": true,
        "scope": {
          "user_handle": "jane@example.com"
        },
        "usage_limit": 100000
      },
      "type": "quotas"
    },
    {
      "attributes": {
        "enforced": false,
        "scope": {
          "user_handle": "*"
        },
        "usage_limit": 250000
      },
      "type": "quotas"
    }
  ]
}
EOF

## Set a limit and schedule a reduction

# Path parameters
export quota_namespace="ai_credits"

# 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 POST "https://api.${DD_SITE}/api/v2/usage/quotas/${quota_namespace}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": [
    {
      "attributes": {
        "enforced": true,
        "pending_usage_limit": 100000,
        "usage_limit": 600000
      },
      "type": "quotas"
    }
  ]
}
EOF
## Create or update quotas for the caller's organization.

# Path parameters
export quota_namespace="ai_credits"

# 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 POST "https://api.${DD_SITE}/api/v2/usage/quotas/${quota_namespace}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": [
    {
      "attributes": {
        "enforced": true,
        "scope": {
          "user_handle": "jane@example.com"
        },
        "usage_limit": 100000
      },
      "type": "quotas"
    },
    {
      "attributes": {
        "enforced": false,
        "scope": {
          "user_handle": "*"
        },
        "usage_limit": 250000
      },
      "type": "quotas"
    }
  ]
}
EOF

## Set a limit and schedule a reduction

# Path parameters
export quota_namespace="ai_credits"

# 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 POST "https://api.${DD_SITE}/api/v2/usage/quotas/${quota_namespace}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": [
    {
      "attributes": {
        "enforced": true,
        "pending_usage_limit": 100000,
        "usage_limit": 600000
      },
      "type": "quotas"
    }
  ]
}
EOF
## Create or update quotas for the caller's organization.

# Path parameters
export quota_namespace="ai_credits"

# 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 POST "https://api.${DD_SITE}/api/v2/usage/quotas/${quota_namespace}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": [
    {
      "attributes": {
        "enforced": true,
        "scope": {
          "user_handle": "jane@example.com"
        },
        "usage_limit": 100000
      },
      "type": "quotas"
    },
    {
      "attributes": {
        "enforced": false,
        "scope": {
          "user_handle": "*"
        },
        "usage_limit": 250000
      },
      "type": "quotas"
    }
  ]
}
EOF

## Set a limit and schedule a reduction

# Path parameters
export quota_namespace="ai_credits"

# 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 POST "https://api.${DD_SITE}/api/v2/usage/quotas/${quota_namespace}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": [
    {
      "attributes": {
        "enforced": true,
        "pending_usage_limit": 100000,
        "usage_limit": 600000
      },
      "type": "quotas"
    }
  ]
}
EOF
## Create or update quotas for the caller's organization.

# Path parameters
export quota_namespace="ai_credits"

# 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 POST "https://api.${DD_SITE}/api/v2/usage/quotas/${quota_namespace}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": [
    {
      "attributes": {
        "enforced": true,
        "scope": {
          "user_handle": "jane@example.com"
        },
        "usage_limit": 100000
      },
      "type": "quotas"
    },
    {
      "attributes": {
        "enforced": false,
        "scope": {
          "user_handle": "*"
        },
        "usage_limit": 250000
      },
      "type": "quotas"
    }
  ]
}
EOF

## Set a limit and schedule a reduction

# Path parameters
export quota_namespace="ai_credits"

# 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 POST "https://api.${DD_SITE}/api/v2/usage/quotas/${quota_namespace}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": [
    {
      "attributes": {
        "enforced": true,
        "pending_usage_limit": 100000,
        "usage_limit": 600000
      },
      "type": "quotas"
    }
  ]
}
EOF
## Create or update quotas for the caller's organization.

# Path parameters
export quota_namespace="ai_credits"

# 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 POST "https://api.${DD_SITE}/api/v2/usage/quotas/${quota_namespace}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": [
    {
      "attributes": {
        "enforced": true,
        "scope": {
          "user_handle": "jane@example.com"
        },
        "usage_limit": 100000
      },
      "type": "quotas"
    },
    {
      "attributes": {
        "enforced": false,
        "scope": {
          "user_handle": "*"
        },
        "usage_limit": 250000
      },
      "type": "quotas"
    }
  ]
}
EOF

## Set a limit and schedule a reduction

# Path parameters
export quota_namespace="ai_credits"

# 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 POST "https://api.${DD_SITE}/api/v2/usage/quotas/${quota_namespace}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": [
    {
      "attributes": {
        "enforced": true,
        "pending_usage_limit": 100000,
        "usage_limit": 600000
      },
      "type": "quotas"
    }
  ]
}
EOF
## Create or update quotas for the caller's organization.

# Path parameters
export quota_namespace="ai_credits"

# 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 POST "https://api.${DD_SITE}/api/v2/usage/quotas/${quota_namespace}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": [
    {
      "attributes": {
        "enforced": true,
        "scope": {
          "user_handle": "jane@example.com"
        },
        "usage_limit": 100000
      },
      "type": "quotas"
    },
    {
      "attributes": {
        "enforced": false,
        "scope": {
          "user_handle": "*"
        },
        "usage_limit": 250000
      },
      "type": "quotas"
    }
  ]
}
EOF

## Set a limit and schedule a reduction

# Path parameters
export quota_namespace="ai_credits"

# 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 POST "https://api.${DD_SITE}/api/v2/usage/quotas/${quota_namespace}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": [
    {
      "attributes": {
        "enforced": true,
        "pending_usage_limit": 100000,
        "usage_limit": 600000
      },
      "type": "quotas"
    }
  ]
}
EOF
## Create or update quotas for the caller's organization.

# Path parameters
export quota_namespace="ai_credits"

# 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 POST "https://api.${DD_SITE}/api/v2/usage/quotas/${quota_namespace}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": [
    {
      "attributes": {
        "enforced": true,
        "scope": {
          "user_handle": "jane@example.com"
        },
        "usage_limit": 100000
      },
      "type": "quotas"
    },
    {
      "attributes": {
        "enforced": false,
        "scope": {
          "user_handle": "*"
        },
        "usage_limit": 250000
      },
      "type": "quotas"
    }
  ]
}
EOF

## Set a limit and schedule a reduction

# Path parameters
export quota_namespace="ai_credits"

# 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 POST "https://api.${DD_SITE}/api/v2/usage/quotas/${quota_namespace}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": [
    {
      "attributes": {
        "enforced": true,
        "pending_usage_limit": 100000,
        "usage_limit": 600000
      },
      "type": "quotas"
    }
  ]
}
EOF
## Create or update quotas for the caller's organization.

# Path parameters
export quota_namespace="ai_credits"

# 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 POST "https://api.${DD_SITE}/api/v2/usage/quotas/${quota_namespace}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": [
    {
      "attributes": {
        "enforced": true,
        "scope": {
          "user_handle": "jane@example.com"
        },
        "usage_limit": 100000
      },
      "type": "quotas"
    },
    {
      "attributes": {
        "enforced": false,
        "scope": {
          "user_handle": "*"
        },
        "usage_limit": 250000
      },
      "type": "quotas"
    }
  ]
}
EOF

## Set a limit and schedule a reduction

# Path parameters
export quota_namespace="ai_credits"

# 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 POST "https://api.${DD_SITE}/api/v2/usage/quotas/${quota_namespace}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": [
    {
      "attributes": {
        "enforced": true,
        "pending_usage_limit": 100000,
        "usage_limit": 600000
      },
      "type": "quotas"
    }
  ]
}
EOF
## Create or update quotas for the caller's organization.

# Path parameters
export quota_namespace="ai_credits"

# 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 POST "https://api.${DD_SITE}/api/v2/usage/quotas/${quota_namespace}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": [
    {
      "attributes": {
        "enforced": true,
        "scope": {
          "user_handle": "jane@example.com"
        },
        "usage_limit": 100000
      },
      "type": "quotas"
    },
    {
      "attributes": {
        "enforced": false,
        "scope": {
          "user_handle": "*"
        },
        "usage_limit": 250000
      },
      "type": "quotas"
    }
  ]
}
EOF

## Set a limit and schedule a reduction

# Path parameters
export quota_namespace="ai_credits"

# 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 POST "https://api.${DD_SITE}/api/v2/usage/quotas/${quota_namespace}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": [
    {
      "attributes": {
        "enforced": true,
        "pending_usage_limit": 100000,
        "usage_limit": 600000
      },
      "type": "quotas"
    }
  ]
}
EOF