Can't access to a container

Asked by Andreas Constabel

Hi,

I have installed the devstack version with swift on ubuntu. The installation is up an running. I have create a container. Until no problem. Now I want to get access to the container but it proves not so easy. I have tried a lot of curl commands and it seems like I will never get a x-auth-token.

Can someone help me?

root@ubuntu:~# swift -A http://10.1.1.37:8080/v1 -U admin -K password list
Auth GET failed: http://10.1.1.37:8080/v1 412 Precondition Failed

root@ubuntu:~# swift -A http://localhost:5000/v2.0 -U admin -K password list
Auth GET failed: http://localhost:5000/v2.0 200 OK

Regards,
Andreas

Question information

Language:
English Edit question
Status:
Answered
For:
OpenStack Object Storage (swift) Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Fabien Boucher (fabien-boucher) said :
#1

Hi Andreas,

In devstack you must use the v2.0 API of keystone, so your second command must be as follow :

fabien@ubuntu:~/devstack$ OS_TENANT_NAME=demo swift -A http://192.168.1.47:5000/v2.0 -V 2 -U demo -K wxcvbn list
mycontainer

If I not provide the API version, the command fails :
fabien@ubuntu:~/devstack$ OS_TENANT_NAME=demo swift -A http://192.168.1.47:5000/v2.0 -U demo -K wxcvbn list
Auth GET failed: http://192.168.1.47:5000/v2.0 200 OK

In devstack you can source the openrc file that contains default informations for tenant, username, and password.
Environnements variables will be set correctly.
fabien@ubuntu:~/devstack$ . openrc
fabien@ubuntu:~/devstack$ swift -A http://192.168.1.47:5000/v2.0 list
mycontainer

This is the same as the above command except that we use admin account and set environnement variables for this swift command:
fabien@ubuntu:~/devstack$ OS_USERNAME=admin OS_TENANT_NAME=admin USER_PASSWORD=wxcvbn swift -A http://192.168.1.47:5000/v2.0 post
admincontainer
fabien@ubuntu:~/devstack$ OS_USERNAME=admin OS_TENANT_NAME=admin USER_PASSWORD=wxcvbn swift -A http://192.168.1.47:5000/v2.0 list
admincontainer
I hope that will help you.
Regards

Revision history for this message
Andreas Constabel (ac-3) said :
#2

Hi Fabien,

thanks you for your help.

The command works:
root@ubuntu:~# swift list --os-auth-url http://10.1.1.37:5000/v2.0 --os-username admin --os-password password --os-tenant-name admin -V 2
TestContainer

An now, how can I get access to the container from externel programms? I want to store backups into a container. I must specify an storage path url like this:
example: <host>[:<port>]/<container<[/<prefix>]

Here my one:
IP:5000/v2.0/TestContainer

First, if I tried to acces through webbrowser I get the following:
<error message="The resource could not be found." code="404" title="Not Found"/>

Precaution, if I tried the following, I get:
http://ip:8080/v1/TestContainer
Unauthorized

I have to mount the container through the backup software. I will still get a failure.

Can someone tell me how to access to an container from external?

Revision history for this message
Fabien Boucher (fabien-boucher) said :
#3

Hi Andreas,

You need to use the API of swift to access store/access backup on your swift account, you should have a look at:
http://docs.openstack.org/api/openstack-object-storage/1.0/content/
If your backup software is not able to use directly the swift API it can be difficult to so, maybe you need
to develop a kind of middleware.
I've found this on github maybe it could help https://github.com/redbo/cloudfuse.
I cannot help you anymore ...

Regards,
Fabien

Revision history for this message
Andreas Constabel (ac-3) said :
#4

Hi Fabien,

I only need to know how do access to a container after setup a fresh devstack installation with swift.

root@ubuntu:~# swift list --os-auth-url http://10.1.1.37:5000/v2.0 --os-username admin --os-password password --os-tenant-name admin
TestContainer

It can't be so difficult.

Revision history for this message
Andreas Constabel (ac-3) said :
#5

OK I have just success upload a file into a container through cli:

root@ubuntu:/etc/swift# swift -A http://127.0.0.1:8080/auth/v1.0 -U admin:admin -K admin list
testcontainer

root@ubuntu:/etc/swift# swift -A http://127.0.0.1:8080/auth/v1.0 -U admin:admin -K admin upload testcontainer swift.conf
swift.conf

Know someone the correct options for the cyberduck program? I have already import the "swift unsecure" profile to get access through http instead https.
Perhaps there are other good swift clients for testing?

Can you help with this problem?

Provide an answer of your own, or ask Andreas Constabel for more information if necessary.

To post a message you must log in.