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