Skip to content

Commit c8d3d46

Browse files
committed
Update tt commands descriptions to 2.1.2
1 parent 69b09d5 commit c8d3d46

File tree

13 files changed

+135
-149
lines changed

13 files changed

+135
-149
lines changed

doc/reference/tooling/tt_cli/check.rst

Lines changed: 21 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,52 +5,40 @@ Checking an application file
55

66
.. code-block:: console
77
8-
$ tt check {INSTANCE | APPLICATION[:APP_INSTANCE]}
8+
$ tt check {APPLICATION[:APP_INSTANCE] | SINGLE_INSTANCE}
99
10-
``tt check`` checks the specified Tarantool application or instance for syntax errors.
10+
``tt check`` checks the syntax correctness of Lua files within Tarantool applications
11+
or separate Lua scripts. The files must be stored inside the ``instances_enabled``
12+
directory specified in the :ref:`tt configuration file <tt-config_file_app>`.
1113

12-
Details
13-
-------
14+
Cluster applications
15+
--------------------
1416

15-
``tt`` searches for ``APP_FILE`` inside the ``instances_enabled`` directory
16-
specified in the :ref:`tt configuration file <tt-config_file_app>`. ``APP_FILE`` can be:
17+
To check all Lua files in an application directory at once, specify the directory name:
1718

18-
* the name of an application file without the ``.lua`` extension.
19-
* the name of a directory containing the ``init.lua`` file. In this case, ``init.lua`` is checked.
20-
21-
22-
Examples
23-
--------
24-
25-
Single instance
26-
~~~~~~~~~~~~~~~
27-
28-
* Check the syntax of the ``app.lua`` file from the ``instances_enabled`` directory:
29-
30-
.. code-block:: console
19+
.. code-block:: console
3120
32-
$ tt check app
21+
$ tt check app
3322
23+
To check a single Lua file from an application directory, add the path to this file:
3424

35-
* Check the syntax of the ``init.lua`` file from the ``instance1/`` directory inside ``instances_enabled``:
25+
.. code-block:: console
3626
37-
.. code-block:: console
27+
$ tt check app/router
28+
# or
29+
$ tt check app/router.lua
3830
39-
$ tt check instance1
31+
.. note::
4032

41-
Multiple instances
42-
~~~~~~~~~~~~~~~~~~
33+
The ``.lua`` extension can be omitted.
4334

44-
* Check all source files of the application stored in the ``app/`` directory inside
45-
``instances_enabled`` in accordance with the :ref:`instances configuration <tt-instances>`:
35+
Single instances
36+
----------------
4637

47-
.. code-block:: console
38+
To check the syntax of a single Lua file, specify the path from ``instances_enabled`` to this file:
4839

49-
$ tt check app
40+
.. code-block:: console
5041
51-
* Check the source of the ``master`` instance of the application stored in the
52-
``app/`` directory inside ``instances_enabled``:
42+
$ tt check app.lua
5343
54-
.. code-block:: console
5544
56-
$ tt check app:master

doc/reference/tooling/tt_cli/clean.rst

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@ Cleaning instance files
55

66
.. code-block:: console
77
8-
$ tt clean {INSTANCE | APPLICATION[:APP_INSTANCE]} [OPTION ...]
8+
$ tt clean {APPLICATION[:APP_INSTANCE]} [OPTION ...]
99
1010
``tt clean`` cleans stored files of Tarantool instances: logs, snapshots, and
1111
other files. To avoid accidental deletion of files, ``tt clean`` shows
1212
the files it is going to delete and asks for confirmation.
1313

14+
When called without arguments, cleans files of all applications in the current environment.
15+
16+
1417
Options
1518
-------
1619

@@ -22,18 +25,6 @@ Options
2225
Examples
2326
--------
2427

25-
Single instance
26-
~~~~~~~~~~~~~~~
27-
28-
* Clean the files of the ``app`` instance:
29-
30-
.. code-block:: console
31-
32-
$ tt clean app
33-
34-
Multiple instances
35-
~~~~~~~~~~~~~~~~~~
36-
3728
* Clean the files of all instances of the ``app`` application:
3829

3930
.. code-block:: console

doc/reference/tooling/tt_cli/connect.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Connecting to a Tarantool instance
55

66
.. code-block:: console
77
8-
$ tt connect {URI|INSTANCE} [OPTION ...]
8+
$ tt connect {URI|INSTANCE_NAME} [OPTION ...]
99
1010
1111
``tt connect`` connects to a Tarantool instance by its URI or instance name specified

doc/reference/tooling/tt_cli/create.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -176,32 +176,32 @@ flag to disable the interactive input. In this case, the values are searched in
176176
version=2
177177
178178
If a variable isn't initialized in any of these ways, the default value
179-
from the manifest will be used.
179+
from the manifest is used.
180180

181181
You can combine different ways of passing variables in a single call of ``tt create``.
182182

183183
Application directory
184184
~~~~~~~~~~~~~~~~~~~~~
185185

186-
By default, the application will appear in the directory named after the provided
186+
By default, the application appears in the directory named after the provided
187187
application name (``--name`` value).
188188

189189
To change the application location, use the ``-dst`` flag.
190190

191191
Examples
192192
--------
193193

194-
* Create the application ``app1`` from the ``simple_app`` template in the current directory:
194+
* Create the application ``app1`` from the ``simple_app`` user-defined template in the current directory:
195195

196196
.. code-block:: console
197197
198198
$ tt create simple_app --name app1
199199
200200
201-
* Create the ``app1`` application in ``/opt/tt/apps/``, set the ``user_name``
202-
variable to ``admin``, force rewrite the application directory if it already exists.
201+
* Create the ``app1`` application in ``/opt/tt/apps/`` from the built-in ``vshard_cluster`` template,
202+
force rewrite the application directory if it already exists.
203203
User interaction is disabled.
204204

205205
.. code-block:: console
206206
207-
$ tt create cartridge --name app1 --var user_name=admin -f --non-interactive -dst /opt/tt/apps/
207+
$ tt create vshard_cluster --name app1 -f --non-interactive -dst /opt/tt/apps/

doc/reference/tooling/tt_cli/export.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Exporting data
1111

1212
.. code-block:: console
1313
14-
$ tt [crud] export URI FILE SPACE [EXPORT_OPTION ...]
14+
$ tt [crud] export URI SPACE:FILE ... [EXPORT_OPTION ...]
1515
1616
``tt [crud] export`` exports a space's data to a file.
1717
The ``crud`` command is optional and can be used to export a cluster's data by using the `CRUD <https://github.com/tarantool/crud>`_ module. Without ``crud``, data is exported using the :ref:`box.space <box_space>` API.
@@ -43,7 +43,7 @@ The command below exports data of the ``customers`` space to the ``customers.csv
4343

4444
.. code-block:: console
4545
46-
$ tt crud export localhost:3301 customers.csv customers
46+
$ tt crud export localhost:3301 customers:customers.csv
4747
4848
If the ``customers`` space has five fields (``id``, ``bucket_id``, ``firstname``, ``lastname``, and ``age``), the file with exported data might look like this:
4949

@@ -70,7 +70,7 @@ To export data with a space's field names in the first row, use the ``--header``
7070

7171
.. code-block:: console
7272
73-
$ tt crud export localhost:3301 customers.csv customers \
73+
$ tt crud export localhost:3301 customers:customers.csv \
7474
--header
7575
7676
In this case, field values start from the second row, for example:
@@ -95,7 +95,7 @@ For example, the command below exports compound values serialized in JSON:
9595

9696
.. code-block:: console
9797
98-
$ tt crud export localhost:3301 customers.csv customers \
98+
$ tt crud export localhost:3301 customers:customers.csv \
9999
--compound-value-format json
100100
101101

doc/reference/tooling/tt_cli/import.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ Importing data
1111

1212
.. code-block:: console
1313
14-
$ tt [crud] import URI FILE SPACE [IMPORT_OPTION ...]
14+
$ tt [crud] import URI FILE:SPACE [IMPORT_OPTION ...]
1515
# or
16-
$ tt [crud] import URI - SPACE < FILE [IMPORT_OPTION ...]
16+
$ tt [crud] import URI :SPACE < FILE [IMPORT_OPTION ...]
1717
1818
``tt [crud] import`` imports data from a file to a space.
1919
The ``crud`` command is optional and can be used to import data to a cluster by using the `CRUD <https://github.com/tarantool/crud>`_ module. Without ``crud``, data is imported using the :ref:`box.space <box_space>` API.
@@ -62,7 +62,7 @@ If the target ``customers`` space has fields with the same names, you can import
6262

6363
.. code-block:: console
6464
65-
$ tt crud import localhost:3301 customers.csv customers \
65+
$ tt crud import localhost:3301 customers.csv:customers \
6666
--header \
6767
--match=header
6868
@@ -92,15 +92,15 @@ you can configure mapping as follows:
9292

9393
.. code-block:: console
9494
95-
$ tt crud import localhost:3301 customers.csv customers \
95+
$ tt crud import localhost:3301 customers.csv:customers \
9696
--header \
9797
--match "id=customer_id;firstname=name;lastname=surname;age=customer_age"
9898
9999
Similarly, you can configure mapping using numeric field positions in the input file:
100100

101101
.. code-block:: console
102102
103-
$ tt crud import localhost:3301 customers.csv customers \
103+
$ tt crud import localhost:3301 customers.csv:customers \
104104
--header \
105105
--match "id=1;firstname=2;lastname=3;age=4"
106106
@@ -119,7 +119,7 @@ In the example below, values already existing in the space are replaced with new
119119

120120
.. code-block:: console
121121
122-
$ tt crud import localhost:3301 customers.csv customers \
122+
$ tt crud import localhost:3301 customers.csv:customers \
123123
--on-exist replace
124124
125125
.. _tt-import-parsing-error:
@@ -131,7 +131,7 @@ To skip rows whose data cannot be parsed correctly, use the ``--on-error`` optio
131131

132132
.. code-block:: console
133133
134-
$ tt crud import localhost:3301 customers.csv customers \
134+
$ tt crud import localhost:3301 customers.csv:customers \
135135
--on-error skip
136136
137137
@@ -156,7 +156,7 @@ Options
156156

157157
.. code-block:: console
158158
159-
$ tt crud import localhost:3301 customers.csv customers \
159+
$ tt crud import localhost:3301 customers.csv:customers \
160160
--delimiter tab
161161
162162
.. NOTE::

doc/reference/tooling/tt_cli/instances.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ Listing enabled applications
77
88
$ tt instances
99
10-
``tt instances`` shows the list of enabled applications.
10+
``tt instances`` shows the list of enabled applications and their instances
11+
in the current environment.
1112

1213
.. note::
1314

@@ -19,7 +20,7 @@ Listing enabled applications
1920
Example
2021
--------
2122

22-
* Show the list of enabled applications:
23+
* Show the list of enabled applications and their instances:
2324

2425
.. code-block:: console
2526

doc/reference/tooling/tt_cli/logrotate.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Rotating instance logs
55

66
.. code-block:: console
77
8-
$ tt logrotate {INSTANCE | APPLICATION[:APP_INSTANCE]}
8+
$ tt logrotate {APPLICATION[:APP_INSTANCE] | SINGLE_INSTANCE}
99
1010
``tt logrotate`` rotates logs of a Tarantool application or specific instances,
1111
and the ``tt`` log. For example, you need to call this function to continue logging

doc/reference/tooling/tt_cli/restart.rst

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,43 +5,43 @@ Restarting a Tarantool instance
55

66
.. code-block:: console
77
8-
$ tt restart {INSTANCE | APPLICATION[:APP_INSTANCE]} [OPTION ...]
8+
$ tt restart {APPLICATION[:APP_INSTANCE] | SINGLE_INSTANCE} [OPTION ...]
99
1010
``tt restart`` restarts the specified running Tarantool instance.
1111
A ``tt restart`` call is equivalent to consecutive calls of
1212
:doc:`tt stop <stop>` and :doc:`tt start <start>`.
1313

14-
Options
15-
-------
14+
When called without arguments, restarts all running applications in the current environment.
1615

17-
.. option:: -y, --yes
16+
Cluster application
17+
-------------------
1818

19-
Automatic "Yes" to confirmation prompt.
19+
To restart all instances of the application stored in the ``app/`` directory inside
20+
``instances_enabled`` in accordance with the :ref:`instances configuration <tt-instances>`:
2021

21-
Examples
22-
--------
22+
.. code-block:: console
2323
24-
Single instance
25-
~~~~~~~~~~~~~~~
24+
$ tt restart app
2625
27-
Restart the ``app`` instance with automatic confirmation:
26+
To restart only the ``master`` instance of the application stored in the ``app/`` directory inside ``instances_enabled``:
2827

2928
.. code-block:: console
3029
31-
$ tt restart app -y
30+
$ tt restart app:master
3231
33-
Multiple instances
34-
~~~~~~~~~~~~~~~~~~
32+
Single instance
33+
---------------
3534

36-
* Restart all instances of the application stored in the ``app/`` directory inside
37-
``instances_enabled`` in accordance with the :ref:`instances configuration <tt-instances>`:
35+
Restart the ``instance1`` instance with automatic confirmation:
3836

39-
.. code-block:: console
37+
.. code-block:: console
38+
39+
$ tt restart instance1 -y
4040
41-
$ tt restart app
41+
Options
42+
-------
4243

43-
* Restart only the ``master`` instance of the application stored in the ``app/`` directory inside ``instances_enabled``:
44+
.. option:: -y, --yes
4445

45-
.. code-block:: console
46+
Automatic "Yes" to confirmation prompt.
4647

47-
$ tt restart app:master

doc/reference/tooling/tt_cli/run.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Running code in a Tarantool instance
77
88
$ tt run [SCRIPT|-e EXPR] [OPTION ...]
99
10-
``tt run`` executes Lua code in a Tarantool instance.
10+
``tt run`` executes Lua code in a new Tarantool instance.
1111

1212
Options
1313
-------

0 commit comments

Comments
 (0)