...
Our implementation of object storage is powered by OpenStack’s Swift.
Some Use Cases
Static Web Assets
Large amounts of unstructured data (eg. map tiles, photos, etc.)
Archival (eg. tax records, backups, etc.)
Consistency/Protection
Apps that leverage extensive metadata on a file
Access
You can gain access to your containers and objects using several methods including the RAC Dashboard, the swift command line client, interacting with the Swift API itself, or using a popular GUI application. Of note at present we don’t offer the S3 compatibility API used by some libraries to connect to Swift. (If you would like to use these feature please contact us at rac-admin@cybera.ca)
...
We offer Swift in both the Calgary region and the Edmonton region.
RAC Dashboard
You can create, delete, copy, and download objects and containers using the RAC Dashboard. Additional features such as setting metadata which is used for most advanced features are not available via the Dashboard.
Command Line (swift client)
If you haven’t already, it’s highly recommended you have reviewed Command-line Tools in the Advanced Guide. Installing the python-openstackclient
should include installation of the python-swiftclient
, but if you need to manually install it, follow the instructions below.
...
After sourcing your openrc file you can then use the swift command to interact with the object storage. Examples can be found below.
Swift API
Additionally your application can leverage the Swift API directly - either using curl or existing libraries (such as Boto for Python).
GUI Applications
Cyberduck
Cyberduck is available for Mac OS X and Windows.
...
Server | keystone-yyc.cloud.cybera.ca or keystone-yeg.cloud.cybera.ca |
Port | 35357 |
Username | project-name:user-name (eg. joe@cybera.ca:joe@cybera.ca - note the colon in between the project and user name) |
Password/Secret Key | Your Password |
This method does have the occasional issue where you need reset the port number (it will also display a warning about sending the password as clear text)
...
Note |
---|
DO NOT upload files larger than 2 GB using Cyberduck if you wish to share them via the Web. |
In Depth Features / Tutorial
See Swift CLI reference for more information.
See usage
Code Block |
---|
swift stat -v swift stat -v container_name swift stat container_name file_name |
Create a Container
Code Block |
---|
swift post container_name |
Upload a File
Code Block |
---|
echo 'Hello World' > file_on_my_computer.txt swift upload container_name file_on_my_computer.txt |
Add and Check metadata on a file
Code Block |
---|
echo 'Another file' > another_file_on_my_computer.txt swift upload container_name another_file_on_my_computer.txt swift upload -m "X-Object-Meta-Hello: World" container_name another_file_on_my_computer.txt swift stat -v container_name another_file_on_my_computer.txt |
Download a File
Code Block |
---|
swift download container_name file_on_my_computer.txt |
Managing ACLs
Code Block |
---|
# Set a container to be public swift post -r '.r:*' container_name # Allow another project to rw to container swift post -w 'second_project_id:*' container_name swift post -r 'second_project_id:*' container_name swift stat -v container_name |
...
Code Block |
---|
swift stat -v --os-storage-url https://swift-<region>.cloud.cybera.ca:8080/v1/AUTH_<first_project_id> container_name |
Making Files Available via the Web
Set container to be public to anyone
...
And then visit http://swift.cloud.cybera.ca/v1/AUTH_xxxx/container_name to view all the objects (changing AUTH_xxxx for your AUTH information)
Versioning
Another feature Swift offers is automatic versioning. This means every time an object is uploaded or updated it will store the old version in a special versions container that is created.
...
Code Block |
---|
swift post -m 'X-Versions-Location: myContainer-versions' myContainer |
Temporary Objects
One last feature we wanted to highlight is the ability to offer temporary URLs for objects or expiring URLs as they are also called. This allows you to provide a URL that will stop functioning after a certain amount of time.
...
Large/Segmented Object Warnings
Swift segments files to support objects larger than 5 GB. If you want to upload a file larger than 5GB using the Swift CLI you will need to ensure you use the -S flag and set a segment size.
...
Cyberduck creates a folder called .file_segments in your container and places the segments in there. It then writes JSON data to the manifest file so you can download the file later
Container Sync
Container sync offers the ability to synchronize the contents of two or more containers between the two regions of the Rapid Access Cloud or if supported, other OpenStack Swift installations. Every five minutes, a sync will run copying any new or changed metadata and objects (including deletions) from the source container to the destination container. Depending on the size of the objects it may take a couple more minutes to copy the object in it's entirety.
...