File: messages.rst

package info (click to toggle)
python-gitlab 1%3A4.9.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,048 kB
  • sloc: python: 24,168; makefile: 171; ruby: 27; javascript: 3
file content (48 lines) | stat: -rw-r--r-- 988 bytes parent folder | download | duplicates (4)
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
##################
Broadcast messages
##################

You can use broadcast messages to display information on all pages of the
gitlab web UI. You must have administration permissions to manipulate broadcast
messages.

References
----------

* v4 API:

  + :class:`gitlab.v4.objects.BroadcastMessage`
  + :class:`gitlab.v4.objects.BroadcastMessageManager`
  + :attr:`gitlab.Gitlab.broadcastmessages`

* GitLab API: https://docs.gitlab.com/ce/api/broadcast_messages.html

Examples
--------

List the messages::

    msgs = gl.broadcastmessages.list()

Get a single message::

    msg = gl.broadcastmessages.get(msg_id)

Create a message::

    msg = gl.broadcastmessages.create({'message': 'Important information'})

The date format for the ``starts_at`` and ``ends_at`` parameters is
``YYYY-MM-ddThh:mm:ssZ``.

Update a message::

    msg.font = '#444444'
    msg.color = '#999999'
    msg.save()

Delete a message::

    gl.broadcastmessages.delete(msg_id)
    # or
    msg.delete()