Skip to content

Commit c4b595b

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 c4b595b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

gitlab/v4/objects.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1707,6 +1707,9 @@ 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+
)
17101713
@cli.register_custom_action('ProjectPipeline')
17111714
@exc.on_http_error(exc.GitlabPipelineCancelError)
17121715
def cancel(self, **kwargs):
@@ -1764,6 +1767,12 @@ def create(self, data, **kwargs):
17641767
return CreateMixin.create(self, data, path=path, **kwargs)
17651768

17661769

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

0 commit comments

Comments
 (0)