Skip to content

Commit

Permalink
Add missing /cat API tests. (#521)
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <[email protected]>
  • Loading branch information
dblock authored Aug 22, 2024
1 parent 772b1c8 commit b28c1cf
Show file tree
Hide file tree
Showing 25 changed files with 185 additions and 49 deletions.
4 changes: 2 additions & 2 deletions tests/default/cat/aliases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ prologues:
index: games
name: jeux
chapters:
- synopsis: Cat with a text response.
- synopsis: List the mapping of aliases to indexes, plus routing and filtering information in plain text.
path: /_cat/aliases
method: GET
response:
status: 200
content_type: text/plain
- synopsis: Cat with a json response.
- synopsis: List the mapping of aliases to indexes, plus routing and filtering information in json.
path: /_cat/aliases/{name}
parameters:
format: json
Expand Down
12 changes: 11 additions & 1 deletion tests/default/cat/allocation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,20 @@ $schema: ../../../json_schemas/test_story.schema.yaml

description: Test cat/allocation endpoints.
chapters:
- synopsis: Cat with a json response.
- synopsis: List the allocation of disk space for indexes and the number of shards on each node.
path: /_cat/allocation
method: GET
parameters:
format: json
response:
status: 200
- synopsis: List the allocation of disk space for indexes and the number of shards on a data node.
path: /_cat/allocation/{node_id}
method: GET
parameters:
node_id: data:true
format: json
bytes: kb
local: true
response:
status: 200
2 changes: 1 addition & 1 deletion tests/default/cat/cluster_manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ $schema: ../../../json_schemas/test_story.schema.yaml

description: Test cat/cluster_manager endpoints.
chapters:
- synopsis: Cat with a json response.
- synopsis: List information that helps identify the elected cluster manager node.
version: '>= 2.0'
path: /_cat/cluster_manager
method: GET
Expand Down
27 changes: 26 additions & 1 deletion tests/default/cat/count.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,36 @@
$schema: ../../../json_schemas/test_story.schema.yaml

description: Test cat/count endpoints.
prologues:
- path: /movies/_doc
method: POST
parameters:
refresh: true
request:
payload:
director: Bennett Miller
title: Moneyball
year: 2011
status: [201]
epilogues:
- path: /movies
method: DELETE
status: [200, 404]
chapters:
- synopsis: Cat with a json response.
- synopsis: List the number of documents in the cluster.
path: /_cat/count
method: GET
parameters:
format: json
response:
status: 200
- synopsis: List the number of documents in an index.
path: /_cat/count/{index}
method: GET
parameters:
index: movies
format: json
response:
status: 200
payload:
- count: '1'
15 changes: 13 additions & 2 deletions tests/default/cat/fielddata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ $schema: ../../../json_schemas/test_story.schema.yaml

description: Test cat/fielddata endpoints.
chapters:
- synopsis: Cat with an empty response.
- synopsis: List the memory size used by each field per node.
path: /_cat/fielddata
method: GET
parameters:
format: json
response:
status: 200
- synopsis: Cat with a json response (from security-analytics).
- synopsis: List the memory size used by each field per node with data from security-analytics.
version: '>= 2.4'
path: /_cat/fielddata
method: GET
Expand All @@ -19,3 +19,14 @@ chapters:
status: 200
payload:
- field: log_types
- synopsis: List the memory size used by each field per node with data from security-analytics.
version: '>= 2.4'
path: /_cat/fielddata/{fields}
method: GET
parameters:
format: json
fields: log_types
response:
status: 200
payload:
- field: log_types
22 changes: 11 additions & 11 deletions tests/default/cat/health.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ $schema: ../../../json_schemas/test_story.schema.yaml

description: Test cat/health endpoints.
chapters:
- synopsis: Cat with a default text response.
- synopsis: List the status of the cluster in plain text.
method: GET
path: /_cat/health
response:
status: 200
content_type: text/plain
- synopsis: Cat with verbose output (v=true).
- synopsis: List the status of the cluster with verbose output (v=true).
method: GET
path: /_cat/health
parameters:
v: true
response:
status: 200
content_type: text/plain
- synopsis: Cat with headers (h=header1,header2).
- synopsis: List the status of the cluster with headers (h=header1,header2).
method: GET
path: /_cat/health
parameters:
Expand All @@ -26,15 +26,15 @@ chapters:
response:
status: 200
content_type: text/plain
- synopsis: Cat displaying all available headers (help=true).
- synopsis: List the status of the cluster displaying all available headers (help=true).
method: GET
path: /_cat/health
parameters:
help: true
response:
status: 200
content_type: text/plain
- synopsis: Cat with sorted results.
- synopsis: List the status of the cluster with sorted results.
method: GET
path: /_cat/health
parameters:
Expand All @@ -43,7 +43,7 @@ chapters:
response:
status: 200
content_type: text/plain
- synopsis: Cat in different formats (format=json).
- synopsis: List the status of the cluster in different formats (format=json).
method: GET
path: /_cat/health
parameters:
Expand All @@ -54,7 +54,7 @@ chapters:
payload:
- node.total: '1'
node.data: '1'
- synopsis: Cat with master response (format=json).
- synopsis: List the status of the cluster with master response (format=json).
method: GET
path: /_cat/health
version: < 2.0
Expand All @@ -67,7 +67,7 @@ chapters:
- node.total: '1'
node.data: '1'
discovered_master: 'true'
- synopsis: Cat with cluster_manager response (format=json).
- synopsis: List the status of the cluster with cluster_manager response (format=json).
method: GET
path: /_cat/health
version: '>= 2.0'
Expand All @@ -80,7 +80,7 @@ chapters:
- node.total: '1'
node.data: '1'
discovered_cluster_manager: 'true'
- synopsis: Cat in different formats (format=yaml).
- synopsis: List the status of the cluster in different formats (format=yaml).
method: GET
path: /_cat/health
parameters:
Expand All @@ -91,7 +91,7 @@ chapters:
payload:
- node.total: '1'
node.data: '1'
- synopsis: Cat in different formats (format=cbor).
- synopsis: List the status of the cluster in different formats (format=cbor).
distributions:
excluded:
- amazon-managed
Expand All @@ -106,7 +106,7 @@ chapters:
payload:
- node.total: '1'
node.data: '1'
- synopsis: Cat in different formats (format=smile).
- synopsis: List the status of the cluster in different formats (format=smile).
distributions:
excluded:
- amazon-managed
Expand Down
2 changes: 1 addition & 1 deletion tests/default/cat/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ $schema: ../../../json_schemas/test_story.schema.yaml

description: Test cat endpoints.
chapters:
- synopsis: Cat with a json response.
- synopsis: List available compact and aligned text (CAT) APIs in plain text.
path: /_cat
method: GET
response:
Expand Down
26 changes: 17 additions & 9 deletions tests/default/cat/indices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,29 @@ epilogues:
method: DELETE
status: [200, 404]
chapters:
- synopsis: Cat with a default text response.
- synopsis: List information related to indexes (text/plain).
method: GET
path: /_cat/indices
response:
status: 200
content_type: text/plain
- synopsis: Cat with verbose output (v=true).
- synopsis: List information related to one index (text/plain).
method: GET
path: /_cat/indices/{index}
parameters:
index: books
response:
status: 200
content_type: text/plain
- synopsis: List information related to indexes with verbose output (v=true).
method: GET
path: /_cat/indices
parameters:
v: true
response:
status: 200
content_type: text/plain
- synopsis: Cat with headers (h=header1,header2).
- synopsis: List information related to indexes with headers (h=header1,header2).
method: GET
path: /_cat/indices
parameters:
Expand All @@ -37,15 +45,15 @@ chapters:
response:
status: 200
content_type: text/plain
- synopsis: Cat displaying all available headers (help=true).
- synopsis: List information related to indexes displaying all available headers (help=true).
method: GET
path: /_cat/indices
parameters:
help: true
response:
status: 200
content_type: text/plain
- synopsis: Cat with sorted results.
- synopsis: List information related to indexes with sorted results.
method: GET
path: /_cat/indices
parameters:
Expand All @@ -54,23 +62,23 @@ chapters:
response:
status: 200
content_type: text/plain
- synopsis: Cat in different formats (format=json).
- synopsis: List information related to indexes in different formats (format=json).
method: GET
path: /_cat/indices
parameters:
format: json
response:
status: 200
content_type: application/json
- synopsis: Cat in different formats (format=yaml).
- synopsis: List information related to indexes in different formats (format=yaml).
method: GET
path: /_cat/indices
parameters:
format: yaml
response:
status: 200
content_type: application/yaml
- synopsis: Cat in different formats (format=cbor).
- synopsis: List information related to indexes in different formats (format=cbor).
distributions:
excluded:
- amazon-managed
Expand All @@ -82,7 +90,7 @@ chapters:
response:
status: 200
content_type: application/cbor
- synopsis: Cat in different formats (format=smile).
- synopsis: List information related to indexes in different formats (format=smile).
distributions:
excluded:
- amazon-managed
Expand Down
2 changes: 1 addition & 1 deletion tests/default/cat/master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ $schema: ../../../json_schemas/test_story.schema.yaml
description: Test cat/master endpoints.
version: < 2.0
chapters:
- synopsis: Cat with a json response.
- synopsis: List information that helps identify the elected master node.
path: /_cat/master
method: GET
parameters:
Expand Down
2 changes: 1 addition & 1 deletion tests/default/cat/nodeattrs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ distributions:
- amazon-managed
- amazon-serverless
chapters:
- synopsis: Cat with a json response.
- synopsis: List the attributes of custom nodes.
path: /_cat/nodeattrs
method: GET
parameters:
Expand Down
4 changes: 2 additions & 2 deletions tests/default/cat/nodes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ $schema: ../../../json_schemas/test_story.schema.yaml

description: Test cat/nodes endpoints.
chapters:
- synopsis: Cat with a json response.
- synopsis: List node-level information.
path: /_cat/nodes
method: GET
version: < 2.0
Expand All @@ -12,7 +12,7 @@ chapters:
status: 200
payload:
- master: '*'
- synopsis: Cat with a json response.
- synopsis: List node-level information.
path: /_cat/nodes
version: '>= 2.0'
method: GET
Expand Down
2 changes: 1 addition & 1 deletion tests/default/cat/pending_tasks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ $schema: ../../../json_schemas/test_story.schema.yaml

description: Test cat/pending_tasks endpoints.
chapters:
- synopsis: Cat with a json response.
- synopsis: List the progress of all pending tasks.
path: /_cat/pending_tasks
method: GET
parameters:
Expand Down
2 changes: 1 addition & 1 deletion tests/default/cat/pit_segments/all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ prologues:
output:
pit_id: payload.pit_id
chapters:
- synopsis: Cat _all with a json response.
- synopsis: List information about the disk utilization of all PITs by describing their Lucene segments.
path: /_cat/pit_segments/_all
method: GET
parameters:
Expand Down
2 changes: 1 addition & 1 deletion tests/default/cat/pit_segments/pit_segments.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ prologues:
output:
pit_id: payload.pit_id
chapters:
- synopsis: Cat pit_segments/pit_id with a json response.
- synopsis: List information about the disk utilization of a PIT by describing its Lucene segments.
path: /_cat/pit_segments
method: GET
parameters:
Expand Down
2 changes: 1 addition & 1 deletion tests/default/cat/plugins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ $schema: ../../../json_schemas/test_story.schema.yaml

description: Test cat/plugins endpoints.
chapters:
- synopsis: Cat with a json response.
- synopsis: List the names, components, and versions of the installed plugins.
path: /_cat/plugins
method: GET
parameters:
Expand Down
Loading

0 comments on commit b28c1cf

Please sign in to comment.