]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
doc/mgr/restful: update max_request config 54984/head
authornmordech@redhat.com <nmordech@redhat.com>
Wed, 21 Feb 2024 10:01:25 +0000 (10:01 +0000)
committerNitzan Mordechai <nmordech@redhat.com>
Tue, 20 Aug 2024 10:35:49 +0000 (10:35 +0000)
Signed-off-by: Nitzan Mordechai <nmordech@redhat.com>
doc/mgr/restful.rst
src/pybind/mgr/restful/module.py

index d684399fcd835a7f9a69959844ee240332226148..c36f2cd0dc5f5e18ff2e934dc5d351ab9c253569 100644 (file)
@@ -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
index c6a69641fa050a1bcba9cc92de356a73725ea4eb..ad76473afd06161691765a89b14154a9315778d8 100644 (file)
@@ -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 = [