Jump to: navigation, search

Difference between revisions of "Monasca/UI UX Support"

(Alarm Counts Resource)
(Alter response body to make it more usable)
Line 22: Line 22:
  
 
=== Response Body ===
 
=== Response Body ===
Returns a JSON object with a links array and an elements array of alarm count objects with the following fields:
+
Returns a JSON object containing the following fields:
* tags (array[string]) List of identifying tags based on the requested group_by parameter
+
* links ([link]) - Links to alarms count resource
* count (integer) – The count associated with the given tags
+
* columns ([string]) - List of the column names, in the order they were returned
 +
* counts ([array[]]) - A two dimensional array of the counts returned
  
 
=== Response Example ===
 
=== Response Example ===
Line 34: Line 35:
 
             }
 
             }
 
         ],
 
         ],
         "elements": [
+
         "columns": ["state", "lifecycle_state", "count"]
            {
+
        "counts": [
                "tags": ["ALARM", "ACKNOWLEDGED"],
+
             ["ALARM", "ACKNOWLEDGED", 124]
                "count": 124
+
             ["ALARM", "OPEN", 34]
             },
+
             ["ALARM", "RESOLVED", 12]
          {
+
             ["OK", "OPEN", 235]
                "tags": ["ALARM", "OPEN"],
+
             ["OK", "RESOLVED", 61]
                "count": 34
+
             ["UNDETERMINED", "ACKNOWLEDGED", 13]
            },
+
             ["UNDETERMINED", "OPEN", 1]
             {
+
             ["UNDETERMINED", "RESOLVED", 2]
                "tags": ["ALARM", "RESOLVED"],
 
                "count": 12
 
             },
 
            {
 
                "tags": ["OK", "ACKNOWLEDGED"],
 
                "count": 0
 
            },
 
             {
 
                "tags": ["OK", "OPEN"],
 
                "count": 235
 
             },
 
            {
 
                "tags": ["OK", "RESOLVED"],
 
                "count": 61
 
             },
 
            {
 
                "tags": ["UNDETERMINED", "ACKNOWLEDGED"],
 
                "count": 13
 
             },
 
            {
 
                "tags": ["UNDETERMINED", "OPEN"],
 
                "count": 1
 
             },
 
            {
 
                "tags": ["UNDETERMINED", "RESOLVED"],
 
                "count": 2
 
            },
 
 
         ]
 
         ]
 
     }
 
     }

Revision as of 23:17, 8 December 2015

Introduction

The following additions and modifications are a work in progress to support UI/UX related queries including alarm counts, advanced filtering, and sorted results.

Alarm Count Resource

This is the proposed specification for a resource that will provide a way to query how many alarms match the specified criteria.

Alarm Count

  • GET /v2.0/alarms/count
    • alarm_definition_id (string, optional) - Alarm definition ID to filter by.
    • metric_name (string(255), optional) - Name of metric to filter by.
    • metric_dimensions ({string(255): string(255)}, optional) - Dimensions of metrics to filter by specified as a comma separated array of (key, value) pairs as key1:value1,key1:value1, ...
    • state (string, optional) - State of alarm to filter by, either OK, ALARM or UNDETERMINED.
    • lifecycle_state (string(50), optional) - Lifecycle state to filter by.
    • link (string(512), optional) - Link to filter by.
    • state_updated_start_time (string, optional) - The start time in ISO 8601 combined date and time format in UTC.
    • offset (string, optional)
    • limit (integer, optional)
    • group_by (string, optional) – a list of fields to group the results by as ```field1,field2,…```

Request Example

GET /v2.0/alarms?metric_name=cpu.system_perc&metric_dimensions=hostname:devstack&group_by=state,lifecycle_state

Response Body

Returns a JSON object containing the following fields:

  • links ([link]) - Links to alarms count resource
  • columns ([string]) - List of the column names, in the order they were returned
  • counts ([array[]]) - A two dimensional array of the counts returned

Response Example

   {
       "links": [
           {
               "rel": "self",
               "href": "http://192.168.10.4:8080/v2.0/alarms?name=cpu.system_perc&dimensions=hostname%3Adevstack&group_by=state,lifecycle_state"
           }
       ],
       "columns": ["state", "lifecycle_state", "count"]
       "counts": [
           ["ALARM", "ACKNOWLEDGED", 124]
           ["ALARM", "OPEN", 34]
           ["ALARM", "RESOLVED", 12]
           ["OK", "OPEN", 235]
           ["OK", "RESOLVED", 61]
           ["UNDETERMINED", "ACKNOWLEDGED", 13]
           ["UNDETERMINED", "OPEN", 1]
           ["UNDETERMINED", "RESOLVED", 2]
       ]
   }