From 2848455d5a70a560e3b178f4f4b9c3898ed5eff2 Mon Sep 17 00:00:00 2001 From: Artjom Vejsel Date: Fri, 17 Nov 2017 16:17:23 +0300 Subject: [PATCH] add "list pipeline jobs" handler as described here: https://docs.gitlab.com/ee/api/jobs.html#list-pipeline-jobs example: `jobs = pipeline.jobs.list()` --- gitlab/v4/objects.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py index 85aba126e..6b9170668 100644 --- a/gitlab/v4/objects.py +++ b/gitlab/v4/objects.py @@ -1707,6 +1707,10 @@ def raw(self, file_path, ref, streamed=False, action=None, chunk_size=1024, class ProjectPipeline(RESTObject): + _managers = ( + ('jobs', 'PipelineJobManager'), + ) + @cli.register_custom_action('ProjectPipeline') @exc.on_http_error(exc.GitlabPipelineCancelError) def cancel(self, **kwargs): @@ -1764,6 +1768,12 @@ def create(self, data, **kwargs): return CreateMixin.create(self, data, path=path, **kwargs) +class PipelineJobManager(ListMixin, RESTManager): + _path = '/projects/%(project_id)s/pipelines/%(pipeline_id)s/jobs' + _obj_cls = ProjectJob + _from_parent_attrs = {'project_id': 'project_id', 'pipeline_id': 'id'} + + class ProjectSnippetNote(SaveMixin, ObjectDeleteMixin, RESTObject): pass