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

Create a new target set

URL Parameter

Parameter Type Description
ACCOUNT_ID String

Account ID from Spotinst Console

Example: act-12345
Request

Headers
{
  "Content-Type": "application/json",
  "Authorization": "Bearer ${token}"
}
Body
Copied!
Downloaded!
{
  "targetSet": {
    "name": "targetSet1",
    "balancerId": "lb-5470a9fb",
    "deploymentId": "de-12345",
    "protocol": "HTTP",
    "weight": 1,
    "healthCheck": {
      "interval": 10,
      "path": "/healthCheck",
      "port": 80,
      "protocol": "HTTP",
      "timeout": 5,
      "healthyThresholdCount": 2,
      "unhealthyThresholdCount": 3
    },
    "tags": [
      {
        "key": "Environment",
        "value": "Production"
      }
    ]
  }
}

Body Attributes


  • targetSet.name * String
    The name of the Target Set. Must contain only alphanumeric characters or hyphens, and must not begin or end with a hyphen.
  • targetSet.balancerId * String
    The id of the balancer
  • targetSet.deploymentId * String
    The id of the deployment
  • targetSet.protocol * String
    The protocol to allow connections to the target
  • targetSet.weight * Integer
    Defined how the traffic is distributed between the Target Set
  • targetSet.healthCheck.interval * Integer
    The interval for the health check
  • targetSet.healthCheck.path * String
    The path to perform the health check
  • targetSet.healthCheck.port * Integer
    The port on which the load balancer is listening.
  • targetSet.healthCheck.protocol * String
    The protocol to allow connections to the target for the health check
  • targetSet.healthCheck.timeout * Integer
    The time out for the health check
  • targetSet.healthCheck.healthyThresholdCount * Integer
    Total number of allowed healthy Targets
  • targetSet.healthCheck.unhealthyThresholdCount * Integer
    Total number of allowed unheathy Targets
  • targetSet.tags.key String
    The tag’s key
  • targetSet.tags.value String
    The tag’s value
Response - 200

Headers
{
  "Content-Type": "application/json"
}
Body
Copied!
Downloaded!
{
  "status": {
    "code": 200,
    "message": "OK"
  },
  "kind": "spotinst:lb:targetSet",
  "items": [
    {
      "id": "ts-12345",
      "deploymentId": "de-12345",
      "name": "targetSet1",
      "balancerId": "lb-5470a9fb",
      "protocol": "HTTP",
      "port": null,
      "weight": 1,
      "healthCheck": {
        "interval": 10,
        "path": "/healthCheck",
        "port": 80,
        "protocol": "HTTP",
        "timeout": 5,
        "healthyThresholdCount": 2,
        "unhealthyThresholdCount": 3
      },
      "tags": [
        {
          "key": "Environment",
          "value": "Production"
        }
      ]
    }
  ],
  "count": 1
}