GET
/
cloud
/
v1
/
servergroups
/
{project_id}
/
{region_id}
import os
from gcore import Gcore

client = Gcore(
    api_key=os.environ.get("GCORE_API_KEY"),  # This is the default and can be omitted
)
placement_group_list = client.cloud.placement_groups.list(
    project_id=0,
    region_id=0,
)
print(placement_group_list.count)
{
  "count": 1,
  "results": [
    {
      "instances": [
        {
          "instance_id": "6d14f194-6c1e-49b3-9fc7-50dc8401eb74",
          "instance_name": "my-instance-1"
        },
        {
          "instance_id": "142988bb-291e-4862-bffb-b1cf20036c27",
          "instance_name": "my-instance-2"
        }
      ],
      "name": "my-server-group",
      "policy": "anti-affinity",
      "project_id": 1337,
      "region": "Luxembourg 1",
      "region_id": 7,
      "servergroup_id": "47003067-550a-6f17-93b6-81ee16ba061e"
    }
  ]
}

Authorizations

APIKey
string
header
required

API key for authentication.

Path Parameters

project_id
integer
required

Project ID

region_id
integer
required

Region ID

Response

200 - application/json

List of placement groups

The response is of type object.