Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 67 additions & 3 deletions _api-reference/snapshots/create-repository.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,18 @@
**Introduced 1.0**
{: .label .label-purple }


You can register a new repository in which to store snapshots or update information for an existing repository by using the snapshots API.

There are two types of snapshot repositories:
Snapshot repositories can be of the following types:

* File system (`fs`): For instructions on creating an `fs` repository, see [Register repository shared file system]({{site.url}}{{site.baseurl}}/tuning-your-cluster/availability-and-recovery/snapshots/snapshot-restore/#shared-file-system).

* Amazon Simple Storage Service (Amazon S3) bucket (`s3`): For instructions on creating an `s3` repository, see [Register repository Amazon S3]({{site.url}}{{site.baseurl}}/tuning-your-cluster/availability-and-recovery/snapshots/snapshot-restore/#amazon-s3).

For instructions on creating a repository, see [Register repository]({{site.url}}{{site.baseurl}}/opensearch/snapshots/snapshot-restore#register-repository).
* Hadoop Distributed File System (HDFS) (`hdfs`): For instructions on creating an `hdfs` repository, see [Register an HDFS repository]({{site.url}}{{site.baseurl}}/tuning-your-cluster/availability-and-recovery/snapshots/snapshot-restore/#hdfs).

For instructions on creating a repository, see [Register repository]({{site.url}}{{site.baseurl}}/opensearch/snapshots/snapshot-restore/#register-repository).

## Endpoints

Expand All @@ -34,7 +37,10 @@

## Request parameters

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

### Common parameters

Expand Down Expand Up @@ -97,6 +103,17 @@
The `server_side_encryption` setting is removed as of OpenSearch 3.1.0. S3 applies server-side encryption as the base level of encryption for all S3 buckets. Because this cannot be disabled, this value repository setting had no effect. For more information, see [Protecting data with server-side encryption](https://docs.aws.amazon.com/AmazonS3/latest/userguide/serv-side-encryption.html).
{: .note}

### hdfs repository

Check failure on line 106 in _api-reference/snapshots/create-repository.md

View workflow job for this annotation

GitHub Actions / style-job

[vale] reported by reviewdog 🐶 [OpenSearch.Spelling] Error: hdfs. If you are referencing a setting, variable, format, function, or repository, surround it with tic marks. Raw Output: {"message": "[OpenSearch.Spelling] Error: hdfs. If you are referencing a setting, variable, format, function, or repository, surround it with tic marks.", "location": {"path": "_api-reference/snapshots/create-repository.md", "range": {"start": {"line": 106, "column": 5}}}, "severity": "ERROR"}

Check failure on line 106 in _api-reference/snapshots/create-repository.md

View workflow job for this annotation

GitHub Actions / style-job

[vale] reported by reviewdog 🐶 [OpenSearch.HeadingCapitalization] 'hdfs repository' is a heading and should be in sentence case. Raw Output: {"message": "[OpenSearch.HeadingCapitalization] 'hdfs repository' is a heading and should be in sentence case.", "location": {"path": "_api-reference/snapshots/create-repository.md", "range": {"start": {"line": 106, "column": 5}}}, "severity": "ERROR"}

Request field | Description
:----------------------------------|:-------------------------------------------------------------------------------------------------------------
| `uri` | The HDFS URI of the `hdfs://<HOST>:<PORT>/path/to/backup` format. Required. |
| `path` | The path within HDFS where you want to store snapshots (for example, `/my/snapshot/directory`). Required. |
| `security.principal` | The Kerberos principal to use when connecting to HDFS. Optional. |
| `conf.<key>` | Additional HDFS client configuration settings (for example, `core-site.xml` or `hdfs-site.xml`). Optional. |



## Example requests

### `fs`
Expand Down Expand Up @@ -254,6 +271,53 @@
python=step1_python %}
<!-- spec_insert_end -->

### `hdfs`

The following request registers a new HDFS repository using the HDFS URI `hdfs://namenode:8020` and the HDFS filesystem path `/opensearch/snapshots`:
<!-- spec_insert_start
component: example_code
rest: PUT /_snapshot/my-hdfs-repository
body: |
{
"type": "hdfs",
"settings": {
"uri": "hdfs://namenode:8020",
"path": "/opensearch/snapshots"
}
}
-->
{% capture step1_rest %}
PUT /_snapshot/my-hdfs-repository
{
"type": "hdfs",
"settings": {
"uri": "hdfs://namenode:8020",
"path": "/opensearch/snapshots"
}
}
{% endcapture %}

{% capture step1_python %}


response = client.snapshot.create_repository(
repository = "my-hdfs-repository",
body = {
"type": "hdfs",
"settings": {
"uri": "hdfs://namenode:8020",
"path": "/opensearch/snapshots"
}
}
)

{% endcapture %}

{% include code-block.html
rest=step1_rest
python=step1_python %}


## Example response

Upon success, the following JSON object is returned:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ You will most likely not need to specify any parameters except for `location`. F
sudo ./bin/opensearch-plugin install repository-s3
```

If you're using the Docker installation, see [Working with plugins]({{site.url}}{{site.baseurl}}/opensearch/install/docker#working-with-plugins). Your `Dockerfile` should look something like this:
If you're using the Docker installation, see [Working with plugins]({{site.url}}{{site.baseurl}}/install-and-configure/install-opensearch/docker/#working-with-plugins). Your `Dockerfile` should look similar to the following:

```
FROM opensearchproject/opensearch:{{site.opensearch_version}}
Expand Down
Loading