mirror of
https://github.com/iSharkFly-Docs/opensearch-docs-cn
synced 2025-03-08 05:20:20 +00:00
* Fix APIs File Signed-off-by: samipak458 <samipak458@gmail.com> * Update API files according to API template Signed-off-by: samipak458 <samipak458@gmail.com> * Update exec-stored-script.md Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com> * Update cat-aliases.md Signed-off-by: MUHAMMAD SAMIULLAH <samipak458@gmail.com> * Update cat-allocation.md Signed-off-by: MUHAMMAD SAMIULLAH <samipak458@gmail.com> * Update cat-cluster_manager.md Signed-off-by: MUHAMMAD SAMIULLAH <samipak458@gmail.com> * Update cat-count.md Signed-off-by: MUHAMMAD SAMIULLAH <samipak458@gmail.com> * Update cat-field-data.md Signed-off-by: MUHAMMAD SAMIULLAH <samipak458@gmail.com> * Update cat-health.md Signed-off-by: MUHAMMAD SAMIULLAH <samipak458@gmail.com> * updated * updated * updated --------- Signed-off-by: samipak458 <samipak458@gmail.com> Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com> Signed-off-by: MUHAMMAD SAMIULLAH <samipak458@gmail.com> Co-authored-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
56 lines
1.4 KiB
Markdown
56 lines
1.4 KiB
Markdown
---
|
|
layout: default
|
|
title: Delete Script
|
|
parent: Script APIs
|
|
nav_order: 4
|
|
---
|
|
|
|
# Delete script
|
|
**Introduced 1.0**
|
|
{: .label .label-purple }
|
|
|
|
Deletes a stored script
|
|
|
|
## Path parameters
|
|
|
|
Path parameters are optional.
|
|
|
|
| Parameter | Data type | Description |
|
|
:--- | :--- | :---
|
|
| script-id | String | ID of script to delete. |
|
|
|
|
## Query parameters
|
|
|
|
| Parameter | Data type | Description |
|
|
:--- | :--- | :---
|
|
| cluster_manager_timeout | Time | Amount of time to wait for a connection to the cluster manager. 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.
|
|
|
|
#### Example request
|
|
|
|
The following request deletes the `my-first-script` script:
|
|
|
|
````json
|
|
DELETE _scripts/my-script
|
|
````
|
|
{% include copy-curl.html %}
|
|
|
|
#### Example response
|
|
|
|
The `DELETE _scripts/my-first-script` request returns the following field:
|
|
|
|
````json
|
|
{
|
|
"acknowledged" : true
|
|
}
|
|
````
|
|
|
|
To determine whether the stored script was successfully deleted, use the [Get stored script]({{site.url}}{{site.baseurl}}/api-reference/script-apis/get-stored-script/) API, passing the script name as the `script` path parameter.
|
|
|
|
## Response fields
|
|
|
|
The <HTTP METHOD> <endpoint> request returns the following response fields:
|
|
|
|
| Field | Data type | Description |
|
|
:--- | :--- | :---
|
|
| acknowledged | Boolean | Whether the delete script request was received. | |