Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7896,7 +7896,7 @@ components:
type: integer
query:
description: The search query - following the log search syntax.
example: "service:web* AND @http.status_code:[200 TO 299]"
example: "service:web-api AND @http.status_code:[200 TO 299]"
type: string
sort:
$ref: "#/components/schemas/LogsSort"
Expand Down Expand Up @@ -35245,7 +35245,7 @@ paths:
value:
index: "retention-3,retention-15"
limit: 25
query: "service:web* AND @http.status_code:[200 TO 299]"
query: "service:web-api AND @http.status_code:[200 TO 299]"
sort: desc
time:
from: "2020-02-02T02:02:02.202Z"
Expand Down
28 changes: 14 additions & 14 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76857,10 +76857,10 @@ components:
type: string
limit:
default: 10
description: Maximum number of logs in the response.
description: Requested maximum number of logs in the response.
example: 25
format: int32
maximum: 1000
maximum: 5000
type: integer
type: object
LogsListResponse:
Expand Down Expand Up @@ -76955,7 +76955,7 @@ components:
query:
default: "*"
description: The search query - following the log search syntax.
example: "service:web* AND @http.status_code:[200 TO 299]"
example: "service:web-api AND @http.status_code:[200 TO 299]"
type: string
type: object
LogsMetricGroupBy:
Expand Down Expand Up @@ -77028,7 +77028,7 @@ components:
properties:
query:
description: The search query - following the log search syntax.
example: "service:web* AND @http.status_code:[200 TO 299]"
example: "service:web-api AND @http.status_code:[200 TO 299]"
type: string
type: object
LogsMetricResponseGroupBy:
Expand Down Expand Up @@ -77117,7 +77117,7 @@ components:
query:
default: "*"
description: The search query - following the log search syntax.
example: "service:web* AND @http.status_code:[200 TO 299]"
example: "service:web-api AND @http.status_code:[200 TO 299]"
type: string
storage_tier:
$ref: "#/components/schemas/LogsStorageTier"
Expand Down Expand Up @@ -197058,7 +197058,7 @@ paths:
indexes:
- main
- web
query: service:web* AND @http.status_code:[200 TO 299]
query: service:web-api AND @http.status_code:[200 TO 299]
storage_tier: indexes
to: now
group_by:
Expand Down Expand Up @@ -198151,7 +198151,7 @@ paths:
include_percentiles: true
path: "@duration"
filter:
query: "service:web* AND @http.status_code:[200 TO 299]"
query: "service:web-api AND @http.status_code:[200 TO 299]"
group_by:
- path: "@http.status_code"
tag_name: status_code
Expand Down Expand Up @@ -198189,7 +198189,7 @@ paths:
include_percentiles: true
path: "@duration"
filter:
query: service:web* AND @http.status_code:[200 TO 299]
query: service:web-api AND @http.status_code:[200 TO 299]
group_by:
- path: "@http.status_code"
tag_name: status_code
Expand All @@ -198213,7 +198213,7 @@ paths:
include_percentiles: true
path: "@duration"
filter:
query: "service:web* AND @http.status_code:[200 TO 299]"
query: "service:web-api AND @http.status_code:[200 TO 299]"
group_by:
- path: "@http.status_code"
tag_name: status_code
Expand Down Expand Up @@ -198279,7 +198279,7 @@ paths:
include_percentiles: true
path: "@duration"
filter:
query: "service:web* AND @http.status_code:[200 TO 299]"
query: "service:web-api AND @http.status_code:[200 TO 299]"
group_by:
- path: "@http.status_code"
tag_name: status_code
Expand Down Expand Up @@ -198319,7 +198319,7 @@ paths:
compute:
include_percentiles: true
filter:
query: service:web* AND @http.status_code:[200 TO 299]
query: service:web-api AND @http.status_code:[200 TO 299]
group_by:
- path: "@http.status_code"
tag_name: status_code
Expand All @@ -198342,7 +198342,7 @@ paths:
include_percentiles: true
path: "@duration"
filter:
query: "service:web* AND @http.status_code:[200 TO 299]"
query: "service:web-api AND @http.status_code:[200 TO 299]"
group_by:
- path: "@http.status_code"
tag_name: status_code
Expand Down Expand Up @@ -199034,7 +199034,7 @@ paths:
schema:
default: 10
format: int32
maximum: 1000
maximum: 5000
type: integer
responses:
"200":
Expand Down Expand Up @@ -199101,7 +199101,7 @@ paths:
indexes:
- main
- web
query: service:web* AND @http.status_code:[200 TO 299]
query: service:web-api AND @http.status_code:[200 TO 299]
storage_tier: indexes
to: now
options:
Expand Down
2 changes: 1 addition & 1 deletion examples/v1/logs/ListLogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

body = LogsListRequest(
index="retention-3,retention-15",
query="service:web* AND @http.status_code:[200 TO 299]",
query="service:web-api AND @http.status_code:[200 TO 299]",
sort=LogsSort.TIME_ASCENDING,
time=LogsListRequestTime(
_from=datetime(2020, 2, 2, 2, 2, 2, 202000, tzinfo=tzutc()),
Expand Down
2 changes: 1 addition & 1 deletion examples/v2/logs-metrics/UpdateLogsMetric.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
type=LogsMetricType.LOGS_METRICS,
attributes=LogsMetricUpdateAttributes(
filter=LogsMetricFilter(
query="service:web* AND @http.status_code:[200 TO 299]-updated",
query="service:web-api AND @http.status_code:[200 TO 299]-updated",
),
),
),
Expand Down
2 changes: 1 addition & 1 deletion examples/v2/logs/ListLogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"main",
"web",
],
query="service:web* AND @http.status_code:[200 TO 299]",
query="service:web-api AND @http.status_code:[200 TO 299]",
storage_tier=LogsStorageTier.INDEXES,
to="now",
),
Expand Down
25 changes: 25 additions & 0 deletions examples/v2/logs/ListLogsGet_3179484528.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"""
Search logs (GET) with a page limit of 5000 returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.logs_api import LogsApi
from datetime import datetime
from dateutil.tz import tzoffset

configuration = Configuration()
configuration.access_token = environ["DD_BEARER_TOKEN"]
with ApiClient(configuration) as api_client:
api_instance = LogsApi(api_client)
response = api_instance.list_logs_get(
filter_query="datadog-agent",
filter_indexes=[
"main",
],
filter_from=datetime(2020, 9, 17, 11, 48, 36, tzinfo=tzoffset(None, 3600)),
filter_to=datetime(2020, 9, 17, 12, 48, 36, tzinfo=tzoffset(None, 3600)),
page_limit=5000,
)

print(response)
34 changes: 34 additions & 0 deletions examples/v2/logs/ListLogs_2789021011.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
"""
Search logs with a page limit above 1000 returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.logs_api import LogsApi
from datadog_api_client.v2.model.logs_list_request import LogsListRequest
from datadog_api_client.v2.model.logs_list_request_page import LogsListRequestPage
from datadog_api_client.v2.model.logs_query_filter import LogsQueryFilter
from datadog_api_client.v2.model.logs_sort import LogsSort

body = LogsListRequest(
filter=LogsQueryFilter(
query="datadog-agent",
indexes=[
"main",
],
_from="2020-09-17T11:48:36+01:00",
to="2020-09-17T12:48:36+01:00",
),
sort=LogsSort.TIMESTAMP_ASCENDING,
page=LogsListRequestPage(
limit=5000,
),
)

configuration = Configuration()
configuration.access_token = environ["DD_BEARER_TOKEN"]
with ApiClient(configuration) as api_client:
api_instance = LogsApi(api_client)
response = api_instance.list_logs(body=body)

print(response)
2 changes: 1 addition & 1 deletion examples/v2/logs/ListLogs_534975433.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"main",
"web",
],
query="service:web* AND @http.status_code:[200 TO 299]",
query="service:web-api AND @http.status_code:[200 TO 299]",
storage_tier=LogsStorageTier.INDEXES,
to="now",
),
Expand Down
2 changes: 1 addition & 1 deletion src/datadog_api_client/v2/api/logs_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def __init__(self, api_client=None):
},
"page_limit": {
"validation": {
"inclusive_maximum": 1000,
"inclusive_maximum": 5000,
},
"openapi_types": (int,),
"attribute": "page[limit]",
Expand Down
4 changes: 2 additions & 2 deletions src/datadog_api_client/v2/model/logs_list_request_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
class LogsListRequestPage(ModelNormal):
validations = {
"limit": {
"inclusive_maximum": 1000,
"inclusive_maximum": 5000,
},
}

Expand All @@ -39,7 +39,7 @@ def __init__(self_, cursor: Union[str, UnsetType] = unset, limit: Union[int, Uns
:param cursor: List following results with a cursor provided in the previous query.
:type cursor: str, optional

:param limit: Maximum number of logs in the response.
:param limit: Requested maximum number of logs in the response.
:type limit: int, optional
"""
if cursor is not unset:
Expand Down
14 changes: 14 additions & 0 deletions tests/generated-test/test-runner-data/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7028,6 +7028,13 @@
"scenario": "Get a quick list of logs returns \"OK\" response",
"version": "v2"
},
{
"feature": "Logs",
"feature_file": "../../v2/features/logs.feature",
"file": "v2/logs/search-logs-get-with-a-page-limit-of-5000-returns-ok-response.json",
"scenario": "Search logs (GET) with a page limit of 5000 returns \"OK\" response",
"version": "v2"
},
{
"feature": "Logs",
"feature_file": "../../v2/features/logs.feature",
Expand All @@ -7042,6 +7049,13 @@
"scenario": "Search logs returns \"OK\" response with pagination",
"version": "v2"
},
{
"feature": "Logs",
"feature_file": "../../v2/features/logs.feature",
"file": "v2/logs/search-logs-with-a-page-limit-above-1000-returns-ok-response.json",
"scenario": "Search logs with a page limit above 1000 returns \"OK\" response",
"version": "v2"
},
{
"feature": "Logs",
"feature_file": "../../v2/features/logs.feature",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
{
"api": "Logs",
"expected_status": 200,
"feature": "Logs",
"id": "v2/Logs/Search logs (GET) with a page limit of 5000 returns \"OK\" response",
"operation_id": "ListLogsGet",
"request": {
"body": null,
"content_type": null,
"method": "GET",
"pagination": false,
"parameters": [
{
"explode": null,
"in": "query",
"name": "filter[query]",
"required": false,
"schema": {
"format": null,
"ref": null,
"type": "string"
},
"source": {
"type": "literal",
"value": "datadog-agent"
},
"style": null
},
{
"explode": false,
"in": "query",
"name": "filter[indexes]",
"required": false,
"schema": {
"format": null,
"items": {
"format": null,
"ref": null,
"type": "string"
},
"ref": null,
"type": "array"
},
"source": {
"type": "literal",
"value": [
"main"
]
},
"style": null
},
{
"explode": null,
"in": "query",
"name": "filter[from]",
"required": false,
"schema": {
"format": "date-time",
"ref": null,
"type": "string"
},
"source": {
"type": "literal",
"value": "2020-09-17T11:48:36+01:00"
},
"style": null
},
{
"explode": null,
"in": "query",
"name": "filter[to]",
"required": false,
"schema": {
"format": "date-time",
"ref": null,
"type": "string"
},
"source": {
"type": "literal",
"value": "2020-09-17T12:48:36+01:00"
},
"style": null
},
{
"explode": null,
"in": "query",
"name": "page[limit]",
"required": false,
"schema": {
"format": "int32",
"ref": null,
"type": "integer"
},
"source": {
"type": "literal",
"value": 5000
},
"style": null
}
],
"path": "/api/v2/logs/events"
},
"scenario": "Search logs (GET) with a page limit of 5000 returns \"OK\" response",
"schema_version": 1,
"version": "v2"
}
Loading
Loading