OpenSearch CLI
Currently, opensearch-cli supports the Anomaly Detection and plugins, along with arbitrary REST API paths. Among other things, you can use opensearch-cli to create and delete detectors, start and stop them, and check k-NN statistics.
Profiles let you easily access different clusters or sign requests with different credentials. opensearch-cli supports unauthenticated requests, HTTP basic signing, and IAM signing for Amazon Web Services.
This example moves a detector () from a staging cluster to a production cluster:
and extract the appropriate installation package for your computer.
-
chmod +x ./opensearch-cli
Confirm the CLI is working properly:
Profiles let you easily switch between different clusters and user credentials. To get started, run opensearch-cli profile create
with the --auth-type
, --endpoint
, and --name
options:
Alternatively, save a configuration file to ~/.opensearch-cli/config.yaml
:
profiles:
- name: docker-local
endpoint: https://localhost:9200
password: foobar
- name: aws
aws_iam:
profile: ""
service: es
For example, the following command retrieves information about a detector:
For a request to the OpenSearch CAT API, try the following command:
opensearch-cli curl get --path _cat/plugins --profile aws
Use the -h
or --help
flag to see all supported commands, subcommands, or usage for a specific command: