Ceph comes with powerful REST API interface access, which allows you to administer your cluster programmatically. It can run as a WSGI application or as a standalone server, listening over the default port 5000. It provides a similar kind of functionality to that of the ceph command-line tool through an HTTP-accessible interface. Commands are submitted as HTTP GET and PUT requests, and the results can be returned in the JSON, XML, and text formats. In this recipe, I will quickly show you how to set up the Ceph REST API and interact with it.
Create a user,
client.restapi
, on the Ceph cluster with appropriate access tomon
,osd
, andmds
:# ceph auth get-or-create client.restapi mds 'allow' osd 'allow *' mon 'allow *' > /etc/ceph/ceph.client.restapi.keyring
Add the following section to the
ceph.conf
file:[client.restapi] log file = /var/log/ceph/ceph.restapi.log keyring = /etc/ceph/ceph.client.restapi.keyring
Execute the following command to start the
ceph-rest...