Skip to content

Commit 4631dd5

Browse files
committed
CAT API automation (Part II) (#9060)
* Add CAT API automation Signed-off-by: Archer <naarcha@amazon.com> * Add CAT API reference Signed-off-by: Archer <naarcha@amazon.com> * Update cat-pit-segments.md Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com> * Fix mustache template Signed-off-by: Archer <naarcha@amazon.com> * Fix table spacing Signed-off-by: Archer <naarcha@amazon.com> * Updated expected output Signed-off-by: Archer <naarcha@amazon.com> * Revert back to type Signed-off-by: Archer <naarcha@amazon.com> * Fix pretty test expected result Signed-off-by: Archer <naarcha@amazon.com> * Add updated tables. Signed-off-by: Archer <naarcha@amazon.com> * Add CAT API automation with updated spec-insert Signed-off-by: Archer <naarcha@amazon.com> * Add updated CAT API tables Signed-off-by: Archer <naarcha@amazon.com> * See if an extra space will fix the table. Signed-off-by: Archer <naarcha@amazon.com> * Update mustache template to add spaces Signed-off-by: Archer <naarcha@amazon.com> * Mustache template update Signed-off-by: Archer <naarcha@amazon.com> * Update expected output. Signed-off-by: Archer <naarcha@amazon.com> * Add lines to renderer. Signed-off-by: Archer <naarcha@amazon.com> * Add new lines Signed-off-by: Archer <naarcha@amazon.com> * Try another way Signed-off-by: Archer <naarcha@amazon.com> * Fix mustache spec Signed-off-by: Archer <naarcha@amazon.com> * Add line breaks correctly. Signed-off-by: Archer <naarcha@amazon.com> * Update endpoint expected output. Signed-off-by: Archer <naarcha@amazon.com> * Fix renderer spacing. Fix tests. Signed-off-by: Archer <naarcha@amazon.com> * Fix expected output. Signed-off-by: Archer <naarcha@amazon.com> * Fix table Signed-off-by: Archer <naarcha@amazon.com> * Update expected results Signed-off-by: Archer <naarcha@amazon.com> * Fix output, again. Signed-off-by: Archer <naarcha@amazon.com> * Add another test Signed-off-by: Archer <naarcha@amazon.com> * Theoretically the correct spacing. Signed-off-by: Archer <naarcha@amazon.com> * Add Theo's suggestions Signed-off-by: Archer <naarcha@amazon.com> * Fix BR tags Signed-off-by: Archer <naarcha@amazon.com> * Fix expected output. Signed-off-by: Archer <naarcha@amazon.com> * Make wildcard defintion consistent. Signed-off-by: Archer <naarcha@amazon.com> --------- Signed-off-by: Archer <naarcha@amazon.com> Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com> (cherry picked from commit 0713861)
1 parent db0bff6 commit 4631dd5

26 files changed

+879
-152
lines changed

_api-reference/cat/cat-aliases.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,23 @@ GET /_cat/aliases/{name}
3232
<!-- spec_insert_start
3333
api: cat.aliases
3434
component: query_parameters
35-
columns: Parameter,Type,Description,Default
35+
columns: Parameter, Data type, Description, Default
3636
include_deprecated: false
3737
-->
3838
## Query parameters
39-
Parameter | Type | Description | Default
40-
:--- | :--- | :--- | :---
41-
`expand_wildcards` | List or String | Expands wildcard expressions to concrete indexes. Combine multiple values with commas. Supported values are `all`, `open`, `closed`, `hidden`, and `none`. |
42-
`format` | String | A short version of the `Accept` header, such as `json` or `yaml`. |
43-
`h` | List | A comma-separated list of column names to display. |
44-
`help` | Boolean | Returns help information. | `false`
45-
`local` | Boolean | Whether to return information from the local node only instead of from the cluster manager node. | `false`
46-
`s` | List | A comma-separated list of column names or column aliases to sort by. |
47-
`v` | Boolean | Enables verbose mode, which displays column headers. | `false`
39+
40+
The following table lists the available query parameters. All query parameters are optional.
41+
42+
| Parameter | Data type | Description | Default |
43+
| :--- | :--- | :--- | :--- |
44+
| `expand_wildcards` | List or String | Specifies the type of index that wildcard expressions can match. Supports comma-separated values. <br> Valid values are: <br> - `all`: Match any index, including hidden ones. <br> - `closed`: Match closed, non-hidden indexes. <br> - `hidden`: Match hidden indexes. Must be combined with open, closed, or both. <br> - `none`: Wildcard expressions are not accepted. <br> - `open`: Match open, non-hidden indexes. | N/A |
45+
| `format` | String | A short version of the `Accept` header, such as `json` or `yaml`. | N/A |
46+
| `h` | List | A comma-separated list of column names to display. | N/A |
47+
| `help` | Boolean | Returns help information. | `false` |
48+
| `local` | Boolean | Whether to return information from the local node only instead of from the cluster manager node. | `false` |
49+
| `s` | List | A comma-separated list of column names or column aliases to sort by. | N/A |
50+
| `v` | Boolean | Enables verbose mode, which displays column headers. | `false` |
51+
4852
<!-- spec_insert_end -->
4953

5054

_api-reference/cat/cat-allocation.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,11 @@ GET /_cat/allocation/{node_id}
3131
<!-- spec_insert_start
3232
api: cat.allocation
3333
component: query_parameters
34-
columns: Parameter,Type,Description,Default
34+
columns: Parameter, Data type, Description, Default
3535
include_deprecated: false
3636
-->
3737
## Query parameters
38+
<<<<<<< HEAD
3839
Parameter | Type | Description | Default
3940
:--- | :--- | :--- | :---
4041
`bytes` | String | The units used to display byte values. |
@@ -45,6 +46,22 @@ Parameter | Type | Description | Default
4546
`local` | Boolean | Returns local information but does not retrieve the state from cluster manager node. | `false`
4647
`s` | List | A comma-separated list of column names or column aliases to sort by. |
4748
`v` | Boolean | Enables verbose mode, which displays column headers. | `false`
49+
=======
50+
51+
The following table lists the available query parameters. All query parameters are optional.
52+
53+
| Parameter | Data type | Description | Default |
54+
| :--- | :--- | :--- | :--- |
55+
| `bytes` | String | The units used to display byte values. <br> Valid values are: `b`, `kb`, `k`, `mb`, `m`, `gb`, `g`, `tb`, `t`, `pb`, `p` | N/A |
56+
| `cluster_manager_timeout` | String | A timeout for connection to the cluster manager node. | N/A |
57+
| `format` | String | A short version of the HTTP `Accept` header, such as `json` or `yaml`. | N/A |
58+
| `h` | List | A comma-separated list of column names to display. | N/A |
59+
| `help` | Boolean | Returns help information. | `false` |
60+
| `local` | Boolean | Returns local information but does not retrieve the state from cluster-manager node. | `false` |
61+
| `s` | List | A comma-separated list of column names or column aliases to sort by. | N/A |
62+
| `v` | Boolean | Enables verbose mode, which displays column headers. | `false` |
63+
64+
>>>>>>> 0713861e (CAT API automation (Part II) (#9060))
4865
<!-- spec_insert_end -->
4966
5067
## Example requests

_api-reference/cat/cat-cluster_manager.md

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,41 @@ has_children: false
1515
The CAT cluster manager operation lists information that helps identify the elected cluster manager node.
1616

1717

18+
<!-- spec_insert_start
19+
api: cat.cluster_manager
20+
component: endpoints
21+
-->
1822
## Endpoints
19-
2023
```json
21-
GET _cat/cluster_manager
24+
GET /_cat/cluster_manager
2225
```
26+
<!-- spec_insert_end -->
27+
2328

29+
<!-- spec_insert_start
30+
api: cat.cluster_manager
31+
component: query_parameters
32+
columns: Parameter, Data type, Description, Default
33+
include_deprecated: false
34+
-->
2435
## Query parameters
2536

26-
Parameter | Type | Description
27-
:--- | :--- | :---
28-
cluster_manager_timeout | Time | The amount of time to wait for a connection to the cluster manager node. Default is 30 seconds.
37+
The following table lists the available query parameters. All query parameters are optional.
38+
39+
| Parameter | Data type | Description | Default |
40+
| :--- | :--- | :--- | :--- |
41+
| `cluster_manager_timeout` | String | A timeout for connection to the cluster manager node. | N/A |
42+
| `format` | String | A short version of the HTTP `Accept` header, such as `json` or `yaml`. | N/A |
43+
| `h` | List | A comma-separated list of column names to display. | N/A |
44+
| `help` | Boolean | Returns help information. | `false` |
45+
| `local` | Boolean | Returns local information but does not retrieve the state from the cluster manager node. | `false` |
46+
| `s` | List | A comma-separated list of column names or column aliases to sort by. | N/A |
47+
| `v` | Boolean | Enables verbose mode, which displays column headers. | `false` |
48+
49+
<!-- spec_insert_end -->
50+
2951

30-
## Example requests
52+
## Example request
3153

3254
```
3355
GET _cat/cluster_manager?v

_api-reference/cat/cat-count.md

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,37 @@ redirect_from:
1616
The CAT count operation lists the number of documents in your cluster.
1717

1818

19+
<!-- spec_insert_start
20+
api: cat.count
21+
component: endpoints
22+
-->
1923
## Endpoints
20-
2124
```json
22-
GET _cat/count?v
23-
GET _cat/count/<index>?v
25+
GET /_cat/count
26+
GET /_cat/count/{index}
2427
```
28+
<!-- spec_insert_end -->
29+
30+
31+
<!-- spec_insert_start
32+
api: cat.count
33+
component: query_parameters
34+
columns: Parameter, Data type, Description, Default
35+
include_deprecated: false
36+
-->
37+
## Query parameters
38+
39+
The following table lists the available query parameters. All query parameters are optional.
40+
41+
| Parameter | Data type | Description | Default |
42+
| :--- | :--- | :--- | :--- |
43+
| `format` | String | A short version of the `Accept` header, such as `json` or `yaml`. | N/A |
44+
| `h` | List | A comma-separated list of column names to display. | N/A |
45+
| `help` | Boolean | Returns help information. | `false` |
46+
| `s` | List | A comma-separated list of column names or column aliases to sort by. | N/A |
47+
| `v` | Boolean | Enables verbose mode, which displays column headers. | `false` |
48+
49+
<!-- spec_insert_end -->
2550

2651
## Example requests
2752

_api-reference/cat/cat-field-data.md

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,38 @@ redirect_from:
1414

1515
The CAT Field Data operation lists the memory size used by each field per node.
1616

17-
17+
<!-- spec_insert_start
18+
api: cat.fielddata
19+
component: endpoints
20+
-->
1821
## Endpoints
19-
2022
```json
21-
GET _cat/fielddata?v
22-
GET _cat/fielddata/<field_name>?v
23+
GET /_cat/fielddata
24+
GET /_cat/fielddata/{fields}
2325
```
26+
<!-- spec_insert_end -->
2427

28+
29+
<!-- spec_insert_start
30+
api: cat.fielddata
31+
component: query_parameters
32+
columns: Parameter, Data type, Description, Default
33+
include_deprecated: false
34+
-->
2535
## Query parameters
2636

27-
Parameter | Type | Description
28-
:--- | :--- | :---
29-
bytes | Byte size | Specify the units for byte size. For example, `7kb` or `6gb`. For more information, see [Supported units]({{site.url}}{{site.baseurl}}/opensearch/units/).
37+
The following table lists the available query parameters. All query parameters are optional.
38+
39+
| Parameter | Data type | Description | Default |
40+
| :--- | :--- | :--- | :--- |
41+
| `bytes` | String | The units used to display byte values. <br> Valid values are: `b`, `kb`, `k`, `mb`, `m`, `gb`, `g`, `tb`, `t`, `pb`, `p` | N/A |
42+
| `format` | String | A short version of the `Accept` header, such as `json` or `yaml`. | N/A |
43+
| `h` | List | A comma-separated list of column names to display. | N/A |
44+
| `help` | Boolean | Returns help information. | `false` |
45+
| `s` | List | A comma-separated list of column names or column aliases to sort by. | N/A |
46+
| `v` | Boolean | Enables verbose mode, which displays column headers. | `false` |
47+
48+
<!-- spec_insert_end -->
3049

3150
## Example requests
3251

_api-reference/cat/cat-health.md

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
layout: default
33
title: CAT health
44
parent: CAT API
5-
65
nav_order: 20
76
has_children: false
87
redirect_from:
@@ -16,18 +15,38 @@ redirect_from:
1615
The CAT health operation lists the status of the cluster, how long the cluster has been up, the number of nodes, and other useful information that helps you analyze the health of your cluster.
1716

1817

18+
<!-- spec_insert_start
19+
api: cat.health
20+
component: endpoints
21+
-->
1922
## Endpoints
20-
2123
```json
22-
GET _cat/health?v
24+
GET /_cat/health
2325
```
26+
<!-- spec_insert_end -->
27+
2428

29+
<!-- spec_insert_start
30+
api: cat.health
31+
component: query_parameters
32+
columns: Parameter, Data type, Description, Default
33+
include_deprecated: false
34+
-->
2535
## Query parameters
2636

27-
Parameter | Type | Description
28-
:--- | :--- | :---
29-
time | Time | Specify the units for time. For example, `5d` or `7h`. For more information, see [Supported units]({{site.url}}{{site.baseurl}}/opensearch/units/).
30-
ts | Boolean | If true, returns HH:MM:SS and Unix epoch timestamps. Default is `true`.
37+
The following table lists the available query parameters. All query parameters are optional.
38+
39+
| Parameter | Data type | Description | Default |
40+
| :--- | :--- | :--- | :--- |
41+
| `format` | String | A short version of the `Accept` header, such as `json` or `yaml`. | N/A |
42+
| `h` | List | A comma-separated list of column names to display. | N/A |
43+
| `help` | Boolean | Returns help information. | `false` |
44+
| `s` | List | A comma-separated list of column names or column aliases to sort by. | N/A |
45+
| `time` | String | The unit used to display time values. <br> Valid values are: `nanos`, `micros`, `ms`, `s`, `m`, `h`, `d` | N/A |
46+
| `ts` | Boolean | When `true`, returns `HH:MM:SS` and Unix epoch timestamps. | `true` |
47+
| `v` | Boolean | Enables verbose mode, which displays column headers. | `false` |
48+
49+
<!-- spec_insert_end -->
3150

3251
## Example request
3352

_api-reference/cat/cat-indices.md

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,45 @@ redirect_from:
1515
The CAT indices operation lists information related to indexes, that is, how much disk space they are using, how many shards they have, their health status, and so on.
1616

1717

18+
<!-- spec_insert_start
19+
api: cat.indices
20+
component: endpoints
21+
-->
1822
## Endpoints
19-
2023
```json
21-
GET _cat/indices/<index>
22-
GET _cat/indices
24+
GET /_cat/indices
25+
GET /_cat/indices/{index}
2326
```
27+
<!-- spec_insert_end -->
28+
2429

30+
<!-- spec_insert_start
31+
api: cat.indices
32+
component: query_parameters
33+
columns: Parameter, Data type, Description, Default
34+
include_deprecated: false
35+
-->
2536
## Query parameters
2637

27-
Parameter | Type | Description
28-
:--- | :--- | :---
29-
bytes | Byte size | Specify the units for byte size. For example, `7kb` or `6gb`. For more information, see [Supported units]({{site.url}}{{site.baseurl}}/opensearch/units/).
30-
health | String | Limit indexes based on their health status. Supported values are `green`, `yellow`, and `red`.
31-
include_unloaded_segments | Boolean | Whether to include information from segments not loaded into memory. Default is `false`.
32-
cluster_manager_timeout | Time | The amount of time to wait for a connection to the cluster manager node. Default is 30 seconds.
33-
pri | Boolean | Whether to return information only from the primary shards. Default is `false`.
34-
time | Time | Specify the units for time. For example, `5d` or `7h`. For more information, see [Supported units]({{site.url}}{{site.baseurl}}/opensearch/units/).
35-
expand_wildcards | Enum | Expands wildcard expressions to concrete indexes. Combine multiple values with commas. Supported values are `all`, `open`, `closed`, `hidden`, and `none`. Default is `open`.
38+
The following table lists the available query parameters. All query parameters are optional.
39+
40+
| Parameter | Data type | Description | Default |
41+
| :--- | :--- | :--- | :--- |
42+
| `bytes` | String | The units used to display byte values. <br> Valid values are: `b`, `kb`, `k`, `mb`, `m`, `gb`, `g`, `tb`, `t`, `pb`, `p` | N/A |
43+
| `cluster_manager_timeout` | String | The amount of time allowed to establish a connection to the cluster manager node. | N/A |
44+
| `expand_wildcards` | List or String | Specifies the type of index that wildcard expressions can match. Supports comma-separated values. <br> Valid values are: <br> - `all`: Match any index, including hidden ones. <br> - `closed`: Match closed, non-hidden indexes. <br> - `hidden`: Match hidden indexes. Must be combined with open, closed, or both. <br> - `none`: Wildcard expressions are not accepted. <br> - `open`: Match open, non-hidden indexes. | N/A |
45+
| `format` | String | A short version of the `Accept` header, such as `json` or `yaml`. | N/A |
46+
| `h` | List | A comma-separated list of column names to display. | N/A |
47+
| `health` | String | Limits indexes based on their health status. Supported values are `green`, `yellow`, and `red`. <br> Valid values are: `green`, `GREEN`, `yellow`, `YELLOW`, `red`, `RED` | N/A |
48+
| `help` | Boolean | Returns help information. | `false` |
49+
| `include_unloaded_segments` | Boolean | Whether to include information from segments not loaded into memory. | `false` |
50+
| `local` | Boolean | Returns local information but does not retrieve the state from the cluster manager node. | `false` |
51+
| `pri` | Boolean | When `true`, returns information only from the primary shards. | `false` |
52+
| `s` | List | A comma-separated list of column names or column aliases to sort by. | N/A |
53+
| `time` | String | Specifies the time units. <br> Valid values are: `nanos`, `micros`, `ms`, `s`, `m`, `h`, `d` | N/A |
54+
| `v` | Boolean | Enables verbose mode, which displays column headers. | `false` |
55+
56+
<!-- spec_insert_end -->
3657

3758
## Example requests
3859

_api-reference/cat/cat-nodeattrs.md

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,38 @@ redirect_from:
1515
The CAT nodeattrs operation lists the attributes of custom nodes.
1616

1717

18+
<!-- spec_insert_start
19+
api: cat.nodeattrs
20+
component: endpoints
21+
-->
1822
## Endpoints
19-
2023
```json
21-
GET _cat/nodeattrs
24+
GET /_cat/nodeattrs
2225
```
26+
<!-- spec_insert_end -->
27+
2328

29+
<!-- spec_insert_start
30+
api: cat.nodeattrs
31+
component: query_parameters
32+
columns: Parameter, Data type, Description, Default
33+
include_deprecated: false
34+
-->
2435
## Query parameters
2536

26-
Parameter | Type | Description
27-
:--- | :--- | :---
28-
local | Boolean | Whether to return information from the local node only instead of from the cluster manager node. Default is `false`.
29-
cluster_manager_timeout | Time | The amount of time to wait for a connection to the cluster manager node. Default is 30 seconds.
37+
The following table lists the available query parameters. All query parameters are optional.
38+
39+
| Parameter | Data type | Description | Default |
40+
| :--- | :--- | :--- | :--- |
41+
| `cluster_manager_timeout` | String | The amount of time allowed to establish a connection to the cluster manager node. | N/A |
42+
| `format` | String | A short version of the `Accept` header, such as `json` or `yaml`. | N/A |
43+
| `h` | List | A comma-separated list of column names to display. | N/A |
44+
| `help` | Boolean | Returns help information. | `false` |
45+
| `local` | Boolean | Returns local information but does not retrieve the state from the cluster manager node. | `false` |
46+
| `s` | List | A comma-separated list of column names or column aliases to sort by. | N/A |
47+
| `v` | Boolean | Enables verbose mode, which displays column headers. | `false` |
48+
49+
<!-- spec_insert_end -->
3050

3151
## Example request
3252

0 commit comments

Comments
 (0)