Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.2",
"regenerated": "2022-04-20 13:39:47.339075",
"spec_repo_commit": "7cce8766"
"regenerated": "2022-04-20 18:58:38.947898",
"spec_repo_commit": "8df9ca3b"
},
"v2": {
"apigentools_version": "1.6.2",
"regenerated": "2022-04-20 13:39:47.354440",
"spec_repo_commit": "7cce8766"
"regenerated": "2022-04-20 18:58:38.961982",
"spec_repo_commit": "8df9ca3b"
}
}
}
17 changes: 16 additions & 1 deletion .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14613,6 +14613,11 @@ components:
all hours in the current date for all organizations.
format: int64
type: integer
observability_pipelines_bytes_processed_sum:
description: Sum of all observability pipelines bytes processed over all
hours in the current date for the given org.
format: int64
type: integer
online_archive_events_count_sum:
description: Sum of all online archived events over all hours in the current
date for all organizations.
Expand Down Expand Up @@ -14930,6 +14935,11 @@ components:
all hours in the current date for the given org.
format: int64
type: integer
observability_pipelines_bytes_processed_sum:
description: Sum of all observability pipelines bytes processed over all
hours in the current date for the given org.
format: int64
type: integer
online_archive_events_count_sum:
description: Sum of all online archived events over all hours in the current
date for the given org.
Expand Down Expand Up @@ -15271,6 +15281,11 @@ components:
all hours in the current months for all organizations.
format: int64
type: integer
observability_pipelines_bytes_processed_agg_sum:
description: Sum of all observability pipelines bytes processed over all
hours in the current months for all organizations.
format: int64
type: integer
online_archive_events_count_agg_sum:
description: Sum of all online archived events over all hours in the current
months for all organizations.
Expand Down Expand Up @@ -28435,7 +28450,7 @@ tags:

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

It is retained for the past 15 months.
It is retained for 15 months.


You can retrieve up to 24 hours of hourly usage data for multiple organizations,
Expand Down
151 changes: 151 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1594,6 +1594,14 @@ components:
required:
- name
type: object
HourlyUsageType:
description: Usage type that is being measured.
enum:
- observability_pipelines_bytes_processed
example: observability_pipelines_bytes_processed
type: string
x-enum-varnames:
- OBSERVABILITY_PIPELINES_BYTES_PROCESSSED
IdPMetadataFormData:
description: The form data submitted to upload IdP metadata
properties:
Expand Down Expand Up @@ -6454,6 +6462,69 @@ components:
required:
- data
type: object
UsageAttributesObject:
description: Usage attributes data.
properties:
org_name:
description: The organization name.
type: string
product_family:
description: The product for which usage is being reported.
type: string
public_id:
description: The organization public ID.
type: string
timeseries:
description: List of usage data reported for each requested hour.
items:
$ref: '#/components/schemas/UsageTimeSeriesObject'
type: array
usage_type:
$ref: '#/components/schemas/HourlyUsageType'
type: object
UsageDataObject:
description: Usage data.
properties:
attributes:
$ref: '#/components/schemas/UsageAttributesObject'
id:
description: Unique ID of the response.
type: string
type:
$ref: '#/components/schemas/UsageTimeSeriesType'
type: object
UsageObservabilityPipelinesResponse:
description: Observability Pipelines usage response.
properties:
data:
description: Response containing Observability Pipelines usage.
items:
$ref: '#/components/schemas/UsageDataObject'
type: array
type: object
UsageTimeSeriesObject:
description: Usage timeseries data.
properties:
timestamp:
description: Datetime in ISO-8601 format, UTC. The hour for the usage.
format: date-time
type: string
value:
description: Contains the number measured for the given usage_type during
the hour.
format: int64
nullable: true
type: integer
type: object
UsageTimeSeriesType:
default: usage_timeseries
description: Type of usage data.
enum:
- usage_timeseries
example: usage_timeseries
type: string
x-enum-varnames:
- USAGE_TIMESERIES
User:
description: User object returned by the API.
properties:
Expand Down Expand Up @@ -11930,6 +12001,65 @@ paths:
x-unstable: '**Note**: This endpoint is in public beta.

If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
/api/v2/usage/observability_pipelines:
get:
description: Get hourly usage for Observability Pipelines.
operationId: GetUsageObservabilityPipelines
parameters:
- description: 'Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]`
for usage beginning at this hour.'
in: query
name: start_hr
required: true
schema:
format: date-time
type: string
- description: 'Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]`
for usage ending

**before** this hour.'
in: query
name: end_hr
required: false
schema:
format: date-time
type: string
responses:
'200':
content:
application/json;datetime-format=rfc3339:
schema:
$ref: '#/components/schemas/UsageObservabilityPipelinesResponse'
description: OK
'400':
content:
application/json;datetime-format=rfc3339:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Bad Request
'403':
content:
application/json;datetime-format=rfc3339:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Forbidden - User is not authorized
'429':
content:
application/json;datetime-format=rfc3339:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Too many requests
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- usage_read
summary: Get hourly usage for Observability Pipelines
tags:
- Usage Metering
x-menu-order: 38
x-undo:
type: safe
/api/v2/user_invitations:
post:
description: Sends emails to one or more users inviting them to join the organization.
Expand Down Expand Up @@ -12501,6 +12631,27 @@ tags:
name: Security Monitoring
- description: Create, edit, and disable service accounts.
name: Service Accounts
- description: 'The usage metering API allows you to get hourly, daily, and

monthly usage across multiple facets of Datadog.

This API is available to all Pro and Enterprise customers.

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


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

It is retained for 15 months.


You can retrieve up to 24 hours of hourly usage data for multiple organizations,

and up to two months of hourly usage data for a single organization in one request.'
externalDocs:
description: Find out more at
url: https://docs.datadoghq.com/account_management/billing/usage_details/
name: Usage Metering
- description: Create, edit, and disable users.
externalDocs:
url: https://docs.datadoghq.com/account_management/users
Expand Down
8 changes: 8 additions & 0 deletions docs/datadog_api_client.v2.api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,14 @@ service\_accounts\_api
:undoc-members:
:show-inheritance:

usage\_metering\_api
--------------------

.. automodule:: datadog_api_client.v2.api.usage_metering_api
:members:
:undoc-members:
:show-inheritance:

users\_api
----------

Expand Down
48 changes: 48 additions & 0 deletions docs/datadog_api_client.v2.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,14 @@ full\_application\_key\_attributes
:undoc-members:
:show-inheritance:

hourly\_usage\_type
-------------------

.. automodule:: datadog_api_client.v2.model.hourly_usage_type
:members:
:undoc-members:
:show-inheritance:

http\_log
---------

Expand Down Expand Up @@ -3281,6 +3289,46 @@ service\_account\_create\_request
:undoc-members:
:show-inheritance:

usage\_attributes\_object
-------------------------

.. automodule:: datadog_api_client.v2.model.usage_attributes_object
:members:
:undoc-members:
:show-inheritance:

usage\_data\_object
-------------------

.. automodule:: datadog_api_client.v2.model.usage_data_object
:members:
:undoc-members:
:show-inheritance:

usage\_observability\_pipelines\_response
-----------------------------------------

.. automodule:: datadog_api_client.v2.model.usage_observability_pipelines_response
:members:
:undoc-members:
:show-inheritance:

usage\_time\_series\_object
---------------------------

.. automodule:: datadog_api_client.v2.model.usage_time_series_object
:members:
:undoc-members:
:show-inheritance:

usage\_time\_series\_type
-------------------------

.. automodule:: datadog_api_client.v2.model.usage_time_series_type
:members:
:undoc-members:
:show-inheritance:

user
----

Expand Down
18 changes: 18 additions & 0 deletions examples/v2/usage-metering/GetUsageObservabilityPipelines.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"""
Get hourly usage for Observability Pipelines returns "OK" response
"""

from datetime import datetime
from dateutil.relativedelta import relativedelta
from datadog_api_client.v2 import ApiClient, Configuration
from datadog_api_client.v2.api.usage_metering_api import UsageMeteringApi

configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = UsageMeteringApi(api_client)
response = api_instance.get_usage_observability_pipelines(
start_hr=(datetime.now() + relativedelta(days=-5)).isoformat(timespec="seconds"),
end_hr=(datetime.now() + relativedelta(days=-3)).isoformat(timespec="seconds"),
)

print(response)
5 changes: 5 additions & 0 deletions src/datadog_api_client/v1/model/usage_summary_date.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/datadog_api_client/v1/model/usage_summary_date_org.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading