Skip to content

Commit e0c3d20

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit fea6d10 of spec repo (#852)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 2e7754f commit e0c3d20

File tree

6 files changed

+77
-5
lines changed

6 files changed

+77
-5
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-02-23 10:10:09.155076",
8-
"spec_repo_commit": "cf974e8"
7+
"regenerated": "2022-02-25 21:39:14.871369",
8+
"spec_repo_commit": "fea6d10"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.2",
12-
"regenerated": "2022-02-23 10:10:09.166979",
13-
"spec_repo_commit": "cf974e8"
12+
"regenerated": "2022-02-25 21:39:14.885431",
13+
"spec_repo_commit": "fea6d10"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3427,7 +3427,6 @@ components:
34273427
readOnly: true
34283428
type: object
34293429
MetricBulkConfigureTagsType:
3430-
type: string
34313430
default: metric_bulk_configure_tags
34323431
description: The metric bulk configure tags resource.
34333432
enum:
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
"""
2+
Aggregate compute events with group by returns "OK" response
3+
"""
4+
5+
from datadog_api_client.v2 import ApiClient, Configuration
6+
from datadog_api_client.v2.api.logs_api import LogsApi
7+
from datadog_api_client.v2.model.logs_aggregate_request import LogsAggregateRequest
8+
from datadog_api_client.v2.model.logs_aggregate_sort import LogsAggregateSort
9+
from datadog_api_client.v2.model.logs_aggregate_sort_type import LogsAggregateSortType
10+
from datadog_api_client.v2.model.logs_aggregation_function import LogsAggregationFunction
11+
from datadog_api_client.v2.model.logs_compute import LogsCompute
12+
from datadog_api_client.v2.model.logs_compute_type import LogsComputeType
13+
from datadog_api_client.v2.model.logs_group_by import LogsGroupBy
14+
from datadog_api_client.v2.model.logs_group_by_missing import LogsGroupByMissing
15+
from datadog_api_client.v2.model.logs_group_by_total import LogsGroupByTotal
16+
from datadog_api_client.v2.model.logs_query_filter import LogsQueryFilter
17+
from datadog_api_client.v2.model.logs_sort_order import LogsSortOrder
18+
19+
body = LogsAggregateRequest(
20+
compute=[
21+
LogsCompute(aggregation=LogsAggregationFunction("count"), interval="5m", type=LogsComputeType("timeseries"))
22+
],
23+
filter=LogsQueryFilter(_from="now-15m", indexes=["main"], query="*", to="now"),
24+
group_by=[
25+
LogsGroupBy(
26+
facet="host",
27+
missing=LogsGroupByMissing("miss"),
28+
sort=LogsAggregateSort(
29+
type=LogsAggregateSortType("measure"),
30+
order=LogsSortOrder("asc"),
31+
aggregation=LogsAggregationFunction("pc90"),
32+
metric="@duration",
33+
),
34+
total=LogsGroupByTotal("recall"),
35+
)
36+
],
37+
)
38+
39+
configuration = Configuration()
40+
with ApiClient(configuration) as api_client:
41+
api_instance = LogsApi(api_client)
42+
response = api_instance.aggregate_logs(body=body)
43+
44+
print(response)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2022-02-23T10:58:05.766Z
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
interactions:
2+
- request:
3+
body: '{"compute":[{"aggregation":"count","interval":"5m","type":"timeseries"}],"filter":{"from":"now-15m","indexes":["main"],"query":"*","to":"now"},"group_by":[{"facet":"host","missing":"miss","sort":{"aggregation":"pc90","metric":"@duration","order":"asc","type":"measure"},"total":"recall"}]}'
4+
headers:
5+
accept:
6+
- application/json
7+
content-type:
8+
- application/json
9+
method: POST
10+
uri: https://api.datadoghq.com/api/v2/logs/analytics/aggregate
11+
response:
12+
body:
13+
string: '{"meta":{"status":"done","request_id":"pddv1ChZjajVGdnloOFRydURjT01RakZPRGJRIiwKHAubHcvWGIRKaJwUb1Qgc-peEYojhMk6Z3opAHYSDOMLcdT0IUoqNWaYdA","elapsed":10},"data":{"buckets":[{"computes":{"c0":[{"value":28,"time":"2022-02-23T10:40:00.000Z"},{"value":80,"time":"2022-02-23T10:45:00.000Z"},{"value":80,"time":"2022-02-23T10:50:00.000Z"},{"value":42,"time":"2022-02-23T10:55:00.000Z"}]},"by":{"host":"07266d86-ec5b-40cb-4060-e4d9"}},{"computes":{"c0":[{"value":32,"time":"2022-02-23T10:40:00.000Z"},{"value":80,"time":"2022-02-23T10:45:00.000Z"},{"value":80,"time":"2022-02-23T10:50:00.000Z"},{"value":40,"time":"2022-02-23T10:55:00.000Z"}]},"by":{"host":"4a5a50c3-5d34-4009-74aa-38d8"}},{"computes":{"c0":[{"value":28,"time":"2022-02-23T10:40:00.000Z"},{"value":80,"time":"2022-02-23T10:45:00.000Z"},{"value":80,"time":"2022-02-23T10:50:00.000Z"},{"value":44,"time":"2022-02-23T10:55:00.000Z"}]},"by":{"host":"3a1410f9-5b3b-44a8-52bc-5269"}},{"computes":{"c0":[{"value":32,"time":"2022-02-23T10:40:00.000Z"},{"value":80,"time":"2022-02-23T10:45:00.000Z"},{"value":80,"time":"2022-02-23T10:50:00.000Z"},{"value":42,"time":"2022-02-23T10:55:00.000Z"}]},"by":{"host":"e17b600e-a2cf-4d23-4eb2-e648"}},{"computes":{"c0":[{"value":28,"time":"2022-02-23T10:40:00.000Z"},{"value":80,"time":"2022-02-23T10:45:00.000Z"},{"value":80,"time":"2022-02-23T10:50:00.000Z"},{"value":44,"time":"2022-02-23T10:55:00.000Z"}]},"by":{"host":"3a6c8709-df68-49b2-5992-351d"}},{"computes":{"c0":[{"value":28,"time":"2022-02-23T10:40:00.000Z"},{"value":80,"time":"2022-02-23T10:45:00.000Z"},{"value":80,"time":"2022-02-23T10:50:00.000Z"},{"value":42,"time":"2022-02-23T10:55:00.000Z"}]},"by":{"host":"f301493f-d994-4237-4a99-b382"}},{"computes":{"c0":[{"value":28,"time":"2022-02-23T10:40:00.000Z"},{"value":80,"time":"2022-02-23T10:45:00.000Z"},{"value":80,"time":"2022-02-23T10:50:00.000Z"},{"value":42,"time":"2022-02-23T10:55:00.000Z"}]},"by":{"host":"4d77dd12-b3be-41fd-753b-fcbb"}},{"computes":{"c0":[{"value":32,"time":"2022-02-23T10:40:00.000Z"},{"value":80,"time":"2022-02-23T10:45:00.000Z"},{"value":80,"time":"2022-02-23T10:50:00.000Z"},{"value":40,"time":"2022-02-23T10:55:00.000Z"}]},"by":{"host":"2961e831-36b5-4c2b-5853-b6d5"}},{"computes":{"c0":[{"value":32,"time":"2022-02-23T10:40:00.000Z"},{"value":80,"time":"2022-02-23T10:45:00.000Z"},{"value":80,"time":"2022-02-23T10:50:00.000Z"},{"value":42,"time":"2022-02-23T10:55:00.000Z"}]},"by":{"host":"cec04667-4f47-4d64-4bf1-b449"}},{"computes":{"c0":[{"value":32,"time":"2022-02-23T10:40:00.000Z"},{"value":80,"time":"2022-02-23T10:45:00.000Z"},{"value":80,"time":"2022-02-23T10:50:00.000Z"},{"value":42,"time":"2022-02-23T10:55:00.000Z"}]},"by":{"host":"352e5c4f-9d7d-4b5e-414f-4199"}},{"computes":{"c0":[{"value":332,"time":"2022-02-23T10:40:00.000Z"},{"value":880,"time":"2022-02-23T10:45:00.000Z"},{"value":880,"time":"2022-02-23T10:50:00.000Z"},{"value":460,"time":"2022-02-23T10:55:00.000Z"}]},"by":{"host":"recall"}}]}}'
14+
headers:
15+
content-type:
16+
- application/json
17+
status:
18+
code: 200
19+
message: OK
20+
version: 1

tests/v2/features/logs.feature

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ Feature: Logs
1414
When the request is sent
1515
Then the response status is 200 OK
1616

17+
@team:DataDog/logs-app
18+
Scenario: Aggregate compute events with group by returns "OK" response
19+
Given a valid "appKeyAuth" key in the system
20+
And new "AggregateLogs" request
21+
And body with value {"compute": [{"aggregation": "count", "interval": "5m", "type": "timeseries"}], "filter": {"from": "now-15m", "indexes": ["main"], "query": "*", "to": "now"}, "group_by": [{"facet": "host", "missing": "miss", "sort": {"type": "measure", "order": "asc", "aggregation": "pc90", "metric": "@duration"}, "total": "recall"}]}
22+
When the request is sent
23+
Then the response status is 200 OK
24+
1725
@generated @skip @team:DataDog/logs-app
1826
Scenario: Aggregate events returns "Bad Request" response
1927
Given a valid "appKeyAuth" key in the system

0 commit comments

Comments
 (0)