diff --git a/doc/reference/reference_lua/box_info/config.rst b/doc/reference/reference_lua/box_info/config.rst index 0fb2df7f2..37b8efab3 100644 --- a/doc/reference/reference_lua/box_info/config.rst +++ b/doc/reference/reference_lua/box_info/config.rst @@ -13,6 +13,11 @@ box.info.config The instance's state in regard to configuration. Note that ``box.info.config`` returns the instance's state obtained using :ref:`config:info('v2') `. + Since version :doc:`3.3.0 ` returns the ``hierarchy`` table, showing names of the group, replicaset, and the instance itself. + These names are taken directly from the ``--name`` CLI option (or the ``TT_INSTANCE_NAME`` environment variable) + and the cluster configuration. This means they are always present if the YAML configuration flow is in use, + disregarding the database status (whether upgraded, writable or not). + :rtype: table **Example** @@ -26,4 +31,8 @@ box.info.config last: &0 [] active: *0 alerts: [] + hierarchy: + group: storages + replicaset: storage-a + instance: storage-a-002 ... diff --git a/doc/reference/reference_lua/box_info/info.rst b/doc/reference/reference_lua/box_info/info.rst index 48d5e882a..134e34af9 100644 --- a/doc/reference/reference_lua/box_info/info.rst +++ b/doc/reference/reference_lua/box_info/info.rst @@ -17,6 +17,11 @@ box.info() :return: keys and values in the submodule :rtype: table + Since version :doc:`3.3.0 ` returns the ``hierarchy`` table, showing names of the group, replicaset, and the instance itself. + These names are taken directly from the ``--name`` CLI option (or the ``TT_INSTANCE_NAME`` environment variable) + and the cluster configuration. This means they are always present if the YAML configuration flow is in use, + disregarding the database status (whether upgraded, writable or not). + **Example** This example is for a master-replica set that contains one master instance @@ -94,4 +99,8 @@ box.info() last: &0 [] active: *0 alerts: [] + hierarchy: + group: storages + replicaset: storage-a + instance: storage-a-002 ... diff --git a/doc/reference/reference_lua/config.rst b/doc/reference/reference_lua/config.rst index 6039e9c0c..e96b7f064 100644 --- a/doc/reference/reference_lua/config.rst +++ b/doc/reference/reference_lua/config.rst @@ -159,6 +159,13 @@ config API - ``alerts`` -- warnings or errors raised on an attempt to apply the configuration + Since version :doc:`3.3.0 ` + + - ``hierarchy`` -- table, showing names of the group, replicaset, and the instance itself. + These names are taken directly from the ``--name`` CLI option (or the ``TT_INSTANCE_NAME`` environment variable) + and the cluster configuration. This means they are always present if the YAML configuration flow is in use, + disregarding the database status (whether upgraded, writable or not). + Below are a few examples demonstrating how the ``info()`` output might look. **Example: no configuration warnings or errors** @@ -174,6 +181,10 @@ config API last: &0 [] active: *0 alerts: [] + hierarchy: + group: group-001 + replicaset: replicaset-001 + instance: instance-001 ... **Example: configuration warnings** @@ -196,6 +207,10 @@ config API upgrade has not been performed, or the privilege write has failed (separate alert reported) timestamp: 2024-07-03T18:09:18.826138+0300 + hierarchy: + group: group-001 + replicaset: replicaset-001 + instance: instance-001 ... This warning is cleared when the ``bands`` space is created. @@ -219,6 +234,10 @@ config API allowed: 0, fatal, 1, syserror, 2, error, 3, crit, 4, warn, 5, info, 6, verbose, 7, debug' timestamp: 2024-07-03T18:13:19.755454+0300 + hierarchy: + group: group-001 + replicaset: replicaset-001 + instance: instance-001 ... **Example: configuration errors (centralized configuration storage)** @@ -248,6 +267,10 @@ config API 8, but only the following values are allowed: 0, fatal, 1, syserror, 2, error, 3, crit, 4, warn, 5, info, 6, verbose, 7, debug' timestamp: 2024-07-03T15:22:06.438275Z + hierarchy: + group: group001 + replicaset: replicaset001 + instance: instance001 ...