addTarget

Prev Next

Available in VPC

Add a target that will be applied to a target group. The list of newly specified target numbers is added to the list of previously applied targets, and you can't add targets that are already bound.

Syntax

The addTarget syntax is as follows:

./ncloud vloadbalancer addTarget \
    --targetGroupNo <target-group-no> \
    --targetNoList <target-no-list> \
    [--regionCode <KR|SGN|JPN>] \
    [--output <json|xml>]

Options

This section describes the options available when running addTarget.

Required options

The following options are required for addTarget.

Options Type Required Description
--targetGroupNo String Required Target group number
--targetNoList List Required Target number list
  • You can enter multiple items separated by spaces (e.g., --targetNoList 34567890 34567891).
  • See getServerInstanceList.

Common options

For information about the options common to all vloadbalancer subcommands, see Load Balancer (VPC) options.

Examples

If the request to add a target is successful, the identification information and health check status of the target bound to the target group are returned.

Command

The command example is as follows:

./ncloud vloadbalancer addTarget \
    --targetGroupNo 55667788 \
    --targetNoList 34567890 \
    --regionCode KR \
    --output json

Output

The output example is as follows:

{
  "addTargetResponse": {
    "totalRows": 1,
    "targetList": [
      {
        "targetNo": "34567890",
        "targetName": "lb-test-target-01",
        "targetIp": "10.0.1.6",
        "healthCheckStatus": {
          "code": "DOWN",
          "codeName": "Health DOWN state"
        },
        "healthCheckResponse": ""
      }
    ],
    "requestId": "b8c9d0e1-f2a3-4567-bcde-890123456789",
    "returnCode": "0",
    "returnMessage": "success"
  }
}