After Deprec

openstack_cloud_computing_cookbook

Issue link: https://read.uberflip.com/i/1334488

Contents of this Issue

Navigation

Page 127 of 317

Chapter 5 117 How it works... The tool swift is a basic but versatile utility that allows us to do many of the things we want to do with files. Listing them in a way that suits the user is also possible. To simply list the contents of our container, the syntax is as follows: swift -V 2.0 -A http://keystone_server:5000/v2.0 -U tenant:user -K password list container To list a file in a particular path within the container, we add in the -p parameter to the syntax: swift -V 2.0 -A http://keystone_server:5000/v2.0 -U tenant:user -K password list -p path container Downloading objects Now that we have a usable OpenStack Storage environment with containers and objects, there comes a time when we want to retrieve the objects. The swift client tool allows us to do this. Getting ready Log in to a computer or server that has the swift client package installed. How to do it... Carry out the following to download objects from our OpenStack Storage environment: Downloading objects To download the object tmp/test/test1, we issue the following command: swift -V 2.0 -A http://172.16.0.1:5000/v2.0/ -U cookbook:demo -K openstack download test tmp/test/test1 This downloads the object to our file system. As we downloaded a file with the full path, this directory structure is preserved, so we end up with a new directory structure of tmp/test with a file in it called test1. Downloading objects with the -o parameter To download the file without preserving the file structure, or to simply rename it to something else, we specify the -o parameter, as follows: swift -V 2.0 -A http://172.16.0.1:5000/v2.0/ -U cookbook:demo -K openstack download test tmp/test/test1 -o test1 www.it-ebooks.info

Articles in this issue

Links on this page

Archives of this issue

view archives of After Deprec - openstack_cloud_computing_cookbook