diff --git a/doc/reference/reference_rock/vshard/vshard_router.rst b/doc/reference/reference_rock/vshard/vshard_router.rst index 0757fa18f9..7b55b3e5f0 100644 --- a/doc/reference/reference_rock/vshard/vshard_router.rst +++ b/doc/reference/reference_rock/vshard/vshard_router.rst @@ -31,6 +31,8 @@ Router API | | * :ref:`vshard.router.discovery_set() ` | | | * :ref:`vshard.router.info() ` | | | * :ref:`vshard.router.buckets_info() ` | + | | * :ref:`vshard.router.enable() ` | + | | * :ref:`vshard.router.disable() ` | | | * :ref:`replicaset_object:call() ` | | | * :ref:`replicaset_object:callro() ` | | | * :ref:`replicaset_object:callrw() ` | @@ -768,6 +770,46 @@ Router public API status: available_rw ... +.. _router_api-enable: + +.. function:: vshard.router.enable() + + Manually allow access to the router API, revert + :ref:`vshard.router.disable() `. + + .. note:: + + ``vshard.router.enable()`` cannot be used for enabling a router + API that was automatically disabled due to a running configuration + process. + +.. _router_api-disable: + +.. function:: vshard.router.disable() + + Manually restrict access to the router API. When the API is disabled, + all its methods throw a Lua error, except + :ref:`vshard.router.cfg() `, + :ref:`vshard.router.new() `, + :ref:`vshard.router.enable() ` and + :ref:`vshard.router.disable() `. + The error object's name attribute is ``ROUTER_IS_DISABLED``. + + The router is enabled by default. However, it is automatically and + forcefully disabled until the configuration is finished, as accessing the + router's methods at that time is not safe. + + Manual disabling can be used, for example, if some preparatory work needs + to be done after calling :ref:`vshard.router.cfg() ` but + before the router's methods are available. It will look like this: + + .. code-block:: lua + + vshard.router.disable() + vshard.router.cfg(...) + -- Some preparatory work here ... + vshard.router.enable() + -- vshard.router's methods are available now .. class:: replicaset_object