resources.configureHealth
POST
/resources/{resourceId}/health-policy
const url = 'https://example.com/api/resources/example/health-policy';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"healthCheck":{"enabled":true,"type":"http","intervalSeconds":5,"timeoutSeconds":5,"retries":10,"startPeriodSeconds":5,"http":{"method":"GET","scheme":"http","host":"localhost","port":1,"path":"/","expectedStatusCode":200,"expectedResponseText":"example"}}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/resources/example/health-policy \ --header 'Content-Type: application/json' \ --data '{ "healthCheck": { "enabled": true, "type": "http", "intervalSeconds": 5, "timeoutSeconds": 5, "retries": 10, "startPeriodSeconds": 5, "http": { "method": "GET", "scheme": "http", "host": "localhost", "port": 1, "path": "/", "expectedStatusCode": 200, "expectedResponseText": "example" } } }'Configures readiness and health checks used during verification. Public docs: /docs/resources/profiles/health-network/#resource-health-profile
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” resourceId
required
string
Request Body required
Section titled “Request Body required ” Media type application/json
object
healthCheck
required
object
enabled
boolean
type
string
intervalSeconds
integer
timeoutSeconds
integer
retries
integer
startPeriodSeconds
integer
http
object
method
string
scheme
string
host
string
port
integer
path
string
expectedStatusCode
integer
expectedResponseText
string
Responses
Section titled “ Responses ”OK
Media type application/json
object
id
required
string
Example generated
{ "id": "example"}