From bdb6d63d4f7423e80e51350546698764994f08c8 Mon Sep 17 00:00:00 2001 From: Keith Wansbrough Date: Thu, 18 Jan 2018 06:13:24 +0000 Subject: Add manager for jobs within a pipeline. (#413) --- gitlab/v4/objects.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'gitlab') diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py index d7bb3d5..e4a5447 100644 --- a/gitlab/v4/objects.py +++ b/gitlab/v4/objects.py @@ -1883,6 +1883,8 @@ class ProjectFileManager(GetMixin, CreateMixin, UpdateMixin, DeleteMixin, class ProjectPipeline(RESTObject): + _managers = (('jobs', 'ProjectPipelineJobManager'), ) + @cli.register_custom_action('ProjectPipeline') @exc.on_http_error(exc.GitlabPipelineCancelError) def cancel(self, **kwargs): @@ -1940,6 +1942,16 @@ class ProjectPipelineManager(RetrieveMixin, CreateMixin, RESTManager): return CreateMixin.create(self, data, path=path, **kwargs) +class ProjectPipelineJob(ProjectJob): + pass + + +class ProjectPipelineJobManager(GetFromListMixin, RESTManager): + _path = '/projects/%(project_id)s/pipelines/%(pipeline_id)s/jobs' + _obj_cls = ProjectPipelineJob + _from_parent_attrs = {'project_id': 'project_id', 'pipeline_id': 'id'} + + class ProjectSnippetNoteAwardEmoji(ObjectDeleteMixin, RESTObject): pass -- cgit v1.2.1