PR#2331: hub: document listChannels arguments

Merges #2331
https://pagure.io/koji/pull-request/2331
This commit is contained in:
Tomas Kopecek 2020-06-23 12:24:12 +02:00
commit b3049b0ebf

View file

@ -5430,8 +5430,20 @@ def get_buildroot(buildrootID, strict=False):
def list_channels(hostID=None, event=None):
"""List channels. If hostID is specified, only list
channels associated with the host with that ID."""
"""
List builder channels.
:param hostID: Koji builder host ID or hostname. If specified, Koji will
return only the channels associated with this builder host.
If unspecified, Koji will return all channels.
:type hostID: int or str
:param int event: The event ID at which to search. If unspecified, the
default behavior is to search for the "active" host
settings. You must specify a hostID parameter with this
option.
:returns: list of dicts, one per channel. For example,
[{'id': 20, 'name': 'container'}]
"""
fields = {'channels.id': 'id', 'channels.name': 'name'}
columns, aliases = zip(*fields.items())
if hostID: