Elasticsearch: Manually verify snapshot repositories
This updates the script for registering snapshot repositories to include a manual verification of the repositories created. This simply allows for inspection of all master and data nodes the repository is verified with to provide additional visibility into the state of all repositories Change-Id: I6e5386386e2b79b1cb0f41fc1f9b78817695f8f3 Signed-off-by: Steve Wilkerson <sw5822@att.com>
This commit is contained in:
parent
17a7eb5cdc
commit
8130e6bdc5
@ -46,6 +46,11 @@ function register_snapshot_repository() {
|
||||
fi
|
||||
}
|
||||
|
||||
function verify_snapshot_repository() {
|
||||
curl -K- <<< "--user ${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD}" \
|
||||
-XPOST "${ELASTICSEARCH_HOST}/_snapshot/$1/_verify"
|
||||
}
|
||||
|
||||
# Get names of all current snapshot repositories
|
||||
snapshot_repos=$(curl -K- <<< "--user ${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD}" \
|
||||
"${ELASTICSEARCH_HOST}"/_cat/repositories?format=json | jq -r '.[].id')
|
||||
@ -56,5 +61,6 @@ if contains "$snapshot_repos" {{$repository.name}}; then
|
||||
echo "Snapshot repository {{$repository.name}} exists!"
|
||||
else
|
||||
register_snapshot_repository {{$repository.name}}
|
||||
verify_snapshot_repository {{$repository.name}}
|
||||
fi
|
||||
{{ end }}
|
||||
|
Loading…
Reference in New Issue
Block a user