createTargetGroup
    • PDF

    createTargetGroup

    • PDF

    Article summary

    Available in VPC

    Create a target group. Created target groups can be used in load balancers or auto scaling groups.

    Request

    The following describes the request format for the endpoint. The request format is as follows:

    MethodURI
    GET/createTargetGroup

    Request headers

    For headers common to all Load Balancer APIs, see Load Balancer common headers.

    Request query parameters

    The following describes the parameters.

    FieldTypeRequiredDescription
    regionCodeStringOptionalRegion code for the target group to create
    • First Region of the getRegionList search result (default)
    • Check through getRegionList
    vpcNoStringRequiredVPC number of the target group to create
    targetGroupNameStringOptionalTarget group name
    • Automatically granted by NAVER Cloud Platform (default)
    • 3 to 30 characters, including English letters, numbers, and the special character "-", and must begin with an English letter and end with an English letter or number
    targetTypeCodeStringOptionalTarget type to be added to the target group
    • VSVR
      • VSVR: Server (VPC)
    targetGroupProtocolTypeCodeStringRequiredTarget group's protocol type
    • 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
    • UDP protocol is only available in Singapore and Japan Regions
    targetGroupPortIntegerOptionalPort used by the target group
    • 1 - 65534 (default: 80)
    targetGroupDescriptionStringOptionalTarget group description (byte)
    • 0 - 1,000
    healthCheckProtocolTypeCodeStringRequiredProtocol 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
    healthCheckPortIntegerOptionalPort used by the load balancer when performing health checks to determine the health of the target
    • 1 - 65534 (default: 80)
    healthCheckUrlPathStringOptionalURL path to use when performing health checks
    • / (default)
    • URL path starting with /
    • t can be set if the target group's health check protocol type is HTTP or HTTPS
    healthCheckHttpMethodTypeCodeStringConditionalHTTP method type to use for performing health checks
    • HEAD | GET
    • It is required if the target group's health check protocol type is HTTP or HTTPS
    healthCheckCycleIntegerOptionalHealth check interval (seconds)
    • 5 - 300 (default: 30)
    healthCheckUpThresholdIntegerOptionalNumber of consecutive successful health checks required to determine that the target health is normal
    • 2 - 10 (default: 2)
    healthCheckDownThresholdIntegerOptionalNumber of consecutive successful health checks required to determine that the target health is normal
    • 2 - 10 (default: 2)
    targetNoList.NList<String>OptionalList of targets to bind to the target group
    • targetNo can be obtained through targetTypeCode
    • <E.g.> targetNoList.1=1234&targetNoList.2=2345
    responseFormatTypeStringOptionalResponse result format
    • xml (default) | json

    Request example

    The following is a sample request.

    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

    The following 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 following is a sample response.

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

    Was this article helpful?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.