Skip to content

Commit d677e02

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 3e3a2085 of spec repo
1 parent cb8c011 commit d677e02

File tree

12 files changed

+589
-4
lines changed

12 files changed

+589
-4
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.2",
7-
"regenerated": "2022-07-05 09:55:37.591663",
8-
"spec_repo_commit": "2439bda0"
7+
"regenerated": "2022-07-05 15:26:54.897735",
8+
"spec_repo_commit": "3e3a2085"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.2",
12-
"regenerated": "2022-07-05 09:55:37.605235",
13-
"spec_repo_commit": "2439bda0"
12+
"regenerated": "2022-07-05 15:26:54.909166",
13+
"spec_repo_commit": "3e3a2085"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1676,6 +1676,67 @@ components:
16761676
required:
16771677
- message
16781678
type: object
1679+
HourlyUsage:
1680+
description: Hourly usage for a product family for an org.
1681+
properties:
1682+
attributes:
1683+
$ref: '#/components/schemas/HourlyUsageAttributes'
1684+
id:
1685+
description: Unique ID of the response.
1686+
type: string
1687+
type:
1688+
$ref: '#/components/schemas/UsageTimeSeriesType'
1689+
type: object
1690+
HourlyUsageAttributes:
1691+
description: Attributes of hourly usage for a product family for an org for
1692+
a time period.
1693+
properties:
1694+
measurements:
1695+
description: List of the measured usage values for the product family for
1696+
the org for the time period.
1697+
items:
1698+
$ref: '#/components/schemas/HourlyUsageMeasurement'
1699+
type: array
1700+
org_name:
1701+
description: The organization name.
1702+
type: string
1703+
product_family:
1704+
description: The product for which usage is being reported.
1705+
type: string
1706+
public_id:
1707+
description: The organization public ID.
1708+
type: string
1709+
region:
1710+
description: The region of the Datadog instance that the organization belongs
1711+
to.
1712+
type: string
1713+
timestamp:
1714+
description: Datetime in ISO-8601 format, UTC. The hour for the usage.
1715+
format: date-time
1716+
type: string
1717+
type: object
1718+
HourlyUsageMeasurement:
1719+
description: Usage amount for a given usage type.
1720+
properties:
1721+
usage_type:
1722+
description: Type of usage.
1723+
type: string
1724+
value:
1725+
description: Contains the number measured for the given usage_type during
1726+
the hour.
1727+
format: int64
1728+
nullable: true
1729+
type: integer
1730+
type: object
1731+
HourlyUsageResponse:
1732+
description: Hourly usage response.
1733+
properties:
1734+
data:
1735+
description: Response containing hourly usage.
1736+
items:
1737+
$ref: '#/components/schemas/HourlyUsage'
1738+
type: array
1739+
type: object
16791740
HourlyUsageType:
16801741
description: Usage type that is being measured.
16811742
enum:
@@ -13023,6 +13084,120 @@ paths:
1302313084
x-menu-order: 39
1302413085
x-undo:
1302513086
type: safe
13087+
/api/v2/usage/hourly_usage:
13088+
get:
13089+
description: Get hourly usage by product family
13090+
operationId: GetHourlyUsage
13091+
parameters:
13092+
- description: 'Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh]
13093+
for usage beginning at this hour.'
13094+
in: query
13095+
name: filter[timestamp][start]
13096+
required: true
13097+
schema:
13098+
format: date-time
13099+
type: string
13100+
- description: 'Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh]
13101+
for usage ending **before** this hour.'
13102+
in: query
13103+
name: filter[timestamp][end]
13104+
required: false
13105+
schema:
13106+
format: date-time
13107+
type: string
13108+
- description: 'Comma separated list of product families to retrieve. Available
13109+
families are `all`, `analyzed_logs`,
13110+
13111+
`application_security`, `audit_logs`, `serverless`, `ci_app`, `cspm`, `cws`,
13112+
`dbm`, `fargate`,
13113+
13114+
`infra_hosts`, `incident_management`, `indexed_logs`, `indexed_spans`, `ingested_spans`,
13115+
`iot`,
13116+
13117+
`lambda_traced_invocations`, `logs`, `network_flows`, `network_hosts`, `observability_pipelines`,
13118+
13119+
`online_archive`, `profiling`, `rum`, `rum_browser_sessions`, `rum_mobile_sessions`,
13120+
`sds`, `snmp`,
13121+
13122+
`synthetics_api`, `synthetics_browser`, and `timeseries`.'
13123+
in: query
13124+
name: filter[product_families]
13125+
required: true
13126+
schema:
13127+
type: string
13128+
- description: Include child org usage in the response. Defaults to false.
13129+
in: query
13130+
name: filter[include_descendants]
13131+
required: false
13132+
schema:
13133+
default: false
13134+
type: boolean
13135+
- description: 'Comma separated list of product family versions to use in the
13136+
format `product_family:version`. For example,
13137+
13138+
`infra_hosts:1.0.0`. If this parameter is not used, the API will use the
13139+
latest version of each requested
13140+
13141+
product family. Currently all families have one version `1.0.0`.'
13142+
in: query
13143+
name: filter[versions]
13144+
required: false
13145+
schema:
13146+
type: string
13147+
- description: Maximum number of results to return (between 1 and 500) - defaults
13148+
to 500 if limit not specified.
13149+
in: query
13150+
name: page[limit]
13151+
required: false
13152+
schema:
13153+
default: 500
13154+
format: int32
13155+
maximum: 500
13156+
minimum: 1
13157+
type: integer
13158+
- description: List following results with a next_record_id provided in the
13159+
previous query.
13160+
in: query
13161+
name: page[next_record_id]
13162+
required: false
13163+
schema:
13164+
type: string
13165+
responses:
13166+
'200':
13167+
content:
13168+
application/json;datetime-format=rfc3339:
13169+
schema:
13170+
$ref: '#/components/schemas/HourlyUsageResponse'
13171+
description: OK
13172+
'400':
13173+
content:
13174+
application/json;datetime-format=rfc3339:
13175+
schema:
13176+
$ref: '#/components/schemas/APIErrorResponse'
13177+
description: Bad Request
13178+
'403':
13179+
content:
13180+
application/json;datetime-format=rfc3339:
13181+
schema:
13182+
$ref: '#/components/schemas/APIErrorResponse'
13183+
description: Forbidden - User is not authorized
13184+
'429':
13185+
content:
13186+
application/json;datetime-format=rfc3339:
13187+
schema:
13188+
$ref: '#/components/schemas/APIErrorResponse'
13189+
description: Too many requests
13190+
security:
13191+
- apiKeyAuth: []
13192+
appKeyAuth: []
13193+
- AuthZ:
13194+
- usage_read
13195+
summary: Get hourly usage by product family
13196+
tags:
13197+
- Usage Metering
13198+
x-menu-order: 40
13199+
x-undo:
13200+
type: safe
1302613201
/api/v2/usage/lambda_traced_invocations:
1302713202
get:
1302813203
description: Get hourly usage for Lambda Traced Invocations.

docs/datadog_api_client.v2.model.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,34 @@ full\_application\_key\_attributes
624624
:members:
625625
:show-inheritance:
626626

627+
hourly\_usage
628+
-------------
629+
630+
.. automodule:: datadog_api_client.v2.model.hourly_usage
631+
:members:
632+
:show-inheritance:
633+
634+
hourly\_usage\_attributes
635+
-------------------------
636+
637+
.. automodule:: datadog_api_client.v2.model.hourly_usage_attributes
638+
:members:
639+
:show-inheritance:
640+
641+
hourly\_usage\_measurement
642+
--------------------------
643+
644+
.. automodule:: datadog_api_client.v2.model.hourly_usage_measurement
645+
:members:
646+
:show-inheritance:
647+
648+
hourly\_usage\_response
649+
-----------------------
650+
651+
.. automodule:: datadog_api_client.v2.model.hourly_usage_response
652+
:members:
653+
:show-inheritance:
654+
627655
hourly\_usage\_type
628656
-------------------
629657

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
"""
2+
Get hourly usage by product family 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+
from datetime import datetime
8+
from dateutil.tz import tzutc
9+
10+
configuration = Configuration()
11+
with ApiClient(configuration) as api_client:
12+
api_instance = UsageMeteringApi(api_client)
13+
response = api_instance.get_hourly_usage(
14+
filter_timestamp_start=datetime(2021, 11, 11, 11, 11, 11, 111000, tzinfo=tzutc()),
15+
filter_product_families="filter[product_families]",
16+
)
17+
18+
print(response)

0 commit comments

Comments
 (0)