Creating Server Group

Last updated: 2020-10-26 15:41:04

    Feature Description

    This API is used to create a server group and return its ID.

    Request

    Sample request

    POST /machinegroup HTTP/1.1
    Host: <Region>.cls.tencentyun.com
    Authorization: <AuthorizationString>
    Content-Type: application/json
    
    {
        "group_name": "testname", 
        "type""label", 
        "labels": ["defined_label_1", "defined_label_2"]
    }

    Request line

    POST /machinegroup

    Request header

    There are only common request headers but no special request headers.

    Request parameters

    Field Name Type Location Required Description
    group_name string body Yes Server group name, which must be unique
    type string body No Server group type. Valid values: ip and label. Default value: ip
    ips JsonArray body Yes List of IPs in server group
    labels JsonArray body No List of labels in the server group

    Response

    Sample response

    HTTP/1.1 200 OK
    Content-Type: application/json
    Content-Length: 123
    
    {"group_id": "xxxx-xx-xx-xx-xxxxxxxx"}

    Response header

    There are only common response headers but no special response headers.

    Response parameters

    Field Name Type Required Description
    group_id string Yes Server group ID

    Error Codes

    For more information, please see Error Codes.

    Was this page helpful?

    Was this page helpful?

    • Not at all
    • Not very helpful
    • Somewhat helpful
    • Very helpful
    • Extremely helpful
    Send Feedback
    Help