Skip to content

Commit 2848455

Browse files
committed
add "list pipeline jobs" handler
as described here: https://docs.gitlab.com/ee/api/jobs.html#list-pipeline-jobs example: `jobs = pipeline.jobs.list()`
1 parent 084b905 commit 2848455

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

gitlab/v4/objects.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1707,6 +1707,10 @@ def raw(self, file_path, ref, streamed=False, action=None, chunk_size=1024,
17071707

17081708

17091709
class ProjectPipeline(RESTObject):
1710+
_managers = (
1711+
('jobs', 'PipelineJobManager'),
1712+
)
1713+
17101714
@cli.register_custom_action('ProjectPipeline')
17111715
@exc.on_http_error(exc.GitlabPipelineCancelError)
17121716
def cancel(self, **kwargs):
@@ -1764,6 +1768,12 @@ def create(self, data, **kwargs):
17641768
return CreateMixin.create(self, data, path=path, **kwargs)
17651769

17661770

1771+
class PipelineJobManager(ListMixin, RESTManager):
1772+
_path = '/projects/%(project_id)s/pipelines/%(pipeline_id)s/jobs'
1773+
_obj_cls = ProjectJob
1774+
_from_parent_attrs = {'project_id': 'project_id', 'pipeline_id': 'id'}
1775+
1776+
17671777
class ProjectSnippetNote(SaveMixin, ObjectDeleteMixin, RESTObject):
17681778
pass
17691779

0 commit comments

Comments
 (0)