Add OSD removal force option

Ensures a removal can continue even in situations where some step(s)
might fail, for instance removing an obsolete OSD from a replaced node.
This commit is contained in:
2022-04-29 11:16:33 -04:00
parent f3f4eaadf1
commit cb50eee2a9
6 changed files with 63 additions and 20 deletions

View File

@ -4099,11 +4099,16 @@ class API_Storage_Ceph_OSD_Element(Resource):
@RequestParser(
[
{
"name": "force",
"required": False,
"helptext": "Force removal even if steps fail.",
},
{
"name": "yes-i-really-mean-it",
"required": True,
"helptext": "Please confirm that 'yes-i-really-mean-it'.",
}
},
]
)
@Authenticator
@ -4116,6 +4121,11 @@ class API_Storage_Ceph_OSD_Element(Resource):
tags:
- storage / ceph
parameters:
- in: query
name: force
type: boolean
required: flase
description: Force removal even if some step(s) fail
- in: query
name: yes-i-really-mean-it
type: string
@ -4138,7 +4148,7 @@ class API_Storage_Ceph_OSD_Element(Resource):
type: object
id: Message
"""
return api_helper.ceph_osd_remove(osdid)
return api_helper.ceph_osd_remove(osdid, reqargs.get("force", False))
api.add_resource(API_Storage_Ceph_OSD_Element, "/storage/ceph/osd/<osdid>")