Prune stale resourcepools,resources,dms and alarms 63/14763/1
authorvpachchi <vineela.pachchipulusu@windriver.com>
Tue, 12 Aug 2025 09:44:22 +0000 (05:44 -0400)
committerJon Zhang <rong.zhang@windriver.com>
Wed, 20 Aug 2025 02:21:28 +0000 (02:21 +0000)
commita48786e6c5dc5b8a8e889e550b7c6cb16baa4d5a
tree56539501f31a4d6f78b831f9e553d3f7b046096b
parent65c8aaebb2451e01013f68e2c9b114fae6d34f41
Prune stale resourcepools,resources,dms and alarms

Prune DB resource pools that don't exist in the authoritative source.

Steps for each prune cycle:

Retrieve current pool IDs from client for the specified ocloud
Get pool IDs from the database
For each pool ID that exists only in DB:
Remove all alarms associated with resources in that pool
Delete all resources belonging to that pool
Remove the resource pool itself

Test Plan:
PASS- Verify if the pruned respools,resources,alarms are not displayed
PASS- Resgression tests are passed

Change-Id: Idb4900e560d3b97a99d73d03ddd22cb295eb056c
Signed-off-by: vpachchi <vineela.pachchipulusu@windriver.com>
(cherry picked from commit dcc9046040af3d5b73dbb5695df8a007b5d3480d)
o2ims/service/watcher/ocloud_watcher.py
o2ims/service/watcher/resourcepool_watcher.py