Rest Api ListReplicas endpoint should be GET
Motivation
The Rest Api ListReplicas endpoint should be a GET request, it is a POST.
https://github.com/rucio/rucio/blob/2e3ad40fc1e64abb35e1e4e4bd5cddec9701d3f9/lib/rucio/web/rest/flaskapi/v1/replicas.py#L299
Modification
Change the ListReplicas endpoint request type.
Careful with this.
We have two different types of clients right now, one expects the POST to come back as application/x-json-stream (one full json per entry per line returned), the one that expects GET to come back as application/x-json (one full json reply containing everything).
Adding @davidgcameron for info (since ARC is using the GET case)
Yes, some explanation would be nice. Specifically:
- The
GETmethod in HTTP is used to request data, thePOSTis used to create/update data. In theListReplicasendpoint, the data is only requested, not updated/posted. Why don't we have two separate endpoints or a header variable to distinguish that instead of thePOSTrequest? We're already doing that for the metalink case:https://github.com/rucio/rucio/blob/2e3ad40fc1e64abb35e1e4e4bd5cddec9701d3f9/lib/rucio/web/rest/flaskapi/v1/replicas.py#L376 - The
GETmethod is not implemented for thereplica/listendpoint, where is it coming from? https://github.com/rucio/rucio/blob/2e3ad40fc1e64abb35e1e4e4bd5cddec9701d3f9/lib/rucio/web/rest/flaskapi/v1/replicas.py#L890
The issue here is historic. POST was chosen (instead of GET) due to the header-size limitations of a get. Thus much less replicas could be asked for in a list_replicas. However, this could probably have been solved differently by addressing these limits in apache (I believe there is a setting for that)
To move forward:
- Investigate the setting in apache
- Duplicate this endpoint as a
GETendpoint (Leave thePOSTas it is) - Over time we might be able to deprecate the
POSTendpoint