Skip to content

Commit

Permalink
Add metrics bulk-config endpoint (#1324)
Browse files Browse the repository at this point in the history
* support empty lookup

* Support additional parameters in response body

* Regenerate client from commit cdd703e of spec repo

Co-authored-by: Jiri Kuncar <jiri.kuncar@gmail.com>
Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
  • Loading branch information
3 people authored Feb 15, 2022
1 parent 031527d commit d6eebfb
Show file tree
Hide file tree
Showing 34 changed files with 3,043 additions and 33 deletions.
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-02-14 20:16:44.221972",
"spec_repo_commit": "5d7c376"
"regenerated": "2022-02-15 12:44:11.413205",
"spec_repo_commit": "cdd703e"
},
"v2": {
"apigentools_version": "1.6.2",
"regenerated": "2022-02-14 20:16:44.234339",
"spec_repo_commit": "5d7c376"
"regenerated": "2022-02-15 12:44:11.425089",
"spec_repo_commit": "cdd703e"
}
}
}
257 changes: 257 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3458,6 +3458,132 @@ components:
$ref: '#/components/schemas/MetricAllTags'
readOnly: true
type: object
MetricBulkConfigureTagsType:
default: metric_bulk_configure_tags
description: The metric bulk configure tags resource.
enum:
- metric_bulk_configure_tags
example: metric_bulk_configure_tags
x-enum-varnames:
- BULK_MANAGE_TAGS
MetricBulkTagConfigCreate:
description: Request object to bulk configure tags for metrics matching the
given prefix.
properties:
attributes:
$ref: '#/components/schemas/MetricBulkTagConfigCreateAttributes'
id:
$ref: '#/components/schemas/MetricBulkTagConfigNamePrefix'
type:
$ref: '#/components/schemas/MetricBulkConfigureTagsType'
required:
- id
- type
type: object
MetricBulkTagConfigCreateAttributes:
description: Optional parameters for bulk creating metric tag configurations.
properties:
emails:
$ref: '#/components/schemas/MetricBulkTagConfigEmailList'
tags:
$ref: '#/components/schemas/MetricBulkTagConfigTagNameList'
type: object
MetricBulkTagConfigCreateRequest:
description: Wrapper object for a single bulk tag configuration request.
properties:
data:
$ref: '#/components/schemas/MetricBulkTagConfigCreate'
required:
- data
type: object
MetricBulkTagConfigDelete:
description: Request object to bulk delete all tag configurations for metrics
matching the given prefix.
properties:
attributes:
$ref: '#/components/schemas/MetricBulkTagConfigDeleteAttributes'
id:
$ref: '#/components/schemas/MetricBulkTagConfigNamePrefix'
type:
$ref: '#/components/schemas/MetricBulkConfigureTagsType'
required:
- id
- type
type: object
MetricBulkTagConfigDeleteAttributes:
description: Optional parameters for bulk deleting metric tag configurations.
properties:
emails:
$ref: '#/components/schemas/MetricBulkTagConfigEmailList'
type: object
MetricBulkTagConfigDeleteRequest:
description: Wrapper object for a single bulk tag deletion request.
properties:
data:
$ref: '#/components/schemas/MetricBulkTagConfigDelete'
required:
- data
type: object
MetricBulkTagConfigEmailList:
description: A list of account emails to notify when the configuration is applied.
example:
- sue@example.com
- bob@example.com
items:
description: An email address.
format: email
type: string
type: array
MetricBulkTagConfigNamePrefix:
description: A text prefix to match against metric names.
example: kafka.lag
type: string
MetricBulkTagConfigResponse:
description: Wrapper for a single bulk tag configuration status response.
properties:
data:
$ref: '#/components/schemas/MetricBulkTagConfigStatus'
type: object
MetricBulkTagConfigStatus:
description: 'The status of a request to bulk configure metric tags.
It contains the fields from the original request for reference.'
properties:
attributes:
$ref: '#/components/schemas/MetricBulkTagConfigStatusAttributes'
id:
$ref: '#/components/schemas/MetricBulkTagConfigNamePrefix'
type:
$ref: '#/components/schemas/MetricBulkConfigureTagsType'
required:
- id
- type
type: object
MetricBulkTagConfigStatusAttributes:
description: Optional attributes for the status of a bulk tag configuration
request.
properties:
emails:
$ref: '#/components/schemas/MetricBulkTagConfigEmailList'
status:
description: The status of the request.
example: Accepted
type: string
tags:
$ref: '#/components/schemas/MetricBulkTagConfigTagNameList'
type: object
MetricBulkTagConfigTagNameList:
description: A list of tag names to apply to the configuration.
example:
- host
- pod_name
- is_shadow
items:
description: A metric tag name.
maxLength: 200
pattern: ^[A-Za-z][A-Za-z0-9\.\-\_:\/]*$
type: string
type: array
MetricCustomAggregation:
description: A time and space aggregation combination for use in query.
example:
Expand Down Expand Up @@ -8153,6 +8279,137 @@ paths:
is only accessible for Metrics without Limits&trade; beta customers.\nIf you\u2019re
interested in Metrics without Limits&trade;, please contact your Customer
Success Manager.**"
/api/v2/metrics/config/bulk-tags:
delete:
description: 'Delete all custom lists of queryable tag keys for a set of existing
count, gauge, rate, and distribution metrics.
Metrics are selected by passing a metric name prefix.
Results can be sent to a set of account email addresses, just like the same
operation in the Datadog web app.
Can only be used with application keys of users with the `Manage Tags for
Metrics` permission.'
operationId: DeleteBulkTagsMetricsConfiguration
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/MetricBulkTagConfigDeleteRequest'
required: true
responses:
'202':
content:
application/json:
schema:
$ref: '#/components/schemas/MetricBulkTagConfigResponse'
description: Accepted
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Bad Request
'403':
content:
application/json:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Forbidden
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Not Found
'429':
content:
application/json:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Too Many Requests
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ: []
summary: Configure tags for multiple metrics
tags:
- Metrics
x-codegen-request-body-name: body
x-menu-order: 9
x-undo:
type: idempotent
post:
description: 'Create and define a list of queryable tag keys for a set of existing
count, gauge, rate, and distribution metrics.
Metrics are selected by passing a metric name prefix. Use the Delete method
of this API path to remove tag configurations.
Results can be sent to a set of account email addresses, just like the same
operation in the Datadog web app.
If multiple calls include the same metric, the last configuration applied
(not by submit order) is used, do not
expect deterministic ordering of concurrent calls.
Can only be used with application keys of users with the `Manage Tags for
Metrics` permission.'
operationId: CreateBulkTagsMetricsConfiguration
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/MetricBulkTagConfigCreateRequest'
required: true
responses:
'202':
content:
application/json:
schema:
$ref: '#/components/schemas/MetricBulkTagConfigResponse'
description: Accepted
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Bad Request
'403':
content:
application/json:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Forbidden
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Not Found
'429':
content:
application/json:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Too Many Requests
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ: []
summary: Configure tags for multiple metrics
tags:
- Metrics
x-codegen-request-body-name: body
x-menu-order: 8
x-undo:
operationId: DeleteBulkTagsMetricsConfiguration
parameters:
- name: body
source: ''
type: unsafe
/api/v2/metrics/{metric_name}/all-tags:
get:
description: View indexed tag key-value pairs for a given metric name.
Expand Down
20 changes: 20 additions & 0 deletions api/v2/datadog/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,16 @@ docs/Metric.md
docs/MetricAllTags.md
docs/MetricAllTagsAttributes.md
docs/MetricAllTagsResponse.md
docs/MetricBulkConfigureTagsType.md
docs/MetricBulkTagConfigCreate.md
docs/MetricBulkTagConfigCreateAttributes.md
docs/MetricBulkTagConfigCreateRequest.md
docs/MetricBulkTagConfigDelete.md
docs/MetricBulkTagConfigDeleteAttributes.md
docs/MetricBulkTagConfigDeleteRequest.md
docs/MetricBulkTagConfigResponse.md
docs/MetricBulkTagConfigStatus.md
docs/MetricBulkTagConfigStatusAttributes.md
docs/MetricCustomAggregation.md
docs/MetricCustomSpaceAggregation.md
docs/MetricCustomTimeAggregation.md
Expand Down Expand Up @@ -613,6 +623,16 @@ model_metric.go
model_metric_all_tags.go
model_metric_all_tags_attributes.go
model_metric_all_tags_response.go
model_metric_bulk_configure_tags_type.go
model_metric_bulk_tag_config_create.go
model_metric_bulk_tag_config_create_attributes.go
model_metric_bulk_tag_config_create_request.go
model_metric_bulk_tag_config_delete.go
model_metric_bulk_tag_config_delete_attributes.go
model_metric_bulk_tag_config_delete_request.go
model_metric_bulk_tag_config_response.go
model_metric_bulk_tag_config_status.go
model_metric_bulk_tag_config_status_attributes.go
model_metric_custom_aggregation.go
model_metric_custom_space_aggregation.go
model_metric_custom_time_aggregation.go
Expand Down
12 changes: 12 additions & 0 deletions api/v2/datadog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ All URIs are relative to *https://api.datadoghq.com*
| _LogsMetricsApi_ | [**GetLogsMetric**](docs/LogsMetricsApi.md#getlogsmetric) | **Get** /api/v2/logs/config/metrics/{metric_id} | Get a log-based metric |
| _LogsMetricsApi_ | [**ListLogsMetrics**](docs/LogsMetricsApi.md#listlogsmetrics) | **Get** /api/v2/logs/config/metrics | Get all log-based metrics |
| _LogsMetricsApi_ | [**UpdateLogsMetric**](docs/LogsMetricsApi.md#updatelogsmetric) | **Patch** /api/v2/logs/config/metrics/{metric_id} | Update a log-based metric |
| _MetricsApi_ | [**CreateBulkTagsMetricsConfiguration**](docs/MetricsApi.md#createbulktagsmetricsconfiguration) | **Post** /api/v2/metrics/config/bulk-tags | Configure tags for multiple metrics |
| _MetricsApi_ | [**CreateTagConfiguration**](docs/MetricsApi.md#createtagconfiguration) | **Post** /api/v2/metrics/{metric_name}/tags | Create a tag configuration |
| _MetricsApi_ | [**DeleteBulkTagsMetricsConfiguration**](docs/MetricsApi.md#deletebulktagsmetricsconfiguration) | **Delete** /api/v2/metrics/config/bulk-tags | Configure tags for multiple metrics |
| _MetricsApi_ | [**DeleteTagConfiguration**](docs/MetricsApi.md#deletetagconfiguration) | **Delete** /api/v2/metrics/{metric_name}/tags | Delete a tag configuration |
| _MetricsApi_ | [**ListTagConfigurationByName**](docs/MetricsApi.md#listtagconfigurationbyname) | **Get** /api/v2/metrics/{metric_name}/tags | List tag configuration by name |
| _MetricsApi_ | [**ListTagConfigurations**](docs/MetricsApi.md#listtagconfigurations) | **Get** /api/v2/metrics | List tag configurations |
Expand Down Expand Up @@ -402,6 +404,16 @@ All URIs are relative to *https://api.datadoghq.com*
- [MetricAllTags](docs/MetricAllTags.md)
- [MetricAllTagsAttributes](docs/MetricAllTagsAttributes.md)
- [MetricAllTagsResponse](docs/MetricAllTagsResponse.md)
- [MetricBulkConfigureTagsType](docs/MetricBulkConfigureTagsType.md)
- [MetricBulkTagConfigCreate](docs/MetricBulkTagConfigCreate.md)
- [MetricBulkTagConfigCreateAttributes](docs/MetricBulkTagConfigCreateAttributes.md)
- [MetricBulkTagConfigCreateRequest](docs/MetricBulkTagConfigCreateRequest.md)
- [MetricBulkTagConfigDelete](docs/MetricBulkTagConfigDelete.md)
- [MetricBulkTagConfigDeleteAttributes](docs/MetricBulkTagConfigDeleteAttributes.md)
- [MetricBulkTagConfigDeleteRequest](docs/MetricBulkTagConfigDeleteRequest.md)
- [MetricBulkTagConfigResponse](docs/MetricBulkTagConfigResponse.md)
- [MetricBulkTagConfigStatus](docs/MetricBulkTagConfigStatus.md)
- [MetricBulkTagConfigStatusAttributes](docs/MetricBulkTagConfigStatusAttributes.md)
- [MetricCustomAggregation](docs/MetricCustomAggregation.md)
- [MetricCustomSpaceAggregation](docs/MetricCustomSpaceAggregation.md)
- [MetricCustomTimeAggregation](docs/MetricCustomTimeAggregation.md)
Expand Down
Loading

0 comments on commit d6eebfb

Please sign in to comment.