oci-go-sdk icon indicating copy to clipboard operation
oci-go-sdk copied to clipboard

How to list block volumes using freeform tags as filter

Open vinayakshnd opened this issue 3 years ago • 1 comments

ListVolume does not take tags as input filter in request body. I want to get list of only volumes that have certain tags applied to them. I know that I can get list of all the volumes in my account using this API and then filter them out at client side. But I want to avoid doing that at client side. Is there any way to just get list of volumes based on tags assigned to them?

vinayakshnd avatar Aug 26 '22 05:08 vinayakshnd

Hi @vinayakshnd , Unfortunately, the block volume team confirmed that they are not supporting sorting by tags right now.

The good news is that there are a couple of options they suggested:

  1. list all volumes and filter by tags on the client (as suggested by you in the ticket)
  2. keep the volumes in a special volume group and get that volume group

Please give this a try and let us know if you have any issues. Hope this helps. Thanks.

KartikShrikantHegde avatar May 02 '23 17:05 KartikShrikantHegde