setTarget

Prev Next

Available in VPC

Set a target that will be applied to a target group. Regardless of the existing target list, only the newly specified target number list will be bound; if no target number list is specified, all previously bound target lists will be removed.

Syntax

The setTarget syntax is as follows:

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

Options

This section describes the options available when running setTarget.

Required options

The following options are required for setTarget.

Options Type Required Description
--targetGroupNo String Required Target group number

Optional options

These are the optional options for setTarget. Options that are not specified will use their default values.

Options Type Required Description
--targetNoList List Optional List of target numbers to bind
  • You can enter multiple items separated by spaces (e.g., --targetNoList 34567890 34567891).
  • If no list of target numbers is specified, all existing bound targets will be removed.
  • See getServerInstanceList.

Common options

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

Examples

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

Command

The command example is as follows:

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

Output

The output example is as follows:

{
  "setTargetResponse": {
    "totalRows": 1,
    "targetList": [
      {
        "targetNo": "34567890",
        "targetName": "lb-test-target-01",
        "targetIp": "10.0.1.6",
        "healthCheckStatus": {
          "code": "DOWN",
          "codeName": "Health DOWN state"
        },
        "healthCheckResponse": ""
      }
    ],
    "requestId": "d0e1f2a3-b4c5-6789-defa-012345678901",
    "returnCode": "0",
    "returnMessage": "success"
  }
}