[infinispan-commits] Infinispan SVN: r1259 - trunk/server/rest/src/main/resources.
infinispan-commits at lists.jboss.org
infinispan-commits at lists.jboss.org
Mon Dec 7 07:22:53 EST 2009
Author: manik.surtani at jboss.com
Date: 2009-12-07 07:22:53 -0500 (Mon, 07 Dec 2009)
New Revision: 1259
Added:
trunk/server/rest/src/main/resources/sample_python_REST_client.py
trunk/server/rest/src/main/resources/sample_ruby_REST_client.rb
Removed:
trunk/server/rest/src/main/resources/infinispan-config.xml
trunk/server/rest/src/main/resources/sample_python_client.py
trunk/server/rest/src/main/resources/sample_ruby_client.rb
Log:
Renamed sample client scripts
Removed infinispan-config - should use one of the samples shipped with core.
Deleted: trunk/server/rest/src/main/resources/infinispan-config.xml
===================================================================
--- trunk/server/rest/src/main/resources/infinispan-config.xml 2009-12-07 12:18:48 UTC (rev 1258)
+++ trunk/server/rest/src/main/resources/infinispan-config.xml 2009-12-07 12:22:53 UTC (rev 1259)
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:infinispan:config:4.0">
- <global>
- <transport clusterName="demoCluster"/>
- </global>
-
-
- <!-- by default all caches are created with these params unless you set up an use a named one below -->
- <default>
- <clustering mode="distribution">
- <l1 enabled="true" lifespan="10000"/>
- <hash numOwners="2"/>
- <sync/>
- </clustering>
- </default>
-
-
- <!-- if you want special treatment for certain cache names, do it here -->
- <namedCache name="cacheX">
- <clustering mode="distribution">
- <l1 enabled="true" lifespan="10000"/>
- <hash numOwners="2"/>
- <sync/>
- </clustering>
- </namedCache>
-
-
-
-</infinispan>
Copied: trunk/server/rest/src/main/resources/sample_python_REST_client.py (from rev 1254, trunk/server/rest/src/main/resources/sample_python_client.py)
===================================================================
--- trunk/server/rest/src/main/resources/sample_python_REST_client.py (rev 0)
+++ trunk/server/rest/src/main/resources/sample_python_REST_client.py 2009-12-07 12:22:53 UTC (rev 1259)
@@ -0,0 +1,28 @@
+#!/usr/bin/python
+
+#
+# Sample python code using the standard http lib only
+#
+
+import httplib
+
+## Your Infinispan WAR server host
+hostname = "localhost:8080"
+
+#putting data in
+conn = httplib.HTTPConnection(hostname)
+data = "SOME DATA HERE !" #could be string, or a file...
+conn.request("POST", "/infinispan/rest/Bucket/0", data, {"Content-Type": "text/plain"})
+response = conn.getresponse()
+print response.status
+
+#getting data out
+import httplib
+conn = httplib.HTTPConnection(hostname)
+conn.request("GET", "/infinispan/rest/Bucket/0")
+response = conn.getresponse()
+print response.status
+print response.read()
+
+## For more information on usagse see http://www.jboss.org/community/wiki/InfinispanRESTserver
+
Property changes on: trunk/server/rest/src/main/resources/sample_python_REST_client.py
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: trunk/server/rest/src/main/resources/sample_python_client.py
===================================================================
--- trunk/server/rest/src/main/resources/sample_python_client.py 2009-12-07 12:18:48 UTC (rev 1258)
+++ trunk/server/rest/src/main/resources/sample_python_client.py 2009-12-07 12:22:53 UTC (rev 1259)
@@ -1,28 +0,0 @@
-#!/usr/bin/python
-
-#
-# Sample python code using the standard http lib only
-#
-
-import httplib
-
-## Your Infinispan WAR server host
-hostname = "localhost:8080"
-
-#putting data in
-conn = httplib.HTTPConnection(hostname)
-data = "SOME DATA HERE !" #could be string, or a file...
-conn.request("POST", "/infinispan/rest/Bucket/0", data, {"Content-Type": "text/plain"})
-response = conn.getresponse()
-print response.status
-
-#getting data out
-import httplib
-conn = httplib.HTTPConnection(hostname)
-conn.request("GET", "/infinispan/rest/Bucket/0")
-response = conn.getresponse()
-print response.status
-print response.read()
-
-## For more information on usagse see http://www.jboss.org/community/wiki/InfinispanRESTserver
-
Copied: trunk/server/rest/src/main/resources/sample_ruby_REST_client.rb (from rev 1254, trunk/server/rest/src/main/resources/sample_ruby_client.rb)
===================================================================
--- trunk/server/rest/src/main/resources/sample_ruby_REST_client.rb (rev 0)
+++ trunk/server/rest/src/main/resources/sample_ruby_REST_client.rb 2009-12-07 12:22:53 UTC (rev 1259)
@@ -0,0 +1,47 @@
+#!/usr/bin/ruby
+
+#
+# Shows how to interact with Infinispan REST api from ruby.
+# No special libraries, just standard net/http
+#
+# Author: Michael Neale
+#
+require 'net/http'
+
+http = Net::HTTP.new('localhost', 8080)
+
+#Create new entry
+http.post('/infinispan/rest/MyData/MyKey', 'DATA HERE', {"Content-Type" => "text/plain"})
+
+#get it back
+puts http.get('/infinispan/rest/MyData/MyKey').body
+
+#use PUT to overwrite
+http.put('/infinispan/rest/MyData/MyKey', 'MORE DATA', {"Content-Type" => "text/plain"})
+
+#and remove...
+http.delete('/infinispan/rest/MyData/MyKey')
+
+#Create binary data like this... just the same...
+http.put('/infinispan/rest/MyImages/Image.png', File.read('/Users/michaelneale/logo.png'), {"Content-Type" => "image/png"})
+
+
+#and if you want to do json...
+require 'rubygems'
+require 'json'
+
+#now for fun, lets do some JSON !
+data = {:name => "michael", :age => 42 }
+http.put('/infinispan/rest/Users/data/0', data.to_json, {"Content-Type" => "application/json"})
+puts "OK !"
+
+## For more information on usagse see http://www.jboss.org/community/wiki/InfinispanRESTserver
+
+
+
+
+
+
+
+
+
Property changes on: trunk/server/rest/src/main/resources/sample_ruby_REST_client.rb
___________________________________________________________________
Name: svn:eol-style
+ native
Deleted: trunk/server/rest/src/main/resources/sample_ruby_client.rb
===================================================================
--- trunk/server/rest/src/main/resources/sample_ruby_client.rb 2009-12-07 12:18:48 UTC (rev 1258)
+++ trunk/server/rest/src/main/resources/sample_ruby_client.rb 2009-12-07 12:22:53 UTC (rev 1259)
@@ -1,47 +0,0 @@
-#!/usr/bin/ruby
-
-#
-# Shows how to interact with Infinispan REST api from ruby.
-# No special libraries, just standard net/http
-#
-# Author: Michael Neale
-#
-require 'net/http'
-
-http = Net::HTTP.new('localhost', 8080)
-
-#Create new entry
-http.post('/infinispan/rest/MyData/MyKey', 'DATA HERE', {"Content-Type" => "text/plain"})
-
-#get it back
-puts http.get('/infinispan/rest/MyData/MyKey').body
-
-#use PUT to overwrite
-http.put('/infinispan/rest/MyData/MyKey', 'MORE DATA', {"Content-Type" => "text/plain"})
-
-#and remove...
-http.delete('/infinispan/rest/MyData/MyKey')
-
-#Create binary data like this... just the same...
-http.put('/infinispan/rest/MyImages/Image.png', File.read('/Users/michaelneale/logo.png'), {"Content-Type" => "image/png"})
-
-
-#and if you want to do json...
-require 'rubygems'
-require 'json'
-
-#now for fun, lets do some JSON !
-data = {:name => "michael", :age => 42 }
-http.put('/infinispan/rest/Users/data/0', data.to_json, {"Content-Type" => "application/json"})
-puts "OK !"
-
-## For more information on usagse see http://www.jboss.org/community/wiki/InfinispanRESTserver
-
-
-
-
-
-
-
-
-
More information about the infinispan-commits
mailing list