We are in the process of trying to retrieve information from the SAS Viya environment by using the REST API. In order to make my question clear I will use in this example that we are trying to retrieve the name, description, type, memberCount and parentFolderUri from all folders.
In the current situation when we make the initial call, the following information is returned:
{
"version": 2,
"accept": "application/vnd.sas.content.folder",
"count": 943,
"start": 0,
"limit": 20,
"name": "folders",
"items": [{
"creationTimeStamp": "2022-11-07T15:23:51.213681Z",
"createdBy": "who.ever@somecompany.com",
"modifiedTimeStamp": "2022-11-07T15:23:51.213684Z",
"modifiedBy": "who.ever@somecompany.com",
"version": 1,
"id": "0016a0ee-2461-46f8-a794-0267ee63f65f",
"name": "SomeFolder",
"parentFolderUri": "/folders/folders/b12eee80-32a4-42f0-a905-272742be7dae",
"description": "Some Folder Description",
"type": "folder",
"memberCount": 6,
"links": [{
"method": "GET",
"rel": "self",
"href": "/folders/folders/0016a0ee-2461-46f8-a794-0267ee63f65f",
"uri": "/folders/folders/0016a0ee-2461-46f8-a794-0267ee63f65f",
"type": "application/vnd.sas.content.folder"
Basically all information for the first 20 folders is returned while I only want limited information returned. Although sufficient information is provided that I can achieve what I want I would like is to do this more directly.
In the Osisoft PI REST API there is the possibility to select the fields that are being returned. Basically (to keep it in SQL terms) it provides the possibility to not only do:
select * from ...
but to change this into:
select column1, column5 from ...
Basically what I am looking for is to start out with (NOTE: the selectedFields is how it is done for PI):
https://example.com/folders/folders?selectedFields=count
This would return me only the value: 943
After this I could loop using the "column filter" plus the start and limit parameters to retrieve the required information for each folder using:
https://example.com/start=x&limit=20&selectedFields=Items.name;Items.description;Items.type;Items.memberCount;Items.parentFolderUri
Giving me hereby only the specific information I would like to have.
Now to get to my specific question: Is there a SAS Viya REST API equivalent for the "selectedFields" as used in the example?
... View more