Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 564de48

Browse filesBrowse files
author
Agustin Henze
committed
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>
1 parent 794d64c commit 564de48
Copy full SHA for 564de48

File tree

Expand file treeCollapse file tree

2 files changed

+18
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+18
-1
lines changed
Open diff view settings
Collapse file

‎docs/gl_objects/builds.rst‎

Copy file name to clipboardExpand all lines: docs/gl_objects/builds.rst
+4Lines changed: 4 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ Get a pipeline for a project::
2929

3030
pipeline = project.pipelines.get(pipeline_id)
3131

32+
Get variables of a pipeline::
33+
34+
variables = pipeline.variables.list()
35+
3236
Create a pipeline for a particular reference::
3337

3438
pipeline = project.pipelines.create({'ref': 'master'})
Collapse file

‎gitlab/v4/objects.py‎

Copy file name to clipboardExpand all lines: gitlab/v4/objects.py
+14-1Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3100,8 +3100,21 @@ class ProjectPipelineJobManager(ListMixin, RESTManager):
31003100
_list_filters = ("scope",)
31013101

31023102

3103+
class ProjectPipelineVariable(RESTObject):
3104+
_id_attr = "key"
3105+
3106+
3107+
class ProjectPipelineVariableManager(ListMixin, RESTManager):
3108+
_path = "/projects/%(project_id)s/pipelines/%(pipeline_id)s/variables"
3109+
_obj_cls = ProjectPipelineVariable
3110+
_from_parent_attrs = {"project_id": "project_id", "pipeline_id": "id"}
3111+
3112+
31033113
class ProjectPipeline(RESTObject, RefreshMixin, ObjectDeleteMixin):
3104-
_managers = (("jobs", "ProjectPipelineJobManager"),)
3114+
_managers = (
3115+
("jobs", "ProjectPipelineJobManager"),
3116+
("variables", "ProjectPipelineVariableManager"),
3117+
)
31053118

31063119
@cli.register_custom_action("ProjectPipeline")
31073120
@exc.on_http_error(exc.GitlabPipelineCancelError)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.