Skip to content

Commit 8f7049d

Browse files
Update GetUsageSummaryAvailableFields example to print field lists by category
1 parent e34e86e commit 8f7049d

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

‎examples/v2/usage-metering/GetUsageSummaryAvailableFields.py‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Get available fields for usage summary returns "OK." response
2+
Get available fields for usage summary returns "OK" response
33
"""
44

55
from datadog_api_client import ApiClient, Configuration
@@ -10,4 +10,15 @@
1010
api_instance = UsageMeteringApi(api_client)
1111
response = api_instance.get_usage_summary_available_fields()
1212

13-
print(response)
13+
attrs = response.data.attributes
14+
print(f"response_fields ({len(attrs.response_fields)}):")
15+
for f in attrs.response_fields:
16+
print(f" {f}")
17+
18+
print(f"date_fields ({len(attrs.date_fields)}):")
19+
for f in attrs.date_fields:
20+
print(f" {f}")
21+
22+
print(f"date_org_fields ({len(attrs.date_org_fields)}):")
23+
for f in attrs.date_org_fields:
24+
print(f" {f}")

0 commit comments

Comments
 (0)