Use a SAM pool
The following steps show the best practice for using a SAM pool.
The application requests available IDs via the group owner ID. In this example,
clientx_admin
is requesting an ID from a group called
clientx
containing clientx_0
and
clientx_1
.
-
Request an ID with
getuid
.Request: https://www2.1010data.com/cgi-bin/gw?apiversion=3&api=getuid&uid=clientx_admin &pswd=*********&gid=clientx Response(s): If the group does not exist or the uid is not the owner: <out> <rc>1</rc> <msg>You do not own the specified group.</msg> </out> If the group exists and the uid is the owner: <out> <rc>0</rc> <msg>OK</msg> <uid>clientx_0</uid> </out>
-
Log into the application with the received user ID and the
kill=possess
parameter. Possess will give you the session parameters if the user is already logged in, therefore retaining the session cache.Request: https://www2.1010data.com/cgi-bin/gw?apiversion=3api=login&uid=clientx_0 &pswd=*********&kill=possess Response: <out> <rc>0</rc> <sid>1392666444</sid> <pswd>Ha2mvx775hbl</pswd> <msg>Last login was: 2009-09-10 21:44:26</msg> </out>
- Run your query.
-
After running your query, release the ID with
reluid
so that the ID is available to other users. The ID will stay logged in until its idle time times out, saving other users the time to start a new session. The next user's view of the data will remain the same until the end of the session.Request: https://www2.1010data.com/cgi-bin/gw?apiversion=3&api=reluid&uid=clientx_0 &pswd=*********&sid=1392666444