usage.asciidoc 9.4 KB

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