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})
--John
> On Jul 28, 2015, at 9:16 PM, Mark Kirkwood <mark.kirkwood at catalyst.net.nz> wrote:
>
> On 25/07/15 00:28, Vincenzo Pii wrote:
>> To upload a Dynamic Large Object with the Swift CLI one can just do
>>
>> swift upload newcont -S 1048576000 large_object
>>
>> but, is there any equivalent in the swift python APIs (swiftclient module
>> from https://github.com/openstack/python-swiftclient)?
>>
>> The content_length parameter of put_object will just truncate the content...
>>
>
> The general approach is outlined here (Swift API section):
>
> https://www.mirantis.com/blog/large-objects-in-cloud-storages/
>
>
> I have attached a rather simple sample program that uses the idea.
>
> regards
>
> Mark
>
> <swiftclient-big.py>_______________________________________________
> Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
> Post to : openstack at lists.openstack.org
> Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20150728/32b424b2/attachment.sig>