Skip to content

Commit

Permalink
Merge 'docs: document scylla-api-client' from Anna Stuchlik
Browse files Browse the repository at this point in the history
Fixes #11999.

This PR adds a description of scylla-api-cli.

Closes #12392

* github.com:scylladb/scylladb:
  docs: fix the description of the system log POST example
  docs: uptate the curl tool name
  docs: describe how to use the scylla-api-client tool
  docs: fix the scylla-api-client tool name
  docs: document scylla-api-cli
  • Loading branch information
denesb committed Jan 3, 2023
2 parents 63c2cda + d0db1a2 commit 82101b7
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion docs/operating-scylla/rest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,35 @@
REST
----

For each JMX operation, attribute get and set, Scylla exposes a matching REST API. You can interact with the REST API using :code:`curl` or using the Swagger UI available at :code:`your-ip:10000/ui`
ScyllaDB exposes a REST API to retrieve administrative information from a node and execute
administrative operations. For example, it allows you to check or update configuration,
retrieve cluster-level information, and more.


CLI for REST API
^^^^^^^^^^^^^^^^^

ScyllaDB ships with ``scylla-api-client``, a lightweight tool that provides a command-line interface
for the ScyllaDB API. The tool allows you to:

* List the API functions with their parameters and print detailed help for each function.
* Invoke the API commands using the command line.

When invoking a function, ``scylla-api-client`` performs basic validation of the function arguments and
prints the result to the standard output. You can use commonly available command line utilities
to print the results in the JSON format.

To avoid errors, you should prefer ``scylla-api-client`` over ``curl`` and similar HTTP tools for interacting
with the ScyllaDB REST API.

Usage
======

Run ``scylla-api-client --help`` for information about all the available options.

**Examples:**

* ``scylla-api-client --list-modules`` - Shows all the API modules.
* ``scylla-api-client --list-module-commands system`` - Shows all the API commands for the ``system`` module.
* ``scylla-api-client system uptime_ms`` - Gets the system uptime (in milliseconds).
* ``scylla-api-client system log POST --message "hello world" --level warn`` - Writes the "hello world" message to the ScyllaDB log using the "warn" logging level.

0 comments on commit 82101b7

Please sign in to comment.