CreateSnapshotRequest in High Level Rest Client has a problem

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.

{
  "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 :

{
    "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

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 ?

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.

2 Likes

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