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

Make start optional when scheduling downtime #124

Merged
merged 1 commit into from
Jan 9, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions src/dogapi/http/monitors.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,16 +176,15 @@ def unmute_monitor(self, monitor_id, scope=None):

class DowntimeApi(object):

def schedule_downtime(self, scope, start, end=None, message=None):
def schedule_downtime(self, scope, start=None, end=None, message=None):
"""
Schedule downtime over *scope* from *start* to *end*, where *start* and
*end* are POSIX timestamps. If *end* is omitted then the downtime will
continue until cancelled.
*end* are POSIX timestamps. If *start* is omitted, the downtime will begin
immediately. If *end* is omitted, the downtime will continue until cancelled.
"""
body = {
'scope': scope,
'start': start,
}
body = {'scope': scope}
if start:
body['start'] = start
if end:
body['end'] = end
if message:
Expand Down