Skip to content

Add tt console docs #3994

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/reference/tooling/tcm/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ in an instance's console.
executable for Linux platforms.

|tcm| works only with Tarantool EE clusters that use centralized configuration in
:ref:`etcd <configuration_etcd>` or a Tarantool-based storage.
:ref:`etcd <configuration_etcd>` or a Tarantool-based configuration storage.
When you create or edit a cluster's configuration in |tcm|, it publishes the saved
configuration to the storage. This ensures consistent and reliable configuration storage.
A single |tcm| installation can connect to multiple Tarantool EE clusters and
Expand Down
34 changes: 34 additions & 0 deletions doc/reference/tooling/tcm/tcm_quick_start.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
.. _tcm_quick_start

Quick start with TCM
====================

.. include:: index.rst
:start-after: ee_note_tcm_start
:end-before: ee_note_tcm_end

This guide explain how to get |tcm_full_name| up and running on your local system.

?? location: howto or TCM?

Prerequisites
-------------

- Linux
- macOS?
- SDK archive (how to obtain)

Setting up Tarantool EE
-----------------------

Preparing TCM environment
-------------------------

Starting TCM
------------

Logging in
----------

Adding a cluster ? do we need further steps?
----------------
93 changes: 83 additions & 10 deletions doc/reference/tooling/tt_cli/connect.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,56 @@ Connecting to a Tarantool instance
$ tt connect {URI|INSTANCE} [OPTION ...]


``tt connect`` connects to a Tarantool instance by its URI or name specified
during its startup (``tt start``).
``tt connect`` connects to a Tarantool instance by its URI or instance name specified
in the current environment.

Options
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's expand -u and -p descriptions a bit. Username four times in a row looks a bit weird :)

image

-------

.. option:: -u USERNAME, --username USERNAME

Username
A Tarantool user for connecting to the instance.

.. option:: -p PASSWORD, --password PASSWORD

Password
The user's password.

.. option:: -f FILEPATH, --file FILEPATH

Connect and evaluate the script from a file.

``-`` – read the script from stdin.

.. option:: -i, --interactive
Copy link
Contributor

@oleg-jukovec oleg-jukovec Jan 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a bit more tt connect flags:

      --sslcafile string      path to a trusted certificate authorities (CA) file
      --sslcertfile string    path to an SSL certificate file
      --sslciphers string     colon-separated (:) list of SSL cipher suites the connection
      --sslkeyfile string     path to a private SSL key file

Or is this not relevant to the issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, added these options and missing tt connect auth methods (URI string and env variables).


Enter the interactive mode after evaluating the script passed in ``-f``/``--file``.

.. option:: -l LANGUAGE, --language LANGUAGE

The input language of the :ref:`tt interactive console <tt-interactive-console>`:
``lua`` (default) or ``sql``.

.. option:: -x FORMAT, --outputformat FORMAT

The output format of the :ref:`tt interactive console <tt-interactive-console>`:
``yaml`` (default), ``lua``, ``table``, ``ttable``.

.. option:: --sslcertfile FILEPATH

The path to an SSL certificate file for encrypted connections.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the descriptions for --sslcafile and --sslcertfile should be swapped.


.. option:: --sslkeyfile FILEPATH

The path to a private SSL key file for encrypted connections.

.. option:: --sslcafile FILEPATH

The path to a trusted certificate authorities (CA) file for encrypted connections.

.. option:: --sslciphers STRING

The list of SSL cipher suites used for encrypted connections, separated by colons (``:``).

Details
-------

Expand All @@ -38,14 +68,57 @@ You can also connect to instances in the same ``tt`` environment
(that is, those that use the same :ref:`configuration file <tt-config_file>` and Tarantool installation)
by their instance names.

If authentication is required, specify the username and the password using the ``-u`` (``--username``)
and ``-p`` (``--password``) options.
Authentication
~~~~~~~~~~~~~~

When connecting to an instance by its URI, ``tt connect`` establishes a remote connection
for which authentication is required. Use one of the following ways to pass the
username and the password:

* The ``-u`` (``--username``) and ``-p`` (``--password``) options:

.. code-block:: console

By default, ``tt connect`` opens an interactive Tarantool console. Alternatively, you
can open a connection to evaluate a Lua script from a file or stdin. To do this,
pass the file path in the ``-f`` (``--file``) option or use ``-f -`` to take the script
from stdin.
$ tt connect 192.168.10.10:3301 -u myuser -p p4$$w0rD

* The connection string:

.. code-block:: console

$ tt connect myuser:p4$$w0rD@192.168.10.10:3301 -u myuser -p p4$$w0rD

* Environment variables ``TT_CLI_USERNAME`` and ``TT_CLI_PASSWORD`` :

.. code-block:: console

$ export TT_CLI_USERNAME=myuser
$ export TT_CLI_PASSWORD=p4$$w0rD
$ tt connect 192.168.10.10:3301

If no credentials are provided for a remote connection, the user is automatically ``guest``.

.. note::

Local connections (by instance name instead of the URI) don't require authentication.

Encrypted connection
~~~~~~~~~~~~~~~~~~~~

To connect to instances that use SSL encryption, provide the SSL certificate and
SSL key files in the ``--sslcertfile`` and ``--sslkeyfile`` options. If necessary,
add other SSL parameters -- ``--sslcafile`` and ``--sslciphers``.

Script evaluation
~~~~~~~~~~~~~~~~~

By default, ``tt connect`` opens an :ref:`interactive tt console <tt-interactive-console>`.
Alternatively, you can open a connection to evaluate a Lua script from a file or stdin.
To do this, pass the file path in the ``-f`` (``--file``) option or use ``-f -``
to take the script from stdin.

.. code-block:: console

$ tt connect app -f test.lua

Examples
--------
Expand Down
1 change: 1 addition & 0 deletions doc/reference/tooling/tt_cli/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ concept explanation, and the ``tt`` command reference.
global_options
commands
external_modules
tt_interactive_console

.. _tt-cli-environments:

Expand Down
Loading