Skip to content

Commit 13a580c

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 8b6d3567 of spec repo (#1419)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
1 parent 110a55a commit 13a580c

File tree

8 files changed

+29
-17
lines changed

8 files changed

+29
-17
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-22 18:54:46.374559",
8-
"spec_repo_commit": "692b2bd1"
7+
"regenerated": "2022-07-26 12:50:54.718724",
8+
"spec_repo_commit": "8b6d3567"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.2",
12-
"regenerated": "2022-07-22 18:54:46.534488",
13-
"spec_repo_commit": "692b2bd1"
12+
"regenerated": "2022-07-26 12:50:54.730560",
13+
"spec_repo_commit": "8b6d3567"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4251,6 +4251,9 @@ components:
42514251
points:
42524252
- timestamp: 1475317847
42534253
value: 0.7
4254+
resources:
4255+
- name: dummyhost
4256+
type: host
42544257
items:
42554258
$ref: '#/components/schemas/MetricSeries'
42564259
type: array
@@ -4278,12 +4281,15 @@ components:
42784281
type: object
42794282
MetricResource:
42804283
description: Metric resource.
4284+
example:
4285+
name: dummyhost
4286+
type: host
42814287
properties:
42824288
name:
4283-
description: The name of the metric.
4289+
description: The name of the resource.
42844290
type: string
42854291
type:
4286-
description: The type of metric.
4292+
description: The type of the resource.
42874293
type: string
42884294
type: object
42894295
MetricSeries:
@@ -12545,7 +12551,7 @@ paths:
1254512551
metrics directly to the Datadog API without using DogStatsD, expect:\n\n-
1254612552
64 bits for the timestamp\n- 64 bits for the value\n- 20 bytes for the metric
1254712553
names\n- 50 bytes for the timeseries\n- The full payload is approximately
12548-
100 bytes."
12554+
100 bytes.\n\nHost name is one of the resources in the Resources field."
1254912555
operationId: SubmitMetrics
1255012556
parameters:
1255112557
- description: HTTP header used to compress the media-type.

examples/v2/metrics/SubmitMetrics.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import com.datadog.api.client.v2.model.MetricIntakeType;
77
import com.datadog.api.client.v2.model.MetricPayload;
88
import com.datadog.api.client.v2.model.MetricPoint;
9+
import com.datadog.api.client.v2.model.MetricResource;
910
import com.datadog.api.client.v2.model.MetricSeries;
1011
import java.time.OffsetDateTime;
1112
import java.util.Collections;
@@ -26,7 +27,10 @@ public static void main(String[] args) {
2627
Collections.singletonList(
2728
new MetricPoint()
2829
.timestamp(OffsetDateTime.now().toInstant().getEpochSecond())
29-
.value(0.7)))));
30+
.value(0.7)))
31+
.resources(
32+
Collections.singletonList(
33+
new MetricResource().name("dummyhost").type("host")))));
3034

3135
try {
3236
IntakePayloadAccepted result = apiInstance.submitMetrics(body);

src/main/java/com/datadog/api/client/v2/api/MetricsApi.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1718,6 +1718,8 @@ public CompletableFuture<IntakePayloadAccepted> submitMetricsAsync(
17181718
* <li>The full payload is approximately 100 bytes.
17191719
* </ul>
17201720
*
1721+
* <p>Host name is one of the resources in the Resources field.
1722+
*
17211723
* @param body (required)
17221724
* @param parameters Optional parameters for the request.
17231725
* @return ApiResponse&lt;IntakePayloadAccepted&gt;

src/main/java/com/datadog/api/client/v2/model/MetricResource.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public MetricResource name(String name) {
3030
}
3131

3232
/**
33-
* The name of the metric.
33+
* The name of the resource.
3434
*
3535
* @return name
3636
*/
@@ -51,7 +51,7 @@ public MetricResource type(String type) {
5151
}
5252

5353
/**
54-
* The type of metric.
54+
* The type of the resource.
5555
*
5656
* @return type
5757
*/
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2022-05-18T18:24:32.611Z
1+
2022-07-12T21:45:36.018Z

src/test/resources/cassettes/features/v2/Submit_metrics_returns_Payload_accepted_response.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"httpRequest": {
44
"body": {
55
"type": "JSON",
6-
"json": "{\"series\": [{\"metric\": \"system.load.1\", \"points\": [{\"timestamp\": 1652898272, \"value\": 0.7}], \"type\": 0}]}"
6+
"json": "{\"series\": [{\"metric\": \"system.load.1\", \"points\": [{\"timestamp\": 1657662336, \"value\": 0.7}], \"resources\": [{\"name\": \"dummyhost\", \"type\": \"host\"}], \"type\": 0}]}"
77
},
88
"headers": {},
99
"method": "POST",
@@ -27,6 +27,6 @@
2727
"timeToLive": {
2828
"unlimited": true
2929
},
30-
"id": "c969dbe4-3c23-6eee-0918-5fc9321d83ec"
30+
"id": "b85f9909-a76a-06e5-fa3f-6a9601244087"
3131
}
3232
]

src/test/resources/com/datadog/api/client/v2/api/metrics.feature

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,28 +191,28 @@ Feature: Metrics
191191
@generated @skip @team:DataDog/metrics-intake @team:DataDog/metrics-query
192192
Scenario: Submit metrics returns "Bad Request" response
193193
Given new "SubmitMetrics" request
194-
And body with value {"series": [{"metric": "system.load.1", "points": [{"timestamp": 1475317847, "value": 0.7}]}]}
194+
And body with value {"series": [{"metric": "system.load.1", "points": [{"timestamp": 1475317847, "value": 0.7}], "resources": [{"name": "dummyhost", "type": "host"}]}]}
195195
When the request is sent
196196
Then the response status is 400 Bad Request
197197

198198
@team:DataDog/metrics-intake @team:DataDog/metrics-query
199199
Scenario: Submit metrics returns "Payload accepted" response
200200
Given new "SubmitMetrics" request
201-
And body with value {"series": [{"metric": "system.load.1", "type": 0, "points": [{"timestamp": {{ timestamp('now') }}, "value": 0.7}]}]}
201+
And body with value {"series": [{"metric": "system.load.1", "type": 0, "points": [{"timestamp": {{ timestamp('now') }}, "value": 0.7}], "resources": [{"name": "dummyhost", "type": "host"}]}]}
202202
When the request is sent
203203
Then the response status is 202 Payload accepted
204204

205205
@generated @skip @team:DataDog/metrics-intake @team:DataDog/metrics-query
206206
Scenario: Submit metrics returns "Payload too large" response
207207
Given new "SubmitMetrics" request
208-
And body with value {"series": [{"metric": "system.load.1", "points": [{"timestamp": 1475317847, "value": 0.7}]}]}
208+
And body with value {"series": [{"metric": "system.load.1", "points": [{"timestamp": 1475317847, "value": 0.7}], "resources": [{"name": "dummyhost", "type": "host"}]}]}
209209
When the request is sent
210210
Then the response status is 413 Payload too large
211211

212212
@generated @skip @team:DataDog/metrics-intake @team:DataDog/metrics-query
213213
Scenario: Submit metrics returns "Request timeout" response
214214
Given new "SubmitMetrics" request
215-
And body with value {"series": [{"metric": "system.load.1", "points": [{"timestamp": 1475317847, "value": 0.7}]}]}
215+
And body with value {"series": [{"metric": "system.load.1", "points": [{"timestamp": 1475317847, "value": 0.7}], "resources": [{"name": "dummyhost", "type": "host"}]}]}
216216
When the request is sent
217217
Then the response status is 408 Request timeout
218218

0 commit comments

Comments
 (0)