summaryrefslogtreecommitdiff
path: root/docs/gl_objects/system_hooks.rst
blob: 1d1804bb4d1081ff4b19d4c01f4b7059d18c9364 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
############
System hooks
############

Use :class:`~gitlab.objects.Hook` objects to manipulate system hooks. The
:attr:`gitlab.Gitlab.hooks` manager object provides helper functions.

Examples
--------

List the system hooks:

.. literalinclude:: system_hooks.py
   :start-after: # list
   :end-before: # end list

Create a system hook:

.. literalinclude:: system_hooks.py
   :start-after: # create
   :end-before: # end create

Test a system hook. The returned object is not usable (it misses the hook ID):

.. literalinclude:: system_hooks.py
   :start-after: # test
   :end-before: # end test

Delete a system hook:

.. literalinclude:: system_hooks.py
   :start-after: # delete
   :end-before: # end delete