Skip to content

Commit dea346e

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Clarify which usage API endpoints must be called using root org keys (#1946)
Co-authored-by: ci.datadog-api-spec <[email protected]> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
1 parent 4d0e4da commit dea346e

File tree

7 files changed

+54
-34
lines changed

7 files changed

+54
-34
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2024-04-19 13:48:50.974867",
8-
"spec_repo_commit": "d5fb4450"
7+
"regenerated": "2024-04-19 20:49:45.386499",
8+
"spec_repo_commit": "c3db9ec1"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-04-19 13:48:50.992732",
13-
"spec_repo_commit": "d5fb4450"
12+
"regenerated": "2024-04-19 20:49:45.403012",
13+
"spec_repo_commit": "c3db9ec1"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30958,7 +30958,10 @@ paths:
3095830958
- Usage Metering
3095930959
/api/v1/usage/billable-summary:
3096030960
get:
30961-
description: Get billable usage across your account.
30961+
description: 'Get billable usage across your account.
30962+
30963+
30964+
This endpoint is only accessible for [parent-level organizations](https://docs.datadoghq.com/account_management/multi_organization/).'
3096230965
operationId: GetUsageBillableSummary
3096330966
parameters:
3096430967
- description: 'Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]`
@@ -32489,7 +32492,10 @@ paths:
3248932492
- Usage Metering
3249032493
/api/v1/usage/summary:
3249132494
get:
32492-
description: Get all usage across your account.
32495+
description: 'Get all usage across your account.
32496+
32497+
32498+
This endpoint is only accessible for [parent-level organizations](https://docs.datadoghq.com/account_management/multi_organization/).'
3249332499
operationId: GetUsageSummary
3249432500
parameters:
3249532501
- description: 'Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]`
@@ -33568,8 +33574,6 @@ tags:
3356833574

3356933575
This API is available to all Pro and Enterprise customers.
3357033576

33571-
Usage is only accessible for [parent-level organizations](https://docs.datadoghq.com/account_management/multi_organization/).
33572-
3357333577

3357433578
**Note**: Usage data is delayed by up to 72 hours from when it was incurred.
3357533579

.generator/schemas/v2/openapi.yaml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25314,7 +25314,8 @@ paths:
2531425314
end_month)\ncursor := response.metadata.pagination.next_record_id\nWHILE cursor
2531525315
!= null BEGIN\n sleep(5 seconds) # Avoid running into rate limit\n response
2531625316
:= GetMonthlyCostAttribution(start_month, end_month, next_record_id=cursor)\n
25317-
\ cursor := response.metadata.pagination.next_record_id\nEND\n```"
25317+
\ cursor := response.metadata.pagination.next_record_id\nEND\n```\n\nThis
25318+
endpoint is only accessible for [parent-level organizations](https://docs.datadoghq.com/account_management/multi_organization/)."
2531825319
operationId: GetMonthlyCostAttribution
2531925320
parameters:
2532025321
- description: 'Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]`
@@ -35214,7 +35215,10 @@ paths:
3521435215

3521535216
[`/historical_cost`](https://docs.datadoghq.com/api/latest/usage-metering/#get-historical-cost-across-your-account)
3521635217

35217-
instead.'
35218+
instead.
35219+
35220+
35221+
This endpoint is only accessible for [parent-level organizations](https://docs.datadoghq.com/account_management/multi_organization/).'
3521835222
operationId: GetCostByOrg
3521935223
parameters:
3522035224
- description: 'Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]`
@@ -35274,7 +35278,10 @@ paths:
3527435278

3527535279
and is delayed by up to 72 hours from when it was incurred.
3527635280

35277-
To access historical costs prior to this, use the `/historical_cost` endpoint.'
35281+
To access historical costs prior to this, use the `/historical_cost` endpoint.
35282+
35283+
35284+
This endpoint is only accessible for [parent-level organizations](https://docs.datadoghq.com/account_management/multi_organization/).'
3527835285
operationId: GetEstimatedCostByOrg
3527935286
parameters:
3528035287
- description: String to specify whether cost is broken down at a parent-org
@@ -35359,7 +35366,10 @@ paths:
3535935366
description: 'Get historical cost across multi-org and single root-org accounts.
3536035367

3536135368
Cost data for a given month becomes available no later than the 16th of the
35362-
following month.'
35369+
following month.
35370+
35371+
35372+
This endpoint is only accessible for [parent-level organizations](https://docs.datadoghq.com/account_management/multi_organization/).'
3536335373
operationId: GetHistoricalCostByOrg
3536435374
parameters:
3536535375
- description: String to specify whether cost is broken down at a parent-org
@@ -35671,7 +35681,8 @@ paths:
3567135681
Projected cost data is only available for the current month and becomes available
3567235682
around the 12th of the month.
3567335683

35674-
This endpoint requires the usage_read authorization scope.'
35684+
35685+
This endpoint is only accessible for [parent-level organizations](https://docs.datadoghq.com/account_management/multi_organization/).'
3567535686
operationId: GetProjectedCost
3567635687
parameters:
3567735688
- description: String to specify whether cost is broken down at a parent-org
@@ -36502,8 +36513,6 @@ tags:
3650236513

3650336514
This API is available to all Pro and Enterprise customers.
3650436515

36505-
Usage is only accessible for [parent-level organizations](https://docs.datadoghq.com/account_management/multi_organization/).
36506-
3650736516

3650836517
**Note**: Usage data is delayed by up to 72 hours from when it was incurred.
3650936518

src/datadog_api_client/v1/api/usage_metering_api.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ class UsageMeteringApi:
6363
The usage metering API allows you to get hourly, daily, and
6464
monthly usage across multiple facets of Datadog.
6565
This API is available to all Pro and Enterprise customers.
66-
Usage is only accessible for `parent-level organizations <https://docs.datadoghq.com/account_management/multi_organization/>`_.
6766
6867
**Note** : Usage data is delayed by up to 72 hours from when it was incurred.
6968
It is retained for 15 months.
@@ -1580,6 +1579,8 @@ def get_usage_billable_summary(
15801579
15811580
Get billable usage across your account.
15821581
1582+
This endpoint is only accessible for `parent-level organizations <https://docs.datadoghq.com/account_management/multi_organization/>`_.
1583+
15831584
:param month: Datetime in ISO-8601 format, UTC, precise to month: ``[YYYY-MM]`` for usage starting this month.
15841585
:type month: datetime, optional
15851586
:rtype: UsageBillableSummaryResponse
@@ -2142,6 +2143,8 @@ def get_usage_summary(
21422143
21432144
Get all usage across your account.
21442145
2146+
This endpoint is only accessible for `parent-level organizations <https://docs.datadoghq.com/account_management/multi_organization/>`_.
2147+
21452148
:param start_month: Datetime in ISO-8601 format, UTC, precise to month: ``[YYYY-MM]`` for usage beginning in this month.
21462149
Maximum of 15 months ago.
21472150
:type start_month: datetime

src/datadog_api_client/v2/api/usage_metering_api.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ class UsageMeteringApi:
3131
The usage metering API allows you to get hourly, daily, and
3232
monthly usage across multiple facets of Datadog.
3333
This API is available to all Pro and Enterprise customers.
34-
Usage is only accessible for `parent-level organizations <https://docs.datadoghq.com/account_management/multi_organization/>`_.
3534
3635
**Note** : Usage data is delayed by up to 72 hours from when it was incurred.
3736
It is retained for 15 months.
@@ -420,6 +419,8 @@ def get_cost_by_org(
420419
` ``/historical_cost`` <https://docs.datadoghq.com/api/latest/usage-metering/#get-historical-cost-across-your-account>`_
421420
instead.
422421
422+
This endpoint is only accessible for `parent-level organizations <https://docs.datadoghq.com/account_management/multi_organization/>`_.
423+
423424
:param start_month: Datetime in ISO-8601 format, UTC, precise to month: ``[YYYY-MM]`` for cost beginning this month.
424425
:type start_month: datetime
425426
:param end_month: Datetime in ISO-8601 format, UTC, precise to month: ``[YYYY-MM]`` for cost ending this month.
@@ -451,6 +452,8 @@ def get_estimated_cost_by_org(
451452
and is delayed by up to 72 hours from when it was incurred.
452453
To access historical costs prior to this, use the ``/historical_cost`` endpoint.
453454
455+
This endpoint is only accessible for `parent-level organizations <https://docs.datadoghq.com/account_management/multi_organization/>`_.
456+
454457
:param view: String to specify whether cost is broken down at a parent-org level or at the sub-org level. Available views are ``summary`` and ``sub-org``. Defaults to ``summary``.
455458
:type view: str, optional
456459
:param start_month: Datetime in ISO-8601 format, UTC, precise to month: ``[YYYY-MM]`` for cost beginning this month. Either start_month or start_date should be specified, but not both. (start_month cannot go beyond two months in the past). Provide an ``end_month`` to view month-over-month cost.
@@ -493,6 +496,8 @@ def get_historical_cost_by_org(
493496
Get historical cost across multi-org and single root-org accounts.
494497
Cost data for a given month becomes available no later than the 16th of the following month.
495498
499+
This endpoint is only accessible for `parent-level organizations <https://docs.datadoghq.com/account_management/multi_organization/>`_.
500+
496501
:param start_month: Datetime in ISO-8601 format, UTC, precise to month: ``[YYYY-MM]`` for cost beginning this month.
497502
:type start_month: datetime
498503
:param view: String to specify whether cost is broken down at a parent-org level or at the sub-org level. Available views are ``summary`` and ``sub-org``. Defaults to ``summary``.
@@ -610,6 +615,8 @@ def get_monthly_cost_attribution(
610615
cursor := response.metadata.pagination.next_record_id
611616
END
612617
618+
This endpoint is only accessible for `parent-level organizations <https://docs.datadoghq.com/account_management/multi_organization/>`_.
619+
613620
:param start_month: Datetime in ISO-8601 format, UTC, precise to month: ``[YYYY-MM]`` for cost beginning in this month.
614621
:type start_month: datetime
615622
:param end_month: Datetime in ISO-8601 format, UTC, precise to month: ``[YYYY-MM]`` for cost ending this month.
@@ -666,7 +673,8 @@ def get_projected_cost(
666673
667674
Get projected cost across multi-org and single root-org accounts.
668675
Projected cost data is only available for the current month and becomes available around the 12th of the month.
669-
This endpoint requires the usage_read authorization scope.
676+
677+
This endpoint is only accessible for `parent-level organizations <https://docs.datadoghq.com/account_management/multi_organization/>`_.
670678
671679
:param view: String to specify whether cost is broken down at a parent-org level or at the sub-org level. Available views are ``summary`` and ``sub-org``. Defaults to ``summary``.
672680
:type view: str, optional

tests/v1/features/usage_metering.feature

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@
22
Feature: Usage Metering
33
The usage metering API allows you to get hourly, daily, and monthly usage
44
across multiple facets of Datadog. This API is available to all Pro and
5-
Enterprise customers. Usage is only accessible for [parent-level organizat
6-
ions](https://docs.datadoghq.com/account_management/multi_organization/).
7-
**Note**: Usage data is delayed by up to 72 hours from when it was
8-
incurred. It is retained for 15 months. You can retrieve up to 24 hours
9-
of hourly usage data for multiple organizations, and up to two months of
10-
hourly usage data for a single organization in one request. Learn more on
11-
the [usage details documentation](https://docs.datadoghq.com/account_manag
12-
ement/billing/usage_details/).
5+
Enterprise customers. **Note**: Usage data is delayed by up to 72 hours
6+
from when it was incurred. It is retained for 15 months. You can retrieve
7+
up to 24 hours of hourly usage data for multiple organizations, and up to
8+
two months of hourly usage data for a single organization in one request.
9+
Learn more on the [usage details documentation](https://docs.datadoghq.com
10+
/account_management/billing/usage_details/).
1311

1412
Background:
1513
Given a valid "apiKeyAuth" key in the system

tests/v2/features/usage_metering.feature

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@
22
Feature: Usage Metering
33
The usage metering API allows you to get hourly, daily, and monthly usage
44
across multiple facets of Datadog. This API is available to all Pro and
5-
Enterprise customers. Usage is only accessible for [parent-level organizat
6-
ions](https://docs.datadoghq.com/account_management/multi_organization/).
7-
**Note**: Usage data is delayed by up to 72 hours from when it was
8-
incurred. It is retained for 15 months. You can retrieve up to 24 hours
9-
of hourly usage data for multiple organizations, and up to two months of
10-
hourly usage data for a single organization in one request. Learn more on
11-
the [usage details documentation](https://docs.datadoghq.com/account_manag
12-
ement/billing/usage_details/).
5+
Enterprise customers. **Note**: Usage data is delayed by up to 72 hours
6+
from when it was incurred. It is retained for 15 months. You can retrieve
7+
up to 24 hours of hourly usage data for multiple organizations, and up to
8+
two months of hourly usage data for a single organization in one request.
9+
Learn more on the [usage details documentation](https://docs.datadoghq.com
10+
/account_management/billing/usage_details/).
1311

1412
Background:
1513
Given a valid "apiKeyAuth" key in the system

0 commit comments

Comments
 (0)