]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
doc/mgr/modules: should use Option class for defining options
authorKefu Chai <kchai@redhat.com>
Thu, 6 May 2021 03:57:27 +0000 (11:57 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 6 May 2021 03:57:30 +0000 (11:57 +0800)
it is the encouraged way to define options nowadays.

Signed-off-by: Kefu Chai <kchai@redhat.com>
doc/mgr/modules.rst

index 8979b4e6a537a3d18d53849f867fa367d8d617b1..4064e34114ec7281c6816d10209b0a833109207a 100644 (file)
@@ -24,7 +24,8 @@ The most important methods to override are:
 * a ``notify`` member function if your module needs to
   take action when new cluster data is available.
 * a ``handle_command`` member function if your module
-  exposes CLI commands.
+  exposes CLI commands. But this approach for exposing commands
+  is deprecated. For more details, see :ref:`mgr-module-exposing-commands`.
 
 Some modules interface with external orchestrators to deploy
 Ceph services.  These also inherit from ``Orchestrator``, which adds
@@ -100,6 +101,7 @@ following commands::
 
 
 
+.. _mgr-module-exposing-commands:
 
 Exposing commands
 -----------------
@@ -207,12 +209,10 @@ Modules can load and store configuration options using the
 You must declare your available configuration options in the
 ``MODULE_OPTIONS`` class attribute, like this:
 
-::
+.. code-block:: python
 
     MODULE_OPTIONS = [
-        {
-            "name": "my_option"
-        }
+        Option(name="my_option")
     ]
 
 If you try to use set_module_option or get_module_option on options not declared