Consuming the Service - a read only browser client

0 Likes
over 3 years ago

Type the logon URL into the browser of choice

http://localhost:8080/MicroFocusHubRESTService/rest/users/logon?username=Administrator&password=Administrator

(this example assumes the tomcat rest service running on localhost, with a user name and password Administrator)

The browser returns a session id (guid) like  7cb9c33f-fa47-4163-b1ca-68ddd929ed05


Use this sessionid as the basis for all subsequent browser queries, for example

http://localhost:8080/MicroFocusHubRESTService/rest/groups;sessionid=7cb9c33f-fa47-4163-b1ca-68ddd929ed05

The browser returns the available set of groups on the server in an XML Document Tree (see example below)

notice that for any given group, the resourceID and the groupID have the same numeric value.

This is the basis for ensuring that the entire model is generic. Everything can be queried by resourceID and typeid

<resources>
<resource>
<structure>
<entry>
<key>GroupName</key>
<value>All Users</value>
</entry>
<entry>
<key>GroupDescription</key>
<value>All StarTeam Server users</value>
</entry>
<entry>
<key>Type</key>
<value>0</value>
</entry>
<entry>
<key>ResourceID</key>
<value>-2147483648</value>
</entry>
<entry>
<key>PrivilegeMask</key>
<value>0</value>
</entry>
</structure>
</resource>
<resource>
<structure>
<entry>
<key>GroupName</key>
<value>Administrators</value>
</entry>
<entry>
<key>GroupDescription</key>
<value>Administrators</value>
</entry>
<entry>
<key>ParentID</key>
<value>-2147483648</value>
</entry>
<entry>
<key>Type</key>
<value>0</value>
</entry>
<entry>
<key>ResourceID</key>
<value>-2147483647</value>
</entry>
<entry>
<key>Users</key>
<value>0,</value>
</entry>
<entry>
<key>ParentGroup</key>
<value>-2147483648</value>
</entry>
<entry>
<key>PrivilegeMask</key>
<value>-1</value>
</entry>
</structure>
</resource>
<resource>
<structure>
<entry>
<key>GroupName</key>
<value>Security Administrators</value>
</entry>
<entry>
<key>GroupDescription</key>
<value>
StarTeam Server security administrators. Users in this group will be alerted in the case of a possible security attack against the server.
</value>
</entry>
<entry>
<key>ParentID</key>
<value>-2147483648</value>
</entry>
<entry>
<key>Type</key>
<value>0</value>
</entry>
<entry>
<key>ResourceID</key>
<value>-2147483646</value>
</entry>
<entry>
<key>Users</key>
<value>0,</value>
</entry>
<entry>
<key>ParentGroup</key>
<value>-2147483648</value>
</entry>
<entry>
<key>PrivilegeMask</key>
<value>0</value>
</entry>
</structure>
</resource>
<resource>
<structure>
<entry>
<key>GroupName</key>
<value>System Managers</value>
</entry>
<entry>
<key>GroupDescription</key>
<value>
StarTeam Server system managers. Users in this group will receive e-mail notifications when server errors occur.
</value>
</entry>
<entry>
<key>ParentID</key>
<value>-2147483647</value>
</entry>
<entry>
<key>Type</key>
<value>0</value>
</entry>
<entry>
<key>ResourceID</key>
<value>-2147483645</value>
</entry>
<entry>
<key>ParentGroup</key>
<value>-2147483647</value>
</entry>
<entry>
<key>PrivilegeMask</key>
<value>0</value>
</entry>
</structure>
</resource>
</resources>

 

 

finally logout of the service using the command

http://localhost:8080/MicroFocusHubRESTService/rest/users/logoff;sessionid=7cb9c33f-fa47-4163-b1ca-68ddd929ed05

which releases the session for the logged in user

Labels:

How To-Best Practice
Comment List
Anonymous
Related Discussions
Recommended