Jump to: navigation, search

Monasca/UI UX Support

< Monasca
Revision as of 22:00, 19 November 2015 by Ryan-brandt (talk | contribs) (Add Proposed Alarm Count Resource Specification)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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 Counts 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 with a links array and an elements array of alarm count objects with the following fields:

  • tags (array[string]) – List of identifying tags based on the requested group_by parameter
  • count (integer) – The count associated with the given tags

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"
           }
       ],
       "elements": [
           {
               "tags": ["ALARM", "ACKNOWLEDGED"],
               "count": 124
           },
          {
               "tags": ["ALARM", "OPEN"],
               "count": 34
           },
           {
               "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
           },
       ]
   }