usage.asciidoc 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404
  1. [role="xpack"]
  2. [testenv="basic"]
  3. [[usage-api]]
  4. == Usage API
  5. Provides usage information about the installed {xpack} features.
  6. [discrete]
  7. [[usage-api-request]]
  8. === {api-request-title}
  9. `GET /_xpack/usage`
  10. [discrete]
  11. [[usage-api-prereqs]]
  12. === {api-prereq-title}
  13. * If the {es} {security-features} are enabled, you must have the `monitor` or
  14. `manage` <<privileges-list-cluster,cluster privilege>> to use this API.
  15. [discrete]
  16. [[usage-api-desc]]
  17. === {api-description-title}
  18. This API provides information about which features are currently enabled and
  19. available under the current license and some usage statistics.
  20. [discrete]
  21. [[usage-api-query-parms]]
  22. === {api-query-parms-title}
  23. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=master-timeout]
  24. [discrete]
  25. [[usage-api-example]]
  26. === {api-examples-title}
  27. [source,console]
  28. ------------------------------------------------------------
  29. GET /_xpack/usage
  30. ------------------------------------------------------------
  31. // TEST[s/usage/usage?filter_path=-watcher.execution.actions.logging*/]
  32. // This response filter removes watcher logging results if they are included
  33. // to avoid errors in the CI builds.
  34. [source,console-result]
  35. ------------------------------------------------------------
  36. {
  37. "security" : {
  38. "available" : true,
  39. "enabled" : false
  40. },
  41. "monitoring" : {
  42. "available" : true,
  43. "enabled" : true,
  44. "collection_enabled" : false,
  45. "enabled_exporters" : {
  46. "local" : 1
  47. }
  48. },
  49. "watcher" : {
  50. "available" : true,
  51. "enabled" : true,
  52. "execution" : {
  53. "actions" : {
  54. "_all" : {
  55. "total" : 0,
  56. "total_time_in_ms" : 0
  57. }
  58. }
  59. },
  60. "watch" : {
  61. "input" : {
  62. "_all" : {
  63. "total" : 0,
  64. "active" : 0
  65. }
  66. },
  67. "trigger" : {
  68. "_all" : {
  69. "total" : 0,
  70. "active" : 0
  71. }
  72. }
  73. },
  74. "count" : {
  75. "total" : 0,
  76. "active" : 0
  77. }
  78. },
  79. "graph" : {
  80. "available" : true,
  81. "enabled" : true
  82. },
  83. "ml" : {
  84. "available" : true,
  85. "enabled" : true,
  86. "jobs" : {
  87. "_all" : {
  88. "count" : 0,
  89. "detectors" : {
  90. ...
  91. },
  92. "created_by" : { },
  93. "model_size" : {
  94. ...
  95. },
  96. "forecasts" : {
  97. "total" : 0,
  98. "forecasted_jobs" : 0
  99. }
  100. }
  101. },
  102. "datafeeds" : {
  103. "_all" : {
  104. "count" : 0
  105. }
  106. },
  107. "data_frame_analytics_jobs" : {
  108. "_all" : {
  109. "count" : 0
  110. },
  111. "analysis_counts": { },
  112. "memory_usage": {
  113. "peak_usage_bytes": {
  114. "min": 0.0,
  115. "max": 0.0,
  116. "avg": 0.0,
  117. "total": 0.0
  118. }
  119. }
  120. },
  121. "inference" : {
  122. "ingest_processors" : {
  123. "_all" : {
  124. "num_docs_processed" : {
  125. "max" : 0,
  126. "sum" : 0,
  127. "min" : 0
  128. },
  129. "pipelines" : {
  130. "count" : 0
  131. },
  132. "num_failures" : {
  133. "max" : 0,
  134. "sum" : 0,
  135. "min" : 0
  136. },
  137. "time_ms" : {
  138. "max" : 0,
  139. "sum" : 0,
  140. "min" : 0
  141. }
  142. }
  143. },
  144. "trained_models" : {
  145. "_all" : {
  146. "count" : 0
  147. },
  148. "count": {
  149. "total": 1,
  150. "classification": 0,
  151. "regression": 0,
  152. "prepackaged": 1,
  153. "other": 0
  154. },
  155. "estimated_heap_memory_usage_bytes": {
  156. "min": 0.0,
  157. "max": 0.0,
  158. "avg": 0.0,
  159. "total": 0.0
  160. },
  161. "estimated_operations": {
  162. "min": 0.0,
  163. "max": 0.0,
  164. "avg": 0.0,
  165. "total": 0.0
  166. }
  167. }
  168. },
  169. "node_count" : 1
  170. },
  171. "logstash" : {
  172. "available" : true,
  173. "enabled" : true
  174. },
  175. "eql" : {
  176. "available" : true,
  177. "enabled" : true
  178. },
  179. "sql" : {
  180. "available" : true,
  181. "enabled" : true,
  182. "features" : {
  183. "having" : 0,
  184. "subselect" : 0,
  185. "limit" : 0,
  186. "orderby" : 0,
  187. "where" : 0,
  188. "join" : 0,
  189. "groupby" : 0,
  190. "command" : 0,
  191. "local" : 0
  192. },
  193. "queries" : {
  194. "rest" : {
  195. "total" : 0,
  196. "paging" : 0,
  197. "failed" : 0
  198. },
  199. "cli" : {
  200. "total" : 0,
  201. "paging" : 0,
  202. "failed" : 0
  203. },
  204. "canvas" : {
  205. "total" : 0,
  206. "paging" : 0,
  207. "failed" : 0
  208. },
  209. "odbc" : {
  210. "total" : 0,
  211. "paging" : 0,
  212. "failed" : 0
  213. },
  214. "jdbc" : {
  215. "total" : 0,
  216. "paging" : 0,
  217. "failed" : 0
  218. },
  219. "odbc32" : {
  220. "total" : 0,
  221. "paging" : 0,
  222. "failed" : 0
  223. },
  224. "odbc64" : {
  225. "total" : 0,
  226. "paging" : 0,
  227. "failed" : 0
  228. },
  229. "_all" : {
  230. "total" : 0,
  231. "paging" : 0,
  232. "failed" : 0
  233. },
  234. "translate" : {
  235. "count" : 0
  236. }
  237. }
  238. },
  239. "rollup" : {
  240. "available" : true,
  241. "enabled" : true
  242. },
  243. "ilm" : {
  244. "policy_count" : 3,
  245. "policy_stats" : [
  246. ...
  247. ]
  248. },
  249. "slm" : {
  250. "available" : true,
  251. "enabled" : true
  252. },
  253. "ccr" : {
  254. "available" : true,
  255. "enabled" : true,
  256. "follower_indices_count" : 0,
  257. "auto_follow_patterns_count" : 0
  258. },
  259. "transform" : {
  260. "available" : true,
  261. "enabled" : true
  262. },
  263. "voting_only" : {
  264. "available" : true,
  265. "enabled" : true
  266. },
  267. "searchable_snapshots" : {
  268. "available" : true,
  269. "enabled" : true,
  270. "indices_count" : 0,
  271. "full_copy_indices_count" : 0,
  272. "shared_cache_indices_count" : 0
  273. },
  274. "frozen_indices" : {
  275. "available" : true,
  276. "enabled" : true,
  277. "indices_count" : 0
  278. },
  279. "spatial" : {
  280. "available" : true,
  281. "enabled" : true
  282. },
  283. "analytics" : {
  284. "available" : true,
  285. "enabled" : true,
  286. "stats": {
  287. "boxplot_usage" : 0,
  288. "top_metrics_usage" : 0,
  289. "normalize_usage" : 0,
  290. "cumulative_cardinality_usage" : 0,
  291. "t_test_usage" : 0,
  292. "rate_usage" : 0,
  293. "string_stats_usage" : 0,
  294. "moving_percentiles_usage" : 0,
  295. "multi_terms_usage" : 0
  296. }
  297. },
  298. "data_streams" : {
  299. "available" : true,
  300. "enabled" : true,
  301. "data_streams" : 0,
  302. "indices_count" : 0
  303. },
  304. "data_tiers" : {
  305. "available" : true,
  306. "enabled" : true,
  307. "data_warm" : {
  308. "node_count" : 0,
  309. "index_count" : 0,
  310. "total_shard_count" : 0,
  311. "primary_shard_count" : 0,
  312. "doc_count" : 0,
  313. "total_size_bytes" : 0,
  314. "primary_size_bytes" : 0,
  315. "primary_shard_size_avg_bytes" : 0,
  316. "primary_shard_size_median_bytes" : 0,
  317. "primary_shard_size_mad_bytes" : 0
  318. },
  319. "data_frozen" : {
  320. "node_count" : 1,
  321. "index_count" : 0,
  322. "total_shard_count" : 0,
  323. "primary_shard_count" : 0,
  324. "doc_count" : 0,
  325. "total_size_bytes" : 0,
  326. "primary_size_bytes" : 0,
  327. "primary_shard_size_avg_bytes" : 0,
  328. "primary_shard_size_median_bytes" : 0,
  329. "primary_shard_size_mad_bytes" : 0
  330. },
  331. "data_cold" : {
  332. "node_count" : 0,
  333. "index_count" : 0,
  334. "total_shard_count" : 0,
  335. "primary_shard_count" : 0,
  336. "doc_count" : 0,
  337. "total_size_bytes" : 0,
  338. "primary_size_bytes" : 0,
  339. "primary_shard_size_avg_bytes" : 0,
  340. "primary_shard_size_median_bytes" : 0,
  341. "primary_shard_size_mad_bytes" : 0
  342. },
  343. "data_content" : {
  344. "node_count" : 0,
  345. "index_count" : 0,
  346. "total_shard_count" : 0,
  347. "primary_shard_count" : 0,
  348. "doc_count" : 0,
  349. "total_size_bytes" : 0,
  350. "primary_size_bytes" : 0,
  351. "primary_shard_size_avg_bytes" : 0,
  352. "primary_shard_size_median_bytes" : 0,
  353. "primary_shard_size_mad_bytes" : 0
  354. },
  355. "data_hot" : {
  356. "node_count" : 0,
  357. "index_count" : 0,
  358. "total_shard_count" : 0,
  359. "primary_shard_count" : 0,
  360. "doc_count" : 0,
  361. "total_size_bytes" : 0,
  362. "primary_size_bytes" : 0,
  363. "primary_shard_size_avg_bytes" : 0,
  364. "primary_shard_size_median_bytes" : 0,
  365. "primary_shard_size_mad_bytes" : 0
  366. }
  367. },
  368. "aggregate_metric" : {
  369. "available" : true,
  370. "enabled" : true
  371. }
  372. }
  373. ------------------------------------------------------------
  374. // TESTRESPONSE[s/"detectors" : \{[^\}]*\},/"detectors" : $body.$_path,/]
  375. // TESTRESPONSE[s/"model_size" : \{[^\}]*\},/"model_size" : $body.$_path,/]
  376. // TESTRESPONSE[s/"eql" : \{[^\}]*\},/"eql" : $body.$_path,/]
  377. // TESTRESPONSE[s/"policy_stats" : \[[^\]]*\]/"policy_stats" : $body.$_path/]
  378. // TESTRESPONSE[s/"slm" : \{[^\}]*\},/"slm" : $body.$_path,/]
  379. // TESTRESPONSE[s/ : true/ : $body.$_path/]
  380. // TESTRESPONSE[s/ : false/ : $body.$_path/]
  381. // TESTRESPONSE[s/ : (\-)?[0-9]+/ : $body.$_path/]
  382. // These replacements do a few things:
  383. // 1. Ignore the contents of the `policy_stats` object because we don't know all
  384. // of the policies that will be in it. And because we figure folks don't need
  385. // to see an exhaustive list anyway.
  386. // 2. Handling eql, which is disabled by default on release builds and enabled
  387. // everywhere else during the initial implementation phase until its release
  388. // 3. Ignore the contents of the `slm` object because it might contain policies
  389. // 4. All of the numbers and strings on the right hand side of *every* field in
  390. // the response are ignored. So we're really only asserting things about the
  391. // the shape of this response, not the values in it.