Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _api-reference/cat/cat-aliases.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ include_deprecated: false
-->
## Query parameters

The following table lists the available query parameters. All query parameters are optional.
The following table lists the available query parameters.

| Parameter | Data type | Description | Default |
| :--- | :--- | :--- | :--- |
Expand Down
2 changes: 1 addition & 1 deletion _api-reference/cat/cat-allocation.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ include_deprecated: false
-->
## Query parameters

The following table lists the available query parameters. All query parameters are optional.
The following table lists the available query parameters.

| Parameter | Data type | Description | Default |
| :--- | :--- | :--- | :--- |
Expand Down
2 changes: 1 addition & 1 deletion _api-reference/cat/cat-cluster_manager.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ include_deprecated: false
-->
## Query parameters

The following table lists the available query parameters. All query parameters are optional.
The following table lists the available query parameters.

| Parameter | Data type | Description | Default |
| :--- | :--- | :--- | :--- |
Expand Down
2 changes: 1 addition & 1 deletion _api-reference/cat/cat-count.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ include_deprecated: false
-->
## Query parameters

The following table lists the available query parameters. All query parameters are optional.
The following table lists the available query parameters.

| Parameter | Data type | Description | Default |
| :--- | :--- | :--- | :--- |
Expand Down
2 changes: 1 addition & 1 deletion _api-reference/cat/cat-field-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ include_deprecated: false
-->
## Query parameters

The following table lists the available query parameters. All query parameters are optional.
The following table lists the available query parameters.

| Parameter | Data type | Description | Default |
| :--- | :--- | :--- | :--- |
Expand Down
2 changes: 1 addition & 1 deletion _api-reference/cat/cat-health.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ include_deprecated: false
-->
## Query parameters

The following table lists the available query parameters. All query parameters are optional.
The following table lists the available query parameters.

| Parameter | Data type | Description | Default |
| :--- | :--- | :--- | :--- |
Expand Down
2 changes: 1 addition & 1 deletion _api-reference/cat/cat-indices.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ include_deprecated: false
-->
## Query parameters

The following table lists the available query parameters. All query parameters are optional.
The following table lists the available query parameters.

| Parameter | Data type | Description | Default |
| :--- | :--- | :--- | :--- |
Expand Down
2 changes: 1 addition & 1 deletion _api-reference/cat/cat-nodeattrs.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ include_deprecated: false
-->
## Query parameters

The following table lists the available query parameters. All query parameters are optional.
The following table lists the available query parameters.

| Parameter | Data type | Description | Default |
| :--- | :--- | :--- | :--- |
Expand Down
4 changes: 2 additions & 2 deletions _api-reference/cat/cat-nodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ include_deprecated: false
-->
## Query parameters

The following table lists the available query parameters. All query parameters are optional.
The following table lists the available query parameters.

| Parameter | Data type | Description | Default |
| :--- | :--- | :--- | :--- |
Expand All @@ -47,7 +47,7 @@ The following table lists the available query parameters. All query parameters a
| `h` | List | A comma-separated list of column names to display. | N/A |
| `help` | Boolean | Returns help information. | `false` |
| `s` | List | A comma-separated list of column names or column aliases to sort by. | N/A |
| `time` | String | Specifies the time units, for example, `5d` or `7h`. For more information, see [Supported units]({{site.url}}{{site.baseurl}}/api-reference/units/). <br> Valid values are: `nanos`, `micros`, `ms`, `s`, `m`, `h`, and `d`. | N/A |
| `time` | String | Specifies the time units, for example, `5d` or `7h`. For more information, see [Supported units](https://opensearch.org/docs/latest/api-reference/units/). <br> Valid values are: `nanos`, `micros`, `ms`, `s`, `m`, `h`, and `d`. | N/A |
| `v` | Boolean | Enables verbose mode, which displays column headers. | `false` |

<!-- spec_insert_end -->
Expand Down
4 changes: 2 additions & 2 deletions _api-reference/cat/cat-pending-tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ include_deprecated: false
-->
## Query parameters

The following table lists the available query parameters. All query parameters are optional.
The following table lists the available query parameters.

| Parameter | Data type | Description | Default |
| :--- | :--- | :--- | :--- |
Expand All @@ -44,7 +44,7 @@ The following table lists the available query parameters. All query parameters a
| `help` | Boolean | Returns help information. | `false` |
| `local` | Boolean | Returns local information but does not retrieve the state from the cluster manager node. | `false` |
| `s` | List | A comma-separated list of column names or column aliases to sort by. | N/A |
| `time` | String | Specifies the time units, for example, `5d` or `7h`. For more information, see [Supported units]({{site.url}}{{site.baseurl}}/api-reference/units/). <br> Valid values are: `nanos`, `micros`, `ms`, `s`, `m`, `h`, and `d`. | N/A |
| `time` | String | Specifies the time units, for example, `5d` or `7h`. For more information, see [Supported units](https://opensearch.org/docs/latest/api-reference/units/). <br> Valid values are: `nanos`, `micros`, `ms`, `s`, `m`, `h`, and `d`. | N/A |
| `v` | Boolean | Enables verbose mode, which displays column headers. | `false` |

<!-- spec_insert_end -->
Expand Down
2 changes: 1 addition & 1 deletion _api-reference/cat/cat-pit-segments.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ include_deprecated: false
-->
## Query parameters

The following table lists the available query parameters. All query parameters are optional.
The following table lists the available query parameters.

| Parameter | Data type | Description | Default |
| :--- | :--- | :--- | :--- |
Expand Down
2 changes: 1 addition & 1 deletion _api-reference/cat/cat-plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ include_deprecated: false
-->
## Query parameters

The following table lists the available query parameters. All query parameters are optional.
The following table lists the available query parameters.

| Parameter | Data type | Description | Default |
| :--- | :--- | :--- | :--- |
Expand Down
4 changes: 2 additions & 2 deletions _api-reference/cat/cat-recovery.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ include_deprecated: false
-->
## Query parameters

The following table lists the available query parameters. All query parameters are optional.
The following table lists the available query parameters.

| Parameter | Data type | Description | Default |
| :--- | :--- | :--- | :--- |
Expand All @@ -47,7 +47,7 @@ The following table lists the available query parameters. All query parameters a
| `help` | Boolean | Returns help information. | `false` |
| `index` | List | A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`. | N/A |
| `s` | List | A comma-separated list of column names or column aliases to sort by. | N/A |
| `time` | String | Specifies the time units, for example, `5d` or `7h`. For more information, see [Supported units]({{site.url}}{{site.baseurl}}/api-reference/units/). <br> Valid values are: `nanos`, `micros`, `ms`, `s`, `m`, `h`, and `d`. | N/A |
| `time` | String | Specifies the time units, for example, `5d` or `7h`. For more information, see [Supported units](https://opensearch.org/docs/latest/api-reference/units/). <br> Valid values are: `nanos`, `micros`, `ms`, `s`, `m`, `h`, and `d`. | N/A |
| `v` | Boolean | Enables verbose mode, which displays column headers. | `false` |

<!-- spec_insert_end -->
Expand Down
2 changes: 1 addition & 1 deletion _api-reference/cat/cat-repositories.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ include_deprecated: false
-->
## Query parameters

The following table lists the available query parameters. All query parameters are optional.
The following table lists the available query parameters.

| Parameter | Data type | Description | Default |
| :--- | :--- | :--- | :--- |
Expand Down
6 changes: 3 additions & 3 deletions _api-reference/cat/cat-segment-replication.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ include_deprecated: false
-->
## Path parameters

The following table lists the available path parameters. All path parameters are optional.
The following table lists the available path parameters.

| Parameter | Data type | Description |
| :--- | :--- | :--- |
Expand All @@ -51,7 +51,7 @@ include_deprecated: false
-->
## Query parameters

The following table lists the available query parameters. All query parameters are optional.
The following table lists the available query parameters.

| Parameter | Data type | Description | Default |
| :--- | :--- | :--- | :--- |
Expand All @@ -69,7 +69,7 @@ The following table lists the available query parameters. All query parameters a
| `index` | List | A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`. | N/A |
| `s` | List | A comma-separated list of column names or column aliases to sort by. | N/A |
| `shards` | List | A comma-separated list of shards to display. | N/A |
| `time` | String | Specifies the time units, for example, `5d` or `7h`. For more information, see [Supported units]({{site.url}}{{site.baseurl}}/api-reference/units/). <br> Valid values are: `nanos`, `micros`, `ms`, `s`, `m`, `h`, and `d`. | N/A |
| `time` | String | Specifies the time units, for example, `5d` or `7h`. For more information, see [Supported units](https://opensearch.org/docs/latest/api-reference/units/). <br> Valid values are: `nanos`, `micros`, `ms`, `s`, `m`, `h`, and `d`. | N/A |
| `timeout` | String | The operation timeout. | N/A |
| `v` | Boolean | Enables verbose mode, which displays column headers. | `false` |

Expand Down
2 changes: 1 addition & 1 deletion _api-reference/cat/cat-segments.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ include_deprecated: false
-->
## Query parameters

The following table lists the available query parameters. All query parameters are optional.
The following table lists the available query parameters.

| Parameter | Data type | Description | Default |
| :--- | :--- | :--- | :--- |
Expand Down
4 changes: 2 additions & 2 deletions _api-reference/cat/cat-shards.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ include_deprecated: false
-->
## Query parameters

The following table lists the available query parameters. All query parameters are optional.
The following table lists the available query parameters.

| Parameter | Data type | Description | Default |
| :--- | :--- | :--- | :--- |
Expand All @@ -46,7 +46,7 @@ The following table lists the available query parameters. All query parameters a
| `help` | Boolean | Returns help information. | `false` |
| `local` | Boolean | Returns local information but does not retrieve the state from the cluster manager node. | `false` |
| `s` | List | A comma-separated list of column names or column aliases to sort by. | N/A |
| `time` | String | Specifies the time units, for example, `5d` or `7h`. For more information, see [Supported units]({{site.url}}{{site.baseurl}}/api-reference/units/). <br> Valid values are: `nanos`, `micros`, `ms`, `s`, `m`, `h`, and `d`. | N/A |
| `time` | String | Specifies the time units, for example, `5d` or `7h`. For more information, see [Supported units](https://opensearch.org/docs/latest/api-reference/units/). <br> Valid values are: `nanos`, `micros`, `ms`, `s`, `m`, `h`, and `d`. | N/A |
| `v` | Boolean | Enables verbose mode, which displays column headers. | `false` |

<!-- spec_insert_end -->
Expand Down
2 changes: 1 addition & 1 deletion _api-reference/cat/cat-snapshots.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ The following table lists the available query parameters.
| `help` | Boolean | Returns help information. | `false` |
| `ignore_unavailable` | Boolean | When `true`, the response does not include information from unavailable snapshots. | `false` |
| `s` | List | A comma-separated list of column names or column aliases to sort by. | N/A |
| `time` | String | Specifies the time units, for example, `5d` or `7h`. For more information, see [Supported units]({{site.url}}{{site.baseurl}}/api-reference/units/). <br> Valid values are: `nanos`, `micros`, `ms`, `s`, `m`, `h`, and `d`. | N/A |
| `time` | String | Specifies the time units, for example, `5d` or `7h`. For more information, see [Supported units](https://opensearch.org/docs/latest/api-reference/units/). <br> Valid values are: `nanos`, `micros`, `ms`, `s`, `m`, `h`, and `d`. | N/A |
| `v` | Boolean | Enables verbose mode, which displays column headers. | `false` |

<!-- spec_insert_end -->
Expand Down
4 changes: 2 additions & 2 deletions _api-reference/cat/cat-tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ include_deprecated: false
-->
## Query parameters

The following table lists the available query parameters. All query parameters are optional.
The following table lists the available query parameters.

| Parameter | Data type | Description | Default |
| :--- | :--- | :--- | :--- |
Expand All @@ -45,7 +45,7 @@ The following table lists the available query parameters. All query parameters a
| `nodes` | List | A comma-separated list of node IDs or names used to limit the returned information. Use `_local` to return information from the node to which you're connecting, specify a specific node from which to get information, or keep the parameter empty to get information from all nodes. | N/A |
| `parent_task_id` | String | The parent task identifier, which is used to limit the response. | N/A |
| `s` | List | A comma-separated list of column names or column aliases to sort by. | N/A |
| `time` | String | Specifies the time units, for example, `5d` or `7h`. For more information, see [Supported units]({{site.url}}{{site.baseurl}}/api-reference/units/). <br> Valid values are: `nanos`, `micros`, `ms`, `s`, `m`, `h`, and `d`. | N/A |
| `time` | String | Specifies the time units, for example, `5d` or `7h`. For more information, see [Supported units](https://opensearch.org/docs/latest/api-reference/units/). <br> Valid values are: `nanos`, `micros`, `ms`, `s`, `m`, `h`, and `d`. | N/A |
| `v` | Boolean | Enables verbose mode, which displays column headers. | `false` |

<!-- spec_insert_end -->
Expand Down
2 changes: 1 addition & 1 deletion _api-reference/cat/cat-templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ include_deprecated: false
-->
## Query parameters

The following table lists the available query parameters. All query parameters are optional.
The following table lists the available query parameters.

| Parameter | Data type | Description | Default |
| :--- | :--- | :--- | :--- |
Expand Down
2 changes: 1 addition & 1 deletion _api-reference/cat/cat-thread-pool.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ include_deprecated: false
-->
## Query parameters

The following table lists the available query parameters. All query parameters are optional.
The following table lists the available query parameters.

| Parameter | Data type | Description | Default |
| :--- | :--- | :--- | :--- |
Expand Down
4 changes: 2 additions & 2 deletions _api-reference/document-apis/mtermvectors.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ component: path_parameters
-->
## Path parameters

The following table lists the available path parameters. All path parameters are optional.
The following table lists the available path parameters.

| Parameter | Data type | Description |
| :--- | :--- | :--- |
Expand All @@ -43,7 +43,7 @@ columns: Parameter, Data type, Description
-->
## Query parameters

The following table lists the available query parameters. All query parameters are optional.
The following table lists the available query parameters.

| Parameter | Data type | Description |
| :--- | :--- | :--- |
Expand Down
2 changes: 1 addition & 1 deletion _api-reference/security/authentication/auth-info.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ component: query_parameters
-->
## Query parameters

The following table lists the available query parameters. All query parameters are optional.
The following table lists the available query parameters.

| Parameter | Data type | Description |
| :--- | :--- | :--- |
Expand Down
4 changes: 2 additions & 2 deletions _api-reference/snapshots/clone-snapshot.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ include_deprecated: false
-->
## Query parameters

The following table lists the available query parameters. All query parameters are optional.
The following table lists the available query parameters.

| Parameter | Data type | Description |
| :--- | :--- | :--- |
| `cluster_manager_timeout` | String | The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters]({{site.url}}{{site.baseurl}}/api-reference/common-parameters/#time-units). |
| `cluster_manager_timeout` | String | The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common-parameters/#time-units). |

<!-- spec_insert_end -->

Expand Down
4 changes: 2 additions & 2 deletions _api-reference/tasks/cancel-tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ component: path_parameters
-->
## Path parameters

The following table lists the available path parameters. All path parameters are optional.
The following table lists the available path parameters.

| Parameter | Data type | Description |
| :--- | :--- | :--- |
Expand All @@ -43,7 +43,7 @@ component: query_parameters
-->
## Query parameters

The following table lists the available query parameters. All query parameters are optional.
The following table lists the available query parameters.

| Parameter | Data type | Description |
| :--- | :--- | :--- |
Expand Down
2 changes: 1 addition & 1 deletion _api-reference/tasks/get-tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ component: query_parameters
-->
## Query parameters

The following table lists the available query parameters. All query parameters are optional.
The following table lists the available query parameters.

| Parameter | Data type | Description | Default |
| :--- | :--- | :--- | :--- |
Expand Down
2 changes: 1 addition & 1 deletion _api-reference/tasks/list-tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ component: query_parameters
-->
## Query parameters

The following table lists the available query parameters. All query parameters are optional.
The following table lists the available query parameters.

| Parameter | Data type | Description | Default |
| :--- | :--- | :--- | :--- |
Expand Down
20 changes: 20 additions & 0 deletions spec-insert/lib/api/action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,26 @@ def deprecated; @spec.deprecated; end
# @return [String] Deprecation message
def deprecation_message; @spec['x-deprecation-message']; end

def self.find_by_rest(rest_line)
method, raw_path = rest_line.strip.split(' ', 2)
return nil unless method && raw_path

# Remove query parameters
path = raw_path.split('?').first

all.find do |action|
action.operations.any? do |op|
op.http_verb.casecmp?(method) &&
path_template_matches?(op.url, path)
end
end
end

def self.path_template_matches?(template, actual)
# "/{index}/_doc/{id}" => "^/[^/]+/_doc/[^/]+$"
regex = Regexp.new("^" + template.gsub(/\{[^\/]+\}/, '[^/]+') + "$")
regex.match?(actual)
end
# @return [String] API reference
def api_reference; @operation.external_docs.url; end
end
Expand Down
3 changes: 2 additions & 1 deletion spec-insert/lib/doc_processor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ def find_insertions(lines)

start_indices.zip(end_indices).map do |start, finish|
args = InsertArguments.from_marker(lines[start..finish])
next nil if args.skip?
[start, finish, SpecInsert.new(args)]
end
end.compact
end

# @param [Array<Integer>] start_indices
Expand Down
Loading