Skip to content
This repository was archived by the owner on Mar 25, 2024. It is now read-only.

Commit 736497a

Browse files
committed
Merge pull request #124 from DataDog/remove_downtime_start
Make `start` optional when scheduling downtime
2 parents 5bf51ef + 41a7494 commit 736497a

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/dogapi/http/monitors.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -176,16 +176,15 @@ def unmute_monitor(self, monitor_id, scope=None):
176176

177177
class DowntimeApi(object):
178178

179-
def schedule_downtime(self, scope, start, end=None, message=None):
179+
def schedule_downtime(self, scope, start=None, end=None, message=None):
180180
"""
181181
Schedule downtime over *scope* from *start* to *end*, where *start* and
182-
*end* are POSIX timestamps. If *end* is omitted then the downtime will
183-
continue until cancelled.
182+
*end* are POSIX timestamps. If *start* is omitted, the downtime will begin
183+
immediately. If *end* is omitted, the downtime will continue until cancelled.
184184
"""
185-
body = {
186-
'scope': scope,
187-
'start': start,
188-
}
185+
body = {'scope': scope}
186+
if start:
187+
body['start'] = start
189188
if end:
190189
body['end'] = end
191190
if message:

0 commit comments

Comments
 (0)