build.gradle 43 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244
  1. import static org.elasticsearch.gradle.testclusters.TestDistribution.DEFAULT
  2. /*
  3. * Licensed to Elasticsearch under one or more contributor
  4. * license agreements. See the NOTICE file distributed with
  5. * this work for additional information regarding copyright
  6. * ownership. Elasticsearch licenses this file to you under
  7. * the Apache License, Version 2.0 (the "License"); you may
  8. * not use this file except in compliance with the License.
  9. * You may obtain a copy of the License at
  10. *
  11. * http://www.apache.org/licenses/LICENSE-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing,
  14. * software distributed under the License is distributed on an
  15. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  16. * KIND, either express or implied. See the License for the
  17. * specific language governing permissions and limitations
  18. * under the License.
  19. */
  20. apply plugin: 'elasticsearch.docs-test'
  21. /* List of files that have snippets that will not work until platinum tests can occur ... */
  22. buildRestTests.expectedUnconvertedCandidates = [
  23. 'reference/ml/anomaly-detection/transforms.asciidoc',
  24. 'reference/ml/anomaly-detection/apis/delete-calendar-event.asciidoc',
  25. 'reference/ml/anomaly-detection/apis/get-bucket.asciidoc',
  26. 'reference/ml/anomaly-detection/apis/get-category.asciidoc',
  27. 'reference/ml/anomaly-detection/apis/get-influencer.asciidoc',
  28. 'reference/ml/anomaly-detection/apis/get-job-stats.asciidoc',
  29. 'reference/ml/anomaly-detection/apis/get-overall-buckets.asciidoc',
  30. 'reference/ml/anomaly-detection/apis/get-record.asciidoc',
  31. 'reference/ml/anomaly-detection/apis/get-snapshot.asciidoc',
  32. 'reference/ml/anomaly-detection/apis/post-data.asciidoc',
  33. 'reference/ml/anomaly-detection/apis/revert-snapshot.asciidoc',
  34. 'reference/ml/anomaly-detection/apis/update-snapshot.asciidoc',
  35. ]
  36. testClusters.integTest {
  37. if (singleNode().testDistribution == DEFAULT) {
  38. setting 'xpack.license.self_generated.type', 'trial'
  39. }
  40. // enable regexes in painless so our tests don't complain about example snippets that use them
  41. setting 'script.painless.regex.enabled', 'true'
  42. setting 'path.repo', "${buildDir}/cluster/shared/repo"
  43. Closure configFile = {
  44. extraConfigFile it, file("src/test/cluster/config/$it")
  45. }
  46. configFile 'analysis/example_word_list.txt'
  47. configFile 'analysis/hyphenation_patterns.xml'
  48. configFile 'analysis/synonym.txt'
  49. configFile 'analysis/stemmer_override.txt'
  50. configFile 'userdict_ja.txt'
  51. configFile 'userdict_ko.txt'
  52. configFile 'KeywordTokenizer.rbbi'
  53. extraConfigFile 'hunspell/en_US/en_US.aff', project(":server").file('src/test/resources/indices/analyze/conf_dir/hunspell/en_US/en_US.aff')
  54. extraConfigFile 'hunspell/en_US/en_US.dic', project(":server").file('src/test/resources/indices/analyze/conf_dir/hunspell/en_US/en_US.dic')
  55. // Whitelist reindexing from the local node so we can test it.
  56. setting 'reindex.remote.whitelist', '127.0.0.1:*'
  57. }
  58. // build the cluster with all plugins
  59. project.rootProject.subprojects.findAll { it.parent.path == ':plugins' }.each { subproj ->
  60. /* Skip repositories. We just aren't going to be able to test them so it
  61. * doesn't make sense to waste time installing them. */
  62. if (subproj.path.startsWith(':plugins:repository-')) {
  63. return
  64. }
  65. // FIXME
  66. subproj.afterEvaluate { // need to wait until the project has been configured
  67. testClusters.integTest {
  68. plugin file(subproj.bundlePlugin.archiveFile)
  69. }
  70. tasks.integTest.dependsOn subproj.bundlePlugin
  71. }
  72. }
  73. buildRestTests.docs = fileTree(projectDir) {
  74. // No snippets in here!
  75. exclude 'build.gradle'
  76. // That is where the snippets go, not where they come from!
  77. exclude 'build'
  78. // Just syntax examples
  79. exclude 'README.asciidoc'
  80. // Broken code snippet tests
  81. exclude 'reference/graph/explore.asciidoc'
  82. }
  83. listSnippets.docs = buildRestTests.docs
  84. Closure setupTwitter = { String name, int count ->
  85. buildRestTests.setups[name] = '''
  86. - do:
  87. indices.create:
  88. index: twitter
  89. body:
  90. settings:
  91. number_of_shards: 1
  92. number_of_replicas: 1
  93. mappings:
  94. properties:
  95. user:
  96. type: keyword
  97. doc_values: true
  98. date:
  99. type: date
  100. likes:
  101. type: long
  102. - do:
  103. bulk:
  104. index: twitter
  105. refresh: true
  106. body: |'''
  107. for (int i = 0; i < count; i++) {
  108. String user, text
  109. if (i == 0) {
  110. user = 'kimchy'
  111. text = 'trying out Elasticsearch'
  112. } else {
  113. user = 'test'
  114. text = "some message with the number $i"
  115. }
  116. buildRestTests.setups[name] += """
  117. {"index":{"_id": "$i"}}
  118. {"user": "$user", "message": "$text", "date": "2009-11-15T14:12:12", "likes": $i}"""
  119. }
  120. }
  121. setupTwitter('twitter', 5)
  122. setupTwitter('big_twitter', 120)
  123. setupTwitter('huge_twitter', 1200)
  124. buildRestTests.setups['host'] = '''
  125. # Fetch the http host. We use the host of the master because we know there will always be a master.
  126. - do:
  127. cluster.state: {}
  128. - set: { master_node: master }
  129. - do:
  130. nodes.info:
  131. metric: [ http, transport ]
  132. - set: {nodes.$master.http.publish_address: host}
  133. - set: {nodes.$master.transport.publish_address: transport_host}
  134. '''
  135. buildRestTests.setups['node'] = '''
  136. # Fetch the node name. We use the host of the master because we know there will always be a master.
  137. - do:
  138. cluster.state: {}
  139. - is_true: master_node
  140. - set: { master_node: node_name }
  141. '''
  142. // Used by scripted metric docs
  143. buildRestTests.setups['ledger'] = '''
  144. - do:
  145. indices.create:
  146. index: ledger
  147. body:
  148. settings:
  149. number_of_shards: 2
  150. number_of_replicas: 1
  151. mappings:
  152. properties:
  153. type:
  154. type: keyword
  155. amount:
  156. type: double
  157. - do:
  158. bulk:
  159. index: ledger
  160. refresh: true
  161. body: |
  162. {"index":{}}
  163. {"date": "2015/01/01 00:00:00", "amount": 200, "type": "sale", "description": "something"}
  164. {"index":{}}
  165. {"date": "2015/01/01 00:00:00", "amount": 10, "type": "expense", "decription": "another thing"}
  166. {"index":{}}
  167. {"date": "2015/01/01 00:00:00", "amount": 150, "type": "sale", "description": "blah"}
  168. {"index":{}}
  169. {"date": "2015/01/01 00:00:00", "amount": 50, "type": "expense", "description": "cost of blah"}
  170. {"index":{}}
  171. {"date": "2015/01/01 00:00:00", "amount": 50, "type": "expense", "description": "advertisement"}'''
  172. // Used by aggregation docs
  173. buildRestTests.setups['sales'] = '''
  174. - do:
  175. indices.create:
  176. index: sales
  177. body:
  178. settings:
  179. number_of_shards: 2
  180. number_of_replicas: 1
  181. mappings:
  182. properties:
  183. type:
  184. type: keyword
  185. - do:
  186. bulk:
  187. index: sales
  188. refresh: true
  189. body: |
  190. {"index":{}}
  191. {"date": "2015/01/01 00:00:00", "price": 200, "promoted": true, "rating": 1, "type": "hat"}
  192. {"index":{}}
  193. {"date": "2015/01/01 00:00:00", "price": 200, "promoted": true, "rating": 1, "type": "t-shirt"}
  194. {"index":{}}
  195. {"date": "2015/01/01 00:00:00", "price": 150, "promoted": true, "rating": 5, "type": "bag"}
  196. {"index":{}}
  197. {"date": "2015/02/01 00:00:00", "price": 50, "promoted": false, "rating": 1, "type": "hat"}
  198. {"index":{}}
  199. {"date": "2015/02/01 00:00:00", "price": 10, "promoted": true, "rating": 4, "type": "t-shirt"}
  200. {"index":{}}
  201. {"date": "2015/03/01 00:00:00", "price": 200, "promoted": true, "rating": 1, "type": "hat"}
  202. {"index":{}}
  203. {"date": "2015/03/01 00:00:00", "price": 175, "promoted": false, "rating": 2, "type": "t-shirt"}'''
  204. // Dummy bank account data used by getting-started.asciidoc
  205. buildRestTests.setups['bank'] = '''
  206. - do:
  207. indices.create:
  208. index: bank
  209. body:
  210. settings:
  211. number_of_shards: 5
  212. number_of_routing_shards: 5
  213. - do:
  214. bulk:
  215. index: bank
  216. refresh: true
  217. body: |
  218. #bank_data#
  219. '''
  220. /* Load the actual accounts only if we're going to use them. This complicates
  221. * dependency checking but that is a small price to pay for not building a
  222. * 400kb string every time we start the build. */
  223. File accountsFile = new File("$projectDir/src/test/resources/accounts.json")
  224. buildRestTests.inputs.file(accountsFile)
  225. buildRestTests.doFirst {
  226. String accounts = accountsFile.getText('UTF-8')
  227. // Indent like a yaml test needs
  228. accounts = accounts.replaceAll('(?m)^', ' ')
  229. buildRestTests.setups['bank'] =
  230. buildRestTests.setups['bank'].replace('#bank_data#', accounts)
  231. }
  232. // Used by index boost doc
  233. buildRestTests.setups['index_boost'] = '''
  234. - do:
  235. indices.create:
  236. index: index1
  237. - do:
  238. indices.create:
  239. index: index2
  240. - do:
  241. indices.put_alias:
  242. index: index1
  243. name: alias1
  244. '''
  245. // Used by sampler and diversified-sampler aggregation docs
  246. buildRestTests.setups['stackoverflow'] = '''
  247. - do:
  248. indices.create:
  249. index: stackoverflow
  250. body:
  251. settings:
  252. number_of_shards: 1
  253. number_of_replicas: 1
  254. mappings:
  255. properties:
  256. author:
  257. type: keyword
  258. tags:
  259. type: keyword
  260. - do:
  261. bulk:
  262. index: stackoverflow
  263. refresh: true
  264. body: |'''
  265. // Make Kibana strongly connected to elasticsearch and logstash
  266. // Make Kibana rarer (and therefore higher-ranking) than JavaScript
  267. // Make JavaScript strongly connected to jquery and angular
  268. // Make Cabana strongly connected to elasticsearch but only as a result of a single author
  269. for (int i = 0; i < 150; i++) {
  270. buildRestTests.setups['stackoverflow'] += """
  271. {"index":{}}
  272. {"author": "very_relevant_$i", "tags": ["elasticsearch", "kibana"]}"""
  273. }
  274. for (int i = 0; i < 50; i++) {
  275. buildRestTests.setups['stackoverflow'] += """
  276. {"index":{}}
  277. {"author": "very_relevant_$i", "tags": ["logstash", "kibana"]}"""
  278. }
  279. for (int i = 0; i < 200; i++) {
  280. buildRestTests.setups['stackoverflow'] += """
  281. {"index":{}}
  282. {"author": "partially_relevant_$i", "tags": ["javascript", "jquery"]}"""
  283. }
  284. for (int i = 0; i < 200; i++) {
  285. buildRestTests.setups['stackoverflow'] += """
  286. {"index":{}}
  287. {"author": "partially_relevant_$i", "tags": ["javascript", "angular"]}"""
  288. }
  289. for (int i = 0; i < 50; i++) {
  290. buildRestTests.setups['stackoverflow'] += """
  291. {"index":{}}
  292. {"author": "noisy author", "tags": ["elasticsearch", "cabana"]}"""
  293. }
  294. buildRestTests.setups['stackoverflow'] += """
  295. """
  296. // Used by significant_text aggregation docs
  297. buildRestTests.setups['news'] = '''
  298. - do:
  299. indices.create:
  300. index: news
  301. body:
  302. settings:
  303. number_of_shards: 1
  304. number_of_replicas: 1
  305. mappings:
  306. properties:
  307. source:
  308. type: keyword
  309. content:
  310. type: text
  311. - do:
  312. bulk:
  313. index: news
  314. refresh: true
  315. body: |'''
  316. // Make h5n1 strongly connected to bird flu
  317. for (int i = 0; i < 100; i++) {
  318. buildRestTests.setups['news'] += """
  319. {"index":{}}
  320. {"source": "very_relevant_$i", "content": "bird flu h5n1"}"""
  321. }
  322. for (int i = 0; i < 100; i++) {
  323. buildRestTests.setups['news'] += """
  324. {"index":{}}
  325. {"source": "filler_$i", "content": "bird dupFiller "}"""
  326. }
  327. for (int i = 0; i < 100; i++) {
  328. buildRestTests.setups['news'] += """
  329. {"index":{}}
  330. {"source": "filler_$i", "content": "flu dupFiller "}"""
  331. }
  332. for (int i = 0; i < 20; i++) {
  333. buildRestTests.setups['news'] += """
  334. {"index":{}}
  335. {"source": "partially_relevant_$i", "content": "elasticsearch dupFiller dupFiller dupFiller dupFiller pozmantier"}"""
  336. }
  337. for (int i = 0; i < 10; i++) {
  338. buildRestTests.setups['news'] += """
  339. {"index":{}}
  340. {"source": "partially_relevant_$i", "content": "elasticsearch logstash kibana"}"""
  341. }
  342. buildRestTests.setups['news'] += """
  343. """
  344. // Used by some aggregations
  345. buildRestTests.setups['exams'] = '''
  346. - do:
  347. indices.create:
  348. index: exams
  349. body:
  350. settings:
  351. number_of_shards: 1
  352. number_of_replicas: 1
  353. mappings:
  354. properties:
  355. grade:
  356. type: byte
  357. - do:
  358. bulk:
  359. index: exams
  360. refresh: true
  361. body: |
  362. {"index":{}}
  363. {"grade": 100, "weight": 2}
  364. {"index":{}}
  365. {"grade": 50, "weight": 3}'''
  366. buildRestTests.setups['stored_example_script'] = '''
  367. # Simple script to load a field. Not really a good example, but a simple one.
  368. - do:
  369. put_script:
  370. id: "my_script"
  371. body: { "script": { "lang": "painless", "source": "doc[params.field].value" } }
  372. - match: { acknowledged: true }
  373. '''
  374. buildRestTests.setups['stored_scripted_metric_script'] = '''
  375. - do:
  376. put_script:
  377. id: "my_init_script"
  378. body: { "script": { "lang": "painless", "source": "state.transactions = []" } }
  379. - match: { acknowledged: true }
  380. - do:
  381. put_script:
  382. id: "my_map_script"
  383. body: { "script": { "lang": "painless", "source": "state.transactions.add(doc.type.value == 'sale' ? doc.amount.value : -1 * doc.amount.value)" } }
  384. - match: { acknowledged: true }
  385. - do:
  386. put_script:
  387. id: "my_combine_script"
  388. body: { "script": { "lang": "painless", "source": "double profit = 0;for (t in state.transactions) { profit += t; } return profit" } }
  389. - match: { acknowledged: true }
  390. - do:
  391. put_script:
  392. id: "my_reduce_script"
  393. body: { "script": { "lang": "painless", "source": "double profit = 0;for (a in states) { profit += a; } return profit" } }
  394. - match: { acknowledged: true }
  395. '''
  396. // Used by analyze api
  397. buildRestTests.setups['analyze_sample'] = '''
  398. - do:
  399. indices.create:
  400. index: analyze_sample
  401. body:
  402. settings:
  403. number_of_shards: 1
  404. number_of_replicas: 0
  405. analysis:
  406. normalizer:
  407. my_normalizer:
  408. type: custom
  409. filter: [lowercase]
  410. mappings:
  411. properties:
  412. obj1.field1:
  413. type: text'''
  414. // Used by percentile/percentile-rank aggregations
  415. buildRestTests.setups['latency'] = '''
  416. - do:
  417. indices.create:
  418. index: latency
  419. body:
  420. settings:
  421. number_of_shards: 1
  422. number_of_replicas: 1
  423. mappings:
  424. properties:
  425. load_time:
  426. type: long
  427. - do:
  428. bulk:
  429. index: latency
  430. refresh: true
  431. body: |'''
  432. for (int i = 0; i < 100; i++) {
  433. def value = i
  434. if (i % 10) {
  435. value = i*10
  436. }
  437. buildRestTests.setups['latency'] += """
  438. {"index":{}}
  439. {"load_time": "$value"}"""
  440. }
  441. // Used by iprange agg
  442. buildRestTests.setups['iprange'] = '''
  443. - do:
  444. indices.create:
  445. index: ip_addresses
  446. body:
  447. settings:
  448. number_of_shards: 1
  449. number_of_replicas: 1
  450. mappings:
  451. properties:
  452. ip:
  453. type: ip
  454. - do:
  455. bulk:
  456. index: ip_addresses
  457. refresh: true
  458. body: |'''
  459. for (int i = 0; i < 255; i++) {
  460. buildRestTests.setups['iprange'] += """
  461. {"index":{}}
  462. {"ip": "10.0.0.$i"}"""
  463. }
  464. for (int i = 0; i < 5; i++) {
  465. buildRestTests.setups['iprange'] += """
  466. {"index":{}}
  467. {"ip": "9.0.0.$i"}"""
  468. buildRestTests.setups['iprange'] += """
  469. {"index":{}}
  470. {"ip": "11.0.0.$i"}"""
  471. buildRestTests.setups['iprange'] += """
  472. {"index":{}}
  473. {"ip": "12.0.0.$i"}"""
  474. }
  475. // Used by SQL because it looks SQL-ish
  476. buildRestTests.setups['library'] = '''
  477. - do:
  478. indices.create:
  479. include_type_name: true
  480. index: library
  481. body:
  482. settings:
  483. number_of_shards: 1
  484. number_of_replicas: 1
  485. mappings:
  486. book:
  487. properties:
  488. name:
  489. type: text
  490. fields:
  491. keyword:
  492. type: keyword
  493. author:
  494. type: text
  495. fields:
  496. keyword:
  497. type: keyword
  498. release_date:
  499. type: date
  500. page_count:
  501. type: short
  502. - do:
  503. bulk:
  504. index: library
  505. type: book
  506. refresh: true
  507. body: |
  508. {"index":{"_id": "Leviathan Wakes"}}
  509. {"name": "Leviathan Wakes", "author": "James S.A. Corey", "release_date": "2011-06-02", "page_count": 561}
  510. {"index":{"_id": "Hyperion"}}
  511. {"name": "Hyperion", "author": "Dan Simmons", "release_date": "1989-05-26", "page_count": 482}
  512. {"index":{"_id": "Dune"}}
  513. {"name": "Dune", "author": "Frank Herbert", "release_date": "1965-06-01", "page_count": 604}
  514. {"index":{"_id": "Dune Messiah"}}
  515. {"name": "Dune Messiah", "author": "Frank Herbert", "release_date": "1969-10-15", "page_count": 331}
  516. {"index":{"_id": "Children of Dune"}}
  517. {"name": "Children of Dune", "author": "Frank Herbert", "release_date": "1976-04-21", "page_count": 408}
  518. {"index":{"_id": "God Emperor of Dune"}}
  519. {"name": "God Emperor of Dune", "author": "Frank Herbert", "release_date": "1981-05-28", "page_count": 454}
  520. {"index":{"_id": "Consider Phlebas"}}
  521. {"name": "Consider Phlebas", "author": "Iain M. Banks", "release_date": "1987-04-23", "page_count": 471}
  522. {"index":{"_id": "Pandora's Star"}}
  523. {"name": "Pandora's Star", "author": "Peter F. Hamilton", "release_date": "2004-03-02", "page_count": 768}
  524. {"index":{"_id": "Revelation Space"}}
  525. {"name": "Revelation Space", "author": "Alastair Reynolds", "release_date": "2000-03-15", "page_count": 585}
  526. {"index":{"_id": "A Fire Upon the Deep"}}
  527. {"name": "A Fire Upon the Deep", "author": "Vernor Vinge", "release_date": "1992-06-01", "page_count": 613}
  528. {"index":{"_id": "Ender's Game"}}
  529. {"name": "Ender's Game", "author": "Orson Scott Card", "release_date": "1985-06-01", "page_count": 324}
  530. {"index":{"_id": "1984"}}
  531. {"name": "1984", "author": "George Orwell", "release_date": "1985-06-01", "page_count": 328}
  532. {"index":{"_id": "Fahrenheit 451"}}
  533. {"name": "Fahrenheit 451", "author": "Ray Bradbury", "release_date": "1953-10-15", "page_count": 227}
  534. {"index":{"_id": "Brave New World"}}
  535. {"name": "Brave New World", "author": "Aldous Huxley", "release_date": "1932-06-01", "page_count": 268}
  536. {"index":{"_id": "Foundation"}}
  537. {"name": "Foundation", "author": "Isaac Asimov", "release_date": "1951-06-01", "page_count": 224}
  538. {"index":{"_id": "The Giver"}}
  539. {"name": "The Giver", "author": "Lois Lowry", "release_date": "1993-04-26", "page_count": 208}
  540. {"index":{"_id": "Slaughterhouse-Five"}}
  541. {"name": "Slaughterhouse-Five", "author": "Kurt Vonnegut", "release_date": "1969-06-01", "page_count": 275}
  542. {"index":{"_id": "The Hitchhiker's Guide to the Galaxy"}}
  543. {"name": "The Hitchhiker's Guide to the Galaxy", "author": "Douglas Adams", "release_date": "1979-10-12", "page_count": 180}
  544. {"index":{"_id": "Snow Crash"}}
  545. {"name": "Snow Crash", "author": "Neal Stephenson", "release_date": "1992-06-01", "page_count": 470}
  546. {"index":{"_id": "Neuromancer"}}
  547. {"name": "Neuromancer", "author": "William Gibson", "release_date": "1984-07-01", "page_count": 271}
  548. {"index":{"_id": "The Handmaid's Tale"}}
  549. {"name": "The Handmaid's Tale", "author": "Margaret Atwood", "release_date": "1985-06-01", "page_count": 311}
  550. {"index":{"_id": "Starship Troopers"}}
  551. {"name": "Starship Troopers", "author": "Robert A. Heinlein", "release_date": "1959-12-01", "page_count": 335}
  552. {"index":{"_id": "The Left Hand of Darkness"}}
  553. {"name": "The Left Hand of Darkness", "author": "Ursula K. Le Guin", "release_date": "1969-06-01", "page_count": 304}
  554. {"index":{"_id": "The Moon is a Harsh Mistress"}}
  555. {"name": "The Moon is a Harsh Mistress", "author": "Robert A. Heinlein", "release_date": "1966-04-01", "page_count": 288}
  556. '''
  557. buildRestTests.setups['sensor_rollup_job'] = '''
  558. - do:
  559. indices.create:
  560. index: sensor-1
  561. body:
  562. settings:
  563. number_of_shards: 1
  564. number_of_replicas: 0
  565. mappings:
  566. properties:
  567. timestamp:
  568. type: date
  569. temperature:
  570. type: long
  571. voltage:
  572. type: float
  573. node:
  574. type: keyword
  575. - do:
  576. raw:
  577. method: PUT
  578. path: _rollup/job/sensor
  579. body: >
  580. {
  581. "index_pattern": "sensor-*",
  582. "rollup_index": "sensor_rollup",
  583. "cron": "*/30 * * * * ?",
  584. "page_size" :1000,
  585. "groups" : {
  586. "date_histogram": {
  587. "field": "timestamp",
  588. "fixed_interval": "1h",
  589. "delay": "7d"
  590. },
  591. "terms": {
  592. "fields": ["node"]
  593. }
  594. },
  595. "metrics": [
  596. {
  597. "field": "temperature",
  598. "metrics": ["min", "max", "sum"]
  599. },
  600. {
  601. "field": "voltage",
  602. "metrics": ["avg"]
  603. }
  604. ]
  605. }
  606. '''
  607. buildRestTests.setups['sensor_started_rollup_job'] = '''
  608. - do:
  609. indices.create:
  610. index: sensor-1
  611. body:
  612. settings:
  613. number_of_shards: 1
  614. number_of_replicas: 0
  615. mappings:
  616. properties:
  617. timestamp:
  618. type: date
  619. temperature:
  620. type: long
  621. voltage:
  622. type: float
  623. node:
  624. type: keyword
  625. - do:
  626. bulk:
  627. index: sensor-1
  628. refresh: true
  629. body: |
  630. {"index":{}}
  631. {"timestamp": 1516729294000, "temperature": 200, "voltage": 5.2, "node": "a"}
  632. {"index":{}}
  633. {"timestamp": 1516642894000, "temperature": 201, "voltage": 5.8, "node": "b"}
  634. {"index":{}}
  635. {"timestamp": 1516556494000, "temperature": 202, "voltage": 5.1, "node": "a"}
  636. {"index":{}}
  637. {"timestamp": 1516470094000, "temperature": 198, "voltage": 5.6, "node": "b"}
  638. {"index":{}}
  639. {"timestamp": 1516383694000, "temperature": 200, "voltage": 4.2, "node": "c"}
  640. {"index":{}}
  641. {"timestamp": 1516297294000, "temperature": 202, "voltage": 4.0, "node": "c"}
  642. - do:
  643. raw:
  644. method: PUT
  645. path: _rollup/job/sensor
  646. body: >
  647. {
  648. "index_pattern": "sensor-*",
  649. "rollup_index": "sensor_rollup",
  650. "cron": "* * * * * ?",
  651. "page_size" :1000,
  652. "groups" : {
  653. "date_histogram": {
  654. "field": "timestamp",
  655. "fixed_interval": "1h",
  656. "delay": "7d"
  657. },
  658. "terms": {
  659. "fields": ["node"]
  660. }
  661. },
  662. "metrics": [
  663. {
  664. "field": "temperature",
  665. "metrics": ["min", "max", "sum"]
  666. },
  667. {
  668. "field": "voltage",
  669. "metrics": ["avg"]
  670. }
  671. ]
  672. }
  673. - do:
  674. raw:
  675. method: POST
  676. path: _rollup/job/sensor/_start
  677. '''
  678. buildRestTests.setups['sensor_index'] = '''
  679. - do:
  680. indices.create:
  681. index: sensor-1
  682. body:
  683. settings:
  684. number_of_shards: 1
  685. number_of_replicas: 0
  686. mappings:
  687. properties:
  688. timestamp:
  689. type: date
  690. temperature:
  691. type: long
  692. voltage:
  693. type: float
  694. node:
  695. type: keyword
  696. load:
  697. type: double
  698. net_in:
  699. type: long
  700. net_out:
  701. type: long
  702. hostname:
  703. type: keyword
  704. datacenter:
  705. type: keyword
  706. '''
  707. buildRestTests.setups['sensor_prefab_data'] = '''
  708. - do:
  709. indices.create:
  710. index: sensor-1
  711. body:
  712. settings:
  713. number_of_shards: 1
  714. number_of_replicas: 0
  715. mappings:
  716. properties:
  717. timestamp:
  718. type: date
  719. temperature:
  720. type: long
  721. voltage:
  722. type: float
  723. node:
  724. type: keyword
  725. - do:
  726. indices.create:
  727. index: sensor_rollup
  728. body:
  729. settings:
  730. number_of_shards: 1
  731. number_of_replicas: 0
  732. mappings:
  733. properties:
  734. node.terms.value:
  735. type: keyword
  736. temperature.sum.value:
  737. type: double
  738. temperature.max.value:
  739. type: double
  740. temperature.min.value:
  741. type: double
  742. timestamp.date_histogram.time_zone:
  743. type: keyword
  744. timestamp.date_histogram.interval:
  745. type: keyword
  746. timestamp.date_histogram.timestamp:
  747. type: date
  748. timestamp.date_histogram._count:
  749. type: long
  750. voltage.avg.value:
  751. type: double
  752. voltage.avg._count:
  753. type: long
  754. _rollup.id:
  755. type: keyword
  756. _rollup.version:
  757. type: long
  758. _meta:
  759. _rollup:
  760. sensor:
  761. cron: "* * * * * ?"
  762. rollup_index: "sensor_rollup"
  763. index_pattern: "sensor-*"
  764. timeout: "20s"
  765. page_size: 1000
  766. groups:
  767. date_histogram:
  768. delay: "7d"
  769. field: "timestamp"
  770. fixed_interval: "60m"
  771. time_zone: "UTC"
  772. terms:
  773. fields:
  774. - "node"
  775. id: sensor
  776. metrics:
  777. - field: "temperature"
  778. metrics:
  779. - min
  780. - max
  781. - sum
  782. - field: "voltage"
  783. metrics:
  784. - avg
  785. - do:
  786. bulk:
  787. index: sensor_rollup
  788. refresh: true
  789. body: |
  790. {"index":{}}
  791. {"node.terms.value":"b","temperature.sum.value":201.0,"temperature.max.value":201.0,"timestamp.date_histogram.time_zone":"UTC","temperature.min.value":201.0,"timestamp.date_histogram._count":1,"timestamp.date_histogram.interval":"1h","_rollup.computed":["temperature.sum","temperature.min","voltage.avg","temperature.max","node.terms","timestamp.date_histogram"],"voltage.avg.value":5.800000190734863,"node.terms._count":1,"_rollup.version":1,"timestamp.date_histogram.timestamp":1516640400000,"voltage.avg._count":1.0,"_rollup.id":"sensor"}
  792. {"index":{}}
  793. {"node.terms.value":"c","temperature.sum.value":200.0,"temperature.max.value":200.0,"timestamp.date_histogram.time_zone":"UTC","temperature.min.value":200.0,"timestamp.date_histogram._count":1,"timestamp.date_histogram.interval":"1h","_rollup.computed":["temperature.sum","temperature.min","voltage.avg","temperature.max","node.terms","timestamp.date_histogram"],"voltage.avg.value":4.199999809265137,"node.terms._count":1,"_rollup.version":1,"timestamp.date_histogram.timestamp":1516381200000,"voltage.avg._count":1.0,"_rollup.id":"sensor"}
  794. {"index":{}}
  795. {"node.terms.value":"a","temperature.sum.value":202.0,"temperature.max.value":202.0,"timestamp.date_histogram.time_zone":"UTC","temperature.min.value":202.0,"timestamp.date_histogram._count":1,"timestamp.date_histogram.interval":"1h","_rollup.computed":["temperature.sum","temperature.min","voltage.avg","temperature.max","node.terms","timestamp.date_histogram"],"voltage.avg.value":5.099999904632568,"node.terms._count":1,"_rollup.version":1,"timestamp.date_histogram.timestamp":1516554000000,"voltage.avg._count":1.0,"_rollup.id":"sensor"}
  796. {"index":{}}
  797. {"node.terms.value":"a","temperature.sum.value":200.0,"temperature.max.value":200.0,"timestamp.date_histogram.time_zone":"UTC","temperature.min.value":200.0,"timestamp.date_histogram._count":1,"timestamp.date_histogram.interval":"1h","_rollup.computed":["temperature.sum","temperature.min","voltage.avg","temperature.max","node.terms","timestamp.date_histogram"],"voltage.avg.value":5.199999809265137,"node.terms._count":1,"_rollup.version":1,"timestamp.date_histogram.timestamp":1516726800000,"voltage.avg._count":1.0,"_rollup.id":"sensor"}
  798. {"index":{}}
  799. {"node.terms.value":"b","temperature.sum.value":198.0,"temperature.max.value":198.0,"timestamp.date_histogram.time_zone":"UTC","temperature.min.value":198.0,"timestamp.date_histogram._count":1,"timestamp.date_histogram.interval":"1h","_rollup.computed":["temperature.sum","temperature.min","voltage.avg","temperature.max","node.terms","timestamp.date_histogram"],"voltage.avg.value":5.599999904632568,"node.terms._count":1,"_rollup.version":1,"timestamp.date_histogram.timestamp":1516467600000,"voltage.avg._count":1.0,"_rollup.id":"sensor"}
  800. {"index":{}}
  801. {"node.terms.value":"c","temperature.sum.value":202.0,"temperature.max.value":202.0,"timestamp.date_histogram.time_zone":"UTC","temperature.min.value":202.0,"timestamp.date_histogram._count":1,"timestamp.date_histogram.interval":"1h","_rollup.computed":["temperature.sum","temperature.min","voltage.avg","temperature.max","node.terms","timestamp.date_histogram"],"voltage.avg.value":4.0,"node.terms._count":1,"_rollup.version":1,"timestamp.date_histogram.timestamp":1516294800000,"voltage.avg._count":1.0,"_rollup.id":"sensor"}
  802. '''
  803. buildRestTests.setups['sample_job'] = '''
  804. - do:
  805. ml.put_job:
  806. job_id: "sample_job"
  807. body: >
  808. {
  809. "description" : "Very basic job",
  810. "analysis_config" : {
  811. "bucket_span":"10m",
  812. "detectors" :[
  813. {
  814. "function": "count"
  815. }
  816. ]},
  817. "data_description" : {
  818. "time_field":"timestamp",
  819. "time_format": "epoch_ms"
  820. }
  821. }
  822. '''
  823. buildRestTests.setups['farequote_index'] = '''
  824. - do:
  825. indices.create:
  826. index: farequote
  827. body:
  828. settings:
  829. number_of_shards: 1
  830. number_of_replicas: 0
  831. mappings:
  832. metric:
  833. properties:
  834. time:
  835. type: date
  836. responsetime:
  837. type: float
  838. airline:
  839. type: keyword
  840. doc_count:
  841. type: integer
  842. '''
  843. buildRestTests.setups['farequote_data'] = buildRestTests.setups['farequote_index'] + '''
  844. - do:
  845. bulk:
  846. index: farequote
  847. type: metric
  848. refresh: true
  849. body: |
  850. {"index": {"_id":"1"}}
  851. {"airline":"JZA","responsetime":990.4628,"time":"2016-02-07T00:00:00+0000", "doc_count": 5}
  852. {"index": {"_id":"2"}}
  853. {"airline":"JBU","responsetime":877.5927,"time":"2016-02-07T00:00:00+0000", "doc_count": 23}
  854. {"index": {"_id":"3"}}
  855. {"airline":"KLM","responsetime":1355.4812,"time":"2016-02-07T00:00:00+0000", "doc_count": 42}
  856. '''
  857. buildRestTests.setups['farequote_job'] = buildRestTests.setups['farequote_data'] + '''
  858. - do:
  859. ml.put_job:
  860. job_id: "farequote"
  861. body: >
  862. {
  863. "analysis_config": {
  864. "bucket_span": "60m",
  865. "detectors": [{
  866. "function": "mean",
  867. "field_name": "responsetime",
  868. "by_field_name": "airline"
  869. }],
  870. "summary_count_field_name": "doc_count"
  871. },
  872. "data_description": {
  873. "time_field": "time"
  874. }
  875. }
  876. '''
  877. buildRestTests.setups['farequote_datafeed'] = buildRestTests.setups['farequote_job'] + '''
  878. - do:
  879. ml.put_datafeed:
  880. datafeed_id: "datafeed-farequote"
  881. body: >
  882. {
  883. "job_id":"farequote",
  884. "indexes":"farequote"
  885. }
  886. '''
  887. buildRestTests.setups['server_metrics_index'] = '''
  888. - do:
  889. indices.create:
  890. index: server-metrics
  891. body:
  892. settings:
  893. number_of_shards: 1
  894. number_of_replicas: 0
  895. mappings:
  896. metric:
  897. properties:
  898. timestamp:
  899. type: date
  900. total:
  901. type: long
  902. '''
  903. buildRestTests.setups['server_metrics_data'] = buildRestTests.setups['server_metrics_index'] + '''
  904. - do:
  905. bulk:
  906. index: server-metrics
  907. type: metric
  908. refresh: true
  909. body: |
  910. {"index": {"_id":"1177"}}
  911. {"timestamp":"2017-03-23T13:00:00","total":40476}
  912. {"index": {"_id":"1178"}}
  913. {"timestamp":"2017-03-23T13:00:00","total":15287}
  914. {"index": {"_id":"1179"}}
  915. {"timestamp":"2017-03-23T13:00:00","total":-776}
  916. {"index": {"_id":"1180"}}
  917. {"timestamp":"2017-03-23T13:00:00","total":11366}
  918. {"index": {"_id":"1181"}}
  919. {"timestamp":"2017-03-23T13:00:00","total":3606}
  920. {"index": {"_id":"1182"}}
  921. {"timestamp":"2017-03-23T13:00:00","total":19006}
  922. {"index": {"_id":"1183"}}
  923. {"timestamp":"2017-03-23T13:00:00","total":38613}
  924. {"index": {"_id":"1184"}}
  925. {"timestamp":"2017-03-23T13:00:00","total":19516}
  926. {"index": {"_id":"1185"}}
  927. {"timestamp":"2017-03-23T13:00:00","total":-258}
  928. {"index": {"_id":"1186"}}
  929. {"timestamp":"2017-03-23T13:00:00","total":9551}
  930. {"index": {"_id":"1187"}}
  931. {"timestamp":"2017-03-23T13:00:00","total":11217}
  932. {"index": {"_id":"1188"}}
  933. {"timestamp":"2017-03-23T13:00:00","total":22557}
  934. {"index": {"_id":"1189"}}
  935. {"timestamp":"2017-03-23T13:00:00","total":40508}
  936. {"index": {"_id":"1190"}}
  937. {"timestamp":"2017-03-23T13:00:00","total":11887}
  938. {"index": {"_id":"1191"}}
  939. {"timestamp":"2017-03-23T13:00:00","total":31659}
  940. '''
  941. buildRestTests.setups['server_metrics_job'] = buildRestTests.setups['server_metrics_data'] + '''
  942. - do:
  943. ml.put_job:
  944. job_id: "total-requests"
  945. body: >
  946. {
  947. "description" : "Total sum of requests",
  948. "analysis_config" : {
  949. "bucket_span":"10m",
  950. "detectors" :[
  951. {
  952. "detector_description": "Sum of total",
  953. "function": "sum",
  954. "field_name": "total"
  955. }
  956. ]},
  957. "data_description" : {
  958. "time_field":"timestamp",
  959. "time_format": "epoch_ms"
  960. }
  961. }
  962. '''
  963. buildRestTests.setups['server_metrics_datafeed'] = buildRestTests.setups['server_metrics_job'] + '''
  964. - do:
  965. ml.put_datafeed:
  966. datafeed_id: "datafeed-total-requests"
  967. body: >
  968. {
  969. "job_id":"total-requests",
  970. "indexes":"server-metrics"
  971. }
  972. '''
  973. buildRestTests.setups['server_metrics_openjob'] = buildRestTests.setups['server_metrics_datafeed'] + '''
  974. - do:
  975. ml.open_job:
  976. job_id: "total-requests"
  977. '''
  978. buildRestTests.setups['server_metrics_startdf'] = buildRestTests.setups['server_metrics_openjob'] + '''
  979. - do:
  980. ml.start_datafeed:
  981. datafeed_id: "datafeed-total-requests"
  982. '''
  983. buildRestTests.setups['calendar_outages'] = '''
  984. - do:
  985. ml.put_calendar:
  986. calendar_id: "planned-outages"
  987. '''
  988. buildRestTests.setups['calendar_outages_addevent'] = buildRestTests.setups['calendar_outages'] + '''
  989. - do:
  990. ml.post_calendar_events:
  991. calendar_id: "planned-outages"
  992. body: >
  993. { "description": "event 1", "start_time": "2017-12-01T00:00:00Z", "end_time": "2017-12-02T00:00:00Z", "calendar_id": "planned-outages" }
  994. '''
  995. buildRestTests.setups['calendar_outages_openjob'] = buildRestTests.setups['server_metrics_openjob'] + '''
  996. - do:
  997. ml.put_calendar:
  998. calendar_id: "planned-outages"
  999. '''
  1000. buildRestTests.setups['calendar_outages_addjob'] = buildRestTests.setups['server_metrics_openjob'] + '''
  1001. - do:
  1002. ml.put_calendar:
  1003. calendar_id: "planned-outages"
  1004. body: >
  1005. {
  1006. "job_ids": ["total-requests"]
  1007. }
  1008. '''
  1009. buildRestTests.setups['calendar_outages_addevent'] = buildRestTests.setups['calendar_outages_addjob'] + '''
  1010. - do:
  1011. ml.post_calendar_events:
  1012. calendar_id: "planned-outages"
  1013. body: >
  1014. { "events" : [
  1015. { "description": "event 1", "start_time": "1513641600000", "end_time": "1513728000000"},
  1016. { "description": "event 2", "start_time": "1513814400000", "end_time": "1513900800000"},
  1017. { "description": "event 3", "start_time": "1514160000000", "end_time": "1514246400000"}
  1018. ]}
  1019. '''
  1020. // used by median absolute deviation aggregation
  1021. buildRestTests.setups['reviews'] = '''
  1022. - do:
  1023. indices.create:
  1024. index: reviews
  1025. body:
  1026. settings:
  1027. number_of_shards: 1
  1028. number_of_replicas: 0
  1029. mappings:
  1030. properties:
  1031. product:
  1032. type: keyword
  1033. rating:
  1034. type: long
  1035. - do:
  1036. bulk:
  1037. index: reviews
  1038. refresh: true
  1039. body: |
  1040. {"index": {"_id": "1"}}
  1041. {"product": "widget-foo", "rating": 1}
  1042. {"index": {"_id": "2"}}
  1043. {"product": "widget-foo", "rating": 5}
  1044. '''
  1045. buildRestTests.setups['remote_cluster'] = buildRestTests.setups['host'] + '''
  1046. - do:
  1047. cluster.put_settings:
  1048. body:
  1049. persistent:
  1050. cluster.remote.remote_cluster.seeds: $transport_host
  1051. '''
  1052. buildRestTests.setups['remote_cluster_and_leader_index'] = buildRestTests.setups['remote_cluster'] + '''
  1053. - do:
  1054. indices.create:
  1055. index: leader_index
  1056. body:
  1057. settings:
  1058. index.number_of_replicas: 0
  1059. index.number_of_shards: 1
  1060. index.soft_deletes.enabled: true
  1061. '''
  1062. buildRestTests.setups['seats'] = '''
  1063. - do:
  1064. indices.create:
  1065. index: seats
  1066. body:
  1067. settings:
  1068. number_of_shards: 1
  1069. number_of_replicas: 0
  1070. mappings:
  1071. properties:
  1072. theatre:
  1073. type: keyword
  1074. cost:
  1075. type: long
  1076. row:
  1077. type: long
  1078. number:
  1079. type: long
  1080. sold:
  1081. type: boolean
  1082. - do:
  1083. bulk:
  1084. index: seats
  1085. refresh: true
  1086. body: |
  1087. {"index":{"_id": "1"}}
  1088. {"theatre": "Skyline", "cost": 37, "row": 1, "number": 7, "sold": false}
  1089. {"index":{"_id": "2"}}
  1090. {"theatre": "Graye", "cost": 30, "row": 3, "number": 5, "sold": false}
  1091. {"index":{"_id": "3"}}
  1092. {"theatre": "Graye", "cost": 33, "row": 2, "number": 6, "sold": false}
  1093. {"index":{"_id": "4"}}
  1094. {"theatre": "Skyline", "cost": 20, "row": 5, "number": 2, "sold": false}'''
  1095. buildRestTests.setups['kibana_sample_data_ecommerce'] = '''
  1096. - do:
  1097. indices.create:
  1098. index: kibana_sample_data_ecommerce
  1099. body:
  1100. settings:
  1101. number_of_shards: 1
  1102. number_of_replicas: 0
  1103. '''
  1104. buildRestTests.setups['simple_kibana_continuous_pivot'] = buildRestTests.setups['kibana_sample_data_ecommerce'] + '''
  1105. - do:
  1106. raw:
  1107. method: PUT
  1108. path: _data_frame/transforms/simple-kibana-ecomm-pivot
  1109. body: >
  1110. {
  1111. "source": {
  1112. "index": "kibana_sample_data_ecommerce",
  1113. "query": {
  1114. "term": {
  1115. "geoip.continent_name": {
  1116. "value": "Asia"
  1117. }
  1118. }
  1119. }
  1120. },
  1121. "pivot": {
  1122. "group_by": {
  1123. "customer_id": {
  1124. "terms": {
  1125. "field": "customer_id"
  1126. }
  1127. }
  1128. },
  1129. "aggregations": {
  1130. "max_price": {
  1131. "max": {
  1132. "field": "taxful_total_price"
  1133. }
  1134. }
  1135. }
  1136. },
  1137. "description": "Maximum priced ecommerce data",
  1138. "dest": {
  1139. "index": "kibana_sample_data_ecommerce_transform",
  1140. "pipeline": "add_timestamp_pipeline"
  1141. },
  1142. "frequency": "5m",
  1143. "sync": {
  1144. "time": {
  1145. "field": "order_date",
  1146. "delay": "60s"
  1147. }
  1148. }
  1149. }
  1150. '''
  1151. buildRestTests.setups['setup_logdata'] = '''
  1152. - do:
  1153. indices.create:
  1154. index: logdata
  1155. body:
  1156. settings:
  1157. number_of_shards: 1
  1158. number_of_replicas: 1
  1159. mappings:
  1160. properties:
  1161. grade:
  1162. type: byte
  1163. - do:
  1164. bulk:
  1165. index: logdata
  1166. refresh: true
  1167. body: |
  1168. {"index":{}}
  1169. {"grade": 100, "weight": 2}
  1170. {"index":{}}
  1171. {"grade": 50, "weight": 3}
  1172. '''
  1173. buildRestTests.setups['logdata_job'] = buildRestTests.setups['setup_logdata'] + '''
  1174. - do:
  1175. ml.put_data_frame_analytics:
  1176. id: "loganalytics"
  1177. body: >
  1178. {
  1179. "source": {
  1180. "index": "logdata"
  1181. },
  1182. "dest": {
  1183. "index": "logdata_out"
  1184. },
  1185. "analysis": {
  1186. "outlier_detection": {}
  1187. }
  1188. }
  1189. '''
  1190. // Used by snapshot lifecycle management docs
  1191. buildRestTests.setups['setup-repository'] = '''
  1192. - do:
  1193. snapshot.create_repository:
  1194. repository: my_repository
  1195. body:
  1196. type: fs
  1197. settings:
  1198. location: buildDir/cluster/shared/repo
  1199. '''