usage.asciidoc 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418
  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. "ssl" : {
  41. "http" : {
  42. "enabled" : false
  43. },
  44. "transport" : {
  45. "enabled" : false
  46. }
  47. }
  48. },
  49. "monitoring" : {
  50. "available" : true,
  51. "enabled" : true,
  52. "collection_enabled" : false,
  53. "enabled_exporters" : {
  54. "local" : 1
  55. }
  56. },
  57. "watcher" : {
  58. "available" : true,
  59. "enabled" : true,
  60. "execution" : {
  61. "actions" : {
  62. "_all" : {
  63. "total" : 0,
  64. "total_time_in_ms" : 0
  65. }
  66. }
  67. },
  68. "watch" : {
  69. "input" : {
  70. "_all" : {
  71. "total" : 0,
  72. "active" : 0
  73. }
  74. },
  75. "trigger" : {
  76. "_all" : {
  77. "total" : 0,
  78. "active" : 0
  79. }
  80. }
  81. },
  82. "count" : {
  83. "total" : 0,
  84. "active" : 0
  85. }
  86. },
  87. "graph" : {
  88. "available" : true,
  89. "enabled" : true
  90. },
  91. "ml" : {
  92. "available" : true,
  93. "enabled" : true,
  94. "jobs" : {
  95. "_all" : {
  96. "count" : 0,
  97. "detectors" : {
  98. ...
  99. },
  100. "created_by" : { },
  101. "model_size" : {
  102. ...
  103. },
  104. "forecasts" : {
  105. "total" : 0,
  106. "forecasted_jobs" : 0
  107. }
  108. }
  109. },
  110. "datafeeds" : {
  111. "_all" : {
  112. "count" : 0
  113. }
  114. },
  115. "data_frame_analytics_jobs" : {
  116. "_all" : {
  117. "count" : 0
  118. },
  119. "analysis_counts": { },
  120. "memory_usage": {
  121. "peak_usage_bytes": {
  122. "min": 0.0,
  123. "max": 0.0,
  124. "avg": 0.0,
  125. "total": 0.0
  126. }
  127. }
  128. },
  129. "inference" : {
  130. "ingest_processors" : {
  131. "_all" : {
  132. "num_docs_processed" : {
  133. "max" : 0,
  134. "sum" : 0,
  135. "min" : 0
  136. },
  137. "pipelines" : {
  138. "count" : 0
  139. },
  140. "num_failures" : {
  141. "max" : 0,
  142. "sum" : 0,
  143. "min" : 0
  144. },
  145. "time_ms" : {
  146. "max" : 0,
  147. "sum" : 0,
  148. "min" : 0
  149. }
  150. }
  151. },
  152. "trained_models" : {
  153. "_all" : {
  154. "count" : 0
  155. },
  156. "count": {
  157. "total": 1,
  158. "classification": 0,
  159. "regression": 0,
  160. "prepackaged": 1,
  161. "other": 0
  162. },
  163. "estimated_heap_memory_usage_bytes": {
  164. "min": 0.0,
  165. "max": 0.0,
  166. "avg": 0.0,
  167. "total": 0.0
  168. },
  169. "estimated_operations": {
  170. "min": 0.0,
  171. "max": 0.0,
  172. "avg": 0.0,
  173. "total": 0.0
  174. }
  175. }
  176. },
  177. "node_count" : 1
  178. },
  179. "logstash" : {
  180. "available" : true,
  181. "enabled" : true
  182. },
  183. "eql" : {
  184. "available" : true,
  185. "enabled" : true
  186. },
  187. "sql" : {
  188. "available" : true,
  189. "enabled" : true,
  190. "features" : {
  191. "having" : 0,
  192. "subselect" : 0,
  193. "limit" : 0,
  194. "orderby" : 0,
  195. "where" : 0,
  196. "join" : 0,
  197. "groupby" : 0,
  198. "command" : 0,
  199. "local" : 0
  200. },
  201. "queries" : {
  202. "rest" : {
  203. "total" : 0,
  204. "paging" : 0,
  205. "failed" : 0
  206. },
  207. "cli" : {
  208. "total" : 0,
  209. "paging" : 0,
  210. "failed" : 0
  211. },
  212. "canvas" : {
  213. "total" : 0,
  214. "paging" : 0,
  215. "failed" : 0
  216. },
  217. "odbc" : {
  218. "total" : 0,
  219. "paging" : 0,
  220. "failed" : 0
  221. },
  222. "jdbc" : {
  223. "total" : 0,
  224. "paging" : 0,
  225. "failed" : 0
  226. },
  227. "odbc32" : {
  228. "total" : 0,
  229. "paging" : 0,
  230. "failed" : 0
  231. },
  232. "odbc64" : {
  233. "total" : 0,
  234. "paging" : 0,
  235. "failed" : 0
  236. },
  237. "_all" : {
  238. "total" : 0,
  239. "paging" : 0,
  240. "failed" : 0
  241. },
  242. "translate" : {
  243. "count" : 0
  244. }
  245. }
  246. },
  247. "rollup" : {
  248. "available" : true,
  249. "enabled" : true
  250. },
  251. "ilm" : {
  252. "policy_count" : 3,
  253. "policy_stats" : [
  254. ...
  255. ]
  256. },
  257. "slm" : {
  258. "available" : true,
  259. "enabled" : true
  260. },
  261. "ccr" : {
  262. "available" : true,
  263. "enabled" : true,
  264. "follower_indices_count" : 0,
  265. "auto_follow_patterns_count" : 0
  266. },
  267. "transform" : {
  268. "available" : true,
  269. "enabled" : true
  270. },
  271. "vectors" : {
  272. "available" : true,
  273. "enabled" : true,
  274. "dense_vector_fields_count" : 0,
  275. "dense_vector_dims_avg_count" : 0
  276. },
  277. "voting_only" : {
  278. "available" : true,
  279. "enabled" : true
  280. },
  281. "searchable_snapshots" : {
  282. "available" : true,
  283. "enabled" : true,
  284. "indices_count" : 0,
  285. "full_copy_indices_count" : 0,
  286. "shared_cache_indices_count" : 0
  287. },
  288. "frozen_indices" : {
  289. "available" : true,
  290. "enabled" : true,
  291. "indices_count" : 0
  292. },
  293. "spatial" : {
  294. "available" : true,
  295. "enabled" : true
  296. },
  297. "analytics" : {
  298. "available" : true,
  299. "enabled" : true,
  300. "stats": {
  301. "boxplot_usage" : 0,
  302. "top_metrics_usage" : 0,
  303. "normalize_usage" : 0,
  304. "cumulative_cardinality_usage" : 0,
  305. "t_test_usage" : 0,
  306. "rate_usage" : 0,
  307. "string_stats_usage" : 0,
  308. "moving_percentiles_usage" : 0,
  309. "multi_terms_usage" : 0
  310. }
  311. },
  312. "data_streams" : {
  313. "available" : true,
  314. "enabled" : true,
  315. "data_streams" : 0,
  316. "indices_count" : 0
  317. },
  318. "data_tiers" : {
  319. "available" : true,
  320. "enabled" : true,
  321. "data_warm" : {
  322. "node_count" : 0,
  323. "index_count" : 0,
  324. "total_shard_count" : 0,
  325. "primary_shard_count" : 0,
  326. "doc_count" : 0,
  327. "total_size_bytes" : 0,
  328. "primary_size_bytes" : 0,
  329. "primary_shard_size_avg_bytes" : 0,
  330. "primary_shard_size_median_bytes" : 0,
  331. "primary_shard_size_mad_bytes" : 0
  332. },
  333. "data_frozen" : {
  334. "node_count" : 1,
  335. "index_count" : 0,
  336. "total_shard_count" : 0,
  337. "primary_shard_count" : 0,
  338. "doc_count" : 0,
  339. "total_size_bytes" : 0,
  340. "primary_size_bytes" : 0,
  341. "primary_shard_size_avg_bytes" : 0,
  342. "primary_shard_size_median_bytes" : 0,
  343. "primary_shard_size_mad_bytes" : 0
  344. },
  345. "data_cold" : {
  346. "node_count" : 0,
  347. "index_count" : 0,
  348. "total_shard_count" : 0,
  349. "primary_shard_count" : 0,
  350. "doc_count" : 0,
  351. "total_size_bytes" : 0,
  352. "primary_size_bytes" : 0,
  353. "primary_shard_size_avg_bytes" : 0,
  354. "primary_shard_size_median_bytes" : 0,
  355. "primary_shard_size_mad_bytes" : 0
  356. },
  357. "data_content" : {
  358. "node_count" : 0,
  359. "index_count" : 0,
  360. "total_shard_count" : 0,
  361. "primary_shard_count" : 0,
  362. "doc_count" : 0,
  363. "total_size_bytes" : 0,
  364. "primary_size_bytes" : 0,
  365. "primary_shard_size_avg_bytes" : 0,
  366. "primary_shard_size_median_bytes" : 0,
  367. "primary_shard_size_mad_bytes" : 0
  368. },
  369. "data_hot" : {
  370. "node_count" : 0,
  371. "index_count" : 0,
  372. "total_shard_count" : 0,
  373. "primary_shard_count" : 0,
  374. "doc_count" : 0,
  375. "total_size_bytes" : 0,
  376. "primary_size_bytes" : 0,
  377. "primary_shard_size_avg_bytes" : 0,
  378. "primary_shard_size_median_bytes" : 0,
  379. "primary_shard_size_mad_bytes" : 0
  380. }
  381. },
  382. "aggregate_metric" : {
  383. "available" : true,
  384. "enabled" : true
  385. }
  386. }
  387. ------------------------------------------------------------
  388. // TESTRESPONSE[s/"detectors" : \{[^\}]*\},/"detectors" : $body.$_path,/]
  389. // TESTRESPONSE[s/"model_size" : \{[^\}]*\},/"model_size" : $body.$_path,/]
  390. // TESTRESPONSE[s/"eql" : \{[^\}]*\},/"eql" : $body.$_path,/]
  391. // TESTRESPONSE[s/"policy_stats" : \[[^\]]*\]/"policy_stats" : $body.$_path/]
  392. // TESTRESPONSE[s/"slm" : \{[^\}]*\},/"slm" : $body.$_path,/]
  393. // TESTRESPONSE[s/ : true/ : $body.$_path/]
  394. // TESTRESPONSE[s/ : false/ : $body.$_path/]
  395. // TESTRESPONSE[s/ : (\-)?[0-9]+/ : $body.$_path/]
  396. // These replacements do a few things:
  397. // 1. Ignore the contents of the `policy_stats` object because we don't know all
  398. // of the policies that will be in it. And because we figure folks don't need
  399. // to see an exhaustive list anyway.
  400. // 2. Handling eql, which is disabled by default on release builds and enabled
  401. // everywhere else during the initial implementation phase until its release
  402. // 3. Ignore the contents of the `slm` object because it might contain policies
  403. // 4. All of the numbers and strings on the right hand side of *every* field in
  404. // the response are ignored. So we're really only asserting things about the
  405. // the shape of this response, not the values in it.