Esempio n. 1
0
    def serialize_notification_to_context(
            cls, notification: NotificationSpec) -> Dict:
        payload = {
            "message": notification.get_details(),
            "message_format": "text",
            "color": notification.get_color(),
            "from": "Polyaxon",
        }

        return payload
Esempio n. 2
0
    def serialize_notification_to_context(
            cls, notification: NotificationSpec) -> Dict:
        logo_url = ""

        payload = {
            "content": notification.get_details(),
            "avatar_url": logo_url
        }

        return payload
Esempio n. 3
0
 def serialize_notification_to_context(
         cls, notification: NotificationSpec) -> Dict:
     context = {
         "owner": notification.uuid,
         "project": notification.uuid,
         "uuid": notification.uuid,
         "name": notification.name,
         "title": notification.get_title(),
         "details": notification.get_details(),
         "finished_at": notification.condition.last_transition_time,
     }
     return context
Esempio n. 4
0
    def serialize_notification_to_context(cls, notification: NotificationSpec) -> Dict:
        payload = {
            "title": notification.get_title(),
            "text": notification.get_details(),
            "color": notification.get_color(),
            "fields": [],
            "author_name": "Polyaxon",
            "author_link": cls.get_url(notification),
            "author_icon": None,
        }

        return payload
Esempio n. 5
0
    def serialize_notification_to_context(cls, notification: NotificationSpec) -> Dict:
        payload = {
            "event_type": notification.get_title(),
            "description": notification.condition.reason,
            "details": notification.get_details(),
            "incident_key": "trigger",
            "client": "polyaxon",
            "client_url": cls.get_url(),
            "contexts": [],
        }

        return payload
Esempio n. 6
0
    def serialize_notification_to_context(cls, notification: NotificationSpec) -> Dict:
        logo_url = "https://cdn.polyaxon.com/static/v1/images/logo_small.png"
        fields = []  # Use build_field

        payload = {
            "fallback": notification.condition.type,
            "title": notification.get_title(),
            "title_link": cls.get_url(notification),
            "text": notification.get_details(),
            "fields": fields,
            "mrkdwn_in": ["text"],
            "footer_icon": logo_url,
            "footer": "Polyaxon",
            "color": notification.get_color(),
            "ts": to_timestamp(notification.condition.last_transition_time),
        }

        return payload