Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add endpoint to retrieve hourly usage attribution #1249

Merged
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.5.1.dev2",
"regenerated": "2021-12-22 15:40:58.067618",
"spec_repo_commit": "fa551a3"
"regenerated": "2021-12-22 22:13:09.436091",
"spec_repo_commit": "861a3c0"
},
"v2": {
"apigentools_version": "1.5.1.dev2",
"regenerated": "2021-12-22 15:40:58.086721",
"spec_repo_commit": "fa551a3"
"regenerated": "2021-12-22 22:13:09.456795",
"spec_repo_commit": "861a3c0"
}
}
}
173 changes: 167 additions & 6 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3365,6 +3365,95 @@ components:
format: int64
type: integer
type: object
HourlyUsageAttributionBody:
description: The usage for one set of tags for one hour.
properties:
hour:
description: The hour for the usage.
format: date-time
type: string
org_name:
description: The name of the organization.
type: string
public_id:
description: The organization public ID.
type: string
tag_config_source:
description: The source of the usage attribution tag configuration and the
selected tags in the format of `<source_org_name>:::<selected tag 1>///<selected
tag 2>///<selected tag 3>`.
type: string
tags:
$ref: '#/components/schemas/UsageAttributionTagNames'
total_usage_sum:
description: Total product usage for the given tags within the hour.
format: double
type: number
updated_at:
description: Shows the most recent hour in the current month for all organizations
where usages are calculated.
type: string
usage_type:
$ref: '#/components/schemas/HourlyUsageAttributionUsageType'
type: object
HourlyUsageAttributionMetadata:
description: The object containing document metadata.
properties:
pagination:
$ref: '#/components/schemas/HourlyUsageAttributionPagination'
type: object
HourlyUsageAttributionPagination:
description: The metadata for the current pagination.
properties:
next_record_id:
description: The cursor to get the next results (if any). To make the next
request, use the same parameters and add `next_record_id`.
type: string
type: object
HourlyUsageAttributionResponse:
description: Response containing the hourly usage attribution by tag(s).
properties:
metadata:
$ref: '#/components/schemas/HourlyUsageAttributionMetadata'
usage:
description: Get the hourly usage attribution by tag(s).
items:
$ref: '#/components/schemas/HourlyUsageAttributionBody'
type: array
type: object
HourlyUsageAttributionUsageType:
description: Supported products for hourly usage attribution requests.
enum:
- api_usage
- apm_host_usage
- browser_usage
- container_usage
- custom_timeseries_usage
- fargate_usage
- functions_usage
- indexed_logs_usage
- infra_host_usage
- invocations_usage
- npm_host_usage
- profiled_container_usage
- profiled_host_usage
- snmp_usage
type: string
x-enum-varnames:
- API_USAGE
- APM_HOST_USAGE
- BROWSER_USAGE
- CONTAINER_USAGE
- CUSTOM_TIMESERIES_USAGE
- FARGATE_USAGE
- FUNCTIONS_USAGE
- INDEXED_LOGS_USAGE
- INFRA_HOST_USAGE
- INVOCATIONS_USAGE
- NPM_HOST_USAGE
- PROFILED_CONTAINER_USAGE
- PROFILED_HOST_USAGE
- SNMP_USAGE
IFrameWidgetDefinition:
description: The iframe widget allows you to embed a portion of any other web
page on your dashboard. Only available on FREE layout dashboards.
Expand Down Expand Up @@ -24261,7 +24350,7 @@ paths:
summary: Get hourly usage for audit logs
tags:
- Usage Metering
x-menu-order: 31
x-menu-order: 32
x-undo:
type: safe
/api/v1/usage/aws_lambda:
Expand Down Expand Up @@ -24409,7 +24498,7 @@ paths:
summary: Get hourly usage for CSPM
tags:
- Usage Metering
x-menu-order: 30
x-menu-order: 31
x-undo:
type: safe
/api/v1/usage/cws:
Expand Down Expand Up @@ -24464,7 +24553,7 @@ paths:
summary: Get hourly usage for Cloud Workload Security
tags:
- Usage Metering
x-menu-order: 32
x-menu-order: 33
x-undo:
type: safe
/api/v1/usage/dbm:
Expand Down Expand Up @@ -24514,7 +24603,7 @@ paths:
summary: Get hourly usage for Database Monitoring
tags:
- Usage Metering
x-menu-order: 33
x-menu-order: 34
x-undo:
type: safe
/api/v1/usage/fargate:
Expand Down Expand Up @@ -24623,6 +24712,78 @@ paths:
x-menu-order: 1
x-undo:
type: safe
/api/v1/usage/hourly-attribution:
get:
description: Get Hourly Usage Attribution.
operationId: GetHourlyUsageAttribution
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
- description: Usage type to retrieve.
in: query
name: usage_type
required: true
schema:
$ref: '#/components/schemas/HourlyUsageAttributionUsageType'
- description: List following results with a next_record_id provided in the
previous query.
in: query
name: next_record_id
required: false
schema:
type: string
- description: Comma separated list of tags used to group usage. If no value
is provided the usage will not be broken down by tags.
in: query
name: tag_breakdown_keys
required: false
schema:
type: string
responses:
'200':
content:
application/json;datetime-format=rfc3339:
schema:
$ref: '#/components/schemas/HourlyUsageAttributionResponse'
description: OK
'403':
content:
application/json;datetime-format=rfc3339:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Forbidden - User is not authorized
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- usage_read
summary: Get Hourly Usage Attribution
tags:
- Usage Metering
x-menu-order: 30
x-undo:
type: safe
x-unstable: '**Note**: This endpoint is in public beta.

If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
/api/v1/usage/incident-management:
get:
description: Get hourly usage for incident management.
Expand Down Expand Up @@ -25218,7 +25379,7 @@ paths:
summary: Get hourly usage for RUM Units
tags:
- Usage Metering
x-menu-order: 35
x-menu-order: 36
x-undo:
type: safe
/api/v1/usage/rum_sessions:
Expand Down Expand Up @@ -25328,7 +25489,7 @@ paths:
summary: Get hourly usage for Sensitive Data Scanner
tags:
- Usage Metering
x-menu-order: 34
x-menu-order: 35
x-undo:
type: safe
/api/v1/usage/snmp:
Expand Down
10 changes: 10 additions & 0 deletions api/v1/datadog/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,11 @@ docs/HostMuteSettings.md
docs/HostTags.md
docs/HostTotals.md
docs/HostsApi.md
docs/HourlyUsageAttributionBody.md
docs/HourlyUsageAttributionMetadata.md
docs/HourlyUsageAttributionPagination.md
docs/HourlyUsageAttributionResponse.md
docs/HourlyUsageAttributionUsageType.md
docs/IFrameWidgetDefinition.md
docs/IFrameWidgetDefinitionType.md
docs/IPPrefixesAPI.md
Expand Down Expand Up @@ -850,6 +855,11 @@ model_host_mute_response.go
model_host_mute_settings.go
model_host_tags.go
model_host_totals.go
model_hourly_usage_attribution_body.go
model_hourly_usage_attribution_metadata.go
model_hourly_usage_attribution_pagination.go
model_hourly_usage_attribution_response.go
model_hourly_usage_attribution_usage_type.go
model_http_log_error.go
model_http_log_item.go
model_http_method.go
Expand Down
6 changes: 6 additions & 0 deletions api/v1/datadog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ Class | Method | HTTP request | Description
*TagsApi* | [**ListHostTags**](docs/TagsApi.md#listhosttags) | **Get** /api/v1/tags/hosts | Get Tags
*TagsApi* | [**UpdateHostTags**](docs/TagsApi.md#updatehosttags) | **Put** /api/v1/tags/hosts/{host_name} | Update host tags
*UsageMeteringApi* | [**GetDailyCustomReports**](docs/UsageMeteringApi.md#getdailycustomreports) | **Get** /api/v1/daily_custom_reports | Get the list of available daily custom reports
*UsageMeteringApi* | [**GetHourlyUsageAttribution**](docs/UsageMeteringApi.md#gethourlyusageattribution) | **Get** /api/v1/usage/hourly-attribution | Get Hourly Usage Attribution
*UsageMeteringApi* | [**GetIncidentManagement**](docs/UsageMeteringApi.md#getincidentmanagement) | **Get** /api/v1/usage/incident-management | Get hourly usage for incident management
*UsageMeteringApi* | [**GetIngestedSpans**](docs/UsageMeteringApi.md#getingestedspans) | **Get** /api/v1/usage/ingested-spans | Get hourly usage for ingested spans
*UsageMeteringApi* | [**GetMonthlyCustomReports**](docs/UsageMeteringApi.md#getmonthlycustomreports) | **Get** /api/v1/monthly_custom_reports | Get the list of available monthly custom reports
Expand Down Expand Up @@ -429,6 +430,11 @@ Class | Method | HTTP request | Description
- [HostMuteSettings](docs/HostMuteSettings.md)
- [HostTags](docs/HostTags.md)
- [HostTotals](docs/HostTotals.md)
- [HourlyUsageAttributionBody](docs/HourlyUsageAttributionBody.md)
- [HourlyUsageAttributionMetadata](docs/HourlyUsageAttributionMetadata.md)
- [HourlyUsageAttributionPagination](docs/HourlyUsageAttributionPagination.md)
- [HourlyUsageAttributionResponse](docs/HourlyUsageAttributionResponse.md)
- [HourlyUsageAttributionUsageType](docs/HourlyUsageAttributionUsageType.md)
- [IFrameWidgetDefinition](docs/IFrameWidgetDefinition.md)
- [IFrameWidgetDefinitionType](docs/IFrameWidgetDefinitionType.md)
- [IPPrefixesAPI](docs/IPPrefixesAPI.md)
Expand Down
Loading