Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add query parameter option to Traffic Ops GET /jobs API to return only jobs created during maxRevalDurationDays window #5674

Closed
rawlinp opened this issue Mar 24, 2021 · 0 comments · Fixed by #6186
Assignees
Labels
cache-config Cache config generation improvement The functionality exists but it could be improved in some way. Traffic Ops related to Traffic Ops

Comments

@rawlinp
Copy link
Contributor

rawlinp commented Mar 24, 2021

I'm submitting a ...

  • improvement request (usability, performance, tech debt, etc.)

Traffic Control components affected ...

  • Traffic Ops
  • Traffic Ops ORT

Current behavior:

The Traffic Ops GET /api/x/jobs API currently returns all invalidation jobs ever created. For applications like ORT that really only need to get unexpired invalidation jobs, this is very inefficient.

New behavior:

Provide a query parameter option to return only invalidation jobs created within the maxRevalDurationDays window. Update ORT to use the new query parameter option. For performance reasons, we might want to add a DB index on the start_time column w/ DESC NULLS LAST, similar to the last_updated index.

Minimal reproduction of the problem with instructions:

Request the TO GET /api/x/jobs route, observe that every job ever created is returned.

@rawlinp rawlinp added Traffic Ops related to Traffic Ops Traffic Ops ORT *DEPRECATED* related to the traffic_ops_ort.pl script improvement The functionality exists but it could be improved in some way. labels Mar 24, 2021
@mitchell852 mitchell852 added cache-config Cache config generation and removed Traffic Ops ORT *DEPRECATED* related to the traffic_ops_ort.pl script labels Jun 3, 2021
@rawlinp rawlinp self-assigned this Sep 1, 2021
rawlinp added a commit to rawlinp/trafficcontrol that referenced this issue Sep 1, 2021
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: apache#5674
ocket8888 pushed a commit that referenced this issue Sep 2, 2021
)

* 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
rawlinp added a commit to rawlinp/trafficcontrol that referenced this issue Sep 9, 2021
Use the new query parameters supported by Traffic Ops to reduce the
amount of unnecessary data requested from the /deliveryserviceserver and
/jobs APIs.

Closes: apache#5674
Closes: apache#6034
ocket8888 pushed a commit that referenced this issue Sep 10, 2021
Use the new query parameters supported by Traffic Ops to reduce the
amount of unnecessary data requested from the /deliveryserviceserver and
/jobs APIs.

Closes: #5674
Closes: #6034
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cache-config Cache config generation improvement The functionality exists but it could be improved in some way. Traffic Ops related to Traffic Ops
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants