Global flags
The apimetrics CLI is a fork of Restish, so its global flags are the Restish --rsh-* family. They apply to every command — built-in and generated alike.
| Flag | Description |
|---|---|
-o, --rsh-output-format string | Output format: auto, json, table, … (default auto) |
-f, --rsh-filter string | Filter / project results using a shorthand query |
-H, --rsh-header stringArray | Add a custom header |
-q, --rsh-query stringArray | Add a custom query parameter |
-p, --rsh-profile string | API auth profile (default default) |
-s, --rsh-server string | Override scheme://server:port for an API |
-r, --rsh-raw | Output the query result raw rather than escaped |
--rsh-no-paginate | Disable auto-pagination |
--rsh-no-cache | Disable the HTTP cache |
--rsh-ignore-status-code | Do not set the exit code from the HTTP status code |
--rsh-insecure | Disable SSL verification |
--rsh-ca-cert string | Path to a PEM-encoded CA cert |
--rsh-client-cert string | Path to a PEM-encoded client certificate |
--rsh-client-key string | Path to a PEM-encoded private key |
--rsh-retry int | Number of times to retry on certain failures (default 2) |
-t, --rsh-timeout duration | Timeout for HTTP requests |
-v, --rsh-verbose | Enable verbose log output |
--version | Print the binary version |
-h, --help | Help for the command |
JSON output is -o json, not --json
There is no --json flag. To get machine-readable JSON, use the output-format flag:
# Correct
apimetrics list-monitors -o json
# Also valid (long form)
apimetrics list-monitors --rsh-output-format json
There is no api configure
Upstream Restish ships an api configure command and generic HTTP verb commands (get, post, …). This fork registers neither. To authenticate, use login instead of api configure. To call the API, use the generated per-operation commands.
Examples
# Pretty table (default) vs. JSON
apimetrics list-monitors
apimetrics list-monitors -o json
# Add a custom header and override the server for one call
apimetrics list-monitors -H 'X-Trace: 1' -s https://staging.example.com
# Filter results client-side
apimetrics list-monitors -f 'body.data[].name'
See also
- Authentication — profiles use
-p/--rsh-profile - Generated commands