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/05/31 13:08:42 UTC

[GitHub] [trafficcontrol] zrhoffman opened a new pull request, #6869: Update Traffic Ops API v2 usage to API v4

zrhoffman opened a new pull request, #6869:
URL: https://github.com/apache/trafficcontrol/pull/6869

   <!--
   Thank you for contributing! Please be sure to read our contribution guidelines: https://github.com/apache/trafficcontrol/blob/master/CONTRIBUTING.md
   If this closes or relates to an existing issue, please reference it using one of the following:
   
   Closes: #ISSUE
   Related: #ISSUE
   
   If this PR fixes a security vulnerability, DO NOT submit! Instead, contact
   the Apache Traffic Control Security Team at security@trafficcontrol.apache.org and follow the
   guidelines at https://apache.org/security regarding vulnerability disclosure.
   -->
   
   This PR updates various usage of TO API v2 (4d82f827a0) and v1 (2effa6dcdf) usage around the project to use TO API v4.
   
   Not covered in this PR:
   * https://github.com/apache/trafficcontrol/blob/31205d568ce80a3dc8eeb18209f46814768e52f6/infrastructure/ansible/sample.lab/ansible/vars.yml#L28 (documented in #6726)
   
   * https://github.com/apache/trafficcontrol/blob/31205d568ce80a3dc8eeb18209f46814768e52f6/experimental/traffic-portal/src/environments/environment.prod.ts#L20
   <!-- **^ Add meaningful description above** --><hr/>
   
   ## Which Traffic Control components are affected by this PR?
   <!-- Please delete all components from this list that are NOT affected by this PR.
   Feel free to add the name of a tool or script that is affected but not on the list.
   -->
   - Documentation
   - Traffic Control Client (Java)<!-- Please specify which (Python, Go, or Java) -->
   - Traffic Ops (Perl TO check scripts, unit tests)
   - CDN in a Box
   - Automation (`infrastructure/docker`)<!-- Please specify which (GitHub Actions, Docker images, Ansible Roles, etc.) -->
   - Other - astats simulator, url-rewriter-nginx
   
   ## What is the best way to verify this PR?
   <!-- Please include here ALL the steps necessary to test your PR.
   If your PR has tests (and most should), provide the steps needed to run the tests.
   If not, please provide step-by-step instructions to test the PR manually and explain why your PR does not need tests. -->
   - Build the documentation
   - Run the TO unit tests
   - Verify the *CDN-in-a-Box CI* workflow passes
   - The other modified components are not used very often
   
   ## PR submission checklist
   - [x] This PR has tests <!-- If not, please delete this text and explain why this PR does not need tests. -->
   - [x] This PR has documentation <!-- If not, please delete this text and explain why this PR does not need documentation. -->
   - [ ] This PR has a CHANGELOG.md entry <!-- A fix for a bug from an ATC release, an improvement, or a new feature should have a changelog entry. -->
   - [x] This PR **DOES NOT FIX A SERIOUS SECURITY VULNERABILITY** (see [the Apache Software Foundation's security guidelines](https://apache.org/security) for details)
   
   <!--
   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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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


[GitHub] [trafficcontrol] zrhoffman commented on a diff in pull request #6869: Update Traffic Ops API v2 usage to API v4

Posted by GitBox <gi...@apache.org>.
zrhoffman commented on code in PR #6869:
URL: https://github.com/apache/trafficcontrol/pull/6869#discussion_r899161691


##########
docs/source/admin/quick_howto/ciab.rst:
##########
@@ -237,7 +237,7 @@ This section will be amended as functionality is added to the CDN in a Box proje
 
 The Enroller
 ------------
-The "enroller" began as an efficient way for Traffic Ops to be populated with data as CDN in a Box starts up. It connects to Traffic Ops as the "admin" user and processes files places in the docker volume shared between the containers. The enroller watches each directory within the ``/shared/enroller`` directory for new :file:`{filename}.json` files to be created there. These files must follow the format outlined in the API guide for the ``POST`` method for each data type,  (e.g. for a ``region``, follow the guidelines for ``POST api/2.0/regions``). Of note, the ``enroller`` does not require fields that reference database ids for other objects within the database.
+The "enroller" began as an efficient way for Traffic Ops to be populated with data as CDN in a Box starts up. It connects to Traffic Ops as the "admin" user and processes files places in the docker volume shared between the containers. The enroller watches each directory within the ``/shared/enroller`` directory for new :file:`{filename}.json` files to be created there. These files must follow the format outlined in the API guide for the ``POST`` method for each data type,  (e.g. for a ``region``, follow the guidelines for ``POST api/4.0/regions``). Of note, the ``enroller`` does not require fields that reference database ids for other objects within the database.

Review Comment:
   Linked in d43f0a3ba7



-- 
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


[GitHub] [trafficcontrol] ocket8888 commented on a diff in pull request #6869: Update Traffic Ops API v2 usage to API v4

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on code in PR #6869:
URL: https://github.com/apache/trafficcontrol/pull/6869#discussion_r886909250


##########
docs/source/admin/quick_howto/ciab.rst:
##########
@@ -254,7 +254,7 @@ The "enroller" began as an efficient way for Traffic Ops to be populated with da
 	The name of a file which will be created in the :option:`--dir` directory when given, indicating service was started (default: "enroller-started").
 
 
-The enroller runs within CDN in a Box using :option:`--dir` which provides the above behavior. It can also be run using :option:`--http` to instead have it listen on the indicated port. In this case, it accepts only ``POST`` requests with the JSON provided in the request payload, e.g. ``curl -X POST https://enroller/api/2.0/regions -d @newregion.json``. CDN in a Box does not currently use this method, but may be modified in the future to avoid using the shared volume approach.
+The enroller runs within CDN in a Box using :option:`--dir` which provides the above behavior. It can also be run using :option:`--http` to instead have it listen on the indicated port. In this case, it accepts only ``POST`` requests with the JSON provided in the request payload, e.g. ``curl -X POST https://enroller/api/4.0/regions -d @newregion.json``. CDN in a Box does not currently use this method, but may be modified in the future to avoid using the shared volume approach.

Review Comment:
   Is the enroller's "API" really versioned? I feel like we should just have it use the path segments following the API version and automagically use the latest version its client knows about.
   
   Which doesn't need to be addressed by this PR, necessarily, but I wanted to bring it up in case I forget.



##########
docs/source/admin/quick_howto/ciab.rst:
##########
@@ -237,7 +237,7 @@ This section will be amended as functionality is added to the CDN in a Box proje
 
 The Enroller
 ------------
-The "enroller" began as an efficient way for Traffic Ops to be populated with data as CDN in a Box starts up. It connects to Traffic Ops as the "admin" user and processes files places in the docker volume shared between the containers. The enroller watches each directory within the ``/shared/enroller`` directory for new :file:`{filename}.json` files to be created there. These files must follow the format outlined in the API guide for the ``POST`` method for each data type,  (e.g. for a ``region``, follow the guidelines for ``POST api/2.0/regions``). Of note, the ``enroller`` does not require fields that reference database ids for other objects within the database.
+The "enroller" began as an efficient way for Traffic Ops to be populated with data as CDN in a Box starts up. It connects to Traffic Ops as the "admin" user and processes files places in the docker volume shared between the containers. The enroller watches each directory within the ``/shared/enroller`` directory for new :file:`{filename}.json` files to be created there. These files must follow the format outlined in the API guide for the ``POST`` method for each data type,  (e.g. for a ``region``, follow the guidelines for ``POST api/4.0/regions``). Of note, the ``enroller`` does not require fields that reference database ids for other objects within the database.

Review Comment:
   Instead of stating the name and specific version of an endpoint, this should just link to the `to-api-regions` label like so:
   ```rst
   ... follow the guidelines for the ``POST`` method of the :ref:`to-api-regions` endpoint. ...
   ```
   
   ... or you could make a label on that endpoint's documentation specifically for the POST method if you want, and link that with custom link text.



-- 
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


[GitHub] [trafficcontrol] ocket8888 merged pull request #6869: Update Traffic Ops API v2 usage to API v4

Posted by GitBox <gi...@apache.org>.
ocket8888 merged PR #6869:
URL: https://github.com/apache/trafficcontrol/pull/6869


-- 
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


[GitHub] [trafficcontrol] zrhoffman commented on pull request #6869: Update Traffic Ops API v2 usage to API v4

Posted by GitBox <gi...@apache.org>.
zrhoffman commented on PR #6869:
URL: https://github.com/apache/trafficcontrol/pull/6869#issuecomment-1155403031

   > So with all that said: is there any reason to keep updating these (and they're probably still broken due to not handling API structural changes and aren't under test or relied on in any known way by any known userbase) instead of just removing them entirely?
   
   Probably not. I'll PR their removal before we remove API 3.0


-- 
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