Skip to content

Commit

Permalink
doc/mgr/restful: update max_request config
Browse files Browse the repository at this point in the history
Signed-off-by: Nitzan Mordechai <[email protected]>
  • Loading branch information
NitzanMordhai committed Aug 20, 2024
1 parent 7b251ca commit dd7e8bb
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
13 changes: 13 additions & 0 deletions doc/mgr/restful.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 13 additions & 6 deletions src/pybind/mgr/restful/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
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


Expand Down Expand Up @@ -194,11 +194,18 @@ def __json__(self):

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 = [
Expand Down

0 comments on commit dd7e8bb

Please sign in to comment.