usage.asciidoc 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420
  1. [role="xpack"]
  2. [testenv="basic"]
  3. [[usage-api]]
  4. == Usage API
  5. Provides usage information about the installed {xpack} features.
  6. [discrete]
  7. [[usage-api-request]]
  8. === {api-request-title}
  9. `GET /_xpack/usage`
  10. [discrete]
  11. [[usage-api-prereqs]]
  12. === {api-prereq-title}
  13. * If the {es} {security-features} are enabled, you must have the `monitor` or
  14. `manage` <<privileges-list-cluster,cluster privilege>> to use this API.
  15. [discrete]
  16. [[usage-api-desc]]
  17. === {api-description-title}
  18. This API provides information about which features are currently enabled and
  19. available under the current license and some usage statistics.
  20. [discrete]
  21. [[usage-api-query-parms]]
  22. === {api-query-parms-title}
  23. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=master-timeout]
  24. [discrete]
  25. [[usage-api-example]]
  26. === {api-examples-title}
  27. [source,console]
  28. ------------------------------------------------------------
  29. GET /_xpack/usage
  30. ------------------------------------------------------------
  31. // TEST[s/usage/usage?filter_path=-watcher.execution.actions.logging*/]
  32. // This response filter removes watcher logging results if they are included
  33. // to avoid errors in the CI builds.
  34. [source,console-result]
  35. ------------------------------------------------------------
  36. {
  37. "security" : {
  38. "available" : true,
  39. "enabled" : false
  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. "estimated_heap_memory_usage_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. "sql" : {
  196. "available" : true,
  197. "enabled" : true,
  198. "features" : {
  199. "having" : 0,
  200. "subselect" : 0,
  201. "limit" : 0,
  202. "orderby" : 0,
  203. "where" : 0,
  204. "join" : 0,
  205. "groupby" : 0,
  206. "command" : 0,
  207. "local" : 0
  208. },
  209. "queries" : {
  210. "rest" : {
  211. "total" : 0,
  212. "paging" : 0,
  213. "failed" : 0
  214. },
  215. "cli" : {
  216. "total" : 0,
  217. "paging" : 0,
  218. "failed" : 0
  219. },
  220. "canvas" : {
  221. "total" : 0,
  222. "paging" : 0,
  223. "failed" : 0
  224. },
  225. "odbc" : {
  226. "total" : 0,
  227. "paging" : 0,
  228. "failed" : 0
  229. },
  230. "jdbc" : {
  231. "total" : 0,
  232. "paging" : 0,
  233. "failed" : 0
  234. },
  235. "odbc32" : {
  236. "total" : 0,
  237. "paging" : 0,
  238. "failed" : 0
  239. },
  240. "odbc64" : {
  241. "total" : 0,
  242. "paging" : 0,
  243. "failed" : 0
  244. },
  245. "_all" : {
  246. "total" : 0,
  247. "paging" : 0,
  248. "failed" : 0
  249. },
  250. "translate" : {
  251. "count" : 0
  252. }
  253. }
  254. },
  255. "rollup" : {
  256. "available" : true,
  257. "enabled" : true
  258. },
  259. "ilm" : {
  260. "policy_count" : 3,
  261. "policy_stats" : [
  262. ...
  263. ]
  264. },
  265. "slm" : {
  266. "available" : true,
  267. "enabled" : true
  268. },
  269. "ccr" : {
  270. "available" : true,
  271. "enabled" : true,
  272. "follower_indices_count" : 0,
  273. "auto_follow_patterns_count" : 0
  274. },
  275. "transform" : {
  276. "available" : true,
  277. "enabled" : true
  278. },
  279. "voting_only" : {
  280. "available" : true,
  281. "enabled" : true
  282. },
  283. "searchable_snapshots" : {
  284. "available" : true,
  285. "enabled" : true,
  286. "indices_count" : 0,
  287. "full_copy_indices_count" : 0,
  288. "shared_cache_indices_count" : 0
  289. },
  290. "frozen_indices" : {
  291. "available" : true,
  292. "enabled" : true,
  293. "indices_count" : 0
  294. },
  295. "spatial" : {
  296. "available" : true,
  297. "enabled" : true
  298. },
  299. "analytics" : {
  300. "available" : true,
  301. "enabled" : true,
  302. "stats": {
  303. "boxplot_usage" : 0,
  304. "top_metrics_usage" : 0,
  305. "normalize_usage" : 0,
  306. "cumulative_cardinality_usage" : 0,
  307. "t_test_usage" : 0,
  308. "rate_usage" : 0,
  309. "string_stats_usage" : 0,
  310. "moving_percentiles_usage" : 0,
  311. "multi_terms_usage" : 0
  312. }
  313. },
  314. "data_streams" : {
  315. "available" : true,
  316. "enabled" : true,
  317. "data_streams" : 0,
  318. "indices_count" : 0
  319. },
  320. "data_tiers" : {
  321. "available" : true,
  322. "enabled" : true,
  323. "data_warm" : {
  324. "node_count" : 0,
  325. "index_count" : 0,
  326. "total_shard_count" : 0,
  327. "primary_shard_count" : 0,
  328. "doc_count" : 0,
  329. "total_size_bytes" : 0,
  330. "primary_size_bytes" : 0,
  331. "primary_shard_size_avg_bytes" : 0,
  332. "primary_shard_size_median_bytes" : 0,
  333. "primary_shard_size_mad_bytes" : 0
  334. },
  335. "data_frozen" : {
  336. "node_count" : 1,
  337. "index_count" : 0,
  338. "total_shard_count" : 0,
  339. "primary_shard_count" : 0,
  340. "doc_count" : 0,
  341. "total_size_bytes" : 0,
  342. "primary_size_bytes" : 0,
  343. "primary_shard_size_avg_bytes" : 0,
  344. "primary_shard_size_median_bytes" : 0,
  345. "primary_shard_size_mad_bytes" : 0
  346. },
  347. "data_cold" : {
  348. "node_count" : 0,
  349. "index_count" : 0,
  350. "total_shard_count" : 0,
  351. "primary_shard_count" : 0,
  352. "doc_count" : 0,
  353. "total_size_bytes" : 0,
  354. "primary_size_bytes" : 0,
  355. "primary_shard_size_avg_bytes" : 0,
  356. "primary_shard_size_median_bytes" : 0,
  357. "primary_shard_size_mad_bytes" : 0
  358. },
  359. "data_content" : {
  360. "node_count" : 0,
  361. "index_count" : 0,
  362. "total_shard_count" : 0,
  363. "primary_shard_count" : 0,
  364. "doc_count" : 0,
  365. "total_size_bytes" : 0,
  366. "primary_size_bytes" : 0,
  367. "primary_shard_size_avg_bytes" : 0,
  368. "primary_shard_size_median_bytes" : 0,
  369. "primary_shard_size_mad_bytes" : 0
  370. },
  371. "data_hot" : {
  372. "node_count" : 0,
  373. "index_count" : 0,
  374. "total_shard_count" : 0,
  375. "primary_shard_count" : 0,
  376. "doc_count" : 0,
  377. "total_size_bytes" : 0,
  378. "primary_size_bytes" : 0,
  379. "primary_shard_size_avg_bytes" : 0,
  380. "primary_shard_size_median_bytes" : 0,
  381. "primary_shard_size_mad_bytes" : 0
  382. }
  383. },
  384. "aggregate_metric" : {
  385. "available" : true,
  386. "enabled" : true
  387. }
  388. }
  389. ------------------------------------------------------------
  390. // TESTRESPONSE[s/"detectors" : \{[^\}]*\},/"detectors" : $body.$_path,/]
  391. // TESTRESPONSE[s/"model_size" : \{[^\}]*\},/"model_size" : $body.$_path,/]
  392. // TESTRESPONSE[s/"eql" : \{[^\}]*\},/"eql" : $body.$_path,/]
  393. // TESTRESPONSE[s/"policy_stats" : \[[^\]]*\]/"policy_stats" : $body.$_path/]
  394. // TESTRESPONSE[s/"slm" : \{[^\}]*\},/"slm" : $body.$_path,/]
  395. // TESTRESPONSE[s/ : true/ : $body.$_path/]
  396. // TESTRESPONSE[s/ : false/ : $body.$_path/]
  397. // TESTRESPONSE[s/ : (\-)?[0-9]+/ : $body.$_path/]
  398. // These replacements do a few things:
  399. // 1. Ignore the contents of the `policy_stats` object because we don't know all
  400. // of the policies that will be in it. And because we figure folks don't need
  401. // to see an exhaustive list anyway.
  402. // 2. Handling eql, which is disabled by default on release builds and enabled
  403. // everywhere else during the initial implementation phase until its release
  404. // 3. Ignore the contents of the `slm` object because it might contain policies
  405. // 4. All of the numbers and strings on the right hand side of *every* field in
  406. // the response are ignored. So we're really only asserting things about the
  407. // the shape of this response, not the values in it.