UpCloud

Server Groups

Server groups allow you to logically group servers and apply anti-affinity policies to ensure high availability. Anti-affinity ensures that grouped servers run on different physical hosts.


GET/1.3/server-group

List server groups

Returns a list of all server groups in the account.

Response fields

  • Name
    uuid
    Type
    string
    Description

    Server group unique identifier.

  • Name
    title
    Type
    string
    Description

    Server group title.

  • Name
    anti_affinity
    Type
    string
    Description

    Anti-affinity policy: "strict", "yes" (best-effort), or "no".

  • Name
    servers
    Type
    object
    Description

    List of servers in the group.

Request

GET
/1.3/server-group
curl -X GET https://api.upcloud.com/1.3/server-group \
  -u your_username:your_password

GET/1.3/server-group/{uuid}

Get server group details

Returns detailed information about a specific server group.

Request

GET
/1.3/server-group/{uuid}
curl -X GET https://api.upcloud.com/1.3/server-group/0b3d85b4-b3be-46ca-a1e2-3b5d40d60fb1 \
  -u your_username:your_password

POST/1.3/server-group

Create server group

Creates a new server group.

Attributes

  • Name
    title
    Type
    string
    Description

    Server group title (0-255 characters).

  • Name
    anti_affinity
    Type
    string
    Description

    Anti-affinity policy: "strict", "yes" (best-effort), or "no".

  • Name
    servers
    Type
    array
    Description

    List of server UUIDs to include.

  • Name
    labels
    Type
    object
    Description

    Labels for classification.

Request

POST
/1.3/server-group
curl -X POST https://api.upcloud.com/1.3/server-group \
  -u your_username:your_password \
  -H "Content-Type: application/json" \
  -d '{
    "server_group": {
      "title": "Production Servers",
      "anti_affinity": "strict",
      "servers": {
        "server": [
          "00798b85-efdc-41ca-8021-f6ef457b8531"
        ]
      }
    }
  }'

PUT/1.3/server-group/{uuid}

Modify server group

Modifies an existing server group.

Attributes

  • Name
    title
    Type
    string
    Description

    Server group title.

  • Name
    anti_affinity
    Type
    string
    Description

    Anti-affinity policy.

  • Name
    servers
    Type
    array
    Description

    Complete list of server UUIDs.

Request

PUT
/1.3/server-group/{uuid}
curl -X PUT https://api.upcloud.com/1.3/server-group/0b3d85b4-b3be-46ca-a1e2-3b5d40d60fb1 \
  -u your_username:your_password \
  -H "Content-Type: application/json" \
  -d '{
    "server_group": {
      "title": "Updated Production Servers",
      "anti_affinity": "yes"
    }
  }'

DELETE/1.3/server-group/{uuid}

Delete server group

Deletes a server group. Servers in the group are not deleted.

Request

DELETE
/1.3/server-group/{uuid}
curl -X DELETE https://api.upcloud.com/1.3/server-group/0b3d85b4-b3be-46ca-a1e2-3b5d40d60fb1 \
  -u your_username:your_password

GET/1.3/server-group/{uuid}/servers

List servers in group

Returns detailed information about all servers in a server group.

Request

GET
/1.3/server-group/{uuid}/servers
curl -X GET https://api.upcloud.com/1.3/server-group/0b3d85b4-b3be-46ca-a1e2-3b5d40d60fb1/servers \
  -u your_username:your_password

POST/1.3/server-group/{uuid}/servers/{server_uuid}

Add server to group

Adds a server to an existing server group.

Request

POST
/1.3/server-group/{uuid}/servers/{server_uuid}
curl -X POST https://api.upcloud.com/1.3/server-group/0b3d85b4-b3be-46ca-a1e2-3b5d40d60fb1/servers/00798b85-efdc-41ca-8021-f6ef457b8531 \
  -u your_username:your_password

DELETE/1.3/server-group/{uuid}/servers/{server_uuid}

Remove server from group

Removes a server from a server group.

Request

DELETE
/1.3/server-group/{uuid}/servers/{server_uuid}
curl -X DELETE https://api.upcloud.com/1.3/server-group/0b3d85b4-b3be-46ca-a1e2-3b5d40d60fb1/servers/00798b85-efdc-41ca-8021-f6ef457b8531 \
  -u your_username:your_password