From 4cb9b7aaa6822dcb6adf1fcbaafee5a6af8a9087 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 28 Mar 2025 16:15:50 +0000 Subject: [PATCH] Add 'Clone Snapshot' API Documentation (#8371) * Add documentation for Clone Snapshot API Signed-off-by: Reiya Downs * Light edits Signed-off-by: Reiya Downs * Fixed title Signed-off-by: Reiya Downs * Remove unnecessary clone-repository file Signed-off-by: Reiya Downs * Update page with automation markers Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com> * Remove response body. Will loop back around once all missing request descriptions have been added to core. Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com> * Apply suggestions from code review Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com> * Update clone-snapshot.md Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com> * Apply suggestions from code review Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com> * Apply suggestions from code review Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Nathan Bower Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com> --------- Signed-off-by: Reiya Downs Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com> Co-authored-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com> Co-authored-by: Nathan Bower (cherry picked from commit a241c0047c28d3f88e2406073da9eb2007aeed7e) Signed-off-by: github-actions[bot] --- _api-reference/snapshots/clone-snapshot.md | 80 ++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 _api-reference/snapshots/clone-snapshot.md diff --git a/_api-reference/snapshots/clone-snapshot.md b/_api-reference/snapshots/clone-snapshot.md new file mode 100644 index 00000000000..5308c9787ff --- /dev/null +++ b/_api-reference/snapshots/clone-snapshot.md @@ -0,0 +1,80 @@ +--- +layout: default +title: Clone snapshot +parent: Snapshot APIs +nav_order: 10 +--- + +# Clone snapshot +Introduced 1.0 +{: .label .label-purple } + +Creates a clone of all or part of a snapshot in the same repository as the original. + + + +## Endpoints +```json +PUT /_snapshot/{repository}/{snapshot}/_clone/{target_snapshot} +``` + + + +## Path parameters + +The following table lists the available path parameters. + +| Parameter | Required | Data type | Description | +| :--- | :--- | :--- | :--- | +| `repository` | **Required** | String | The name of repository that will contain the snapshot clone. | +| `snapshot` | **Required** | String | The name of the original snapshot. | +| `target_snapshot` | **Required** | String | The name of the cloned snapshot. | + + + + + +## Query parameters + +The following table lists the available query parameters. All query parameters are optional. + +| 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). | + + + + +## Example request + +The following request clones indexes `index_a` and `index_b` from `my_snapshot`, a snapshot located in the snapshot repository `my-opensearch-repo`, into a new snapshot in the same repository called `my_new_snapshot`: + +```json +PUT /_snapshot/my-opensearch-repo/my_snapshot/_clone/my_new_snapshot +{ + “indices” : “index_a,index_b” +} +``` +{% include copy-curl.html %} + + +## Example response + +The successful creation of a snapshot clone returns the following response: + +```json +{ + "acknowledged" : true +} +``` +