-
Notifications
You must be signed in to change notification settings - Fork 52
Expand file tree
/
Copy pathlogs_index_update_request.py
More file actions
134 lines (112 loc) · 6.2 KB
/
logs_index_update_request.py
File metadata and controls
134 lines (112 loc) · 6.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# 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 typing import List, Union, TYPE_CHECKING
from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
none_type,
unset,
UnsetType,
)
if TYPE_CHECKING:
from datadog_api_client.v1.model.logs_daily_limit_reset import LogsDailyLimitReset
from datadog_api_client.v1.model.logs_exclusion import LogsExclusion
from datadog_api_client.v1.model.logs_filter import LogsFilter
class LogsIndexUpdateRequest(ModelNormal):
validations = {
"daily_limit_warning_threshold_percentage": {
"inclusive_maximum": 99.99,
"inclusive_minimum": 50,
},
}
@cached_property
def openapi_types(_):
from datadog_api_client.v1.model.logs_daily_limit_reset import LogsDailyLimitReset
from datadog_api_client.v1.model.logs_exclusion import LogsExclusion
from datadog_api_client.v1.model.logs_filter import LogsFilter
return {
"daily_limit": (int,),
"daily_limit_reset": (LogsDailyLimitReset,),
"daily_limit_warning_threshold_percentage": (float,),
"disable_daily_limit": (bool,),
"exclusion_filters": ([LogsExclusion],),
"filter": (LogsFilter,),
"num_flex_logs_retention_days": (int, none_type),
"num_retention_days": (int,),
"tags": ([str],),
}
attribute_map = {
"daily_limit": "daily_limit",
"daily_limit_reset": "daily_limit_reset",
"daily_limit_warning_threshold_percentage": "daily_limit_warning_threshold_percentage",
"disable_daily_limit": "disable_daily_limit",
"exclusion_filters": "exclusion_filters",
"filter": "filter",
"num_flex_logs_retention_days": "num_flex_logs_retention_days",
"num_retention_days": "num_retention_days",
"tags": "tags",
}
def __init__(
self_,
filter: LogsFilter,
daily_limit: Union[int, UnsetType] = unset,
daily_limit_reset: Union[LogsDailyLimitReset, UnsetType] = unset,
daily_limit_warning_threshold_percentage: Union[float, UnsetType] = unset,
disable_daily_limit: Union[bool, UnsetType] = unset,
exclusion_filters: Union[List[LogsExclusion], UnsetType] = unset,
num_flex_logs_retention_days: Union[int, none_type, UnsetType] = unset,
num_retention_days: Union[int, UnsetType] = unset,
tags: Union[List[str], UnsetType] = unset,
**kwargs,
):
"""
Object for updating a Datadog Log index.
:param daily_limit: The number of log events you can send in this index per day before you are rate-limited.
:type daily_limit: int, optional
:param daily_limit_reset: Object containing options to override the default daily limit reset time.
:type daily_limit_reset: LogsDailyLimitReset, optional
:param daily_limit_warning_threshold_percentage: A percentage threshold of the daily quota at which a Datadog warning event is generated.
:type daily_limit_warning_threshold_percentage: float, optional
:param disable_daily_limit: If true, sets the ``daily_limit`` value to null and the index is not limited on a daily basis (any
specified ``daily_limit`` value in the request is ignored). If false or omitted, the index's current
``daily_limit`` is maintained.
:type disable_daily_limit: bool, optional
:param exclusion_filters: An array of exclusion objects. The logs are tested against the query of each filter,
following the order of the array. Only the first matching active exclusion matters,
others (if any) are ignored.
:type exclusion_filters: [LogsExclusion], optional
:param filter: Filter for logs.
:type filter: LogsFilter
:param num_flex_logs_retention_days: The total number of days logs are stored in Standard and Flex Tier before being deleted from the index.
If Standard Tier is enabled on this index, logs are first retained in Standard Tier for the number of days specified through ``num_retention_days`` ,
and then stored in Flex Tier until the number of days specified in ``num_flex_logs_retention_days`` is reached.
The available values depend on retention plans specified in your organization's contract/subscriptions.
**Note** : Changing this value affects all logs already in this index. It may also affect billing.
:type num_flex_logs_retention_days: int, none_type, optional
:param num_retention_days: The number of days logs are stored in Standard Tier before aging into the Flex Tier or being deleted from the index.
The available values depend on retention plans specified in your organization's contract/subscriptions.
**Note** : Changing this value affects all logs already in this index. It may also affect billing.
:type num_retention_days: int, optional
:param tags: A list of tags associated with the index. Tags must be in ``key:value`` format.
:type tags: [str], optional
"""
if daily_limit is not unset:
kwargs["daily_limit"] = daily_limit
if daily_limit_reset is not unset:
kwargs["daily_limit_reset"] = daily_limit_reset
if daily_limit_warning_threshold_percentage is not unset:
kwargs["daily_limit_warning_threshold_percentage"] = daily_limit_warning_threshold_percentage
if disable_daily_limit is not unset:
kwargs["disable_daily_limit"] = disable_daily_limit
if exclusion_filters is not unset:
kwargs["exclusion_filters"] = exclusion_filters
if num_flex_logs_retention_days is not unset:
kwargs["num_flex_logs_retention_days"] = num_flex_logs_retention_days
if num_retention_days is not unset:
kwargs["num_retention_days"] = num_retention_days
if tags is not unset:
kwargs["tags"] = tags
super().__init__(kwargs)
self_.filter = filter