Skip to content

Commit

Permalink
Merge pull request #284 from ruzickap/feature/improve_documentation
Browse files Browse the repository at this point in the history
Adding kqueen cli examples to docs
  • Loading branch information
naumvd95 authored May 3, 2018
2 parents 9fac246 + aa9f086 commit 8d50e9e
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'kqueen.tex', 'kqueen Documentation',
'Tomáš Kukrál', 'manual'),
'Mirantis', 'manual'),
]


Expand Down
35 changes: 35 additions & 0 deletions docs/kqueen.cli_api_examples.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Kqueen CLI API Examples
-----------------------

Obtain bearer token and authenticate to kqueen:

.. code-block:: bash
$ TOKEN=$(curl -s -H "Content-Type: application/json" --data '{ "username": "admin", "password": "default" }' -X POST 127.0.0.1:5000/api/v1/auth | jq -r '.access_token')
$ echo $TOKEN
List organizations

.. code-block:: bash
$ curl -s -H "Authorization: Bearer $TOKEN" 127.0.0.1:5000/api/v1/organizations | jq
Check the clusters:

.. code-block:: bash
$ curl -s -H "Authorization: Bearer $TOKEN" 127.0.0.1:5000/api/v1/clusters | jq
List users

.. code-block:: bash
$ curl -s -H "Authorization: Bearer $TOKEN" 127.0.0.1:5000/api/v1/users | jq
Create new organization "testorg"

.. code-block:: bash
$ curl -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" --data '{ "name": "testorg", "namespace": "testorg" }' -X POST 127.0.0.1:5000/api/v1/organizations | jq
2 changes: 2 additions & 0 deletions docs/kqueen.rst
Original file line number Diff line number Diff line change
Expand Up @@ -455,3 +455,5 @@ Example of etcd recovery workflow:
# Start new etcd with these two extra parameters (among the other)
# for example: etcd --force-new-cluster
.. include:: kqueen.cli_api_examples.rst

0 comments on commit 8d50e9e

Please sign in to comment.