blob: 047d2cb6f1ab5de51b10b09dcfdcc7f61a86dfb1 [file] [log] [blame]
gfrabonife17bbe2017-09-22 11:30:59 -04001## Query the health check API.
Priyanka Jainc07e1d12018-05-03 12:52:04 +00002HEALTH_CHECK_ENDPOINT="http://so:8080/ecomp/mso/infra/healthcheck"
gfrabonife17bbe2017-09-22 11:30:59 -04003HEALTH_CHECK_RESPONSE=$(curl -s $HEALTH_CHECK_ENDPOINT)
4
5READY=$(echo $HEALTH_CHECK_RESPONSE | grep "Application ready")
6
7if [ -n $READY ]; then
8 echo "Query against health check endpoint: $HEALTH_CHECK_ENDPOINT"
9 echo "Produces response: $HEALTH_CHECK_RESPONSE"
10 echo "Application is not in an available state"
11 return 2
12else
13 echo "Application is available."
14 return 0
15fi