1.9 KiB
layout, title, parent, nav_order
| layout | title | parent | nav_order |
|---|---|---|---|
| default | Delete snapshot | Snapshot APIs | 70 |
Delete Snapshot API
Introduced 1.0 {: .label .label-purple }
Deletes a snapshot from a repository. To view a list of your repositories, use the CAT Repositories API. To view a list of your snapshots, use the CAT Snapshots API.
Deleting a snapshot that is in progress stops the snapshot operation and deletes the partially created snapshot.
Endpoints
DELETE _snapshot/{repository}/{snapshot}
Path parameters
The following table lists the available path parameters.
| Parameter | Data type | Description |
|---|---|---|
repository |
String | Repository that contains the snapshot. |
snapshot |
String | Snapshot to delete. |
Example request
The following request deletes a snapshot called my-first-snapshot from the my-opensearch-repo repository:
{% capture step1_rest %} DELETE /_snapshot/my-opensearch-repo/my-first-snapshot {% endcapture %}
{% capture step1_python %}
response = client.snapshot.delete( repository = "my-opensearch-repo", snapshot = "my-first-snapshot" )
{% endcapture %}
{% include code-block.html rest=step1_rest python=step1_python %}
Example response
Upon success, the response returns the following JSON object:
{
"acknowledged": true
}
To verify that the snapshot was deleted, use the Get snapshot API, passing the snapshot name as the snapshot path parameter.
{: .note}
Required permissions
If you use the Security plugin, make sure you have the appropriate permissions: cluster:admin/snapshot/delete.