-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcloud_status.sh
More file actions
executable file
·59 lines (50 loc) · 1.48 KB
/
Copy pathcloud_status.sh
File metadata and controls
executable file
·59 lines (50 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
set -e
#
# Lists collections and configurations in the cloud
#
# Requirements: jq
#
###############################################################################
# CONFIG
###############################################################################
if [[ -s "cloud.conf" ]]; then
source "cloud.conf" # Local overrides
fi
pushd ${BASH_SOURCE%/*} > /dev/null
if [[ -s "cloud.conf" ]]; then
source "cloud.conf" # Project overrides
fi
source general.conf
: ${CLOUD:="$(pwd)/cloud"}
popd > /dev/null
function usage() {
echo "Usage: ./cloud_status.sh"
echo ""
echo "Specify Solr port with SOLR_BASE_PORT=xxxx ./cloud_status.sh"
exit $1
}
check_parameters() {
# Resolve default
: ${HOST:=`hostname`}
: ${SOLR_BASE_PORT:=9000}
: ${SOLR:="$HOST:$SOLR_BASE_PORT"}
}
################################################################################
# FUNCTIONS
################################################################################
# Input: collection
list_collections() {
set +e
echo "*** Collections"
curl -m 30 -s "http://$SOLR/solr/admin/collections?action=LIST" | jq -r .collections[]
echo ""
echo "*** Config sets"
curl -m 30 -s "http://$SOLR/solr/admin/configs?action=LIST" | jq -r .configSets[]
set -e
}
###############################################################################
# CODE
###############################################################################
check_parameters "$@"
list_collections