<a id="symp-cli-client"></a>

# Symp CLI Client

## Overview

The Zadara zCompute Symp client is a unified CLI (Command Line Interface) to
manage and operate your zCompute services.

The zCompute Symp CLI tools should be installed on a VM image that is created
from the zCompute Toolbox image, available in the zCompute cluster’s Machine
Images Marketplace.

To install the zCompute Symp CLI tools, the VM should be configured to be
accessible externally via ssh.

## Installing the Symp CLI client

The Symp CLI client is supplied as part of the zCompute Toolbox.

1. In the zCompute UI, go to **Machine Images > Marketplace**.
   If there are more than one zCompute Toolbox image, use the latest
   image.
2. In the Zadara apps list, click the **zCompute Toolbox** icon.

   In the dialog box that opens:

   Click **Download**.
3. Create a VM instance:
   1. Go to **Compute > Instances > Create**.
      1. Enter the **Compute** parameters:
         - **Name**: A name for the VM.
         - **Create from**: Select `Image`.
         - **Image**: Select the zcompute-toolbox image downloaded in the
           previous step.
         - **Instance type**: Search and select a suitable instance type.
         - **Key Pair**: Select the key pair to sign-in to the VM over ssh.
           If no key pair exists for the user, create one using the `+`
           sign and follow the instructions to save the private key file.
         - Click **Next**.
      2. Enter the **Storage** parameters:
         * **Boot Volume** - disk size (GB) and volume type that will be used for
           the boot volume of the VM instance.
         * **Data Volumes** - add new or existing data volumes. To add a
           new volume, click **Add** and **+** and configure the following:
           * **Name** -  volume name.
           * **Description** - description of volume.
           * **Volume Type** - select the volume type from the dropdown list.
           * **Size** - volume size (GB).
           * **Protection Group** - protection group for the volume.
         * Click **Next**.
      3. Enter the **Networking** tab parameters according to
         the specific environment, and click **Finish**.
         The VM instance will start.
4. When the VM instance is ready:
   1. Launch the VM in the target project, if it wasn’t started yet:
      1. In the zCompute UI, go to **Compute > Instances**.
      2. Select the VM, and click **Start**.
   2. If the Security Group settings are not yet configured to permit ssh
      access to the VM:
      1. Go to **VPC Networking > Security Groups** and select the
         Security Group for the account and project.
      2. On the top toolbar, click **Modify**.
      3. In the **Modify Security Group** dialog, click **Add** to
         add any required entries to permit ssh access.
      4. Click **OK**.
   3. Configure an Elastic IP address for the VM:
      1. Go to **Compute > Instances**, and select the VM instance.
      2. On the top toolbar, select **More > Attach > Elastic IP**.
      3. In the **Attach Elastic IP** dialog, allocate an IP address.
      4. In **Compute > Instances**, click the VM instance’s
         link in the **Name** column.
      5. In the VM’s **Subnets** section, note its Elastic IP address,
         or copy it to the clipboard.
   4. Connect to the VM instance via `ssh`, as the user `fedora`:
      ```console
      ssh -i <private-key pem path/filename> fedora@<Elastic IP address>
      ```

      The VM displays the Zadara Toolbox welcome message:
      ```console
       _____         _                   _____           _ _
      |__  /__ _  __| | __ _ _ __ __ _  |_   _|__   ___ | | |__   _____  __
        / // _` |/ _` |/ _` | '__/ _` |   | |/ _ \ / _ \| | '_ \ / _ \ \/ /
       / /| (_| | (_| | (_| | | | (_| |   | | (_) | (_) | | |_) | (_) >  <
      /____\__,_|\__,_|\__,_|_|  \__,_|   |_|\___/ \___/|_|_.__/ \___/_/\_\

      Welcome to Zadara Toolbox VM!
      ```
5. Install Symp on the VM by running the following command:

   `symp-update -c <Cluster IP> -k`
6. Verify that the Symp installation was successful by running a `symp`
   command.
   ```console
   symp -k --url https://<cluster IP address> -d <account> -u <username> --project <projectname>
   ```

   Symp will prompt for the user’s password.

   For example:
   ```console
   symp -k --url https://10.11.12.13 -d cloud_member -u member1 --project vpc_proj1

   Starting new HTTPS connection (1): 10.11.12.13
   Password:

    d88888b  dP    dP 8888ba.88ba   888888ba  dP     dP   .88888.  888888ba  dP    dP
   88.    "' Y8.  .8P 88  `8b  `8b  88    `8b 88     88  d8'   `8b 88    `8b Y8.  .8P
   `Y88888b.  Y8aa8P  88   88   88 a88aaaa8P' 88aaaaa88a 88     88 88     88  Y8aa8P
         `8b    88    88   88   88  88        88     88  88     88 88     88    88
   d8'   .8P    88    88   88   88  88        88     88  Y8.   .8P 88     88    88
    Y88888P     dP    dP   dP   dP  dP        dP     dP   `8888P'  dP     dP    dP

   Tap <TAB> twice to get list of available commands.
   Type --help to get help with any command
   Symphony @ cloud_member/vpc_proj1 >
   ```

## Adaptive-Table Output Format Modifiers

The Adaptive-Table Output Format is Symp’s CLI default output format.

It is sensitive to the terminal width and supports hierarchical data
structures and the filtering of rows and columns.

### Usage

```console
$ symp command [argument [argument...]] [--flag] [-m modifier [modifier...]]
```

### Filter Modifiers

By default, symp displays all rows and columns.

To restrict the output to a select population of rows, columns, or both,
apply filter modifiers to the symp command.

| Filter Modifier              | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
|------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `grep`                       | **Usage**: `-m grep=pattern`<br/><br/>Displays only those rows containing a value that matches the pattern.<br/><br/>The matching value is **case-sensitive**.<br/><br/>The pattern can be any regular expression.<br/><br/>For example:<br/><br/>* `grep=name` - Displays only those rows containing a value that matches ‘name’.<br/>* `grep=name|number` - Displays only those rows containing a value that matches either ‘name’ or ‘number’.<br/>* `'grep=name grep=number'` - Displays only those rows containing both one value that matches ‘name’ and another value that matches ‘number’.<br/><br/>**Note**: The values are searched recursively.  |
| `grep-i`                     | **Usage**: `-m grep-i=pattern`<br/><br/>Same as `grep`, but the matching value is **case-insensitive**.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `grep-v`                     | **Usage**: `-m grep-v=pattern`<br/><br/>Displays all rows **except** those containing any values that match the pattern.<br/><br/>The matching value is **case-sensitive**.<br/><br/>The pattern can be any regular expression.<br/><br/>For example:<br/><br/>* `grep-v=name` - Displays all rows **except** those that contain a value that matches ‘name’.<br/>* `grep-v=name|number` - Displays all rows **except** those that contain a value that matches either ‘name’ or ‘number’.<br/>* `'grep-v=name grep-v=number'` - Displays all rows **except** those that contain both one value that matches ‘name’ and another value that matches ‘number’. |
| `grep-iv`<br/><br/>`grep-vi` | **Usage**: `-m grep-iv=pattern` or `-m grep-vi=pattern`<br/><br/>Same as `grep-v`, but the matching value is **case-insensitive**.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `head`                       | **Usage**: `-m head=n`<br/><br/>Displays only the first n rows.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `tail`                       | **Usage**: `-m tail=n`<br/><br/>Displays only the last n rows.<br/><br/>Thus, if a table has 20 rows, the modifier `-m head=10 tail=5` would display the last five of the first ten rows, or rows 6-10.<br/><br/>**Note**: tail is processed after head regardless of their order in the command.                                                                                                                                                                                                                                                                                                                                                            |
| `columns`                    | **Usage**: `-m columns=pattern`<br/><br/>Displays only those columns whose headers match the pattern.<br/><br/>The matching value is case-sensitive.<br/><br/>The pattern can be any regular expression.<br/><br/>**Note**: The columns modifier is processed after the `grep*` modifiers, so the matched values might not be displayed.<br/><br/>* `columns=name` - Displays only those columns whose headers match ‘name’.<br/>* `columns=name|id` or `'columns=name columns=id'` (In contrast to `grep=pattern`) - Displays only those columns whose headers match either ‘name’ or ‘id’.                                                                 |

### Display Modifiers

To customize the output style, apply display modifiers to the symp command
to override the default output style settings.

| Display Modifier   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
|--------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `split-table`      | **Usage**: `-m split-table=<boolean value>`<br/><br/>Splits output into multiple, terminal-width tables, each containing some of the columns.<br/><br/>Default: `false`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `column-order`     | **Usage**: `-m column-order=<csv column list>`<br/><br/>Displays the columns according to a comma-separated list of column headers.<br/><br/>The unlisted columns are displayed after the listed ones in alphabetical order.<br/><br/>Default: `name, id, status, state`                                                                                                                                                                                                                                                                                                                                                                                                              |
| `force-frames`     | **Usage**: `-m force-frames=<boolean value>`<br/><br/>Displays frames around all sub-tables.<br/><br/>Default: `false`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `horizontal-lines` | **Usage**: `-m horizontal-lines=<boolean value>`<br/><br/>Displays horizontal lines between each row.<br/><br/>Horizontal lines are normally only drawn if either the row above or below is split into multiple lines.<br/><br/>Default: `false`                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `split-words`      | **Usage**: `-m split-words=<policy>`<br/><br/>Determines whether to split words when displaying cell values that are longer than their cell width.<br/><br/>There are four policies:<br/><br/>* `except-ids` (default) - Same as `standard` except that UUIDs and IPv4 addresses are never split.<br/>* `standard` - Cell values are split only between words. Words are not split unless a word is longer than the cell width.<br/>* `always` - Cell values can be split both between words and within words. This can result in slightly shorter tables.<br/>* `never` - Cell values are never split. This causes the table to look like the output of the regular table formatter. |
| `width`            | **Usage**: `-m width=n`<br/><br/>Sets the width of the terminal to `n` characters instead of using the auto-detected value.<br/><br/>Default: auto-detected value.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |

See the [Symp CLI Reference Guide](symp-ref-guide/index.md#symp-cli-ref-guide) for the commands and their parameters.
