Skip to content

Commit 4a637e6

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 1bea0809 of spec repo (#932)
Co-authored-by: ci.datadog-api-spec <[email protected]> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
1 parent f181e04 commit 4a637e6

14 files changed

+349
-12
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.6.2",
7-
"regenerated": "2022-04-05 10:17:47.820497",
8-
"spec_repo_commit": "9a0922b9"
7+
"regenerated": "2022-04-05 11:14:19.779948",
8+
"spec_repo_commit": "1bea0809"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.2",
12-
"regenerated": "2022-04-05 10:17:47.832988",
13-
"spec_repo_commit": "9a0922b9"
12+
"regenerated": "2022-04-05 11:14:19.796004",
13+
"spec_repo_commit": "1bea0809"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,6 +1270,7 @@ components:
12701270
properties:
12711271
deleted_monitor_id:
12721272
description: ID of the deleted monitor.
1273+
example: 666486743
12731274
format: int64
12741275
type: integer
12751276
readOnly: true
@@ -21650,6 +21651,7 @@ paths:
2165021651
required: true
2165121652
schema:
2165221653
items:
21654+
example: 666486743
2165321655
format: int64
2165421656
type: integer
2165521657
type: array
@@ -21925,6 +21927,7 @@ paths:
2192521927
name: monitor_id
2192621928
required: true
2192721929
schema:
21930+
example: 666486743
2192821931
format: int64
2192921932
type: integer
2193021933
- description: Delete the monitor even if it's referenced by other resources
@@ -21988,6 +21991,7 @@ paths:
2198821991
name: monitor_id
2198921992
required: true
2199021993
schema:
21994+
example: 666486743
2199121995
format: int64
2199221996
type: integer
2199321997
- description: When specified, shows additional information about the group
@@ -22044,6 +22048,7 @@ paths:
2204422048
name: monitor_id
2204522049
required: true
2204622050
schema:
22051+
example: 666486743
2204722052
format: int64
2204822053
type: integer
2204922054
requestBody:
@@ -22145,6 +22150,60 @@ paths:
2214522150
x-menu-order: 7
2214622151
x-undo:
2214722152
type: safe
22153+
/api/v1/monitor/{monitor_id}/validate:
22154+
post:
22155+
description: Validate the monitor provided in the request.
22156+
operationId: ValidateExistingMonitor
22157+
parameters:
22158+
- description: The ID of the monitor
22159+
in: path
22160+
name: monitor_id
22161+
required: true
22162+
schema:
22163+
example: 666486743
22164+
format: int64
22165+
type: integer
22166+
requestBody:
22167+
content:
22168+
application/json:
22169+
schema:
22170+
$ref: '#/components/schemas/Monitor'
22171+
description: Monitor request object
22172+
required: true
22173+
responses:
22174+
'200':
22175+
content:
22176+
application/json:
22177+
schema:
22178+
example: {}
22179+
type: object
22180+
description: OK
22181+
'400':
22182+
content:
22183+
application/json:
22184+
schema:
22185+
$ref: '#/components/schemas/APIErrorResponse'
22186+
description: Invalid JSON
22187+
'403':
22188+
content:
22189+
application/json:
22190+
schema:
22191+
$ref: '#/components/schemas/APIErrorResponse'
22192+
description: Forbidden
22193+
'429':
22194+
$ref: '#/components/responses/TooManyRequestsResponse'
22195+
security:
22196+
- apiKeyAuth: []
22197+
appKeyAuth: []
22198+
- AuthZ:
22199+
- monitors_write
22200+
summary: Validate an existing monitor
22201+
tags:
22202+
- Monitors
22203+
x-codegen-request-body-name: body
22204+
x-menu-order: 8
22205+
x-undo:
22206+
type: idempotent
2214822207
/api/v1/monthly_custom_reports:
2214922208
get:
2215022209
description: Get monthly custom reports.

examples/v1/dashboards/CreateDashboard_2308247857.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
title_align=WidgetTextAlign("left"),
3131
time=WidgetTime(),
3232
type=AlertGraphWidgetDefinitionType("alert_graph"),
33-
alert_id="1",
33+
alert_id="7",
3434
viz_type=WidgetVizType("timeseries"),
3535
),
3636
)

examples/v1/dashboards/CreateDashboard_2316374332.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
title_size="16",
2828
title_align=WidgetTextAlign("left"),
2929
type=AlertValueWidgetDefinitionType("alert_value"),
30-
alert_id="1",
30+
alert_id="7",
3131
unit="auto",
3232
text_align=WidgetTextAlign("left"),
3333
precision=2,
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
"""
2+
Validate an existing monitor returns "OK" response
3+
"""
4+
5+
from os import environ
6+
from datadog_api_client.v1 import ApiClient, Configuration
7+
from datadog_api_client.v1.api.monitors_api import MonitorsApi
8+
from datadog_api_client.v1.model.monitor import Monitor
9+
from datadog_api_client.v1.model.monitor_options import MonitorOptions
10+
from datadog_api_client.v1.model.monitor_thresholds import MonitorThresholds
11+
from datadog_api_client.v1.model.monitor_type import MonitorType
12+
13+
# there is a valid "monitor" in the system
14+
MONITOR_ID = environ["MONITOR_ID"]
15+
16+
body = Monitor(
17+
name="Example-Validate_an_existing_monitor_returns_OK_response",
18+
type=MonitorType("log alert"),
19+
query='logs("service:foo AND type:error").index("main").rollup("count").by("source").last("5m") > 2',
20+
message="some message Notify: @hipchat-channel",
21+
tags=["test:examplevalidateanexistingmonitorreturnsokresponse", "env:ci"],
22+
priority=3,
23+
options=MonitorOptions(
24+
enable_logs_sample=True,
25+
escalation_message="the situation has escalated",
26+
evaluation_delay=700,
27+
groupby_simple_monitor=True,
28+
include_tags=True,
29+
locked=False,
30+
new_host_delay=600,
31+
no_data_timeframe=None,
32+
notify_audit=False,
33+
notify_no_data=False,
34+
renotify_interval=60,
35+
require_full_window=True,
36+
timeout_h=24,
37+
thresholds=MonitorThresholds(critical=2.0, warning=1.0),
38+
),
39+
)
40+
41+
configuration = Configuration()
42+
with ApiClient(configuration) as api_client:
43+
api_instance = MonitorsApi(api_client)
44+
response = api_instance.validate_existing_monitor(monitor_id=int(MONITOR_ID), body=body)
45+
46+
print(response)

examples/v1/usage-metering/GetUsageBillableSummary.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,12 @@
22
Get billable usage across your account returns "OK" response
33
"""
44

5-
from datetime import datetime
6-
from dateutil.relativedelta import relativedelta
75
from datadog_api_client.v1 import ApiClient, Configuration
86
from datadog_api_client.v1.api.usage_metering_api import UsageMeteringApi
97

108
configuration = Configuration()
119
with ApiClient(configuration) as api_client:
1210
api_instance = UsageMeteringApi(api_client)
13-
response = api_instance.get_usage_billable_summary(
14-
month=(datetime.now() + relativedelta(days=-3)).isoformat(timespec="seconds")
15-
)
11+
response = api_instance.get_usage_billable_summary()
1612

1713
print(response)

src/datadog_api_client/v1/api/monitors_api.py

Lines changed: 75 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2022-04-04T09:34:37.709Z
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
interactions:
2+
- request:
3+
body: '{"message":"some message Notify: @hipchat-channel","name":"Test-Validate_an_existing_monitor_returns_Invalid_JSON_response-1649064877","options":{"enable_logs_sample":true,"escalation_message":"the
4+
situation has escalated","evaluation_delay":700,"groupby_simple_monitor":true,"include_tags":true,"locked":false,"new_host_delay":600,"no_data_timeframe":null,"notify_audit":false,"notify_no_data":false,"renotify_interval":60,"require_full_window":true,"thresholds":{"critical":2,"warning":1},"timeout_h":24},"priority":3,"query":"logs(\"service:foo
5+
AND type:error\").index(\"main\").rollup(\"count\").by(\"source\").last(\"5m\")
6+
> 2","tags":["test:testvalidateanexistingmonitorreturnsinvalidjsonresponse1649064877","env:ci"],"type":"log
7+
alert"}'
8+
headers:
9+
accept:
10+
- application/json
11+
content-type:
12+
- application/json
13+
method: POST
14+
uri: https://api.datadoghq.com/api/v1/monitor
15+
response:
16+
body:
17+
string: '{"restricted_roles":null,"tags":["test:testvalidateanexistingmonitorreturnsinvalidjsonresponse1649064877","env:ci"],"deleted":null,"query":"logs(\"service:foo
18+
AND type:error\").index(\"main\").rollup(\"count\").by(\"source\").last(\"5m\")
19+
> 2","message":"some message Notify: @hipchat-channel","id":67817255,"multi":true,"name":"Test-Validate_an_existing_monitor_returns_Invalid_JSON_response-1649064877","created":"2022-04-04T09:34:38.039976+00:00","created_at":1649064878000,"creator":{"id":1445416,"handle":"[email protected]","name":null,"email":"[email protected]"},"org_id":321813,"modified":"2022-04-04T09:34:38.039976+00:00","priority":3,"overall_state_modified":null,"overall_state":"No
20+
Data","type":"log alert","options":{"notify_audit":false,"locked":false,"timeout_h":24,"renotify_interval":60,"include_tags":true,"no_data_timeframe":null,"silenced":{},"new_host_delay":600,"require_full_window":true,"notify_no_data":false,"enable_logs_sample":true,"groupby_simple_monitor":true,"escalation_message":"the
21+
situation has escalated","evaluation_delay":700,"thresholds":{"critical":2.0,"warning":1.0}}}'
22+
headers:
23+
content-type:
24+
- application/json
25+
status:
26+
code: 200
27+
message: OK
28+
- request:
29+
body: '{"query":"query","type":"log alert"}'
30+
headers:
31+
accept:
32+
- application/json
33+
content-type:
34+
- application/json
35+
method: POST
36+
uri: https://api.datadoghq.com/api/v1/monitor/67817255/validate
37+
response:
38+
body:
39+
string: '{"errors": ["The value provided for parameter ''query'' is invalid:
40+
invalid operator specified: "]}'
41+
headers:
42+
content-type:
43+
- application/json
44+
status:
45+
code: 400
46+
message: Bad Request
47+
- request:
48+
body: null
49+
headers:
50+
accept:
51+
- application/json
52+
method: DELETE
53+
uri: https://api.datadoghq.com/api/v1/monitor/67817255
54+
response:
55+
body:
56+
string: '{"deleted_monitor_id":67817255}'
57+
headers:
58+
content-type:
59+
- application/json
60+
status:
61+
code: 200
62+
message: OK
63+
version: 1
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2022-04-04T09:34:38.711Z

0 commit comments

Comments
 (0)