Skip to content
This repository has been archived by the owner on Feb 2, 2018. It is now read-only.

Commit

Permalink
Merge pull request #13 from ashcrow/mbarnes-cluster-endpoint
Browse files Browse the repository at this point in the history
Testing of endpoints according to the doc worked as expected
  • Loading branch information
cooktheryan committed Jan 28, 2016
2 parents acf06ee + bd396e3 commit 2b35255
Show file tree
Hide file tree
Showing 4 changed files with 744 additions and 8 deletions.
161 changes: 160 additions & 1 deletion doc/endpoints.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,168 @@
REST Endpoints
==============

Cluster
-------
**Endpoint**: /api/v0/cluster/{NAME}

GET
```
Retrieve the status of the cluster.

.. code-block:: javascript
{
"status" string,
"hosts": {
"total": int,
"available": int,
"unavailable": int
}
}
Example
~~~~~~~

.. code-block:: javascript
{
"status": "ok",
"hosts": {
"total": 3,
"available": 3,
"unavailable": 0
}
}
PUT
```
Creates a new cluster.

No body.



Cluster Operations: Upgrade
---------------------------
**Endpoint**: /api/v0/cluster/{NAME}/upgrade

GET
```
Retrieve the current status of upgrades.

.. code-block:: javascript
{
"status": string,
"upgrade_to": string,
"upgraded": HOST_LIST,
"in_process": HOST_LIST,
"started_at": string,
"finished_at": string
}
Example
~~~~~~~

.. code-block:: javascript
{
"status": "in_process",
"upgrade_to": "7.2.1",
"upgraded": [{...}],
"in_process": [{...}],
"started_at": "2015-12-17T15:48:18.710454",
"finished_at": "0001-01-01T00:00:00"
}
PUT
```
Start a new upgrade.

.. code-block:: javascript
{
"upgrade_to": string
}
Example
~~~~~~~

.. code-block:: javascript
{
"upgrade_to": "7.2.1"
}
Example Response
~~~~~~~~~~~~~~~~

.. code-block:: javascript
{
"status": "in_process",
"upgrade_to": "7.2.1",
"upgraded": [{...}],
"in_process": [{...}],
"started_at": "2015-12-17T15:48:18.710454",
"finished_at": "0001-01-01T00:00:00"
}
Cluster Operations: Restart
---------------------------
**Endpoint**: /api/v0/cluster/{NAME}/restart

GET
```
Retrieve the status of a restart.

.. code-block:: javascript
{
"status": string,
"restarted": HOST_LIST,
"in_process": HOST_LIST,
"started_at": string,
"finished_at": string
}
Example
~~~~~~~

.. code-block:: javascript
{
"status": "in_process",
"restarted": [{...}],
"in_process": [{...}],
"started_at": "2015-12-17T15:48:18.710454",
"finished_at": "0001-01-01T00:00:00"
}
PUT
```
Create a new restart.

No body.

Example Response
~~~~~~~~~~~~~~~~

{
"status": "in_process",
"restarted": [{...}],
"in_process": [{...}],
"started_at": "2015-12-17T15:48:18.710454",
"finished_at": "0001-01-01T00:00:00"
}



Clusters
--------
**Endpoint**: /api/v0/cluster/{IP}
**Endpoint**: /api/v0/cluster/

GET
```
Expand Down

0 comments on commit 2b35255

Please sign in to comment.