Ok, so it has brought to my attention that there are use cases where the ds_regex at position 0 may need to be something other than .*\.xml-id\..*
So how about this? 1. When creating a delivery service thru the API (POST /api/1.2/deliveryservices), upon success, the system creates a "default" ds_regex for you like so: - type=HOST_REGEX - pattern=.*\.xml-id\..* - set_number=0 2. Create a set of delivery service regex crud apis so a user can manage delivery service regexes (i.e. change the format of the default ds_regex OR add more regexes for cnames / aliases) - https://issues.apache.org/ jira/browse/TC-94 - for most use cases, the "default" ds_regex that was created for you in step#1 (.*\.xml-id\..*) should suffice but these api's are there if you need to do more advanced things with ds_regexes... Jeremy On Wed, Jan 18, 2017 at 3:56 PM, Jeremy Mitchell <[email protected]> wrote: > 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 > > >
