comparison scripts/list-document-store-snapshots.sh @ 424:52c2ec5ddeb5

DS-54: add backup, restore, and list snapshots scripts for document store
author Robin Fronk <robin.fronk@mcoecn.org>
date Tue, 19 Sep 2023 11:36:03 -0400
parents
children
comparison
equal deleted inserted replaced
423:8f797bb7ccb3 424:52c2ec5ddeb5
1 #!/bin/bash
2
3 projectDir=${1:-$PWD}
4 detailedView=${2:-false}
5
6 cd "$projectDir" || echo "Unable to change to project directory: $projectDir"
7
8 function prop {
9 grep "${1}" .env/ssdt-document-store-shared.properties|cut -d'=' -f2
10 }
11
12 entityId=$(prop 'entityId' | tr -d '"')
13 repository="${entityId}_fs_backup"
14 certificate=${projectDir}/http_ca.crt
15 baseUrl="https://$(prop 'DOCUMENTSTORE_ELASTIC_HOST' | tr -d '"'):$(prop 'DOCUMENTSTORE_ELASTIC_PORT' | tr -d '"')"
16 elasticPassword=$(prop 'ELASTIC_PASSWORD' | tr -d '"')
17
18 options="pretty&verbose=${detailedView}&index_names=${detailedView}&ignore_unavailable=true"
19
20 curl --cacert "${certificate}" -s -u elastic:"${elasticPassword}" -X GET "${baseUrl}/_snapshot/${repository}/_all?${options}"