usage.asciidoc 9.0 KB

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