Available in VPC
Create a target group. Created target groups can be used in load balancers or auto scaling groups.
Request
This section describes the request format. The method and URI are as follows:
| Method | URI |
|---|---|
| GET | /vloadbalancer/v2/createTargetGroup |
Request headers
For information about the headers common to all Load Balancer APIs, see Load Balancer request headers.
Request query parameters
You can use the following query parameters with your request:
| Field | Type | Required | Description |
|---|---|---|---|
regionCode |
String | Optional | Region code of the target group you want to create
|
vpcNo |
String | Required | VPC number of the load balancer you want to create
|
targetGroupName |
String | Optional | Target group name
|
targetTypeCode |
String | Optional | Target type to be added to the target group
|
targetGroupProtocolTypeCode |
String | Required | Protocol type of the target group
|
targetGroupPort |
Integer | Optional | Port used by the target group
|
targetGroupDescription |
String | Optional | Description of the target group (byte)
|
healthCheckProtocolTypeCode |
String | Required | Protocol used by the load balancer when performing health checks to determine the health of targets
|
healthCheckPort |
Integer | Optional | Port used by the load balancer when performing health checks to determine the health of the target
|
healthCheckUrlPath |
String | Optional | URL path to use when performing health checks
|
healthCheckHttpMethodTypeCode |
String | Conditional | HTTP method type to use when performing health checks
|
healthCheckCycle |
Integer | Optional | Health check interval (second)
|
healthCheckUpThreshold |
Integer | Optional | Number of consecutive successful health checks required to determine that the target health is normal
|
healthCheckDownThreshold |
Integer | Optional | Number of consecutive failed health checks required to determine that the target health is abnormal
|
targetNoList.N |
List[String] | Optional | List of targets to bind to the target group
|
responseFormatType |
String | Optional | Format of the response result
|
Request example
The request example is as follows:
curl --location 'https://ncloud.apigw.ntruss.com/vloadbalancer/v2/createTargetGroup?regionCode=KR&vpcNo=*****&targetGroupName=YOUR_TARGET_GROUP&targetTypeCode=VSVR&targetGroupProtocolTypeCode=HTTP&targetGroupPort=80&healthCheckProtocolTypeCode=HTTP&healthCheckPort=80&healthCheckUrlPath=/&healthCheckHttpMethodTypeCode=GET&healthCheckCycle=30&healthCheckUpThreshold=2&healthCheckDownThreshold=2' \
--header 'x-ncp-apigw-timestamp: {Timestamp}' \
--header 'x-ncp-iam-access-key: {Access Key}' \
--header 'x-ncp-apigw-signature-v2: {API Gateway Signature}'
Response
This section describes the response format.
Response body
See TargetGroupList for the response body.
Response status codes
For information about the HTTP status codes common to all Load Balancer APIs, see Load Balancer response status codes.
Response example
The response example is as follows:
<createTargetGroupResponse>
<requestId>f5356756-9e75-4e69-94a8-8c88e270b5d2</requestId>
<returnCode>0</returnCode>
<returnMessage>success</returnMessage>
<totalRows>1</totalRows>
<targetGroupList>
<targetGroup>
<targetGroupNo>*******</targetGroupNo>
<targetGroupName>YOUR_TARGET_GROUP</targetGroupName>
<targetType>
<code>VSVR</code>
<codeName>Server (VPC)</codeName>
</targetType>
<vpcNo>*****</vpcNo>
<targetGroupProtocolType>
<code>HTTP</code>
<codeName>HTTP protocol</codeName>
</targetGroupProtocolType>
<targetGroupPort>80</targetGroupPort>
<targetGroupDescription></targetGroupDescription>
<useStickySession>false</useStickySession>
<useProxyProtocol>false</useProxyProtocol>
<algorithmType>
<code>RR</code>
<codeName>Round Robin</codeName>
</algorithmType>
<createDate>2024-06-04T10:17:10+0900</createDate>
<regionCode>KR</regionCode>
<loadBalancerInstanceNo></loadBalancerInstanceNo>
<healthCheckProtocolType>
<code>HTTP</code>
<codeName>HTTP protocol</codeName>
</healthCheckProtocolType>
<healthCheckPort>80</healthCheckPort>
<healthCheckUrlPath>/</healthCheckUrlPath>
<healthCheckHttpMethodType>
<code>GET</code>
<codeName>HTTP GET Method</codeName>
</healthCheckHttpMethodType>
<healthCheckCycle>30</healthCheckCycle>
<healthCheckUpThreshold>2</healthCheckUpThreshold>
<healthCheckDownThreshold>2</healthCheckDownThreshold>
<targetNoList/>
</targetGroup>
</targetGroupList>
</createTargetGroupResponse>