Jobs API - Filter by date
Description
Right now the Jobs API is pretty limited in the queries it will accept. Every day we need to parse all jobs of the previous day to collect the CI minutes used per project. The process is very slow as we need to collect all pages of the /jobs API per project, then filter manually by date. We use AWS Lambda service for the collect which is limited to 15 minutes of execution, for some project the Lambda timeout because their is to much page to collect and we can not just set an hardcoded number of page as some project can run more than 1000+ jobs per days.
Proposal
Add a created_after and created_before (ISO 8601 format YYYY-MM-DDTHH:MM:SSZ) attribute to the query string for fetching project jobs so we could do :
curl --header "PRIVATE-TOKEN: xxxxxxxxxxxx" 'https://gitlab.example.com/api/v4/projects/1/jobs?created_before=YYYY-MM-DDTHH:MM:SSZ&created_after=YYYY-MM-DDTHH:MM:SSZ'