summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Zirka <you@example.com>2020-10-07 20:36:00 +0300
committerAlex Zirka <you@example.com>2020-10-07 20:36:00 +0300
commit05cbdc224007e9dda10fc2f6f7d63c82cf36dec0 (patch)
tree2bcca29542f77200419b62d63661ec61c022b646
parent40ec2f528b885290fbb3e2d7ef0f5f8615219326 (diff)
downloadgitlab-05cbdc224007e9dda10fc2f6f7d63c82cf36dec0.tar.gz
feat: added support for pipeline bridges
-rw-r--r--docs/gl_objects/pipelines_and_jobs.rst24
-rw-r--r--gitlab/v4/objects/__init__.py12
2 files changed, 36 insertions, 0 deletions
diff --git a/docs/gl_objects/pipelines_and_jobs.rst b/docs/gl_objects/pipelines_and_jobs.rst
index cc4db53..0a3ddb1 100644
--- a/docs/gl_objects/pipelines_and_jobs.rst
+++ b/docs/gl_objects/pipelines_and_jobs.rst
@@ -302,3 +302,27 @@ Play (trigger) a job::
Erase a job (artifacts and trace)::
build_or_job.erase()
+
+
+Pipeline bridges
+=====================
+
+Get a list of bridge jobs (including child pipelines) for a pipeline.
+
+Reference
+---------
+
+* v4 API
+
+ + :class:`gitlab.v4.objects.ProjectPipelineBridge`
+ + :class:`gitlab.v4.objects.ProjectPipelineBridgeManager`
+ + :attr:`gitlab.v4.objects.ProjectPipeline.bridges`
+
+* GitLab API: https://docs.gitlab.com/ee/api/jobs.html#list-pipeline-bridges
+
+Examples
+--------
+
+List bridges for the pipeline::
+
+ bridges = pipeline.bridges.list()
diff --git a/gitlab/v4/objects/__init__.py b/gitlab/v4/objects/__init__.py
index 016caec..3e2ccb2 100644
--- a/gitlab/v4/objects/__init__.py
+++ b/gitlab/v4/objects/__init__.py
@@ -3778,6 +3778,17 @@ class ProjectPipelineJobManager(ListMixin, RESTManager):
_list_filters = ("scope",)
+class ProjectPipelineBridge(RESTObject):
+ pass
+
+
+class ProjectPipelineBridgeManager(ListMixin, RESTManager):
+ _path = "/projects/%(project_id)s/pipelines/%(pipeline_id)s/bridges"
+ _obj_cls = ProjectPipelineBridge
+ _from_parent_attrs = {"project_id": "project_id", "pipeline_id": "id"}
+ _list_filters = ("scope",)
+
+
class ProjectPipelineVariable(RESTObject):
_id_attr = "key"
@@ -3791,6 +3802,7 @@ class ProjectPipelineVariableManager(ListMixin, RESTManager):
class ProjectPipeline(RESTObject, RefreshMixin, ObjectDeleteMixin):
_managers = (
("jobs", "ProjectPipelineJobManager"),
+ ("bridges", "ProjectPipelineBridgeManager"),
("variables", "ProjectPipelineVariableManager"),
)