Enable the purge of deleted stacks for specific project

Add project-id argument to heat-manage purge_deleted command in order to be able to hard delete DB entries for a specific project.


Problem description

Currently heat-manage purge_deleted command allows operators to purge all DB entries marked as deleted and are older than an age.

Usually this global purge process is setup to run periodically in a cloud platform. However, for some specific projects, cloud operators would like to setup the purge process with much smaller retention period. Typical example of such project is the monitoring project that monitors heat service.

Proposed change

Add project-id argument for heat-manage purge_deleted command:

~ # heat-manage purge_deleted --help
usage: heat-manage purge_deleted [-h] [-g {days,hours,minutes,seconds}]
                                 [-p PROJECT_ID]

positional arguments:
   age                   How long to preserve deleted data.

optional arguments:
  -h, --help            show this help message and exit
  -g {days,hours,minutes,seconds}, --granularity {days,hours,minutes,seconds}
                        Granularity to use for age argument,
                        defaults to days.
  -p PROJECT_ID, --project-id PROJECT_ID
                        Project ID to purge deleted stacks.

When project-id argument is set, only this project DB entries marked as deleted will be purged. Given project-id value will not be validated, leaving the database unchanged if incorrect.




Primary assignee:

Ala Rezmerita <ala.rezmerita@orange.com>


Target Milestone for completion:


Work Items

  • Implement proposed change

  • Add the corresponding functional tests