From: nmordech@redhat.com Date: Wed, 21 Feb 2024 10:01:25 +0000 (+0000) Subject: doc/mgr/restful: update max_request config X-Git-Tag: v20.0.0~1238^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=dd7e8bbde6df5efdf4706279e5f8b8281ebaee16;p=ceph.git doc/mgr/restful: update max_request config Signed-off-by: Nitzan Mordechai --- diff --git a/doc/mgr/restful.rst b/doc/mgr/restful.rst index d684399fcd835..c36f2cd0dc5f5 100644 --- a/doc/mgr/restful.rst +++ b/doc/mgr/restful.rst @@ -77,6 +77,19 @@ If the port is not configured, *restful* will bind to port ``8003``. If the address it not configured, the *restful* will bind to ``::``, which corresponds to all available IPv4 and IPv6 addresses. +Configuring max_request +--------------------------- + +The maximum request size can be configured via a central configuration +option:: + + ceph config set mgr mgr/restful/$name/max_requests $NUM + +where ``$name`` is the ID of the ceph-mgr daemon (usually the hostname). + +.. mgr_module:: restful +.. confval:: max_requests + .. _creating-an-api-user: Creating an API User diff --git a/src/pybind/mgr/restful/module.py b/src/pybind/mgr/restful/module.py index c6a69641fa050..ad76473afd061 100644 --- a/src/pybind/mgr/restful/module.py +++ b/src/pybind/mgr/restful/module.py @@ -24,7 +24,7 @@ from pecan.rest import RestController from werkzeug.serving import make_server, make_ssl_devcert from .hooks import ErrorHook -from mgr_module import MgrModule, CommandResult, NotifyType +from mgr_module import MgrModule, CommandResult, NotifyType, Option from mgr_util import build_url @@ -194,11 +194,18 @@ class CommandsRequest(object): class Module(MgrModule): MODULE_OPTIONS = [ - {'name': 'server_addr'}, - {'name': 'server_port'}, - {'name': 'key_file'}, - {'name': 'enable_auth', 'type': 'bool', 'default': True}, - {'name': 'max_requests', 'type': 'int', 'default': 500}, + Option(name='server_addr'), + Option(name='server_port'), + Option(name='key_file'), + Option(name='enable_auth', + type='bool', + default=True), + Option(name='max_requests', + type='int', + default=500, + desc='Maximum number of requests to keep in memory. ' + ' When new request comes in, the oldest request will be removed if the number of requests exceeds the max request number.' + 'if un-finished request is removed, error message will be logged in the ceph-mgr log.'), ] COMMANDS = [