usage.asciidoc 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440
  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. "enterprise_search" : {
  121. "available": true,
  122. "enabled": true,
  123. "search_applications" : {
  124. "count": 0
  125. }
  126. },
  127. "inference" : {
  128. "ingest_processors" : {
  129. "_all" : {
  130. "num_docs_processed" : {
  131. "max" : 0,
  132. "sum" : 0,
  133. "min" : 0
  134. },
  135. "pipelines" : {
  136. "count" : 0
  137. },
  138. "num_failures" : {
  139. "max" : 0,
  140. "sum" : 0,
  141. "min" : 0
  142. },
  143. "time_ms" : {
  144. "max" : 0,
  145. "sum" : 0,
  146. "min" : 0
  147. }
  148. }
  149. },
  150. "trained_models" : {
  151. "_all" : {
  152. "count": 1
  153. },
  154. "count": {
  155. "total": 1,
  156. "prepackaged": 1,
  157. "other": 0
  158. },
  159. "model_size_bytes": {
  160. "min": 0.0,
  161. "max": 0.0,
  162. "avg": 0.0,
  163. "total": 0.0
  164. },
  165. "estimated_operations": {
  166. "min": 0.0,
  167. "max": 0.0,
  168. "avg": 0.0,
  169. "total": 0.0
  170. }
  171. },
  172. "deployments": {
  173. "count": 0,
  174. "inference_counts": {
  175. "total": 0.0,
  176. "min": 0.0,
  177. "avg": 0.0,
  178. "max": 0.0
  179. },
  180. "model_sizes_bytes": {
  181. "total": 0.0,
  182. "min": 0.0,
  183. "avg": 0.0,
  184. "max": 0.0
  185. },
  186. "time_ms": {
  187. "avg": 0.0
  188. }
  189. }
  190. },
  191. "node_count" : 1
  192. },
  193. "logstash" : {
  194. "available" : true,
  195. "enabled" : true
  196. },
  197. "eql" : {
  198. "available" : true,
  199. "enabled" : true
  200. },
  201. "sql" : {
  202. "available" : true,
  203. "enabled" : true,
  204. "features" : {
  205. "having" : 0,
  206. "subselect" : 0,
  207. "limit" : 0,
  208. "orderby" : 0,
  209. "where" : 0,
  210. "join" : 0,
  211. "groupby" : 0,
  212. "command" : 0,
  213. "local" : 0
  214. },
  215. "queries" : {
  216. "rest" : {
  217. "total" : 0,
  218. "paging" : 0,
  219. "failed" : 0
  220. },
  221. "cli" : {
  222. "total" : 0,
  223. "paging" : 0,
  224. "failed" : 0
  225. },
  226. "canvas" : {
  227. "total" : 0,
  228. "paging" : 0,
  229. "failed" : 0
  230. },
  231. "odbc" : {
  232. "total" : 0,
  233. "paging" : 0,
  234. "failed" : 0
  235. },
  236. "jdbc" : {
  237. "total" : 0,
  238. "paging" : 0,
  239. "failed" : 0
  240. },
  241. "odbc32" : {
  242. "total" : 0,
  243. "paging" : 0,
  244. "failed" : 0
  245. },
  246. "odbc64" : {
  247. "total" : 0,
  248. "paging" : 0,
  249. "failed" : 0
  250. },
  251. "_all" : {
  252. "total" : 0,
  253. "paging" : 0,
  254. "failed" : 0
  255. },
  256. "translate" : {
  257. "count" : 0
  258. }
  259. }
  260. },
  261. "rollup" : {
  262. "available" : true,
  263. "enabled" : true
  264. },
  265. "ilm" : {
  266. "policy_count" : 3,
  267. "policy_stats" : [
  268. ...
  269. ]
  270. },
  271. "slm" : {
  272. "available" : true,
  273. "enabled" : true
  274. },
  275. "ccr" : {
  276. "available" : true,
  277. "enabled" : true,
  278. "follower_indices_count" : 0,
  279. "auto_follow_patterns_count" : 0
  280. },
  281. "transform" : {
  282. "available" : true,
  283. "enabled" : true
  284. },
  285. "voting_only" : {
  286. "available" : true,
  287. "enabled" : true
  288. },
  289. "searchable_snapshots" : {
  290. "available" : true,
  291. "enabled" : true,
  292. "indices_count" : 0,
  293. "full_copy_indices_count" : 0,
  294. "shared_cache_indices_count" : 0
  295. },
  296. "frozen_indices" : {
  297. "available" : true,
  298. "enabled" : true,
  299. "indices_count" : 0
  300. },
  301. "spatial" : {
  302. "available" : true,
  303. "enabled" : true
  304. },
  305. "analytics" : {
  306. "available" : true,
  307. "enabled" : true,
  308. "stats": {
  309. "boxplot_usage" : 0,
  310. "top_metrics_usage" : 0,
  311. "normalize_usage" : 0,
  312. "cumulative_cardinality_usage" : 0,
  313. "t_test_usage" : 0,
  314. "rate_usage" : 0,
  315. "string_stats_usage" : 0,
  316. "moving_percentiles_usage" : 0,
  317. "multi_terms_usage" : 0
  318. }
  319. },
  320. "data_streams" : {
  321. "available" : true,
  322. "enabled" : true,
  323. "data_streams" : 0,
  324. "indices_count" : 0
  325. },
  326. "data_tiers" : {
  327. "available" : true,
  328. "enabled" : true,
  329. "data_warm" : {
  330. "node_count" : 0,
  331. "index_count" : 0,
  332. "total_shard_count" : 0,
  333. "primary_shard_count" : 0,
  334. "doc_count" : 0,
  335. "total_size_bytes" : 0,
  336. "primary_size_bytes" : 0,
  337. "primary_shard_size_avg_bytes" : 0,
  338. "primary_shard_size_median_bytes" : 0,
  339. "primary_shard_size_mad_bytes" : 0
  340. },
  341. "data_frozen" : {
  342. "node_count" : 1,
  343. "index_count" : 0,
  344. "total_shard_count" : 0,
  345. "primary_shard_count" : 0,
  346. "doc_count" : 0,
  347. "total_size_bytes" : 0,
  348. "primary_size_bytes" : 0,
  349. "primary_shard_size_avg_bytes" : 0,
  350. "primary_shard_size_median_bytes" : 0,
  351. "primary_shard_size_mad_bytes" : 0
  352. },
  353. "data_cold" : {
  354. "node_count" : 0,
  355. "index_count" : 0,
  356. "total_shard_count" : 0,
  357. "primary_shard_count" : 0,
  358. "doc_count" : 0,
  359. "total_size_bytes" : 0,
  360. "primary_size_bytes" : 0,
  361. "primary_shard_size_avg_bytes" : 0,
  362. "primary_shard_size_median_bytes" : 0,
  363. "primary_shard_size_mad_bytes" : 0
  364. },
  365. "data_content" : {
  366. "node_count" : 0,
  367. "index_count" : 0,
  368. "total_shard_count" : 0,
  369. "primary_shard_count" : 0,
  370. "doc_count" : 0,
  371. "total_size_bytes" : 0,
  372. "primary_size_bytes" : 0,
  373. "primary_shard_size_avg_bytes" : 0,
  374. "primary_shard_size_median_bytes" : 0,
  375. "primary_shard_size_mad_bytes" : 0
  376. },
  377. "data_hot" : {
  378. "node_count" : 0,
  379. "index_count" : 0,
  380. "total_shard_count" : 0,
  381. "primary_shard_count" : 0,
  382. "doc_count" : 0,
  383. "total_size_bytes" : 0,
  384. "primary_size_bytes" : 0,
  385. "primary_shard_size_avg_bytes" : 0,
  386. "primary_shard_size_median_bytes" : 0,
  387. "primary_shard_size_mad_bytes" : 0
  388. }
  389. },
  390. "aggregate_metric" : {
  391. "available" : true,
  392. "enabled" : true
  393. },
  394. "archive" : {
  395. "available" : true,
  396. "enabled" : true,
  397. "indices_count" : 0
  398. },
  399. "health_api" : {
  400. "available" : true,
  401. "enabled" : true,
  402. "invocations": {
  403. "total": 0
  404. }
  405. }
  406. }
  407. ------------------------------------------------------------
  408. // TESTRESPONSE[s/"detectors" : \{[^\}]*\},/"detectors" : $body.$_path,/]
  409. // TESTRESPONSE[s/"model_size" : \{[^\}]*\},/"model_size" : $body.$_path,/]
  410. // TESTRESPONSE[s/"eql" : \{[^\}]*\},/"eql" : $body.$_path,/]
  411. // TESTRESPONSE[s/"policy_stats" : \[[^\]]*\]/"policy_stats" : $body.$_path/]
  412. // TESTRESPONSE[s/"slm" : \{[^\}]*\},/"slm" : $body.$_path,/]
  413. // TESTRESPONSE[s/"health_api" : \{[^\}]*\}\s*\}/"health_api" : $body.$_path/]
  414. // TESTRESPONSE[s/ : true/ : $body.$_path/]
  415. // TESTRESPONSE[s/ : false/ : $body.$_path/]
  416. // TESTRESPONSE[s/ : (\-)?[0-9]+/ : $body.$_path/]
  417. // These replacements do a few things:
  418. // 1. Ignore the contents of the `policy_stats` object because we don't know all
  419. // of the policies that will be in it. And because we figure folks don't need
  420. // to see an exhaustive list anyway.
  421. // 2. Handling eql, which is disabled by default on release builds and enabled
  422. // everywhere else during the initial implementation phase until its release
  423. // 3. Ignore the contents of the `slm` object because it might contain policies
  424. // 4. Ignore the contents of the `health_api` object because we do not know if the api has been called or not
  425. // 5. All of the numbers and strings on the right hand side of *every* field in
  426. // the response are ignored. So we're really only asserting things about the
  427. // the shape of this response, not the values in it.