For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/jen.gilbert/astro-base/es/api/latest/usage-metering/get-cost-across-multi-org-account.md. A documentation index is available at /llms.txt.
Language
Datadog site

Ver el coste de una cuenta multi-organización

GEThttps://api.datadoghq.com/api/v2/usage/cost_by_orghttps://api.us3.datadoghq.com/api/v2/usage/cost_by_orghttps://api.us5.datadoghq.com/api/v2/usage/cost_by_orghttps://api.datadoghq.eu/api/v2/usage/cost_by_orghttps://api.ap1.datadoghq.com/api/v2/usage/cost_by_orghttps://api.ap2.datadoghq.com/api/v2/usage/cost_by_orghttps://api.uk1.datadoghq.com/api/v2/usage/cost_by_orghttps://api.ddog-gov.com/api/v2/usage/cost_by_orghttps://api.us2.ddog-gov.com/api/v2/usage/cost_by_org

Descripción general

Obtén el coste a través de una cuenta de múltiples organizaciones. Los datos de costes por organización de un mes determinado estarán disponibles a más tardar el día 16 del mes siguiente. Nota: Este endpoint ha quedado obsoleto. Utiliza el nuevo endpoint /historical_cost en su lugar.

Este endpoint solo es accesible para organizaciones primarias.

This endpoint requires all of the following permissions:

  • usage_read
  • billing_read

OAuth apps require the usage_read, billing_read authorization scope to access this endpoint.

Argumentos

Cadenas de consulta

Nombre
Type
Descripción
start_month [required]
string

Datetime in ISO-8601 format, UTC, precise to month: [YYYY-MM] for cost beginning this month.

end_month
string

Datetime in ISO-8601 format, UTC, precise to month: [YYYY-MM] for cost ending this month.

Respuesta

OK

Chargeback Summary response.

Campo
Type
Descripción
data
[object]

Response containing Chargeback Summary.

Ejemplo de código

Ver el coste de una cuenta multi-organización
# Required query arguments
export start_month="CHANGE_ME"

# 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 GET "https://api.${DD_SITE}/api/v2/usage/cost_by_org?start_month=${start_month}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Required query arguments
export start_month="CHANGE_ME"

# 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 GET "https://api.${DD_SITE}/api/v2/usage/cost_by_org?start_month=${start_month}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Required query arguments
export start_month="CHANGE_ME"

# 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 GET "https://api.${DD_SITE}/api/v2/usage/cost_by_org?start_month=${start_month}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Required query arguments
export start_month="CHANGE_ME"

# 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 GET "https://api.${DD_SITE}/api/v2/usage/cost_by_org?start_month=${start_month}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Required query arguments
export start_month="CHANGE_ME"

# 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 GET "https://api.${DD_SITE}/api/v2/usage/cost_by_org?start_month=${start_month}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Required query arguments
export start_month="CHANGE_ME"

# 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 GET "https://api.${DD_SITE}/api/v2/usage/cost_by_org?start_month=${start_month}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Required query arguments
export start_month="CHANGE_ME"

# 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 GET "https://api.${DD_SITE}/api/v2/usage/cost_by_org?start_month=${start_month}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Required query arguments
export start_month="CHANGE_ME"

# 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 GET "https://api.${DD_SITE}/api/v2/usage/cost_by_org?start_month=${start_month}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Required query arguments
export start_month="CHANGE_ME"

# 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 GET "https://api.${DD_SITE}/api/v2/usage/cost_by_org?start_month=${start_month}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"