From 705804ee0c2bd494c82cee278361a5aaf73658ae Mon Sep 17 00:00:00 2001 From: Lisa Cawley Date: Thu, 25 Jan 2018 09:33:21 -0800 Subject: [PATCH] [DOCS] Compacted setup scripts in build.gradle (elastic/x-pack-elasticsearch#3573) Original commit: elastic/x-pack-elasticsearch@265950c186c161f209c8b3dfed0af6dd7e32b2bc --- docs/build.gradle | 85 ++--------------------------------------------- 1 file changed, 2 insertions(+), 83 deletions(-) diff --git a/docs/build.gradle b/docs/build.gradle index 771792fe08b..84e228fe06c 100644 --- a/docs/build.gradle +++ b/docs/build.gradle @@ -253,41 +253,7 @@ setups['server_metrics_job'] = ''' } } ''' -setups['server_metrics_openjob'] = ''' - - do: - indices.create: - index: server-metrics - body: - settings: - number_of_shards: 1 - number_of_replicas: 0 - mappings: - metric: - properties: - timestamp: - type: date - total: - type: long - - do: - xpack.ml.put_job: - job_id: "total-requests" - body: > - { - "description" : "Total sum of requests", - "analysis_config" : { - "bucket_span":"10m", - "detectors" :[ - { - "detector_description": "Sum of total", - "function": "sum", - "field_name": "total" - } - ]}, - "data_description" : { - "time_field":"timestamp", - "time_format": "epoch_ms" - } - } +setups['server_metrics_openjob'] = setups['server_metrics_job'] + ''' - do: xpack.ml.put_datafeed: datafeed_id: "datafeed-total-requests" @@ -301,54 +267,7 @@ setups['server_metrics_openjob'] = ''' xpack.ml.open_job: job_id: "total-requests" ''' - -setups['server_metrics_startdf'] = ''' - - do: - indices.create: - index: server-metrics - body: - settings: - number_of_shards: 1 - number_of_replicas: 0 - mappings: - metric: - properties: - timestamp: - type: date - total: - type: long - - do: - xpack.ml.put_job: - job_id: "total-requests" - body: > - { - "description" : "Total sum of requests", - "analysis_config" : { - "bucket_span":"10m", - "detectors" :[ - { - "detector_description": "Sum of total", - "function": "sum", - "field_name": "total" - } - ]}, - "data_description" : { - "time_field":"timestamp", - "time_format": "epoch_ms" - } - } - - do: - xpack.ml.put_datafeed: - datafeed_id: "datafeed-total-requests" - body: > - { - "job_id":"total-requests", - "indexes":"server-metrics", - "types":"metric" - } - - do: - xpack.ml.open_job: - job_id: "total-requests" +setups['server_metrics_startdf'] = setups['server_metrics_openjob'] + ''' - do: xpack.ml.start_datafeed: datafeed_id: "datafeed-total-requests"