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:
Make the
opensearch-cli
file executable:chmod +x ./opensearch-cli
Confirm the CLI is working properly:
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
opensearch-cli commands use the following syntax:
For example, the following command retrieves information about a detector:
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: