File tree 3 files changed +51
-0
lines changed
3 files changed +51
-0
lines changed Original file line number Diff line number Diff line change @@ -20,4 +20,5 @@ API objects manipulation
20
20
gl_objects/projects
21
21
gl_objects/runners
22
22
gl_objects/settings
23
+ gl_objects/system_hooks
23
24
gl_objects/users
Original file line number Diff line number Diff line change
1
+ # list
2
+ hooks = gl .hooks .list ()
3
+ # end list
4
+
5
+ # test
6
+ gl .hooks .get (hook_id )
7
+ # end test
8
+
9
+ # create
10
+ hook = gl .hooks .create ({'url' : 'http://your.target.url' })
11
+ # end create
12
+
13
+ # delete
14
+ gl .hooks .delete (hook_id )
15
+ # or
16
+ hook .delete ()
17
+ # end delete
Original file line number Diff line number Diff line change
1
+ ############
2
+ System hooks
3
+ ############
4
+
5
+ Use :class: `~gitlab.objects.Hook ` objects to manipulate system hooks. The
6
+ :attr: `gitlab.Gitlab.hooks ` manager object provides helper functions.
7
+
8
+ Examples
9
+ --------
10
+
11
+ List the system hooks:
12
+
13
+ .. literalinclude :: system_hooks.py
14
+ :start-after: # list
15
+ :end-before: # end list
16
+
17
+ Create a system hook:
18
+
19
+ .. literalinclude :: system_hooks.py
20
+ :start-after: # create
21
+ :end-before: # end create
22
+
23
+ Test a system hook. The returned object is not usable (it misses the hook ID):
24
+
25
+ .. literalinclude :: system_hooks.py
26
+ :start-after: # test
27
+ :end-before: # end test
28
+
29
+ Delete a system hook:
30
+
31
+ .. literalinclude :: system_hooks.py
32
+ :start-after: # delete
33
+ :end-before: # end delete
You can’t perform that action at this time.
0 commit comments