usage.asciidoc 12 KB

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