Bug 815492

Summary: Documentation shows /infinispan/rest in the client examples
Product: [JBoss] JBoss Data Grid 6 Reporter: Brian Ashburn <bashburn>
Component: DocumentationAssignee: gsheldon
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.0.0CC: jdg-bugs, mgencur, mhusnain
Target Milestone: ---   
Target Release: 6.0.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-15 03:05:28 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.