From 6fbd1bc1c9676ef5f6cc668f7f9f4fb69817cb04 Mon Sep 17 00:00:00 2001 From: David Stern Date: Wed, 15 Jan 2020 15:28:37 +0000 Subject: [PATCH] Set limit=10000 for /folders/{folderId}/members Viya 3.5 introduces version 2 of the Folders API. Both version 1 and version 2 of this API have a limit parameter, with a default of 20 results, but it did not seem to be enforced in the API at v1. It does seem to be being enforced at v2, so now specifying a limit high enough for our classroom use. For large folder structures, this may be insufficient. In this case you could increase it, or re-write this tool to iterate through several 'pages' of results. Contributions from any user welcome on this! --- listmemberswithpath.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/listmemberswithpath.py b/listmemberswithpath.py index 5eb8973..df4cb04 100755 --- a/listmemberswithpath.py +++ b/listmemberswithpath.py @@ -67,7 +67,9 @@ if not objecturi.startswith("/folders/folders/"): #See Folders API documentation in swagger at http://swagger.na.sas.com/apis/folders/v1/apidoc.html#op:getAncestors endpoint=objecturi+'/members' if recursive: - endpoint=endpoint+'?recursive=true' + endpoint=endpoint+'?recursive=true&limit=10000' +else: + endpoint=endpoint+'?limit=10000' method='get' #make the rest call