<div dir="ltr">Aloha guardians of the API!<div><br></div><div>I haven recently* reviewed a spec for neutron [1] proposing a distinct URI for returning resource count on list operations.</div><div>This proposal is for selected neutron resources, but I believe the topic is general enough to require a guideline for the API working group. Your advice is therefore extremely valuable.</div><div><br></div><div>In a nutshell the proposal is to retrieve resource count in the following way:</div><div>GET /<prefix>/<resource_name>/count</div><div><br></div><div>In my limited experience with RESTful APIs, I've never encountered one that does counting in this way. This obviously does not mean it's a bad idea.</div><div>I think it's not great from a usability perspective to require two distinct URIs to fetch the first page and then the total number of elements. I reckon the first response page for a list operation might include also the total count. For example:</div><div><br></div><div>{'resources': [{meh}, {meh}, {meh_again}],</div><div> 'resource_count': 55</div><div> <link_to_next_page>}</div><div><br></div><div>I am however completely open to consider other alternatives.</div><div>What is your opinion on this matter?</div><div><br></div><div>Regards,</div><div>Salvatore</div><div><br></div><div><br></div><div>* it's been 10 days now</div><div><br></div><div>[1] <a href="https://review.openstack.org/#/c/102199/">https://review.openstack.org/#/c/102199/</a></div></div>