usage.asciidoc 11 KB

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