Merge "Magnum stats API documentation"

This commit is contained in:
Jenkins 2017-01-19 07:24:40 +00:00 committed by Gerrit Code Review
commit 0c0438b5f1
4 changed files with 105 additions and 0 deletions

View File

@ -14,3 +14,4 @@
.. include:: clustertemplates.inc
.. include:: certificates.inc
.. include:: mservices.inc
.. include:: stats.inc

View File

@ -32,6 +32,12 @@ clustertemplate_ident:
required: true
description: |
The UUID or name of cluster templates in Magnum.
project_id:
type: string
in: path
required: true
description: |
Project ID.
# Body params
api_address:
@ -106,6 +112,12 @@ cluster_list:
required: true
description: |
The list of all clusters in Magnum.
clusters:
type: integer
in: body
required: true
description: |
The number of clusters.
clustertemplate_id:
type: UUID
in: body
@ -417,6 +429,12 @@ node_count:
in: body
required: true
type: integer
nodes:
description: |
The total number of nodes including master nodes.
in: body
required: true
type: integer
op:
description: |
The operation used to modify resource's attributes. Supported operations

View File

@ -0,0 +1,4 @@
{
"clusters": 1,
"nodes": 2
}

82
api-ref/source/stats.inc Normal file
View File

@ -0,0 +1,82 @@
.. -*- rst -*-
=================
Magnum Stats API
=================
An admin user can get stats for the given tenant and also overall system stats.
A non-admin user can get self stats.
Show stats for a tenant
=======================
.. rest_method:: GET /v1/stats?project_id=<project_id>
Get stats based on project id.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 200
.. rest_status_code:: error status.yaml
- 401
- 403
Request
-------
.. rest_parameters:: parameters.yaml
- project_id: project_id
Response
--------
.. rest_parameters:: parameters.yaml
- clusters: clusters
- nodes: nodes
Response Example
----------------
.. literalinclude:: samples/stats-get-resp.json
:language: javascript
Show overall stats
==================
.. rest_method:: GET /v1/stats
Show overall Magnum system stats.
If the requester is non-admin user show self stats.
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 200
.. rest_status_code:: error status.yaml
- 401
- 403
Response
--------
.. rest_parameters:: parameters.yaml
- clusters: clusters
- nodes: nodes
Response Example
----------------
.. literalinclude:: samples/stats-get-resp.json
:language: javascript