Skip to content

Server groups

Keep instances on different hosts, or together.

Paths are relative to your API address. See Authentication and Operations. Changes that answer 202 Accepted return an operation to follow.

Request and response examples are generated from the schema; the tables under Schemas are the reference.

Create a server group

POST /v1/orgs/{org_id}/projects/{project_id}/server-groups

Creates a server group in one location. An instance joins a group only when it is created (server_group_id). Accepted at once: follow the returned operation until it finishes.

Input parameters

Parameter In Type Default Nullable Description
Authorization header string N/A No Bearer followed by a service account's API key. The console uses your signed-in session instead.
idempotency-key header string Yes
org_id path string No
project_id path string No

Request body

{
    "display_name": "string",
    "execute_before": "2022-04-13T15:42:05.901Z",
    "location": "string",
    "max_server_per_host": 0,
    "policy": "anti-affinity"
}

Responses

{
    "operation": {
        "href": "string",
        "id": "string",
        "state": "string"
    }
}
{
    "detail": [
        {
            "ctx": {},
            "input": null,
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}

Delete a server group

DELETE /v1/orgs/{org_id}/projects/{project_id}/server-groups/{server_group_id}

Deletes the group. Refused while it has instances: an instance cannot leave its group, so delete them first. Accepted at once: follow the returned operation until it finishes.

Input parameters

Parameter In Type Default Nullable Description
Authorization header string N/A No Bearer followed by a service account's API key. The console uses your signed-in session instead.
idempotency-key header string Yes
org_id path string No
project_id path string No
server_group_id path string No

Responses

{
    "operation": {
        "href": "string",
        "id": "string",
        "state": "string"
    }
}
{
    "detail": [
        {
            "ctx": {},
            "input": null,
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string"
        }
    ]
}

Schemas

Accepted

Name Type Description
operation OperationLink

HTTPValidationError

Name Type Description
detail Array<ValidationError>
Name Type Description
href string Where to read the operation; also the Location header.
id string The operation's ID (op_…).
state string | null Its state when accepted, normally queued.

ServerGroupCreateBody

Name Type Description
display_name string
execute_before string(date-time) | null
location string
max_server_per_host integer | null anti-affinity only: how many of the group's instances one host may run (1 when left out).
policy string Where the location's cloud places the group's instances: anti-affinity on different hosts, or the instance fails to start; affinity on the same host, or it fails; soft-anti-affinity and soft-affinity the same when the cloud can, never failing for it. Hosts are not availability zones.

ValidationError

Name Type Description
ctx
input
loc Array<>
msg string
type string