Skip to content

Commit ec6d8b3

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 2920812 of spec repo
1 parent 88f36ac commit ec6d8b3

23 files changed

Lines changed: 398 additions & 1700 deletions

.generator/schemas/v1/openapi.yaml

Lines changed: 32 additions & 518 deletions
Large diffs are not rendered by default.

.generator/schemas/v2/openapi.yaml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69185,6 +69185,42 @@ components:
6918569185
usage_type:
6918669186
$ref: '#/components/schemas/HourlyUsageType'
6918769187
type: object
69188+
UsageAttributionTypesAttributes:
69189+
description: List of usage attribution types.
69190+
properties:
69191+
values:
69192+
description: List of usage attribution types.
69193+
items:
69194+
description: A given usage type in a list.
69195+
example: infra_host
69196+
type: string
69197+
type: array
69198+
type: object
69199+
UsageAttributionTypesBody:
69200+
description: Usage attribution types data.
69201+
properties:
69202+
attributes:
69203+
$ref: '#/components/schemas/UsageAttributionTypesAttributes'
69204+
id:
69205+
description: Unique ID of the response.
69206+
type: string
69207+
type:
69208+
$ref: '#/components/schemas/UsageAttributionTypesType'
69209+
type: object
69210+
UsageAttributionTypesResponse:
69211+
description: Usage attribution types response.
69212+
properties:
69213+
data:
69214+
$ref: '#/components/schemas/UsageAttributionTypesBody'
69215+
type: object
69216+
UsageAttributionTypesType:
69217+
default: usage_attribution_types
69218+
description: Type of usage attribution types data.
69219+
enum:
69220+
- usage_attribution_types
69221+
type: string
69222+
x-enum-varnames:
69223+
- USAGE_ATTRIBUTION_TYPES
6918869224
UsageDataObject:
6918969225
description: Usage data.
6919069226
properties:
@@ -107057,6 +107093,41 @@ paths:
107057107093
permissions:
107058107094
- usage_read
107059107095
- billing_read
107096+
/api/v2/usage/usage-attribution-types:
107097+
get:
107098+
description: Get usage attribution types.
107099+
operationId: GetUsageAttributionTypes
107100+
responses:
107101+
'200':
107102+
content:
107103+
application/json;datetime-format=rfc3339:
107104+
schema:
107105+
$ref: '#/components/schemas/UsageAttributionTypesResponse'
107106+
description: OK
107107+
'403':
107108+
content:
107109+
application/json;datetime-format=rfc3339:
107110+
schema:
107111+
$ref: '#/components/schemas/APIErrorResponse'
107112+
description: Forbidden - User is not authorized
107113+
'429':
107114+
content:
107115+
application/json;datetime-format=rfc3339:
107116+
schema:
107117+
$ref: '#/components/schemas/APIErrorResponse'
107118+
description: Too many requests
107119+
security:
107120+
- apiKeyAuth: []
107121+
appKeyAuth: []
107122+
- AuthZ:
107123+
- usage_read
107124+
summary: Get usage attribution types
107125+
tags:
107126+
- Usage Metering
107127+
x-permission:
107128+
operator: OR
107129+
permissions:
107130+
- usage_read
107060107131
/api/v2/user_invitations:
107061107132
post:
107062107133
description: Sends emails to one or more users inviting them to join the organization.

docs/datadog_api_client.v1.model.rst

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1369,13 +1369,6 @@ datadog\_api\_client.v1.model.hourly\_usage\_attribution\_response module
13691369
:members:
13701370
:show-inheritance:
13711371

1372-
datadog\_api\_client.v1.model.hourly\_usage\_attribution\_usage\_type module
1373-
----------------------------------------------------------------------------
1374-
1375-
.. automodule:: datadog_api_client.v1.model.hourly_usage_attribution_usage_type
1376-
:members:
1377-
:show-inheritance:
1378-
13791372
datadog\_api\_client.v1.model.http\_log module
13801373
----------------------------------------------
13811374

@@ -2685,13 +2678,6 @@ datadog\_api\_client.v1.model.monthly\_usage\_attribution\_response module
26852678
:members:
26862679
:show-inheritance:
26872680

2688-
datadog\_api\_client.v1.model.monthly\_usage\_attribution\_supported\_metrics module
2689-
------------------------------------------------------------------------------------
2690-
2691-
.. automodule:: datadog_api_client.v1.model.monthly_usage_attribution_supported_metrics
2692-
:members:
2693-
:show-inheritance:
2694-
26952681
datadog\_api\_client.v1.model.monthly\_usage\_attribution\_values module
26962682
------------------------------------------------------------------------
26972683

docs/datadog_api_client.v2.model.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30391,6 +30391,34 @@ datadog\_api\_client.v2.model.usage\_attributes\_object module
3039130391
:members:
3039230392
:show-inheritance:
3039330393

30394+
datadog\_api\_client.v2.model.usage\_attribution\_types\_attributes module
30395+
--------------------------------------------------------------------------
30396+
30397+
.. automodule:: datadog_api_client.v2.model.usage_attribution_types_attributes
30398+
:members:
30399+
:show-inheritance:
30400+
30401+
datadog\_api\_client.v2.model.usage\_attribution\_types\_body module
30402+
--------------------------------------------------------------------
30403+
30404+
.. automodule:: datadog_api_client.v2.model.usage_attribution_types_body
30405+
:members:
30406+
:show-inheritance:
30407+
30408+
datadog\_api\_client.v2.model.usage\_attribution\_types\_response module
30409+
------------------------------------------------------------------------
30410+
30411+
.. automodule:: datadog_api_client.v2.model.usage_attribution_types_response
30412+
:members:
30413+
:show-inheritance:
30414+
30415+
datadog\_api\_client.v2.model.usage\_attribution\_types\_type module
30416+
--------------------------------------------------------------------
30417+
30418+
.. automodule:: datadog_api_client.v2.model.usage_attribution_types_type
30419+
:members:
30420+
:show-inheritance:
30421+
3039430422
datadog\_api\_client.v2.model.usage\_data\_object module
3039530423
--------------------------------------------------------
3039630424

examples/v1/usage-metering/GetHourlyUsageAttribution.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@
66
from dateutil.relativedelta import relativedelta
77
from datadog_api_client import ApiClient, Configuration
88
from datadog_api_client.v1.api.usage_metering_api import UsageMeteringApi
9-
from datadog_api_client.v1.model.hourly_usage_attribution_usage_type import HourlyUsageAttributionUsageType
109

1110
configuration = Configuration()
1211
with ApiClient(configuration) as api_client:
1312
api_instance = UsageMeteringApi(api_client)
1413
response = api_instance.get_hourly_usage_attribution(
1514
start_hr=(datetime.now() + relativedelta(days=-3)),
16-
usage_type=HourlyUsageAttributionUsageType.INFRA_HOST_USAGE,
15+
usage_type="infra_host_usage",
1716
)
1817

1918
print(response)

examples/v1/usage-metering/GetMonthlyUsageAttribution.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,13 @@
66
from dateutil.relativedelta import relativedelta
77
from datadog_api_client import ApiClient, Configuration
88
from datadog_api_client.v1.api.usage_metering_api import UsageMeteringApi
9-
from datadog_api_client.v1.model.monthly_usage_attribution_supported_metrics import (
10-
MonthlyUsageAttributionSupportedMetrics,
11-
)
129

1310
configuration = Configuration()
1411
with ApiClient(configuration) as api_client:
1512
api_instance = UsageMeteringApi(api_client)
1613
response = api_instance.get_monthly_usage_attribution(
1714
start_month=(datetime.now() + relativedelta(days=-3)),
18-
fields=MonthlyUsageAttributionSupportedMetrics.INFRA_HOST_USAGE,
15+
fields="infra_host_usage",
1916
)
2017

2118
print(response)

examples/v1/usage-metering/GetMonthlyUsageAttribution_3849653599.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
from os import environ
88
from datadog_api_client import ApiClient, Configuration
99
from datadog_api_client.v1.api.usage_metering_api import UsageMeteringApi
10-
from datadog_api_client.v1.model.monthly_usage_attribution_supported_metrics import (
11-
MonthlyUsageAttributionSupportedMetrics,
12-
)
1310

1411
# there is a valid "monthly_usage_attribution" response
1512
MONTHLY_USAGE_ATTRIBUTION_METADATA_PAGINATION_NEXT_RECORD_ID = environ[
@@ -21,7 +18,7 @@
2118
api_instance = UsageMeteringApi(api_client)
2219
response = api_instance.get_monthly_usage_attribution(
2320
start_month=(datetime.now() + relativedelta(days=-3)),
24-
fields=MonthlyUsageAttributionSupportedMetrics.INFRA_HOST_USAGE,
21+
fields="infra_host_usage",
2522
next_record_id=MONTHLY_USAGE_ATTRIBUTION_METADATA_PAGINATION_NEXT_RECORD_ID,
2623
)
2724

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"""
2+
Get usage attribution types returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.usage_metering_api import UsageMeteringApi
7+
8+
configuration = Configuration()
9+
with ApiClient(configuration) as api_client:
10+
api_instance = UsageMeteringApi(api_client)
11+
response = api_instance.get_usage_attribution_types()
12+
13+
print(response)

src/datadog_api_client/v1/api/usage_metering_api.py

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
from datadog_api_client.v1.model.usage_fargate_response import UsageFargateResponse
3131
from datadog_api_client.v1.model.usage_hosts_response import UsageHostsResponse
3232
from datadog_api_client.v1.model.hourly_usage_attribution_response import HourlyUsageAttributionResponse
33-
from datadog_api_client.v1.model.hourly_usage_attribution_usage_type import HourlyUsageAttributionUsageType
3433
from datadog_api_client.v1.model.usage_incident_management_response import UsageIncidentManagementResponse
3534
from datadog_api_client.v1.model.usage_indexed_spans_response import UsageIndexedSpansResponse
3635
from datadog_api_client.v1.model.usage_ingested_spans_response import UsageIngestedSpansResponse
@@ -39,9 +38,6 @@
3938
from datadog_api_client.v1.model.usage_logs_by_retention_response import UsageLogsByRetentionResponse
4039
from datadog_api_client.v1.model.usage_logs_by_index_response import UsageLogsByIndexResponse
4140
from datadog_api_client.v1.model.monthly_usage_attribution_response import MonthlyUsageAttributionResponse
42-
from datadog_api_client.v1.model.monthly_usage_attribution_supported_metrics import (
43-
MonthlyUsageAttributionSupportedMetrics,
44-
)
4541
from datadog_api_client.v1.model.usage_network_flows_response import UsageNetworkFlowsResponse
4642
from datadog_api_client.v1.model.usage_network_hosts_response import UsageNetworkHostsResponse
4743
from datadog_api_client.v1.model.usage_online_archive_response import UsageOnlineArchiveResponse
@@ -137,7 +133,7 @@ def __init__(self, api_client=None):
137133
},
138134
"usage_type": {
139135
"required": True,
140-
"openapi_types": (HourlyUsageAttributionUsageType,),
136+
"openapi_types": (str,),
141137
"attribute": "usage_type",
142138
"location": "query",
143139
},
@@ -279,7 +275,7 @@ def __init__(self, api_client=None):
279275
},
280276
"fields": {
281277
"required": True,
282-
"openapi_types": (MonthlyUsageAttributionSupportedMetrics,),
278+
"openapi_types": (str,),
283279
"attribute": "fields",
284280
"location": "query",
285281
},
@@ -289,7 +285,7 @@ def __init__(self, api_client=None):
289285
"location": "query",
290286
},
291287
"sort_name": {
292-
"openapi_types": (MonthlyUsageAttributionSupportedMetrics,),
288+
"openapi_types": (str,),
293289
"attribute": "sort_name",
294290
"location": "query",
295291
},
@@ -1255,7 +1251,7 @@ def get_daily_custom_reports(
12551251
def get_hourly_usage_attribution(
12561252
self,
12571253
start_hr: datetime,
1258-
usage_type: HourlyUsageAttributionUsageType,
1254+
usage_type: str,
12591255
*,
12601256
end_hr: Union[datetime, UnsetType] = unset,
12611257
next_record_id: Union[str, UnsetType] = unset,
@@ -1280,14 +1276,13 @@ def get_hourly_usage_attribution(
12801276
cursor := response.metadata.pagination.next_record_id
12811277
END
12821278
1283-
The following values have been **deprecated** :
1284-
``estimated_indexed_spans_usage`` , ``estimated_indexed_spans_percentage`` , ``estimated_ingested_spans_usage`` , ``estimated_ingested_spans_percentage`` , ``llm_observability_usage`` , ``llm_observability_percentage``.
1285-
12861279
:param start_hr: Datetime in ISO-8601 format, UTC, precise to hour: ``[YYYY-MM-DDThh]`` for usage beginning at this hour.
12871280
:type start_hr: datetime
1288-
:param usage_type: Usage type to retrieve. The following values have been **deprecated** :
1289-
``estimated_indexed_spans_usage`` , ``estimated_ingested_spans_usage``.
1290-
:type usage_type: HourlyUsageAttributionUsageType
1281+
:param usage_type: Usage type to retrieve. Usage types are in the format ``<usage_type>_usage``.
1282+
Example: ``infra_host_usage``
1283+
To obtain the complete list of active usage types that can be used to replace
1284+
``<usage_type>`` in the field names, make a request to the `Get usage attribution types API <https://docs.datadoghq.com/api/latest/usage-metering/#get-usage-attribution-types>`_.
1285+
:type usage_type: str
12911286
:param end_hr: Datetime in ISO-8601 format, UTC, precise to hour: ``[YYYY-MM-DDThh]`` for usage ending
12921287
**before** this hour.
12931288
:type end_hr: datetime, optional
@@ -1417,11 +1412,11 @@ def get_monthly_custom_reports(
14171412
def get_monthly_usage_attribution(
14181413
self,
14191414
start_month: datetime,
1420-
fields: MonthlyUsageAttributionSupportedMetrics,
1415+
fields: str,
14211416
*,
14221417
end_month: Union[datetime, UnsetType] = unset,
14231418
sort_direction: Union[UsageSortDirection, UnsetType] = unset,
1424-
sort_name: Union[MonthlyUsageAttributionSupportedMetrics, UnsetType] = unset,
1419+
sort_name: Union[str, UnsetType] = unset,
14251420
tag_breakdown_keys: Union[str, UnsetType] = unset,
14261421
next_record_id: Union[str, UnsetType] = unset,
14271422
include_descendants: Union[bool, UnsetType] = unset,
@@ -1448,17 +1443,20 @@ def get_monthly_usage_attribution(
14481443
Maximum of 15 months ago.
14491444
:type start_month: datetime
14501445
:param fields: Comma-separated list of usage types to return, or ``*`` for all usage types.
1451-
The following values have been **deprecated** :
1452-
``estimated_indexed_spans_usage`` , ``estimated_indexed_spans_percentage`` , ``estimated_ingested_spans_usage`` , ``estimated_ingested_spans_percentage`` , ``llm_observability_usage`` , ``llm_observability_percentage``.
1453-
:type fields: MonthlyUsageAttributionSupportedMetrics
1446+
Usage types are in the format ``<usage_type>_usage`` and ``<usage_type>_percentage``.
1447+
Example: ``infra_host_usage,infra_host_percentage``
1448+
To obtain the complete list of usage attribution types that can be used to replace
1449+
``<usage_type>`` in the field names, make a request to the `Get usage attribution types API <https://docs.datadoghq.com/api/latest/usage-metering/#get-usage-attribution-types>`_.
1450+
:type fields: str
14541451
:param end_month: Datetime in ISO-8601 format, UTC, precise to month: ``[YYYY-MM]`` for usage ending this month.
14551452
:type end_month: datetime, optional
14561453
:param sort_direction: The direction to sort by: ``[desc, asc]``.
14571454
:type sort_direction: UsageSortDirection, optional
1458-
:param sort_name: The field to sort by.
1459-
The following values have been **deprecated** :
1460-
``estimated_indexed_spans_usage`` , ``estimated_indexed_spans_percentage`` , ``estimated_ingested_spans_usage`` , ``estimated_ingested_spans_percentage``.
1461-
:type sort_name: MonthlyUsageAttributionSupportedMetrics, optional
1455+
:param sort_name: The field to sort by. Sort fields are in the format ``<usage_type>_usage``.
1456+
Example: ``infra_host_usage``
1457+
To obtain the complete list of usage attribution types that can be used to replace
1458+
``<usage_type>`` in the field names, make a request to the `Get usage attribution types API <https://docs.datadoghq.com/api/latest/usage-metering/#get-usage-attribution-types>`_.
1459+
:type sort_name: str, optional
14621460
:param tag_breakdown_keys: Comma separated list of tag keys used to group usage. If no value is provided the usage will not be broken down by tags.
14631461
14641462
To see which tags are available, look for the value of ``tag_config_source`` in the API response.

src/datadog_api_client/v1/model/hourly_usage_attribution_body.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,12 @@
1717

1818
if TYPE_CHECKING:
1919
from datadog_api_client.v1.model.usage_attribution_tag_names import UsageAttributionTagNames
20-
from datadog_api_client.v1.model.hourly_usage_attribution_usage_type import HourlyUsageAttributionUsageType
2120

2221

2322
class HourlyUsageAttributionBody(ModelNormal):
2423
@cached_property
2524
def openapi_types(_):
2625
from datadog_api_client.v1.model.usage_attribution_tag_names import UsageAttributionTagNames
27-
from datadog_api_client.v1.model.hourly_usage_attribution_usage_type import HourlyUsageAttributionUsageType
2826

2927
return {
3028
"hour": (datetime,),
@@ -35,7 +33,7 @@ def openapi_types(_):
3533
"tags": (UsageAttributionTagNames,),
3634
"total_usage_sum": (float,),
3735
"updated_at": (str,),
38-
"usage_type": (HourlyUsageAttributionUsageType,),
36+
"usage_type": (str,),
3937
}
4038

4139
attribute_map = {
@@ -60,7 +58,7 @@ def __init__(
6058
tags: Union[UsageAttributionTagNames, none_type, UnsetType] = unset,
6159
total_usage_sum: Union[float, UnsetType] = unset,
6260
updated_at: Union[str, UnsetType] = unset,
63-
usage_type: Union[HourlyUsageAttributionUsageType, UnsetType] = unset,
61+
usage_type: Union[str, UnsetType] = unset,
6462
**kwargs,
6563
):
6664
"""
@@ -95,8 +93,8 @@ def __init__(
9593
:type updated_at: str, optional
9694
9795
:param usage_type: Supported products for hourly usage attribution requests.
98-
The following values have been **deprecated** : ``estimated_indexed_spans_usage`` , ``estimated_ingested_spans_usage``.
99-
:type usage_type: HourlyUsageAttributionUsageType, optional
96+
To obtain the complete list of valid usage types, make a request to the `Get usage attribution types API <https://docs.datadoghq.com/api/latest/usage-metering/#get-usage-attribution-types>`_.
97+
:type usage_type: str, optional
10098
"""
10199
if hour is not unset:
102100
kwargs["hour"] = hour

0 commit comments

Comments
 (0)