List all image tags from a gitlab registry

Hi,

I’m having trouble listing all the image tasks inside a registry (belonging to a repository, of course). I’m running the following command:

curl --request GET --data 'name_regex=.*' --header "PRIVATE-TOKEN: private-token" "https://gitlab.domain.com/api/v4/projects/70/registry/repositories/35/tags"

Unfortunately only the first two pages are being shown (20 image tags) instead of all. Is there any option I can add to the query that would show me all the images? Like the per_page option in github, for instance?

Thank you!

It works with per_page actually. I’m not sure why it didn’t work initially. Probably just a syntax error.
I’m guessing the same applies also when deleting images?

@lethargos you’re absolutely right, combining per_page=100 (max per page option) and page=n+1 is the best way to get a list of images inside a registry.

To delete registry images, you don’t actually need to list anything where per_page would help.

To delete registry tags you can either: delete each specific registry tag individually or use regex to delete registry tags in bulk:

2 Likes

While we’re at it, is there any way to use regex with a GET request? Just to make sure what it’s going to be deleted before I actually delete the tags?