Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: introduces a REST use-cases section #471

Merged
1 commit merged into from
Nov 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion doc/source/rest.j2
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,17 @@ Operations between metrics can also be done, such as:

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

List the top N resources that consume the most CPU during the last hour
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The following is configured so that `stop` - `start` = `granularity` will get
only one point per instance.

This will give all information needed to order by `cpu.util` timeseries which
can be filtered down to N results.


{{ scenarios['use-case1-top-cpuutil-per-instances']['doc'] }}

Aggregation across metrics (deprecated)
=======================================
Expand Down Expand Up @@ -945,7 +956,6 @@ reporting values such as the number of new |measures| to process for each

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


Timestamp format
================

Expand Down
22 changes: 22 additions & 0 deletions doc/source/rest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
"name": "short",
"back_window": 0,
"definition": [
{
"granularity": "1h",
"timespan": "7 day"
},
{
"granularity": "1s",
"timespan": "1 hour"
Expand Down Expand Up @@ -52,6 +56,10 @@

{
"definition": [
{
"granularity": "1h",
"timespan": "7 day"
},
{
"granularity": "1s",
"timespan": "1 hour"
Expand Down Expand Up @@ -825,3 +833,17 @@

- name: get-status
request: GET /v1/status HTTP/1.1


- name: use-case1-top-cpuutil-per-instances
request: |
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
Content-Type: application/json

{
"resource_type": "instance",
"search": "server_group='my_autoscaling_group'",
"operations": "(metric cpu.util mean)"
}