diff --git a/pingdomlib/check.py b/pingdomlib/check.py index ccd25ac..788041a 100644 --- a/pingdomlib/check.py +++ b/pingdomlib/check.py @@ -1,7 +1,6 @@ import sys from pingdomlib.analysis import PingdomAnalysis - checktypes = ['http', 'httpcustom', 'tcp', 'ping', 'dns', 'udp', 'smtp', 'pop3', 'imap'] @@ -47,7 +46,7 @@ class PingdomCheck(object): 'sendnotificationwhendown', 'notifyagainevery', 'notifywhenbackup', 'created', 'type', 'hostname', 'status', 'lasterrortime', 'lasttesttime', - 'use_legacy_notifications', 'lastresponsetime', 'probe_filters',] + 'use_legacy_notifications', 'lastresponsetime', 'probe_filters','tags',] def __init__(self, instantiator, checkinfo=dict()): self.pingdom = instantiator @@ -73,7 +72,7 @@ def __setattr__(self, key, value): 'postdata', 'additionalurls', 'stringtosend', 'stringtoexpect', 'expectedip', 'nameserver', 'use_legacy_notifications', 'host', 'alert_policy', - 'autoresolve', 'probe_filters']: + 'autoresolve', 'probe_filters','tags']: if self.pingdom.pushChanges: self.modify(**{key: value}) else: @@ -172,6 +171,11 @@ def __addDetails__(self, checkinfo): else: object.__setattr__(self, 'paused', False) + if 'tags' in checkinfo: + object.__setattr__(self, 'tags', checkinfo['tags']) + else: + object.__setattr__(self, 'tags', None) + def getDetails(self): """Update check details, returns dictionary of details""" @@ -234,6 +238,10 @@ def modify(self, **kwargs): * probe_filters -- Can be one of region: NA, region: EU, region: APAC Type: String + + * tags -- Tags for this check + Type: String ['high', 'critical', 'db'] + HTTP check options: @@ -366,7 +374,7 @@ def modify(self, **kwargs): 'shouldnotcontain', 'postdata', 'additionalurls', 'stringtosend', 'stringtoexpect', 'expectedip', 'nameserver', 'use_legacy_notifications', 'host', - 'alert_policy', 'autoresolve', 'probe_filters']: + 'alert_policy', 'autoresolve', 'probe_filters','tags']: sys.stderr.write("'%s'" % key + ' is not a valid argument of' + '.modify()\n') diff --git a/pingdomlib/pingdom.py b/pingdomlib/pingdom.py index 7279c62..0688489 100644 --- a/pingdomlib/pingdom.py +++ b/pingdomlib/pingdom.py @@ -1,6 +1,5 @@ import requests import sys - from pingdomlib.check import PingdomCheck from pingdomlib.contact import PingdomContact from pingdomlib.reports import PingdomEmailReport, PingdomSharedReport @@ -210,7 +209,7 @@ def getChecks(self, **parameters): # Warn user about unhandled parameters for key in parameters: - if key not in ['limit', 'offset', 'tags']: + if key not in ['limit', 'offset', 'tags', 'include_tags']: sys.stderr.write('%s not a valid argument for getChecks()\n' % key)