const apiInstance = new Fastly.HealthcheckApi();
Note
All URIs are relative to https://api.fastly.com
Method | HTTP request | Description |
---|---|---|
createHealthcheck | POST /service/{service_id}/version/{version_id}/healthcheck | Create a health check |
deleteHealthcheck | DELETE /service/{service_id}/version/{version_id}/healthcheck/{healthcheck_name} | Delete a health check |
getHealthcheck | GET /service/{service_id}/version/{version_id}/healthcheck/{healthcheck_name} | Get a health check |
listHealthchecks | GET /service/{service_id}/version/{version_id}/healthcheck | List health checks |
updateHealthcheck | PUT /service/{service_id}/version/{version_id}/healthcheck/{healthcheck_name} | Update a health check |
createHealthcheck({ service_id, version_id, [check_interval, ][comment, ][expected_response, ][headers, ][host, ][http_version, ][initial, ][method, ][name, ][path, ][threshold, ][timeout, ][window] })
Create a health check for a particular service and version.
const options = {
service_id: "service_id_example", // required
version_id: 56, // required
check_interval: 56,
comment: "comment_example",
expected_response: 56,
headers: ["null"],
host: "host_example",
http_version: "http_version_example",
initial: 56,
method: "method_example",
name: "name_example",
path: "path_example",
threshold: 56,
timeout: 56,
window: 56,
};
apiInstance.createHealthcheck(options)
.then((data) => {
console.log(data, "API called successfully.");
})
.catch((error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
service_id | String | Alphanumeric string identifying the service. | |
version_id | Number | Integer identifying a service version. | |
check_interval | Number | How often to run the health check in milliseconds. | [optional] |
comment | String | A freeform descriptive note. | [optional] |
expected_response | Number | The status code expected from the host. | [optional] |
headers | [String] | Array of custom headers that will be added to the health check probes. | [optional] |
host | String | Which host to check. | [optional] |
http_version | String | Whether to use version 1.0 or 1.1 HTTP. | [optional] |
initial | Number | When loading a config, the initial number of probes to be seen as OK. | [optional] |
method | String | Which HTTP method to use. | [optional] |
name | String | The name of the health check. | [optional] |
path | String | The path to check. | [optional] |
threshold | Number | How many health checks must succeed to be considered healthy. | [optional] |
timeout | Number | Timeout in milliseconds. | [optional] |
window | Number | The number of most recent health check queries to keep for this health check. | [optional] |
deleteHealthcheck({ service_id, version_id, healthcheck_name })
Delete the health check for a particular service and version.
const options = {
service_id: "service_id_example", // required
version_id: 56, // required
healthcheck_name: "healthcheck_name_example", // required
};
apiInstance.deleteHealthcheck(options)
.then((data) => {
console.log(data, "API called successfully.");
})
.catch((error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
service_id | String | Alphanumeric string identifying the service. | |
version_id | Number | Integer identifying a service version. | |
healthcheck_name | String | The name of the health check. |
getHealthcheck({ service_id, version_id, healthcheck_name })
Get the health check for a particular service and version.
const options = {
service_id: "service_id_example", // required
version_id: 56, // required
healthcheck_name: "healthcheck_name_example", // required
};
apiInstance.getHealthcheck(options)
.then((data) => {
console.log(data, "API called successfully.");
})
.catch((error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
service_id | String | Alphanumeric string identifying the service. | |
version_id | Number | Integer identifying a service version. | |
healthcheck_name | String | The name of the health check. |
listHealthchecks({ service_id, version_id })
List all of the health checks for a particular service and version.
const options = {
service_id: "service_id_example", // required
version_id: 56, // required
};
apiInstance.listHealthchecks(options)
.then((data) => {
console.log(data, "API called successfully.");
})
.catch((error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
service_id | String | Alphanumeric string identifying the service. | |
version_id | Number | Integer identifying a service version. |
updateHealthcheck({ service_id, version_id, healthcheck_name, [check_interval, ][comment, ][expected_response, ][headers, ][host, ][http_version, ][initial, ][method, ][name, ][path, ][threshold, ][timeout, ][window] })
Update the health check for a particular service and version.
const options = {
service_id: "service_id_example", // required
version_id: 56, // required
healthcheck_name: "healthcheck_name_example", // required
check_interval: 56,
comment: "comment_example",
expected_response: 56,
headers: ["null"],
host: "host_example",
http_version: "http_version_example",
initial: 56,
method: "method_example",
name: "name_example",
path: "path_example",
threshold: 56,
timeout: 56,
window: 56,
};
apiInstance.updateHealthcheck(options)
.then((data) => {
console.log(data, "API called successfully.");
})
.catch((error) => {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
service_id | String | Alphanumeric string identifying the service. | |
version_id | Number | Integer identifying a service version. | |
healthcheck_name | String | The name of the health check. | |
check_interval | Number | How often to run the health check in milliseconds. | [optional] |
comment | String | A freeform descriptive note. | [optional] |
expected_response | Number | The status code expected from the host. | [optional] |
headers | [String] | Array of custom headers that will be added to the health check probes. | [optional] |
host | String | Which host to check. | [optional] |
http_version | String | Whether to use version 1.0 or 1.1 HTTP. | [optional] |
initial | Number | When loading a config, the initial number of probes to be seen as OK. | [optional] |
method | String | Which HTTP method to use. | [optional] |
name | String | The name of the health check. | [optional] |
path | String | The path to check. | [optional] |
threshold | Number | How many health checks must succeed to be considered healthy. | [optional] |
timeout | Number | Timeout in milliseconds. | [optional] |
window | Number | The number of most recent health check queries to keep for this health check. | [optional] |