Hi,
Think I might have a paging issue now for tenants with more than 20 properties.
var propertyClient = vraHost.createPropertyClient();
var propDefinitions = propertyClient.get("propertydefinitions/");
System.log(propDefinitions);
"metadata": {
"size": 20,
"totalElements": 0,
"totalPages": 0,
"number": 1,
"offset": 0
}
var propertyClient = vraHost.createPropertyClient();
// Neither of the below are having any effect on paging.
//var propDefinitions = propertyClient.getWithVariables("propertydefinitions/",["page=1","limit=40"]);
var propDefinitions = propertyClient.getWithVariables("propertydefinitions/",["$skip=0","$top=40"]);
System.log(propDefinitions);
"metadata": {
"size": 20,
"totalElements": 0,
"totalPages": 0,
"number": 1,
"offset": 0
}
192.168.7.118 [14/Oct/2019:10:16:10 -0400][149 ms] "GET /properties-service/api/propertydefinitions/ HTTP/1.1" 200 5747 [tomcat-http--378]
https://vrafqdn/component-registry/services/docs#!/default/get_api_propertydefinitions
Hi,
I don't have a vRA instance at hand to verify it, but I think the second argument of getWithVariables() provides values to replace path variables in the first argument.
So could you try if something like the following works?
var propDefinitions = propertyClient.getWithVariables("propertydefinitions/?page={page}&limit={limit}", ["1","40"]);
So the idea is that "1" will replace "{page}" and "40" will replace "limit", producing a query URL like "propertydefinitions/?page=1&limit=40"
Hi,
I don't have a vRA instance at hand to verify it, but I think the second argument of getWithVariables() provides values to replace path variables in the first argument.
So could you try if something like the following works?
var propDefinitions = propertyClient.getWithVariables("propertydefinitions/?page={page}&limit={limit}", ["1","40"]);
So the idea is that "1" will replace "{page}" and "40" will replace "limit", producing a query URL like "propertydefinitions/?page=1&limit=40"
Perfect, thanks for the quick update. That's working great.
Cheers, Red