rob05c commented on a change in pull request #: Add TO Go 1.1 routes
URL:
https://github.com/apache/incubator-trafficcontrol/pull/#discussion_r186187979
##
File path: traffic_ops/traffic_ops_golang/routes.go
##
@@ -77,106 +77,107 @@ func Routes(d ServerData) ([]Route, []RawRoute,
http.Handler, error) {
// 1.2 routes are simply a Go replacement for the equivalent
Perl route. They may or may not conform with the API guidelines
(https://cwiki.apache.org/confluence/display/TC/API+Guidelines).
//ASN: CRUD
- {1.2, http.MethodGet, `asns/?(\.json)?$`,
api.ReadHandler(asn.GetRefType(), d.DB), auth.PrivLevelReadOnly, Authenticated,
nil},
- {1.2, http.MethodGet, `asns/{id}$`,
api.ReadHandler(asn.GetRefType(), d.DB), auth.PrivLevelReadOnly, Authenticated,
nil},
- {1.2, http.MethodPut, `asns/{id}$`,
api.UpdateHandler(asn.GetRefType(), d.DB), auth.PrivLevelOperations,
Authenticated, nil},
- {1.2, http.MethodPost, `asns/?$`,
api.CreateHandler(asn.GetRefType(), d.DB), auth.PrivLevelOperations,
Authenticated, nil},
- {1.2, http.MethodDelete, `asns/{id}$`,
api.DeleteHandler(asn.GetRefType(), d.DB), auth.PrivLevelOperations,
Authenticated, nil},
+ {1.2, http.MethodGet, `asns/?(\.json)?$`,
api.ReadHandler(asn.GetRefTypeV12(), d.DB), auth.PrivLevelReadOnly,
Authenticated, nil},
+ {1.1, http.MethodGet, `asns/?(\.json)?$`, asn.V11ReadAll(d.DB),
auth.PrivLevelReadOnly, Authenticated, nil},
+ {1.1, http.MethodGet, `asns/{id}$`,
api.ReadHandler(asn.GetRefTypeV11(), d.DB), auth.PrivLevelReadOnly,
Authenticated, nil},
+ {1.1, http.MethodPut, `asns/{id}$`,
api.UpdateHandler(asn.GetRefTypeV11(), d.DB), auth.PrivLevelOperations,
Authenticated, nil},
+ {1.1, http.MethodPost, `asns/?$`,
api.CreateHandler(asn.GetRefTypeV11(), d.DB), auth.PrivLevelOperations,
Authenticated, nil},
+ {1.1, http.MethodDelete, `asns/{id}$`,
api.DeleteHandler(asn.GetRefTypeV11(), d.DB), auth.PrivLevelOperations,
Authenticated, nil},
//CacheGroup: CRUD
- {1.2, http.MethodGet, `cachegroups/?(\.json)?$`,
api.ReadHandler(cachegroup.GetRefType(), d.DB), auth.PrivLevelReadOnly,
Authenticated, nil},
- {1.2, http.MethodGet, `cachegroups/{id}$`,
api.ReadHandler(cachegroup.GetRefType(), d.DB), auth.PrivLevelReadOnly,
Authenticated, nil},
- {1.2, http.MethodPut, `cachegroups/{id}$`,
api.UpdateHandler(cachegroup.GetRefType(), d.DB), auth.PrivLevelOperations,
Authenticated, nil},
- {1.2, http.MethodPost, `cachegroups/?$`,
api.CreateHandler(cachegroup.GetRefType(), d.DB), auth.PrivLevelOperations,
Authenticated, nil},
- {1.2, http.MethodDelete, `cachegroups/{id}$`,
api.DeleteHandler(cachegroup.GetRefType(), d.DB), auth.PrivLevelOperations,
Authenticated, nil},
+ {1.1, http.MethodGet, `cachegroups/?(\.json)?$`,
api.ReadHandler(cachegroup.GetRefType(), d.DB), auth.PrivLevelReadOnly,
Authenticated, nil},
+ {1.1, http.MethodGet, `cachegroups/{id}$`,
api.ReadHandler(cachegroup.GetRefType(), d.DB), auth.PrivLevelReadOnly,
Authenticated, nil},
+ {1.1, http.MethodPut, `cachegroups/{id}$`,
api.UpdateHandler(cachegroup.GetRefType(), d.DB), auth.PrivLevelOperations,
Authenticated, nil},
+ {1.1, http.MethodPost, `cachegroups/?$`,
api.CreateHandler(cachegroup.GetRefType(), d.DB), auth.PrivLevelOperations,
Authenticated, nil},
+ {1.1, http.MethodDelete, `cachegroups/{id}$`,
api.DeleteHandler(cachegroup.GetRefType(), d.DB), auth.PrivLevelOperations,
Authenticated, nil},
//CDN
- {1.2, http.MethodGet, `cdns/capacity$`,
handlerToFunc(proxyHandler), 0, NoAuth, []Middleware{}},
- {1.2, http.MethodGet, `cdns/configs$`,
handlerToFunc(proxyHandler), 0, NoAuth, []Middleware{}},
- {1.2, http.MethodGet, `cdns/domains$`,
handlerToFunc(proxyHandler), 0, NoAuth, []Middleware{}},
- {1.2, http.MethodGet, `cdns/health$`,
handlerToFunc(proxyHandler), 0, NoAuth, []Middleware{}},
- {1.2, http.MethodGet, `cdns/routing$`,
handlerToFunc(proxyHandler), 0, NoAuth, []Middleware{}},
+ {1.1, http.MethodGet, `cdns/capacity$`,
handlerToFunc(proxyHandler), 0, NoAuth, []Middleware{}},
+ {1.1, http.MethodGet, `cdns/configs$`,
handlerToFunc(proxyHandler), 0, NoAuth, []Middleware{}},
+ {1.1, http.MethodGet, `cdns/domains$`,
handlerToFunc(proxyHandler), 0, NoAuth, []Middleware{}},
+ {1.1, http.MethodGet, `cdns/health$`,
handlerToFunc(proxyHandler), 0, NoAuth, []Middleware{}},
+ {1.1, http.MethodGet, `cdns/routing$`,
handlerToFunc(proxyHandler), 0, NoAuth, []Middleware{}},
//CDN: CRUD
- {1.2, http.MethodGet,