Add storage prefix to Ceph commands

Add the "storage" prefix to all Ceph-based commands in both the CLI and
the API. This partially abstracts the storage subsystem from the Ceph
tool specifically, should future storage subsystems be added or changed.
The name "ceph" is still used due to the non-abstracted components of
the Ceph management, e.g. referencing Ceph-specific concepts like OSDs
or pools.
This commit is contained in:
Joshua Boniface 2019-07-10 15:14:17 -04:00
parent e9dcbf6198
commit 9ccf3390ab
3 changed files with 106 additions and 92 deletions

View File

@ -697,10 +697,22 @@ def api_net_acl_remove(network, acl):
return pvcapi.net_acl_remove(network, direction, acl) return pvcapi.net_acl_remove(network, direction, acl)
# #
# Ceph endpoints # Storage (Ceph) endpoints
# #
@api.route('/api/v1/ceph', methods=['GET']) # Note: The prefix `/storage` allows future potential storage subsystems.
@api.route('/api/v1/ceph/status', methods=['GET']) # Since Ceph is the only section not abstracted by PVC directly
# (i.e. it references Ceph-specific concepts), this makes more
# sense in the long-term.
#
@api.route('/api/v1/storage', methods=['GET'])
def api_storage():
"""
Manage the storage of the PVC cluster.
"""
return flask.jsonify({"message":"Manage the storage of the PVC cluster."}), 200
@api.route('/api/v1/storage/ceph', methods=['GET'])
@api.route('/api/v1/storage/ceph/status', methods=['GET'])
@authenticator @authenticator
def api_ceph_status(): def api_ceph_status():
""" """
@ -708,7 +720,7 @@ def api_ceph_status():
""" """
return pvcapi.ceph_status() return pvcapi.ceph_status()
@api.route('/api/v1/ceph/df', methods=['GET']) @api.route('/api/v1/storage/ceph/df', methods=['GET'])
@authenticator @authenticator
def api_ceph_radosdf(): def api_ceph_radosdf():
""" """
@ -716,7 +728,7 @@ def api_ceph_radosdf():
""" """
return pvcapi.ceph_radosdf() return pvcapi.ceph_radosdf()
@api.route('/api/v1/ceph/osd', methods=['GET']) @api.route('/api/v1/storage/ceph/osd', methods=['GET'])
@authenticator @authenticator
def api_ceph_osd(): def api_ceph_osd():
""" """
@ -730,7 +742,7 @@ def api_ceph_osd():
return pvcapi.ceph_osd_list(limit) return pvcapi.ceph_osd_list(limit)
@api.route('/api/v1/ceph/osd/set', methods=['POST']) @api.route('/api/v1/storage/ceph/osd/set', methods=['POST'])
@authenticator @authenticator
def api_ceph_osd_set(): def api_ceph_osd_set():
""" """
@ -744,7 +756,7 @@ def api_ceph_osd_set():
return pvcapi.ceph_osd_set(option) return pvcapi.ceph_osd_set(option)
@api.route('/api/v1/ceph/osd/unset', methods=['POST']) @api.route('/api/v1/storage/ceph/osd/unset', methods=['POST'])
@authenticator @authenticator
def api_ceph_osd_unset(): def api_ceph_osd_unset():
""" """
@ -758,7 +770,7 @@ def api_ceph_osd_unset():
return pvcapi.ceph_osd_unset(option) return pvcapi.ceph_osd_unset(option)
@api.route('/api/v1/ceph/osd/<osd>', methods=['GET']) @api.route('/api/v1/storage/ceph/osd/<osd>', methods=['GET'])
@authenticator @authenticator
def api_ceph_osd_info(osd): def api_ceph_osd_info(osd):
""" """
@ -767,7 +779,7 @@ def api_ceph_osd_info(osd):
# Same as specifying /osd?limit=OSD # Same as specifying /osd?limit=OSD
return pvcapi.ceph_osd_list(osd) return pvcapi.ceph_osd_list(osd)
@api.route('/api/v1/ceph/osd/<node>/add', methods=['POST']) @api.route('/api/v1/storage/ceph/osd/<node>/add', methods=['POST'])
@authenticator @authenticator
def api_ceph_osd_add(node): def api_ceph_osd_add(node):
""" """
@ -787,7 +799,7 @@ def api_ceph_osd_add(node):
return pvcapi.ceph_osd_add(node, device, weight) return pvcapi.ceph_osd_add(node, device, weight)
@api.route('/api/v1/ceph/osd/<osd>/remove', methods=['POST']) @api.route('/api/v1/storage/ceph/osd/<osd>/remove', methods=['POST'])
@authenticator @authenticator
def api_ceph_osd_remove(osd): def api_ceph_osd_remove(osd):
""" """
@ -799,7 +811,7 @@ def api_ceph_osd_remove(osd):
return pvcapi.ceph_osd_remove(osd) return pvcapi.ceph_osd_remove(osd)
@api.route('/api/v1/ceph/osd/<osd>/in', methods=['POST']) @api.route('/api/v1/storage/ceph/osd/<osd>/in', methods=['POST'])
@authenticator @authenticator
def api_ceph_osd_in(osd): def api_ceph_osd_in(osd):
""" """
@ -807,7 +819,7 @@ def api_ceph_osd_in(osd):
""" """
return pvcapi.ceph_osd_in(osd) return pvcapi.ceph_osd_in(osd)
@api.route('/api/v1/ceph/osd/<osd>/out', methods=['POST']) @api.route('/api/v1/storage/ceph/osd/<osd>/out', methods=['POST'])
@authenticator @authenticator
def api_ceph_osd_out(osd): def api_ceph_osd_out(osd):
""" """
@ -815,7 +827,7 @@ def api_ceph_osd_out(osd):
""" """
return pvcapi.ceph_osd_out(osd) return pvcapi.ceph_osd_out(osd)
@api.route('/api/v1/ceph/pool', methods=['GET']) @api.route('/api/v1/storage/ceph/pool', methods=['GET'])
@authenticator @authenticator
def api_ceph_pool(): def api_ceph_pool():
""" """
@ -829,7 +841,7 @@ def api_ceph_pool():
return pvcapi.ceph_pool_list(limit) return pvcapi.ceph_pool_list(limit)
@api.route('/api/v1/ceph/pool/<pool>', methods=['GET']) @api.route('/api/v1/storage/ceph/pool/<pool>', methods=['GET'])
@authenticator @authenticator
def api_ceph_pool_info(pool): def api_ceph_pool_info(pool):
""" """
@ -838,7 +850,7 @@ def api_ceph_pool_info(pool):
# Same as specifying /pool?limit=POOL # Same as specifying /pool?limit=POOL
return pvcapi.ceph_pool_list(pool) return pvcapi.ceph_pool_list(pool)
@api.route('/api/v1/ceph/pool/<pool>/add', methods=['POST']) @api.route('/api/v1/storage/ceph/pool/<pool>/add', methods=['POST'])
@authenticator @authenticator
def api_ceph_pool_add(pool): def api_ceph_pool_add(pool):
""" """
@ -853,7 +865,7 @@ def api_ceph_pool_add(pool):
return pvcapi.ceph_pool_add(pool, pgs) return pvcapi.ceph_pool_add(pool, pgs)
@api.route('/api/v1/ceph/pool/<pool>/remove', methods=['POST']) @api.route('/api/v1/storage/ceph/pool/<pool>/remove', methods=['POST'])
@authenticator @authenticator
def api_ceph_pool_remove(pool): def api_ceph_pool_remove(pool):
""" """
@ -865,7 +877,7 @@ def api_ceph_pool_remove(pool):
return pvcapi.ceph_pool_remove(pool) return pvcapi.ceph_pool_remove(pool)
@api.route('/api/v1/ceph/volume', methods=['GET']) @api.route('/api/v1/storage/ceph/volume', methods=['GET'])
@authenticator @authenticator
def api_ceph_volume(): def api_ceph_volume():
""" """
@ -885,7 +897,7 @@ def api_ceph_volume():
return pvcapi.ceph_volume_list(pool, limit) return pvcapi.ceph_volume_list(pool, limit)
@api.route('/api/v1/ceph/volume/<pool>/<volume>', methods=['GET']) @api.route('/api/v1/storage/ceph/volume/<pool>/<volume>', methods=['GET'])
@authenticator @authenticator
def api_ceph_volume_info(pool, volume): def api_ceph_volume_info(pool, volume):
""" """
@ -894,7 +906,7 @@ def api_ceph_volume_info(pool, volume):
# Same as specifying /volume?limit=VOLUME # Same as specifying /volume?limit=VOLUME
return pvcapi.ceph_osd_list(pool, osd) return pvcapi.ceph_osd_list(pool, osd)
@api.route('/api/v1/ceph/volume/<pool>/<volume>/add', methods=['POST']) @api.route('/api/v1/storage/ceph/volume/<pool>/<volume>/add', methods=['POST'])
@authenticator @authenticator
def api_ceph_volume_add(pool, volume): def api_ceph_volume_add(pool, volume):
""" """
@ -908,7 +920,7 @@ def api_ceph_volume_add(pool, volume):
return pvcapi.ceph_volume_add(pool, volume, size) return pvcapi.ceph_volume_add(pool, volume, size)
@api.route('/api/v1/ceph/volume/<pool>/<volume>/remove', methods=['POST']) @api.route('/api/v1/storage/ceph/volume/<pool>/<volume>/remove', methods=['POST'])
@authenticator @authenticator
def api_ceph_volume_remove(pool, volume): def api_ceph_volume_remove(pool, volume):
""" """
@ -916,7 +928,7 @@ def api_ceph_volume_remove(pool, volume):
""" """
return pvcapi.ceph_volume_remove(pool, volume) return pvcapi.ceph_volume_remove(pool, volume)
@api.route('/api/v1/ceph/volume/snapshot', methods=['GET']) @api.route('/api/v1/storage/ceph/volume/snapshot', methods=['GET'])
@authenticator @authenticator
def api_ceph_volume_snapshot(): def api_ceph_volume_snapshot():
""" """
@ -942,7 +954,7 @@ def api_ceph_volume_snapshot():
return pvcapi.ceph_volume_snapshot_list(pool, volume, limit) return pvcapi.ceph_volume_snapshot_list(pool, volume, limit)
@api.route('/api/v1/ceph/volume/snapshot/<pool>/<volume>/<snapshot>', methods=['GET']) @api.route('/api/v1/storage/ceph/volume/snapshot/<pool>/<volume>/<snapshot>', methods=['GET'])
@authenticator @authenticator
def api_ceph_volume_snapshot_info(pool, volume, snapshot): def api_ceph_volume_snapshot_info(pool, volume, snapshot):
""" """
@ -951,7 +963,7 @@ def api_ceph_volume_snapshot_info(pool, volume, snapshot):
# Same as specifying /snapshot?limit=VOLUME # Same as specifying /snapshot?limit=VOLUME
return pvcapi.ceph_snapshot_list(pool, volume, snapshot) return pvcapi.ceph_snapshot_list(pool, volume, snapshot)
@api.route('/api/v1/ceph/volume/snapshot/<pool>/<volume>/<snapshot>/add', methods=['POST']) @api.route('/api/v1/storage/ceph/volume/snapshot/<pool>/<volume>/<snapshot>/add', methods=['POST'])
@authenticator @authenticator
def api_ceph_volume_snapshot_add(pool, volume, snapshot): def api_ceph_volume_snapshot_add(pool, volume, snapshot):
""" """
@ -959,7 +971,7 @@ def api_ceph_volume_snapshot_add(pool, volume, snapshot):
""" """
return pvcapi.ceph_volume_snapshot_add(pool, volume, snapshot) return pvcapi.ceph_volume_snapshot_add(pool, volume, snapshot)
@api.route('/api/v1/ceph/volume/snapshot/<pool>/<volume>/<snapshot>/remove', methods=['POST']) @api.route('/api/v1/storage/ceph/volume/snapshot/<pool>/<volume>/<snapshot>/remove', methods=['POST'])
@authenticator @authenticator
def api_ceph_volume_snapshot_remove(pool, volume, snapshot): def api_ceph_volume_snapshot_remove(pool, volume, snapshot):
""" """

View File

@ -1122,7 +1122,22 @@ def net_acl_list(net, limit, direction):
cleanup(retcode, retdata, zk_conn) cleanup(retcode, retdata, zk_conn)
############################################################################### ###############################################################################
# pvc ceph # pvc storage
###############################################################################
# Note: The prefix `storage` allows future potential storage subsystems.
# Since Ceph is the only section not abstracted by PVC directly
# (i.e. it references Ceph-specific concepts), this makes more
# sense in the long-term.
###############################################################################
@click.group(name='storage', short_help='Manage the PVC storage cluster.', context_settings=CONTEXT_SETTINGS)
def cli_storage():
"""
Manage the storage of the PVC cluster.
"""
pass
###############################################################################
# pvc storage ceph
############################################################################### ###############################################################################
@click.group(name='ceph', short_help='Manage the PVC Ceph storage cluster.', context_settings=CONTEXT_SETTINGS) @click.group(name='ceph', short_help='Manage the PVC Ceph storage cluster.', context_settings=CONTEXT_SETTINGS)
def cli_ceph(): def cli_ceph():
@ -1134,7 +1149,7 @@ def cli_ceph():
pass pass
############################################################################### ###############################################################################
# pvc ceph status # pvc storage ceph status
############################################################################### ###############################################################################
@click.command(name='status', short_help='Show storage cluster status.') @click.command(name='status', short_help='Show storage cluster status.')
def ceph_status(): def ceph_status():
@ -1150,7 +1165,7 @@ def ceph_status():
cleanup(retcode, retdata, zk_conn) cleanup(retcode, retdata, zk_conn)
############################################################################### ###############################################################################
# pvc ceph df # pvc storage ceph df
############################################################################### ###############################################################################
@click.command(name='df', short_help='Show storage cluster utilization.') @click.command(name='df', short_help='Show storage cluster utilization.')
def ceph_radosdf(): def ceph_radosdf():
@ -1166,7 +1181,7 @@ def ceph_radosdf():
cleanup(retcode, retdata, zk_conn) cleanup(retcode, retdata, zk_conn)
############################################################################### ###############################################################################
# pvc ceph osd # pvc storage ceph osd
############################################################################### ###############################################################################
@click.group(name='osd', short_help='Manage OSDs in the PVC storage cluster.', context_settings=CONTEXT_SETTINGS) @click.group(name='osd', short_help='Manage OSDs in the PVC storage cluster.', context_settings=CONTEXT_SETTINGS)
def ceph_osd(): def ceph_osd():
@ -1176,7 +1191,7 @@ def ceph_osd():
pass pass
############################################################################### ###############################################################################
# pvc ceph osd add # pvc storage ceph osd add
############################################################################### ###############################################################################
@click.command(name='add', short_help='Add new OSD.') @click.command(name='add', short_help='Add new OSD.')
@click.argument( @click.argument(
@ -1211,7 +1226,7 @@ def ceph_osd_add(node, device, weight, yes):
cleanup(retcode, retmsg, zk_conn) cleanup(retcode, retmsg, zk_conn)
############################################################################### ###############################################################################
# pvc ceph osd remove # pvc storage ceph osd remove
############################################################################### ###############################################################################
@click.command(name='remove', short_help='Remove OSD.') @click.command(name='remove', short_help='Remove OSD.')
@click.argument( @click.argument(
@ -1238,7 +1253,7 @@ def ceph_osd_remove(osdid, yes):
cleanup(retcode, retmsg, zk_conn) cleanup(retcode, retmsg, zk_conn)
############################################################################### ###############################################################################
# pvc ceph osd in # pvc storage ceph osd in
############################################################################### ###############################################################################
@click.command(name='in', short_help='Online OSD.') @click.command(name='in', short_help='Online OSD.')
@click.argument( @click.argument(
@ -1254,7 +1269,7 @@ def ceph_osd_in(osdid):
cleanup(retcode, retmsg, zk_conn) cleanup(retcode, retmsg, zk_conn)
############################################################################### ###############################################################################
# pvc ceph osd out # pvc storage ceph osd out
############################################################################### ###############################################################################
@click.command(name='out', short_help='Offline OSD.') @click.command(name='out', short_help='Offline OSD.')
@click.argument( @click.argument(
@ -1270,7 +1285,7 @@ def ceph_osd_out(osdid):
cleanup(retcode, retmsg, zk_conn) cleanup(retcode, retmsg, zk_conn)
############################################################################### ###############################################################################
# pvc ceph osd set # pvc storage ceph osd set
############################################################################### ###############################################################################
@click.command(name='set', short_help='Set property.') @click.command(name='set', short_help='Set property.')
@click.argument( @click.argument(
@ -1290,7 +1305,7 @@ def ceph_osd_set(osd_property):
cleanup(retcode, retmsg, zk_conn) cleanup(retcode, retmsg, zk_conn)
############################################################################### ###############################################################################
# pvc ceph osd unset # pvc storage ceph osd unset
############################################################################### ###############################################################################
@click.command(name='unset', short_help='Unset property.') @click.command(name='unset', short_help='Unset property.')
@click.argument( @click.argument(
@ -1310,7 +1325,7 @@ def ceph_osd_unset(osd_property):
cleanup(retcode, retmsg, zk_conn) cleanup(retcode, retmsg, zk_conn)
############################################################################### ###############################################################################
# pvc ceph osd list # pvc storage ceph osd list
############################################################################### ###############################################################################
@click.command(name='list', short_help='List cluster OSDs.') @click.command(name='list', short_help='List cluster OSDs.')
@click.argument( @click.argument(
@ -1329,7 +1344,7 @@ def ceph_osd_list(limit):
cleanup(retcode, retdata, zk_conn) cleanup(retcode, retdata, zk_conn)
############################################################################### ###############################################################################
# pvc ceph pool # pvc storage ceph pool
############################################################################### ###############################################################################
@click.group(name='pool', short_help='Manage RBD pools in the PVC storage cluster.', context_settings=CONTEXT_SETTINGS) @click.group(name='pool', short_help='Manage RBD pools in the PVC storage cluster.', context_settings=CONTEXT_SETTINGS)
def ceph_pool(): def ceph_pool():
@ -1339,7 +1354,7 @@ def ceph_pool():
pass pass
############################################################################### ###############################################################################
# pvc ceph pool add # pvc storage ceph pool add
############################################################################### ###############################################################################
@click.command(name='add', short_help='Add new RBD pool.') @click.command(name='add', short_help='Add new RBD pool.')
@click.argument( @click.argument(
@ -1358,7 +1373,7 @@ def ceph_pool_add(name, pgs):
cleanup(retcode, retmsg, zk_conn) cleanup(retcode, retmsg, zk_conn)
############################################################################### ###############################################################################
# pvc ceph pool remove # pvc storage ceph pool remove
############################################################################### ###############################################################################
@click.command(name='remove', short_help='Remove RBD pool.') @click.command(name='remove', short_help='Remove RBD pool.')
@click.argument( @click.argument(
@ -1387,7 +1402,7 @@ def ceph_pool_remove(name, yes):
cleanup(retcode, retmsg, zk_conn) cleanup(retcode, retmsg, zk_conn)
############################################################################### ###############################################################################
# pvc ceph pool list # pvc storage ceph pool list
############################################################################### ###############################################################################
@click.command(name='list', short_help='List cluster RBD pools.') @click.command(name='list', short_help='List cluster RBD pools.')
@click.argument( @click.argument(
@ -1406,7 +1421,7 @@ def ceph_pool_list(limit):
cleanup(retcode, retdata, zk_conn) cleanup(retcode, retdata, zk_conn)
############################################################################### ###############################################################################
# pvc ceph volume # pvc storage ceph volume
############################################################################### ###############################################################################
@click.group(name='volume', short_help='Manage RBD volumes in the PVC storage cluster.', context_settings=CONTEXT_SETTINGS) @click.group(name='volume', short_help='Manage RBD volumes in the PVC storage cluster.', context_settings=CONTEXT_SETTINGS)
def ceph_volume(): def ceph_volume():
@ -1416,7 +1431,7 @@ def ceph_volume():
pass pass
############################################################################### ###############################################################################
# pvc ceph volume add # pvc storage ceph volume add
############################################################################### ###############################################################################
@click.command(name='add', short_help='Add new RBD volume.') @click.command(name='add', short_help='Add new RBD volume.')
@click.argument( @click.argument(
@ -1438,7 +1453,7 @@ def ceph_volume_add(pool, name, size):
cleanup(retcode, retmsg, zk_conn) cleanup(retcode, retmsg, zk_conn)
############################################################################### ###############################################################################
# pvc ceph volume remove # pvc storage ceph volume remove
############################################################################### ###############################################################################
@click.command(name='remove', short_help='Remove RBD volume.') @click.command(name='remove', short_help='Remove RBD volume.')
@click.argument( @click.argument(
@ -1468,7 +1483,7 @@ def ceph_volume_remove(pool, name, yes):
cleanup(retcode, retmsg, zk_conn) cleanup(retcode, retmsg, zk_conn)
############################################################################### ###############################################################################
# pvc ceph volume list # pvc storage ceph volume list
############################################################################### ###############################################################################
@click.command(name='list', short_help='List cluster RBD volumes.') @click.command(name='list', short_help='List cluster RBD volumes.')
@click.argument( @click.argument(
@ -1492,7 +1507,7 @@ def ceph_volume_list(limit, pool):
cleanup(retcode, retdata, zk_conn) cleanup(retcode, retdata, zk_conn)
############################################################################### ###############################################################################
# pvc ceph volume snapshot # pvc storage ceph volume snapshot
############################################################################### ###############################################################################
@click.group(name='snapshot', short_help='Manage RBD volume snapshots in the PVC storage cluster.', context_settings=CONTEXT_SETTINGS) @click.group(name='snapshot', short_help='Manage RBD volume snapshots in the PVC storage cluster.', context_settings=CONTEXT_SETTINGS)
def ceph_volume_snapshot(): def ceph_volume_snapshot():
@ -1502,7 +1517,7 @@ def ceph_volume_snapshot():
pass pass
############################################################################### ###############################################################################
# pvc ceph volume snapshot add # pvc storage ceph volume snapshot add
############################################################################### ###############################################################################
@click.command(name='add', short_help='Add new RBD volume snapshot.') @click.command(name='add', short_help='Add new RBD volume snapshot.')
@click.argument( @click.argument(
@ -1524,7 +1539,7 @@ def ceph_volume_snapshot_add(pool, volume, name):
cleanup(retcode, retmsg, zk_conn) cleanup(retcode, retmsg, zk_conn)
############################################################################### ###############################################################################
# pvc ceph volume snapshot remove # pvc storage ceph volume snapshot remove
############################################################################### ###############################################################################
@click.command(name='remove', short_help='Remove RBD volume snapshot.') @click.command(name='remove', short_help='Remove RBD volume snapshot.')
@click.argument( @click.argument(
@ -1557,7 +1572,7 @@ def ceph_volume_snapshot_remove(pool, volume, name, yes):
cleanup(retcode, retmsg, zk_conn) cleanup(retcode, retmsg, zk_conn)
############################################################################### ###############################################################################
# pvc ceph volume snapshot list # pvc storage ceph volume snapshot list
############################################################################### ###############################################################################
@click.command(name='list', short_help='List cluster RBD volume shapshots.') @click.command(name='list', short_help='List cluster RBD volume shapshots.')
@click.argument( @click.argument(
@ -1586,21 +1601,6 @@ def ceph_volume_snapshot_list(pool, volume, limit):
cleanup(retcode, retdata, zk_conn) cleanup(retcode, retdata, zk_conn)
###############################################################################
# pvc init
###############################################################################
@click.command(name='init', short_help='Initialize a new cluster.')
def init_cluster():
"""
Perform initialization of a new PVC cluster.
"""
import pvc_init
pvc_init.init_zookeeper(zk_host)
############################################################################### ###############################################################################
# pvc init # pvc init
############################################################################### ###############################################################################
@ -1767,10 +1767,12 @@ cli_ceph.add_command(ceph_osd)
cli_ceph.add_command(ceph_pool) cli_ceph.add_command(ceph_pool)
cli_ceph.add_command(ceph_volume) cli_ceph.add_command(ceph_volume)
cli_storage.add_command(cli_ceph)
cli.add_command(cli_node) cli.add_command(cli_node)
cli.add_command(cli_vm) cli.add_command(cli_vm)
cli.add_command(cli_network) cli.add_command(cli_network)
cli.add_command(cli_ceph) cli.add_command(cli_storage)
cli.add_command(init_cluster) cli.add_command(init_cluster)
# #

View File

@ -409,13 +409,13 @@ Add a new NFTables ACL with description `<acl>` in virtual network with descript
Remove an NFTables ACL with description `<acl>` from virtual network with description `<network>`. Remove an NFTables ACL with description `<acl>` from virtual network with description `<network>`.
### Ceph endpoints ### Storage (Ceph) endpoints
These endpoints manage PVC Ceph storage cluster state and operation. These endpoints manage PVC Ceph storage cluster state and operation. This section has the added prefix `/storage`, to allow the future addition of other storage subsystems.
**NOTE:** Unlike the other API endpoints, Ceph endpoints will wait until the command completes successfully before returning. This is a safety measure to prevent the critical storage subsystem from going out-of-sync with the PVC Zookeeper database; the cluster objects are only created after the storage subsystem commands complete. Because of this, *be careful with HTTP timeouts when running Ceph commands via the API*. 30s or longer may be required for some commands, especially OSD addition or removal. **NOTE:** Unlike the other API endpoints, Ceph endpoints will wait until the command completes successfully before returning. This is a safety measure to prevent the critical storage subsystem from going out-of-sync with the PVC Zookeeper database; the cluster objects are only created after the storage subsystem commands complete. Because of this, *be careful with HTTP timeouts when running Ceph commands via the API*. 30s or longer may be required for some commands, especially OSD addition or removal.
#### `/api/v1/ceph` #### `/api/v1/storage/ceph`
* Methods: `GET` * Methods: `GET`
* Mandatory values: N/A * Mandatory values: N/A
* Optional values: N/A * Optional values: N/A
@ -424,14 +424,14 @@ Return a JSON document containing information about the current Ceph cluster sta
The JSON element `ceph_data` contains the raw output of a `ceph status` command. The JSON element `ceph_data` contains the raw output of a `ceph status` command.
#### `/api/v1/ceph/status` #### `/api/v1/storage/ceph/status`
* Methods: `GET` * Methods: `GET`
* Mandatory values: N/A * Mandatory values: N/A
* Optional values: N/A * Optional values: N/A
This endpoint is an alias for `/api/v1/ceph`. This endpoint is an alias for `/api/v1/storage/ceph`.
#### `/api/v1/ceph/df` #### `/api/v1/storage/ceph/df`
* Methods: `GET` * Methods: `GET`
* Mandatory values: N/A * Mandatory values: N/A
* Optional values: N/A * Optional values: N/A
@ -440,7 +440,7 @@ Return a JSON document containing information about the current Ceph cluster uti
The JSON element `ceph_data` contains the raw output of a `rados df` command. The JSON element `ceph_data` contains the raw output of a `rados df` command.
#### `/api/v1/ceph/osd` #### `/api/v1/storage/ceph/osd`
* Methods: `GET` * Methods: `GET`
* Mandatory values: N/A * Mandatory values: N/A
* Optional values: `limit` * Optional values: `limit`
@ -449,14 +449,14 @@ Return a JSON document containing information about all Ceph OSDs in the storage
If `limit` is specified, return a JSON document containing information about all Ceph OSDs with names matching `limit` as fuzzy regex. If `limit` is specified, return a JSON document containing information about all Ceph OSDs with names matching `limit` as fuzzy regex.
#### `/api/v1/ceph/osd/<osd>` #### `/api/v1/storage/ceph/osd/<osd>`
* Methods: `GET` * Methods: `GET`
* Mandatory values: N/A * Mandatory values: N/A
* Optional values: N/A * Optional values: N/A
Return a JSON document containing information about Ceph OSD with ID `<osd>` in the storage cluster. Unlike other similar endpoints, this is **NOT** equivalent to any limit within the list, since that limit is based off names rather than just the ID. Return a JSON document containing information about Ceph OSD with ID `<osd>` in the storage cluster. Unlike other similar endpoints, this is **NOT** equivalent to any limit within the list, since that limit is based off names rather than just the ID.
#### `/api/v1/ceph/osd/set` #### `/api/v1/storage/ceph/osd/set`
* Methods: `POST` * Methods: `POST`
* Mandatory values: `option` * Mandatory values: `option`
* Optional values: N/A * Optional values: N/A
@ -465,7 +465,7 @@ Set a global Ceph OSD option on the storage cluster.
`option` must be a valid option to the `ceph osd set` command, e.g. `noout` or `noscrub`. `option` must be a valid option to the `ceph osd set` command, e.g. `noout` or `noscrub`.
#### `/api/v1/ceph/osd/unset` #### `/api/v1/storage/ceph/osd/unset`
* Methods: `POST` * Methods: `POST`
* Mandatory values: N/A * Mandatory values: N/A
* Optional values: N/A * Optional values: N/A
@ -474,7 +474,7 @@ Unset a global Ceph OSD option on the storage cluster.
`option` must be a valid option to the `ceph osd unset` command, e.g. `noout` or `noscrub`. `option` must be a valid option to the `ceph osd unset` command, e.g. `noout` or `noscrub`.
#### `/api/v1/ceph/osd/<node>/add` #### `/api/v1/storage/ceph/osd/<node>/add`
* Methods: `POST` * Methods: `POST`
* Mandatory values: `device`, `weight` * Mandatory values: `device`, `weight`
* Optional values: N/A * Optional values: N/A
@ -485,7 +485,7 @@ Add a new Ceph OSD to PVC node with name `<node>`.
`weight` must be a valid Ceph OSD weight, usually `1.0` if all OSD disks are the same size. `weight` must be a valid Ceph OSD weight, usually `1.0` if all OSD disks are the same size.
#### `/api/v1/ceph/osd/<osd>/remove` #### `/api/v1/storage/ceph/osd/<osd>/remove`
* Methods: `POST` * Methods: `POST`
* Mandatory values: `flag_yes_i_really_mean_it` * Mandatory values: `flag_yes_i_really_mean_it`
* Optional values: N/A * Optional values: N/A
@ -496,21 +496,21 @@ Remove a Ceph OSD device with ID `<osd>` from the storage cluster.
**WARNING:** Removing an OSD without first setting it `out` (and letting it flush) triggers an unclean PG recovery. This could potentially cause data loss if other OSDs were to fail or be removed. OSDs should not normally be removed except in the case of failed OSDs during replacement or during a replacement with a larger disk. **WARNING:** Removing an OSD without first setting it `out` (and letting it flush) triggers an unclean PG recovery. This could potentially cause data loss if other OSDs were to fail or be removed. OSDs should not normally be removed except in the case of failed OSDs during replacement or during a replacement with a larger disk.
#### `/api/v1/ceph/osd/<osd>/in` #### `/api/v1/storage/ceph/osd/<osd>/in`
* Methods: `POST` * Methods: `POST`
* Mandatory values: N/A * Mandatory values: N/A
* Optional values: N/A * Optional values: N/A
Set in (active) a Ceph OSD device with ID `<osd>` in the storage cluster. Set in (active) a Ceph OSD device with ID `<osd>` in the storage cluster.
#### `/api/v1/ceph/osd/<osd>/out` #### `/api/v1/storage/ceph/osd/<osd>/out`
* Methods: `POST` * Methods: `POST`
* Mandatory values: N/A * Mandatory values: N/A
* Optional values: N/A * Optional values: N/A
Set out (inactive) a Ceph OSD device with ID `<osd>` in the storage cluster. Set out (inactive) a Ceph OSD device with ID `<osd>` in the storage cluster.
#### `/api/v1/ceph/pool` #### `/api/v1/storage/ceph/pool`
* Methods: `GET` * Methods: `GET`
* Mandatory values: N/A * Mandatory values: N/A
* Optional values: `limit` * Optional values: `limit`
@ -519,14 +519,14 @@ Return a JSON document containing information about all Ceph RBD pools in the st
If `limit` is specified, return a JSON document containing information about all Ceph RBD pools with names matching `limit` as fuzzy regex. If `limit` is specified, return a JSON document containing information about all Ceph RBD pools with names matching `limit` as fuzzy regex.
#### `/api/v1/ceph/pool/<pool>` #### `/api/v1/storage/ceph/pool/<pool>`
* Methods: `GET` * Methods: `GET`
* Mandatory values: N/A * Mandatory values: N/A
* Optional values: N/A * Optional values: N/A
Return a JSON document containing information about Ceph RBD pool with name `<pool>`. The output is identical to `/api/v1/ceph/pool?limit=<pool>` without fuzzy regex. Return a JSON document containing information about Ceph RBD pool with name `<pool>`. The output is identical to `/api/v1/storage/ceph/pool?limit=<pool>` without fuzzy regex.
#### `/api/v1/ceph/pool/<pool>/add` #### `/api/v1/storage/ceph/pool/<pool>/add`
* Methods: `POST` * Methods: `POST`
* Mandatory values: `pgs` * Mandatory values: `pgs`
* Optional values: N/A * Optional values: N/A
@ -535,7 +535,7 @@ Add a new Ceph RBD pool with name `<pool>` to the storage cluster.
`pgs` must be a valid number of Placement Groups for the pool, taking into account the number of OSDs and the replication of the pool (`copies=3`). `256` is a safe number for 3 nodes and 2 disks per node. This value can be grown later via `ceph` commands as required. `pgs` must be a valid number of Placement Groups for the pool, taking into account the number of OSDs and the replication of the pool (`copies=3`). `256` is a safe number for 3 nodes and 2 disks per node. This value can be grown later via `ceph` commands as required.
#### `/api/v1/ceph/pool/<pool>/remove` #### `/api/v1/storage/ceph/pool/<pool>/remove`
* Methods: `POST` * Methods: `POST`
* Mandatory values: `flag_yes_i_really_mean_it` * Mandatory values: `flag_yes_i_really_mean_it`
* Optional values: N/A * Optional values: N/A
@ -546,7 +546,7 @@ Remove a Ceph RBD pool with name `<pool>` from the storage cluster.
**WARNING:** Removing an RBD pool will delete all data on that pool, including all Ceph RBD volumes on the pool. Do not run this command lightly and without ensuring the pool is safely removable first. **WARNING:** Removing an RBD pool will delete all data on that pool, including all Ceph RBD volumes on the pool. Do not run this command lightly and without ensuring the pool is safely removable first.
#### `/api/v1/ceph/volume` #### `/api/v1/storage/ceph/volume`
* Methods: `GET` * Methods: `GET`
* Mandatory values: N/A * Mandatory values: N/A
* Optional values: `pool`, `limit` * Optional values: `pool`, `limit`
@ -557,14 +557,14 @@ If `pool` is specified, return a JSON document containing information about all
If `limit` is specified, return a JSON document containing information about all Ceph RBD volumes with names matching `limit` as fuzzy regex. If `limit` is specified, return a JSON document containing information about all Ceph RBD volumes with names matching `limit` as fuzzy regex.
#### `/api/v1/ceph/volume/<pool>/<volume>` #### `/api/v1/storage/ceph/volume/<pool>/<volume>`
* Methods: `GET` * Methods: `GET`
* Mandatory values: N/A * Mandatory values: N/A
* Optional values: N/A * Optional values: N/A
Return a JSON document containing information about Ceph RBD volume with name `<volume>` in Ceph RBD pool with name `<pool>`. The output is identical to `/api/v1/ceph/volume?pool=<pool>&limit=<volume>` without fuzzy regex. Return a JSON document containing information about Ceph RBD volume with name `<volume>` in Ceph RBD pool with name `<pool>`. The output is identical to `/api/v1/storage/ceph/volume?pool=<pool>&limit=<volume>` without fuzzy regex.
#### `/api/v1/ceph/volume/<pool>/<volume>/add` #### `/api/v1/storage/ceph/volume/<pool>/<volume>/add`
* Methods: `POST` * Methods: `POST`
* Mandatory values: `size` * Mandatory values: `size`
* Optional values: N/A * Optional values: N/A
@ -573,14 +573,14 @@ Add a new Ceph RBD volume with name `<volume>` to Ceph RBD pool with name `<pool
`size` must be a valid size, in bytes or a single-character metric prefix of bytes, e.g. `1073741824` (1GB), `4096M`, or `2G`. `size` must be a valid size, in bytes or a single-character metric prefix of bytes, e.g. `1073741824` (1GB), `4096M`, or `2G`.
#### `/api/v1/ceph/volume/<pool>/<volume>/remove` #### `/api/v1/storage/ceph/volume/<pool>/<volume>/remove`
* Methods: `POST` * Methods: `POST`
* Mandatory values: N/A * Mandatory values: N/A
* Optional values: N/A * Optional values: N/A
Remove a Ceph RBD volume with name `<volume>` from Ceph RBD pool `<pool>`. Remove a Ceph RBD volume with name `<volume>` from Ceph RBD pool `<pool>`.
#### `/api/v1/ceph/volume/snapshot` #### `/api/v1/storage/ceph/volume/snapshot`
* Methods: `GET` * Methods: `GET`
* Mandatory values: N/A * Mandatory values: N/A
* Optional values: `pool`, `volume`, `limit` * Optional values: `pool`, `volume`, `limit`
@ -595,21 +595,21 @@ If `limit` is specified, return a JSON document containing information about all
The various limit options can be combined freely, e.g. one can specify a `volume` without `pool`, which would match all snapshots of the named volume(s) regardless of pool, or a `pool` and `limit` without a `volume`, which would match all named snapshots on any volume in `pool`. The various limit options can be combined freely, e.g. one can specify a `volume` without `pool`, which would match all snapshots of the named volume(s) regardless of pool, or a `pool` and `limit` without a `volume`, which would match all named snapshots on any volume in `pool`.
#### `/api/v1/ceph/volume/snapshot/<pool>/<volume>/<snapshot>` #### `/api/v1/storage/ceph/volume/snapshot/<pool>/<volume>/<snapshot>`
* Methods: `GET` * Methods: `GET`
* Mandatory values: N/A * Mandatory values: N/A
* Optional values: N/A * Optional values: N/A
Return a JSON document containing information about Ceph RBD volume snapshot with name `<snapshot>` of Ceph RBD volume with name `<volume>` in Ceph RBD pool with name `<pool>`. The output is identical to `/api/v1/ceph/volume?pool=<pool>&volume=<volume>&limit=<snapshot>` without fuzzy regex. Return a JSON document containing information about Ceph RBD volume snapshot with name `<snapshot>` of Ceph RBD volume with name `<volume>` in Ceph RBD pool with name `<pool>`. The output is identical to `/api/v1/storage/ceph/volume?pool=<pool>&volume=<volume>&limit=<snapshot>` without fuzzy regex.
#### `/api/v1/ceph/volume/snapshot/<pool>/<volume>/<snapshot>/add` #### `/api/v1/storage/ceph/volume/snapshot/<pool>/<volume>/<snapshot>/add`
* Methods: `POST` * Methods: `POST`
* Mandatory values: N/A * Mandatory values: N/A
* Optional values: N/A * Optional values: N/A
Add a new Ceph RBD volume snapshot with name `<volume>` of Ceph RBD volume with name `<volume>` on Ceph RBD pool with name `<pool>`. Add a new Ceph RBD volume snapshot with name `<volume>` of Ceph RBD volume with name `<volume>` on Ceph RBD pool with name `<pool>`.
#### `/api/v1/ceph/volume/snapshot/<pool>/<volume>/<snapshot>/remove` #### `/api/v1/storage/ceph/volume/snapshot/<pool>/<volume>/<snapshot>/remove`
* Methods: `POST` * Methods: `POST`
* Mandatory values: N/A * Mandatory values: N/A
* Optional values: N/A * Optional values: N/A