示例#1
0
 def delete(self, alert, **kwargs):
     raise AlertaException(
         "I'm a teapot",
         code=418,
         errors=[
             'server refuses to brew coffee because it is, permanently, a teapot',
             'See https://tools.ietf.org/html/rfc2324'
         ])
示例#2
0
 def take_action(self, alert, action, text, **kwargs):
     if action != 'tea':
         raise AlertaException(
             "I'm a teapot",
             code=418,
             errors=[
                 'server refuses to brew coffee because it is, permanently, a teapot',
                 'See https://tools.ietf.org/html/rfc2324'
             ])
     return alert, action, text
示例#3
0
 def pre_receive(self, alert, **kwargs):
     if 'coffee' in alert.text:
         raise AlertaException(
             "I'm a teapot",
             code=418,
             errors=[
                 'server refuses to brew coffee because it is, permanently, a teapot',
                 'See https://tools.ietf.org/html/rfc2324'
             ])
     return alert