Skip to content

Commit

Permalink
API: new method KiwiTCMS.version()
Browse files Browse the repository at this point in the history
requires the user to be logged in and will return the string version of
Kiwi TCMS.

Primarily useful for informational purposes. We're also going to use
this method in some of our performance evaluations because it doesn't
touch the DB and essentially returns a static value!
  • Loading branch information
atodorov committed Mar 25, 2021
1 parent 5d53ed2 commit 63733c2
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/source/modules/tcms.rpc.api.kiwitcms.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
tcms.rpc.api.kiwitcms module
============================

.. automodule:: tcms.rpc.api.kiwitcms
:members:
:undoc-members:
:show-inheritance:
1 change: 1 addition & 0 deletions docs/source/modules/tcms.rpc.api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Submodules
tcms.rpc.api.category
tcms.rpc.api.classification
tcms.rpc.api.component
tcms.rpc.api.kiwitcms
tcms.rpc.api.markdown
tcms.rpc.api.plantype
tcms.rpc.api.priority
Expand Down
20 changes: 20 additions & 0 deletions tcms/rpc/api/kiwitcms.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-

from modernrpc.auth.basic import http_basic_auth_login_required
from modernrpc.core import rpc_method

from tcms import __version__

__all__ = ("version",)


@http_basic_auth_login_required
@rpc_method(name="KiwiTCMS.version")
def version():
"""
.. function:: RPC KiwiTCMS.version()
:return: Current version of Kiwi TCMS installation.
:rtype: string
"""
return __version__
1 change: 1 addition & 0 deletions tcms/settings/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@
"tcms.rpc.api.classification",
"tcms.rpc.api.component",
"tcms.rpc.api.markdown",
"tcms.rpc.api.kiwitcms",
"tcms.rpc.api.plantype",
"tcms.rpc.api.priority",
"tcms.rpc.api.product",
Expand Down

0 comments on commit 63733c2

Please sign in to comment.