swift: search objects in container by name

asked 2014-05-13 08:02:15 -0600

Robin Winslow gravatar image

updated 2014-08-19 12:42:36 -0600

briancline gravatar image

Is there any way to filter objects returned when listing items in a swift container? As far as I can tell, the following will simply list all items in a container:

http GET https://swift.example.com/v1/AUTH_ID/myfiles?format=json

If there are potentially thousands of objects inside that container, it would be really useful to be able to filter by say a substring of their name - e.g.:

http GET https://swift.example.com/v1/AUTH_ID/myfiles?format=json&name-filter=gif # return gif files

Even more useful would be to be able to search objects by arbitrarily set meta data. But I can't find anything in the docs1 suggesting you can do either of these things.


1. http://docs.openstack.org/api/openstack-object-storage/1.0/content/GET_showContainerDetails__v1__account___container__storage_container_services.html
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2014-05-13 18:00:30 -0600

torgomatic gravatar image

You can search by prefix with the prefix query parameter; setting prefix=abc will retrieve only entries for objects starting with "abc".

edit flag offensive delete link more


Yeah I know about prefix, but it's useless for this task. What I really want is to find on a substring anywhere - e.g. unt would find ubuntu.jpg.

Robin Winslow gravatar imageRobin Winslow ( 2014-05-14 05:02:47 -0600 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools



Asked: 2014-05-13 08:02:15 -0600

Seen: 895 times

Last updated: May 13 '14