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 2020/03/25 14:40:32 UTC
[GitHub] [trafficcontrol] shamrickus opened a new pull request #4538:
Deprecate steering/:ds/targets/:target
shamrickus opened a new pull request #4538: Deprecate steering/:ds/targets/:target
URL: https://github.com/apache/trafficcontrol/pull/4538
<!--
************ STOP!! ************
If this Pull Request is intended to fix a security vulnerability, DO NOT submit it! Instead, contact
the Apache Software Foundation Security Team at security@trafficcontrol.apache.org and follow the
guidelines at https://www.apache.org/security/ regarding vulnerability disclosure.
-->
## What does this PR (Pull Request) do?
<!-- Explain the changes you made here. If this fixes an Issue, identify it by
replacing the text in the checkbox item with the Issue number e.g.
- [x] This PR fixes #9001 OR is not related to any Issue
^ This will automatically close Issue number 9001 when the Pull Request is
merged (The '#' is important).
Be sure you check the box properly, see the "The following criteria are ALL
met by this PR" section for details.
-->
- [x] This PR deprecates steering/:ds/targets/:target
## Which Traffic Control components are affected by this PR?
<!-- Please delete all components from this list that are NOT affected by this
Pull Request. Also, feel free to add the name of a tool or script that is
affected but not on the list.
Additionally, if this Pull Request does NOT affect documentation, please
explain why documentation is not required. -->
- Documentation
- Traffic Ops
## What is the best way to verify this PR?
Ensure endpoint is gone in 2.0 and deprecated in 1.1
<!-- Please include here ALL the steps necessary to test your Pull Request. If
it includes tests (and most should), outline here the steps needed to run the
tests. If not, lay out the manual testing procedure and please explain why
tests are unnecessary for this Pull Request. -->
<!-- If this PR fixes a bug, please list here all of the affected versions - to
the best of your knowledge. It's also pretty helpful to include a commit hash
of where 'master' is at the time this PR is opened (if it affects master),
because what 'master' means will change over time. For example, if this PR
fixes a bug that's present in master (at commit hash '2697ebac'), in v3.0.0,
and in the current 3.0.1 Release candidate (e.g. RC1), then this list would
look like:
- master (2697ebac)
- 3.0.0
- 3.0.1 (RC1)
If you don't know what other versions might have this bug, AND don't know how
to find the commit hash of 'master', then feel free to leave this section
blank (or, preferably, delete it entirely).
-->
## The following criteria are ALL met by this PR
<!-- Check the boxes to signify that the associated statement is true. To
"check a box", replace the space inside of the square brackets with an 'x'.
e.g.
- [ x] <- Wrong
- [x ] <- Wrong
- [] <- Wrong
- [*] <- Wrong
- [x] <- Correct!
-->
- [x] This PR includes tests OR I have explained why tests are unnecessary
- [x] This PR includes documentation OR I have explained why documentation is unnecessary
- [x] This PR includes an update to CHANGELOG.md OR such an update is not necessary
- [x] This PR includes any and all required license headers
- [x] This PR ensures that database migration sequence is correct OR this PR does not include a database migration
- [x] This PR **DOES NOT FIX A SERIOUS SECURITY VULNERABILITY** (see [the Apache Software Foundation's security guidelines](https://www.apache.org/security/) for details)
## Additional Information
<!-- If you would like to include any additional information on the PR for
potential reviewers please put it here.
Some examples of this would be:
- Before and after screenshots/gifs of the Traffic Portal if it is affected
- Links to other dependent Pull Requests
- References to relevant context (e.g. new/updates to dependent libraries,
mailing list records, blueprints)
Feel free to leave this section blank (or, preferably, delete it entirely).
-->
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you 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.
-->
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [trafficcontrol] ocket8888 merged pull request #4538: Deprecate
steering/:ds/targets/:target
Posted by GitBox <gi...@apache.org>.
ocket8888 merged pull request #4538: Deprecate steering/:ds/targets/:target
URL: https://github.com/apache/trafficcontrol/pull/4538
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [trafficcontrol] shamrickus commented on a change in pull request
#4538: Deprecate steering/:ds/targets/:target
Posted by GitBox <gi...@apache.org>.
shamrickus commented on a change in pull request #4538: Deprecate steering/:ds/targets/:target
URL: https://github.com/apache/trafficcontrol/pull/4538#discussion_r398090707
##########
File path: traffic_ops/traffic_ops_golang/routing/routes.go
##########
@@ -957,7 +956,7 @@ func Routes(d ServerData) ([]Route, []RawRoute, http.Handler, error) {
{api.Version{1, 1}, http.MethodGet, `deliveryservices/{id}/health/?(\.json)?$`, deliveryservice.GetHealth, auth.PrivLevelReadOnly, Authenticated, nil, 2034590101, perlBypass},
{api.Version{1, 1}, http.MethodGet, `steering/{deliveryservice}/targets/?(\.json)?$`, api.ReadHandler(&steeringtargets.TOSteeringTargetV11{}), auth.PrivLevelReadOnly, Authenticated, nil, 1569607824, noPerlBypass},
- {api.Version{1, 1}, http.MethodGet, `steering/{deliveryservice}/targets/{target}$`, api.ReadHandler(&steeringtargets.TOSteeringTargetV11{}), auth.PrivLevelReadOnly, Authenticated, nil, 105995848, noPerlBypass},
+ {api.Version{1, 1}, http.MethodGet, `steering/{deliveryservice}/targets/{target}$`, api.DeprecatedReadHandler(&steeringtargets.TOSteeringTargetV11{}, nil), auth.PrivLevelReadOnly, Authenticated, nil, 105995848, noPerlBypass},
Review comment:
You are correct, I have updated it accordingly
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request
#4538: Deprecate steering/:ds/targets/:target
Posted by GitBox <gi...@apache.org>.
ocket8888 commented on a change in pull request #4538: Deprecate steering/:ds/targets/:target
URL: https://github.com/apache/trafficcontrol/pull/4538#discussion_r398066195
##########
File path: docs/source/api/v2/steering_id_targets_targetID.rst
##########
@@ -1,230 +0,0 @@
-..
-..
-.. 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-steering-id-targets-targetID:
-
-****************************************
-``steering/{{ID}}/targets/{{targetID}}``
-****************************************
-
-``GET``
-=======
-Get a single target for a specific STEERING-:ref:`ds-types` :term:`Delivery Service`.
-
-:Auth. Required: Yes
-:Roles Required: None
-:Response Type: Array
-
-Request Structure
------------------
-.. table:: Request Path Parameters
-
- +-----------+--------------------------------------------------------------------------------------------------------------------------------------+
- | Name | Description |
- +===========+======================================================================================================================================+
- | ID | The integral, unique identifier of a steering :term:`Delivery Service` |
- +-----------+--------------------------------------------------------------------------------------------------------------------------------------+
- | targetID | The integral, unique identifier of a :term:`Delivery Service` which is a target of the :term:`Delivery Service` identified by ``ID`` |
- +-----------+--------------------------------------------------------------------------------------------------------------------------------------+
- | orderby | Choose the ordering of the results - must be the name of one of the fields of the objects in the ``response`` array |
- +-----------+--------------------------------------------------------------------------------------------------------------------------------------+
- | sortOrder | Changes the order of sorting. Either ascending (default or "asc") or descending ("desc") |
- +-----------+--------------------------------------------------------------------------------------------------------------------------------------+
- | limit | Choose the maximum number of results to return |
- +-----------+--------------------------------------------------------------------------------------------------------------------------------------+
- | offset | The number of results to skip before beginning to return results. Must use in conjunction with limit |
- +-----------+--------------------------------------------------------------------------------------------------------------------------------------+
- | page | Return the n\ :sup:`th` page of results, where "n" is the value of this parameter, pages are ``limit`` long and the first page is 1. |
- | | If ``offset`` was defined, this query parameter has no effect. ``limit`` must be defined to make use of ``page``. |
- +-----------+--------------------------------------------------------------------------------------------------------------------------------------+
-
-.. code-block:: http
- :caption: Request Example
-
- GET /api/2.0/steering/2/targets/1 HTTP/1.1
- Host: trafficops.infra.ciab.test
- User-Agent: curl/7.47.0
- Accept: */*
- Cookie: mojolicious=...
-
-Response Structure
-------------------
-:deliveryService: A string that is the :ref:`ds-xmlid` of the steering :term:`Delivery Service`
-:deliveryServiceId: An integral, unique identifier for the steering :term:`Delivery Service`
-:target: A string that is the :ref:`ds-xmlid` of this target :term:`Delivery Service`
-:targetId: An integral, unique identifier for this target :term:`Delivery Service`
-:type: The routing type of this target :term:`Delivery Service`
-:typeId: An integral, unique identifier for the :ref:`routing type <ds-types>` of this target :term:`Delivery Service`
-:value: The 'weight' attributed to this steering target as an integer
-
-.. 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, 18 Nov 2019 17:40:54 GMT; Max-Age=3600; HttpOnly
- Whole-Content-Sha512: utlJK4oYS2l6Ff7NzAqRuQeMEtazYn3rM3Nlux2XgTLxvSyslHy0mJrwDExSU05gVMdrgYCLZrZEvPHlENT1nA==
- X-Server-Name: traffic_ops_golang/
- Date: Tue, 11 Dec 2018 14:16:53 GMT
- Content-Length: 130
-
- { "response": [
- {
- "deliveryService": "test",
- "deliveryServiceId": 2,
- "target": "demo1",
- "targetId": 1,
- "type": "HTTP",
- "typeId": 1,
- "value": 100
- }
- ]}
-
-``PUT``
-=======
-Updates a steering target.
-
-:Auth. Required: Yes
-:Roles Required: Portal, Steering, Federation, "operations" or "admin"
-:Response Type: Object
-
-Request Structure
------------------
-.. table:: Request Path Parameters
-
- +----------+--------------------------------------------------------------------------------------------------------------------------------------+
- | Name | Description |
- +==========+======================================================================================================================================+
- | ID | The integral, unique identifier of a steering :term:`Delivery Service` |
- +----------+--------------------------------------------------------------------------------------------------------------------------------------+
- | targetID | The integral, unique identifier of a :term:`Delivery Service` which is a target of the :term:`Delivery Service` identified by ``ID`` |
- +----------+--------------------------------------------------------------------------------------------------------------------------------------+
-
-:typeId: The integral, unique identifier of the :ref:`routing type <ds-types>` of the target :term:`Delivery Service`
-:value: The 'weight' which shall be attributed to the target :term:`Delivery Service`
-
-.. code-block:: http
- :caption: Request Example
-
- PUT /api/2.0/steering/2/targets/1 HTTP/1.1
- Host: trafficops.infra.ciab.test
- User-Agent: curl/7.47.0
- Accept: */*
- Cookie: mojolicious=...
- Content-Length: 26
- Content-Type: application/json
-
- {
- "value": 1,
- "typeId": 1
- }
-
-Response Structure
-------------------
-:deliveryService: A string that is the :ref:`ds-xmlid` of the steering :term:`Delivery Service`
-:deliveryServiceId: An integral, unique identifier for the steering :term:`Delivery Service`
-:target: A string that is the :ref:`ds-xmlid` of this target :term:`Delivery Service`
-:targetId: An integral, unique identifier for this target :term:`Delivery Service`
-:type: The routing type of this target :term:`Delivery Service`
-:typeId: An integral, unique identifier for the :ref:`routing type <ds-types>` of this target :term:`Delivery Service`
-:value: The 'weight' attributed to this steering target as an integer
-
-.. 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, 18 Nov 2019 17:40:54 GMT; Max-Age=3600; HttpOnly
- Whole-Content-Sha512: AfXsIRzdtU3HZYkr93qBMVTZRJ5oTF2u5sKYnd+DSqxZ+RQxY6vXtCupnnXCf9dxMt5QXRW1EFOW/FBG6lFrTg==
- X-Server-Name: traffic_ops_golang/
- Date: Tue, 11 Dec 2018 14:34:22 GMT
- Content-Length: 194
-
- { "alerts": [
- {
- "text": "steeringtarget was updated.",
- "level": "success"
- }
- ],
- "response": {
- "deliveryService": "test",
- "deliveryServiceId": 2,
- "target": "demo1",
- "targetId": 1,
- "type": "HTTP",
- "typeId": 1,
- "value": 1
- }}
-
-``DELETE``
-==========
-Removes a specific target mapping from a specific :term:`Delivery Service`
-
-:Auth. Required: Yes
-:Roles Required: Portal, Steering, Federation, "operations" or "admin"
-:Response Type: ``undefined``
-
-Request Structure
------------------
-.. table:: Request Path Parameters
-
- +----------+----------------------------------------------------------------------------------------------------------------------------------------------------+
- | Name | Description |
- +==========+====================================================================================================================================================+
- | ID | The integral, unique identifier of a steering :term:`Delivery Service` - a target of which shall be deleted |
- +----------+----------------------------------------------------------------------------------------------------------------------------------------------------+
- | targetID | The integral, unique identifier of a :term:`Delivery Service` which is a target to be removed of the :term:`Delivery Service` identified by ``ID`` |
- +----------+----------------------------------------------------------------------------------------------------------------------------------------------------+
-
-.. code-block:: http
- :caption: Request Example
-
- DELETE /api/2.0/steering/2/targets/1 HTTP/1.1
- Host: trafficops.infra.ciab.test
- User-Agent: curl/7.47.0
- Accept: */*
- Cookie: mojolicious=...
-
-Response Structure
-------------------
-.. 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, 18 Nov 2019 17:40:54 GMT; Max-Age=3600; HttpOnly
- Whole-Content-Sha512: N6h8Kl7uQveqpTc3fmKXFDY2yYe5smApNcaTow4ab0DHGFdJfqQh89I4nvvaXvmVNhxVAqX3UE/6blbO8/9Xqg==
- X-Server-Name: traffic_ops_golang/
- Date: Tue, 11 Dec 2018 14:42:54 GMT
- Content-Length: 69
-
- { "alerts": [
- {
- "text": "steeringtarget was deleted.",
- "level": "success"
- }
- ]}
Review comment:
You only deprecated the GET method, so all of this documentation should still be in there.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [trafficcontrol] mhoppa commented on a change in pull request
#4538: Deprecate steering/:ds/targets/:target
Posted by GitBox <gi...@apache.org>.
mhoppa commented on a change in pull request #4538: Deprecate steering/:ds/targets/:target
URL: https://github.com/apache/trafficcontrol/pull/4538#discussion_r398065431
##########
File path: traffic_ops/traffic_ops_golang/routing/routes.go
##########
@@ -957,7 +956,7 @@ func Routes(d ServerData) ([]Route, []RawRoute, http.Handler, error) {
{api.Version{1, 1}, http.MethodGet, `deliveryservices/{id}/health/?(\.json)?$`, deliveryservice.GetHealth, auth.PrivLevelReadOnly, Authenticated, nil, 2034590101, perlBypass},
{api.Version{1, 1}, http.MethodGet, `steering/{deliveryservice}/targets/?(\.json)?$`, api.ReadHandler(&steeringtargets.TOSteeringTargetV11{}), auth.PrivLevelReadOnly, Authenticated, nil, 1569607824, noPerlBypass},
- {api.Version{1, 1}, http.MethodGet, `steering/{deliveryservice}/targets/{target}$`, api.ReadHandler(&steeringtargets.TOSteeringTargetV11{}), auth.PrivLevelReadOnly, Authenticated, nil, 105995848, noPerlBypass},
+ {api.Version{1, 1}, http.MethodGet, `steering/{deliveryservice}/targets/{target}$`, api.DeprecatedReadHandler(&steeringtargets.TOSteeringTargetV11{}, nil), auth.PrivLevelReadOnly, Authenticated, nil, 105995848, noPerlBypass},
Review comment:
is the replacement route the base path `steering/{deliveryservice}/targets` with a query parameter of ID ?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services