Bug 815492 - Documentation shows /infinispan/rest in the client examples
Summary: Documentation shows /infinispan/rest in the client examples
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Data Grid 6
Classification: JBoss
Component: Documentation
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 6.0.0
Assignee: gsheldon
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-04-23 17:45 UTC by Brian Ashburn
Modified: 2012-08-15 16:44 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-06-15 03:05:28 UTC
Type: Bug


Attachments (Terms of Use)

Description Brian Ashburn 2012-04-23 17:45:15 UTC
Description of problem:
There is no clear description of the base URL used by the REST server. The Python and Ruby examples both show it as "/infinispan/rest". The default page that comes up when the server comes up "http://localhost:8080" does not give the base URL at all.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:
The examples and front page for the REST server should show the base URL as "http://localhost:8080/rest/<cache name>/<key>"


Additional info:

Comment 1 Misha H. Ali 2012-06-07 01:22:44 UTC
Brian, I may be misunderstanding you, but is it sufficient to add a note specifying the base url with a brief explanation of the same, for example:

"The JBoss Data Grid REST server is mapped onto the location "/" as a default. As a result, the base URL is:

http://localhost:8080/rest/MyData/MyKey

In the listed base URL, "/rest" represents the REST servlet, "MyData" represents the name of the cache and "MyKey" represents the key.

Please clarify if I am missing what you intended for this bug.

Comment 2 Martin Gencur 2012-06-11 12:01:19 UTC
I see the problem here. The following part of documentation specifies /infinispan/rest/... as the path for REST server: http://documentation-stage.bne.redhat.com/docs/en-US/JBoss_Data_Grid/6/html/Developer_Guide/chap-The_REST_Interface.html

This issue is only present with Ruby and Python examples.

E.g. 
http.post('/infinispan/rest/MyData/MyKey', DATA HERE', {"Content-Type" => "text/plain"}) 

should be replaced with 

http.post('/rest/MyData/MyKey', DATA HERE', {"Content-Type" => "text/plain"}) 

but there are more issues like this one.

Otherwise the home page of JDG server shows the proper context path starting with /rest (home page at http://localhost:8080/) so this should not be a problem.

Comment 3 gsheldon 2012-06-12 00:47:50 UTC
Ruby Client code:

http://documentation-stage.bne.redhat.com/docs/en-US/JBoss_Data_Grid/6/html/Developer_Guide/chap-The_REST_Interface.html#Ruby_Client_Code

Have corrected occurrence of /infinispan in 5 parts of the example code on lines 4, 6, 8, 10, and 12.

4) http.post('/rest/MyData/MyKey', DATA HERE', {"Content-Type" => "text/plain"})
6) puts http.get('/rest/MyData/MyKey').body
8) http.put('/rest/MyData/MyKey', 'MORE DATA', {"Content-Type" => "text/plain"})
10) http.delete('/rest/MyData/MyKey')
12) http.put('/rest/MyImages/Image.png', File.read('/Users/michaelneale/logo.png'), {"Content-Type" => "image/png"})


Python Client code:

http://documentation-stage.bne.redhat.com/docs/en-US/JBoss_Data_Grid/6/html/Developer_Guide/chap-The_REST_Interface.html#Python_Client_Code

Corrected occurrence of /infinispan in 2 parts of the example code:

3rd line after #How to insert data:

conn.request("POST", "/rest/Bucket/0", data, {"Content-Type": "text/plain"})

3rd line after #How to retrieve data:

conn.request("GET", "/rest/Bucket/0")


Changes will appear on the stage after the next brew.

Comment 4 Brian Ashburn 2012-06-12 14:13:12 UTC
Those are the changes that I was looking for. Thanks.

Comment 5 Misha H. Ali 2012-06-12 21:03:00 UTC
Thanks Martin and Brian. Marking this bug resolved and awaiting release.


Note You need to log in before you can comment on or make changes to this bug.