usage.asciidoc 8.3 KB

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