-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Regenerate client from commit 1289c722 of spec repo (#891)
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>
- Loading branch information
1 parent
8d9228b
commit b8beea1
Showing
5 changed files
with
57 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
""" | ||
Search test logs returns "OK" response | ||
""" | ||
|
||
from datetime import datetime | ||
from dateutil.relativedelta import relativedelta | ||
from datadog_api_client.v1 import ApiClient, Configuration | ||
from datadog_api_client.v1.api.logs_api import LogsApi | ||
from datadog_api_client.v1.model.logs_list_request import LogsListRequest | ||
from datadog_api_client.v1.model.logs_list_request_time import LogsListRequestTime | ||
from datadog_api_client.v1.model.logs_sort import LogsSort | ||
|
||
body = LogsListRequest( | ||
index="main", | ||
query="service:web*", | ||
sort=LogsSort("asc"), | ||
time=LogsListRequestTime( | ||
_from=(datetime.now() + relativedelta(hours=-1)).isoformat(timespec="seconds"), | ||
timezone="Europe/Paris", | ||
to=datetime.now().isoformat(timespec="seconds"), | ||
), | ||
) | ||
|
||
configuration = Configuration() | ||
with ApiClient(configuration) as api_client: | ||
api_instance = LogsApi(api_client) | ||
response = api_instance.list_logs(body=body) | ||
|
||
print(response) |
1 change: 1 addition & 0 deletions
1
tests/v1/cassettes/test_scenarios/test_search_test_logs_returns_ok_response.frozen
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
2022-03-16T20:19:15.972Z |
20 changes: 20 additions & 0 deletions
20
tests/v1/cassettes/test_scenarios/test_search_test_logs_returns_ok_response.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
interactions: | ||
- request: | ||
body: '{"index":"main","query":"service:web*","sort":"asc","time":{"from":"2022-03-16T19:19:15.972Z","timezone":"Europe/Paris","to":"2022-03-16T20:19:15.972Z"}}' | ||
headers: | ||
accept: | ||
- application/json | ||
content-type: | ||
- application/json | ||
method: POST | ||
uri: https://api.datadoghq.com/api/v1/logs-queries/list | ||
response: | ||
body: | ||
string: '{"status":"done","nextLogId":null,"logs":[],"requestId":"pddv1ChY1NmxlTHZVZlFpNnN6WGJLQUg4VGNBIi0KHfuLOnaa0UteA_7Jc4dRCbmb4YhQqyZLVXBRZ-eSEgzkoIm-nmhrtG8HKG0"}' | ||
headers: | ||
content-type: | ||
- application/json | ||
status: | ||
code: 200 | ||
message: OK | ||
version: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters