Placement group API

Placement group API

Create shared constraints, manage membership, and explain noncompliant placements.

The Placement group API stores affinity or spread constraints in a project. Membership changes do not automatically migrate existing guests.

POST/organizations/{organization_id}/projects/{project_id}/placement-groups
Scope
droplets:write
Auth
Bearer API key

Creates a shared placement constraint and its initial membership.

Constraint definition
namestringrequired
Project display name.
region_idstringrequired
Region shared by every member.
strategystringrequired
Separates members or requests colocation.
one ofspread, affinity
domainstringoptional
Failure domain evaluated by the rule.
one ofnode, zonedefaultnode
enforcementstringoptional
Whether an unmet constraint rejects placement.
one ofrequired, preferreddefaultrequired
droplet_idsstring[]optional
Existing members, all in this project and region.
default[]

Returns 201 with the group ID, revision, resolved members, and compliance. An unsupported strategy/domain combination returns 422 invalid_constraint. Unknown members and cross-region references reject the whole definition.

Update membership

PATCH/organizations/{organization_id}/projects/{project_id}/placement-groups/{group_id}
Scope
droplets:write
Auth
Bearer API key

Updates placement constraints or member IDs.

Requires If-Match and droplets:write. Writable fields include name, strategy, domain, enforcement, and droplet_ids. The member array replaces the complete set; omission preserves it and an empty array removes all members. null is invalid.

Existing locations can become noncompliant after an edit. The result records those violations instead of evicting members. Organization policy can reject an edit that introduces a noncompliant required rule.

Read compliance

GET/organizations/{organization_id}/projects/{project_id}/placement-groups/{group_id}
Scope
droplets:read
Auth
Bearer API key

Returns evaluated placement compliance and violations.

Requires droplets:read. Its compliance object contains state, evaluated_at, and violations identifying member IDs, domain IDs, and failed requirements. A stale evaluation includes its timestamp and is not a placement reservation.

A compliance result lists unsatisfied placement constraints:

JSON
{
  "state": "noncompliant",
  "violations": [
    {
      "code": "shared_zone",
      "droplet_ids": ["drp_web01", "drp_web02"],
      "domain_id": "zone_a"
    }
  ]
}

Reconcile

POST/organizations/{organization_id}/projects/{project_id}/placement-groups/{group_id}/reconcile-preview
Scope
droplets:write
Auth
Bearer API key

Returns proposed moves and unsatisfied members. Apply the reviewed preview through this operation.

POST/organizations/{organization_id}/projects/{project_id}/placement-groups/{group_id}/reconcile
Scope
droplets:write
Auth
Bearer API key

Applies a reviewed placement-reconciliation plan.

Requires the reviewed plan ID and the current group ETag in If-Match. Accepted work returns 202 with child migration operations.

Unsupported live moves remain blockers. The operation cannot bypass local-disk, CPU, or passthrough device constraints.

Delete

DELETE/organizations/{organization_id}/projects/{project_id}/placement-groups/{group_id}
Scope
droplets:write
Auth
Bearer API key

Deletes an empty placement group without moving droplets.

Requires If-Match and rejects a nonempty group with 409 group_in_use. Removing an empty group returns 204 without changing any droplet placement. See placement groups for maintenance consequences and Operation API for partial reconciliation results.