summaryrefslogtreecommitdiff
path: root/gitlab/v4/objects.py
diff options
context:
space:
mode:
authorAgustin Henze <tin@redhat.com>2019-05-29 12:44:36 +0200
committerAgustin Henze <tin@redhat.com>2019-06-10 13:04:52 +0200
commit564de484f5ef4c76261057d3d2207dc747da020b (patch)
tree0a67a70e67f376cf59437245edaf44b835d01ac2 /gitlab/v4/objects.py
parent794d64c8ef8ef0448205b51ff4a25c1589c2b2dd (diff)
downloadgitlab-564de484f5ef4c76261057d3d2207dc747da020b.tar.gz
feat: add endpoint to get the variables of a pipeline
It adds a new endpoint which was released in the Gitlab CE 11.11. Signed-off-by: Agustin Henze <tin@redhat.com>
Diffstat (limited to 'gitlab/v4/objects.py')
-rw-r--r--gitlab/v4/objects.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py
index 16a3da8..8fc7150 100644
--- a/gitlab/v4/objects.py
+++ b/gitlab/v4/objects.py
@@ -3100,8 +3100,21 @@ class ProjectPipelineJobManager(ListMixin, RESTManager):
_list_filters = ("scope",)
+class ProjectPipelineVariable(RESTObject):
+ _id_attr = "key"
+
+
+class ProjectPipelineVariableManager(ListMixin, RESTManager):
+ _path = "/projects/%(project_id)s/pipelines/%(pipeline_id)s/variables"
+ _obj_cls = ProjectPipelineVariable
+ _from_parent_attrs = {"project_id": "project_id", "pipeline_id": "id"}
+
+
class ProjectPipeline(RESTObject, RefreshMixin, ObjectDeleteMixin):
- _managers = (("jobs", "ProjectPipelineJobManager"),)
+ _managers = (
+ ("jobs", "ProjectPipelineJobManager"),
+ ("variables", "ProjectPipelineVariableManager"),
+ )
@cli.register_custom_action("ProjectPipeline")
@exc.on_http_error(exc.GitlabPipelineCancelError)