I’m looking for a way to query and get a count of total devices in a subtenancy. I know I can query inventory/managedObjects?fragmentType=c8y_IsDevice&withTotalPages=True&pageSize=100 and get the totalPages, navigate to pageNumber= in the query string and iterate through and count the devices in that page and then multiply the pagesize * (totalPages-1) + devices counted in the last page. but that seems really fiddly and wonder if there’s a parameter to the inventory to merely return a count.
Alternatively, if it’s just about the count, you could set your pageSize to 1 so that totalPages=totalCount. Also, when stating withTotalPages the pageSize shouldbe part of the statistics fragment - so you wouldn’t need to extract that from the URL. But I think withTotalElements is the parameter you’re looking for.