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

URL Parameters

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!
{
  "target": {
    "name": "target1",
    "balancerId": "lb-12345",
    "targetSetId": "ts-12345",
    "host": "10.0.0.2",
    "port": 8080,
    "weight": 1,
    "tags": [
      {
        "key": "Environment",
        "value": "Production"
      }
    ]
  }
}

Body Attributes


  • target.name * String
    The name of the Target . Must contain only alphanumeric characters or hyphens, and must not begin or end with a hyphen.
  • target.balancerId * String
    The id of the balancer
  • target.targetSetId * String
    The id of the Target Set
  • target.host * String
    The address (IP or URL) of the targets to register
  • target.port * Integer
    The Port the target will register to
  • target.weight * Integer
    Defined how the traffic is distributed between the Target
  • target.tags.key String
    The tag’s key
  • target.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:target",
  "items": [
    {
      "id": "t-12345",
      "balancerId": "lb-12345",
      "targetSetId": "ts-12345",
      "name": "target1",
      "address": "http://10.0.0.2:8080",
      "host": "10.0.0.2",
      "port": 8080,
      "weight": 1,
      "status": {
        "healthiness": "UNKNOWN",
        "readiness": "READY"
      },
      "healthCheckResponseCode": null,
      "healthCheckResponseText": null,
      "tags": [
        {
          "key": "Environment",
          "value": "Production"
        }
      ]
    }
  ],
  "count": 1
}