Merge pull request #26016 from falcon78921/wip-doc-37957

doc: added section on creating RESTful API user

Reviewed-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2019-04-04 14:33:24 +08:00 committed by GitHub
commit 8614b9b81d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,6 +77,39 @@ If the port is not configured, *restful* will bind to port ``8003``.
If the address it not configured, the *restful* will bind to ``::``,
which corresponds to all available IPv4 and IPv6 addresses.
.. _creating-an-api-user:
Creating an API User
-----------------------
To create an API user, please run the following command::
ceph restful create-key <username>
Replace ``<username>`` with the desired name of the user. For example, to create a user named
``api``::
$ ceph restful create-key api
52dffd92-a103-4a10-bfce-5b60f48f764e
The UUID generated from ``ceph restful create-key api`` acts as the key for the user.
To list all of your API keys, please run the following command::
ceph restful list-keys
The ``ceph restful list-keys`` command will output in JSON::
{
"api": "52dffd92-a103-4a10-bfce-5b60f48f764e"
}
You can use ``curl`` in order to test your user with the API. Here is an example::
curl -k https://api:52dffd92-a103-4a10-bfce-5b60f48f764e@<ceph-mgr>:<port>/server
In the case above, we are using ``GET`` to fetch information from the ``server`` endpoint.
Load balancer
-------------