New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assign multiple servers to a capability #7079
Assign multiple servers to a capability #7079
Conversation
4f9e38d
to
8804e91
Compare
traffic_ops/traffic_ops_golang/server/servers_server_capability.go
Outdated
Show resolved
Hide resolved
traffic_ops/traffic_ops_golang/server/servers_server_capability.go
Outdated
Show resolved
Hide resolved
traffic_ops/traffic_ops_golang/server/servers_server_capability.go
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
...p/src/common/modules/table/serverCapabilityServers/TableServerCapabilityServersController.js
Outdated
Show resolved
Hide resolved
...p/src/common/modules/table/serverCapabilityServers/table.assignServersPerCapability.tpl.html
Outdated
Show resolved
Hide resolved
.../app/src/common/modules/table/serverCapabilityServers/table.serverCapabilityServers.tpl.html
Outdated
Show resolved
Hide resolved
d78f3a8
to
dbf8b36
Compare
0507ae2
to
03d684e
Compare
4d017cd
to
7655d5c
Compare
7655d5c
to
fe7eb89
Compare
traffic_ops/traffic_ops_golang/server/servers_server_capability.go
Outdated
Show resolved
Hide resolved
traffic_ops/traffic_ops_golang/server/servers_server_capability.go
Outdated
Show resolved
Hide resolved
traffic_ops/traffic_ops_golang/server/servers_server_capability.go
Outdated
Show resolved
Hide resolved
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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