usage.asciidoc 8.9 KB

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