示例#1
0
文件: alert.py 项目: wimfabri/alerta
 def get_body(self, history: bool=True) -> Dict[str, Any]:
     body = self.serialize
     body.update({
         key: DateTime.iso8601(body[key]) for key in ['createTime', 'lastReceiveTime', 'receiveTime']
     })
     if not history:
         body['history'] = []
     return body
示例#2
0
文件: alert.py 项目: 3IWOH/alerta
 def get_body(self, history=True):
     body = self.serialize
     body.update({
         key: DateTime.iso8601(body[key]) for key in ['createTime', 'lastReceiveTime', 'receiveTime']
     })
     if not history:
         body['history'] = []
     return body
示例#3
0
    def get_body(self, history: bool = True) -> Dict[str, Any]:
        body = self.serialize
        keys2Replace = ['createTime', 'lastReceiveTime', 'receiveTime']
        if 'updateTime' in body and body['updateTime'] != None:
            keys2Replace.append('updateTime')

        body.update({key: DateTime.iso8601(body[key]) for key in keys2Replace})
        if not history:
            body['history'] = []
        return body
示例#4
0
文件: base.py 项目: moonlightp/alerta
 def _adapt_datetime(dt):
     return AsIs("%s" % adapt(DateTime.iso8601(dt)))