Skip to content

Commit f7fbfca

Browse files
author
Gauvain Pocentek
committed
[docs] Add an example of pipeline schedule vars listing
Closes python-gitlab#595
1 parent 368a34d commit f7fbfca

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

docs/gl_objects/builds.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,13 @@ Delete a schedule::
141141

142142
sched.delete()
143143

144+
List schedule variables::
145+
146+
# note: you need to use get() to retrieve the schedule variables. The
147+
# attribute is not present in the response of a list() call
148+
sched = projects.pipelineschedules.get(schedule_id)
149+
vars = sched.attributes['variables']
150+
144151
Create a schedule variable::
145152

146153
var = sched.variables.create({'key': 'foo', 'value': 'bar'})

0 commit comments

Comments
 (0)