← Back to team overview

openstack team mailing list archive

Re: json - Static Large Objects

 

Here's a little script I have to test it out on my SAIO:

#/bin/bash
export PASS='AUTH_tk36accf5200b143dd8883b9841965e6a2'
export URL='http://127.0.0.1:8080/v1/AUTH_dfg'

curl -i -H "X-Auth-Token: $PASS" $URL/hat -XPUT

curl -i -H "X-Auth-Token: $PASS" $URL/hat/one -XPUT -d '11111'

curl -i -H "X-Auth-Token: $PASS" $URL/hat/two -XPUT -d '22222'

echo `python -c 'import simplejson; print simplejson.dumps([{"path": "/hat/one", "etag": "b0baee9d279d34fa1dfd71aadb908c3f", "size_bytes": 5}, {"path": "/hat/two", "etag": "3d2172418ce305c7d16d4b05597c6a59", "size_bytes": 5}])'` | curl -i -H "X-Auth-Token: $PASS" "$URL/hat/man?multipart-manifest=put" -XPUT -Hcontent-type:text/plain -T -


you'd just need to switch out the PASS and URL with whatever you're using.  It creates a SLO object in $URL/hat/man. Oh- you'd also need to change your minimum segment size in your /etc/swift/proxy-server.conf if you wanted this to work… something like this:

[filter:slo]
use = egg:swift#slo
min_segment_size = 1


I also added support for Static Large Objects in python-swiftclient: https://github.com/openstack/python-swiftclient for example:

swift upload testcontainer testfile -S 1048576 --use-slo

creates a SLO object with 1MB segments.

David


On Apr 17, 2013, at 1:22 PM, david.loy wrote:

> This is my first post to this list so this may not be the appropriate place to ask this question:
> 
> I am trying to  upload a Static Large Object and have not been successful. I believe the problem is the json format I'm using.
> 
> The document description:
> http://docs.openstack.org/developer/swift/misc.html#deleting-a-large-object
> 
> shows:
> 
> json:
> [{"path": "/cont/object",
>  "etag": "etagoftheobjectsegment",
>  "size_bytes": 1048576}, ...]
> 
> which is not legal json.
> 
> If anyone can send me a working json example for SLO I would appreciate. If XML is supported,
> that would also be useful.
> 
> Any help would really be appreciated.
> 
> Thanks
> David
> 
> 
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~openstack
> Post to     : openstack@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~openstack
> More help   : https://help.launchpad.net/ListHelp



References