createTargetGroup

Prev Next

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 /createTargetGroup

Request headers

For information about the headers common to all Load Balancer APIs, see Common Load Balancer headers.

Request query parameters

The following describes the parameters.

Field Type Required Description
regionCode String Optional Region code of the target group you want to create
  • First Region of the getRegionList query result (default)
  • Check through getRegionList.
vpcNo String Required VPC number of the load balancer you want to create
targetGroupName String Optional Target group name
  • Granted automatically by NAVER Cloud Platform (default)
  • 3 to 30 characters are allowed, including letters, numbers, and the special character "-", and it must begin with an English letter and end with an English letter or number.
targetTypeCode String Optional Target type to be added to the target group
  • VSVR
    • VSVR: Server (VPC)
targetGroupProtocolTypeCode String Required Protocol type of the target group
  • HTTP | HTTPS | TCP | UDP | PROXY_TCP
  • The types of load balancers you can apply are limited by the protocols you use.
    • Application Load Balancer: HTTP | HTTPS
    • Network Load Balancer: TCP | UDP
    • Network Proxy Load Balancer: PROXY_TCP
targetGroupPort Integer Optional Port used by the target group
  • 1-65534 (default: 80)
targetGroupDescription String Optional Description of the target group (byte)
  • 0-1000
healthCheckProtocolTypeCode String Required Protocol used by the load balancer when performing health checks to determine the health of targets
  • HTTP | HTTPS | TCP
  • Protocol type of the target group limits the values you can select.
    • HTTP, HTTPS protocol: HTTP, HTTPS
    • TCP, UDP, PROXY_TCP protocol: TCP
healthCheckPort Integer Optional Port used by the load balancer when performing health checks to determine the health of the target
  • 1-65534 (default: 80)
healthCheckUrlPath String Optional URL path to use when performing health checks
  • / (default)
  • URL path that starts with /
  • It can be set if the target group's health check protocol type is HTTP or HTTPS.
healthCheckHttpMethodTypeCode String Conditional HTTP method type to use when performing health checks
  • HEAD | GET
  • Required if the target group's health check protocol type is HTTP or HTTPS
healthCheckCycle Integer Optional Health check interval (second)
  • 5-300 (default: 30)
healthCheckUpThreshold Integer Optional Number of consecutive successful health checks required to determine that the target health is normal
  • 2-10 (default: 2)
healthCheckDownThreshold Integer Optional Number of consecutive failed health checks required to determine that the target health is abnormal
  • 2-10 (default: 2)
targetNoList.N List<String> Optional List of targets to bind to the target group
  • targetNo can be obtained through targetTypeCode.
  • Example: targetNoList.1=1234&targetNoList.2=2345
responseFormatType String Optional Format of the response result
  • xml (default) | json

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 response status codes common to NAVER Cloud Platform, see Ncloud API 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>