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 <[email protected]>
> 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 : [email protected]
> Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
signature.asc
Description: Message signed with OpenPGP using GPGMail
_______________________________________________ Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack Post to : [email protected] Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
