add limit pagination to jobs/<id>/job_events/

* trigger via jobs/<id>/job_events/?limit=10
* Can and should be used in conjunction with an indexed set of fields to
generate efficient pagination queries. i.e.
jobs/<id>/job_events?limit=10&start_line__gte=10
* If limit is not specified in the query params then the default
pagination will be used.
This commit is contained in:
Chris Meyers
2021-05-20 13:37:04 -04:00
committed by Jim Ladd
parent 2a23b4c719
commit 321135da3d
3 changed files with 69 additions and 1 deletions

View File

@@ -172,6 +172,7 @@ from awx.api.views.root import ( # noqa
ApiV2AttachView,
)
from awx.api.views.webhooks import WebhookKeyView, GithubWebhookReceiver, GitlabWebhookReceiver # noqa
from awx.api.pagination import JobEventPagination
logger = logging.getLogger('awx.api.views')
@@ -3832,6 +3833,7 @@ class GroupJobEventsList(BaseJobEventsList):
class JobJobEventsList(BaseJobEventsList):
parent_model = models.Job
pagination_class = JobEventPagination
def get_queryset(self):
job = self.get_parent_object()