Skip to content

Commit b1b855b

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit c413ebe of spec repo (#448)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 2cc097b commit b1b855b

File tree

7 files changed

+65
-36
lines changed

7 files changed

+65
-36
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.4.1.dev6",
7-
"regenerated": "2021-05-20 07:39:45.861697",
8-
"spec_repo_commit": "12e8b3e"
7+
"regenerated": "2021-05-21 07:36:01.929628",
8+
"spec_repo_commit": "c413ebe"
99
},
1010
"v2": {
1111
"apigentools_version": "1.4.1.dev6",
12-
"regenerated": "2021-05-20 07:40:14.721284",
13-
"spec_repo_commit": "12e8b3e"
12+
"regenerated": "2021-05-21 07:36:23.649975",
13+
"spec_repo_commit": "c413ebe"
1414
}
1515
}
1616
}

docs/v1/Monitor.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ Object describing a monitor.
55
## Properties
66
Name | Type | Description | Notes
77
------------ | ------------- | ------------- | -------------
8+
**query** | **str** | The monitor query. |
9+
**type** | [**MonitorType**](MonitorType.md) | |
810
**created** | **datetime** | Timestamp of the monitor creation. | [optional] [readonly]
911
**creator** | [**Creator**](Creator.md) | | [optional]
1012
**deleted** | **datetime, none_type** | Whether or not the monitor is deleted. (Always &#x60;null&#x60;) | [optional] [readonly]
@@ -16,11 +18,9 @@ Name | Type | Description | Notes
1618
**options** | [**MonitorOptions**](MonitorOptions.md) | | [optional]
1719
**overall_state** | [**MonitorOverallStates**](MonitorOverallStates.md) | | [optional]
1820
**priority** | **int** | Integer from 1 (high) to 5 (low) indicating alert severity. | [optional]
19-
**query** | **str** | The monitor query. | [optional]
2021
**restricted_roles** | **[str]** | A list of role identifiers that can be pulled from the Roles API. Cannot be used with &#x60;locked&#x60; option. | [optional]
2122
**state** | [**MonitorState**](MonitorState.md) | | [optional]
2223
**tags** | **[str]** | Tags associated to your monitor. | [optional]
23-
**type** | [**MonitorType**](MonitorType.md) | | [optional]
2424

2525
[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md)
2626

docs/v1/MonitorsApi.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ with ApiClient(configuration) as api_client:
163163
),
164164
overall_state=MonitorOverallStates("Alert"),
165165
priority=1,
166-
query="query_example",
166+
query="avg(last_5m):sum:system.net.bytes_rcvd{host:host0} > 100",
167167
restricted_roles=[
168168
"restricted_roles_example",
169169
],
@@ -182,7 +182,7 @@ with ApiClient(configuration) as api_client:
182182
tags=[
183183
"tags_example",
184184
],
185-
type=MonitorType("composite"),
185+
type=MonitorType("metric alert"),
186186
) # Monitor | Create a monitor request body.
187187

188188
# example passing only required values which don't have defaults set
@@ -250,7 +250,7 @@ with ApiClient(configuration) as api_client:
250250
# Create an instance of the API class
251251
api_instance = monitors_api.MonitorsApi(api_client)
252252
monitor_id = 1 # int | The ID of the monitor.
253-
force = "force_example" # str | Delete the monitor even if it's referenced by other resources (e.g. SLO, composite monitor). (optional)
253+
force = "false" # str | Delete the monitor even if it's referenced by other resources (e.g. SLO, composite monitor). (optional)
254254

255255
# example passing only required values which don't have defaults set
256256
try:
@@ -406,14 +406,14 @@ configuration = Configuration()
406406
with ApiClient(configuration) as api_client:
407407
# Create an instance of the API class
408408
api_instance = monitors_api.MonitorsApi(api_client)
409-
group_states = "group_states_example" # str | When specified, shows additional information about the group states. Choose one or more from `all`, `alert`, `warn`, and `no data`. (optional)
409+
group_states = "alert" # str | When specified, shows additional information about the group states. Choose one or more from `all`, `alert`, `warn`, and `no data`. (optional)
410410
name = "name_example" # str | A string to filter monitors by name. (optional)
411-
tags = "tags_example" # str | A comma separated list indicating what tags, if any, should be used to filter the list of monitors by scope. For example, `host:host0`. (optional)
412-
monitor_tags = "monitor_tags_example" # str | A comma separated list indicating what service and/or custom tags, if any, should be used to filter the list of monitors. Tags created in the Datadog UI automatically have the service key prepended. For example, `service:my-app`. (optional)
411+
tags = "host:host0" # str | A comma separated list indicating what tags, if any, should be used to filter the list of monitors by scope. For example, `host:host0`. (optional)
412+
monitor_tags = "service:my-app" # str | A comma separated list indicating what service and/or custom tags, if any, should be used to filter the list of monitors. Tags created in the Datadog UI automatically have the service key prepended. For example, `service:my-app`. (optional)
413413
with_downtimes = True # bool | If this argument is set to true, then the returned data includes all current downtimes for each monitor. (optional)
414414
id_offset = 1 # int | Monitor ID offset. (optional)
415-
page = 1 # int | The page to start paginating from. If this argument is not specified, the request returns all monitors without pagination. (optional)
416-
page_size = 1 # int | The number of monitors to return per page. If the page argument is not specified, the default behavior returns all monitors without a `page_size` limit. However, if page is specified and `page_size` is not, the argument defaults to 100. (optional)
415+
page = 0 # int | The page to start paginating from. If this argument is not specified, the request returns all monitors without pagination. (optional)
416+
page_size = 20 # int | The number of monitors to return per page. If the page argument is not specified, the default behavior returns all monitors without a `page_size` limit. However, if page is specified and `page_size` is not, the argument defaults to 100. (optional)
417417

418418
# example passing only required values which don't have defaults set
419419
# and optional values
@@ -563,7 +563,7 @@ with ApiClient(configuration) as api_client:
563563
tags=[
564564
"tags_example",
565565
],
566-
type=MonitorType("composite"),
566+
type=MonitorType("metric alert"),
567567
) # MonitorUpdateRequest | Edit a monitor request body.
568568

569569
# example passing only required values which don't have defaults set
@@ -609,7 +609,7 @@ Name | Type | Description | Notes
609609
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
610610

611611
# **validate_monitor**
612-
> Monitor validate_monitor(body)
612+
> {str: (bool, date, datetime, dict, float, int, list, str, none_type)} validate_monitor(body)
613613
614614
Validate a monitor
615615

@@ -689,7 +689,7 @@ with ApiClient(configuration) as api_client:
689689
),
690690
overall_state=MonitorOverallStates("Alert"),
691691
priority=1,
692-
query="query_example",
692+
query="avg(last_5m):sum:system.net.bytes_rcvd{host:host0} > 100",
693693
restricted_roles=[
694694
"restricted_roles_example",
695695
],
@@ -708,7 +708,7 @@ with ApiClient(configuration) as api_client:
708708
tags=[
709709
"tags_example",
710710
],
711-
type=MonitorType("composite"),
711+
type=MonitorType("metric alert"),
712712
) # Monitor | Monitor request object
713713

714714
# example passing only required values which don't have defaults set
@@ -729,7 +729,7 @@ Name | Type | Description | Notes
729729

730730
### Return type
731731

732-
[**Monitor**](Monitor.md)
732+
**{str: (bool, date, datetime, dict, float, int, list, str, none_type)}**
733733

734734
### Authorization
735735

src/datadog_api_client/v1/api/monitors_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ def __init__(self, api_client=None):
321321

322322
self._validate_monitor_endpoint = _Endpoint(
323323
settings={
324-
"response_type": (Monitor,),
324+
"response_type": ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},),
325325
"auth": ["apiKeyAuth", "appKeyAuth"],
326326
"endpoint_path": "/api/v1/monitor/validate",
327327
"operation_id": "validate_monitor",
@@ -657,7 +657,7 @@ def validate_monitor(self, body, **kwargs):
657657
async_req (bool): execute request asynchronously
658658
659659
Returns:
660-
Monitor
660+
{str: (bool, date, datetime, dict, float, int, list, str, none_type)}
661661
If the method is called asynchronously, returns the request
662662
thread.
663663
"""

src/datadog_api_client/v1/model/monitor.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ def openapi_types():
8585
"""
8686
lazy_import()
8787
return {
88+
"query": (str,), # noqa: E501
89+
"type": (MonitorType,), # noqa: E501
8890
"created": (datetime,), # noqa: E501
8991
"creator": (Creator,), # noqa: E501
9092
"deleted": (
@@ -99,18 +101,18 @@ def openapi_types():
99101
"options": (MonitorOptions,), # noqa: E501
100102
"overall_state": (MonitorOverallStates,), # noqa: E501
101103
"priority": (int,), # noqa: E501
102-
"query": (str,), # noqa: E501
103104
"restricted_roles": ([str],), # noqa: E501
104105
"state": (MonitorState,), # noqa: E501
105106
"tags": ([str],), # noqa: E501
106-
"type": (MonitorType,), # noqa: E501
107107
}
108108

109109
@cached_property
110110
def discriminator():
111111
return None
112112

113113
attribute_map = {
114+
"query": "query", # noqa: E501
115+
"type": "type", # noqa: E501
114116
"created": "created", # noqa: E501
115117
"creator": "creator", # noqa: E501
116118
"deleted": "deleted", # noqa: E501
@@ -122,11 +124,9 @@ def discriminator():
122124
"options": "options", # noqa: E501
123125
"overall_state": "overall_state", # noqa: E501
124126
"priority": "priority", # noqa: E501
125-
"query": "query", # noqa: E501
126127
"restricted_roles": "restricted_roles", # noqa: E501
127128
"state": "state", # noqa: E501
128129
"tags": "tags", # noqa: E501
129-
"type": "type", # noqa: E501
130130
}
131131

132132
_composed_schemas = {}
@@ -143,9 +143,13 @@ def discriminator():
143143
)
144144

145145
@convert_js_args_to_python_args
146-
def __init__(self, *args, **kwargs): # noqa: E501
146+
def __init__(self, query, type, *args, **kwargs): # noqa: E501
147147
"""Monitor - a model defined in OpenAPI
148148
149+
Args:
150+
query (str): The monitor query.
151+
type (MonitorType):
152+
149153
Keyword Args:
150154
_check_type (bool): if True, values for parameters in openapi_types
151155
will be type checked and a TypeError will be
@@ -188,11 +192,9 @@ def __init__(self, *args, **kwargs): # noqa: E501
188192
options (MonitorOptions): [optional] # noqa: E501
189193
overall_state (MonitorOverallStates): [optional] # noqa: E501
190194
priority (int): Integer from 1 (high) to 5 (low) indicating alert severity.. [optional] # noqa: E501
191-
query (str): The monitor query.. [optional] # noqa: E501
192195
restricted_roles ([str]): A list of role identifiers that can be pulled from the Roles API. Cannot be used with `locked` option.. [optional] # noqa: E501
193196
state (MonitorState): [optional] # noqa: E501
194197
tags ([str]): Tags associated to your monitor.. [optional] # noqa: E501
195-
type (MonitorType): [optional] # noqa: E501
196198
"""
197199

198200
_check_type = kwargs.pop("_check_type", True)
@@ -219,6 +221,8 @@ def __init__(self, *args, **kwargs): # noqa: E501
219221
self._configuration = _configuration
220222
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
221223

224+
self.query = query
225+
self.type = type
222226
for var_name, var_value in kwargs.items():
223227
if (
224228
var_name not in self.attribute_map

src/datadog_api_client/v1/openapi.yaml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4872,6 +4872,7 @@ components:
48724872
type: integer
48734873
query:
48744874
description: The monitor query.
4875+
example: avg(last_5m):sum:system.net.bytes_rcvd{host:host0} > 100
48754876
type: string
48764877
restricted_roles:
48774878
description: A list of role identifiers that can be pulled from the Roles
@@ -4890,6 +4891,9 @@ components:
48904891
type: array
48914892
type:
48924893
$ref: '#/components/schemas/MonitorType'
4894+
required:
4895+
- type
4896+
- query
48934897
type: object
48944898
MonitorDeviceID:
48954899
description: ID of the device the Synthetics monitor is running on. Same as
@@ -5261,6 +5265,7 @@ components:
52615265
- trace-analytics alert
52625266
- slo alert
52635267
- event-v2 alert
5268+
example: metric alert
52645269
type: string
52655270
x-enum-varnames:
52665271
- COMPOSITE
@@ -16753,6 +16758,7 @@ paths:
1675316758
name: group_states
1675416759
required: false
1675516760
schema:
16761+
example: alert
1675616762
type: string
1675716763
- description: A string to filter monitors by name.
1675816764
in: query
@@ -16768,6 +16774,7 @@ paths:
1676816774
name: tags
1676916775
required: false
1677016776
schema:
16777+
example: host:host0
1677116778
type: string
1677216779
- description: 'A comma separated list indicating what service and/or custom
1677316780
tags, if any, should be used to filter the list of monitors.
@@ -16778,6 +16785,7 @@ paths:
1677816785
name: monitor_tags
1677916786
required: false
1678016787
schema:
16788+
example: service:my-app
1678116789
type: string
1678216790
- description: If this argument is set to true, then the returned data includes
1678316791
all current downtimes for each monitor.
@@ -16799,6 +16807,7 @@ paths:
1679916807
name: page
1680016808
required: false
1680116809
schema:
16810+
example: 0
1680216811
format: int64
1680316812
type: integer
1680416813
- description: The number of monitors to return per page. If the page argument
@@ -16809,6 +16818,7 @@ paths:
1680916818
name: page_size
1681016819
required: false
1681116820
schema:
16821+
example: 20
1681216822
format: int32
1681316823
maximum: 1000
1681416824
type: integer
@@ -17105,6 +17115,19 @@ paths:
1710517115
requestBody:
1710617116
content:
1710717117
application/json:
17118+
examples:
17119+
json-request-body:
17120+
value:
17121+
message: You may need to add web hosts if this is consistently high.
17122+
name: Bytes received on host0
17123+
options:
17124+
no_data_timeframe: 20
17125+
notify_no_data: true
17126+
query: avg(last_5m):sum:system.net.bytes_rcvd{host:host0} > 100
17127+
tags:
17128+
- app:webserver
17129+
- frontend
17130+
type: metric alert
1710817131
schema:
1710917132
$ref: '#/components/schemas/Monitor'
1711017133
description: Create a monitor request body.
@@ -17200,7 +17223,8 @@ paths:
1720017223
content:
1720117224
application/json:
1720217225
schema:
17203-
$ref: '#/components/schemas/Monitor'
17226+
example: {}
17227+
type: object
1720417228
description: OK
1720517229
'400':
1720617230
content:
@@ -17239,6 +17263,7 @@ paths:
1723917263
name: force
1724017264
required: false
1724117265
schema:
17266+
example: 'false'
1724217267
type: string
1724317268
responses:
1724417269
'200':

0 commit comments

Comments
 (0)