<commit_before>Alerts
------

To get a list of alerts, run GET against **/api/alerts/** as authenticated user.

Alert severity field can take one of this values: "Critical", "Error", "Warning", "Info", "Debug".
Field scope will contain link to object that cause alert.
Context - dictionary that contains information about all related to alert objects.

Alerts can be filtered by:
 - ?severity=<severity> (can be list)
 - ?alert_type=<alert_type> (can be list)
 - ?scope=<url> concrete alert scope
 - ?scope_type=<string> name of scope type (Ex.: instance, cloud_project_membership, project...)
 - ?created_from=<timestamp>
 - ?created_to=<timestamp>
 - ?closed_from=<timestamp>
 - ?closed_to=<timestamp>
 - ?opened - if this argument is in GET request endpoint will return only alerts that are not closed
 - ?aggregate=aggregate_model_name (default: 'customer'. Have to be from list: 'customer', 'project', 'project_group')
 - ?uuid=uuid_of_aggregate_model_object (not required. If this parameter will be defined - result will contain only
 object with given uuid)

Alerts can be ordered by:

 -?o=severity - order by severity


.. code-block:: http

    GET /api/alerts/
    Accept: application/json
    Content-Type: application/json
    Host: example.com

    [
        {
            "url": "http://127.0.0.1:8000/api/alerts/e80e48a4e58b48ff9a1320a0aa0d68ab/",
            "uuid": "e80e48a4e58b48ff9a1320a0aa0d68ab",
            "alert_type": "first_alert",
            "message": "message#1",
            "severity": "Debug",
            "scope": "http://127.0.0.1:8000/api/instances/9d1d7e03b0d14fd0b42b5f649dfa3de5/",
            "created": "2015-05-29T14:24:27.342Z",
            "closed": null,
            "context": {
                'customer_abbreviation': 'MoCS',
                'customer_contact_details': 'drop db;',
                'customer_name': 'The Ministry of Civil Service',<commit_msg>Correct docs (nc-553)<commit_after>Alerts
------

To get a list of alerts, run GET against **/api/alerts/** as authenticated user.

Alert severity field can take one of this values: "Critical", "Error", "Warning", "Info", "Debug".
Field scope will contain link to object that cause alert.
Context - dictionary that contains information about all related to alert objects.

Alerts can be filtered by:
 - ?severity=<severity> (can be list)
 - ?alert_type=<alert_type> (can be list)
 - ?scope=<url> concrete alert scope
 - ?scope_type=<string> name of scope type (Ex.: instance, cloud_project_membership, project...)
 - ?created_from=<timestamp>
 - ?created_to=<timestamp>
 - ?closed_from=<timestamp>
 - ?closed_to=<timestamp>
 - ?opened - if this argument is in GET request endpoint will return only alerts that are not closed
 - ?aggregate=aggregate_model_name (default: 'customer'. Have to be from list: 'customer', 'project', 'project_group')
 - ?uuid=uuid_of_aggregate_model_object (not required. If this parameter will be defined - result will contain only
 object with given uuid)

Alerts can be ordered by:

 -?o=severity - order by severity


.. code-block:: http

    GET /api/alerts/
    Accept: application/json
    Content-Type: application/json
    Host: example.com

    [
        {
            "url": "http://127.0.0.1:8000/api/alerts/e80e48a4e58b48ff9a1320a0aa0d68ab/",
            "uuid": "e80e48a4e58b48ff9a1320a0aa0d68ab",
            "alert_type": "first_alert",
            "message": "message#1",
            "severity": "Debug",
            "scope": "http://127.0.0.1:8000/api/instances/9d1d7e03b0d14fd0b42b5f649dfa3de5/",
            "created": "2015-05-29T14:24:27.342Z",
            "closed": null,
            "context": {
                'customer_abbreviation': 'customer_abbreviation',
                'customer_contact_details': 'customer details',
                'customer_name': '<NAME>',
{'fraction_non_alphanumeric': 0.12532637075718014, 'fraction_numerical': 0.048302872062663184, 'mean_word_length': 3.146103896103896, 'pattern_counts': {'":': 18, '<': 20, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5679461', 'n_tokens_mistral': 1330, 'n_tokens_neox': 1202, 'n_words': 339}