usage.asciidoc 11 KB

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