Swiftclient

UCDN
2019-09-18 13:41

Another method for managing your UCDN storage is by using a command-line tool called "swiftclient" based on python. You can download it from here: https://github.com/openstack/python-swiftclient

After you configure it on your server or local computer, you can start using it with the following details:

  • username - first part of your username associated with the container at your control panel. If your username is 100001.100001 , then username will be 100001
  • tenant - the same as username, e.g. 100001
  • password - the password, which you can check from your control panel
  • url - here you should use Swift authorization URL: https://auth.files.nl01.cloud.servers.com:5000/v2.0/ - if you want to connect to your Europe container https://auth.files.us01.cloud.servers.com:5000/v2.0/ - if you want to connecto to your North America container

In order to list files for your container you can use the following command:

swift --os-username YOUR_USERNAME --os-tenant-name YOUR_TENANT --os-password YOUR_PASSWORD --os-auth-url https://auth.files.nl01.cloud.servers.com:5000/v2.0/ list YOUR_CONTAINER

In order to upload files to your container you can use the following command:

swift --os-username YOUR_USERNAME --os-tenant-name YOUR_TENANT --os-password YOUR_PASSWORD --os-auth-url https://auth.files.nl01.cloud.servers.com:5000/v2.0/ upload YOUR_CONTAINER PATH_TO_YOUR_FILE

In order to delete files to your container you can use the following command:

swift --os-username YOUR_USERNAME --os-tenant-name YOUR_TENANT --os-password YOUR_PASSWORD --os-auth-url https://auth.files.nl01.cloud.servers.com:5000/v2.0/ delete YOUR_CONTAINER PATH_TO_YOUR_FILE

You can check all available commands using: swift -h or swift --help

Tags: Swiftclient