Skip to content

Commit

Permalink
Update documentation for create / update repository api (#7851)
Browse files Browse the repository at this point in the history
* Update documentation for create / update repository api

Signed-off-by: Ashish Singh <[email protected]>

* Update create-repository.md

* Apply suggestions from code review

Co-authored-by: Nathan Bower <[email protected]>
Signed-off-by: Naarcha-AWS <[email protected]>

---------

Signed-off-by: Ashish Singh <[email protected]>
Signed-off-by: Naarcha-AWS <[email protected]>
Co-authored-by: Naarcha-AWS <[email protected]>
Co-authored-by: Nathan Bower <[email protected]>
  • Loading branch information
3 people authored Jul 30, 2024
1 parent 4993689 commit 10f4b1e
Showing 1 changed file with 30 additions and 18 deletions.
48 changes: 30 additions & 18 deletions _api-reference/snapshots/create-repository.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,20 @@ PUT /_snapshot/my-first-repo/

Parameter | Data type | Description
:--- | :--- | :---
repository | String | Repository name |
`repository` | String | Repository name |

## Request parameters

Request parameters depend on the type of repository: `fs` or `s3`.

### Common parameters

The following table lists parameters that can be used with both the `fs` and `s3` repositories.

Request field | Description
:--- | :---
`prefix_mode_verification` | When enabled, adds a hashed value of a random seed to the prefix for repository verification. For remote-store-enabled clusters, you can add the `setting.prefix_mode_verification` setting to the node attributes for the supplied repository. This field works with both new and existing repositories. Optional.

### fs repository

Request field | Description
Expand All @@ -48,20 +56,6 @@ Request field | Description
`remote_store_index_shallow_copy` | Boolean | Determines whether the snapshot of the remote store indexes are captured as a shallow copy. Default is `false`.
`readonly` | Whether the repository is read-only. Useful when migrating from one cluster (`"readonly": false` when registering) to another cluster (`"readonly": true` when registering). Optional.

## Example request

The following example registers an `fs` repository using the local directory `/mnt/snapshots` as `location`.

```json
PUT /_snapshot/my-fs-repository
{
"type": "fs",
"settings": {
"location": "/mnt/snapshots"
}
}
```
{% include copy-curl.html %}

#### s3 repository

Expand All @@ -85,9 +79,27 @@ Request field | Description
For the `base_path` parameter, do not enter the `s3://` prefix when entering your S3 bucket details. Only the name of the bucket is required.
{: .note}

## Example request
## Example requests

The following request registers a new S3 repository called `my-opensearch-repo` in an existing bucket called `my-open-search-bucket`. By default, all snapshots are stored in the `my/snapshot/directory`.
### `fs`

The following example registers an `fs` repository using the local directory `/mnt/snapshots` as `location`:

```json
PUT /_snapshot/my-fs-repository
{
"type": "fs",
"settings": {
"location": "/mnt/snapshots"
}
}
```
{% include copy-curl.html %}

### `s3`


The following request registers a new S3 repository called `my-opensearch-repo` in an existing bucket called `my-open-search-bucket`. By default, all snapshots are stored in the `my/snapshot/directory`:

```json
PUT /_snapshot/my-opensearch-repo
Expand All @@ -112,4 +124,4 @@ Upon success, the following JSON object is returned:
```

To verify that the repository was registered, use the [Get snapshot repository]({{site.url}}{{site.baseurl}}/api-reference/snapshots/get-snapshot-repository) API, passing the repository name as the `repository` path parameter.
{: .note}
{: .note}

0 comments on commit 10f4b1e

Please sign in to comment.