Run all components in one namespace
[oom.git] / kubernetes / config / docker / init / src / config / consul / consul-agent-config / scripts / mso-api-script.sh
1 ## Query the health check API.
2 HEALTH_CHECK_ENDPOINT="http://mso.namespace-placeholder:8080/ecomp/mso/infra/healthcheck"
3 HEALTH_CHECK_RESPONSE=$(curl -s $HEALTH_CHECK_ENDPOINT)
4
5 READY=$(echo $HEALTH_CHECK_RESPONSE | grep "Application ready")
6
7 if [ -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
12 else
13   echo "Application is available."
14   return 0
15 fi