123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433 |
- [role="xpack"]
- [[usage-api]]
- == Usage API
- Provides usage information about the installed {xpack} features.
- [discrete]
- [[usage-api-request]]
- === {api-request-title}
- `GET /_xpack/usage`
- [discrete]
- [[usage-api-prereqs]]
- === {api-prereq-title}
- * If the {es} {security-features} are enabled, you must have the `monitor` or
- `manage` <<privileges-list-cluster,cluster privilege>> to use this API.
- [discrete]
- [[usage-api-desc]]
- === {api-description-title}
- This API provides information about which features are currently enabled and
- available under the current license and some usage statistics.
- [discrete]
- [[usage-api-query-parms]]
- === {api-query-parms-title}
- include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=master-timeout]
- [discrete]
- [[usage-api-example]]
- === {api-examples-title}
- [source,console]
- ------------------------------------------------------------
- GET /_xpack/usage
- ------------------------------------------------------------
- // TEST[s/usage/usage?filter_path=-watcher.execution.actions.logging*/]
- // This response filter removes watcher logging results if they are included
- // to avoid errors in the CI builds.
- [source,console-result]
- ------------------------------------------------------------
- {
- "security" : {
- "available" : true,
- "enabled" : false
- },
- "monitoring" : {
- "available" : true,
- "enabled" : true,
- "collection_enabled" : false,
- "enabled_exporters" : {
- "local" : 1
- }
- },
- "watcher" : {
- "available" : true,
- "enabled" : true,
- "execution" : {
- "actions" : {
- "_all" : {
- "total" : 0,
- "total_time_in_ms" : 0
- }
- }
- },
- "watch" : {
- "input" : {
- "_all" : {
- "total" : 0,
- "active" : 0
- }
- },
- "trigger" : {
- "_all" : {
- "total" : 0,
- "active" : 0
- }
- }
- },
- "count" : {
- "total" : 0,
- "active" : 0
- }
- },
- "graph" : {
- "available" : true,
- "enabled" : true
- },
- "ml" : {
- "available" : true,
- "enabled" : true,
- "jobs" : {
- "_all" : {
- "count" : 0,
- "detectors" : {
- ...
- },
- "created_by" : { },
- "model_size" : {
- ...
- },
- "forecasts" : {
- "total" : 0,
- "forecasted_jobs" : 0
- }
- }
- },
- "datafeeds" : {
- "_all" : {
- "count" : 0
- }
- },
- "data_frame_analytics_jobs" : {
- "_all" : {
- "count" : 0
- },
- "analysis_counts": { },
- "memory_usage": {
- "peak_usage_bytes": {
- "min": 0.0,
- "max": 0.0,
- "avg": 0.0,
- "total": 0.0
- }
- }
- },
- "inference" : {
- "ingest_processors" : {
- "_all" : {
- "num_docs_processed" : {
- "max" : 0,
- "sum" : 0,
- "min" : 0
- },
- "pipelines" : {
- "count" : 0
- },
- "num_failures" : {
- "max" : 0,
- "sum" : 0,
- "min" : 0
- },
- "time_ms" : {
- "max" : 0,
- "sum" : 0,
- "min" : 0
- }
- }
- },
- "trained_models" : {
- "_all" : {
- "count": 1
- },
- "count": {
- "total": 1,
- "prepackaged": 1,
- "other": 0
- },
- "model_size_bytes": {
- "min": 0.0,
- "max": 0.0,
- "avg": 0.0,
- "total": 0.0
- },
- "estimated_operations": {
- "min": 0.0,
- "max": 0.0,
- "avg": 0.0,
- "total": 0.0
- }
- },
- "deployments": {
- "count": 0,
- "inference_counts": {
- "total": 0.0,
- "min": 0.0,
- "avg": 0.0,
- "max": 0.0
- },
- "model_sizes_bytes": {
- "total": 0.0,
- "min": 0.0,
- "avg": 0.0,
- "max": 0.0
- },
- "time_ms": {
- "avg": 0.0
- }
- }
- },
- "node_count" : 1
- },
- "logstash" : {
- "available" : true,
- "enabled" : true
- },
- "eql" : {
- "available" : true,
- "enabled" : true
- },
- "sql" : {
- "available" : true,
- "enabled" : true,
- "features" : {
- "having" : 0,
- "subselect" : 0,
- "limit" : 0,
- "orderby" : 0,
- "where" : 0,
- "join" : 0,
- "groupby" : 0,
- "command" : 0,
- "local" : 0
- },
- "queries" : {
- "rest" : {
- "total" : 0,
- "paging" : 0,
- "failed" : 0
- },
- "cli" : {
- "total" : 0,
- "paging" : 0,
- "failed" : 0
- },
- "canvas" : {
- "total" : 0,
- "paging" : 0,
- "failed" : 0
- },
- "odbc" : {
- "total" : 0,
- "paging" : 0,
- "failed" : 0
- },
- "jdbc" : {
- "total" : 0,
- "paging" : 0,
- "failed" : 0
- },
- "odbc32" : {
- "total" : 0,
- "paging" : 0,
- "failed" : 0
- },
- "odbc64" : {
- "total" : 0,
- "paging" : 0,
- "failed" : 0
- },
- "_all" : {
- "total" : 0,
- "paging" : 0,
- "failed" : 0
- },
- "translate" : {
- "count" : 0
- }
- }
- },
- "rollup" : {
- "available" : true,
- "enabled" : true
- },
- "ilm" : {
- "policy_count" : 3,
- "policy_stats" : [
- ...
- ]
- },
- "slm" : {
- "available" : true,
- "enabled" : true
- },
- "ccr" : {
- "available" : true,
- "enabled" : true,
- "follower_indices_count" : 0,
- "auto_follow_patterns_count" : 0
- },
- "transform" : {
- "available" : true,
- "enabled" : true
- },
- "voting_only" : {
- "available" : true,
- "enabled" : true
- },
- "searchable_snapshots" : {
- "available" : true,
- "enabled" : true,
- "indices_count" : 0,
- "full_copy_indices_count" : 0,
- "shared_cache_indices_count" : 0
- },
- "frozen_indices" : {
- "available" : true,
- "enabled" : true,
- "indices_count" : 0
- },
- "spatial" : {
- "available" : true,
- "enabled" : true
- },
- "analytics" : {
- "available" : true,
- "enabled" : true,
- "stats": {
- "boxplot_usage" : 0,
- "top_metrics_usage" : 0,
- "normalize_usage" : 0,
- "cumulative_cardinality_usage" : 0,
- "t_test_usage" : 0,
- "rate_usage" : 0,
- "string_stats_usage" : 0,
- "moving_percentiles_usage" : 0,
- "multi_terms_usage" : 0
- }
- },
- "data_streams" : {
- "available" : true,
- "enabled" : true,
- "data_streams" : 0,
- "indices_count" : 0
- },
- "data_tiers" : {
- "available" : true,
- "enabled" : true,
- "data_warm" : {
- "node_count" : 0,
- "index_count" : 0,
- "total_shard_count" : 0,
- "primary_shard_count" : 0,
- "doc_count" : 0,
- "total_size_bytes" : 0,
- "primary_size_bytes" : 0,
- "primary_shard_size_avg_bytes" : 0,
- "primary_shard_size_median_bytes" : 0,
- "primary_shard_size_mad_bytes" : 0
- },
- "data_frozen" : {
- "node_count" : 1,
- "index_count" : 0,
- "total_shard_count" : 0,
- "primary_shard_count" : 0,
- "doc_count" : 0,
- "total_size_bytes" : 0,
- "primary_size_bytes" : 0,
- "primary_shard_size_avg_bytes" : 0,
- "primary_shard_size_median_bytes" : 0,
- "primary_shard_size_mad_bytes" : 0
- },
- "data_cold" : {
- "node_count" : 0,
- "index_count" : 0,
- "total_shard_count" : 0,
- "primary_shard_count" : 0,
- "doc_count" : 0,
- "total_size_bytes" : 0,
- "primary_size_bytes" : 0,
- "primary_shard_size_avg_bytes" : 0,
- "primary_shard_size_median_bytes" : 0,
- "primary_shard_size_mad_bytes" : 0
- },
- "data_content" : {
- "node_count" : 0,
- "index_count" : 0,
- "total_shard_count" : 0,
- "primary_shard_count" : 0,
- "doc_count" : 0,
- "total_size_bytes" : 0,
- "primary_size_bytes" : 0,
- "primary_shard_size_avg_bytes" : 0,
- "primary_shard_size_median_bytes" : 0,
- "primary_shard_size_mad_bytes" : 0
- },
- "data_hot" : {
- "node_count" : 0,
- "index_count" : 0,
- "total_shard_count" : 0,
- "primary_shard_count" : 0,
- "doc_count" : 0,
- "total_size_bytes" : 0,
- "primary_size_bytes" : 0,
- "primary_shard_size_avg_bytes" : 0,
- "primary_shard_size_median_bytes" : 0,
- "primary_shard_size_mad_bytes" : 0
- }
- },
- "aggregate_metric" : {
- "available" : true,
- "enabled" : true
- },
- "archive" : {
- "available" : true,
- "enabled" : true,
- "indices_count" : 0
- },
- "health_api" : {
- "available" : true,
- "enabled" : true,
- "invocations": {
- "total": 0
- }
- }
- }
- ------------------------------------------------------------
- // TESTRESPONSE[s/"detectors" : \{[^\}]*\},/"detectors" : $body.$_path,/]
- // TESTRESPONSE[s/"model_size" : \{[^\}]*\},/"model_size" : $body.$_path,/]
- // TESTRESPONSE[s/"eql" : \{[^\}]*\},/"eql" : $body.$_path,/]
- // TESTRESPONSE[s/"policy_stats" : \[[^\]]*\]/"policy_stats" : $body.$_path/]
- // TESTRESPONSE[s/"slm" : \{[^\}]*\},/"slm" : $body.$_path,/]
- // TESTRESPONSE[s/"health_api" : \{[^\}]*\}\s*\}/"health_api" : $body.$_path/]
- // TESTRESPONSE[s/ : true/ : $body.$_path/]
- // TESTRESPONSE[s/ : false/ : $body.$_path/]
- // TESTRESPONSE[s/ : (\-)?[0-9]+/ : $body.$_path/]
- // These replacements do a few things:
- // 1. Ignore the contents of the `policy_stats` object because we don't know all
- // of the policies that will be in it. And because we figure folks don't need
- // to see an exhaustive list anyway.
- // 2. Handling eql, which is disabled by default on release builds and enabled
- // everywhere else during the initial implementation phase until its release
- // 3. Ignore the contents of the `slm` object because it might contain policies
- // 4. Ignore the contents of the `health_api` object because we do not know if the api has been called or not
- // 5. All of the numbers and strings on the right hand side of *every* field in
- // the response are ignored. So we're really only asserting things about the
- // the shape of this response, not the values in it.
|