Skip to content

Commit 9980524

Browse files
p7novpsergeeandreyaksenov
authored
Update tt commands descriptions to 2.1.2 (#4039)
Resolves #3999 tarantool/enterprise_doc#260 tarantool/enterprise_doc#259 Co-authored-by: Pavel Sergeev <[email protected]> Co-authored-by: Andrey Aksenov <[email protected]>
1 parent d7d55a7 commit 9980524

File tree

14 files changed

+109
-153
lines changed

14 files changed

+109
-153
lines changed

doc/reference/tooling/tt_cli/check.rst

Lines changed: 14 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5,52 +5,32 @@ Checking an application file
55

66
.. code-block:: console
77
8-
$ tt check {INSTANCE | APPLICATION[:APP_INSTANCE]}
9-
10-
``tt check`` checks the specified Tarantool application or instance for syntax errors.
11-
12-
Details
13-
-------
14-
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-
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.
8+
$ tt check {FILEPATH | APPLICATION[:APP_INSTANCE]}
209
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>`.
2113

2214
Examples
2315
--------
2416

25-
Single instance
26-
~~~~~~~~~~~~~~~
27-
28-
* Check the syntax of the ``app.lua`` file from the ``instances_enabled`` directory:
17+
To check all Lua files in an application directory at once, specify the directory name:
2918

30-
.. code-block:: console
31-
32-
$ tt check app
33-
34-
35-
* Check the syntax of the ``init.lua`` file from the ``instance1/`` directory inside ``instances_enabled``:
19+
.. code-block:: console
3620
37-
.. code-block:: console
21+
$ tt check app
3822
39-
$ tt check instance1
23+
To check a single Lua file from an application directory, add the path to this file:
4024

41-
Multiple instances
42-
~~~~~~~~~~~~~~~~~~
25+
.. code-block:: console
4326
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>`:
27+
$ tt check app/router
28+
# or
29+
$ tt check app/router.lua
4630
47-
.. code-block:: console
31+
.. note::
4832

49-
$ tt check app
33+
The ``.lua`` extension can be omitted.
5034

51-
* Check the source of the ``master`` instance of the application stored in the
52-
``app/`` directory inside ``instances_enabled``:
5335

54-
.. code-block:: console
5536

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: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Variables
108108

109109
Templates variables are replaced with their values provided upon the instantiation.
110110

111-
All templates have the ``name`` variable. Its value is taken from the ``--name`` flag.
111+
All templates have the ``name`` variable. Its value is taken from the ``--name`` option.
112112

113113
To add other variables, define them in the ``vars`` section of the template manifest.
114114
A variable can have the following attributes:
@@ -151,17 +151,17 @@ Examples:
151151

152152
Variables receive their values during the template instantiation. By default, ``tt create``
153153
asks you to provide the values interactively. You can use the ``-s`` (or ``--non-interactive``)
154-
flag to disable the interactive input. In this case, the values are searched in the following order:
154+
option to disable the interactive input. In this case, the values are searched in the following order:
155155

156-
* In the ``--var`` flag. Pass a string of the ``var=value`` format after the ``--var``
157-
flag. You can pass multiple variables, each after a separate ``--var`` flag:
156+
* In the ``--var`` option. Pass a string of the ``var=value`` format after the ``--var``
157+
option. You can pass multiple variables, each after a separate ``--var`` option:
158158

159159
.. code-block:: console
160160
161161
$ tt create template app --var user_name=admin
162162
163163
* In a file. Specify ``var=value`` pairs in a plain text file, each on a new line, and
164-
pass it as the value of the ``--vars-file`` flag:
164+
pass it as the value of the ``--vars-file`` option:
165165

166166
.. code-block:: console
167167
@@ -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

189-
To change the application location, use the ``-dst`` flag.
189+
To change the application location, use the ``-dst`` option.
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/installation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ To build ``tt`` from sources:
6060
6161
git clone https://github.com/tarantool/tt --recursive
6262
63-
3. Go to the ``tt/`` directory:
63+
3. Go to the ``tt`` directory:
6464

6565
.. code-block:: bash
6666

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]
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: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,17 @@ Restarting a Tarantool instance
55

66
.. code-block:: console
77
8-
$ tt restart {INSTANCE | APPLICATION[:APP_INSTANCE]} [OPTION ...]
8+
$ tt restart APPLICATION[:APP_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+
When called without arguments, restarts all running applications in the current environment.
15+
16+
See also: :ref:`tt-start`, :ref:`tt-stop`, :ref:`tt-status`.
17+
18+
1419
Options
1520
-------
1621

@@ -21,27 +26,22 @@ Options
2126
Examples
2227
--------
2328

24-
Single instance
25-
~~~~~~~~~~~~~~~
29+
* Restart all instances of the application stored in the ``app`` directory inside
30+
``instances_enabled`` in accordance with the :ref:`instances configuration <tt-instances>`:
2631

27-
Restart the ``app`` instance with automatic confirmation:
32+
.. code-block:: console
2833
29-
.. code-block:: console
34+
$ tt restart app
3035
31-
$ tt restart app -y
36+
.. note::
3237

33-
Multiple instances
34-
~~~~~~~~~~~~~~~~~~
38+
This call starts all application instances specified in its ``instances.yml``,
39+
even those that were not running before the call.
3540

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>`:
41+
* Restart only the ``master`` instance of the ``app`` application with automatic confirmation:
3842

3943
.. code-block:: console
4044
41-
$ tt restart app
45+
$ tt restart app:master -y
4246
43-
* Restart only the ``master`` instance of the application stored in the ``app/`` directory inside ``instances_enabled``:
44-
45-
.. code-block:: console
4647
47-
$ tt restart app:master

0 commit comments

Comments
 (0)