# CreateSnapshotRequest in High Level Rest Client has a problem

**URL:** <https://discuss.elastic.co/t/createsnapshotrequest-in-high-level-rest-client-has-a-problem/236273>\
**Category:** Elasticsearch\
**Created:** [June 9, 2020, 6:44am UTC](https://discuss.elastic.co/t/createsnapshotrequest-in-high-level-rest-client-has-a-problem/236273 "2020-06-09T06:44:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheDevLuffy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thedevluffy/32/90667_2.png) [@TheDevLuffy](https://discuss.elastic.co/u/TheDevLuffy)\
**Post date:** [June 9, 2020, 6:44am UTC](https://discuss.elastic.co/t/createsnapshotrequest-in-high-level-rest-client-has-a-problem/236273/1 "2020-06-09T06:44:56Z")

</div>

Hello,

Now, I'm using Amazon Elasticsearch Service with High Level Rest Client.

Firstable, I tried to create snapshot with `CreateSnapshotRequest`.

This trial has request body (following code block) according to http log.

```json
{
  "repository": "snapshot-repository-name",
  "snapshot": "snapshot-name",
  "indices": [
		// names of indices
  ],
  "partial": false,
  "settings": {},
  "include_global_state": true,
  "expand_wildcards": [
    "open"
  ],
  "ignore_unavailable": false,
  "allow_no_indices": true,
  "ignore_throttled": false
}

```

but response i'd got was :

```auto
{
    "Message":"settings.role_arn is needed for snapshot registration."
}

```

I thought this message is given when **create snapshot repository.**

So, I tried with Low Level Rest Client.

I build request body using json string by referring to [elastic search documentation](https://www.elastic.co/guide/en/elasticsearch/reference/7.1/modules-snapshots.html#_snapshot)

Then, request was successful and snapshot was created.

Finally, I realized the problem is from `settings` property of `CreateSnapshotRequest` .

According to `CreateSnapshotRequest#toXContent`, if `settings` is null, json builder would not contain `settings`. This looks like `settings` can be `null`. But `CreateSnapshotRequest#validate` show me could not set `settings` null.

Then, how can I request without `settings` using CreateSnapshotRequest ?

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [June 9, 2020, 7:22am UTC](https://discuss.elastic.co/t/createsnapshotrequest-in-high-level-rest-client-has-a-problem/236273/2 "2020-06-09T07:22:58Z")

</div>

> [@TheDevLuffy](#):
>
> `settings.role_arn is needed for snapshot registration`

I do not see this message anywhere in the source code. If you're using the AWS Elasticsearch Service then you are running a nonstandard version of Elasticsearch with a number of proprietary modifications to which we do not have access. I suspect this incompatibility is coming from such a modification. You'll need to contact Amazon about that, or you can set up a hosted cluster running the official version at [Elastic Cloud: Hosted Elasticsearch, Hosted Search | Elastic](https://www.elastic.co/cloud/).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 7, 2020, 7:23am UTC](https://discuss.elastic.co/t/createsnapshotrequest-in-high-level-rest-client-has-a-problem/236273/3 "2020-07-07T07:23:02Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
