usage.asciidoc 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  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-desc]]
  12. === {api-description-title}
  13. This API provides information about which features are currently enabled and
  14. available under the current license and some usage statistics.
  15. [discrete]
  16. [[usage-api-query-parms]]
  17. === {api-query-parms-title}
  18. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=master-timeout]
  19. [discrete]
  20. [[usage-api-example]]
  21. === {api-examples-title}
  22. [source,console]
  23. ------------------------------------------------------------
  24. GET /_xpack/usage
  25. ------------------------------------------------------------
  26. [source,console-result]
  27. ------------------------------------------------------------
  28. {
  29. "security" : {
  30. "available" : true,
  31. "enabled" : false,
  32. "ssl" : {
  33. "http" : {
  34. "enabled" : false
  35. },
  36. "transport" : {
  37. "enabled" : false
  38. }
  39. }
  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. },
  112. "inference" : {
  113. "ingest_processors" : {
  114. "_all" : {
  115. "num_docs_processed" : {
  116. "max" : 0,
  117. "sum" : 0,
  118. "min" : 0
  119. },
  120. "pipelines" : {
  121. "count" : 0
  122. },
  123. "num_failures" : {
  124. "max" : 0,
  125. "sum" : 0,
  126. "min" : 0
  127. },
  128. "time_ms" : {
  129. "max" : 0,
  130. "sum" : 0,
  131. "min" : 0
  132. }
  133. }
  134. },
  135. "trained_models" : {
  136. "_all" : {
  137. "count" : 0
  138. }
  139. }
  140. },
  141. "node_count" : 1
  142. },
  143. "logstash" : {
  144. "available" : true,
  145. "enabled" : true
  146. },
  147. "eql" : {
  148. "available" : true,
  149. "enabled" : true
  150. },
  151. "sql" : {
  152. "available" : true,
  153. "enabled" : true,
  154. "features" : {
  155. "having" : 0,
  156. "subselect" : 0,
  157. "limit" : 0,
  158. "orderby" : 0,
  159. "where" : 0,
  160. "join" : 0,
  161. "groupby" : 0,
  162. "command" : 0,
  163. "local" : 0
  164. },
  165. "queries" : {
  166. "rest" : {
  167. "total" : 0,
  168. "paging" : 0,
  169. "failed" : 0
  170. },
  171. "cli" : {
  172. "total" : 0,
  173. "paging" : 0,
  174. "failed" : 0
  175. },
  176. "canvas" : {
  177. "total" : 0,
  178. "paging" : 0,
  179. "failed" : 0
  180. },
  181. "odbc" : {
  182. "total" : 0,
  183. "paging" : 0,
  184. "failed" : 0
  185. },
  186. "jdbc" : {
  187. "total" : 0,
  188. "paging" : 0,
  189. "failed" : 0
  190. },
  191. "odbc32" : {
  192. "total" : 0,
  193. "paging" : 0,
  194. "failed" : 0
  195. },
  196. "odbc64" : {
  197. "total" : 0,
  198. "paging" : 0,
  199. "failed" : 0
  200. },
  201. "_all" : {
  202. "total" : 0,
  203. "paging" : 0,
  204. "failed" : 0
  205. },
  206. "translate" : {
  207. "count" : 0
  208. }
  209. }
  210. },
  211. "rollup" : {
  212. "available" : true,
  213. "enabled" : true
  214. },
  215. "ilm" : {
  216. "policy_count" : 3,
  217. "policy_stats" : [
  218. ...
  219. ]
  220. },
  221. "slm" : {
  222. "available" : true,
  223. "enabled" : true
  224. },
  225. "ccr" : {
  226. "available" : true,
  227. "enabled" : true,
  228. "follower_indices_count" : 0,
  229. "auto_follow_patterns_count" : 0
  230. },
  231. "transform" : {
  232. "available" : true,
  233. "enabled" : true
  234. },
  235. "vectors" : {
  236. "available" : true,
  237. "enabled" : true,
  238. "dense_vector_fields_count" : 0,
  239. "dense_vector_dims_avg_count" : 0
  240. },
  241. "voting_only" : {
  242. "available" : true,
  243. "enabled" : true
  244. },
  245. "searchable_snapshots" : {
  246. "available" : true,
  247. "enabled" : true,
  248. "indices_count" : 0
  249. },
  250. "frozen_indices" : {
  251. "available" : true,
  252. "enabled" : true,
  253. "indices_count" : 0
  254. },
  255. "spatial" : {
  256. "available" : true,
  257. "enabled" : true
  258. },
  259. "analytics" : {
  260. "available" : true,
  261. "enabled" : true,
  262. "stats": {
  263. "boxplot_usage" : 0,
  264. "top_metrics_usage" : 0,
  265. "normalize_usage" : 0,
  266. "cumulative_cardinality_usage" : 0,
  267. "t_test_usage" : 0,
  268. "string_stats_usage" : 0,
  269. "moving_percentiles_usage" : 0
  270. }
  271. },
  272. "data_streams" : {
  273. "available" : true,
  274. "enabled" : true,
  275. "data_streams" : 0,
  276. "indices_count" : 0
  277. }
  278. }
  279. ------------------------------------------------------------
  280. // TESTRESPONSE[s/"detectors" : \{[^\}]*\},/"detectors" : $body.$_path,/]
  281. // TESTRESPONSE[s/"model_size" : \{[^\}]*\},/"model_size" : $body.$_path,/]
  282. // TESTRESPONSE[s/"eql" : \{[^\}]*\},/"eql" : $body.$_path,/]
  283. // TESTRESPONSE[s/"policy_stats" : \[[^\]]*\]/"policy_stats" : $body.$_path/]
  284. // TESTRESPONSE[s/"slm" : \{[^\}]*\},/"slm" : $body.$_path,/]
  285. // TESTRESPONSE[s/ : true/ : $body.$_path/]
  286. // TESTRESPONSE[s/ : false/ : $body.$_path/]
  287. // TESTRESPONSE[s/ : (\-)?[0-9]+/ : $body.$_path/]
  288. // These replacements do a few things:
  289. // 1. Ignore the contents of the `policy_stats` object because we don't know all
  290. // of the policies that will be in it. And because we figure folks don't need
  291. // to see an exhaustive list anyway.
  292. // 2. Handling eql, which is disabled by default on release builds and enabled
  293. // everywhere else during the initial implementation phase until its release
  294. // 3. Ignore the contents of the `slm` object because it might contain policies
  295. // 4. All of the numbers and strings on the right hand side of *every* field in
  296. // the response are ignored. So we're really only asserting things about the
  297. // the shape of this response, not the values in it.