Difference between revisions of "Monasca/UI UX Support"
< Monasca
Ryan-brandt (talk | contribs) (→Alarm Counts Resource) |
Ryan-brandt (talk | contribs) (Alter response body to make it more usable) |
||
Line 22: | Line 22: | ||
=== Response Body === | === Response Body === | ||
− | Returns a JSON object | + | 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 === | === Response Example === | ||
Line 34: | Line 35: | ||
} | } | ||
], | ], | ||
− | " | + | "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] | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
] | ] | ||
} | } |
Revision as of 23:17, 8 December 2015
Contents
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] ] }