Skip to content

Commit

Permalink
Change sample to example in 1.3 (#3006)
Browse files Browse the repository at this point in the history
Signed-off-by: Fanit Kolchina <[email protected]>
  • Loading branch information
kolchfa-aws authored Feb 21, 2023
1 parent a5341b2 commit fd3e3b3
Show file tree
Hide file tree
Showing 53 changed files with 274 additions and 274 deletions.
2 changes: 1 addition & 1 deletion _api-reference/analyze-apis/perform-text-analysis.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Field | Data Type | Description
:--- | :--- | :---
text | String or Array of Strings | Text to analyze. If you provide an array of strings, the text is analyzed as a multi-value field.

#### Sample requests
#### Example requests

[Analyze array of text strings](#analyze-array-of-text-strings)

Expand Down
6 changes: 3 additions & 3 deletions _api-reference/cluster-api/cluster-health.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ wait_for_no_relocating_shards | Boolean | Whether to wait until there are no rel
wait_for_no_initializing_shards | Boolean | Whether to wait until there are no initializing shards in the cluster. Default is false.
wait_for_status | Enum | Wait until the cluster health reaches the specified status or better. Supported values are `green`, `yellow`, and `red`.

#### Sample request
#### Example request

The following sample request retrieves cluster health for all indexes in the cluster:
The following example request retrieves cluster health for all indexes in the cluster:

```json
GET _cluster/health
```

#### Sample response
#### Example response

The response contains cluster health information:

Expand Down
8 changes: 4 additions & 4 deletions _api-reference/cluster-api/cluster-settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ include_defaults (GET only) | Boolean | Whether to include default settings as p
master_timeout | Time unit | The amount of time to wait for a response from the master node. Default is `30 seconds`.
timeout (PUT only) | Time unit | The amount of time to wait for a response from the cluster. Default is `30 seconds`.

#### Sample request
#### Example request

```json
GET _cluster/settings?include_defaults=true
```
{% include copy-curl.html %}

#### Sample response
#### Example response

```json
PUT _cluster/settings
Expand Down Expand Up @@ -105,7 +105,7 @@ The following request field parameters are compatible with the cluster API.
| cluster.persistent_tasks.allocation.enable | String | Enables or disables allocation for persistent tasks: <br /> <br /> `all` – Allows persistent tasks to be assigned to nodes. <br /> <br /> `none` – No allocations are allowed for persistent tasks. This does not affect persistent tasks already running. <br /> <br /> Default is `all`. |
| cluster.persistent_tasks.allocation.recheck_interval | Time unit | The master node automatically checks whether or not persistent tasks need to be assigned when the cluster state changes in a significant way. There are other factors, such as memory usage, that will affect whether or not persistent tasks are assigned to nodes but do not otherwise cause the cluster state to change. This setting defines how often assignment checks are performed in response to these factors. Default is `30 seconds`, with a minimum of `10 seconds` being required. |

#### Sample request
#### Example request

For a PUT operation, the request body must contain `transient` or `persistent`, along with the setting you want to update:

Expand All @@ -121,7 +121,7 @@ PUT _cluster/settings

For more information about transient settings, persistent settings, and precedence, see [OpenSearch configuration]({{site.url}}{{site.baseurl}}/opensearch/configuration/).

#### Sample response
#### Example response

```json
{
Expand Down
6 changes: 3 additions & 3 deletions _api-reference/index-apis/clear-index-cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ All query parameters are optional.
| query | Boolean | If `true`, clears the query cache. Defaults to `true`. |
| request | Boolean | If `true`, clears the request cache. Defaults to `true`. |

#### Sample requests
#### Example requests

The following sample requests show multiple clear cache API uses.
The following example requests show multiple clear cache API uses.

##### Clear a specific cache

Expand Down Expand Up @@ -93,7 +93,7 @@ POST /_cache/clear
````
{% include copy-curl.html %}

#### Sample response
#### Example response

The `POST /books,hockey/_cache/clear` request returns the following fields:

Expand Down
4 changes: 2 additions & 2 deletions _api-reference/index-apis/dangling-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ master_timeout | Time units | The amount of time to wait for the connection to t

## Examples

The following are sample requests and a sample response.
The following are example requests and a example response.

#### Sample list

Expand All @@ -71,7 +71,7 @@ POST /_dangling/msdjernajxAT23RT-BupMB?accept_data_loss=true
DELETE /_dangling/msdjernajxAT23RT-BupMB?accept_data_loss=true
````

#### Sample response body
#### Example response body

````json
{
Expand Down
2 changes: 1 addition & 1 deletion _api-reference/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ redirect_from:

# REST API reference

OpenSearch uses its REST API for most operations. This _incomplete_ section includes REST API paths, HTTP verbs, supported parameters, request body details, and sample responses.
OpenSearch uses its REST API for most operations. This _incomplete_ section includes REST API paths, HTTP verbs, supported parameters, request body details, and example responses.

In general, the OpenSearch REST API is no different from the Elasticsearch OSS REST API; most client code that worked with Elasticsearch OSS should also work with OpenSearch.
{: .tip }
4 changes: 2 additions & 2 deletions _api-reference/nodes-apis/nodes-hot-threads.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ ignore_idle_threads | Boolean | Don’t show threads that are in known idle st
type | String | Supported thread types are `cpu`, `wait`, or `block`. Defaults to `cpu`.
timeout | Time | Sets the time limit for node response. Default value is `30s`.

#### Sample request
#### Example request

```json
GET /_nodes/hot_threads
```
{% include copy-curl.html %}

#### Sample response
#### Example response

```bash
::: {opensearch}{F-ByTQzVQ3GQeYzQJArJGQ}{GxbcLdCATPWggOuQHJAoCw}{127.0.0.1}{127.0.0.1:9300}{dimr}{shard_indexing_pressure_enabled=true}
Expand Down
4 changes: 2 additions & 2 deletions _api-reference/nodes-apis/nodes-info.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Parameter | Type | Description
flat_settings| Boolean | Specifies whether to return the `settings` object of the response in flat format. Default is `false`.
timeout | Time | Sets the time limit for node response. Default value is `30s`.

#### Sample request
#### Example request

The following query requests the `process` and `transport` metrics from the master node:

Expand All @@ -86,7 +86,7 @@ GET /_nodes/master:true/process,transport
```
{% include copy-curl.html %}

#### Sample response
#### Example response

The response contains the metric groups specified in the `<metrics>` request parameter (in this case, `process` and `transport`):

Expand Down
4 changes: 2 additions & 2 deletions _api-reference/nodes-apis/nodes-reload-secure.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ The request may include an optional object containing the password for the OpenS
}
```

#### Sample request
#### Example request

The following is an example API request:

Expand All @@ -43,7 +43,7 @@ POST _nodes/reload_secure_settings
```
{% include copy-curl.html %}

#### Sample response
#### Example response

The following is an example response:

Expand Down
4 changes: 2 additions & 2 deletions _api-reference/nodes-apis/nodes-stats.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@ level | String | Specifies whether statistics are aggregated at the cluster, ind
timeout | Time | Sets the time limit for node response. Default is `30s`.
include_segment_file_sizes | Boolean | If segment statistics are requested, this field specifies to return the aggregated disk usage of every Lucene index file. Default is `false`.

#### Sample request
#### Example request

```json
GET _nodes/stats/
```
{% include copy-curl.html %}

#### Sample response
#### Example response

```json
{
Expand Down
4 changes: 2 additions & 2 deletions _api-reference/nodes-apis/nodes-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Parameter | Type | Description
timeout | Time | Sets the time limit for a response from the node. Default is `30s`.
master_timeout | Time | Sets the time limit for a response from the master node. Default is `30s`.

#### Sample request
#### Example request

The following request returns usage details for all nodes:

Expand All @@ -45,7 +45,7 @@ GET _nodes/usage
```
{% include copy-curl.html %}

#### Sample response
#### Example response

The following is an example response:

Expand Down
4 changes: 2 additions & 2 deletions _api-reference/rank-eval.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ ignore_unlabeled | Defaults to `false`. Unlabeled documents are ignored when set
template_id | Template ID.
params | Parameters used in the template.

#### Sample request
#### Example request

````json
GET shakespeare/_rank_eval
Expand Down Expand Up @@ -74,7 +74,7 @@ GET shakespeare/_rank_eval
````
{% include copy-curl.html %}

#### Sample response
#### Example response

````json
{
Expand Down
4 changes: 2 additions & 2 deletions _api-reference/reload-search-analyzer.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ ignore_unavailable | Boolean | If an index is closed or missing, an error is ret

The following are an example request and response.

#### Sample request
#### Example request

````json
POST /shakespeare/_reload_search_analyzers
````
{% include copy-curl.html %}

#### Sample response
#### Example response

````json
{
Expand Down
4 changes: 2 additions & 2 deletions _api-reference/script-apis/create-stored-script.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ All parameters are optional.
| lang | String | Scripting language. Required. |
| source | String or Object | Required. <br /> <br /> For scripts, a string with the contents of the script. <br /> <br /> For search templates, an object that defines the search template. Supports the same parameters as the [Search]({{site.url}}{{site.baseurl}}/api-reference/search) API request body. Search templates also support Mustache variables. |

#### Sample request
#### Example request

The sample uses an index called `books` with the following documents:

Expand Down Expand Up @@ -95,7 +95,7 @@ curl -XPUT "http://opensearch:9200/_scripts/my-first-script" -H 'Content-Type: a

See [Execute Painless stored script]({{site.url}}{{site.baseurl}}/api-reference/script-apis/exec-stored-script/) for information about running the script.

#### Sample response
#### Example response

The `PUT _scripts/my-first-script` request returns the following field:

Expand Down
4 changes: 2 additions & 2 deletions _api-reference/script-apis/delete-script.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Path parameters are optional.
| master_timeout | Time | Amount of time to wait for a connection to the master node. Optional, defaults to `30s`. |
| timeout | Time | The period of time to wait for a response. If a response is not received before the timeout value, the request will be dropped.

#### Sample request
#### Example request

The following request deletes the `my-first-script` script:

Expand All @@ -33,7 +33,7 @@ DELETE _scripts/my-script
````
{% include copy-curl.html %}

#### Sample response
#### Example response

The `DELETE _scripts/my-first-script` request returns the following field:

Expand Down
6 changes: 3 additions & 3 deletions _api-reference/script-apis/exec-script.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ POST /_scripts/painless/_execute
| context | A context for the script. Optional. Default is `painless_test`. |
| context_setup | Specifies additional parameters for the context. Optional.|

#### Sample request
#### Example request

The following request uses the default `painless_context` for the script:

Expand All @@ -43,7 +43,7 @@ GET /_scripts/painless/_execute
```
{% include copy-curl.html %}

#### Sample response
#### Example response

The response contains the average of two script parameters:

Expand All @@ -66,7 +66,7 @@ Choose different contexts to control the variables that are available to the scr

### Painless test context

The `painless_test` context is the default script context that provides only the `params` variable to the script. The returned result is always converted to a string. See the preceding sample request for a usage example.
The `painless_test` context is the default script context that provides only the `params` variable to the script. The returned result is always converted to a string. See the preceding example request for a usage example.

### Filter context

Expand Down
4 changes: 2 additions & 2 deletions _api-reference/script-apis/exec-stored-script.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ OpenSearch provides several ways to run a script; the following sections show ho
| script_fields | Object | Fields to include in output. |
| script | Object | ID of the script that produces a value for a field. |

#### Sample request
#### Example request

The following request runs the stored script that was created in [Create or update stored script]({{site.url}}{{site.baseurl}}/api-reference/script-apis/create-stored-script/). The script sums the ratings for each book and displays the sum in the `total_ratings` field in the output.

Expand All @@ -46,7 +46,7 @@ GET books/_search
````
{% include copy-curl.html %}

#### Sample response
#### Example response

The `GET books/_search` request returns the following fields:

Expand Down
4 changes: 2 additions & 2 deletions _api-reference/script-apis/get-script-contexts.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ nav_order: 5

Retrieves all contexts for stored scripts.

#### Sample request
#### Example request

````json
GET _script_context
````
{% include copy-curl.html %}

#### Sample response
#### Example response

The `GET _script_context` request returns the following fields:

Expand Down
4 changes: 2 additions & 2 deletions _api-reference/script-apis/get-script-language.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ nav_order: 6

The get script language API operation retrieves all supported script languages and their contexts.

#### Sample request
#### Example request

```json
GET _script_language
```
{% include copy-curl.html %}

#### Sample response
#### Example response

The `GET _script_language` request returns the available contexts for each language:

Expand Down
4 changes: 2 additions & 2 deletions _api-reference/script-apis/get-stored-script.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Retrieves a stored script.
:--- | :--- | :---
| master_timeout | Time | Amount of time to wait for a connection to the master node. Optional, defaults to `30s`. |

#### Sample request
#### Example request

The following retrieves the `my-first-script` stored script.

Expand All @@ -30,7 +30,7 @@ GET _scripts/my-first-script
````
{% include copy-curl.html %}

#### Sample response
#### Example response

The `GET _scripts/my-first-script` request returns the following fields:

Expand Down
4 changes: 2 additions & 2 deletions _api-reference/snapshots/create-repository.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Setting | Description
`server_side_encryption` | Whether to encrypt snapshot files in the S3 bucket. This setting uses AES-256 with S3-managed keys. See [Protecting data using server-side encryption](https://docs.aws.amazon.com/AmazonS3/latest/dev/serv-side-encryption.html). Default is false. Optional.
`storage_class` | Specifies the [S3 storage class](https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html) for the snapshots files. Default is `standard`. Do not use the `glacier` and `deep_archive` storage classes. Optional.

#### Sample request
#### Example request

The following requests register or update a repository called `my-first-repo`. Both require a request body as described in [Request fields](#request-fields).

Expand All @@ -75,7 +75,7 @@ PUT _snapshot/my-opensearch-repo
```
{% include copy-curl.html %}

#### Sample response
#### Example response

Upon success, the following JSON object is returned:

Expand Down
Loading

0 comments on commit fd3e3b3

Please sign in to comment.