usage.asciidoc 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369
  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. "rate_usage" : 0,
  269. "string_stats_usage" : 0,
  270. "moving_percentiles_usage" : 0
  271. }
  272. },
  273. "data_streams" : {
  274. "available" : true,
  275. "enabled" : true,
  276. "data_streams" : 0,
  277. "indices_count" : 0
  278. },
  279. "data_tiers" : {
  280. "available" : true,
  281. "enabled" : true,
  282. "data_warm" : {
  283. "node_count" : 0,
  284. "index_count" : 0,
  285. "total_shard_count" : 0,
  286. "primary_shard_count" : 0,
  287. "doc_count" : 0,
  288. "total_size_bytes" : 0,
  289. "primary_size_bytes" : 0,
  290. "primary_shard_size_avg_bytes" : 0,
  291. "primary_shard_size_median_bytes" : 0,
  292. "primary_shard_size_mad_bytes" : 0
  293. },
  294. "data_cold" : {
  295. "node_count" : 0,
  296. "index_count" : 0,
  297. "total_shard_count" : 0,
  298. "primary_shard_count" : 0,
  299. "doc_count" : 0,
  300. "total_size_bytes" : 0,
  301. "primary_size_bytes" : 0,
  302. "primary_shard_size_avg_bytes" : 0,
  303. "primary_shard_size_median_bytes" : 0,
  304. "primary_shard_size_mad_bytes" : 0
  305. },
  306. "data_content" : {
  307. "node_count" : 0,
  308. "index_count" : 0,
  309. "total_shard_count" : 0,
  310. "primary_shard_count" : 0,
  311. "doc_count" : 0,
  312. "total_size_bytes" : 0,
  313. "primary_size_bytes" : 0,
  314. "primary_shard_size_avg_bytes" : 0,
  315. "primary_shard_size_median_bytes" : 0,
  316. "primary_shard_size_mad_bytes" : 0
  317. },
  318. "data_hot" : {
  319. "node_count" : 0,
  320. "index_count" : 0,
  321. "total_shard_count" : 0,
  322. "primary_shard_count" : 0,
  323. "doc_count" : 0,
  324. "total_size_bytes" : 0,
  325. "primary_size_bytes" : 0,
  326. "primary_shard_size_avg_bytes" : 0,
  327. "primary_shard_size_median_bytes" : 0,
  328. "primary_shard_size_mad_bytes" : 0
  329. }
  330. },
  331. "aggregate_metric" : {
  332. "available" : true,
  333. "enabled" : true
  334. },
  335. "runtime_fields" : {
  336. "available" : true,
  337. "enabled" : true,
  338. "field_types" : []
  339. }
  340. }
  341. ------------------------------------------------------------
  342. // TESTRESPONSE[s/"detectors" : \{[^\}]*\},/"detectors" : $body.$_path,/]
  343. // TESTRESPONSE[s/"model_size" : \{[^\}]*\},/"model_size" : $body.$_path,/]
  344. // TESTRESPONSE[s/"eql" : \{[^\}]*\},/"eql" : $body.$_path,/]
  345. // TESTRESPONSE[s/"policy_stats" : \[[^\]]*\]/"policy_stats" : $body.$_path/]
  346. // TESTRESPONSE[s/"slm" : \{[^\}]*\},/"slm" : $body.$_path,/]
  347. // TESTRESPONSE[s/ : true/ : $body.$_path/]
  348. // TESTRESPONSE[s/ : false/ : $body.$_path/]
  349. // TESTRESPONSE[s/ : (\-)?[0-9]+/ : $body.$_path/]
  350. // These replacements do a few things:
  351. // 1. Ignore the contents of the `policy_stats` object because we don't know all
  352. // of the policies that will be in it. And because we figure folks don't need
  353. // to see an exhaustive list anyway.
  354. // 2. Handling eql, which is disabled by default on release builds and enabled
  355. // everywhere else during the initial implementation phase until its release
  356. // 3. Ignore the contents of the `slm` object because it might contain policies
  357. // 4. All of the numbers and strings on the right hand side of *every* field in
  358. // the response are ignored. So we're really only asserting things about the
  359. // the shape of this response, not the values in it.