getTargetGroupList

Prev Next

VPC環境で利用できます。

ターゲットグループリストを照会します。

構文

getTargetGroupList構文は次の通りです。

./ncloud vloadbalancer getTargetGroupList \
    [--vpcNo <vpc-no>] \
    [--targetTypeCode <VSVR>] \
    [--targetGroupNoList <target-group-no-list>] \
    [--pageNo <page-no>] \
    [--pageSize <page-size>] \
    [--sortList <sort-condition>] \
    [--regionCode <KR|SGN|JPN>] \
    [--output <json|xml>]

オプション

getTargetGroupListの実行時に指定できるオプションについて説明します。

必須オプション

getTargetGroupListの必須オプションです。

オプション タイプ 必須の有無 説明
--pageSize Integer Conditional ページごとに表示する結果数
  • pageNo入力時、必ず入力
  • pageNo、pageSizeを利用して結果値をページング処理

任意オプション

getTargetGroupListの任意オプションです。指定しない場合、オプションにはデフォルト値が適用されます。

オプション タイプ 必須の有無 説明
--vpcNo String Optional VPC番号
--targetTypeCode String Optional ターゲットタイプ
  • VSVR: Server (VPC)
--targetGroupNoList List Optional ターゲットグループの番号リスト
  • スペースで区切って複数入力可能 (例: --targetGroupNoList 55667788 55667799)
--pageNo Integer Optional ページング処理された結果のページ番号
  • 1~N
  • pageNo、pageSizeを利用して結果値をページング処理
--sortList List Optional ソートの条件
  • 二重引用符の中に{フィールド=‘値’}のペアをコンマで区切って入力
    • sortedBy (任意): ソート順。targetGroupNo (ターゲットグループの番号) | targetGroupName (ターゲットグループの名前)
    • sortingOrder (任意): ソート順。ASC (上昇、デフォルト) | DESC (下降)

共通オプション

vloadbalancerコマンドで共通して使用するオプションについては、Load Balancer (VPC)のオプションをご参照ください。

例

ターゲットグループリストの照会リクエストが成功すると、各ターゲットグループの構成情報が返されます。

コマンド

コマンドの例は次の通りです。

./ncloud vloadbalancer getTargetGroupList \
    --vpcNo 12345678 \
    --targetTypeCode VSVR \
    --targetGroupNoList 55667788 55667799 \
    --pageNo 1 \
    --pageSize 10 \
    --sortList "sortedBy='targetGroupNo',sortingOrder='ASC'" \
    --regionCode KR \
    --output json

出力

出力の例は次の通りです。

{
  "getTargetGroupListResponse": {
    "totalRows": 2,
    "targetGroupList": [
      {
        "targetGroupNo": "55667788",
        "targetGroupName": "lb-test-tg",
        "targetType": {
          "code": "VSVR",
          "codeName": "Server (VPC)"
        },
        "vpcNo": "12345678",
        "targetGroupProtocolType": {
          "code": "HTTP",
          "codeName": "HTTP protocol"
        },
        "targetGroupPort": 80,
        "targetGroupDescription": "Updated target group description",
        "useStickySession": true,
        "useProxyProtocol": false,
        "algorithmType": {
          "code": "RR",
          "codeName": "Round Robin"
        },
        "createDate": "2026-07-07T17:08:44+0900",
        "regionCode": "KR",
        "loadBalancerInstanceNo": "41112223",
        "healthCheckProtocolType": {
          "code": "HTTP",
          "codeName": "HTTP protocol"
        },
        "healthCheckPort": 8080,
        "healthCheckUrlPath": "/health",
        "healthCheckHttpMethodType": {
          "code": "GET",
          "codeName": "HTTP GET Method"
        },
        "healthCheckCycle": 60,
        "healthCheckUpThreshold": 3,
        "healthCheckDownThreshold": 3,
        "targetNoList": []
      },
      {
        "targetGroupNo": "55667799",
        "targetGroupName": "lb-test-tg2",
        "targetType": {
          "code": "VSVR",
          "codeName": "Server (VPC)"
        },
        "vpcNo": "12345678",
        "targetGroupProtocolType": {
          "code": "HTTP",
          "codeName": "HTTP protocol"
        },
        "targetGroupPort": 80,
        "targetGroupDescription": "",
        "useStickySession": false,
        "useProxyProtocol": false,
        "algorithmType": {
          "code": "RR",
          "codeName": "Round Robin"
        },
        "createDate": "2026-07-07T17:12:57+0900",
        "regionCode": "KR",
        "loadBalancerInstanceNo": "",
        "healthCheckProtocolType": {
          "code": "HTTP",
          "codeName": "HTTP protocol"
        },
        "healthCheckPort": 80,
        "healthCheckUrlPath": "/",
        "healthCheckHttpMethodType": {
          "code": "GET",
          "codeName": "HTTP GET Method"
        },
        "healthCheckCycle": 30,
        "healthCheckUpThreshold": 2,
        "healthCheckDownThreshold": 2,
        "targetNoList": []
      }
    ],
    "requestId": "b2c3d4e5-f6a7-8901-bcde-f23456789012",
    "returnCode": "0",
    "returnMessage": "success"
  }
}