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.
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
curl -X GET https://api.upcloud.com/1.3/server-group \
-u your_username:your_password
Get server group details
Returns detailed information about a specific server group.
Request
curl -X GET https://api.upcloud.com/1.3/server-group/0b3d85b4-b3be-46ca-a1e2-3b5d40d60fb1 \
-u your_username:your_password
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
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"
]
}
}
}'
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
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 server group
Deletes a server group. Servers in the group are not deleted.
Request
curl -X DELETE https://api.upcloud.com/1.3/server-group/0b3d85b4-b3be-46ca-a1e2-3b5d40d60fb1 \
-u your_username:your_password
List servers in group
Returns detailed information about all servers in a server group.
Request
curl -X GET https://api.upcloud.com/1.3/server-group/0b3d85b4-b3be-46ca-a1e2-3b5d40d60fb1/servers \
-u your_username:your_password
Add server to group
Adds a server to an existing server group.
Request
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
Remove server from group
Removes a server from a server group.
Request
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