Background knowledge
In Pulsar, the current CLI commands for deleting tenants, namespaces, topics, and subscriptions require specifying each entity individually. This can be cumbersome and time-consuming, especially in testing or maintenance scenarios where multiple entities need to be deleted.
Motivation
The motivation behind this proposal is to improve the efficiency of the deletion process and make it more convenient to clean up environments in certain scenarios, such as testing and production environments where entities like subscriptions associated with deprecated services need to be cleaned up. This can be achieved by adding support for reading entity names from a file and using regular expressions for batch deletion.
Goals
In Scope
- Add support for reading entity names (tenants, namespaces, topics, and subscriptions) from a file.
- Add support for regular expressions in CLI commands for deleting entities.
- Delete entities from the local cluster where the command is run.
- Maintain backward compatibility.
Out of Scope
N/A
High Level Design
The solution involves extending the current Pulsar CLI commands to support batch deletion by reading entity names from a file and using regular expressions. This will allow users to delete multiple entities at once, making the process more efficient and convenient.
Detailed Design
Design & Implementation Details
-
Extend the current CLI commands (pulsar-admin tenants delete, pulsar-admin namespaces delete, pulsar-admin topics delete, and pulsar-admin subscriptions delete) to include optional arguments --regex, and --from-file.
-
If --from-file is specified, read the entity names from the provided file, with one entity name per line. If --regex is specified, filter the entity names based on the provided regular expression.
-
Perform the deletion operation on the filtered list of entity names in the local cluster where the command is run.
Public-facing Changes
CLI
-
Add optional arguments --regex, and --from-file to the following CLI commands:
pulsar-admin tenants delete
pulsar-admin namespaces delete
pulsar-admin topics delete
pulsar-admin subscriptions delete
-
Update the documentation and help messages for these commands to include the new arguments and their usage.
Monitoring
No additional monitoring is required for this feature, as it only extends the CLI commands' functionality.
Security Considerations
There are no new security considerations introduced by this proposal, as the existing authentication and authorization mechanisms will still apply to the modified CLI commands.
Backward & Forward Compatibility
Revert
To revert back to a version without this feature, users can simply downgrade their Pulsar CLI version to a version that does not include the changes.
Upgrade
No special upgrade steps are required. Users can upgrade their Pulsar CLI version to a version that includes the changes without any issues.
Alternatives
N/A
General Notes
N/A
Links
Background knowledge
In Pulsar, the current CLI commands for deleting tenants, namespaces, topics, and subscriptions require specifying each entity individually. This can be cumbersome and time-consuming, especially in testing or maintenance scenarios where multiple entities need to be deleted.
Motivation
The motivation behind this proposal is to improve the efficiency of the deletion process and make it more convenient to clean up environments in certain scenarios, such as testing and production environments where entities like subscriptions associated with deprecated services need to be cleaned up. This can be achieved by adding support for reading entity names from a file and using regular expressions for batch deletion.
Goals
In Scope
Out of Scope
N/A
High Level Design
The solution involves extending the current Pulsar CLI commands to support batch deletion by reading entity names from a file and using regular expressions. This will allow users to delete multiple entities at once, making the process more efficient and convenient.
Detailed Design
Design & Implementation Details
Extend the current CLI commands (
pulsar-admin tenants delete,pulsar-admin namespaces delete,pulsar-admin topics delete, andpulsar-admin subscriptions delete) to include optional arguments--regex, and--from-file.If
--from-fileis specified, read the entity names from the provided file, with one entity name per line. If--regexis specified, filter the entity names based on the provided regular expression.Perform the deletion operation on the filtered list of entity names in the local cluster where the command is run.
Public-facing Changes
CLI
Add optional arguments
--regex, and--from-fileto the following CLI commands:pulsar-admin tenants deletepulsar-admin namespaces deletepulsar-admin topics deletepulsar-admin subscriptions deleteUpdate the documentation and help messages for these commands to include the new arguments and their usage.
Monitoring
No additional monitoring is required for this feature, as it only extends the CLI commands' functionality.
Security Considerations
There are no new security considerations introduced by this proposal, as the existing authentication and authorization mechanisms will still apply to the modified CLI commands.
Backward & Forward Compatibility
Revert
To revert back to a version without this feature, users can simply downgrade their Pulsar CLI version to a version that does not include the changes.
Upgrade
No special upgrade steps are required. Users can upgrade their Pulsar CLI version to a version that includes the changes without any issues.
Alternatives
N/A
General Notes
N/A
Links