-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update header for logs search endpoints (#2173)
Co-authored-by: ci.datadog-api-spec <[email protected]>
- Loading branch information
1 parent
0a91af4
commit 66126da
Showing
9 changed files
with
124 additions
and
38 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
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
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,5 @@ | ||
# Search logs (GET) returns "OK" response with pagination | ||
|
||
require "datadog_api_client" | ||
api_instance = DatadogAPIClient::V2::LogsAPI.new | ||
api_instance.list_logs_get_with_pagination() { |item| puts item } |
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,23 @@ | ||
# Search logs returns "OK" response | ||
|
||
require "datadog_api_client" | ||
api_instance = DatadogAPIClient::V2::LogsAPI.new | ||
|
||
body = DatadogAPIClient::V2::LogsListRequest.new({ | ||
filter: DatadogAPIClient::V2::LogsQueryFilter.new({ | ||
query: "datadog-agent", | ||
indexes: [ | ||
"main", | ||
], | ||
from: "2020-09-17T11:48:36+01:00", | ||
to: "2020-09-17T12:48:36+01:00", | ||
}), | ||
sort: DatadogAPIClient::V2::LogsSort::TIMESTAMP_ASCENDING, | ||
page: DatadogAPIClient::V2::LogsListRequestPage.new({ | ||
limit: 5, | ||
}), | ||
}) | ||
opts = { | ||
body: body, | ||
} | ||
p api_instance.list_logs(opts) |
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 logs (POST) returns "OK" response with pagination | ||
|
||
require "datadog_api_client" | ||
api_instance = DatadogAPIClient::V2::LogsAPI.new | ||
|
||
body = DatadogAPIClient::V2::LogsListRequest.new({ | ||
filter: DatadogAPIClient::V2::LogsQueryFilter.new({ | ||
from: "now-15m", | ||
indexes: [ | ||
"main", | ||
"web", | ||
], | ||
query: "service:web* AND @http.status_code:[200 TO 299]", | ||
storage_tier: DatadogAPIClient::V2::LogsStorageTier::INDEXES, | ||
to: "now", | ||
}), | ||
options: DatadogAPIClient::V2::LogsQueryOptions.new({ | ||
timezone: "GMT", | ||
}), | ||
page: DatadogAPIClient::V2::LogsListRequestPage.new({ | ||
cursor: "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", | ||
limit: 25, | ||
}), | ||
sort: DatadogAPIClient::V2::LogsSort::TIMESTAMP_ASCENDING, | ||
}) | ||
opts = { | ||
body: body, | ||
} | ||
api_instance.list_logs_with_pagination(opts) { |item| puts item } |
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