From 5d7263b69e29b086ae6185f9d491388fe4bd7f8a Mon Sep 17 00:00:00 2001 From: Clinton Gormley Date: Tue, 22 Apr 2014 19:14:26 +0200 Subject: [PATCH] [SPEC] Renamed benchmark endpoints benchmark.submit -> benchmark benchmark.list -> list_benchmarks benchmark.abort -> abort_benchmark And fixed the related tests --- ...chmark.abort.json => abort_benchmark.json} | 2 +- .../{benchmark.submit.json => benchmark.json} | 3 +- ...nchmark.list.json => list_benchmarks.json} | 3 +- .../10_basic.yaml | 2 +- .../test/benchmark.list/10_basic.yaml | 7 ---- .../test/benchmark.submit/10_basic.yaml | 32 ------------------- rest-api-spec/test/benchmark/10_basic.yaml | 30 +++++++++++++++++ 7 files changed, 34 insertions(+), 45 deletions(-) rename rest-api-spec/api/{benchmark.abort.json => abort_benchmark.json} (95%) rename rest-api-spec/api/{benchmark.submit.json => benchmark.json} (94%) rename rest-api-spec/api/{benchmark.list.json => list_benchmarks.json} (92%) rename rest-api-spec/test/{benchmark.abort => abort_benchmark}/10_basic.yaml (78%) delete mode 100644 rest-api-spec/test/benchmark.list/10_basic.yaml delete mode 100644 rest-api-spec/test/benchmark.submit/10_basic.yaml create mode 100644 rest-api-spec/test/benchmark/10_basic.yaml diff --git a/rest-api-spec/api/benchmark.abort.json b/rest-api-spec/api/abort_benchmark.json similarity index 95% rename from rest-api-spec/api/benchmark.abort.json rename to rest-api-spec/api/abort_benchmark.json index 9759cdc5d54..6134199f998 100644 --- a/rest-api-spec/api/benchmark.abort.json +++ b/rest-api-spec/api/abort_benchmark.json @@ -1,5 +1,5 @@ { - "benchmark.abort" : { + "abort_benchmark" : { "documentation": "http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-benchmark.html", "methods": ["POST"], "url": { diff --git a/rest-api-spec/api/benchmark.submit.json b/rest-api-spec/api/benchmark.json similarity index 94% rename from rest-api-spec/api/benchmark.submit.json rename to rest-api-spec/api/benchmark.json index 48b86b395b7..4bbed21bd23 100644 --- a/rest-api-spec/api/benchmark.submit.json +++ b/rest-api-spec/api/benchmark.json @@ -1,5 +1,5 @@ { - "benchmark.submit" : { + "benchmark" : { "documentation": "http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-benchmark.html", "methods": ["PUT"], "url": { @@ -16,7 +16,6 @@ }, "type": { "type" : "string", - "required" : true, "description" : "The name of the document type" } }, diff --git a/rest-api-spec/api/benchmark.list.json b/rest-api-spec/api/list_benchmarks.json similarity index 92% rename from rest-api-spec/api/benchmark.list.json rename to rest-api-spec/api/list_benchmarks.json index 5f068d6846b..7e3cfb6e182 100644 --- a/rest-api-spec/api/benchmark.list.json +++ b/rest-api-spec/api/list_benchmarks.json @@ -1,5 +1,5 @@ { - "benchmark.list" : { + "list_benchmarks" : { "documentation": "http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-benchmark.html", "methods": ["GET"], "url": { @@ -16,7 +16,6 @@ }, "type": { "type" : "string", - "required" : true, "description" : "The name of the document type" } }, diff --git a/rest-api-spec/test/benchmark.abort/10_basic.yaml b/rest-api-spec/test/abort_benchmark/10_basic.yaml similarity index 78% rename from rest-api-spec/test/benchmark.abort/10_basic.yaml rename to rest-api-spec/test/abort_benchmark/10_basic.yaml index 50089a0afed..a48c112fa0a 100644 --- a/rest-api-spec/test/benchmark.abort/10_basic.yaml +++ b/rest-api-spec/test/abort_benchmark/10_basic.yaml @@ -2,7 +2,7 @@ "Test benchmark abort": - do: - benchmark.abort: + abort_benchmark: name: my_benchmark catch: request diff --git a/rest-api-spec/test/benchmark.list/10_basic.yaml b/rest-api-spec/test/benchmark.list/10_basic.yaml deleted file mode 100644 index 4ae1ae0f3bf..00000000000 --- a/rest-api-spec/test/benchmark.list/10_basic.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -"Test benchmark list": - - - do: - benchmark.list: {} - catch: request - diff --git a/rest-api-spec/test/benchmark.submit/10_basic.yaml b/rest-api-spec/test/benchmark.submit/10_basic.yaml deleted file mode 100644 index 293acbdd2f6..00000000000 --- a/rest-api-spec/test/benchmark.submit/10_basic.yaml +++ /dev/null @@ -1,32 +0,0 @@ ---- -"Test benchmark submit": - - - do: - indices.create: - index: test_1 - body: - settings: - index: - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: yellow - - - do: - benchmark.submit: - index: test_1 - body: { - "name": "my_benchmark", - "competitors": [ { - "name": "my_competitor", - "requests": [ { - "query": { - "match": { "_all": "*" } - } - } ] - } ] - } - catch: request - - diff --git a/rest-api-spec/test/benchmark/10_basic.yaml b/rest-api-spec/test/benchmark/10_basic.yaml new file mode 100644 index 00000000000..6164029a38d --- /dev/null +++ b/rest-api-spec/test/benchmark/10_basic.yaml @@ -0,0 +1,30 @@ +--- +"Test benchmark submit": + + - do: + indices.create: + index: test_1 + body: + settings: + index: + number_of_replicas: 0 + + - do: + cluster.health: + wait_for_status: yellow + + - do: + benchmark: + index: test_1 + body: + "name": "my_benchmark" + "competitors": + - + "name": "my_competitor" + "requests": + - + "query": + "match": { "_all": "*" } + + - match: { status: complete } +