Ask Your Question
0

swift download

asked 2017-02-17 02:23:46 -0500

tcpip gravatar image

hi all,

I have a container called Books1, inside I have 10 pdf files, how can i download an specific pdf file to an specific path?

I was using

swift download -a -D

but this will download all the pdf files.

thanks.

edit retag flag offensive close merge delete

3 answers

Sort by ยป oldest newest most voted
0

answered 2017-02-28 11:35:39 -0500

ntata gravatar image

Hello,

There are two ways to download an object from a container in Swift.

  1. using python-swiftclient
  2. using python-openstackclient

Per the question, I see that you're using python-swiftclient which is simply "swift". In your example, the arguments used with swift are downloading all objects (-a) into a specified path(-D). Hence you see all the PDFs being downloaded. However, you might want to use it like this -

swift download <container-name> <specific-PDF-to-download> -o <download-dir-path/output-filename>

NOTE: -D is an optional argument that is used when downloading more than one object from a container into a specified directory. Since you want to download only one object from a container, -o must be used by explicitly specifying the path of the downloads directory along with a filename for the downloaded object. However, by changing your pwd (present working directory) to the downloads directory, you can simply use the following:

cd /path-to-downloads-dir/
swift download <container-name> <specific-PDF-to-download>

The above will simply download your specified object into the current directory and retains its name as is.

References: https://docs.openstack.org/cli-reference/swift.html#swift-download (https://docs.openstack.org/cli-refere...)

edit flag offensive delete link more
0

answered 2017-02-18 02:29:27 -0500

tcpip gravatar image

Hello

I did a delete but in the swift container will shows the file.

thanks.

edit flag offensive delete link more

Comments

Put that in a different question. And I would check the log files. Swift normally logs to the system log.

Bernd Bausch gravatar imageBernd Bausch ( 2017-02-18 04:32:22 -0500 )edit
0

answered 2017-02-17 03:58:47 -0500

Bernd Bausch gravatar image

updated 2017-02-17 04:00:59 -0500

Using the openstack client: openstack object save --file LOCALFILENAME CONTAINERNAME OBJECTNAME. As seen at https://docs.openstack.org/developer/....

Or swift download CONTAINER OBJECT_FILENAME. You may also want to read the end-user guide.

edit flag offensive delete link more

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

1 follower

Stats

Asked: 2017-02-17 02:23:46 -0500

Seen: 46 times

Last updated: Feb 18