Services /
Update service health checks
Updates health checks for the given service.
Required permission
Project > Services > General > Update
Path parameters
projectId
string requiredID of the projectserviceId
string requiredID of the service
Request body
- {object}
healthChecks
[array] requiredAn array of health checks.- {object}A health check object.
protocol
string requiredThe protocol to access the health check with.one ofHTTP, CMD, TCPtype
string requiredThe type of health check.one oflivenessProbe, readinessProbe, startupProbepath
stringThe path of the health check endpoint. Required when protocol is HTTP.pattern^\/([a-zA-Z0-9-._]+\/)*[a-zA-Z0-9-._]+$cmd
stringThe command to run for the health check. Required when protocol is CMDport
integerPort number for the health check endpoint. Required when protocol is HTTP.min1initialDelaySeconds
integer requiredInitial delay, in seconds, before the health check is first run.min1max180periodSeconds
integer requiredThe time between each check, in seconds.min10max600timeoutSeconds
integer requiredThe time to wait for a response before marking the health check as a failure.min1max60failureThreshold
integer requiredThe maximum number of allowed failures.min1max255successThreshold
integerThe number of successes required to mark the health check as a success.min1max255
Response body
- {object}Response object.
data
{object} requiredResult data.
API
CLI
JS Client
POST /v1/projects/{projectId}/services/{serviceId}/health-checks
Example request
Request body
curl
curl --header "Content-Type: application/json" \
--header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
--request POST \
--data '{"healthChecks":[{"protocol":"HTTP","type":"readinessProbe","path":"/health-check","port":8080,"initialDelaySeconds":10,"periodSeconds":60,"timeoutSeconds":1,"failureThreshold":3,"successThreshold":1}]}' \
https://api.northflank.com/v1/projects/{projectId}/services/{serviceId}/health-checks
Example response
200 OK
The operation was performed successfully.
JSON
{
"data": {}
}