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 ?