This repository was archived by the owner on Nov 24, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 356
[TO] Added a new route and logic for assigning multiple server capabilities to a server #6996
Merged
ocket8888
merged 19 commits into
apache:master
from
rimashah25:feature/multiple_server_capabilities
Aug 9, 2022
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
45a3d01
Added a new route and logic for assigning multiple server capabilitie…
rimashah25 f80cf34
Added tests for assigning multiple server capabilities to a server.
rimashah25 4a15c2f
Updated CHANGELOG.md
rimashah25 3625d53
Merge branch 'master' of github.com:apache/trafficcontrol into featur…
rimashah25 7b5366d
Updated test based on latest table driven model
rimashah25 622fba0
Added documentation for new route.
rimashah25 13f4923
Fixed spacing.
rimashah25 a3766c1
Fixed spacing.
rimashah25 18edd48
Updated based on review comments.
rimashah25 6b59823
Updated based on review comments-1.
rimashah25 f65bf2f
Added both API versions to allow client flexibility.
rimashah25 f9f9697
Updated order of API versions.
rimashah25 b0fe635
Removed `id` parameter.
rimashah25 af387f8
Updated based on another set of review comments.
rimashah25 9656a82
Merge branch 'master' of github.com:apache/trafficcontrol into featur…
rimashah25 76c9cf8
Updated test based on route change
rimashah25 8181b51
updated format.
rimashah25 9517726
Revert "updated format."
rimashah25 1398590
removed format and updated docs
rimashah25 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| .. | ||
| .. | ||
| .. Licensed under the Apache License, Version 2.0 (the "License"); | ||
| .. you may not use this file except in compliance with the License. | ||
| .. You may obtain a copy of the License at | ||
| .. | ||
| .. http://www.apache.org/licenses/LICENSE-2.0 | ||
| .. | ||
| .. Unless required by applicable law or agreed to in writing, software | ||
| .. distributed under the License is distributed on an "AS IS" BASIS, | ||
| .. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| .. See the License for the specific language governing permissions and | ||
| .. limitations under the License. | ||
| .. | ||
|
|
||
| .. _to-api-multiple_server_capabilities: | ||
|
|
||
| ******************************** | ||
| ``multiple_server_capabilities`` | ||
| ******************************** | ||
|
|
||
| .. versionadded:: 4.1 | ||
|
|
||
| ``PUT`` | ||
| ======== | ||
| Associates a list of :term:`Server Capability` to a server. The API call replaces all the server capabilities assigned to a server with the ones specified in the serverCapabilities field. | ||
|
|
||
| :Auth. Required: Yes | ||
| :Roles Required: "admin" or "operations" | ||
| :Permissions Required: SERVER:UPDATE, SERVER:READ, SERVER-CAPABILITY:READ | ||
| :Response Type: Object | ||
|
|
||
| Request Structure | ||
| ----------------- | ||
| :serverId: The integral, unique identifier of a server to be associated with a :term:`Server Capability` | ||
| :serverCapabilities: List of :term:`Server Capability`'s name to associate | ||
|
|
||
| .. code-block:: http | ||
| :caption: Request Example | ||
|
|
||
| PUT /api/4.1/multiple_server_capabilities/ HTTP/1.1 | ||
| Host: trafficops.infra.ciab.test | ||
| User-Agent: curl/7.47.0 | ||
| Accept: */* | ||
| Cookie: mojolicious=... | ||
| Content-Length: 84 | ||
| Content-Type: application/json | ||
|
|
||
| { | ||
| "serverId": 1, | ||
| "serverCapabilities": ["test", "disk"] | ||
| } | ||
|
|
||
| Response Structure | ||
| ------------------ | ||
| :serverId: The integral, unique identifier of the newly associated server | ||
| :serverCapabilities: List of :term:`Server Capability`'s name | ||
|
|
||
| .. code-block:: http | ||
| :caption: Response Example | ||
|
|
||
| HTTP/1.1 200 OK | ||
| Access-Control-Allow-Credentials: true | ||
| Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Set-Cookie, Cookie | ||
| Access-Control-Allow-Methods: POST,GET,OPTIONS,PUT,DELETE | ||
| Access-Control-Allow-Origin: * | ||
| Content-Type: application/json | ||
| Set-Cookie: mojolicious=...; Path=/; Expires=Mon, 8 Aug 2022 22:40:54 GMT; Max-Age=3600; HttpOnly | ||
| Whole-Content-Sha512: eQrl48zWids0kDpfCYmmtYMpegjnFxfOVvlBYxxLSfp7P7p6oWX4uiC+/Cfh2X9i3G+MQ36eH95gukJqOBOGbQ== | ||
| X-Server-Name: traffic_ops_golang/ | ||
| Date: Mon, 08 Aug 2022 16:15:11 GMT | ||
| Content-Length: 157 | ||
|
|
||
| { | ||
| "alerts": [{ | ||
| "text": "Multiple Server Capabilities assigned to a server", | ||
| "level": "success" | ||
| }], | ||
| "response": { | ||
| "serverId": 1, | ||
| "serverCapabilities": ["test", "disk"] | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.