Skip to content

Commit

Permalink
Add support for cdn and maxRevalDurationDays qparams to GET /jobs (#6154
Browse files Browse the repository at this point in the history
)

* Add support for cdnId and maxRevalDurationDays qparams to GET /jobs

For the `GET /jobs` API, add support for the following query parameters:
- `cdn` to return jobs for delivery services in the given CDN with this
  name
- `maxRevalDurationDays` to return jobs with a start_time that is
  greater than now() - $maxRevalDurationDays (a parameter in the GLOBAL
  profile which controls how long any created invalidation job can last)

Related: #5674

* Use cdn (name) query param instead of cdnId

* Use startTime in the docs instead of start_time, log test error
  • Loading branch information
rawlinp authored Sep 2, 2021
1 parent d0a15d5 commit 9cddb11
Show file tree
Hide file tree
Showing 9 changed files with 203 additions and 53 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

## unreleased (but not 6.0)
### Added
- [#5674](https://github.com/apache/trafficcontrol/issues/5674) Added new query parameters `cdn` and `maxRevalDurationDays` to the `GET /api/x/jobs` Traffic Ops API to filter by CDN name and within the start_time window defined by the `maxRevalDurationDays` GLOBAL profile parameter, respectively.

## unreleased
### Added
- [#4982](https://github.com/apache/trafficcontrol/issues/4982) Added the ability to support queueing updates by server type and profile
Expand Down
38 changes: 21 additions & 17 deletions docs/source/api/v2/jobs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,27 @@ Request Structure
-----------------
.. table:: Request Query Parameters

+-----------------+----------+----------------------------------------------------------------------------------------------------------------------+
| Name | Required | Description |
+=================+==========+======================================================================================================================+
| assetUrl | no | Return only invalidation jobs that operate on URLs by matching this regular expression |
+-----------------+----------+----------------------------------------------------------------------------------------------------------------------+
| createdBy | no | Return only invalidation jobs that were created by the user with this username |
+-----------------+----------+----------------------------------------------------------------------------------------------------------------------+
| deliveryService | no | Return only invalidation jobs that operate on the :term:`Delivery Service` with this :ref:`ds-xmlid` |
+-----------------+----------+----------------------------------------------------------------------------------------------------------------------+
| dsId | no | Return only invalidation jobs pending on the :term:`Delivery Service` identified by this integral, unique identifier |
+-----------------+----------+----------------------------------------------------------------------------------------------------------------------+
| id | no | Return only the single invalidation job identified by this integral, unique identifer |
+-----------------+----------+----------------------------------------------------------------------------------------------------------------------+
| keyword | no | Return only invalidation jobs that have this "keyword" - only "PURGE" should exist |
+-----------------+----------+----------------------------------------------------------------------------------------------------------------------+
| userId | no | Return only invalidation jobs created by the user identified by this integral, unique identifier |
+-----------------+----------+----------------------------------------------------------------------------------------------------------------------+
+----------------------+----------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Name | Required | Description |
+======================+==========+==================================================================================================================================================================+
| assetUrl | no | Return only invalidation jobs that operate on URLs by matching this regular expression |
+----------------------+----------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| cdn | no | Return only invalidation jobs for delivery services with this CDN name |
+----------------------+----------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| createdBy | no | Return only invalidation jobs that were created by the user with this username |
+----------------------+----------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| deliveryService | no | Return only invalidation jobs that operate on the :term:`Delivery Service` with this :ref:`ds-xmlid` |
+----------------------+----------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| dsId | no | Return only invalidation jobs pending on the :term:`Delivery Service` identified by this integral, unique identifier |
+----------------------+----------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| id | no | Return only the single invalidation job identified by this integral, unique identifer |
+----------------------+----------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| keyword | no | Return only invalidation jobs that have this "keyword" - only "PURGE" should exist |
+----------------------+----------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| maxRevalDurationDays | no | Return only invalidation jobs with a startTime that is within the window defined by the ``maxRevalDurationDays`` :term:`Parameter` in :ref:`the-global-profile` |
+----------------------+----------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| userId | no | Return only invalidation jobs created by the user identified by this integral, unique identifier |
+----------------------+----------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+


.. code-block:: http
Expand Down
38 changes: 21 additions & 17 deletions docs/source/api/v3/jobs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,27 @@ Request Structure
-----------------
.. table:: Request Query Parameters

+-----------------+----------+----------------------------------------------------------------------------------------------------------------------+
| Name | Required | Description |
+=================+==========+======================================================================================================================+
| assetUrl | no | Return only invalidation jobs that operate on URLs by matching this regular expression |
+-----------------+----------+----------------------------------------------------------------------------------------------------------------------+
| createdBy | no | Return only invalidation jobs that were created by the user with this username |
+-----------------+----------+----------------------------------------------------------------------------------------------------------------------+
| deliveryService | no | Return only invalidation jobs that operate on the :term:`Delivery Service` with this :ref:`ds-xmlid` |
+-----------------+----------+----------------------------------------------------------------------------------------------------------------------+
| dsId | no | Return only invalidation jobs pending on the :term:`Delivery Service` identified by this integral, unique identifier |
+-----------------+----------+----------------------------------------------------------------------------------------------------------------------+
| id | no | Return only the single invalidation job identified by this integral, unique identifer |
+-----------------+----------+----------------------------------------------------------------------------------------------------------------------+
| keyword | no | Return only invalidation jobs that have this "keyword" - only "PURGE" should exist |
+-----------------+----------+----------------------------------------------------------------------------------------------------------------------+
| userId | no | Return only invalidation jobs created by the user identified by this integral, unique identifier |
+-----------------+----------+----------------------------------------------------------------------------------------------------------------------+
+----------------------+----------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Name | Required | Description |
+======================+==========+==================================================================================================================================================================+
| assetUrl | no | Return only invalidation jobs that operate on URLs by matching this regular expression |
+----------------------+----------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| cdn | no | Return only invalidation jobs for delivery services with this CDN name |
+----------------------+----------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| createdBy | no | Return only invalidation jobs that were created by the user with this username |
+----------------------+----------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| deliveryService | no | Return only invalidation jobs that operate on the :term:`Delivery Service` with this :ref:`ds-xmlid` |
+----------------------+----------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| dsId | no | Return only invalidation jobs pending on the :term:`Delivery Service` identified by this integral, unique identifier |
+----------------------+----------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| id | no | Return only the single invalidation job identified by this integral, unique identifer |
+----------------------+----------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| keyword | no | Return only invalidation jobs that have this "keyword" - only "PURGE" should exist |
+----------------------+----------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| maxRevalDurationDays | no | Return only invalidation jobs with a startTime that is within the window defined by the ``maxRevalDurationDays`` :term:`Parameter` in :ref:`the-global-profile` |
+----------------------+----------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| userId | no | Return only invalidation jobs created by the user identified by this integral, unique identifier |
+----------------------+----------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+


.. code-block:: http
Expand Down
Loading

0 comments on commit 9cddb11

Please sign in to comment.