fbpx
POSThttps://api.spotinst.io/healthCheck?accountId={ACCOUNT_ID}

Create an HCS for Spotinst Elastigroup

URL Parameters

Parameter Type Description
ACCOUNT_ID String

Your Spotinst accountId associated with your token

Example: act-123abc

Body Attributes


Attribute Type Description
resourceId * String

Spotinst Resource id

Example: sig-12345
name String

A logical name for the health check

proxyAddress * String

The public hostname / IP where you installed the the Spotinst HCS

proxyPort Integer

The port of the HCS.

Default: 80
check * Object

The check config for each instance

check.protocol * String

The protocol to use to connect with the instance. Valid values: http https

check.port * Integer

The port to use to connect with the instance

check.endpoint * String

The destination for the request

check.interval * Integer

he amount of time (in seconds) between each health check. Minimum value is 10

check.timeout * Integer

The amount of time (in seconds) to wait when receiving a response from the health check

check.unhealthyThreshold * Integer

The number of consecutive failed health checks that must occur before declaring an instance unhealthy

check.healthyThreshold * Integer

The number of consecutive successful health checks that must occur before declaring an instance healthy

Request

Headers
{
    "Authorization": "Bearer ${token}",
    "Content-Type": "application/json"
}
Body
Copied!
Downloaded!
{
  "healthCheck": {
    "resourceId": "sig-12345",
    "name": "Service-1-healthCheck",
    "proxyAddress": "51.22.125.47",
    "check": {
      "protocol": "http",
      "port": 80,
      "endpoint": "index.html",
      "interval": 30,
      "timeout": 60,
      "unhealthyThreshold": 2,
      "healthyThreshold": 2
    }
  }
}
Response - 200

Headers
{
    "Content-Type": "application/json"
}
Body
Copied!
Downloaded!
{
  "request": {
    "id": "d4f94021-c9ac-4dd0-be7a-6e938c568c45",
    "url": "/healthCheck",
    "method": "POST",
    "timestamp": "2016-05-17T09:36:25.246Z"
  },
  "response": {
    "status": {
      "code": 200,
      "message": "OK"
    },
    "kind": "spotinst:healthCheck",
    "items": [
      {
        "id": 1,
        "resourceId": "sig-12345",
        "name": "Service-1-healthCheck",
        "proxyAddress": "51.22.125.47",
        "check": {
          "protocol": "http",
          "port": 80,
          "endpoint": "index.html",
          "unhealthyThreshold": 2,
          "healthyThreshold": 2,
          "interval": 30,
          "timeout": 60
        }
      }
    ],
    "count": 1
  }
}