Issue link: https://read.uberflip.com/i/1334488
Chapter 5 113 Uploading multiple objects We are able to upload a number of objects at once. To do this, we simply specify each of them on our command line. To upload our test1 and test2 files, we issue the following command: swift -V 2.0 -A http://172.16.0.1:5000/v2.0/ -U cookbook:demo -K openstack upload test /tmp/test/test1 /tmp/test/test2 How it works... Uploading files to our OpenStack Storage environment is simple to achieve with the swift client tool. We can upload individual files or complete directories. The syntax is as follows: swift -V 2.0 -A http://keystone_server:5000/v2.0 -U tenant:user -K password upload container file|directory {file|directory … } Note that when uploading files, the objects that are created are of the form that we specify to the swift client, including the full paths. For example, uploading /tmp/example-500Mb uploads that object as tmp/example-500Mb. This is because OpenStack Storage is not a traditional tree-based hierarchical file system that our computers and desktops usually employ, where paths are delimited by a single slash (/ or \). OpenStack Storage consists of a flat set of objects that exist in containers where that slash forms the object name itself. Uploading large objects Individual objects up to 5 GB in size can be uploaded to OpenStack Storage. However, by splitting the objects into segments, the download size of a single object is virtually unlimited. Segments of the larger object are uploaded and a special manifest file is created that, when downloaded, sends all the segments concatenated as a single object. By splitting objects into smaller chunks, you also gain efficiency by allowing parallel uploads. Getting ready Log in to a computer or server that has the swift client package installed. www.it-ebooks.info

