Alert

class aaa_modules.alert.Alert(level, subject, body=None, attachmentUrls=[], module=None, intervalBetweenAlertsInMinutes=-1, emailAddresses=None)[source]

Contains information about the alert.

classmethod createCriticalAlert(subject, body=None, attachmentUrls=[], module=None, intervalBetweenAlertsInMinutes=-1)[source]

Creates a CRITICAL alert.

Parameters:
  • subject (string) –
  • attachmentUrls (list(str)) – list of URL attachment strings:
  • module (string) – (optional)
  • intervalBetweenAlertsInMinutes (int) – (optional)
classmethod createInfoAlert(subject, body=None, attachmentUrls=[], module=None, intervalBetweenAlertsInMinutes=-1)[source]

Creates an INFO alert.

Parameters:
  • subject (string) –
  • attachmentUrls (list(str)) – list of URL attachment strings:
  • module (string) – (optional)
  • intervalBetweenAlertsInMinutes (int) – (optional)
classmethod createWarningAlert(subject, body=None, attachmentUrls=[], module=None, intervalBetweenAlertsInMinutes=-1)[source]

Creates a WARNING alert.

Parameters:
  • subject (string) –
  • attachmentUrls (list(str)) – list of URL attachment strings:
  • module (string) – (optional)
  • intervalBetweenAlertsInMinutes (int) – (optional)
classmethod fromJson(jsonString)[source]

Creates a new object from information in the json string. This method is used for alerts coming in from outside the jsr223 framework; they will be in JSON format. Accepted keys: subject, body, level (‘info’, ‘warning’, or ‘critical’).

Parameters:jsonString (str) –
Raise:ValueError if jsonString contains invalid values
getAttachmentUrls()[source]
Return type:list(str)
getBody()[source]
Return type:str
getEmailAddresses()[source]

Returns the overriding email addresses to be used instead of the default email addresses.

Returns:a list of email addresses; empty list if not specified
Return type:list(str)
getIntervalBetweenAlertsInMinutes()[source]
Return type:int
getModule()[source]

Returns the alert module

Return type:str
getSubject()[source]
Return type:str
isCriticalLevel()[source]
Return type:bool
isInfoLevel()[source]
Return type:bool
isWarningLevel()[source]
Return type:bool
toString()[source]
Returns:a user readable string containing this object’s info.
class aaa_modules.alert.Level[source]

The alert levels.

CRITICAL = 3

CRITICAL

INFO = 1

INFO

WARNING = 2

WARNING