<div>Hi Rugwiro,</div><div><br></div><div>Are you having a problem setting up PyDev or writing the code to interact with Swift?</div><div><br></div><div>I'm not familiar with Python on Windows but assuming you're using pip you can install the Swift Python bindings like this,</div>
<div><br></div><div> pip install python-swiftclient</div><div><br></div><div>Here's some sample Python to carry out various operations,</div><div><br></div><div>--------------------------------------------------------------------------------</div>
<div>from swiftclient.client import get_auth, put_object, put_container, \</div><div> get_object, delete_object, delete_container</div><div><br></div><div>AUTH_URL = '<a href="http://127.0.0.1:8080/auth/v1.0">http://127.0.0.1:8080/auth/v1.0</a>'</div>
<div>USER = 'test:tester'</div><div>PASSWORD = 'testing'</div><div><br></div><div>if __name__ == '__main__':</div><div> # authenticate</div><div> (url, token) = get_auth(AUTH_URL, USER, PASSWORD)</div>
<div><br></div><div> # create a container</div><div> container = "docs"</div><div> put_container(url, token, container)</div><div><br></div><div> # upload an object</div><div> filename = "helloworld"</div>
<div> obj_file = open('/tmp/%s' % filename)</div><div> put_object(url, token, container, filename, obj_file)</div><div> obj_file.close()</div><div><br></div><div> # Download the object</div><div> (headers, obj_contents) = get_object(url, token, container, filename)</div>
<div> downloaded_obj = open('/tmp/%s_downloaded' % filename, 'w')</div><div> downloaded_obj.write(obj_contents)</div><div> downloaded_obj.close()</div><div><br></div><div> # Delete the object</div>
<div> delete_object(url, token, container, filename)</div><div><br></div><div> # Delete the container</div><div> delete_container(url, token, container)</div><div>--------------------------------------------------------------------------------</div>
<div><br></div><div><br></div><br><div class="gmail_quote">On 17 October 2012 02:37, Rugwiro Ulysse <span dir="ltr"><<a href="mailto:rugwiro05@yahoo.com" target="_blank">rugwiro05@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<table cellspacing="0" cellpadding="0" border="0"><tbody><tr><td valign="top" style="font:inherit"><div>Dear <span>John Dickinson</span></div>
<div><span></span> </div>
<div><span></span></div>
<div><span>I would like to ask a favor from you,i followed the instruction you gave me on how to apload quickly file on swift but i couldnt run and test you code .could you guide me step by step on how i should do it?? i am using windows 7 OS and PyDev</span></div>
<div><span></span> </div>
<div><span></span></div>
<div><span>Thanks a lot!!</span></div><br><br>--- On <b>Mon, 10/8/12, John Dickinson <i><<a href="mailto:me@not.mn" target="_blank">me@not.mn</a>></i></b> wrote:<br>
<blockquote style="BORDER-LEFT:rgb(16,16,255) 2px solid;PADDING-LEFT:5px;MARGIN-LEFT:5px"><br>From: John Dickinson <<a href="mailto:me@not.mn" target="_blank">me@not.mn</a>><br>Subject: Re: [openstack-dev] Swift App<br>
To: "OpenStack Development Mailing List" <<a href="mailto:openstack-dev@lists.openstack.org" target="_blank">openstack-dev@lists.openstack.org</a>><br>Date: Monday, October 8, 2012, 6:20 PM<div><div class="h5">
<br><br>
<div>"Advice on swift application development" could cover a lot of ground and fill a lot of pages of text. However, here are some getting started places.<br><br>First, check out the swift API docs at <a href="http://docs.openstack.org/" target="_blank">http://docs.openstack.org</a>. Swift's API is HTTP, so any client or library that speaks HTTP can talk to swift. I've published some examples of using Python's httplib to talk to swift at <a href="http://programmerthoughts.com/programming/quickly-uploading-to-cloud-files-part-2/" target="_blank">http://programmerthoughts.com/programming/quickly-uploading-to-cloud-files-part-2/</a>.<br>
<br>If you are looking for language bindings, check out either <a href="https://github.com/openstack/python-swiftclient" target="_blank">https://github.com/openstack/python-swiftclient</a> (the official Python language bindings) or <a href="https://github.com/rackspace/python-cloudfiles" target="_blank">https://github.com/rackspace/python-cloudfiles</a>). There are bindings for other languages as well.<br>
<br>As a general guide for building a client app, first, know your data. Try to use concurrency when talking to swift (instead of sending each request serially). Also, for large data sets, shard your data across many containers. Try to target 1-10 million objects in each container (although this is affected by your hardware deployment choices). Swift is designed for high throughput using many concurrent connections, so take advantage of that.<br>
<br>--John<br><br><br><br><br><br>On Oct 8, 2012, at 9:03 AM, Rugwiro Ulysse <<a href="http://us.mc1129.mail.yahoo.com/mc/compose?to=rugwiro05@yahoo.com" target="_blank">rugwiro05@yahoo.com</a>> wrote:<br><br>> Hello everyone !!<br>
> <br>> I would like your advice on swift application development.<br>> <br>> " How a client can talk directly to
a swift cluster without a web service invorved?"<br>> <br>> This question have been in my mind for long and i dont seem to have figured out how to make such application in python. any ideas??<br>> <br>> Regards!!<br>
> _______________________________________________<br>> OpenStack-dev mailing list<br>> <a href="http://us.mc1129.mail.yahoo.com/mc/compose?to=OpenStack-dev@lists.openstack.org" target="_blank">OpenStack-dev@lists.openstack.org</a><br>
> <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br><br></div><br></div></div>-----Inline Attachment Follows-----<div class="im">
<br><br>
<div>_______________________________________________<br>OpenStack-dev mailing list<br><a href="http://us.mc1129.mail.yahoo.com/mc/compose?to=OpenStack-dev@lists.openstack.org" target="_blank">OpenStack-dev@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br></div></div></blockquote></td></tr></tbody></table><br>_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br></blockquote></div><br>