In sahara-cli you can only delete an object by name or id. In several os clients, such as nova and heat, you can delete an object by providing a list of ids or names. This blueprint is about adding this feature in sahara-cli.
The CLI does not include deletion of objects by list of names or ids.
Our long term goal is to have the sahara-cli more consistent with other os clients.
Current CLI usage for cluster-delete:
sahara cluster-delete [--name NAME] [--id <cluster_id>]
Nova CLI usage for delete:
nova delete <server> [<server> ...]
In nova-cli, and other os clients, you pass directly the id(s) or the name(s) of the items you want to delete. We can refactor sahara-cli to remove the –name and –id arguments. So in long term the usage of sahara cli will be:
sahara cluster-delete <cluster> [<cluster> ...] Positional arguments: <cluster> Name or ID of cluster(s).``
Note that the CLI refactoring will take substantial time, so as short term solution, can temporary use –names and –ids for all delete verbs of the CLI. And once the CLI will be refactored, we will remove all –name(s) and –id(s) arguments.
So the proposed change implies to add –names and –ids arguments which consist of a Comma separated list of names and ids:
sahara cluster-delete [--name NAME] [--id cluster_id] [--names NAMES] [--ids IDS]
No short term solution and just depend on the CLI refactoring to provide this feature.
Update CLI methods *_delete in saharaclient/api/shell.py
Primary Assignee: Pierre Padrixe (stannie)
Update the tests to delete list of names and ids
Documentation of the CLI needs to be updated