from gcore import Gcore
client = Gcore(
api_key="My API Key",
)
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"
}
]
}
from gcore import Gcore
client = Gcore(
api_key="My API Key",
)
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"
}
]
}
API key for authentication. Make sure to include the word apikey
, followed by a single space and then your token.
Example: apikey 1234$abcdef
List of placement groups
The response is of type object
.
Was this page helpful?