Skip to content

Commit

Permalink
Regenerate client from commit 75a48ed4 of spec repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ci.datadog-api-spec committed Oct 24, 2022
1 parent e14074a commit 6de737f
Show file tree
Hide file tree
Showing 8 changed files with 105 additions and 7 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.4",
"regenerated": "2022-10-20 09:07:34.924350",
"spec_repo_commit": "148c906a"
"regenerated": "2022-10-24 16:25:56.280883",
"spec_repo_commit": "75a48ed4"
},
"v2": {
"apigentools_version": "1.6.4",
"regenerated": "2022-10-20 09:07:34.965011",
"spec_repo_commit": "148c906a"
"regenerated": "2022-10-24 16:25:56.293735",
"spec_repo_commit": "75a48ed4"
}
}
}
20 changes: 20 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4606,6 +4606,8 @@ components:
description: The search query - following the log search syntax.
example: service:web* AND @http.status_code:[200 TO 299]
type: string
storage_tier:
$ref: '#/components/schemas/LogsStorageTier'
to:
default: now
description: The maximum time for the requested logs, supports date math
Expand Down Expand Up @@ -4685,6 +4687,17 @@ components:
x-enum-varnames:
- ASCENDING
- DESCENDING
LogsStorageTier:
default: indexes
description: Specifies storage type as indexes or online-archives
enum:
- indexes
- online-archives
example: indexes
type: string
x-enum-varnames:
- INDEXES
- ONLINE_ARCHIVES
LogsWarning:
description: A warning message indicating something that went wrong with the
query
Expand Down Expand Up @@ -12180,6 +12193,13 @@ paths:
schema:
format: date-time
type: string
- description: Specifies the storage type to be used
example: indexes
in: query
name: filter[storage_tier]
required: false
schema:
$ref: '#/components/schemas/LogsStorageTier'
- description: Order of logs in results.
in: query
name: sort
Expand Down
7 changes: 7 additions & 0 deletions docs/datadog_api_client.v2.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2010,6 +2010,13 @@ logs\_sort\_order
:members:
:show-inheritance:

logs\_storage\_tier
-------------------

.. automodule:: datadog_api_client.v2.model.logs_storage_tier
:members:
:show-inheritance:

logs\_warning
-------------

Expand Down
18 changes: 18 additions & 0 deletions src/datadog_api_client/v2/api/logs_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from datadog_api_client.v2.model.logs_aggregate_response import LogsAggregateResponse
from datadog_api_client.v2.model.logs_aggregate_request import LogsAggregateRequest
from datadog_api_client.v2.model.logs_list_response import LogsListResponse
from datadog_api_client.v2.model.logs_storage_tier import LogsStorageTier
from datadog_api_client.v2.model.logs_sort import LogsSort
from datadog_api_client.v2.model.log import Log
from datadog_api_client.v2.model.logs_list_request import LogsListRequest
Expand Down Expand Up @@ -106,6 +107,11 @@ def __init__(self, api_client=None):
"attribute": "filter[to]",
"location": "query",
},
"filter_storage_tier": {
"openapi_types": (LogsStorageTier,),
"attribute": "filter[storage_tier]",
"location": "query",
},
"sort": {
"openapi_types": (LogsSort,),
"attribute": "sort",
Expand Down Expand Up @@ -293,6 +299,7 @@ def list_logs_get(
filter_index: Union[str, UnsetType] = unset,
filter_from: Union[datetime, UnsetType] = unset,
filter_to: Union[datetime, UnsetType] = unset,
filter_storage_tier: Union[LogsStorageTier, UnsetType] = unset,
sort: Union[LogsSort, UnsetType] = unset,
page_cursor: Union[str, UnsetType] = unset,
page_limit: Union[int, UnsetType] = unset,
Expand All @@ -317,6 +324,8 @@ def list_logs_get(
:type filter_from: datetime, optional
:param filter_to: Maximum timestamp for requested logs.
:type filter_to: datetime, optional
:param filter_storage_tier: Specifies the storage type to be used
:type filter_storage_tier: LogsStorageTier, optional
:param sort: Order of logs in results.
:type sort: LogsSort, optional
:param page_cursor: List following results with a cursor provided in the previous query.
Expand All @@ -338,6 +347,9 @@ def list_logs_get(
if filter_to is not unset:
kwargs["filter_to"] = filter_to

if filter_storage_tier is not unset:
kwargs["filter_storage_tier"] = filter_storage_tier

if sort is not unset:
kwargs["sort"] = sort

Expand All @@ -356,6 +368,7 @@ def list_logs_get_with_pagination(
filter_index: Union[str, UnsetType] = unset,
filter_from: Union[datetime, UnsetType] = unset,
filter_to: Union[datetime, UnsetType] = unset,
filter_storage_tier: Union[LogsStorageTier, UnsetType] = unset,
sort: Union[LogsSort, UnsetType] = unset,
page_cursor: Union[str, UnsetType] = unset,
page_limit: Union[int, UnsetType] = unset,
Expand All @@ -373,6 +386,8 @@ def list_logs_get_with_pagination(
:type filter_from: datetime, optional
:param filter_to: Maximum timestamp for requested logs.
:type filter_to: datetime, optional
:param filter_storage_tier: Specifies the storage type to be used
:type filter_storage_tier: LogsStorageTier, optional
:param sort: Order of logs in results.
:type sort: LogsSort, optional
:param page_cursor: List following results with a cursor provided in the previous query.
Expand All @@ -396,6 +411,9 @@ def list_logs_get_with_pagination(
if filter_to is not unset:
kwargs["filter_to"] = filter_to

if filter_storage_tier is not unset:
kwargs["filter_storage_tier"] = filter_storage_tier

if sort is not unset:
kwargs["sort"] = sort

Expand Down
16 changes: 15 additions & 1 deletion src/datadog_api_client/v2/model/logs_query_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations

from typing import List, Union
from typing import List, TYPE_CHECKING, Union

from datadog_api_client.model_utils import (
ModelNormal,
Expand All @@ -13,20 +13,28 @@
)


if TYPE_CHECKING:
from datadog_api_client.v2.model.logs_storage_tier import LogsStorageTier


class LogsQueryFilter(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v2.model.logs_storage_tier import LogsStorageTier

return {
"_from": (str,),
"indexes": ([str],),
"query": (str,),
"storage_tier": (LogsStorageTier,),
"to": (str,),
}

attribute_map = {
"_from": "from",
"indexes": "indexes",
"query": "query",
"storage_tier": "storage_tier",
"to": "to",
}

Expand All @@ -35,6 +43,7 @@ def __init__(
_from: Union[str, UnsetType] = unset,
indexes: Union[List[str], UnsetType] = unset,
query: Union[str, UnsetType] = unset,
storage_tier: Union[LogsStorageTier, UnsetType] = unset,
to: Union[str, UnsetType] = unset,
**kwargs,
):
Expand All @@ -50,6 +59,9 @@ def __init__(
:param query: The search query - following the log search syntax.
:type query: str, optional
:param storage_tier: Specifies storage type as indexes or online-archives
:type storage_tier: LogsStorageTier, optional
:param to: The maximum time for the requested logs, supports date math and regular timestamps (milliseconds).
:type to: str, optional
"""
Expand All @@ -59,6 +71,8 @@ def __init__(
kwargs["indexes"] = indexes
if query is not unset:
kwargs["query"] = query
if storage_tier is not unset:
kwargs["storage_tier"] = storage_tier
if to is not unset:
kwargs["to"] = to
super().__init__(kwargs)
38 changes: 38 additions & 0 deletions src/datadog_api_client/v2/model/logs_storage_tier.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations


from datadog_api_client.model_utils import (
ModelSimple,
cached_property,
)

from typing import ClassVar


class LogsStorageTier(ModelSimple):
"""
Specifies storage type as indexes or online-archives
:param value: If omitted defaults to "indexes". Must be one of ["indexes", "online-archives"].
:type value: str
"""

allowed_values = {
"indexes",
"online-archives",
}
INDEXES: ClassVar["LogsStorageTier"]
ONLINE_ARCHIVES: ClassVar["LogsStorageTier"]

@cached_property
def openapi_types(_):
return {
"value": (str,),
}


LogsStorageTier.INDEXES = LogsStorageTier("indexes")
LogsStorageTier.ONLINE_ARCHIVES = LogsStorageTier("online-archives")
1 change: 1 addition & 0 deletions src/datadog_api_client/v2/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@
from datadog_api_client.v2.model.logs_response_metadata_page import LogsResponseMetadataPage
from datadog_api_client.v2.model.logs_sort import LogsSort
from datadog_api_client.v2.model.logs_sort_order import LogsSortOrder
from datadog_api_client.v2.model.logs_storage_tier import LogsStorageTier
from datadog_api_client.v2.model.logs_warning import LogsWarning
from datadog_api_client.v2.model.metric import Metric
from datadog_api_client.v2.model.metric_active_configuration_type import MetricActiveConfigurationType
Expand Down
4 changes: 2 additions & 2 deletions tests/v2/features/logs.feature
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Feature: Logs
Scenario: Aggregate events returns "Bad Request" response
Given a valid "appKeyAuth" key in the system
And new "AggregateLogs" request
And body with value {"compute": [{"aggregation": "pc90", "interval": "5m", "metric": "@duration", "type": "total"}], "filter": {"from": "now-15m", "indexes": ["main", "web"], "query": "service:web* AND @http.status_code:[200 TO 299]", "to": "now"}, "group_by": [{"facet": "host", "histogram": {"interval": 10, "max": 100, "min": 50}, "limit": 10, "sort": {"aggregation": "count", "order": "asc"}, "total": false}], "options": {"timezone": "GMT"}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ=="}}
And body with value {"compute": [{"aggregation": "pc90", "interval": "5m", "metric": "@duration", "type": "total"}], "filter": {"from": "now-15m", "indexes": ["main", "web"], "query": "service:web* AND @http.status_code:[200 TO 299]", "storage_tier": "indexes", "to": "now"}, "group_by": [{"facet": "host", "histogram": {"interval": 10, "max": 100, "min": 50}, "limit": 10, "sort": {"aggregation": "count", "order": "asc"}, "total": false}], "options": {"timezone": "GMT"}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ=="}}
When the request is sent
Then the response status is 400 Bad Request

Expand Down Expand Up @@ -77,7 +77,7 @@ Feature: Logs
Scenario: Search logs returns "Bad Request" response
Given a valid "appKeyAuth" key in the system
And new "ListLogs" request
And body with value {"filter": {"from": "now-15m", "indexes": ["main", "web"], "query": "service:web* AND @http.status_code:[200 TO 299]", "to": "now"}, "options": {"timezone": "GMT"}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "timestamp"}
And body with value {"filter": {"from": "now-15m", "indexes": ["main", "web"], "query": "service:web* AND @http.status_code:[200 TO 299]", "storage_tier": "indexes", "to": "now"}, "options": {"timezone": "GMT"}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "timestamp"}
When the request is sent
Then the response status is 400 Bad Request

Expand Down

0 comments on commit 6de737f

Please sign in to comment.