We use proprietary and third party´s cookies to improve your experience and our services, identifying your Internet Browsing preferences on our website; develop analytic activities and display advertising based on your preferences. If you keep browsing, you accept its use. You can get more information on our Cookie Policy
Cookies Policy
Ask Your Question

How can i remotely create a container?

asked 2016-02-04 06:57:13 +0200

Dexter gravatar image

I'm in Spain2 region and trying to create a container from terminal using:

curl    -v \
    -X PUT \
    -H 'X-Auth-Token: $Auth-Token' \
    -H 'Content-Type: application/cdmi-container' \
    -H 'Accept: application/cdmi-container' \
    -H 'X-VDMI-Specification-Version: 1.0.1' \$ID/example_curl/

I can get the capabilities correctly but when i try to list the containers, create a new one or download/upload content i get error 403 forbidden:

403 Forbidden

Access was denied to this resource.

*Connection #0 to host left intact

Here's an example of capabilities.sh, which works well:

curl    -v \
    -X GET \
    -H 'X-Auth-Token: $Auth-Token' \
    -H 'Accept: application/cdmi-capabilities' \
    -H 'X-VDMI-Specification-Version: 1.0.1' \$ID/cdmi_capabilities/

Any idea why i cant create/interact with the containers?


edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2016-02-05 07:16:47 +0200

jicg gravatar image

First of all, let me clarify that there is no CDMI installed in Spain2 region and that IP doesn't belong to Spain2 region. Thus, the endpoints you are using are not valid enpoints to create containers/objects.

You can use this in serveral ways, I'll try to explain one using curl (following your example) and another one using the Official Command Line Interface.

  • 1st way, using curl

So, in order to create containers and to create, retrieve, delete and list objects you could use Swift API

** Create a container

curl -i${TENANTID}/${NEWCONTAINERNAME} -X POST -H "Content-Length: 0" -H "X-Auth-Token: ${AUTH_TOKEN}"

** Upload an object to the container


** Retrieve the object from the container


** Delete one object from the container


** Delete the container (only if it is empty):


** List your containers

curl${TENANTID} -H "X-Auth-Token: ${AUTH_TOKEN}"

** List the objects in a container


  • 2nd way, using the python CLI

Some other way to work with Swift could be installing the Swift CLI:

pip install python-keystoneclient python-swiftclient

This way you could be able to access your objects using this tool:

swift -v -V 2.0 -A http://cloud.lab.fi-ware.org:4730/v2.0/ -U ${YOURTENANTNAME}:${YOURUSERNAME} -K ${YOUR_PASSWORD} <operations>

So operations can be list, post, upload, etc... This is quite well explained in the command help if you simply type swift.

$ swift
Usage: swift
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2016-02-04 06:57:13 +0200

Seen: 3,008 times

Last updated: Feb 04 '16