Skip to content

ATLAS-Analytics/AlarmAlertServiceFrontend

Repository files navigation

Alarm and Alert Service Frontend

Build ATLAS Alarm and Alert Frontend image

REST interface and frontend

Elasticsearch

Documents are stored in following indices:

type index
alarm type aaas_topology
alarms aaas_alarms
heartbeats type aaas_heartbeats_topology
heartbeats aaas_heartbeats

Content:

aaas_users

  • affiliation
  • created_at
  • email
  • user
  • username
  • subscriptions - nested? .category .subcategory .event .tags
  • preferences - flattened .vacation ....

aaas_alerts

  • created_at
  • sent_to
  • reason

REST API

alarm

  • POST alarm/ - it enforce category and subcategory, make sure there are event, source and body

    {}
  • POST fetch/

  • GET alarm/categories - returns dictionary tree of category, subcategory, event

  • POST alarm/:category

    {}
  • PATCH alarm/:category

    {}
  • DEL alarm/ - deletes a category of alarm

    {
        "category":"SLATE", 
        "subcategory": "Squid", 
        "event": "server down"
    }

user

  • GET user/ - returns json document with info on all users

  • GET user/:userId - returns json document with info on a specific user

  • DEL user/:userId - deletes specific user profile

  • POST user/preferences/:userId - sets user's preferences

    {
        "vaccation": "True",
        ...
    }```
    
  • POST user/subscriptions/:userId - adds a subscription

    {
        [
            {
                category, subcategory, event, tags
            },
        ]
    }
    

heartbeats

  • POST heartbeat/register/ - used to register a new heartbeat:

    {
        "category":"SLATE", 
        "subcategory": "Squid", 
        "event": "server down", 
        "tags":["site", "instance"], 
        "template":"Squid instance: %{instance}, running at %{site}, failed to send required number of heartbeats.",
        "description": "This alarm gets generated if a squid instance does not send at least 4 heartbeats in last 60 seconds. Heartbeats are sent in 10 second intervals.",
        "interval": 60, 
        "min_expected":4
    }
  • PATCH heartbeat/ - used to edit an existing heartbeat:

    {
        "category":"SLATE", 
        "subcategory": "Squid", 
        "event": "server down", 
        "tags":["site", "instance"], 
        "template":"Squid instance: %instance, running at %site, failed to send required number of heartbeats.",
        "description": "This alarm gets generated if a squid instance does not send at least 4 heartbeats in last 60 seconds. Heartbeats are sent in 10 second intervals.",
        "interval": 60, 
        "min_expected":4
    }
  • GET heartbeat/ - used to get list of registered heartbeats

  • DELETE heartbeat/ - used to unregister a heartbeat:

    {
        "category":"SLATE", 
        "subcategory": "Squid", 
        "event": "server down"
    }
  • POST heartbeat/ - used to accept a heartbeat:

    {
        "category":"SLATE", 
        "subcategory": "Squid", 
        "event": "server down", 
        "source": {
            "site": "MWT2",
            "instance" : "MWT2_Slate_01"
        }
    }