Skip to content

Commit 26a1d12

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spectherve
authored
Regenerate client from commit 8b6d3567 of spec repo (#1093)
Co-authored-by: ci.datadog-api-spec <[email protected]> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Co-authored-by: Thomas Hervé <[email protected]>
1 parent cf4baf0 commit 26a1d12

File tree

8 files changed

+30
-15
lines changed

8 files changed

+30
-15
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:28.340261",
8-
"spec_repo_commit": "692b2bd1"
7+
"regenerated": "2022-07-26 12:51:10.256864",
8+
"spec_repo_commit": "8b6d3567"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.2",
12-
"regenerated": "2022-07-22 18:54:28.362963",
13-
"spec_repo_commit": "692b2bd1"
12+
"regenerated": "2022-07-26 12:51:10.273448",
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.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from datadog_api_client.v2.model.metric_intake_type import MetricIntakeType
99
from datadog_api_client.v2.model.metric_payload import MetricPayload
1010
from datadog_api_client.v2.model.metric_point import MetricPoint
11+
from datadog_api_client.v2.model.metric_resource import MetricResource
1112
from datadog_api_client.v2.model.metric_series import MetricSeries
1213

1314
body = MetricPayload(
@@ -21,6 +22,12 @@
2122
value=0.7,
2223
),
2324
],
25+
resources=[
26+
MetricResource(
27+
name="dummyhost",
28+
type="host",
29+
),
30+
],
2431
),
2532
],
2633
)

src/datadog_api_client/v2/api/metrics_api.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,8 @@ def submit_metrics(
628628
* 50 bytes for the timeseries
629629
* The full payload is approximately 100 bytes.
630630
631+
Host name is one of the resources in the Resources field.
632+
631633
:type body: MetricPayload
632634
:param content_encoding: HTTP header used to compress the media-type.
633635
:type content_encoding: MetricContentEncoding, optional

src/datadog_api_client/v2/model/metric_resource.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ def __init__(self, *args, **kwargs):
2626
"""
2727
Metric resource.
2828
29-
:param name: The name of the metric.
29+
:param name: The name of the resource.
3030
:type name: str, optional
3131
32-
:param type: The type of metric.
32+
:param type: The type of the resource.
3333
:type type: str, optional
3434
"""
3535
super().__init__(kwargs)
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

tests/v2/cassettes/test_scenarios/test_submit_metrics_returns_payload_accepted_response.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
interactions:
22
- request:
3-
body: '{"series":[{"metric":"system.load.1","points":[{"timestamp":1652898272,"value":0.7}],"type":0}]}'
3+
body: '{"series":[{"metric":"system.load.1","points":[{"timestamp":1657662336,"value":0.7}],"resources":[{"name":"dummyhost","type":"host"}],"type":0}]}'
44
headers:
55
accept:
66
- application/json

tests/v2/features/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)