I've been thinking about delivery services and the requirement of each delivery service to have a "delivery service regex" first in line (position 0) with a type of "HOST_REGEXP" and a format like .*\.xml-id\..*
[image: Inline image 1] These values end up in the CRConfig.json file that Traffic Router uses to route delivery service traffic appropriately. If either the type or the format of the FIRST delivery service regex is incorrect, bad things happen to the Traffic Router. Going forward with the TO API, I propose the following: 1. When creating a delivery service thru the API (POST /api/1.2/deliveryservices), upon success, the system creates a ds_regex for you like so: - type=HOST_REGEX - pattern=.*\.xml-id\..* - set_number=0 So basically, when you create a new delivery service, you get a "default" delivery service regex (one that the system requires in the format it requires) for free. No more fumbling around with regex... 2. When updating a delivery service thru the API (PUT /api/1.2/deliveryservices/:id), if xml_id has changed, then update the ds_regex at position 0 like so: - pattern=.*\.new-xml-id\..* 3. Create a set of delivery service regex crud apis so a user can manage delivery service regexes (i.e. add more regexes for cnames / aliases) - https://issues.apache.org/jira/browse/TC-94 - the only caveat being that NOBODY can touch ds_regexes at position 0. those are set in stone and the pattern can only be changed by changing the xml id of the deliveryservice. Thoughts? Jeremy
