First, you need to install
swift command line utility
and here is how to do it: Install OpenStack swift client only
In general you will need:
- username (–os-username) – Username
- password (–os-password) – Password
- authentication url (–os-auth-url) – The URL address, which authorize your requests, it generates a security token for your operations. Always use https!
- tenant name (–os-tenant-name) – Tenant is like a project.
All of the above information should be available from your OpenStack administrator.
For the examples we assume there is a container “mytest” (it’s like a main directory from the root). You cannot upload files in the root, because this is the place for containers only i.e. directories. You must always upload files under container (i.e. directory aka folder).
To upload a single file with swift cli execute:
myuser@myserver:~$ swift --os-username myuser --os-tenant-name mytenant --os-password mypass --os-auth-url https://auth-url.example.com/v2.0/ upload mytest ./file1.log file1.log