rawlinp commented on a change in pull request #3758: Rewrote
deliveryservice_stats to Go
URL: https://github.com/apache/trafficcontrol/pull/3758#discussion_r307888019
##########
File path: traffic_ops/traffic_ops_golang/routing/routes.go
##########
@@ -104,6 +105,9 @@ func Routes(d ServerData) ([]Route, []RawRoute,
http.Handler, error) {
{1.1, http.MethodPost, `asns/?$`,
api.CreateHandler(&asn.TOASNV11{}), auth.PrivLevelOperations, Authenticated,
nil},
{1.1, http.MethodDelete, `asns/{id}$`,
api.DeleteHandler(&asn.TOASNV11{}), auth.PrivLevelOperations, Authenticated,
nil},
+ // Traffic Stats access
+ {1.2, http.MethodGet, `deliveryservice_stats`,
trafficstats.GetDSStats, auth.PrivLevelOperations, Authenticated, nil},
Review comment:
Alphabetical organization might be dangerous since the order matters w.r.t.
the API version and regex matches. I.e. the same route for different minor
versions needs to have the minor versions in descending order (since a 1.1
request will not match a 1.3 or 1.2 route, but a 1.3 request will match a 1.2
or 1.1 route). There may be some regexes that are overlapping as well, so the
_longer_ regexes should come before the shorter regexes so that the best match
is taken.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services