Skip to content

Commit 360d60b

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 9fa2d8e1 of spec repo
1 parent 2ce42b7 commit 360d60b

File tree

11 files changed

+107
-8
lines changed

11 files changed

+107
-8
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-26 15:30:14.273167",
8-
"spec_repo_commit": "8cdc5711"
7+
"regenerated": "2022-07-27 16:17:22.382475",
8+
"spec_repo_commit": "9fa2d8e1"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.2",
12-
"regenerated": "2022-07-26 15:30:14.285625",
13-
"spec_repo_commit": "8cdc5711"
12+
"regenerated": "2022-07-27 16:17:22.398855",
13+
"spec_repo_commit": "9fa2d8e1"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5511,12 +5511,18 @@ components:
55115511
x-enum-varnames:
55125512
- USER_AGENT_PARSER
55135513
MetricContentEncoding:
5514+
default: deflate
55145515
description: HTTP header used to compress the media-type.
55155516
enum:
55165517
- deflate
5518+
- zstd
5519+
- gzip
5520+
example: deflate
55175521
type: string
55185522
x-enum-varnames:
55195523
- DEFLATE
5524+
- ZSTD
5525+
- GZIP
55205526
MetricMetadata:
55215527
description: Object with all metric related metadata.
55225528
properties:

.generator/schemas/v2/openapi.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4321,9 +4321,14 @@ components:
43214321
description: HTTP header used to compress the media-type.
43224322
enum:
43234323
- deflate
4324+
- zstd1
4325+
- gzip
4326+
example: deflate
43244327
type: string
43254328
x-enum-varnames:
43264329
- DEFLATE
4330+
- ZSTD1
4331+
- GZIP
43274332
MetricCustomAggregation:
43284333
description: A time and space aggregation combination for use in query.
43294334
example:
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/**
2+
* Submit metrics with compression returns "Payload accepted" response
3+
*/
4+
5+
import { client, v1 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v1.MetricsApi(configuration);
9+
10+
const params: v1.MetricsApiSubmitMetricsRequest = {
11+
body: {
12+
series: [
13+
{
14+
metric: "system.load.1",
15+
type: "gauge",
16+
points: [[new Date().getTime() / 1000, 1.1]],
17+
tags: [
18+
"test:ExampleSubmitmetricswithcompressionreturnsPayloadacceptedresponse",
19+
],
20+
},
21+
],
22+
},
23+
contentEncoding: "zstd",
24+
};
25+
26+
apiInstance
27+
.submitMetrics(params)
28+
.then((data: v1.IntakePayloadAccepted) => {
29+
console.log(
30+
"API called successfully. Returned data: " + JSON.stringify(data)
31+
);
32+
})
33+
.catch((error: any) => console.error(error));
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/**
2+
* Submit metrics with compression returns "Payload accepted" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.MetricsApi(configuration);
9+
10+
const params: v2.MetricsApiSubmitMetricsRequest = {
11+
body: {
12+
series: [
13+
{
14+
metric: "system.load.1",
15+
type: 0,
16+
points: [
17+
{
18+
timestamp: new Date().getTime() / 1000,
19+
value: 0.7,
20+
},
21+
],
22+
},
23+
],
24+
},
25+
contentEncoding: "zstd1",
26+
};
27+
28+
apiInstance
29+
.submitMetrics(params)
30+
.then((data: v2.IntakePayloadAccepted) => {
31+
console.log(
32+
"API called successfully. Returned data: " + JSON.stringify(data)
33+
);
34+
})
35+
.catch((error: any) => console.error(error));

features/v1/metrics.feature

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,3 +179,11 @@ Feature: Metrics
179179
And body with value {"series": [{"metric": "system.load.1", "points": [[1475317847.0, 0.7]]}]}
180180
When the request is sent
181181
Then the response status is 408 Request timeout
182+
183+
@integration-only @skip-terraform-config @skip-validation @team:DataDog/metrics-intake @team:DataDog/metrics-query
184+
Scenario: Submit metrics with compression returns "Payload accepted" response
185+
Given new "SubmitMetrics" request
186+
And body with value {"series": [{"metric": "system.load.1", "type": "gauge", "points": [[{{ timestamp("now") }}, 1.1]], "tags": ["test:{{ unique_alnum }}"]}]}
187+
And request contains "Content-Encoding" parameter with value "zstd"
188+
When the request is sent
189+
Then the response status is 202 Payload accepted

features/v2/metrics.feature

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,14 @@ Feature: Metrics
216216
When the request is sent
217217
Then the response status is 408 Request timeout
218218

219+
@integration-only @skip-terraform-config @skip-validation @team:DataDog/metrics-intake @team:DataDog/metrics-query
220+
Scenario: Submit metrics with compression returns "Payload accepted" response
221+
Given new "SubmitMetrics" request
222+
And body with value {"series": [{"metric": "system.load.1", "type": 0, "points": [{"timestamp": {{ timestamp('now') }}, "value": 0.7}]}]}
223+
And request contains "Content-Encoding" parameter with value "zstd1"
224+
When the request is sent
225+
Then the response status is 202 Payload accepted
226+
219227
@generated @skip @team:DataDog/points-aggregation
220228
Scenario: Tag Configuration Cardinality Estimator returns "API error response." response
221229
Given a valid "appKeyAuth" key in the system

packages/datadog-api-client-v1/models/MetricContentEncoding.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,7 @@
44
* Copyright 2020-Present Datadog, Inc.
55
*/
66

7-
export type MetricContentEncoding = typeof DEFLATE;
7+
export type MetricContentEncoding = typeof DEFLATE | typeof ZSTD | typeof GZIP;
88
export const DEFLATE = "deflate";
9+
export const ZSTD = "zstd";
10+
export const GZIP = "gzip";

packages/datadog-api-client-v1/models/ObjectSerializer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ const enumsMap: { [key: string]: any[] } = {
705705
LogsTraceRemapperType: ["trace-id-remapper"],
706706
LogsURLParserType: ["url-parser"],
707707
LogsUserAgentParserType: ["user-agent-parser"],
708-
MetricContentEncoding: ["deflate"],
708+
MetricContentEncoding: ["deflate", "zstd", "gzip"],
709709
MonitorDeviceID: [
710710
"laptop_large",
711711
"tablet",

packages/datadog-api-client-v2/models/MetricContentEncoding.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,7 @@
44
* Copyright 2020-Present Datadog, Inc.
55
*/
66

7-
export type MetricContentEncoding = typeof DEFLATE;
7+
export type MetricContentEncoding = typeof DEFLATE | typeof ZSTD1 | typeof GZIP;
88
export const DEFLATE = "deflate";
9+
export const ZSTD1 = "zstd1";
10+
export const GZIP = "gzip";

0 commit comments

Comments
 (0)