Skip to content
This repository was archived by the owner on Nov 24, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
74 changes: 74 additions & 0 deletions .github/workflows/traffic-ops.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,3 +202,77 @@ jobs:
path: ${{ github.workspace }}/traffic_ops/traffic_ops_golang/traffic.ops.log
- name: Save Alpine Docker image
run: .github/actions/save-alpine-tar/entrypoint.sh save ${{ env.ALPINE_VERSION }}

APIv5Tests:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest

services:
postgres:
image: postgres:13
env:
POSTGRES_USER: traffic_ops
POSTGRES_PASSWORD: twelve
POSTGRES_DB: traffic_ops
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

smtp:
image: maildev/maildev:2.0.0-beta3
ports:
- 25:25
options: >-
--entrypoint=bin/maildev
--user=root
--health-cmd="sh -c \"[[ \$(wget -qO- http://smtp/healthz) == true ]]\""
--
maildev/maildev:2.0.0-beta3
--smtp=25
--hide-extensions=STARTTLS
--web=80

steps:
- name: Checkout
uses: actions/checkout@master
- name: Cache Alpine Docker image
uses: actions/cache@v2
with:
path: ${{ github.workspace }}/docker-images
key: docker-images/alpine@${{ env.ALPINE_VERSION }}.tar.gz
- name: Import cached Alpine Docker image
run: .github/actions/save-alpine-tar/entrypoint.sh load ${{ env.ALPINE_VERSION }}
- name: Initialize Traffic Ops Database
id: todb
uses: ./.github/actions/todb-init
- name: Initialize Traffic Vault Database
id: tvdb
uses: ./.github/actions/tvdb-init
- name: Check Go Version
run: echo "::set-output name=value::$(cat GO_VERSION)"
id: go-version
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ steps.go-version.outputs.value }}
- name: Run API v5 tests
id: v5Tests
if: ${{ steps.todb.outcome == 'success' && always() }}
uses: ./.github/actions/to-integration-tests
with:
version: 5
smtp_address: 172.17.0.1
- name: Upload v5 Vault logs
if: ${{ steps.v5Tests.outcome != 'success' && always() }}
uses: actions/upload-artifact@v2
with:
name: v5 Traffic Vault logs
path: ${{ github.workspace }}/infrastructure/cdn-in-a-box/traffic.vault.logs
- name: Upload v5 Ops logs
if: ${{ steps.v5Tests.outcome != 'success' && always() }}
uses: actions/upload-artifact@v2
with:
name: v5 Traffic Ops logs
path: ${{ github.workspace }}/traffic_ops/traffic_ops_golang/traffic.ops.log
- name: Save Alpine Docker image
run: .github/actions/save-alpine-tar/entrypoint.sh save ${{ env.ALPINE_VERSION }}
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- [#2101](https://github.com/apache/trafficcontrol/issues/2101) Added the ability to tell if a Delivery Service is the target of another steering DS.
- [#6033](https://github.com/apache/trafficcontrol/issues/6033) Added ability to assign multiple server capabilities to a server.
- [#7032](https://github.com/apache/trafficcontrol/issues/7032) Add t3c-apply flag to use local ATS version for config generation rather than Server package Parameter, to allow managing the ATS OS package via external tools. See 'man t3c-apply' and 'man t3c-generate' for details.
- Traffic Ops API version 5.0

- [Traffic Monitor] Added logging for `ipv4Availability` and `ipv6Availability` in TM.
- [Traffic Ops] Added the `ASN` field in TO Server struct, which provides the ability to query servers by `ASN`.

### Changed
- Traffic Portal now obscures sensitive text in Delivery Service "Raw Remap" fields, private SSL keys, "Header Rewrite" rules, and ILO interface passwords by default.
- Traffic Router now uses Traffic Ops API 4.0 by default
- The Traffic Ops Python client now uses Traffic Ops API 4.1 by default.

### Fixed
- Traffic Stats: Reuse InfluxDB client handle to prevent potential connection leaks
Expand Down
12 changes: 11 additions & 1 deletion docs/source/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The Traffic Ops API provides programmatic access to read and write Traffic Contr

How to Read this Documentation
==============================
Each endpoint for each version is on its own page, titled with the request path. The request paths shown on each endpoint's page are - unless otherwise noted - only usable by being appended to the request path prefix ``/api/<version>/`` where ``<version>`` is the API version being requested. The API versions officially supported as of the time of this writing are 3.0, 3.1, and 4.0. All endpoints are documented as though they were being used in version 3.1 in the version 3 documentation and version 4.0 in the version 4 documentation. If an endpoint or request method of an endpoint is only available after a specific version, that will be noted next to the method or endpoint name. If changes were made to the structure of an endpoint's input or output, the version number and nature of the change will be noted.
Each endpoint for each version is on its own page, titled with the request path. The request paths shown on each endpoint's page are - unless otherwise noted - only usable by being appended to the request path prefix ``/api/<version>/`` where ``<version>`` is the API version being requested. The API versions officially supported as of the time of this writing are 3.0, 3.1, 4.0, 4.1, and 5.0. All endpoints are documented as though they were being used in version 3.1 in the version 3 documentation, version 4.1 in the version 4 documentation, and version 5.0 in the version 5 documentation. If an endpoint or request method of an endpoint is only available after a specific version, that will be noted next to the method or endpoint name. If changes were made to the structure of an endpoint's input or output, the version number and nature of the change will be noted.

Every endpoint is documented with a section for each method, containing the subsections "Request Structure" and "Response Structure" which identify all properties and structure of the Request to and Response from the endpoint. Before these subsections, three key pieces of information will be provided:

Expand Down Expand Up @@ -332,5 +332,15 @@ API routes available in version 4.

v4/*

API V5 Routes
=============
API routes available in version 5.

.. toctree::
:maxdepth: 4
:glob:

v5/*


.. [1] A cookie obtained by logging in through Traffic Portal can be used to access API endpoints under the Traffic Portal domain name - since it will proxy such requests back to Traffic Ops. This is not recommended in actual deployments, however, because it will involve an extra network connection which could be avoided by simply using the Traffic Ops domain itself.
2 changes: 1 addition & 1 deletion docs/source/api/v4/acme_accounts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
.. limitations under the License.
..

.. _to-api-acme-accounts:
.. _to-api-v4-acme-accounts:

*****************
``acme_accounts``
Expand Down
2 changes: 1 addition & 1 deletion docs/source/api/v4/acme_accounts_provider_email.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
.. limitations under the License.
..

.. _to-api-acme-accounts-provider-email:
.. _to-api-v4-acme-accounts-provider-email:

****************************************
``acme_accounts/{{provider}}/{{email}}``
Expand Down
2 changes: 1 addition & 1 deletion docs/source/api/v4/acme_accounts_providers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
.. limitations under the License.
..

.. _to-api-acme-accounts-providers:
.. _to-api-v4-acme-accounts-providers:

***************************
``acme_accounts/providers``
Expand Down
2 changes: 1 addition & 1 deletion docs/source/api/v4/acme_autorenew.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
.. limitations under the License.
..

.. _to-api-acme-autorenew:
.. _to-api-v4-acme-autorenew:

******************
``acme_autorenew``
Expand Down
2 changes: 1 addition & 1 deletion docs/source/api/v4/asns.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
..


.. _to-api-asns:
.. _to-api-v4-asns:

********
``asns``
Expand Down
2 changes: 1 addition & 1 deletion docs/source/api/v4/asns_id.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
..


.. _to-api-asns-id:
.. _to-api-v4-asns-id:

***************
``asns/{{id}}``
Expand Down
2 changes: 1 addition & 1 deletion docs/source/api/v4/async_status.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
.. limitations under the License.
..

.. _to-api-async_status:
.. _to-api-v4-async_status:

***********************
``async_status/{{id}}``
Expand Down
8 changes: 4 additions & 4 deletions docs/source/api/v4/cache_stats.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
..


.. _to-api-cache_stats:
.. _to-api-v4-cache_stats:

***************
``cache_stats``
***************
Retrieves detailed, aggregated statistics for caches in a specific CDN.

.. seealso:: This gives an aggregate of statistics for *all caches* within a particular CDN and time range. For statistics basic statistics from all caches regardless of CDN and at the current time, use :ref:`to-api-caches-stats`.
.. seealso:: This gives an aggregate of statistics for *all caches* within a particular CDN and time range. For statistics basic statistics from all caches regardless of CDN and at the current time, use :ref:`to-api-v4-caches-stats`.

``GET``
-------
Expand Down Expand Up @@ -65,7 +65,7 @@ Request Structure
| | | Epoch, or in the same, proprietary format as the ``lastUpdated`` fields prevalent throughout the Traffic Ops API |
+---------------------+-------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

.. _cache_stats-get-request-example:
.. _cache_stats-v4-get-request-example:
.. code-block:: http
:caption: Request Example

Expand All @@ -78,7 +78,7 @@ Request Structure

Content Format
""""""""""""""
It's important to note in :ref:`cache_stats-get-request-example` the use of a complex "Accept" header. This endpoint accepts two special media types in the "Accept" header that instruct it on how to format the timestamps associated with the returned data. Specifically, Traffic Ops will recognize the special, optional, non-standard parameter of :mimetype:`application/json`: ``timestamp``. The values of this parameter are restricted to one of
It's important to note in :ref:`cache_stats-v4-get-request-example` the use of a complex "Accept" header. This endpoint accepts two special media types in the "Accept" header that instruct it on how to format the timestamps associated with the returned data. Specifically, Traffic Ops will recognize the special, optional, non-standard parameter of :mimetype:`application/json`: ``timestamp``. The values of this parameter are restricted to one of

rfc
Returned timestamps will be formatted according to :rfc:`3339` (no sub-second precision).
Expand Down
4 changes: 2 additions & 2 deletions docs/source/api/v4/cachegroups.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
.. limitations under the License.
..

.. _to-api-cachegroups:
.. _to-api-v4-cachegroups:

***************
``cachegroups``
Expand Down Expand Up @@ -150,7 +150,7 @@ Request Structure
:shortName: An abbreviation of the ``name``
:typeId: An integral, unique identifier for the :ref:`Cache Group's Type <cache-group-type>`

.. note:: The actual, integral, unique identifiers for these :term:`Types` must first be obtained, generally via :ref:`to-api-types`.
.. note:: The actual, integral, unique identifiers for these :term:`Types` must first be obtained, generally via :ref:`to-api-v4-types`.

.. code-block:: http
:caption: Request Example
Expand Down
4 changes: 2 additions & 2 deletions docs/source/api/v4/cachegroups_id.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
.. limitations under the License.
..

.. _to-api-cachegroups-id:
.. _to-api-v4-cachegroups-id:

**********************
``cachegroups/{{ID}}``
Expand Down Expand Up @@ -55,7 +55,7 @@ Request Structure
:shortName: An abbreviation of the ``name``
:typeId: An integral, unique identifier for the :ref:`Cache Group's Type <cache-group-type>`

.. note:: The actual, integral, unique identifiers for these :term:`Types` must first be obtained, generally via :ref:`to-api-types`.
.. note:: The actual, integral, unique identifiers for these :term:`Types` must first be obtained, generally via :ref:`to-api-v4-types`.

.. code-block:: http
:caption: Request Example
Expand Down
3 changes: 1 addition & 2 deletions docs/source/api/v4/cachegroups_id_deliveryservices.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
.. limitations under the License.
..

.. _to-api-cachegroups-id-deliveryservices:
.. _to-api-v4-cachegroups-id-deliveryservices:

***************************************
``cachegroups/{{ID}}/deliveryservices``
Expand Down Expand Up @@ -91,4 +91,3 @@ Response Structure
2
]
}}

2 changes: 1 addition & 1 deletion docs/source/api/v4/cachegroups_id_queue_update.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
.. limitations under the License.
..

.. _to-api-cachegroups-id-queue_update:
.. _to-api-v4-cachegroups-id-queue_update:

***********************************
``cachegroups/{{ID}}/queue_update``
Expand Down
4 changes: 2 additions & 2 deletions docs/source/api/v4/caches_stats.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
..


.. _to-api-caches-stats:
.. _to-api-v4-caches-stats:

****************
``caches/stats``
****************
An API endpoint that returns cache statistics using the :ref:`tm-api`.

.. seealso:: This gives a set of basic statistics for *all* :term:`cache servers` at the current time. For statistics from time ranges and/or aggregated over a specific CDN, use :ref:`to-api-cache_stats`.
.. seealso:: This gives a set of basic statistics for *all* :term:`cache servers` at the current time. For statistics from time ranges and/or aggregated over a specific CDN, use :ref:`to-api-v4-cache_stats`.

``GET``
=======
Expand Down
2 changes: 1 addition & 1 deletion docs/source/api/v4/cdn_locks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
.. limitations under the License.
..

.. _to-api-cdn-locks:
.. _to-api-v4-cdn-locks:

*****************
``cdn_locks``
Expand Down
2 changes: 1 addition & 1 deletion docs/source/api/v4/cdn_notifications.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
..


.. _to-api-cdn-notifications:
.. _to-api-v4-cdn-notifications:

*********************
``cdn_notifications``
Expand Down
2 changes: 1 addition & 1 deletion docs/source/api/v4/cdns.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
.. limitations under the License.
..

.. _to-api-cdns:
.. _to-api-v4-cdns:

********
``cdns``
Expand Down
2 changes: 1 addition & 1 deletion docs/source/api/v4/cdns_capacity.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
.. limitations under the License.
..

.. _to-api-cdns-capacity:
.. _to-api-v4-cdns-capacity:

*****************
``cdns/capacity``
Expand Down
2 changes: 1 addition & 1 deletion docs/source/api/v4/cdns_dnsseckeys_generate.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
.. limitations under the License.
..

.. _to-api-cdns-dnsseckeys-generate:
.. _to-api-v4-cdns-dnsseckeys-generate:

****************************
``cdns/dnsseckeys/generate``
Expand Down
2 changes: 1 addition & 1 deletion docs/source/api/v4/cdns_dnsseckeys_refresh.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
.. limitations under the License.
..

.. _to-api-cdns-dnsseckeys-refresh:
.. _to-api-v4-cdns-dnsseckeys-refresh:

***************************
``cdns/dnsseckeys/refresh``
Expand Down
2 changes: 1 addition & 1 deletion docs/source/api/v4/cdns_domains.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
.. limitations under the License.
..

.. _to-api-cdns-domains:
.. _to-api-v4-cdns-domains:

****************
``cdns/domains``
Expand Down
2 changes: 1 addition & 1 deletion docs/source/api/v4/cdns_health.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
.. limitations under the License.
..

.. _to-api-cdns-health:
.. _to-api-v4-cdns-health:

***************
``cdns/health``
Expand Down
3 changes: 1 addition & 2 deletions docs/source/api/v4/cdns_id.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
.. limitations under the License.
..

.. _to-api-cdns-id:
.. _to-api-v4-cdns-id:

***************
``cdns/{{ID}}``
Expand Down Expand Up @@ -134,4 +134,3 @@ Response Structure
"level": "success"
}
]}

2 changes: 1 addition & 1 deletion docs/source/api/v4/cdns_id_queue_update.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
.. limitations under the License.
..

.. _to-api-cdns-id-queue_update:
.. _to-api-v4-cdns-id-queue_update:

****************************
``cdns/{{ID}}/queue_update``
Expand Down
2 changes: 1 addition & 1 deletion docs/source/api/v4/cdns_name_configs_monitoring.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
.. limitations under the License.
..

.. _to-api-cdns-name-configs-monitoring:
.. _to-api-v4-cdns-name-configs-monitoring:

************************************
``cdns/{{name}}/configs/monitoring``
Expand Down
Loading