[Openstack] Python API for Dynamic Large Objects in Swift

Clint Byrum clint at fewbar.com
Wed Jul 29 06:01:39 UTC 2015


Excerpts from John Dickinson's message of 2015-07-28 22:01:54 -0700:
> You can also use swiftclient.service module. It is the wrapper on top of the low-level swiftclient.client that is actually what the CLI tool uses for some of its higher-order functions (like splitting larger local files and making manifest objects).
> 
> You'd have something like:
> 
> results = swiftclient.service.upload('target_container', ['path/to/local/file',], options={'segment_size': 1048576000})
> 

Indeed. To build on this, since you may have more than one cloud, we've
added some pieces to the 'shade' library that figures out what segment
sizes to use and just lets you pass in paths. Unfortunately I just
noticed the create_object method isn't well documented, but I submitted
a patch so here is that documentation:

https://review.openstack.org/#/c/206872/1/shade/__init__.py

Basically something like


import shade

cloud = shade.openstack_cloud()
cloud.create_object('target_container', 'call me maybe', 'path/to/local/file')




More information about the Openstack mailing list