Skip to content

Commit be6e908

Browse files
authored
Fix API template consistency. (opensearch-project#8488)
* Fix API template consistency. Signed-off-by: Archer <[email protected]> * Fix broken links Signed-off-by: Archer <[email protected]> * Rename request body headers Signed-off-by: Archer <[email protected]> * Fix broken links Signed-off-by: Archer <[email protected]> * Remove copy button from paths Signed-off-by: Archer <[email protected]> * Add path parameters Signed-off-by: Archer <[email protected]> * Additional doc feedback. Signed-off-by: Archer <[email protected]> * Change parameter text. Signed-off-by: Archer <[email protected]> * One more parameter. Signed-off-by: Archer <[email protected]> --------- Signed-off-by: Archer <[email protected]>
1 parent cd31d82 commit be6e908

File tree

159 files changed

+1134
-1078
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

159 files changed

+1134
-1078
lines changed

API_STYLE_GUIDE.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ For GET and DELETE APIs: Introduce what you can do with the optional parameters.
103103
Parameter | Data type | Description
104104
:--- | :--- | :---
105105

106-
### Request fields
106+
### Request body fields
107107

108108
For PUT and POST APIs: Introduce what the request fields are allowed to provide in the body of the request.
109109

@@ -189,7 +189,7 @@ The `POST _reindex` request returns the following response fields:
189189
}
190190
```
191191

192-
### Response fields
192+
### Response body fields
193193

194194
For PUT and POST APIs: Define all allowable response fields that can be returned in the body of the response.
195195

_api-reference/analyze-apis.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ If you use the Security plugin, you must have the `manage index` privilege. If y
2222

2323
## Path and HTTP methods
2424

25-
```
25+
```json
2626
GET /_analyze
2727
GET /{index}/_analyze
2828
POST /_analyze
@@ -81,7 +81,7 @@ text | String or Array of Strings | Text to analyze. If you provide an array of
8181

8282
[Set a token limit](#set-a-token-limit)
8383

84-
#### Analyze array of text strings
84+
### Analyze array of text strings
8585

8686
When you pass an array of strings to the `text` field, it is analyzed as a multi-value field.
8787

@@ -145,7 +145,7 @@ The previous request returns the following fields:
145145
}
146146
````
147147

148-
#### Apply a built-in analyzer
148+
### Apply a built-in analyzer
149149

150150
If you omit the `index` path parameter, you can apply any of the built-in analyzers to the text string.
151151

@@ -190,7 +190,7 @@ The previous request returns the following fields:
190190
}
191191
````
192192

193-
#### Apply a custom analyzer
193+
### Apply a custom analyzer
194194

195195
You can create your own analyzer and specify it in an analyze request.
196196

@@ -244,7 +244,7 @@ The previous request returns the following fields:
244244
}
245245
````
246246

247-
#### Apply a custom transient analyzer
247+
### Apply a custom transient analyzer
248248

249249
You can build a custom transient analyzer from tokenizers, token filters, or character filters. Use the `filter` parameter to specify token filters.
250250

@@ -373,7 +373,7 @@ The previous request returns the following fields:
373373
}
374374
````
375375

376-
#### Specify an index
376+
### Specify an index
377377

378378
You can analyze text using an index's default analyzer, or you can specify a different analyzer.
379379

@@ -446,7 +446,7 @@ The previous request returns the following fields:
446446
}
447447
````
448448

449-
#### Derive the analyzer from an index field
449+
### Derive the analyzer from an index field
450450

451451
You can pass text and a field in the index. The API looks up the field's analyzer and uses it to analyze the text.
452452

@@ -493,7 +493,7 @@ The previous request returns the following fields:
493493
}
494494
````
495495

496-
#### Specify a normalizer
496+
### Specify a normalizer
497497

498498
Instead of using a keyword field, you can use the normalizer associated with the index. A normalizer causes the analysis change to produce a single token.
499499

@@ -557,7 +557,7 @@ The previous request returns the following fields:
557557
}
558558
````
559559

560-
#### Get token details
560+
### Get token details
561561

562562
You can obtain additional details for all tokens by setting the `explain` attribute to `true`.
563563

@@ -640,7 +640,7 @@ The previous request returns the following fields:
640640
}
641641
````
642642

643-
#### Set a token limit
643+
### Set a token limit
644644

645645
You can set a limit to the number of tokens generated. Setting a lower value reduces a node's memory usage. The default value is 10000.
646646

@@ -659,7 +659,7 @@ PUT /books2
659659
The preceding request is an index API rather than an analyze API. See [Dynamic index-level index settings]({{site.url}}{{site.baseurl}}/install-and-configure/configuring-opensearch/index-settings/#dynamic-index-level-index-settings) for additional details.
660660
{: .note}
661661

662-
### Response fields
662+
## Response body fields
663663

664664
The text analysis endpoints return the following response fields.
665665

_api-reference/cat/cat-aliases.md

+3-7
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,13 @@ The CAT aliases operation lists the mapping of aliases to indexes, plus routing
1818

1919
## Path and HTTP methods
2020

21-
```
21+
```json
2222
GET _cat/aliases/<alias>
2323
GET _cat/aliases
2424
```
25+
{% include copy-curl.html %}
2526

26-
27-
## URL parameters
28-
29-
All CAT aliases URL parameters are optional.
30-
31-
In addition to the [common URL parameters]({{site.url}}{{site.baseurl}}/api-reference/cat/index), you can specify the following parameters:
27+
## Query parameters
3228

3329
Parameter | Type | Description
3430
:--- | :--- | :---

_api-reference/cat/cat-allocation.md

+2-6
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,12 @@ The CAT allocation operation lists the allocation of disk space for indexes and
1717

1818
## Path and HTTP methods
1919

20-
```
20+
```json
2121
GET _cat/allocation?v
2222
GET _cat/allocation/<node_name>
2323
```
2424

25-
## URL parameters
26-
27-
All CAT allocation URL parameters are optional.
28-
29-
In addition to the [common URL parameters]({{site.url}}{{site.baseurl}}/api-reference/cat/index), you can specify the following parameters:
25+
## Query parameters
3026

3127
Parameter | Type | Description
3228
:--- | :--- | :---

_api-reference/cat/cat-cluster_manager.md

+2-6
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,11 @@ The CAT cluster manager operation lists information that helps identify the elec
1717

1818
## Path and HTTP methods
1919

20-
```
20+
```json
2121
GET _cat/cluster_manager
2222
```
2323

24-
## URL parameters
25-
26-
All CAT cluster manager URL parameters are optional.
27-
28-
In addition to the [common URL parameters]({{site.url}}{{site.baseurl}}/api-reference/cat/index), you can specify the following parameters:
24+
## Query parameters
2925

3026
Parameter | Type | Description
3127
:--- | :--- | :---

_api-reference/cat/cat-count.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,11 @@ The CAT count operation lists the number of documents in your cluster.
1818

1919
## Path and HTTP methods
2020

21-
```
21+
```json
2222
GET _cat/count?v
2323
GET _cat/count/<index>?v
2424
```
2525

26-
## URL parameters
27-
28-
All CAT count URL parameters are optional. You can specify any of the [common URL parameters]({{site.url}}{{site.baseurl}}/api-reference/cat/index).
29-
3026
## Example requests
3127

3228
```json

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

+2-6
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,12 @@ The CAT Field Data operation lists the memory size used by each field per node.
1717

1818
## Path and HTTP methods
1919

20-
```
20+
```json
2121
GET _cat/fielddata?v
2222
GET _cat/fielddata/<field_name>?v
2323
```
2424

25-
## URL parameters
26-
27-
All CAT fielddata URL parameters are optional.
28-
29-
In addition to the [common URL parameters]({{site.url}}{{site.baseurl}}/api-reference/cat/index), you can specify the following parameter:
25+
## Query parameters
3026

3127
Parameter | Type | Description
3228
:--- | :--- | :---

_api-reference/cat/cat-health.md

+3-5
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,11 @@ The CAT health operation lists the status of the cluster, how long the cluster h
1818

1919
## Path and HTTP methods
2020

21-
```
21+
```json
2222
GET _cat/health?v
2323
```
24-
{% include copy-curl.html %}
2524

26-
## URL parameters
27-
28-
All CAT health URL parameters are optional.
25+
## Query parameters
2926

3027
Parameter | Type | Description
3128
:--- | :--- | :---
@@ -39,6 +36,7 @@ The following example request give cluster health information for the past 5 day
3936
```json
4037
GET _cat/health?v&time=5d
4138
```
39+
{% include copy-curl.html %}
4240

4341
## Example response
4442

_api-reference/cat/cat-indices.md

+4-8
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,12 @@ The CAT indices operation lists information related to indexes, that is, how muc
1717

1818
## Path and HTTP methods
1919

20-
```
20+
```json
2121
GET _cat/indices/<index>
2222
GET _cat/indices
2323
```
2424

25-
## URL parameters
26-
27-
All URL parameters are optional.
28-
29-
In addition to the [common URL parameters]({{site.url}}{{site.baseurl}}/api-reference/cat/index/), you can specify the following parameters:
25+
## Query parameters
3026

3127
Parameter | Type | Description
3228
:--- | :--- | :---
@@ -40,14 +36,14 @@ expand_wildcards | Enum | Expands wildcard expressions to concrete indexes. Comb
4036

4137
## Example requests
4238

43-
```
39+
```json
4440
GET _cat/indices?v
4541
```
4642
{% include copy-curl.html %}
4743

4844
To limit the information to a specific index, add the index name after your query.
4945

50-
```
46+
```json
5147
GET _cat/indices/<index>?v
5248
```
5349
{% include copy-curl.html %}

_api-reference/cat/cat-nodeattrs.md

+3-7
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,11 @@ The CAT nodeattrs operation lists the attributes of custom nodes.
1717

1818
## Path and HTTP methods
1919

20-
```
20+
```json
2121
GET _cat/nodeattrs
2222
```
2323

24-
## URL parameters
25-
26-
All CAT nodeattrs URL parameters are optional.
27-
28-
In addition to the [common URL parameters]({{site.url}}{{site.baseurl}}/api-reference/cat/index), you can specify the following parameters:
24+
## Query parameters
2925

3026
Parameter | Type | Description
3127
:--- | :--- | :---
@@ -36,7 +32,7 @@ cluster_manager_timeout | Time | The amount of time to wait for a connection to
3632

3733
The following example request returns attributes about custom nodes:
3834

39-
```
35+
```json
4036
GET _cat/nodeattrs?v
4137
```
4238
{% include copy-curl.html %}

_api-reference/cat/cat-nodes.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ A few important node metrics are `pid`, `name`, `cluster_manager`, `ip`, `port`,
1919

2020
## Path and HTTP methods
2121

22-
```
22+
```json
2323
GET _cat/nodes
2424
```
2525

26-
## URL parameters
26+
## Query parameters
2727

2828
All CAT nodes URL parameters are optional.
2929

@@ -41,7 +41,7 @@ include_unloaded_segments | Boolean | Whether to include information from segmen
4141

4242
The following example request lists node level information:
4343

44-
```
44+
```json
4545
GET _cat/nodes?v
4646
```
4747
{% include copy-curl.html %}

_api-reference/cat/cat-pending-tasks.md

+3-7
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,11 @@ The CAT pending tasks operation lists the progress of all pending tasks, includi
1818

1919
## Path and HTTP methods
2020

21-
```
21+
```json
2222
GET _cat/pending_tasks
2323
```
2424

25-
## URL parameters
26-
27-
All CAT nodes URL parameters are optional.
28-
29-
In addition to the [common URL parameters]({{site.url}}{{site.baseurl}}/api-reference/cat/index), you can specify the following parameters:
25+
## Query parameters
3026

3127
Parameter | Type | Description
3228
:--- | :--- | :---
@@ -38,7 +34,7 @@ time | Time | Specify the units for time. For example, `5d` or `7h`. For more in
3834

3935
The following example request lists the progress of all pending node tasks:
4036

41-
```
37+
```json
4238
GET _cat/pending_tasks?v
4339
```
4440
{% include copy-curl.html %}

_api-reference/cat/cat-plugins.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ The CAT plugins operation lists the names, components, and versions of the insta
1818

1919
## Path and HTTP methods
2020

21-
```
21+
```json
2222
GET _cat/plugins
2323
```
2424

25-
## URL parameters
25+
## Query parameters
2626

27-
All CAT plugins URL parameters are optional.
27+
All parameters are optional.
2828

29-
In addition to the [common URL parameters]({{site.url}}{{site.baseurl}}/api-reference/cat/index), you can specify the following parameters:
29+
In addition to the [common parameters]({{site.url}}{{site.baseurl}}/api-reference/cat/index), you can specify the following parameters:
3030

3131
Parameter | Type | Description
3232
:--- | :--- | :---
@@ -37,7 +37,7 @@ cluster_manager_timeout | Time | The amount of time to wait for a connection to
3737

3838
The following example request lists all installed plugins:
3939

40-
```
40+
```json
4141
GET _cat/plugins?v
4242
```
4343
{% include copy-curl.html %}

0 commit comments

Comments
 (0)