ocket8888 opened a new pull request, #7210: URL: https://github.com/apache/trafficcontrol/pull/7210
Primarily the motivation of this PR was to support the change of the "Active" property of Delivery Services from a boolean to an enumerated constant. More generally, though, that means using APIv5 for requests that include DS representations in either the request or response body(ies). The structure of responses changed in APIv5 for certain requests - not just because of "active". POST requests, for example, used to return a `response` that was an array where the length was always one and the only element was the created DS; instead they now just return the DS without wrapping it in an array. Also, the service was returning the entire HTTP response, so I had to go track down all the places it was used. To make it easier for both me and anyone else who ever has to do anything similar, I added typings to the Delivery Service and Delivery Service Request API services. I also eliminated like half the lines of code by just using `async`/`await` instead of `.then` chains and callbacks. <hr/> ## Which Traffic Control components are affected by this PR? - Traffic Portal ## What is the best way to verify this PR? Make sure existing tests still pass, filter Delivery Services on the basis of their "Active" property, create, update, and delete DSes and DSRs ## PR submission checklist - [x] This PR uses existing tests - [x] This PR doesn't need documentation - [x] This PR doesn't need a CHANGELOG.md entry since the change to the DS structure is already in the changelog - [x] This PR **DOES NOT FIX A SERIOUS SECURITY VULNERABILITY** -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
