Skip to content

Commit

Permalink
[7.x][DOCS] Adds X-Pack usage API (elastic#52592)
Browse files Browse the repository at this point in the history
  • Loading branch information
lcawl authored Feb 21, 2020
1 parent f3f6ff9 commit 4ff78e8
Show file tree
Hide file tree
Showing 4 changed files with 303 additions and 2 deletions.
2 changes: 2 additions & 0 deletions docs/reference/rest-api/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ not be included yet.
* <<security-api,Security APIs>>
* <<snapshot-lifecycle-management-api,Snapshot lifecycle management APIs>>
* <<transform-apis,{transform-cap} APIs>>
* <<usage-api,Usage API>>
* <<watcher-api,Watcher APIs>>
--

Expand All @@ -56,5 +57,6 @@ include::{es-repo-dir}/search.asciidoc[]
include::{xes-repo-dir}/rest-api/security.asciidoc[]
include::{es-repo-dir}/slm/apis/slm-api.asciidoc[]
include::{es-repo-dir}/transform/apis/index.asciidoc[]
include::usage.asciidoc[]
include::{xes-repo-dir}/rest-api/watcher.asciidoc[]
include::defs.asciidoc[]
2 changes: 1 addition & 1 deletion docs/reference/rest-api/info.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ The information provided by this API includes:
The default value is `true`.

[discrete]
[[info-api--example]]
[[info-api-example]]
=== {api-examples-title}

The following example queries the info API:
Expand Down
299 changes: 299 additions & 0 deletions docs/reference/rest-api/usage.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,299 @@
[role="xpack"]
[testenv="basic"]
[[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-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::{docdir}/rest-api/common-parms.asciidoc[tag=master-timeout]

[discrete]
[[usage-api-example]]
=== {api-examples-title}

[source,console]
------------------------------------------------------------
GET /_xpack/usage
------------------------------------------------------------

[source,console-result]
------------------------------------------------------------
{
"security" : {
"available" : true,
"enabled" : false,
"ssl" : {
"http" : {
"enabled" : false
},
"transport" : {
"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
}
},
"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" : 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
},
"enrich" : {
"available" : true,
"enabled" : true
},
"transform" : {
"available" : true,
"enabled" : true
},
"flattened" : {
"available" : true,
"enabled" : true,
"field_count" : 0
},
"vectors" : {
"available" : true,
"enabled" : true,
"dense_vector_fields_count" : 0,
"dense_vector_dims_avg_count" : 0,
"sparse_vector_fields_count" : 0
},
"voting_only" : {
"available" : true,
"enabled" : true
},
"frozen_indices" : {
"available" : true,
"enabled" : true,
"indices_count" : 0
},
"spatial" : {
"available" : true,
"enabled" : true
},
"analytics" : {
"available" : true,
"enabled" : true,
...
}
}
------------------------------------------------------------
// TESTRESPONSE[s/"detectors" : \{[^\}]*\},/"detectors" : $body.$_path,/]
// TESTRESPONSE[s/"model_size" : \{[^\}]*\},/"model_size" : $body.$_path,/]
// TESTRESPONSE[s/"eql" : \{[^\}]*\},/"eql" : $body.$_path,/]
// TESTRESPONSE[s/"ilm" : \{[^\}]*\},/"ilm" : $body.$_path,/]
// TESTRESPONSE[s/"slm" : \{[^\}]*\},/"slm" : $body.$_path,/]
// TESTRESPONSE[s/"analytics" : \{[^\}]*\}/"analytics" : $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. Handling eql, which is disabled by default on release builds and enabled
// everywhere else during the initial implementation phase until its release
// 2. Ignore the contents of the `ilm` and `slm` objects because they don't know
// all of the policies that will be in them.
// 3. Ignore the contents of the `analytics` object because it might contain
// additional stats
// 4. 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.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"xpack.usage":{
"documentation":{
"url":"Retrieve information about xpack features usage"
"url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/usage-api.html"
},
"stability":"stable",
"url":{
Expand Down

0 comments on commit 4ff78e8

Please sign in to comment.