Skip to content

status: add support for multiple output formats#1249

Merged
bigbes merged 1 commit intotarantool:masterfrom
psergee:feat/status-format-support
Mar 29, 2026
Merged

status: add support for multiple output formats#1249
bigbes merged 1 commit intotarantool:masterfrom
psergee:feat/status-format-support

Conversation

@psergee
Copy link
Copy Markdown
Contributor

@psergee psergee commented Mar 2, 2026

The status command now supports JSON and YAML output formats in addition to the existing table format. This change introduces a printer interface that separates output formatting logic from core status functionality.

New --format CLI option allows users to get machine-readable output for automation purposes.

Closes #1245

@TarantoolBot document
Title: tt status supports JSON and YAML output formats

The tt status command now supports multiple output formats:

  • Table format (default, human-readable)
  • JSON format (machine-readable, for automation)
  • YAML format (machine-readable, for automation)

Usage:

  • tt status - default table output
  • tt status --format=json - JSON output
  • tt status --format=yaml - YAML output

The JSON and YAML formats include all status information:

  • Instance name
  • Status (RUNNING, STOPPED, etc.)
  • PID (if running)
  • Mode (RW/RO)
  • Config status
  • Box status
  • Upstream status
  • Alerts (with severity levels)

Example JSON output:

{
  "app:master": {
    "status": "RUNNING",
    "pid": 12345,
    "mode": "RW",
    "config": "ready",
    "box": "running",
    "upstream": "--",
    "alerts": []
  }
}

@patapenka-alexey patapenka-alexey added the full-ci Enables full ci tests label Mar 3, 2026
@psergee psergee added the feature A new functionality label Mar 3, 2026
Copy link
Copy Markdown
Contributor

@patapenka-alexey patapenka-alexey left a comment

Choose a reason for hiding this comment

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

Thank you for the patch! LGTM.

@psergee psergee force-pushed the feat/status-format-support branch from 104136a to 24ef0a7 Compare March 10, 2026 19:31
@psergee psergee requested a review from elhimov March 11, 2026 11:22
Copy link
Copy Markdown
Collaborator

@bigbes bigbes left a comment

Choose a reason for hiding this comment

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

Thank you for your patch! Pls consider fixing this minor issues (or questions).

@psergee psergee force-pushed the feat/status-format-support branch from 24ef0a7 to 3ea9405 Compare March 19, 2026 21:39
@psergee psergee requested a review from bigbes March 19, 2026 21:40
Copy link
Copy Markdown
Collaborator

@bigbes bigbes left a comment

Choose a reason for hiding this comment

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

Sorry for long response, let's not make any breaking changes in patch or minor versions. Mark this option as deprecated pls in "--help" and when it's used. "--format" option should take precedence before "--pretty". TYVM for your patch!

@psergee psergee force-pushed the feat/status-format-support branch from 3ea9405 to f2457ae Compare March 23, 2026 19:40
The status command now supports JSON and YAML output formats in addition
to the existing table format. This change introduces a printer interface
that separates output formatting logic from core status functionality.

New --format CLI option allows users to get machine-readable output for
automation purposes.

Maps --pretty to --format pretty-table for backward compatibility.

Closes tarantool#1245

@TarantoolBot document
Title: `tt status` supports JSON and YAML output formats

The `tt status` command now supports multiple output formats:
- Table format (default, human-readable)
- JSON format (machine-readable, for automation)
- YAML format (machine-readable, for automation)

Usage:
- `tt status` - default table output
- `tt status --format=json` - JSON output
- `tt status --format=yaml` - YAML output

`--pretty` option is deprecated in favor of `--format=pretty-table`.

The JSON and YAML formats include all status information:
- Instance name
- Status (RUNNING, STOPPED, etc.)
- PID (if running)
- Mode (RW/RO)
- Config status
- Box status
- Upstream status
- Alerts (with severity levels)

Example JSON output:
```json
{
  "app:master": {
    "status": "RUNNING",
    "pid": 12345,
    "mode": "RW",
    "config": "ready",
    "box": "running",
    "upstream": "--",
    "alerts": []
  }
}
```
@psergee psergee force-pushed the feat/status-format-support branch from f2457ae to 0eb8e71 Compare March 23, 2026 19:47
@psergee psergee requested a review from bigbes March 23, 2026 19:47
@bigbes bigbes merged commit dbfd762 into tarantool:master Mar 29, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature A new functionality full-ci Enables full ci tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add the --json or --yaml option to tt status

3 participants