-
Notifications
You must be signed in to change notification settings - Fork 344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Traffic Ops GET /api/*/cdns should be sorted alphabetically by name by default #3455
Comments
GET /api/*/cdns
should be sorted alphabetically by name by default
GET /api/*/cdns
should be sorted alphabetically by name by default
actually, I used to agree, but I've changed my mind and disagree.. a client should not be dependent on the order items are returned. If it has the need for them to be ordered a specific way, it should do so itself. In the case of the portal, it's easy enough to sort them when the cdn list is retrieved. We do have precedent for other types (I think servers are sorted), but we shouldn't try to do that going forward.. |
in other words, I think this should be against the portal and not traffic ops |
Yeah, I'm just thinking it's a minor change in behavior from the Perl implementation. Really, I think TP should be sending the |
+1 on putting it in the Portal, not the API IMO sorting shouldn't be part of an API. It's trivial for clients to do, and it reduces the scalability of the server. Sometimes it's trivial for the server to do, sometimes it's expensive. If it's expensive, it means that for |
I think we are getting into a much broader discussion about API 2.0. Currently most of our 1.x endpoints support server-side ordering, and I don't think we should rip that out of the 1.x endpoints. If we feel strongly that API 2.0 shouldn't support server-side ordering, then that's a discussion we should have on the mailing list about API 2.0 at a good time. For this specific issue, I don't really care strongly if the sorting is done client-side or server-side, but I also don't think we should be worried about server-side sorting of CDNs affecting the scalability of TO. I would merge a TP PR that did the sorting either way. |
I think the API should impose some order on the results it returns. Whether or not it's configurable via e.g. an |
When clicking the snapshot button (the camera icon in the top right) in Traffic Portal, it shows the list of CDNs to choose from. Today, these CDNs appear to be sorted ascending by their numerical ID rather than alphabetically by their name. With a high number of CDNs to choose from, it would be easier to sift through the list alphabetically.
The CDN table (viewed by clicking the "CDNs" tab on the left) should also be sorted alphabetically by name. This appears to be a minor regression from the Perl TO API implementation which sorted by name by default (if no other
orderby
param is specified in the request URL): https://github.com/apache/trafficcontrol/blob/master/traffic_ops/app/lib/API/Cdn.pm#L34The text was updated successfully, but these errors were encountered: