The following examples show how to use the swift command-line client.
swift -A http://zfssa:80/auth/v1.0 -U user -K key list
The output lists the containers that are part of an account.
swift -A http://zfssa:80/auth/v1.0/export/fs1 -U user -K key list
swift -A http://zfssa:80/auth/v1.0/ -U user -K key list containerA
swift -A http://zfssa:80/auth/v1.0/ -U user -K key upload containerA object1
swift -A http://zfssa:80/auth/v1.0/ -U user -K key download containerA
swift -A http://zfssa:80/auth/v1.0/ -U user -K key delete containerA
swift -A http://zfssa:80/auth/v1.0/ -U user -K key download containerA object1
swift -A http://zfssa:80/auth/v1.0/ -U user -K key delete containerA object1
swift -A http://zfssa:80/auth/v1.0/ -U user -K key post containerA object1 --header "X-Object-Meta-Movie: comedy”
swift -A http://zfssa:80/auth/v1.0/ -U user -K key stat -v containerA object1
Dynamic Large Object is a middleware component supported by Oracle ZFS Storage Appliance.
swift -A http://zfssa:80/auth/v1.0/ -U user -K key upload containerA large_file -S 100000000
Dynamic Large Object is a middleware component supported by Oracle ZFS Storage Appliance.
swift -A http://zfssa:80/auth/v1.0/ -U user -K key download containerA large_file
Bulk Delete and Bulk Upload are middleware components supported by Oracle ZFS Storage Appliance.
In the following example, three objects are created in a container called Various. A file called object_to_delete contains the name of the objects to be deleted. A curl command is used to delete those objects.
Multiple file uploads can be accomplished in a similar manner, using the bulk-upload option.
# swift -U swift1 -K swift1 \ -A http://192.168.0.200/v1/export/MyMusic \ upload --object-name a1 Various aa.txt a1 # swift -U swift1 -K swift1 \ -A http://192.168.0.200/v1/export/MyMusic \ upload --object-name a2 Various aa.txt a2 # swift -U swift1 -K swift1 \ -A http://192.168.0.200/v1/export/MyMusic \ upload --object-name a3 Various aa.txt a3 # vi object_to_delete # cat objects_to_delete Various/a1 Various/a2 Various/a3 # swift -U swift1 -K swift1 \ -A http://192.168.0.200/v1/export/MyMusic/Various list DabyToure&SkipMcDonald.mp3 a1 a2 a3 aa.txt # curl -X DELETE -H "X-Auth-Token: $token" \ -T objects_to_delete \ "http://192.168.0.200/v1/export/MyMusic/Various/?bulk-delete" Number Deleted: 3 Number Not Found: 0 Response Body: Response Status: 200 OK Errors: # swift -U swift1 -K swift1 \ -A http://192.168.0.200/v1/export/MyMusic/Various list DabyToure&SkipMcDonald.mp3 aa.txt #