usage.asciidoc 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518
  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.index*\,-watcher.execution.actions.logging*,-watcher.execution.actions.email*/]
  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" : true,
  39. ...
  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": 1
  147. },
  148. "count": {
  149. "total": 1,
  150. "prepackaged": 1,
  151. "other": 0
  152. },
  153. "model_size_bytes": {
  154. "min": 0.0,
  155. "max": 0.0,
  156. "avg": 0.0,
  157. "total": 0.0
  158. },
  159. "estimated_operations": {
  160. "min": 0.0,
  161. "max": 0.0,
  162. "avg": 0.0,
  163. "total": 0.0
  164. }
  165. },
  166. "deployments": {
  167. "count": 0,
  168. "inference_counts": {
  169. "total": 0.0,
  170. "min": 0.0,
  171. "avg": 0.0,
  172. "max": 0.0
  173. },
  174. "stats_by_model": [],
  175. "model_sizes_bytes": {
  176. "total": 0.0,
  177. "min": 0.0,
  178. "avg": 0.0,
  179. "max": 0.0
  180. },
  181. "time_ms": {
  182. "avg": 0.0
  183. }
  184. }
  185. },
  186. "node_count" : 1
  187. },
  188. "inference": {
  189. "available" : true,
  190. "enabled" : true,
  191. "models" : []
  192. },
  193. "logstash" : {
  194. "available" : true,
  195. "enabled" : true
  196. },
  197. "eql" : {
  198. "available" : true,
  199. "enabled" : true
  200. },
  201. "esql" : {
  202. "available" : true,
  203. "enabled" : true,
  204. "features" : {
  205. "eval" : 0,
  206. "stats" : 0,
  207. "dissect": 0,
  208. "grok" : 0,
  209. "limit" : 0,
  210. "where" : 0,
  211. "sort" : 0,
  212. "drop" : 0,
  213. "show" : 0,
  214. "rename" : 0,
  215. "mv_expand" : 0,
  216. "keep" : 0,
  217. "enrich" : 0,
  218. "from" : 0,
  219. "row" : 0
  220. },
  221. "queries" : {
  222. "rest" : {
  223. "total" : 0,
  224. "failed" : 0
  225. },
  226. "kibana" : {
  227. "total" : 0,
  228. "failed" : 0
  229. },
  230. "_all" : {
  231. "total" : 0,
  232. "failed" : 0
  233. }
  234. }
  235. },
  236. "sql" : {
  237. "available" : true,
  238. "enabled" : true,
  239. "features" : {
  240. "having" : 0,
  241. "subselect" : 0,
  242. "limit" : 0,
  243. "orderby" : 0,
  244. "where" : 0,
  245. "join" : 0,
  246. "groupby" : 0,
  247. "command" : 0,
  248. "local" : 0
  249. },
  250. "queries" : {
  251. "rest" : {
  252. "total" : 0,
  253. "paging" : 0,
  254. "failed" : 0
  255. },
  256. "cli" : {
  257. "total" : 0,
  258. "paging" : 0,
  259. "failed" : 0
  260. },
  261. "canvas" : {
  262. "total" : 0,
  263. "paging" : 0,
  264. "failed" : 0
  265. },
  266. "odbc" : {
  267. "total" : 0,
  268. "paging" : 0,
  269. "failed" : 0
  270. },
  271. "jdbc" : {
  272. "total" : 0,
  273. "paging" : 0,
  274. "failed" : 0
  275. },
  276. "odbc32" : {
  277. "total" : 0,
  278. "paging" : 0,
  279. "failed" : 0
  280. },
  281. "odbc64" : {
  282. "total" : 0,
  283. "paging" : 0,
  284. "failed" : 0
  285. },
  286. "_all" : {
  287. "total" : 0,
  288. "paging" : 0,
  289. "failed" : 0
  290. },
  291. "translate" : {
  292. "count" : 0
  293. }
  294. }
  295. },
  296. "rollup" : {
  297. "available" : true,
  298. "enabled" : true
  299. },
  300. "ilm" : {
  301. "policy_count" : 3,
  302. "policy_stats" : [
  303. ...
  304. ]
  305. },
  306. "slm" : {
  307. "available" : true,
  308. "enabled" : true
  309. },
  310. "ccr" : {
  311. "available" : true,
  312. "enabled" : true,
  313. "follower_indices_count" : 0,
  314. "auto_follow_patterns_count" : 0
  315. },
  316. "transform" : {
  317. "available" : true,
  318. "enabled" : true
  319. },
  320. "voting_only" : {
  321. "available" : true,
  322. "enabled" : true
  323. },
  324. "searchable_snapshots" : {
  325. "available" : true,
  326. "enabled" : true,
  327. "indices_count" : 0,
  328. "full_copy_indices_count" : 0,
  329. "shared_cache_indices_count" : 0
  330. },
  331. "frozen_indices" : {
  332. "available" : true,
  333. "enabled" : true,
  334. "indices_count" : 0
  335. },
  336. "spatial" : {
  337. "available" : true,
  338. "enabled" : true
  339. },
  340. "analytics" : {
  341. "available" : true,
  342. "enabled" : true,
  343. "stats": {
  344. "boxplot_usage" : 0,
  345. "top_metrics_usage" : 0,
  346. "normalize_usage" : 0,
  347. "cumulative_cardinality_usage" : 0,
  348. "t_test_usage" : 0,
  349. "rate_usage" : 0,
  350. "string_stats_usage" : 0,
  351. "moving_percentiles_usage" : 0,
  352. "multi_terms_usage" : 0
  353. }
  354. },
  355. "data_streams" : {
  356. "available" : true,
  357. "enabled" : true,
  358. "data_streams" : 0,
  359. "indices_count" : 0
  360. },
  361. "data_lifecycle" : {
  362. "available": true,
  363. "enabled": true,
  364. "count": 0,
  365. "default_rollover_used": true,
  366. "retention": {
  367. "minimum_millis": 0,
  368. "maximum_millis": 0,
  369. "average_millis": 0.0
  370. }
  371. },
  372. "data_tiers" : {
  373. "available" : true,
  374. "enabled" : true,
  375. "data_warm" : {
  376. "node_count" : 0,
  377. "index_count" : 0,
  378. "total_shard_count" : 0,
  379. "primary_shard_count" : 0,
  380. "doc_count" : 0,
  381. "total_size_bytes" : 0,
  382. "primary_size_bytes" : 0,
  383. "primary_shard_size_avg_bytes" : 0,
  384. "primary_shard_size_median_bytes" : 0,
  385. "primary_shard_size_mad_bytes" : 0
  386. },
  387. "data_frozen" : {
  388. "node_count" : 1,
  389. "index_count" : 0,
  390. "total_shard_count" : 0,
  391. "primary_shard_count" : 0,
  392. "doc_count" : 0,
  393. "total_size_bytes" : 0,
  394. "primary_size_bytes" : 0,
  395. "primary_shard_size_avg_bytes" : 0,
  396. "primary_shard_size_median_bytes" : 0,
  397. "primary_shard_size_mad_bytes" : 0
  398. },
  399. "data_cold" : {
  400. "node_count" : 0,
  401. "index_count" : 0,
  402. "total_shard_count" : 0,
  403. "primary_shard_count" : 0,
  404. "doc_count" : 0,
  405. "total_size_bytes" : 0,
  406. "primary_size_bytes" : 0,
  407. "primary_shard_size_avg_bytes" : 0,
  408. "primary_shard_size_median_bytes" : 0,
  409. "primary_shard_size_mad_bytes" : 0
  410. },
  411. "data_content" : {
  412. "node_count" : 0,
  413. "index_count" : 0,
  414. "total_shard_count" : 0,
  415. "primary_shard_count" : 0,
  416. "doc_count" : 0,
  417. "total_size_bytes" : 0,
  418. "primary_size_bytes" : 0,
  419. "primary_shard_size_avg_bytes" : 0,
  420. "primary_shard_size_median_bytes" : 0,
  421. "primary_shard_size_mad_bytes" : 0
  422. },
  423. "data_hot" : {
  424. "node_count" : 0,
  425. "index_count" : 0,
  426. "total_shard_count" : 0,
  427. "primary_shard_count" : 0,
  428. "doc_count" : 0,
  429. "total_size_bytes" : 0,
  430. "primary_size_bytes" : 0,
  431. "primary_shard_size_avg_bytes" : 0,
  432. "primary_shard_size_median_bytes" : 0,
  433. "primary_shard_size_mad_bytes" : 0
  434. }
  435. },
  436. "aggregate_metric" : {
  437. "available" : true,
  438. "enabled" : true
  439. },
  440. "archive" : {
  441. "available" : true,
  442. "enabled" : true,
  443. "indices_count" : 0
  444. },
  445. "health_api" : {
  446. "available" : true,
  447. "enabled" : true,
  448. "invocations": {
  449. "total": 0
  450. }
  451. },
  452. "remote_clusters": {
  453. "size": 0,
  454. "mode": {
  455. "proxy": 0,
  456. "sniff": 0
  457. },
  458. "security": {
  459. "cert": 0,
  460. "api_key": 0
  461. }
  462. },
  463. "enterprise_search" : {
  464. "available": true,
  465. "enabled": true,
  466. "search_applications" : {
  467. "count": 0
  468. },
  469. "analytics_collections": {
  470. "count": 0
  471. },
  472. "query_rulesets": {
  473. "total_rule_count": 0,
  474. "total_count": 0,
  475. "min_rule_count": 0,
  476. "max_rule_count": 0
  477. }
  478. },
  479. "universal_profiling" : {
  480. "available" : true,
  481. "enabled" : true
  482. }
  483. }
  484. ------------------------------------------------------------
  485. // TESTRESPONSE[s/"security" : \{[^\}]*\},/"security" : $body.$_path,/]
  486. // TESTRESPONSE[s/"detectors" : \{[^\}]*\},/"detectors" : $body.$_path,/]
  487. // TESTRESPONSE[s/"model_size" : \{[^\}]*\},/"model_size" : $body.$_path,/]
  488. // TESTRESPONSE[s/"eql" : \{[^\}]*\},/"eql" : $body.$_path,/]
  489. // TESTRESPONSE[s/"policy_stats" : \[[^\]]*\]/"policy_stats" : $body.$_path/]
  490. // TESTRESPONSE[s/"slm" : \{[^\}]*\},/"slm" : $body.$_path,/]
  491. // TESTRESPONSE[s/"health_api" : \{[^\}]*\}\s*\}/"health_api" : $body.$_path/]
  492. // TESTRESPONSE[s/ : true/ : $body.$_path/]
  493. // TESTRESPONSE[s/ : false/ : $body.$_path/]
  494. // TESTRESPONSE[s/ : (\-)?[0-9]+/ : $body.$_path/]
  495. // These replacements do a few things:
  496. // 1. Ignore the contents of the `policy_stats` object because we don't know all
  497. // of the policies that will be in it. And because we figure folks don't need
  498. // to see an exhaustive list anyway.
  499. // 2. Handling eql, which is disabled by default on release builds and enabled
  500. // everywhere else during the initial implementation phase until its release
  501. // 3. Ignore the contents of the `slm` object because it might contain policies
  502. // 4. Ignore the contents of the `health_api` object because we do not know if the api has been called or not
  503. // 5. All of the numbers and strings on the right hand side of *every* field in
  504. // the response are ignored. So we're really only asserting things about the
  505. // the shape of this response, not the values in it.