Ask Your Question
0

swift: search objects in container by name

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

Robin Winslow gravatar image

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

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.

References

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
0

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

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

Comments

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 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

2 followers

Stats

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

Seen: 687 times

Last updated: May 13 '14