Skip to content
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 script documentation. #1016

Conversation

Steve-O-Murphy
Copy link
Contributor

Signed-off-by: Steve Murphy [email protected]

Description

I added documentation for these script APIs:

  • Create script
  • Delete script
  • Execute script
  • Get script contexts
  • Get stored script.

I also added index.md.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Steve Murphy <[email protected]>
@Naarcha-AWS Naarcha-AWS marked this pull request as ready for review August 30, 2022 18:07
@Naarcha-AWS Naarcha-AWS requested a review from a team as a code owner August 30, 2022 18:07

#### Sample request

The following request deletes the `books` index.:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be deleting the script, not the whole index.

The following request deletes the `books` index.:

````json
DELETE /books
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DELETE _scripts/my-first-script


#### Sample response

The `DELETE /books` request returns the following field:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be delete script


### Response fields

The <HTTP METHOD> <endpoint> request returns the following response fields:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete script request


| Field | Data Type | Description |
:--- | :--- | :---
| name | String | Mthod name. |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Method


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

````json
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we get an actual response from your my-first-script for consistency?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have made this change.

The script APIs allow you to work with stored scripts. Stored scripts are part of the cluster state and reduce compilation time and enhance search speed. The default scripting language is Painless.

You perform the following operations on stored scripts:
* create
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make these links to pages?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kolchfa-aws A list of links to pages is automatically generated.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see the above list rendering as plain text. I suggest we make those links to the pages they refer to.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Naarcha-AWS Ah, now I understand. A TABLE OF CONTENTS section is generated that has links to the operations that I hard-coded. Given that, maybe remove the the hard-coded list?

Screen Shot 2022-09-01 at 5 09 09 PM

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Naarcha-AWS, I looked at the production version and the links in the bulleted list (see attachment) are broken. They each include path segment script-apis that needs to be changed to _script-apis.

opensearch-script-link-errors

* retrieve
* delete

You can also retrieve stored script contexts.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make the last sentence a list item in the list above.

@ariamarble
Copy link
Contributor

PR moved to #1094

@ariamarble
Copy link
Contributor

Merged on #1094

@ariamarble ariamarble closed this Sep 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants