-
Notifications
You must be signed in to change notification settings - Fork 518
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add CAT API automation #9042
Add CAT API automation #9042
Conversation
Signed-off-by: Archer <[email protected]>
Thank you for submitting your PR. The PR states are In progress (or Draft) -> Tech review -> Doc review -> Editorial review -> Merged. Before you submit your PR for doc review, make sure the content is technically accurate. If you need help finding a tech reviewer, tag a maintainer. When you're ready for doc review, tag the assignee of this PR. The doc reviewer may push edits to the PR directly or leave comments and editorial suggestions for you to address (let us know in a comment if you have a preference). The doc reviewer will arrange for an editorial review. |
Signed-off-by: Archer <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of suggestions for template consistency.
columns: Parameter,Type,Description,Default | ||
include_deprecated: false | ||
--> | ||
## Query parameters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be a line between the heading and the table: do the spec tags have to go below the heading for it to happen? There should also be an intro sentence here "The following table lists the available query parameters. All query parameters are optional." per the API template.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. I noticed now that not having the space breaks the table on prod. I'll omit the header for now.
@nhtruong: can we adjust the workflow to add a space after the header for both query parameters and path parameters?
`cluster_manager_timeout` | String | A timeout for connection to the cluster manager node. | | ||
`format` | String | A short version of the HTTP `Accept` header, such as `json` or `yaml`. | | ||
`h` | List | A comma-separated list of column names to display. | | ||
`help` | Boolean | Return help information. | `false` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`help` | Boolean | Return help information. | `false` | |
`help` | Boolean | Returns help information. | `false` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updating this description in the spec.
<!-- spec_insert_end --> | ||
|
||
|
||
## Example request | ||
|
||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be a json
highlighter specified for the example requests.
:--- | :--- | :--- | :--- | ||
`bytes` | String | The units used to display byte values. | | ||
`cluster_manager_timeout` | String | The amount of time allowed to establish a connection to the cluster manager node. | | ||
`expand_wildcards` | List or String | The type of index that wildcard patterns can match. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we provide valid values for expand_wildcards
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updating the description in the spec
now.
`h` | List | A comma-separated list of column names to display. | | ||
`help` | Boolean | Return help information. | `false` | ||
`s` | List | A comma-separated list of column names or column aliases to sort by. | | ||
`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/). | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous instance of time
did not include examples. I think examples are nice and a link to the units should be provided.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are all time
parameter descriptions coming from different places in the spec? If so, we should create a reference variable in the spec and source all descriptions from that variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's talk about using $ref
for descriptions in another venue. Using $refs
for descriptions also affects how other developers contribute new or missing specs, so I think it warrants a larger discussion about how to do it properly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We talked about this in the API spec repo a while ago opensearch-project/opensearch-api-specification#726 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes we did. When I tried to do this locally it the spec would error out, similar to what's discussed in this issue: opensearch-project/opensearch-api-specification#577. I believe that you would have to create a separate schema which includes only the shared description, as opposed to referencing an already used description to another schema. I'll make an issue the api-specification repo detailing what I tried and encountered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we just need to keep the definitions in the common schema and generate valid values off of the enum (I opened an issue in the api-spec repo opensearch-project/opensearch-api-specification#783) cc: @nhtruong
<!-- spec_insert_end --> | ||
|
||
## Request body fields | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be an intro sentence here per the API template.
|
||
```json | ||
GET /_cat/pit_segments | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"o463QQEPbXktaW5kZXgtMDAwMDAxFkhGN09fMVlPUkVPLXh6MUExZ1hpaEEAFjBGbmVEZHdGU1EtaFhhUFc4ZkR5cWcAAAAAAAAAAAIWaXBPNVJtZEhTZDZXTWFFR05waXdWZwEWSEY3T18xWU9SRU8teHoxQTFnWGloQQAA" | ||
] | ||
} | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a copy button here
`bytes` | String | The units used to display byte values. | | ||
`completed_only` | Boolean | When `true`, the response only includes the last-completed segment replication events. | `false` | ||
`detailed` | Boolean | When `true`, the response includes additional metrics for each stage of a segment replication event. | `false` | ||
`expand_wildcards` | List or String | Whether to expand the wildcard expression to include concrete indexes that are open, closed, or both. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This description is different from one of the above expand_wildcards
descriptions. We should make them the same by using a variable in the spec.
include_deprecated: false | ||
--> | ||
## Query parameters | ||
Parameter | Type | Description | Default |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make this "Data type" to be consistent with the template?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. But I don't think this should be a blocker for this PR since @nhtruong would have to address it in the workflow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addendum to my previous. I figured out how to update this and will add it to this PR.
Signed-off-by: Naarcha-AWS <[email protected]>
Signed-off-by: Archer <[email protected]>
Signed-off-by: Archer <[email protected]>
Signed-off-by: Archer <[email protected]>
Signed-off-by: Archer <[email protected]>
Signed-off-by: Archer <[email protected]>
Signed-off-by: Naarcha-AWS <[email protected]>
Going to close this one for now to open a new PR. |
Description
The following PR adds CAT API automation markers. All descriptions have been reviewed by editorial, see opensearch-project/opensearch-api-specification#726.
Checklist
For more information on following Developer Certificate of Origin and signing off your commits, please check here.