rob05c commented on issue #2232: Rewrite Traffic Ops CRConfig Table Endpoints in Go URL: https://github.com/apache/trafficcontrol/issues/2232#issuecomment-398070296 # Table Usage ``` get /api/1.1/cdns/:name/configs/routing - DB: Server, Profile, Cdn, Parameter, ProfileParameter, CacheGroup, Regex, Type, StaticDNSEntry, DeliveryService get /api/1.1/cdns/domains - DB: Profile, CDN get /api/1.1/servers/:id/configfiles/ats get /api/1.1/profiles/:id/configfiles/ats/:filename get /api/1.1/servers/:id/configfiles/ats/:filename get /api/1.1/cdns/:id/configfiles/ats/:filename get /api/1.1/dbdump - Ext: pg_dump put /api/1.1/deliveryservices/:id/safe - DB: Deliveryservice, DeliveryServiceRegex, Regex, Profile, Type, Tenant delete /api/1.1/deliveryservice_server/:dsId/:serverId - DB: DeliveryService, DeliveryServiceServer, Tenant get /api/1.1/deliveryservices/:id/health - DB: Tenant, DeliveryService - Ext: Monitor get /api/1.1/deliveryservices/:id/capacity - DB: Tenant, DeliveryService - Ext: Monitor get /api/1.1/deliveryservices/:id/routing - DB: Tenant, DeliveryService, DeliveryServiceRegex, Regex, Cdn, Type - Ext: Router get /api/1.1/deliveryservices/:id/state - DB: Tenant, DeliveryService, CDN - Ext: Monitor post /api/1.1/deliveryservices/request - Ext: Email get /api/1.1/steering/:id/targets - DB: Tenant, DeliveryService, SteeringTarget, Type get /api/1.1/steering/:id/targets/:target_id - DB: Tenant, DeliveryService, SteeringTarget, Type post /api/1.1/steering/:id/targets - DB: Tenant, DeliveryService, SteeringTarget, Type put /api/1.1/steering/:id/targets/:target_id - DB: Tenant, DeliveryService, SteeringTarget, Type delete /api/1.1/steering/:id/targets/:target_id - DB: Tenant, DeliveryService, SteeringTarget get /api/1.1/deliveryservices/xmlId/:xmlid/sslkeys/delete - DB: DeliveryService, Tenant - Ext: Riak post /api/1.1/deliveryservices/xmlId/:xmlId/urlkeys/generate - DB: DeliveryService, Tenant - Ext: Riak post /api/1.1/deliveryservices/xmlId/:xmlId/urlkeys/copyFromXmlId/:copyFromXmlId - DB: DeliveryService, Tenant - Ext: Riak get /api/1.1/deliveryservices/xmlId/:xmlId/urlkeys - DB: DeliveryService, Tenant - Ext: Riak get /api/1.1/deliveryservices/:id/urlkeys - DB: DeliveryService, Tenant - Ext: Riak delete /api/1.1/divisions/name/:name - DB: Division, Region get /api/1.1/federations - DB: TmUser, FederationTmUser, FederationDeliveryService, DeliveryService post /api/1.1/federations put /api/1.1/federations delete /api/1.1/federations get /api/1.1/cdns/:name/federations get /api/1.1/cdns/:name/federations/:fedId post /api/1.1/cdns/:name/federations put /api/1.1/cdns/:name/federations/:fedId delete /api/1.1/cdns/:name/federations/:fedId get /api/1.1/federations/:fedId/users post /api/1.1/federations/:fedId/users delete /api/1.1/federations/:fedId/users/:userId get /api/1.1/federations/:fedId/deliveryservices post /api/1.1/federations/:fedId/deliveryservices delete /api/1.1/federations/:fedId/deliveryservices/:dsId get /api/1.1/federations/:fedId/federation_resolvers post /api/1.1/federations/:fedId/federation_resolvers post /api/1.1/federation_resolvers delete /api/1.1/federation_resolvers/:id - DB: TmUser, FederationTmUser, FederationDeliveryService, DeliveryService, FederationResolver, FederationFederationResolver get /api/1.1/hwinfo/dtdata - DB: HwInfo, Server get /api/1.1/osversions - DB: Parameter, Server - Ext: file:osversions.cfg post /api/1.1/isos - DB: Parameter - Ext: mkisofs get /api/1.1/jobs - DB: DeliveryService, Tenant, Job get /api/1.1/jobs/:id - DB: DeliveryService, Job get /api/1.1/user/current/jobs - DB: Tenant, DeliveryService, Job, TmUser post /api/1.1/user/current/jobs - DB: Tenant, DeliveryService, Job, TmUser post /api/1.1/parameters/validate - DB: Parameter get /api/1.1/cachegroups/:id/parameters - DB: Parameter, CachegroupParameter get /api/1.1/cachegroups/:id/unassigned_parameters - DB: Parameter, CachegroupParameter get /api/1.1/cachegroup/:parameter_id/parameter - DB: Cachegroup, CachegroupParameter get /api/1.1/cachegroupparameters - DB: CachegroupParameter post /api/1.1/cachegroupparameters - DB: Cachegroup, Parameter, ProfileParameter, CachegroupParameter delete /api/1.1/cachegroupparameters/:cachegroup_id/:parameter_id - DB: Cachegroup, Parameter, CachegroupParameter get /api/1.1/cachegroups/:parameter_id/parameter/available - DB: Cachegroup, CachegroupParameter post /api/1.1/regions/:region_name/phys_locations - DB: PhysLocation, Region post /api/1.1/profiles/name/:profile_name/copy/:profile_copy_from - DB: Profile, ProfileParameter get /api/1.1/profiles/:id/export - DB: Profile, ProfileParameter, Parameter post /api/1.1/profiles/import - DB: Cdn, Profile, ProfileTypeValue, Parameter, ProfileParameter get /api/1.1/parameters/:id/profiles - DB: Profile, ProfileParameter get /api/1.1/parameters/:id/unassigned_profiles - DB: Profile, ProfileParameter post /api/1.1/divisions/:division_name/regions - DB: Region, Division delete /api/1.1/regions/name/:name - DB: Region get /api/1.1/roles - DB: Role get /api/1.1/capabilities - DB: Capability get /api/1.1/capabilities/:name - DB: Capability put /api/1.1/capabilities/:name - DB: Capability post /api/1.1/capabilities - DB: Capability delete /api/1.1/capabilities/:name - DB: Capability, ApiCapability get /api/1.1/api_capabilities - DB: ApiCapability get /api/1.1/api_capabilities/:id - DB: ApiCapability put /api/1.1/api_capabilities/:id - DB: ApiCapability post /api/1.1/api_capabilities - DB: ApiCapability delete /api/1.1/api_capabilities/:id - DB: ApiCapability get /api/1.1/deliveryservices/:id/servers/eligible - DB: Tenant, DeliveryService, Server, TmUser, DeliveryserviceTmUser, Cdn, Status, Type get /api/1.1/servers/totals - DB: ServerTypes, Server, Type get /api/1.1/servers/status - DB: Server, Status, Type post /api/1.1/servers/:id/queue_update - DB: Server put /api/1.1/servers/:id/status - DB: Server, Status, Type, Cachegroup get /api/1.1/servers/checks - DB: ToExtension, Server, Profile, Status, Cachegroup, Type get /api/1.1/servercheck/aadata - DB: Type, Server, ServerCheck post /api/1.1/servercheck - DB: ToExtension, Server get /api/1.1/stats_summary - DB: StatsSummary post /api/1.1/stats_summary/create - DB: StatsSummary get /api/1.1/tenants - DB: Tenant get /api/1.1/tenants/:id - DB: Tenant put /api/1.1/tenants/:id - DB: Tenant post /api/1.1/tenants - DB: Tenant delete /api/1.1/tenants/:id - DB: Tenant, Deliveryservice, TmUser get /api/1.1/types/trimmed - DB: Type post /api/1.1/users/register - DB: TmUser, Role, Tenant - Ext: Email post /api/1.1/deliveryservice_user - DB: TmUser, Tenant, DeliveryserviceTmUser delete /api/1.1/deliveryservice_user/:dsId/:userId - DB: TmUser, Tenant, Deliveryservice, DeliveryserviceTmUser put /api/1.1/user/current - DB: Tenant, TmUser post /api/1.1/user/current/update - DB: Tenant, TmUser post /api/1.1/user/login/token - DB: Tenant, TmUser post /api/1.1/user/logout - nothing post /api/1.1/user/reset_password - DB: TmUser - Ext: Email get /api/1.1/riak/bucket/:bucket/key/:key/values - Ext: Riak get /api/1.1/riak/stats - Ext: Riak - Note: Go Riak library fundamentally doesn't support stats. Going to be painful to use HTTP outside the lib. get /api/1.1/to_extensions - DB: ToExtension, Parameter, ProfileParameter post /api/1.1/to_extensions - DB: ToExtension, ServerCheck post /api/1.1/to_extensions/:id/delete - DB: ToExtension get /api/1.1/traffic_monitor/stats - DB: Server, Cdn - Ext: Monitor ``` # External ## Commands get /api/1.1/dbdump (pg_dump) get /api/1.1/osversions (file:osversions.cfg) post /api/1.1/isos (mkisofs) ## Monitor get /api/1.1/deliveryservices/:id/health get /api/1.1/deliveryservices/:id/capacity get /api/1.1/deliveryservices/:id/state get /api/1.1/traffic_monitor/stats ## Router get /api/1.1/deliveryservices/:id/routing ## Email post /api/1.1/deliveryservices/request post /api/1.1/users/register post /api/1.1/user/reset_password ## Riak get /api/1.1/deliveryservices/xmlId/:xmlid/sslkeys/delete post /api/1.1/deliveryservices/xmlId/:xmlId/urlkeys/generate post /api/1.1/deliveryservices/xmlId/:xmlId/urlkeys/copyFromXmlId/:copyFromXmlId get /api/1.1/deliveryservices/xmlId/:xmlId/urlkeys get /api/1.1/deliveryservices/:id/urlkeys get /api/1.1/riak/bucket/:bucket/key/:key/values get /api/1.1/riak/stats # Observations - Deliveryservices overlap almost 1:1 with Riak, Monitor, Router - Most Delete check other tables, to ensure foreign keys - can we remove from Perl, and rely on DB for foreign key constraints? - 30/110 endpoints use DeliveryServices table # Delivery Services Table ``` get /api/1.1/cdns/:name/configs/routing put /api/1.1/deliveryservices/:id/safe delete /api/1.1/deliveryservice_server/:dsId/:serverId get /api/1.1/deliveryservices/:id/health get /api/1.1/deliveryservices/:id/capacity get /api/1.1/deliveryservices/:id/routing get /api/1.1/deliveryservices/:id/state get /api/1.1/steering/:id/targets get /api/1.1/steering/:id/targets/:target_id post /api/1.1/steering/:id/targets put /api/1.1/steering/:id/targets/:target_id delete /api/1.1/steering/:id/targets/:target_id get /api/1.1/deliveryservices/xmlId/:xmlid/sslkeys/delete post /api/1.1/deliveryservices/xmlId/:xmlId/urlkeys/generate post /api/1.1/deliveryservices/xmlId/:xmlId/urlkeys/copyFromXmlId/:copyFromXmlId get /api/1.1/deliveryservices/xmlId/:xmlId/urlkeys get /api/1.1/deliveryservices/:id/urlkeys get /api/1.1/federations post /api/1.1/federations put /api/1.1/federations delete /api/1.1/federations get /api/1.1/jobs get /api/1.1/jobs/:id get /api/1.1/user/current/jobs post /api/1.1/user/current/jobs get /api/1.1/deliveryservices/:id/servers/eligible delete /api/1.1/tenants/:id post /api/1.1/deliveryservice_user delete /api/1.1/deliveryservice_user/:dsId/:userId ```
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on 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