Apache Libcloud 1.0.0-rc2 (preview) was released today and it contains the new Outscale storage driver I contributed upstream several days ago.
Along this entry I will introduce the Apache Libcloud project, the Outscale driver and how a new provider can be used to connect with the Outscale object storage service.
The Apache Libcloud project
Apache Libcloud is an Open Source Python library that provides a vendor-neutral interface to cloud provider APIs. It is used to support diversification without vendor lock-in.
The library eases the interaction with the cloud resources through an unified API and backend drivers.
There are available backend drivers to support popular and well-known cloud service providers. As expected, those drivers contain the functionalities exported to developers and applications via the unified API.
From a logical perspective, the library divides the supported resources among the following categories:
- Cloud Servers and Block Storage
- Cloud Object Storage and CDN
- Load Balancers as a Service
- DNS as a Service
- Container Services
- Backup as a Service
The next picture shows a simplified Libcloud diagram:
The Outscale object storage driver
The BSU is the way to work with block storage on standard hard drives or SSDs. It is used to create and attach block storage volumes to instances in the Flexible Compute Unit (FCU) service.
The OSU service is all about storing and managing objects in a replicated and high-availability environment. The service exports an AWS S3 compatible API.
The Outscale object storage driver targets this second service, the OSU service. The driver extends the Libcloud S3 storage driver to provide a compatible S3 API together with the required bits to connect with the OSU service.
Using the Outscale OSU storage driver in Libcloud
You can use the OSU driver via the S3_RGW_OUTSCALE provider easily. A simple snippet follows...
from libcloud.storage.types import Provider from libcloud.storage.providers import get_driver import libcloud api_key = 'api_key' secret_key = 'secret_key' cls = get_driver(Provider.S3_RGW_OUTSCALE) driver = cls(api_key, secret_key, region='eu-west-1') container = driver.get_container(...)
The 'region' parameter is an optional parameter. If you don't set up an explicit region the driver will use the default region 'eu-west-2'.
The driver supports the following five Outscale regions:
A full example loading the S3_RGW_OUTSCALE provider and then retrieving an object is available here.
Running the example...
$ ./test-osu-outscale-driver.py <Object: name=my-name-abcdabcd-123, size=3453, hash=89c28be4b979a529afa5f24fae439858, provider=OUTSCALE Ceph RGW S3 (eu-west-1) ...>