Overview
IAM
- Account
- Users
- API Tokens
CDN
- IP addresses list
- CDN service
- Origins
- CDN resources
- CDN activity logs
- Log forwarding
- Log viewer
- Logs uploader
- Tools
- Rules
- Rule templates
- Purge history
- SSL certificates
- CA certificates
- CDN Statistics
- Advanced analytics
- Origin shielding
- Let's Encrypt certificates
Managed DNS
- Analyze
- Locations
- Lookup
- Metrics
- Pickers
- DNS Clients
- Zones
- DNSSEC
- RRsets
Cloud
- Bare Metal
- Container as a Service
- Cost Reports
- DDOS Protection
- File Shares
- Firewalls
- Floating IPs
- Function as a Service
- GPU Cloud
- IP Ranges
- Images
- Inference Instances
- Instances
- Load Balancers
- Logging
- Managed Kubernetes
- Managed PostgreSQL
- Networks
- Placement Groups
- Projects
- Quotas
- Regions
- Registry
- Reservations
- Reserved IPs
- Routers
- SSH Keys
- Secrets
- Service Endpoints
- Snapshot Schedules
- Snapshots
- Tasks
- User Actions
- User Role Assignments
- Volumes
Security
- Event Logs
- BGP announces
- Security Templates
- Profiles
FastEdge
- Apps
- Binaries
- FastEdge Clients
- FastEdge Secrets
- Stats
- FastEdge Templates
WAAP
- WAAP Service
- Domains
- Policies
- Analytics
- Custom Page Sets
- Custom Rules
- Firewall Rules
- Advanced Rules
- Tags
- Network Organizations
- API Discovery
- IP Spotlight
- Security Insights
Web Security
- Billing Statistics
- Resources
Video Streaming
- Streams
- Overlays
- Broadcasts
- Restreams
- Videos
- Subtitles
- Directories
- Playlists
- QualitySets
- Players
- AI
- Streaming Statistics
Object Storage
- Notifications
- Key
- Location
- Storage
- Storage Statistics
Placement Groups
Create placement group
Create an affinity or anti-affinity or soft-anti-affinity placement group
POST
/
cloud
/
v1
/
servergroups
/
{project_id}
/
{region_id}
Copy
Ask AI
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 = client.cloud.placement_groups.create(
project_id=0,
region_id=0,
name="my-server-group",
policy="anti-affinity",
)
print(placement_group.project_id)
Copy
Ask AI
{
"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
API key for authentication.
Body
application/json
Response
200 - application/json
Returned placement group
The response is of type object
.
Was this page helpful?
Copy
Ask AI
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 = client.cloud.placement_groups.create(
project_id=0,
region_id=0,
name="my-server-group",
policy="anti-affinity",
)
print(placement_group.project_id)
Copy
Ask AI
{
"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"
}
Assistant
Responses are generated using AI and may contain mistakes.