Skip to content

Commit e28dbd0

Browse files
committed
Update per review: use 'v2' in info() examples
1 parent d16f367 commit e28dbd0

File tree

1 file changed

+92
-66
lines changed

1 file changed

+92
-66
lines changed

doc/reference/reference_lua/config.rst

Lines changed: 92 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ config API
108108

109109
The example below shows how to get the full instance configuration:
110110

111-
.. code-block:: console
111+
.. code-block:: tarantoolsession
112112
113113
app:instance001> require('config'):get()
114114
---
@@ -122,7 +122,7 @@ config API
122122
123123
This example shows how to get an ``iproto.listen`` option value:
124124

125-
.. code-block:: console
125+
.. code-block:: tarantoolsession
126126
127127
app:instance001> require('config'):get('iproto.listen')
128128
---
@@ -161,71 +161,97 @@ config API
161161

162162
- ``alerts`` -- warnings or errors raised on an attempt to apply the configuration
163163

164-
**Examples:**
164+
Below are a few examples demonstrating how the ``info()`` output might look.
165+
166+
**Example: no configuration errors**
167+
168+
In the example below, an instance's state is ``ready`` and no warnings are shown:
169+
170+
.. code-block:: tarantoolsession
171+
172+
app:instance001> require('config'):info('v2')
173+
---
174+
- status: ready
175+
meta:
176+
last: &0 []
177+
active: *0
178+
alerts: []
179+
...
180+
181+
**Example: configuration warnings**
182+
183+
In the example below, the instance's state is ``check_warnings``.
184+
The ``alerts`` section informs that privileges to the ``bands`` space for ``sampleuser`` cannot be granted because the ``bands`` space has not created yet:
185+
186+
.. code-block:: tarantoolsession
187+
188+
app:instance001> require('config'):info('v2')
189+
---
190+
- status: check_warnings
191+
meta:
192+
last: &0 []
193+
active: *0
194+
alerts:
195+
- type: warn
196+
message: box.schema.user.grant("sampleuser", "read,write", "space", "bands") has
197+
failed because either the object has not been created yet, a database schema
198+
upgrade has not been performed, or the privilege write has failed (separate
199+
alert reported)
200+
timestamp: 2024-07-03T18:09:18.826138+0300
201+
...
202+
203+
This warning is cleared when the ``bands`` space is created.
204+
205+
**Example: configuration errors**
206+
207+
In the example below, the instance's state is ``check_errors``.
208+
The ``alerts`` section informs that the ``log.level`` configuration option has an incorrect value:
209+
210+
.. code-block:: tarantoolsession
211+
212+
app:instance001> require('config'):info('v2')
213+
---
214+
- status: check_errors
215+
meta:
216+
last: []
217+
active: []
218+
alerts:
219+
- type: error
220+
message: '[cluster_config] log.level: Got 8, but only the following values are
221+
allowed: 0, fatal, 1, syserror, 2, error, 3, crit, 4, warn, 5, info, 6, verbose,
222+
7, debug'
223+
timestamp: 2024-07-03T18:13:19.755454+0300
224+
...
225+
226+
**Example: configuration errors (centralized configuration storage)**
227+
228+
In this example, an instance's state includes information about a :ref:`centralized storage <configuration_etcd>` the instance takes a configuration from:
229+
230+
.. code-block:: tarantoolsession
231+
232+
app:instance001> require('config'):info('v2')
233+
---
234+
- status: check_errors
235+
meta:
236+
last:
237+
etcd:
238+
mod_revision:
239+
/myapp/config/all: 5
240+
revision: 5
241+
active:
242+
etcd:
243+
mod_revision:
244+
/myapp/config/all: 2
245+
revision: 4
246+
alerts:
247+
- type: error
248+
message: 'etcd source: invalid config at key "/myapp/config/all": [cluster_config]
249+
groups.group001.replicasets.replicaset001.instances.instance001.log.level: Got
250+
8, but only the following values are allowed: 0, fatal, 1, syserror, 2, error,
251+
3, crit, 4, warn, 5, info, 6, verbose, 7, debug'
252+
timestamp: 2024-07-03T15:22:06.438275Z
253+
...
165254
166-
Below are a few examples demonstrating how the ``info()`` output might look:
167-
168-
* In the example below, an instance's state is ``ready`` and no warnings are shown:
169-
170-
.. code-block:: console
171-
172-
app:instance001> require('config'):info()
173-
---
174-
- status: ready
175-
meta: []
176-
alerts: []
177-
...
178-
179-
* In the example below, the instance's state is ``check_warnings``.
180-
The ``alerts`` section informs that privileges to the ``books`` space for ``sampleuser`` cannot be granted because the ``books`` space has not been created yet:
181-
182-
.. code-block:: console
183-
184-
app:instance001> require('config'):info()
185-
---
186-
- status: check_warnings
187-
meta: []
188-
alerts:
189-
- type: warn
190-
message: box.schema.user.grant("sampleuser", "read,write", "space", "books") has
191-
failed because either the object has not been created yet, or the privilege
192-
write has failed (separate alert reported)
193-
timestamp: 2024-02-27T15:07:41.815785+0300
194-
...
195-
196-
This warning is cleared when the ``books`` space is created.
197-
198-
* In the example below, the instance's state is ``check_errors``.
199-
The ``alerts`` section informs that the ``log.level`` configuration option has an incorrect value:
200-
201-
.. code-block:: console
202-
203-
app:instance001> require('config'):info()
204-
---
205-
- status: check_errors
206-
meta: []
207-
alerts:
208-
- type: error
209-
message: '[cluster_config] log.level: Got 8, but only the following values are
210-
allowed: 0, fatal, 1, syserror, 2, error, 3, crit, 4, warn, 5, info, 6, verbose,
211-
7, debug'
212-
timestamp: 2024-02-29T12:55:54.366810+0300
213-
...
214-
215-
* In this example, an instance's state includes information about a :ref:`centralized storage <configuration_etcd>` the instance takes a configuration from:
216-
217-
.. code-block:: console
218-
219-
app:instance001> require('config'):info()
220-
---
221-
- status: ready
222-
meta:
223-
storage:
224-
revision: 8
225-
mod_revision:
226-
/myapp/config/all: 8
227-
alerts: []
228-
...
229255
230256
.. _config_api_reference_instance_uri:
231257

0 commit comments

Comments
 (0)