Lieutenant Commander
Lieutenant Commander
2682 views

GroupWise REST API Limitations

Hello,

since there is no way to mass change on user visibility using admin console I made a simple perl script that does this job using GroupWise REST API.

I have one big problem with API:

As stated in this documentation: https://www.novell.com/documentation/groupwise2014r2/gwsdk_admin_rest_api/data/b12ypdkd.html I can get all post office users using this request: GET https://localhost:9710/gwadmin-service/list/USER/POST_OFFICE.testDom1.testPO1

The Problem is, that the response is capped to 1000 users, so if I have more than 1000 users in a post office, everything over that 1000 will be ignored and is not a part of the response. Is there a way to get more than 1000 users as a response to that query ? Is it a bug maybe ?

GroupWise Version: 2014 R2 SP2 HP1
Runnning on: SLES 11 SP4

Best Regards,
Aleksejs Sokolovics
Labels (1)
0 Likes
7 Replies
Knowledge Partner Knowledge Partner
Knowledge Partner

Out of curiosity could you explain why you would want more than 1000 at a
time? Are you wanting to change the visibility for all users in the
system and could you do that using queries for users by name, e.g. a*, b*,
c*, etc.?

I would guess sane limits are in place not as a bug but to prevent
less-desirable things from happening when somebody request all users ever,
and getting 100k results, killing the client and maybe even the server
side as it generates that response.

--
Good luck.

If you find this post helpful and are logged into the web interface,
show your appreciation and click on the star below.

If you want to send me a private message, please let me know in the
forum as I do not use the web interface often.
0 Likes
Cadet 1st Class
Cadet 1st Class

Here is a comment from one of my programs:

When all matching entries are returned there is (e.g.) <outOf>25</outOf> at the end of the output. If not all are returned i.e. there are more than 1000 matches, we get (e.g.) <resultInfo><nextId>578</nextId><resultInfo> and we must issue a further request starting at ID 578. When there are no further entries, there is no <nextId> and no <outOf> at the end of the data.

HTH, John
0 Likes
Lieutenant Commander
Lieutenant Commander

johnbaird;2474987 wrote:
Here is a comment from one of my programs:

When all matching entries are returned there is (e.g.) <outOf>25</outOf> at the end of the output. If not all are returned i.e. there are more than 1000 matches, we get (e.g.) <resultInfo><nextId>578</nextId><resultInfo> and we must issue a further request starting at ID 578. When there are no further entries, there is no <nextId> and no <outOf> at the end of the data.

HTH, John


Thanks for the hint, infact at the end of the response I see <nextId>5848</nextId>, but how should the query URL look like if I want to pickup on that ID ? Atm my script just uses curl to query this url https://localhost:9710/gwadmin-service/list/USER/POST_OFFICE.testDom1.testPO1 in the documentation I dont see any description on this case.

Edit: Found the way 🙂 Thanks!
0 Likes
Admiral
Admiral

partnernetrst;2475036 wrote:
Thanks for the hint, infact at the end of the response I see <nextId>5848</nextId>, but how should the query URL look like if I want to pickup on that ID ? Atm my script just uses curl to query this url https://localhost:9710/gwadmin-service/list/USER/POST_OFFICE.testDom1.testPO1 in the documentation I dont see any description on this case.

Edit: Found the way 🙂 Thanks!



Can you share the format of your request for grabbing the next set?
0 Likes
Lieutenant Commander
Lieutenant Commander

A bit late but anyways:

If you have more than 1000 Users to be edited, after first request you will get a response and at the end of the response you should find the 1001 User ID and the second request should pick up on that ID:

Lines that you will find at the end of response if there are more than 1000 Users to edit:

<resultInfo>
<nextId>23913</nextId>
</resultInfo>


So if you have those lines in response to your request, it means that there are more users to be edited and the next ID you should start is 23913, so your next request should look like this: https://localhost:9710/gwadmin-service/list/USER/POST_OFFICE.testDom1.testPO1?nextid=23913

0 Likes
Micro Focus Contributor
Micro Focus Contributor

So if I have a filter and nextId then I am assuming we can use something like:

https://<server>:<port>/list/user?filter=timeLastMod>'271600790698000'&nextId=23913 

 

0 Likes
Micro Focus Frequent Contributor
Micro Focus Frequent Contributor

Yes, I think that's correct.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.