Show radosdf output in clients

This commit is contained in:
2019-07-08 10:56:33 -04:00
parent cda690e94f
commit 31b4dd9aed
5 changed files with 77 additions and 6 deletions

View File

@ -537,6 +537,20 @@ def ceph_status():
pvc_common.stopZKConnection(zk_conn)
return flask.jsonify(retdata), retcode
def ceph_radosdf():
"""
Get the current Ceph cluster utilization.
"""
zk_conn = pvc_common.startZKConnection(config['coordinators'])
retflag, retdata = pvc_ceph.get_radosdf(zk_conn)
if retflag:
retcode = 200
else:
retcode = 510
pvc_common.stopZKConnection(zk_conn)
return flask.jsonify(retdata), retcode
def ceph_osd_list(limit=None):
"""
Get the list of OSDs in the Ceph storage cluster.

View File

@ -700,13 +700,22 @@ def api_net_acl_remove(network, acl):
# Ceph endpoints
#
@api.route('/api/v1/ceph', methods=['GET'])
@api.route('/api/v1/ceph/status', methods=['GET'])
@authenticator
def api_ceph():
def api_ceph_status():
"""
Get the current Ceph cluster status.
"""
return pvcapi.ceph_status()
@api.route('/api/v1/ceph/df', methods=['GET'])
@authenticator
def api_ceph_radosdf():
"""
Get the current Ceph cluster utilization.
"""
return pvcapi.ceph_radosdf()
@api.route('/api/v1/ceph/osd', methods=['GET'])
@authenticator
def api_ceph_osd():