#2241 hub: API docs
Merged 2 years ago by tkopecek. Opened 2 years ago by tkopecek.
tkopecek/koji issue2108  into  master

file modified
+51
@@ -4056,6 +4056,12 @@ 

  

  

  def find_build_id(X, strict=False):

+     """gets build ID for various inputs

+ 

+     :param int|str|dict X: build ID | NVR | dict with name, version and release values

+ 

+     :returns int: build ID

+     """

      if isinstance(X, six.integer_types):

          return X

      elif isinstance(X, str):
@@ -10531,6 +10537,7 @@ 

  

      def buildReferences(self, build, limit=None, lazy=False):

          return build_references(get_build(build, strict=True)['id'], limit, lazy)

+     buildReferences.__doc__ = build_references.__doc__

  

      addVolume = staticmethod(add_volume)

      removeVolume = staticmethod(remove_volume)
@@ -10561,6 +10568,19 @@ 

          return apply_volume_policy(build, strict)

  

      def createEmptyBuild(self, name, version, release, epoch, owner=None):

+         """Creates empty build entry

+ 

+         :param str name: build name

+         :param str version: build version

+         :param str release: release version

+         :param str epoch: epoch version

+         :param userInfo: a str (Kerberos principal or name) or an int (user id)

+                          or a dict:

+                              - id: User's ID

+                              - name: User's name

+                              - krb_principal: Kerberos principal

+         :return: int build ID

+         """

          context.session.assertPerm('admin')

          data = {'name': name, 'version': version, 'release': release,

                  'epoch': epoch}
@@ -11341,6 +11361,16 @@ 

          return writeInheritanceData(tag, data, clear=clear)

  

      def getFullInheritance(self, tag, event=None, reverse=False, stops=None, jumps=None):

+         """

+         :param int|str tag: tag ID | name

+         :param int event: event ID

+         :param bool reverse: return reversed tree (descendants instead of

+                              parents)

+         :param dict stops: dict of tag ids which should be ignored

+         :param dict jumps: dict of tag ids which should be skipped

+ 

+         :returns: list of node dicts

+         """

          if stops is None:

              stops = {}

          if jumps is None:
@@ -11848,6 +11878,16 @@ 

          return taginfo

  

      def getRepo(self, tag, state=None, event=None, dist=False):

+         """Get individual repository data based on tag and additional filters.

+         If more repos fits, most recent is returned.

+ 

+         :param int|str tag: tag ID or name

+         :param int state: value from koji.REPO_STATES

+         :param int event: event ID

+         :param bool dist: True = dist repo, False = regular repo

+ 

+         :returns: dict with repo data (id, state, create_event, time, dist)

+         """

          if isinstance(tag, six.integer_types):

              id = tag

          else:
@@ -12442,6 +12482,17 @@ 

              return None

  

      def setBuildOwner(self, build, user):

+         """Sets owner of a build

+ 

+         :param int|str|dict build: build ID, NVR or dict with name, version and release

+         :param user: a str (Kerberos principal or name) or an int (user id)

+                      or a dict:

+                          - id: User's ID

+                          - name: User's name

+                          - krb_principal: Kerberos principal

+ 

+         :returns: None

+         """

          context.session.assertPerm('admin')

          buildinfo = get_build(build, strict=True)

          userinfo = get_user(user, strict=True)

Metadata Update from @tkopecek:
- Pull-request tagged with: doc, no_qe

2 years ago

Commit 1c70ec1 fixes this pull-request

Pull-Request has been merged by tkopecek

2 years ago