Assign multiple servers to a capability#7079
Conversation
4f9e38d to
8804e91
Compare
ocket8888
left a comment
There was a problem hiding this comment.
I know this would probably be a large change at this point, but why not just augment the existing /multiple_server_capabilities route to accept an array of both server IDs and Capability names instead of making a whole new endpoint?
d78f3a8 to
dbf8b36
Compare
0507ae2 to
03d684e
Compare
4d017cd to
7655d5c
Compare
7655d5c to
fe7eb89
Compare
3307a37 to
c120f87
Compare
The way new integration tests are written, one doesn't need do that. |
…outes to match the API call to this new function.
f4cc956 to
bdf32e1
Compare
38fc596 to
35f6e8e
Compare
There was a problem hiding this comment.
Manual testing looks good. I'm just mentioning this here so that we have a comment to refer to in the future. If you hit the POST endpoint with multiple server IDs and one server capability, but the pageType is set to server, it will still just associate the one server capability to just the FIRST server in that list (since the pageType is server).
Similarly, if you hit the same endpoint with multiple server capabilities and just one server ID, but with the pageType set to sc, it will assign ONLY THE FIRST server capability to the server.
The above is only applicable for users hitting the API directly, because TP adds these checks before passing in the request.
Otherwise, all many to many assignments fail as expected.
Any pageType other than server and sc fails as expected.
A blank pageType fails as expected.
I'll merge it once GHA tasks pass.
Closes: #6033
Which Traffic Control components are affected by this PR?
What is the best way to verify this PR?
Using API test the new route with a list of servers for a given server capability
Success Assignment
curl -X POST -k -H "Accept: application/json" --cookie "mojolicious=" --data @mspc.json https://localhost:port/api/4.1/multiple_servers_capabilities/
Incorrect route
curl -X POST -k -H "Accept: application/json" --cookie "mojolicious==" --data @mspc.json https://localhost:port/api/4.0/multiple_servers_capabilities
Using TP
Manage Servers(changed the name fromView Servers)If this is a bugfix, which Traffic Control versions contained the bug?
PR submission checklist