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
232 changes: 232 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44866,6 +44866,66 @@ components:
type:
$ref: "#/components/schemas/HistoricalJobDataType"
type: object
HistoricalMetricsConfigurationAttributes:
description: Attributes of a historical metrics configuration.
properties:
created_at:
description: Timestamp when historical metrics ingestion was enabled for the metric.
example: "2024-01-15T12:00:00.000Z"
format: date-time
readOnly: true
type: string
type: object
HistoricalMetricsConfigurationCreateData:
description: Data object for enabling historical metrics ingestion for a metric.
properties:
id:
description: The metric name, used as the resource ID.
example: dd.test.metric
type: string
type:
$ref: "#/components/schemas/HistoricalMetricsConfigurationType"
required:
- id
- type
type: object
HistoricalMetricsConfigurationCreateRequest:
description: Request body for enabling historical metrics ingestion for a metric.
properties:
data:
$ref: "#/components/schemas/HistoricalMetricsConfigurationCreateData"
required:
- data
type: object
HistoricalMetricsConfigurationData:
description: >-
A historical metrics configuration resource object. Existence of this resource means historical metrics ingestion is enabled for the metric; there is no separate enabled attribute.
properties:
attributes:
$ref: "#/components/schemas/HistoricalMetricsConfigurationAttributes"
id:
description: The metric name, used as the resource ID.
example: dd.test.metric
type: string
type:
$ref: "#/components/schemas/HistoricalMetricsConfigurationType"
type: object
HistoricalMetricsConfigurationResponse:
description: Response containing a historical metrics configuration.
properties:
data:
$ref: "#/components/schemas/HistoricalMetricsConfigurationData"
readOnly: true
type: object
HistoricalMetricsConfigurationType:
default: historical_metrics_configurations
description: The historical metrics configuration resource type.
enum:
- historical_metrics_configurations
example: historical_metrics_configurations
type: string
x-enum-varnames:
- HISTORICAL_METRICS_CONFIGURATIONS
HourlyUsage:
description: Hourly usage for a product family for an org.
properties:
Expand Down Expand Up @@ -159552,6 +159612,178 @@ paths:
permissions:
- metric_tags_write
x-sunset: "2027-01-01"
/api/v2/metrics/historical-metrics-configurations:
post:
description: |-
Enable historical metrics ingestion (late data ingestion) for a metric. Idempotent:
enabling an already-enabled metric returns 200 instead of 201. Not supported for
distribution metrics, metrics with an existing tag configuration, or most standard
(non-custom) metrics.
operationId: CreateHistoricalMetricsConfiguration
requestBody:
content:
application/json:
examples:
default:
value:
data:
id: dd.test.metric
type: historical_metrics_configurations
schema:
$ref: "#/components/schemas/HistoricalMetricsConfigurationCreateRequest"
required: true
responses:
"200":
content:
application/json:
examples:
default:
value:
data:
attributes:
created_at: "2024-01-15T12:00:00.000Z"
id: dd.test.metric
type: historical_metrics_configurations
schema:
$ref: "#/components/schemas/HistoricalMetricsConfigurationResponse"
description: OK
"201":
content:
application/json:
examples:
default:
value:
data:
attributes:
created_at: "2024-01-15T12:00:00.000Z"
id: dd.test.metric
type: historical_metrics_configurations
schema:
$ref: "#/components/schemas/HistoricalMetricsConfigurationResponse"
description: Created
"400":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Bad Request
"404":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Not Found
"422":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Unprocessable Entity
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- late_metrics_config_write
summary: Enable historical metrics ingestion
tags:
- Metrics
x-codegen-request-body-name: body
"x-permission":
operator: OR
permissions:
- late_metrics_config_write
x-unstable: |-
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
/api/v2/metrics/historical-metrics-configurations/{metric_name}:
delete:
description: |-
Disable historical metrics ingestion for a metric. Idempotent: always returns 204,
whether or not the configuration existed or the metric itself still exists, so that
Terraform destroy succeeds for a metric removed out-of-band.
operationId: DeleteHistoricalMetricsConfiguration
parameters:
- $ref: "#/components/parameters/MetricName"
responses:
"204":
description: No Content
"400":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Bad Request
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- late_metrics_config_write
summary: Delete a historical metrics configuration
tags:
- Metrics
"x-permission":
operator: OR
permissions:
- late_metrics_config_write
x-unstable: |-
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
get:
description: |-
Get the historical metrics ingestion configuration for a metric. Existence of the
resource means historical metrics ingestion is enabled; returns 404 when it is not
enabled for the metric.
operationId: GetHistoricalMetricsConfiguration
parameters:
- $ref: "#/components/parameters/MetricName"
responses:
"200":
content:
application/json:
examples:
default:
value:
data:
attributes:
created_at: "2024-01-15T12:00:00.000Z"
id: dd.test.metric
type: historical_metrics_configurations
schema:
$ref: "#/components/schemas/HistoricalMetricsConfigurationResponse"
description: OK
"400":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Bad Request
"404":
content:
application/json:
schema:
$ref: "#/components/schemas/JSONAPIErrorResponse"
description: Not Found
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- metrics_read
summary: Get a historical metrics configuration
tags:
- Metrics
"x-permission":
operator: OR
permissions:
- metrics_read
x-unstable: |-
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
/api/v2/metrics/tag-indexing-rules:
get:
description: List tag indexing rules for an org, sorted by `rule_order`, with offset/limit pagination.
Expand Down
36 changes: 36 additions & 0 deletions examples/v2/metrics/CreateHistoricalMetricsConfiguration.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Enable historical metrics ingestion returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.MetricsApi;
import com.datadog.api.client.v2.model.HistoricalMetricsConfigurationCreateData;
import com.datadog.api.client.v2.model.HistoricalMetricsConfigurationCreateRequest;
import com.datadog.api.client.v2.model.HistoricalMetricsConfigurationResponse;
import com.datadog.api.client.v2.model.HistoricalMetricsConfigurationType;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setUnstableOperationEnabled("v2.createHistoricalMetricsConfiguration", true);
MetricsApi apiInstance = new MetricsApi(defaultClient);

HistoricalMetricsConfigurationCreateRequest body =
new HistoricalMetricsConfigurationCreateRequest()
.data(
new HistoricalMetricsConfigurationCreateData()
.id("dd.test.metric")
.type(HistoricalMetricsConfigurationType.HISTORICAL_METRICS_CONFIGURATIONS));

try {
HistoricalMetricsConfigurationResponse result =
apiInstance.createHistoricalMetricsConfiguration(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling MetricsApi#createHistoricalMetricsConfiguration");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
23 changes: 23 additions & 0 deletions examples/v2/metrics/DeleteHistoricalMetricsConfiguration.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Delete a historical metrics configuration returns "No Content" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.MetricsApi;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setUnstableOperationEnabled("v2.deleteHistoricalMetricsConfiguration", true);
MetricsApi apiInstance = new MetricsApi(defaultClient);

try {
apiInstance.deleteHistoricalMetricsConfiguration("dist.http.endpoint.request");
} catch (ApiException e) {
System.err.println("Exception when calling MetricsApi#deleteHistoricalMetricsConfiguration");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
26 changes: 26 additions & 0 deletions examples/v2/metrics/GetHistoricalMetricsConfiguration.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Get a historical metrics configuration returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.MetricsApi;
import com.datadog.api.client.v2.model.HistoricalMetricsConfigurationResponse;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setUnstableOperationEnabled("v2.getHistoricalMetricsConfiguration", true);
MetricsApi apiInstance = new MetricsApi(defaultClient);

try {
HistoricalMetricsConfigurationResponse result =
apiInstance.getHistoricalMetricsConfiguration("dist.http.endpoint.request");
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling MetricsApi#getHistoricalMetricsConfiguration");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
3 changes: 3 additions & 0 deletions src/main/java/com/datadog/api/client/ApiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -1124,10 +1124,13 @@ public class ApiClient {
put("v2.removeRoleFromRestrictionQuery", false);
put("v2.replaceRestrictionQuery", false);
put("v2.updateRestrictionQuery", false);
put("v2.createHistoricalMetricsConfiguration", false);
put("v2.createTagIndexingRule", false);
put("v2.createTagIndexingRuleExemption", false);
put("v2.deleteHistoricalMetricsConfiguration", false);
put("v2.deleteTagIndexingRule", false);
put("v2.deleteTagIndexingRuleExemption", false);
put("v2.getHistoricalMetricsConfiguration", false);
put("v2.getTagIndexingRule", false);
put("v2.getTagIndexingRuleExemption", false);
put("v2.listTagIndexingRules", false);
Expand Down
Loading
Loading