mitchell852 commented on issue #2029: [Issue 1907] TO API for backup edge 
cachegroup
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/2029#issuecomment-382891910
 
 
   @Vijay-1 - i think that makes sense
   
   fetch list
   Cache group for a fallbackId
   Example: GET api/{version}/cachegroup_fallbacks?fallbackId=6 returns
   [ { cachegroupId: 3, cachegroupName: 'cg-3', fallbackId: 6, fallbackName: 
'fb-6' }, { cachegroupId: 4, cachegroupName: 'cg-4', fallbackId: 6, 
fallbackName: 'fb-6' }  ]
   
   Fallbacks for a cacheGroupId
   Example: GET /api/{version}/cachegroup_fallbacks?cacheGroupId=3 returns
   [ { cachegroupId: 3, cachegroupName: 'cg-3', fallbackId: 6, fallbackName: 
'fb-6' }, { cachegroupId: 3, cachegroupName: 'cg-3', fallbackId: 7, 
fallbackName: 'fb-7' }  ]
   
   ^^ although the cg is not needed in the response, it keeps the structure the 
same regardless of which query param you send in.
   
   delete one
   DELETE all the fallbacks for a cache
   Example: DELETE api/{Version}/cachegroup_fallbacks?cacheGroupId=1
   DELETE a specific fallback for a cache
   Example: DELETE 
api/{Version}/cachegroup_fallbacks?cacheGroupId=1&fallbackId=5"
   
   but for POST (create), why not just one route like this:
   
   POST /api/{version}/cachegroup_fallbacks where the request is an array of 
one or more that looks like this:
   
   [ { cgId: 3, fbId: 6 }, { cgId: 3, fbId: 7 }, { cgId: 3, fbId: 8 }  ]
   
   ^^ insert a row for each item in the array. if it is already in the 
database, skip it.
   
   

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to