blackducksoftware / hub-rest-api-python

HUB REST API Python bindings
Apache License 2.0
89 stars 104 forks source link

Allow time parameter for deleting empty projects and projects #173

Closed ramaprakashganesan closed 4 months ago

ramaprakashganesan commented 3 years ago

https://github.com/blackducksoftware/hub-rest-api-python/blob/master/examples/delete_empty_projects_and_versions.py just seems to directly delete all empty projects and all empty versions in any projects. Request to add parameter for its execution to provide number of days since that particular project or version was created. Eg: Delete all projects and all versions in all projects that are empty, and created 30 days before or earlier.

https://github.com/blackducksoftware/hub-rest-api-python/blob/master/examples/delete_empty_projects.py does allow a time parameter. If similar logic to provide time were provided for versions also, it would be helpful. It is better if the time parameter is in the form of number of days since creation, rather than in date format (YYYY-MM-DD).

Please see if possible to implement this. Would be helpful for multiple customers.

gsnyder2007 commented 3 years ago

Thanks for the feedback. The examples are just that and are provided as-is. You're welcome to fork and change however you want OR make a PR to incorporate some additional capability like this. I'm sure it would be quite possible to implement what you've asked for and one of the maintainers/contributors may be able to get to it sooner rather than later, but if you don't want to wait we welcome PR's so feel free to suggest something.