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

Revision history [back]

click to hide/show revision 1
initial version

First of all, let me clarify that there is no CDMI installed in Spain2 region and that IP 130.206.82.9 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 http://130.206.112.3:8080/v1/AUTH${TENANTID}/${NEWCONTAINERNAME} -X POST -H "Content-Length: 0" -H "X-Auth-Token: ${AUTH_TOKEN}"

** Upload an object to the container

curl -i http://130.206.112.3:8080/v1/AUTH${TENANTID}/${NEWCONTAINERNAME}/${NEWOBJECTNAME} -X PUT -H "X-Auth-Token: ${AUTHTOKEN}" -T "${FILENAMETO_UPLOAD}"

** Retrieve the object from the container

curl http://130.206.112.3:8080/v1/AUTH${TENANTID}/${NEWCONTAINERNAME}/${NEWOBJECTNAME} -H "X-Auth-Token: ${AUTHTOKEN}" > ${SOMEFILENAME}

** Delete one object from the container

curl http://130.206.112.3:8080/v1/AUTH${TENANTID}/${NEWCONTAINERNAME}/${NEWOBJECTNAME} -H "X-Auth-Token: ${AUTH_TOKEN}" -X DELETE

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

curl http://130.206.112.3:8080/v1/AUTH${TENANTID}/${NEWCONTAINERNAME} -H "X-Auth-Token: ${AUTH_TOKEN}" -X DELETE

** List your containers

curl http://130.206.112.3:8080/v1/AUTH${TENANTID} -H "X-Auth-Token: ${AUTH_TOKEN}"

** List the objects in a container

curl http://130.206.112.3:8080/v1/AUTH${TENANTID}/${NEWCONTAINERNAME} -H "X-Auth-Token: ${AUTH_TOKEN}"

  • 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
...