mattjackson220 commented on a change in pull request #4378: updated API to 
version 2.x
URL: https://github.com/apache/trafficcontrol/pull/4378#discussion_r378358160
 
 

 ##########
 File path: traffic_ops/traffic_ops_golang/routing/routes.go
 ##########
 @@ -133,477 +134,872 @@ func Routes(d ServerData) ([]Route, []RawRoute, 
http.Handler, error) {
                // 1.1 and 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).
                // 1.3 routes exist only in Go. There is NO equivalent Perl 
route. They should conform with the API guidelines 
(https://cwiki.apache.org/confluence/display/TC/API+Guidelines).
 
+               // 2.x routes exist only in Go. There is NO equivalent Perl 
route. They should conform with the API guidelines 
(https://cwiki.apache.org/confluence/display/TC/API+Guidelines).
+
                // NOTE: Route IDs are immutable and unique. DO NOT change the 
ID of an existing Route; otherwise, existing
                // configurations may break. New Route IDs can be any integer 
between 0 and 2147483647 (inclusive), as long as
                // it's unique.
 
                // API Capability
-               {1.1, http.MethodGet, `api_capabilities/?(\.json)?$`, 
apicapability.GetAPICapabilitiesHandler, auth.PrivLevelReadOnly, Authenticated, 
nil, 1813206589, perlBypass},
+               {api.Version{2, 0}, http.MethodGet, `api_capabilities/?$`, 
apicapability.GetAPICapabilitiesHandler, auth.PrivLevelReadOnly, Authenticated, 
nil, 2813206589, noPerlBypass},
+
+               //ASNs
+               {api.Version{2, 0}, http.MethodPut, `asns/?$`, 
api.UpdateHandler(&asn.TOASNV11{}), auth.PrivLevelOperations, Authenticated, 
nil, 2264172317, noPerlBypass},
+               {api.Version{2, 0}, http.MethodDelete, `asns/?$`, 
api.DeleteHandler(&asn.TOASNV11{}), auth.PrivLevelOperations, Authenticated, 
nil, 20204898, noPerlBypass},
+
+               //ASN: CRUD
+               {api.Version{2, 0}, http.MethodGet, `asns/?$`, 
api.ReadHandler(&asn.TOASNV11{}), auth.PrivLevelReadOnly, Authenticated, nil, 
273877722, noPerlBypass},
+               {api.Version{2, 0}, http.MethodGet, `asns/{id}$`, 
api.ReadHandler(&asn.TOASNV11{}), auth.PrivLevelReadOnly, Authenticated, nil, 
223008984, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPut, `asns/{id}$`, 
api.UpdateHandler(&asn.TOASNV11{}), auth.PrivLevelOperations, Authenticated, 
nil, 2951198629, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPost, `asns/?$`, 
api.CreateHandler(&asn.TOASNV11{}), auth.PrivLevelOperations, Authenticated, 
nil, 2999492188, noPerlBypass},
+               {api.Version{2, 0}, http.MethodDelete, `asns/{id}$`, 
api.DeleteHandler(&asn.TOASNV11{}), auth.PrivLevelOperations, Authenticated, 
nil, 2672524769, noPerlBypass},
+
+               // Traffic Stats access
+               {api.Version{2, 0}, http.MethodGet, `deliveryservice_stats`, 
trafficstats.GetDSStats, auth.PrivLevelReadOnly, Authenticated, nil, 
2319569028, noPerlBypass},
+               {api.Version{2, 0}, http.MethodGet, `cache_stats`, 
trafficstats.GetCacheStats, auth.PrivLevelReadOnly, Authenticated, nil, 
2497997906, noPerlBypass},
+               {api.Version{2, 0}, http.MethodGet, `current_stats/?$`, 
trafficstats.GetCurrentStats, auth.PrivLevelReadOnly, Authenticated, nil, 
2785442893, noPerlBypass},
+
+               {api.Version{2, 0}, http.MethodGet, `caches/stats/?$`, 
cachesstats.Get, auth.PrivLevelReadOnly, Authenticated, nil, 2813206588, 
noPerlBypass},
+
+               //CacheGroup: CRUD
+               {api.Version{2, 0}, http.MethodGet, `cachegroups/trimmed/?$`, 
cachegroup.GetTrimmed, auth.PrivLevelReadOnly, Authenticated, nil, 229527916, 
noPerlBypass},
+               {api.Version{2, 0}, http.MethodGet, `cachegroups/?$`, 
api.ReadHandler(&cachegroup.TOCacheGroup{}), auth.PrivLevelReadOnly, 
Authenticated, nil, 223079110, noPerlBypass},
+               {api.Version{2, 0}, http.MethodGet, `cachegroups/{id}$`, 
api.ReadHandler(&cachegroup.TOCacheGroup{}), auth.PrivLevelReadOnly, 
Authenticated, nil, 291886338, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPut, `cachegroups/{id}$`, 
api.UpdateHandler(&cachegroup.TOCacheGroup{}), auth.PrivLevelOperations, 
Authenticated, nil, 212954546, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPost, `cachegroups/?$`, 
api.CreateHandler(&cachegroup.TOCacheGroup{}), auth.PrivLevelOperations, 
Authenticated, nil, 22982665, noPerlBypass},
+               {api.Version{2, 0}, http.MethodDelete, `cachegroups/{id}$`, 
api.DeleteHandler(&cachegroup.TOCacheGroup{}), auth.PrivLevelOperations, 
Authenticated, nil, 227869365, noPerlBypass},
+
+               {api.Version{2, 0}, http.MethodPost, 
`cachegroups/{id}/queue_update$`, cachegroup.QueueUpdates, 
auth.PrivLevelOperations, Authenticated, nil, 2071644110, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPost, 
`cachegroups/{id}/deliveryservices/?$`, cachegroup.DSPostHandler, 
auth.PrivLevelOperations, Authenticated, nil, 2520240431, noPerlBypass},
+
+               //CacheGroup Parameters: CRUD
+               {api.Version{2, 0}, http.MethodGet, `cachegroupparameters/?$`, 
cachegroupparameter.ReadAllCacheGroupParameters, auth.PrivLevelReadOnly, 
Authenticated, nil, 212449724, perlBypass},
+               {api.Version{2, 0}, http.MethodPost, `cachegroupparameters/?$`, 
cachegroupparameter.AddCacheGroupParameters, auth.PrivLevelOperations, 
Authenticated, nil, 212449725, perlBypass},
+               {api.Version{2, 0}, http.MethodGet, 
`cachegroups/{id}/parameters/?$`, 
api.ReadHandler(&cachegroupparameter.TOCacheGroupParameter{}), 
auth.PrivLevelReadOnly, Authenticated, nil, 212449723, noPerlBypass},
+               {api.Version{2, 0}, http.MethodGet, 
`cachegroups/{id}/unassigned_parameters/?$`, 
api.ReadHandler(&cachegroupparameter.TOCacheGroupUnassignedParameter{}), 
auth.PrivLevelReadOnly, Authenticated, nil, 2457339250, noPerlBypass},
+               {api.Version{2, 0}, http.MethodDelete, 
`cachegroupparameters/{cachegroupID}/{parameterId}$`, 
api.DeleteHandler(&cachegroupparameter.TOCacheGroupParameter{}), 
auth.PrivLevelOperations, Authenticated, nil, 212449733, noPerlBypass},
+
+               //Capabilities
+               {api.Version{2, 0}, http.MethodGet, `capabilities/?$`, 
capabilities.Read, auth.PrivLevelReadOnly, Authenticated, nil, 2008135, 
noPerlBypass},
+
+               //CDN
+               {api.Version{2, 0}, http.MethodGet, 
`cdns/name/{name}/sslkeys/?$`, cdn.GetSSLKeys, auth.PrivLevelAdmin, 
Authenticated, nil, 2278581772, noPerlBypass},
+               {api.Version{2, 0}, http.MethodGet, `cdns/metric_types`, 
notImplementedHandler, 0, NoAuth, nil, 283165463, noPerlBypass}, // MUST NOT 
end in $, because the 1.x route is longer
+
+               {api.Version{2, 0}, http.MethodGet, `cdns/capacity$`, 
cdn.GetCapacity, auth.PrivLevelReadOnly, Authenticated, nil, 297185281, 
noPerlBypass},
+
+               {api.Version{2, 0}, http.MethodGet, `cdns/{name}/health/?$`, 
cdn.GetNameHealth, auth.PrivLevelReadOnly, Authenticated, nil, 2135348194, 
noPerlBypass},
+               {api.Version{2, 0}, http.MethodGet, `cdns/health/?$`, 
cdn.GetHealth, auth.PrivLevelReadOnly, Authenticated, nil, 2085381134, 
noPerlBypass},
+
+               {api.Version{2, 0}, http.MethodGet, `cdns/domains/?$`, 
cdn.DomainsHandler, auth.PrivLevelReadOnly, Authenticated, nil, 226902560, 
noPerlBypass},
+               {api.Version{2, 0}, http.MethodGet, `cdns/routing$`, 
cdn.GetRouting, auth.PrivLevelReadOnly, Authenticated, nil, 26722982, 
noPerlBypass},
+
+               //CDN: CRUD
+               {api.Version{2, 0}, http.MethodGet, `cdns/name/{name}/?$`, 
api.ReadHandler(&cdn.TOCDN{}), auth.PrivLevelReadOnly, Authenticated, nil, 
2235233288, noPerlBypass},
+               {api.Version{2, 0}, http.MethodDelete, `cdns/name/{name}$`, 
cdn.DeleteName, auth.PrivLevelOperations, Authenticated, nil, 208804959, 
noPerlBypass},
+
+               //CDN: queue updates
+               {api.Version{2, 0}, http.MethodPost, `cdns/{id}/queue_update$`, 
cdn.Queue, auth.PrivLevelOperations, Authenticated, nil, 221515980, 
noPerlBypass},
+               {api.Version{2, 0}, http.MethodPost, 
`cdns/dnsseckeys/generate?$`, cdn.CreateDNSSECKeys, auth.PrivLevelAdmin, 
Authenticated, nil, 275336, noPerlBypass},
+               {api.Version{2, 0}, http.MethodGet, 
`cdns/name/{name}/dnsseckeys/delete/?$`, cdn.DeleteDNSSECKeys, 
auth.PrivLevelAdmin, Authenticated, nil, 271104207, noPerlBypass},
+               {api.Version{2, 0}, http.MethodGet, 
`cdns/name/{name}/dnsseckeys/?$`, cdn.GetDNSSECKeys, auth.PrivLevelAdmin, 
Authenticated, nil, 279010609, noPerlBypass},
+
+               {api.Version{2, 0}, http.MethodGet, 
`cdns/dnsseckeys/refresh/?$`, cdn.RefreshDNSSECKeys, auth.PrivLevelOperations, 
Authenticated, nil, 2771997116, noPerlBypass},
+
+               //CDN: Monitoring: Traffic Monitor
+               {api.Version{2, 0}, http.MethodGet, 
`cdns/{cdn}/configs/monitoring?$`, crconfig.SnapshotGetMonitoringHandler, 
auth.PrivLevelReadOnly, Authenticated, nil, 2240847892, noPerlBypass},
+
+               //Database dumps
+               {api.Version{2, 0}, http.MethodGet, `dbdump/?`, dbdump.DBDump, 
auth.PrivLevelAdmin, Authenticated, nil, 224016647, noPerlBypass},
+
+               //Division: CRUD
+               {api.Version{2, 0}, http.MethodGet, `divisions/??$`, 
api.ReadHandler(&division.TODivision{}), auth.PrivLevelReadOnly, Authenticated, 
nil, 2085181534, noPerlBypass},
+               {api.Version{2, 0}, http.MethodGet, `divisions/{id}$`, 
api.ReadHandler(&division.TODivision{}), auth.PrivLevelReadOnly, Authenticated, 
nil, 2241497902, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPut, `divisions/{id}$`, 
api.UpdateHandler(&division.TODivision{}), auth.PrivLevelOperations, 
Authenticated, nil, 206369140, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPost, `divisions/?$`, 
api.CreateHandler(&division.TODivision{}), auth.PrivLevelOperations, 
Authenticated, nil, 253713800, noPerlBypass},
+               {api.Version{2, 0}, http.MethodDelete, `divisions/{id}$`, 
api.DeleteHandler(&division.TODivision{}), auth.PrivLevelOperations, 
Authenticated, nil, 2325382237, noPerlBypass},
+
+               {api.Version{2, 0}, http.MethodGet, `logs/?$`, logs.Get, 
auth.PrivLevelReadOnly, Authenticated, nil, 248340550, noPerlBypass},
+               {api.Version{2, 0}, http.MethodGet, `logs/{days}/days/?$`, 
logs.Get, auth.PrivLevelReadOnly, Authenticated, nil, 2192414145, noPerlBypass},
+               {api.Version{2, 0}, http.MethodGet, `logs/newcount/?$`, 
logs.GetNewCount, auth.PrivLevelReadOnly, Authenticated, nil, 2405833012, 
noPerlBypass},
+
+               //Content invalidation jobs
+               {api.Version{2, 0}, http.MethodGet, `jobs/?$`, 
api.ReadHandler(&invalidationjobs.InvalidationJob{}), auth.PrivLevelReadOnly, 
Authenticated, nil, 2966782041, noPerlBypass},
+               {api.Version{2, 0}, http.MethodDelete, `jobs/?$`, 
invalidationjobs.Delete, auth.PrivLevelPortal, Authenticated, nil, 216780776, 
noPerlBypass},
+               {api.Version{2, 0}, http.MethodPut, `jobs/?$`, 
invalidationjobs.Update, auth.PrivLevelPortal, Authenticated, nil, 286134226, 
noPerlBypass},
+               {api.Version{2, 0}, http.MethodPost, `jobs/?`, 
invalidationjobs.Create, auth.PrivLevelPortal, Authenticated, nil, 20450955, 
noPerlBypass},
+
+               //Login
+               {api.Version{2, 0}, http.MethodGet, 
`users/{id}/deliveryservices/?$`, user.GetDSes, auth.PrivLevelReadOnly, 
Authenticated, nil, 288787789, noPerlBypass},
+               {api.Version{2, 0}, http.MethodGet, 
`user/{id}/deliveryservices/available/?$`, user.GetAvailableDSes, 
auth.PrivLevelReadOnly, Authenticated, nil, 257082995, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPost, `user/login/?$`, 
login.LoginHandler(d.DB, d.Config), 0, NoAuth, nil, 2392670821, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPost, `user/logout/?$`, 
login.LogoutHandler(d.Config.Secrets[0]), 0, Authenticated, nil, 243434825, 
noPerlBypass},
+               {api.Version{2, 0}, http.MethodPost, `user/login/oauth/?$`, 
login.OauthLoginHandler(d.DB, d.Config), 0, NoAuth, nil, 2415886009, 
noPerlBypass},
+               {api.Version{2, 0}, http.MethodPost, `user/login/token/?$`, 
login.TokenLoginHandler(d.DB, d.Config), 0, NoAuth, nil, 202408841, 
noPerlBypass},
+               {api.Version{2, 0}, http.MethodPost, `user/reset_password/?$`, 
login.ResetPassword(d.DB, d.Config), 0, NoAuth, nil, 2292914630, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPost, `users/register/?$`, 
login.RegisterUser, auth.PrivLevelOperations, Authenticated, nil, 2337, 
noPerlBypass},
+
+               //ISO
+               {api.Version{2, 0}, http.MethodGet, `osversions/?$`, 
iso.GetOSVersions, auth.PrivLevelReadOnly, Authenticated, nil, 276088657, 
noPerlBypass},
+
+               //User: CRUD
+               {api.Version{2, 0}, http.MethodGet, `users/?$`, 
api.ReadHandler(&user.TOUser{}), auth.PrivLevelReadOnly, Authenticated, nil, 
2491929900, noPerlBypass},
+               {api.Version{2, 0}, http.MethodGet, `users/{id}$`, 
api.ReadHandler(&user.TOUser{}), auth.PrivLevelReadOnly, Authenticated, nil, 
213809980, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPut, `users/{id}$`, 
api.UpdateHandler(&user.TOUser{}), auth.PrivLevelOperations, Authenticated, 
nil, 235433404, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPost, `users/?$`, 
api.CreateHandler(&user.TOUser{}), auth.PrivLevelOperations, Authenticated, 
nil, 276244816, noPerlBypass},
+
+               {api.Version{2, 0}, http.MethodGet, `user/current/?$`, 
user.Current, auth.PrivLevelReadOnly, Authenticated, nil, 2610701614, 
noPerlBypass},
+               {api.Version{2, 0}, http.MethodPut, `user/current/?$`, 
user.ReplaceCurrent, auth.PrivLevelReadOnly, Authenticated, nil, 220, 
noPerlBypass},
+
+               //Parameter: CRUD
+               {api.Version{2, 0}, http.MethodGet, `parameters/?$`, 
api.ReadHandler(&parameter.TOParameter{}), auth.PrivLevelReadOnly, 
Authenticated, nil, 2212554292, noPerlBypass},
+               {api.Version{2, 0}, http.MethodGet, `parameters/{id}$`, 
api.ReadHandler(&parameter.TOParameter{}), auth.PrivLevelReadOnly, 
Authenticated, nil, 2221666841, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPut, `parameters/{id}$`, 
api.UpdateHandler(&parameter.TOParameter{}), auth.PrivLevelOperations, 
Authenticated, nil, 2873936115, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPost, `parameters/?$`, 
api.CreateHandler(&parameter.TOParameter{}), auth.PrivLevelOperations, 
Authenticated, nil, 2669510859, noPerlBypass},
+               {api.Version{2, 0}, http.MethodDelete, `parameters/{id}$`, 
api.DeleteHandler(&parameter.TOParameter{}), auth.PrivLevelOperations, 
Authenticated, nil, 226277118, noPerlBypass},
+
+               //Phys_Location: CRUD
+               {api.Version{2, 0}, http.MethodGet, `phys_locations/?$`, 
api.ReadHandler(&physlocation.TOPhysLocation{}), auth.PrivLevelReadOnly, 
Authenticated, nil, 220405182, noPerlBypass},
+               {api.Version{2, 0}, http.MethodGet, 
`phys_locations/trimmed/?$`, physlocation.GetTrimmed, auth.PrivLevelReadOnly, 
Authenticated, nil, 2097221000, noPerlBypass},
+               {api.Version{2, 0}, http.MethodGet, `phys_locations/{id}$`, 
api.ReadHandler(&physlocation.TOPhysLocation{}), auth.PrivLevelReadOnly, 
Authenticated, nil, 2554216025, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPut, `phys_locations/{id}$`, 
api.UpdateHandler(&physlocation.TOPhysLocation{}), auth.PrivLevelOperations, 
Authenticated, nil, 222795021, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPost, `phys_locations/?$`, 
api.CreateHandler(&physlocation.TOPhysLocation{}), auth.PrivLevelOperations, 
Authenticated, nil, 2246456648, noPerlBypass},
+               {api.Version{2, 0}, http.MethodDelete, `phys_locations/{id}$`, 
api.DeleteHandler(&physlocation.TOPhysLocation{}), auth.PrivLevelOperations, 
Authenticated, nil, 25614221, noPerlBypass},
+
+               //Ping
+               {api.Version{2, 0}, http.MethodGet, `ping$`, 
ping.PingHandler(), 0, NoAuth, nil, 2555661597, noPerlBypass},
+               {api.Version{2, 0}, http.MethodGet, `riak/ping/?$`, ping.Riak, 
auth.PrivLevelReadOnly, Authenticated, nil, 2884012114, noPerlBypass},
+               {api.Version{2, 0}, http.MethodGet, `keys/ping/?$`, ping.Keys, 
auth.PrivLevelReadOnly, Authenticated, nil, 218416022, noPerlBypass},
+
+               //Profile: CRUD
+               {api.Version{2, 0}, http.MethodGet, `profiles/?$`, 
api.ReadHandler(&profile.TOProfile{}), auth.PrivLevelReadOnly, Authenticated, 
nil, 268758589, noPerlBypass},
+               {api.Version{2, 0}, http.MethodGet, `profiles/trimmed/?$`, 
profile.Trimmed, auth.PrivLevelReadOnly, Authenticated, nil, 244942941, 
noPerlBypass},
+
+               {api.Version{2, 0}, http.MethodGet, `profiles/{id}$`, 
api.ReadHandler(&profile.TOProfile{}), auth.PrivLevelReadOnly, Authenticated, 
nil, 2570260672, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPut, `profiles/{id}$`, 
api.UpdateHandler(&profile.TOProfile{}), auth.PrivLevelOperations, 
Authenticated, nil, 28439172, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPost, `profiles/?$`, 
api.CreateHandler(&profile.TOProfile{}), auth.PrivLevelOperations, 
Authenticated, nil, 2540211556, noPerlBypass},
+               {api.Version{2, 0}, http.MethodDelete, `profiles/{id}$`, 
api.DeleteHandler(&profile.TOProfile{}), auth.PrivLevelOperations, 
Authenticated, nil, 2205594465, noPerlBypass},
+
+               {api.Version{2, 0}, http.MethodGet, `profiles/{id}/export/?$`, 
profile.ExportProfileHandler, auth.PrivLevelReadOnly, Authenticated, nil, 
20133517, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPost, `profiles/import/?$`, 
profile.ImportProfileHandler, auth.PrivLevelOperations, Authenticated, nil, 
206143208, noPerlBypass},
+
+               // Copy Profile
+               {api.Version{2, 0}, http.MethodPost, 
`profiles/name/{new_profile}/copy/{existing_profile}`, 
profile.CopyProfileHandler, auth.PrivLevelOperations, Authenticated, nil, 
206143209, noPerlBypass},
+
+               //Region: CRUDs
+               {api.Version{2, 0}, http.MethodGet, `regions/?$`, 
api.ReadHandler(&region.TORegion{}), auth.PrivLevelReadOnly, Authenticated, 
nil, 210037085, noPerlBypass},
+               {api.Version{2, 0}, http.MethodGet, `regions/{id}$`, 
api.ReadHandler(&region.TORegion{}), auth.PrivLevelReadOnly, Authenticated, 
nil, 2224440051, noPerlBypass},
+               {api.Version{2, 0}, http.MethodGet, `regions/name/{name}/?$`, 
region.GetName, auth.PrivLevelReadOnly, Authenticated, nil, 203583197, 
noPerlBypass},
+               {api.Version{2, 0}, http.MethodPut, `regions/{id}$`, 
api.UpdateHandler(&region.TORegion{}), auth.PrivLevelOperations, Authenticated, 
nil, 222308224, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPost, `regions/?$`, 
api.CreateHandler(&region.TORegion{}), auth.PrivLevelOperations, Authenticated, 
nil, 2288334488, noPerlBypass},
+               {api.Version{2, 0}, http.MethodDelete, `regions/?$`, 
api.DeleteHandler(&region.TORegion{}), auth.PrivLevelOperations, Authenticated, 
nil, 2232626758, noPerlBypass},
+               {api.Version{2, 0}, http.MethodDelete, `regions/name/{name}$`, 
handlerToFunc(proxyHandler), 0, NoAuth, nil, 2925881096, noPerlBypass},
+               {api.Version{2, 0}, http.MethodDelete, `regions/{id}$`, 
api.DeleteHandler(&region.TORegion{}), auth.PrivLevelOperations, Authenticated, 
nil, 2181575271, noPerlBypass},
+
+               {api.Version{2, 0}, http.MethodDelete, 
`deliveryservice_server/{dsid}/{serverid}`, dsserver.Delete, 
auth.PrivLevelOperations, Authenticated, nil, 2532184523, noPerlBypass},
+
+               // get all edge servers associated with a delivery service 
(from deliveryservice_server table)
+
+               {api.Version{2, 0}, http.MethodGet, `deliveryserviceserver/?$`, 
dsserver.ReadDSSHandlerV14, auth.PrivLevelReadOnly, Authenticated, nil, 
2946145033, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPost, `deliveryserviceserver$`, 
dsserver.GetReplaceHandler, auth.PrivLevelOperations, Authenticated, nil, 
229799788, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPost, 
`deliveryservices/{xml_id}/servers$`, dsserver.GetCreateHandler, 
auth.PrivLevelOperations, Authenticated, nil, 2428181206, noPerlBypass},
+               {api.Version{2, 0}, http.MethodGet, 
`servers/{id}/deliveryservices$`, 
api.ReadHandler(&dsserver.TODSSDeliveryService{}), auth.PrivLevelReadOnly, 
Authenticated, nil, 233115411, noPerlBypass},
+               {api.Version{2, 0}, http.MethodGet, 
`deliveryservices/{id}/servers$`, dsserver.GetReadAssigned, 
auth.PrivLevelReadOnly, Authenticated, nil, 2345121223, noPerlBypass},
+               {api.Version{2, 0}, http.MethodGet, 
`deliveryservices/{id}/unassigned_servers$`, dsserver.GetReadUnassigned, 
auth.PrivLevelReadOnly, Authenticated, nil, 2223944221, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPost, 
`deliveryservices/request`, deliveryservicerequests.Request, 
auth.PrivLevelPortal, Authenticated, nil, 240875299, noPerlBypass},
+               {api.Version{2, 0}, http.MethodGet, 
`deliveryservice_matches/?$`, deliveryservice.GetMatches, 
auth.PrivLevelReadOnly, Authenticated, nil, 2191301170, noPerlBypass},
+
+               {api.Version{2, 0}, http.MethodGet, 
`deliveryservices/{id}/capacity/?$`, deliveryservice.GetCapacity, 
auth.PrivLevelReadOnly, Authenticated, nil, 2231409110, noPerlBypass},
+
+               //Server
+               {api.Version{2, 0}, http.MethodGet, `servers/status$`, 
server.GetServersStatusCountsHandler, auth.PrivLevelReadOnly, Authenticated, 
nil, 2252786293, noPerlBypass},
+
+               //Serverchecks
+               {api.Version{2, 0}, http.MethodGet, `servers/checks/?$`, 
servercheck.ReadServersChecks, auth.PrivLevelReadOnly, Authenticated, nil, 
2796112922, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPost, `servercheck/?$`, 
servercheck.CreateUpdateServercheck, auth.PrivLevelInvalid, Authenticated, nil, 
2764281568, noPerlBypass},
+
+               //Server Details
+               {api.Version{2, 0}, http.MethodGet, `servers/details/?$`, 
server.GetDetailParamHandler, auth.PrivLevelReadOnly, Authenticated, nil, 
2261264714, noPerlBypass},
+               {api.Version{2, 0}, http.MethodGet, 
`servers/hostname/{hostName}/details/?$`, server.GetDetailHandler, 
auth.PrivLevelReadOnly, Authenticated, nil, 272366128, noPerlBypass},
+
+               //Server status
+               {api.Version{2, 0}, http.MethodPut, `servers/{id}/status$`, 
server.UpdateStatusHandler, auth.PrivLevelOperations, Authenticated, nil, 
276663851, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPost, 
`servers/{id}/queue_update$`, server.QueueUpdateHandler, 
auth.PrivLevelOperations, Authenticated, nil, 2189471, noPerlBypass},
+
+               //Server: CRUD
+               {api.Version{2, 0}, http.MethodGet, `servers/?$`, 
api.ReadHandler(&server.TOServer{}), auth.PrivLevelReadOnly, Authenticated, 
nil, 2720959285, noPerlBypass},
+               {api.Version{2, 0}, http.MethodGet, `servers/{id}$`, 
api.ReadHandler(&server.TOServer{}), auth.PrivLevelReadOnly, Authenticated, 
nil, 2543122028, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPut, `servers/{id}$`, 
api.UpdateHandler(&server.TOServer{}), auth.PrivLevelOperations, Authenticated, 
nil, 258634103, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPost, `servers/?$`, 
api.CreateHandler(&server.TOServer{}), auth.PrivLevelOperations, Authenticated, 
nil, 2225558061, noPerlBypass},
+               {api.Version{2, 0}, http.MethodDelete, `servers/{id}$`, 
api.DeleteHandler(&server.TOServer{}), auth.PrivLevelOperations, Authenticated, 
nil, 292322233, noPerlBypass},
+
+               //Server Capability
+               {api.Version{2, 0}, http.MethodGet, `server_capabilities$`, 
api.ReadHandler(&servercapability.TOServerCapability{}), 
auth.PrivLevelReadOnly, Authenticated, nil, 210407391, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPost, `server_capabilities$`, 
api.CreateHandler(&servercapability.TOServerCapability{}), 
auth.PrivLevelOperations, Authenticated, nil, 2074470708, noPerlBypass},
+               {api.Version{2, 0}, http.MethodDelete, `server_capabilities$`, 
api.DeleteHandler(&servercapability.TOServerCapability{}), 
auth.PrivLevelOperations, Authenticated, nil, 236415038, noPerlBypass},
+
+               //Server Server Capabilities: CRUD
+               {api.Version{2, 0}, http.MethodGet, 
`server_server_capabilities/?$`, 
api.ReadHandler(&server.TOServerServerCapability{}), auth.PrivLevelReadOnly, 
Authenticated, nil, 2800231889, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPost, 
`server_server_capabilities/?$`, 
api.CreateHandler(&server.TOServerServerCapability{}), 
auth.PrivLevelOperations, Authenticated, nil, 2293166834, noPerlBypass},
+               {api.Version{2, 0}, http.MethodDelete, 
`server_server_capabilities/?$`, 
api.DeleteHandler(&server.TOServerServerCapability{}), 
auth.PrivLevelOperations, Authenticated, nil, 2058714058, noPerlBypass},
+
+               //Status: CRUD
+               {api.Version{2, 0}, http.MethodGet, `statuses/?$`, 
api.ReadHandler(&status.TOStatus{}), auth.PrivLevelReadOnly, Authenticated, 
nil, 2244905656, noPerlBypass},
+               {api.Version{2, 0}, http.MethodGet, `statuses/{id}$`, 
api.ReadHandler(&status.TOStatus{}), auth.PrivLevelReadOnly, Authenticated, 
nil, 2899095947, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPut, `statuses/{id}$`, 
api.UpdateHandler(&status.TOStatus{}), auth.PrivLevelOperations, Authenticated, 
nil, 2207966504, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPost, `statuses/?$`, 
api.CreateHandler(&status.TOStatus{}), auth.PrivLevelOperations, Authenticated, 
nil, 2369123612, noPerlBypass},
+               {api.Version{2, 0}, http.MethodDelete, `statuses/{id}$`, 
api.DeleteHandler(&status.TOStatus{}), auth.PrivLevelOperations, Authenticated, 
nil, 255111360, noPerlBypass},
+
+               //System
+               {api.Version{2, 0}, http.MethodGet, `system/info/?$`, 
systeminfo.Get, auth.PrivLevelReadOnly, Authenticated, nil, 221047475, 
noPerlBypass},
+
+               //Type: CRUD
+               {api.Version{2, 0}, http.MethodGet, `types/?$`, 
api.ReadHandler(&types.TOType{}), auth.PrivLevelReadOnly, Authenticated, nil, 
2226701823, noPerlBypass},
+               {api.Version{2, 0}, http.MethodGet, `types/{id}$`, 
api.ReadHandler(&types.TOType{}), auth.PrivLevelReadOnly, Authenticated, nil, 
26037256, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPut, `types/{id}$`, 
api.UpdateHandler(&types.TOType{}), auth.PrivLevelOperations, Authenticated, 
nil, 28860115, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPost, `types/?$`, 
api.CreateHandler(&types.TOType{}), auth.PrivLevelOperations, Authenticated, 
nil, 2513308195, noPerlBypass},
+               {api.Version{2, 0}, http.MethodDelete, `types/{id}$`, 
api.DeleteHandler(&types.TOType{}), auth.PrivLevelOperations, Authenticated, 
nil, 23175773, noPerlBypass},
+
+               //About
+               {api.Version{2, 0}, http.MethodGet, `about/?$`, 
about.Handler(), auth.PrivLevelReadOnly, Authenticated, nil, 2317501166, 
noPerlBypass},
+
+               //Coordinates
+               {api.Version{2, 0}, http.MethodGet, `coordinates/?$`, 
api.ReadHandler(&coordinate.TOCoordinate{}), auth.PrivLevelReadOnly, 
Authenticated, nil, 296700745, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPut, `coordinates/?$`, 
api.UpdateHandler(&coordinate.TOCoordinate{}), auth.PrivLevelOperations, 
Authenticated, nil, 268926174, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPost, `coordinates/?$`, 
api.CreateHandler(&coordinate.TOCoordinate{}), auth.PrivLevelOperations, 
Authenticated, nil, 2428112157, noPerlBypass},
+               {api.Version{2, 0}, http.MethodDelete, `coordinates/?$`, 
api.DeleteHandler(&coordinate.TOCoordinate{}), auth.PrivLevelOperations, 
Authenticated, nil, 2303849889, noPerlBypass},
+
+               //CDN generic handlers:
+               {api.Version{2, 0}, http.MethodGet, `cdns/?$`, 
api.ReadHandler(&cdn.TOCDN{}), auth.PrivLevelReadOnly, Authenticated, nil, 
2230318621, noPerlBypass},
+               {api.Version{2, 0}, http.MethodGet, `cdns/{id}$`, 
api.ReadHandler(&cdn.TOCDN{}), auth.PrivLevelReadOnly, Authenticated, nil, 
232290057, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPut, `cdns/{id}$`, 
api.UpdateHandler(&cdn.TOCDN{}), auth.PrivLevelOperations, Authenticated, nil, 
2311178934, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPost, `cdns/?$`, 
api.CreateHandler(&cdn.TOCDN{}), auth.PrivLevelOperations, Authenticated, nil, 
2160505289, noPerlBypass},
+               {api.Version{2, 0}, http.MethodDelete, `cdns/{id}$`, 
api.DeleteHandler(&cdn.TOCDN{}), auth.PrivLevelOperations, Authenticated, nil, 
227694657, noPerlBypass},
+
+               //Delivery service requests
+               {api.Version{2, 0}, http.MethodGet, 
`deliveryservice_requests/?$`, 
api.ReadHandler(&dsrequest.TODeliveryServiceRequest{}), auth.PrivLevelReadOnly, 
Authenticated, nil, 2681163935, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPut, 
`deliveryservice_requests/?$`, 
api.UpdateHandler(&dsrequest.TODeliveryServiceRequest{}), auth.PrivLevelPortal, 
Authenticated, nil, 2249907918, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPost, 
`deliveryservice_requests/?$`, 
api.CreateHandler(&dsrequest.TODeliveryServiceRequest{}), auth.PrivLevelPortal, 
Authenticated, nil, 29385039, noPerlBypass},
+               {api.Version{2, 0}, http.MethodDelete, 
`deliveryservice_requests/?$`, 
api.DeleteHandler(&dsrequest.TODeliveryServiceRequest{}), auth.PrivLevelPortal, 
Authenticated, nil, 2296985025, noPerlBypass},
+
+               //Delivery service request: Actions
+               {api.Version{2, 0}, http.MethodPut, 
`deliveryservice_requests/{id}/assign$`, 
api.UpdateHandler(dsrequest.GetAssignmentSingleton()), 
auth.PrivLevelOperations, Authenticated, nil, 2703160290, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPut, 
`deliveryservice_requests/{id}/status$`, 
api.UpdateHandler(dsrequest.GetStatusSingleton()), auth.PrivLevelPortal, 
Authenticated, nil, 268415099, noPerlBypass},
+
+               //Delivery service request comment: CRUD
+               {api.Version{2, 0}, http.MethodGet, 
`deliveryservice_request_comments/?$`, 
api.ReadHandler(&comment.TODeliveryServiceRequestComment{}), 
auth.PrivLevelReadOnly, Authenticated, nil, 2032650737, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPut, 
`deliveryservice_request_comments/?$`, 
api.UpdateHandler(&comment.TODeliveryServiceRequestComment{}), 
auth.PrivLevelPortal, Authenticated, nil, 260487847, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPost, 
`deliveryservice_request_comments/?$`, 
api.CreateHandler(&comment.TODeliveryServiceRequestComment{}), 
auth.PrivLevelPortal, Authenticated, nil, 227227672, noPerlBypass},
+               {api.Version{2, 0}, http.MethodDelete, 
`deliveryservice_request_comments/?$`, 
api.DeleteHandler(&comment.TODeliveryServiceRequestComment{}), 
auth.PrivLevelPortal, Authenticated, nil, 299504668, noPerlBypass},
+
+               //Delivery service uri signing keys: CRUD
+               {api.Version{2, 0}, http.MethodGet, 
`deliveryservices/{xmlID}/urisignkeys$`, urisigning.GetURIsignkeysHandler, 
auth.PrivLevelAdmin, Authenticated, nil, 2293078558, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPost, 
`deliveryservices/{xmlID}/urisignkeys$`, 
urisigning.SaveDeliveryServiceURIKeysHandler, auth.PrivLevelAdmin, 
Authenticated, nil, 208466335, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPut, 
`deliveryservices/{xmlID}/urisignkeys$`, 
urisigning.SaveDeliveryServiceURIKeysHandler, auth.PrivLevelAdmin, 
Authenticated, nil, 27648969, noPerlBypass},
+               {api.Version{2, 0}, http.MethodDelete, 
`deliveryservices/{xmlID}/urisignkeys$`, 
urisigning.RemoveDeliveryServiceURIKeysHandler, auth.PrivLevelAdmin, 
Authenticated, nil, 229925417, noPerlBypass},
+
+               //Delivery Service Required Capabilities: CRUD
+               {api.Version{2, 0}, http.MethodGet, 
`deliveryservices_required_capabilities/?$`, 
api.ReadHandler(&deliveryservice.RequiredCapability{}), auth.PrivLevelReadOnly, 
Authenticated, nil, 2158522227, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPost, 
`deliveryservices_required_capabilities/?$`, 
api.CreateHandler(&deliveryservice.RequiredCapability{}), 
auth.PrivLevelOperations, Authenticated, nil, 2096873992, noPerlBypass},
+               {api.Version{2, 0}, http.MethodDelete, 
`deliveryservices_required_capabilities/?$`, 
api.DeleteHandler(&deliveryservice.RequiredCapability{}), 
auth.PrivLevelOperations, Authenticated, nil, 2496289304, noPerlBypass},
+
+               // Federations by CDN (the actual table for federation)
+               {api.Version{2, 0}, http.MethodGet, 
`cdns/{name}/federations/?$`, 
api.ReadHandler(&cdnfederation.TOCDNFederation{}), auth.PrivLevelReadOnly, 
Authenticated, nil, 289225032, noPerlBypass},
+               {api.Version{2, 0}, http.MethodGet, 
`cdns/{name}/federations/{id}$`, 
api.ReadHandler(&cdnfederation.TOCDNFederation{}), auth.PrivLevelReadOnly, 
Authenticated, nil, 22850599, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPost, 
`cdns/{name}/federations/?$`, 
api.CreateHandler(&cdnfederation.TOCDNFederation{}), auth.PrivLevelAdmin, 
Authenticated, nil, 2954894219, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPut, 
`cdns/{name}/federations/{id}$`, 
api.UpdateHandler(&cdnfederation.TOCDNFederation{}), auth.PrivLevelAdmin, 
Authenticated, nil, 226065466, noPerlBypass},
+               {api.Version{2, 0}, http.MethodDelete, 
`cdns/{name}/federations/{id}$`, 
api.DeleteHandler(&cdnfederation.TOCDNFederation{}), auth.PrivLevelAdmin, 
Authenticated, nil, 2442852902, noPerlBypass},
+
+               {api.Version{2, 0}, http.MethodPost, 
`cdns/{name}/dnsseckeys/ksk/generate$`, cdn.GenerateKSK, auth.PrivLevelAdmin, 
Authenticated, nil, 272924281, noPerlBypass},
+
+               //Origins
+               {api.Version{2, 0}, http.MethodGet, `origins/?$`, 
api.ReadHandler(&origin.TOOrigin{}), auth.PrivLevelReadOnly, Authenticated, 
nil, 244649256, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPut, `origins/?$`, 
api.UpdateHandler(&origin.TOOrigin{}), auth.PrivLevelOperations, Authenticated, 
nil, 21567746, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPost, `origins/?$`, 
api.CreateHandler(&origin.TOOrigin{}), auth.PrivLevelOperations, Authenticated, 
nil, 2099561643, noPerlBypass},
+               {api.Version{2, 0}, http.MethodDelete, `origins/?$`, 
api.DeleteHandler(&origin.TOOrigin{}), auth.PrivLevelOperations, Authenticated, 
nil, 260273263, noPerlBypass},
+
+               //Roles
+               {api.Version{2, 0}, http.MethodGet, `roles/?$`, 
api.ReadHandler(&role.TORole{}), auth.PrivLevelReadOnly, Authenticated, nil, 
287088583, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPut, `roles/?$`, 
api.UpdateHandler(&role.TORole{}), auth.PrivLevelAdmin, Authenticated, nil, 
2612897489, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPost, `roles/?$`, 
api.CreateHandler(&role.TORole{}), auth.PrivLevelAdmin, Authenticated, nil, 
230652406, noPerlBypass},
+               {api.Version{2, 0}, http.MethodDelete, `roles/?$`, 
api.DeleteHandler(&role.TORole{}), auth.PrivLevelAdmin, Authenticated, nil, 
2356705982, noPerlBypass},
+
+               //Delivery Services Regexes
+               {api.Version{2, 0}, http.MethodGet, 
`deliveryservices_regexes/?$`, deliveryservicesregexes.Get, 
auth.PrivLevelReadOnly, Authenticated, nil, 205501453, noPerlBypass},
+               {api.Version{2, 0}, http.MethodGet, 
`deliveryservices/{dsid}/regexes/?$`, deliveryservicesregexes.DSGet, 
auth.PrivLevelReadOnly, Authenticated, nil, 277432763, noPerlBypass},
+               {api.Version{2, 0}, http.MethodGet, 
`deliveryservices/{dsid}/regexes/{regexid}?$`, deliveryservicesregexes.DSGetID, 
auth.PrivLevelReadOnly, Authenticated, nil, 2044974567, noPerlBypass},
+               {api.Version{2, 0}, http.MethodPost, 
`deliveryservices/{dsid}/regexes/?(\.json)?$`, deliveryservicesregexes.Post, 
auth.PrivLevelOperations, Authenticated, nil, 212737800, noPerlBypass},
 
 Review comment:
   done

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to