mirror of
https://github.com/ceph/ceph
synced 2025-01-04 02:02:36 +00:00
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:
commit
8614b9b81d
@ -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
|
||||
-------------
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user