1

I would like to download a file from Swift (Openstack) using curl. I used the following command : curl -i http://hostname:5000/v2/container_name/filename -X GET -H "X-Auth-Token:token_value" -o "response.txt"

Where : response.txt : a file to store the result of curl

I used the version 2 of authentication.

I got as a response that "The resource could not be found". You can see the full message in the following image.

enter image description here Is the URL correct ? I obtained the token by running the command swift stat -v. Is it the right token ?

Thank you

Amelie
  • 535
  • 1
  • 5
  • 13

1 Answers1

0

By the port(5000) and your error message you're pointing curl to Keystone instead of Swift.

Which type of installation do you have? I think probably Swift is running on one of these ports: 8081, 8080 or 80.

I've just realized there are more things wrong with your url. It should be something like:

http://hostname:8080/v1/AUTH_ACCOUNTID(or NAME)/container_name/filename

Nelson Marcos
  • 477
  • 2
  • 16
  • 1
    When I switched the port to 8080, I obtained the followin g error : http 1.1 401 unautorized , the request you have made requires authentication – Amelie Nov 25 '16 at 19:47
  • But I am using authentication with keystone (not tempauth) – Amelie Nov 25 '16 at 20:08
  • When you authenticate with keystone it shows 3 urls: public url, internal url and admin url. You sould use public url. – Nelson Marcos Nov 25 '16 at 20:09
  • the command swift stat -v gives the storage url, the account and the authentication token. I used these informations for the curl command. – Amelie Nov 25 '16 at 20:17
  • Can you pastebin the output hiding your private data, changing the characters? – Nelson Marcos Nov 28 '16 at 12:46
  • 1
    Suggest you do a GET on the account to list containers, so that you can confirm you are using the correct swift endpoint and it has the container that you are looking for. – Chen Xie Dec 09 '16 at 20:54