Add cleanup policies Rest APIs

Problem

As part of implementing virtual registry cache entry lifecycle management (see #548566 (closed)), we need to create REST API endpoints to allow users to programmatically manage cleanup policies.

Solution

Implement REST API endpoints for virtual registry cleanup policies that will allow users to:

  1. Create a new cleanup policy for a top-level group
  2. Retrieve existing cleanup policy details
  3. Update an existing cleanup policy
  4. Delete a cleanup policy

The API should support the following parameters:

  • keep_n_days_after_download: Number of days after which unused cache entries can be removed
  • cadence: How often the cleanup job should run (daily, weekly, monthly, etc.)
  • enabled: Boolean to enable/disable the policy

Implementation Details

  • Create new API endpoints under the virtual registry namespace
  • Ensure proper authentication and authorization (group owners only)
  • Add appropriate documentation
  • Include tests for all endpoints
Edited by Moaz Khalifa