-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #284 from ruzickap/feature/improve_documentation
Adding kqueen cli examples to docs
- Loading branch information
Showing
3 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters