4e582272410d55d4a4d59d15bbb4ef0ff3fdb656
[sdc.git] / openecomp-be / dist / sdc-onboard-backend-docker / artifacts / chef-repo / cookbooks / sdc-onboard-backend / templates / default / ready-probe.sh.erb
1 #!/bin/bash
2 <% if node[:disableHttp] -%>
3 health_Check_http_code=$(curl --max-time 5 -o /dev/null -w '%{http_code}' -X GET --header "USER_ID: cs0008" --header "Accept: application/json" "http://127.0.0.1:<%= @ssl_port %>/onboarding-api/v1.0/healthcheck")
4 <% else %>
5 health_Check_http_code=$(curl --max-time 5 -o /dev/null -w '%{http_code}' -X GET --header "USER_ID: cs0008" --header "Accept: application/json" "http://127.0.0.1:<%= @onboard_port %>/onboarding-api/v1.0/healthcheck")
6 <% end -%>
7 if [[ "$health_Check_http_code" -eq 200 ]]; then
8    exit 0
9 else
10    exit $health_Check_http_code
11 fi