<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://developer.nirvanix.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Python</title><link>http://developer.nirvanix.com/files/folders/python/default.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP2 (Build: 20611.960)</generator><item><title>Nirvanix SDK For Google App Engine</title><link>http://developer.nirvanix.com/files/folders/python/entry1253.aspx</link><pubDate>Fri, 27 Jun 2008 14:58:31 GMT</pubDate><guid isPermaLink="false">40a1f22b-b3c4-4855-9640-186c593af682:1253</guid><dc:creator>BarryR</dc:creator><slash:comments>3</slash:comments><description>&lt;p&gt;The Google App Engine is an advanced Python engine that allows developers to quickly and easily integrate existing Python code and templates to host web applications. The Nirvanix SDK is a tool that will let you quickly and easily integrate mass storage into this environment and allow easy access to the Nirvanix file system.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Additional System Requirements&lt;/b&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;An active account and application within Google App Engine is required to use this SDK.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Installation Instructions&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Extract the contents of this package and place in a folder where you can upload to App Engine. A sample website is included that will let you browse directories and download files from Nirvanix. You can find a running copy of the sample website here:&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://nirvanixdev.appspot.com/"&gt;http://nirvanixdev.appspot.com/&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;To install this website you should follow the steps below.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;b&gt;Installing The Sample App&lt;/b&gt;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Update app.yaml – Change the “application:” from YOURAPPNAME to an application name you have created.&lt;/li&gt;&lt;li&gt;Browse to the SampleApplication directory.&lt;/li&gt;&lt;li&gt;Open Download.py and Main.py in a text editor and change the appkey, username, and password to match your Nirvanix credentials found at &lt;a href="http://nmp.nirvanix.com/"&gt;http://nmp.nirvanix.com/&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Browse to your applications root folder and you should see the application listing the folders in your account.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;Uploading the entire SDK and sample code can be done using the appcfg.py script from Google.&lt;/p&gt;&lt;p&gt;&lt;b&gt;Quick Start Guide&lt;/b&gt;&lt;/p&gt;&lt;p&gt;To use the SDK you should create a simple App Engine page and include the following imports:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;i&gt;import nirvanix&lt;br /&gt;import nirvanixutils&lt;br /&gt;from nirvanix import Nirvanix&lt;br /&gt;from nirvanix import Session&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;To create a session (login) to Nirvanix you can use the following code:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;try:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; session = Session(appkey, username, password)&lt;br /&gt;except nirvanixutils.NirvanixException, e:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if e.code == 80001:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.response.out.write(&amp;quot;Login Failed.&amp;quot;)&lt;br /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; return&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:&lt;br /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; self.response.out.write(&amp;quot;Error: &amp;quot; + e.message)&lt;br /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; return&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;&lt;b&gt;Login Sample&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The unit tests show the use of different name spaces within the Nirvanix web services. Please use them as reference for other namespace calls.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Overview&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The overall goal of the SDK is to provide a simple interface for accessing each namespace and under that each method.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Structure&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The session object is used to hold the currently logged on session information for a specific user account / appkey combo. This session is then used by the other calls into the system to authenticate. The session can be considered a key for the other calls in the system. To access a specific namespace you create the Nirvanix object and pass the namespace name and session.&lt;br /&gt;&lt;br /&gt;IMFS (Internet Media File System) is used for copy, move, delete, and a host of other file related calls. Below is an example that creates an IMFS object and calls ListFolder to get the files and folders from that listing.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;session = Session(appkey, username, password)&lt;br /&gt;imfs = Nirvanix(&amp;#39;IMFS&amp;#39;, session);&lt;br /&gt;options = {&amp;#39;folderPath&amp;#39;: &amp;#39;/&amp;#39;,&amp;#39;pageNumber&amp;#39;:&amp;#39;1&amp;#39;,&amp;#39;pageSize&amp;#39;: &amp;#39;500&amp;#39;}&lt;br /&gt;try:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; doc = imfs.ListFolder(options,False)&lt;br /&gt;except nirvanixutils.NirvanixException, e:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print e.message&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;The returned value is an XML document that contains the file and folder listing for the path requested.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;</description><enclosure url="http://developer.nirvanix.com/files/folders/1253/download.aspx" length="206067" type="application/zip" /></item></channel></rss>