You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2022/10/11 19:38:11 UTC

[GitHub] [trafficcontrol] ocket8888 commented on a diff in pull request #7079: Assign multiple servers to a capability

ocket8888 commented on code in PR #7079:
URL: https://github.com/apache/trafficcontrol/pull/7079#discussion_r987141091


##########
docs/source/glossary.rst:
##########
@@ -414,6 +414,10 @@ Glossary
 
 		.. seealso:: For a more complete description of Roles, see the :ref:`roles` overview section.
 
+	Server
+	Servers
+		A :dfn:`Server` implies a :dfn:`cache servers` and/or :dfn:`origin servers` associated with a :dfn:`Delivery Service`.

Review Comment:
   This isn't true, a server could also be a Traffic Monitor, Traffic Ops, Traffic Router, or any other kind of server you could think up.



##########
docs/source/api/v4/multiple_servers_capabilities.rst:
##########
@@ -0,0 +1,187 @@
+..
+..
+.. 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-v4-multiple_servers_capabilities:
+
+*********************************
+``multiple_servers_capabilities``
+*********************************
+
+.. versionadded:: 4.1
+
+``POST``
+========
+Inserts a list of :term:`Server Capability` associated to a server and vice versa i.e insert a list of :term:`Server` associated to a server capability.

Review Comment:
   these terms should be plural; `Server Capabilities` and `Servers`, based on their usage



##########
docs/source/glossary.rst:
##########
@@ -414,6 +414,10 @@ Glossary
 
 		.. seealso:: For a more complete description of Roles, see the :ref:`roles` overview section.
 
+	Server
+	Servers
+		A :dfn:`Server` implies a :dfn:`cache servers` and/or :dfn:`origin servers` associated with a :dfn:`Delivery Service`.

Review Comment:
   Also, the `dfn` role is for the "defining instance" of a term. The first one you have on `Server` is appropriate, the rest should probably be `term`s



##########
docs/source/api/v5/multiple_servers_capabilities.rst:
##########
@@ -0,0 +1,185 @@
+..
+..
+.. 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_servers_capabilities:
+
+*********************************
+``multiple_servers_capabilities``
+*********************************
+
+``POST``
+========
+Inserts a list of :term:`Server Capability` associated to a server and vice versa i.e insert a list of :term:`Server` associated to a server capability.

Review Comment:
   Same as above



##########
docs/source/api/v5/multiple_servers_capabilities.rst:
##########
@@ -0,0 +1,123 @@
+..
+..
+.. 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_servers_capabilities:
+
+*********************************
+``multiple_servers_capabilities``
+*********************************
+
+``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.
+And also Associates a list of :term:`Servers` to a server capability. The API call replaces all the servers assigned to a server capability with the ones specified in the servers field.
+
+:Auth. Required: Yes
+:Roles Required: "admin" or "operations"
+:Permissions Required: SERVER:READ, SERVER:UPDATE, SERVER-CAPABILITY:READ, SERVER-CAPABILITY:UPDATE
+:Response Type:  Object
+
+Request Structure
+-----------------
+:serverIds:          List of :term:`Server` ids ((integral, unique identifier) associated with a :term:`Server Capability`
+:serverCapabilities: List of :term:`Server Capability`'s name to associate with a :term:`Server` id
+
+.. code-block:: http
+	:caption: Request Example1
+
+	PUT /api/5.0/multiple_servers_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
+
+	{
+		"serverIds": [1],
+		"serverCapabilities": ["test", "disk"]
+	}
+
+.. code-block:: http
+	:caption: Request Example2
+
+	PUT /api/5.0/multiple_servers_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
+
+	{
+		"serverIds": [2, 3]
+		"serverCapabilities": ["eas"],
+	}
+
+Response Structure
+------------------
+:serverId:           List of :term:`Server` ids ((integral, unique identifier) associated with a server capability.
+:serverCapabilities: List of :term:`Server Capability`'s name to be associated with a :term:`Server` id.
+
+.. code-block:: http
+	:caption: Response Example1
+
+	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": {
+			"serverIds": [1],
+			"serverCapabilities": ["test", "disk"]
+		}
+	}
+
+.. code-block:: http
+	:caption: Response Example2
+
+	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
+	{

Review Comment:
   needs a blank line between the HTTP headers and body; highlighting is broken otherwise



-- 
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: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org