Ask Your Question
2

How to make a container public in swift rest api?

asked 2015-08-23 04:56:03 -0500

frz59 gravatar image

updated 2015-08-23 04:56:35 -0500

I want to know how can I make a public container or make a container public by swift restful API.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
2

answered 2015-08-23 09:12:44 -0500

updated 2015-08-23 09:13:18 -0500

Setting container ACLs (write/read) to *

Example:

curl -X POST -i \
       -H "X-Auth-Token: 0101010101" \
       -H "X-Container-Read: .r:*" \
       -H "X-Container-Write: .r:*" \
       http://swift.example.com/v1/AUTH_bob/container

This will update an existing container to give read and write permissions for everybody (publicly), if you want to create it, use PUT instead of POST in the request Regards

edit flag offensive delete link more

Comments

When I added -H "X-Container-Write: .r:*" to my command, it didsn't work. The error message is: Referrers not allowed in write ACL: '.r:*' But when I just added -H "X-Container-Read: .r:*", it worked. Thank you Eduardo.

frz59 gravatar imagefrz59 ( 2015-08-24 00:59:32 -0500 )edit
1

Realize that setting read acl to * does not allow listings over container. Must set .rlistings for that purpose. Check dev guide https://swiftstack.com/docs/cookbooks/swift_usage/container_acl.html

Eduardo Gonzalez gravatar imageEduardo Gonzalez ( 2015-08-24 01:32:31 -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: 2015-08-23 04:56:03 -0500

Seen: 2,649 times

Last updated: Aug 14