Skip to content

Commit 6ac38f8

Browse files
author
Mehdi Abaakouk
committed
doc: introduces a REST use-cases section
We should list all REST API use-case that people is asking for, to not get issue opened for new feature when it's already possible to get the data. It's not always clear what API call I need to do to get all informations I need for a use-cases. This change starts a new section and add one example. Related gnocchixyz#465.
1 parent c79d1a6 commit 6ac38f8

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

doc/source/rest.j2

+11-1
Original file line numberDiff line numberDiff line change
@@ -838,6 +838,17 @@ Operations between metrics can also be done, such as:
838838

839839
{{ scenarios['get-aggregates-between-metrics']['doc'] }}
840840

841+
List top N instances for that consume the most cpu last hour
842+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
843+
844+
{{ scenarios['use-case1-top-cpuutil-per-instances']['doc'] }}
845+
846+
The following is configured so that `stop` - `start` = `granularity` will get
847+
only one point per instance.
848+
849+
This will give all information needed to order by cpu.util timeseries which can
850+
be filtered down to N results..
851+
841852

842853
Aggregation across metrics (deprecated)
843854
=======================================
@@ -931,7 +942,6 @@ reporting values such as the number of new |measures| to process for each
931942

932943
{{ scenarios['get-status']['doc'] }}
933944

934-
935945
Timestamp format
936946
================
937947

doc/source/rest.yaml

+22
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
"name": "short",
88
"back_window": 0,
99
"definition": [
10+
{
11+
"granularity": "1h",
12+
"timespan": "7 day"
13+
},
1014
{
1115
"granularity": "1s",
1216
"timespan": "1 hour"
@@ -52,6 +56,10 @@
5256
5357
{
5458
"definition": [
59+
{
60+
"granularity": "1h",
61+
"timespan": "7 day"
62+
},
5563
{
5664
"granularity": "1s",
5765
"timespan": "1 hour"
@@ -825,3 +833,17 @@
825833

826834
- name: get-status
827835
request: GET /v1/status HTTP/1.1
836+
837+
838+
- name: use-case1-top-cpuutil-per-instances
839+
request: |
840+
POST /v1/aggregates?start=2014-10-06T14:00&stop=2014-10-06T15:00&groupby=original_resource_id&groupby=display_name&granularity=3600.0 HTTP/1.1
841+
Content-Type: application/json
842+
843+
{
844+
"resource_type": "instance",
845+
"search": "server_group='my_autoscaling_group'",
846+
"operations": "(metric cpu.util mean)"
847+
}
848+
849+

0 commit comments

Comments
 (0)