oci-java-sdk
oci-java-sdk copied to clipboard
List Compartment lacks feature to filter out deleted compartments
List Compartments API returns all the compartments,(Active+deleted), there hould be a filter option based on the lifecyclestate in Listcompartment request
Our current behavior is that we return the list of compartments until the audit period has expired, then it will be removed from the list.
However, I'll add the ability to filter out deleted compartments as feature request. Can you tell me why you'd want this filter on the server side?
because we audit the events for the compartments and if the compartment is deleted then it makes no sense to audit the logs for the compartment since no actions can be performed further
Ok, thanks. So you want to filter it out since you want to look at audit events for active compartments only.
This is an old ticket, and the requestor might have found the solution already. You can filter out deleted compartments by passing in the lifecycle-state
parameter. E.g., oci iam compartment list --lifecycle-state ACTIVE
returns only active compartments.
Hi @aunayak , Please try out the suggestion above and let us know if you encounter this issue again. I am closing this ticket for now. Thanks.