Difference between revisions of "Opensearch-cli curl get --help"
Jump to navigation
Jump to search
Line 1: | Line 1: | ||
{{lc}} | {{lc}} | ||
[[opensearch-cli curl get]] --help | [[opensearch-cli curl get]] --help | ||
− | + | ||
− | Get command enables you to run any GET API against cluster | + | Get command enables you to run any GET API against cluster |
− | + | ||
− | Usage: | + | Usage: |
− | + | opensearch-cli curl get [flags] | |
− | + | ||
− | Examples: | + | Examples: |
− | + | ||
− | # get document count for an index | + | # get document count for an index |
− | opensearch-cli curl get --path "_cat/count/my-index-01" --query-params "v=true" --pretty | + | opensearch-cli curl get --path "_cat/count/my-index-01" --query-params "v=true" --pretty |
− | + | ||
− | # get health status of a cluster. | + | # get health status of a cluster. |
− | opensearch-cli curl get --path "_cluster/health" --pretty --filter-path "status" | + | opensearch-cli curl get --path "_cluster/health" --pretty --filter-path "status" |
− | + | ||
− | # get explanation for cluster allocation for a given index and shard number | + | # get explanation for cluster allocation for a given index and shard number |
− | opensearch-cli curl get --path "_cluster/allocation/explain" \ | + | opensearch-cli curl get --path "_cluster/allocation/explain" \ |
− | + | --data '{ | |
− | + | "index": "my-index-01", | |
− | + | "shard": 0, | |
− | + | "primary": false, | |
− | + | "current_node": "nodeA" | |
− | + | }' | |
− | + | ||
− | + | ||
− | Flags: | + | Flags: |
− | + | -d, --data string Data for the REST API. If value starts with '@', the rest should be a file name to read the data from. | |
− | + | -H, --headers : Headers for the REST API. Consists of case-insensitive name followed by a colon (:), then by its value. Use | |
− | + | ';' to separate multiple parameters. Ex: -H "content-type:json;accept-encoding:gzip" | |
− | + | -h, --help Help for curl get | |
− | + | -P, --path string URL path for the REST API | |
− | + | -q, --query-params string URL query parameters (key & value) for the REST API. Use ‘&’ to separate multiple parameters. Ex: -q | |
− | Global Flags: | + | "v=true&s=order:desc,index_patterns" |
− | + | ||
− | + | Global Flags: | |
− | + | -c, --config string Configuration file for opensearch-cli, default is /Users/sf/.opensearch-cli/config.yaml | |
− | + | -f, --filter-path string Filter output fields returned by OpenSearch. Use comma ',' to separate list of filters | |
− | + | -o, --output-format string Output format if supported by cluster, else, default format by OpenSearch. Example json, yaml | |
− | + | --pretty Response will be formatted | |
+ | -p, --profile string Use a specific profile from your configuration file | ||
== See also == | == See also == |
Latest revision as of 11:33, 22 April 2022
opensearch-cli curl get --help Get command enables you to run any GET API against cluster Usage: opensearch-cli curl get [flags] Examples: # get document count for an index opensearch-cli curl get --path "_cat/count/my-index-01" --query-params "v=true" --pretty # get health status of a cluster. opensearch-cli curl get --path "_cluster/health" --pretty --filter-path "status" # get explanation for cluster allocation for a given index and shard number opensearch-cli curl get --path "_cluster/allocation/explain" \ --data '{ "index": "my-index-01", "shard": 0, "primary": false, "current_node": "nodeA" }' Flags: -d, --data string Data for the REST API. If value starts with '@', the rest should be a file name to read the data from. -H, --headers : Headers for the REST API. Consists of case-insensitive name followed by a colon (:), then by its value. Use ';' to separate multiple parameters. Ex: -H "content-type:json;accept-encoding:gzip" -h, --help Help for curl get -P, --path string URL path for the REST API -q, --query-params string URL query parameters (key & value) for the REST API. Use ‘&’ to separate multiple parameters. Ex: -q "v=true&s=order:desc,index_patterns" Global Flags: -c, --config string Configuration file for opensearch-cli, default is /Users/sf/.opensearch-cli/config.yaml -f, --filter-path string Filter output fields returned by OpenSearch. Use comma ',' to separate list of filters -o, --output-format string Output format if supported by cluster, else, default format by OpenSearch. Example json, yaml --pretty Response will be formatted -p, --profile string Use a specific profile from your configuration file
See also[edit]
Advertising: