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
- GETGet available floating IPs
- GETList floating IPs
- POSTCreate floating IP
- GETGet floating IP
- DELDelete floating IP
- POSTAssign floating IP to instance or loadbalancer
- GETList floating IP tags
- PUTReplace floating IP tags
- POSTCreate or update floating IP tags
- GETGet Floating IP tag by key
- DELDelete Floating IP tag by key
- POSTUnassign floating IP from the instance
- POSTPreview floating IP price
- GET
- 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
Floating IPs
Assign floating IP to instance or loadbalancer
POST
/
cloud
/
v1
/
floatingips
/
{project_id}
/
{region_id}
/
{floating_ip_id}
/
assign
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
)
floating_ip = client.cloud.floating_ips.assign(
floating_ip_id="floating_ip_id",
project_id=0,
region_id=0,
port_id="ee2402d0-f0cd-4503-9b75-69be1d11c5f1",
)
print(floating_ip.id)
Copy
Ask AI
{
"created_at": "2019-06-13T13:58:12+0000",
"creator_task_id": "d1e1500b-e2be-40aa-9a4b-cc493fa1af30",
"dns_domain": "string",
"dns_name": "string",
"fixed_ip_address": "192.168.10.15",
"floating_ip_address": "172.24.4.34",
"id": "c64e5db1-5f1f-43ec-a8d9-5090df85b82d",
"port_id": "ee2402d0-f0cd-4503-9b75-69be1d11c5f1",
"project_id": 1337,
"region": "Luxembourg 1",
"region_id": 7,
"router_id": "11005a33-c5ac-4c96-ab6f-8f2827cc7da6",
"status": "ACTIVE",
"subnet_id": null,
"tags": [
{
"key": "my-tag",
"read_only": false,
"value": "my-tag-value"
}
],
"task_id": "a4eb4b29-048e-42f6-a5e1-2c18bc001c45",
"updated_at": "2019-06-13T13:58:12+0000"
}
Authorizations
API key for authentication.
Path Parameters
Project ID
Region ID
Floating IP ID
Body
application/json
Response
200
application/json
Returned floating IP
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
)
floating_ip = client.cloud.floating_ips.assign(
floating_ip_id="floating_ip_id",
project_id=0,
region_id=0,
port_id="ee2402d0-f0cd-4503-9b75-69be1d11c5f1",
)
print(floating_ip.id)
Copy
Ask AI
{
"created_at": "2019-06-13T13:58:12+0000",
"creator_task_id": "d1e1500b-e2be-40aa-9a4b-cc493fa1af30",
"dns_domain": "string",
"dns_name": "string",
"fixed_ip_address": "192.168.10.15",
"floating_ip_address": "172.24.4.34",
"id": "c64e5db1-5f1f-43ec-a8d9-5090df85b82d",
"port_id": "ee2402d0-f0cd-4503-9b75-69be1d11c5f1",
"project_id": 1337,
"region": "Luxembourg 1",
"region_id": 7,
"router_id": "11005a33-c5ac-4c96-ab6f-8f2827cc7da6",
"status": "ACTIVE",
"subnet_id": null,
"tags": [
{
"key": "my-tag",
"read_only": false,
"value": "my-tag-value"
}
],
"task_id": "a4eb4b29-048e-42f6-a5e1-2c18bc001c45",
"updated_at": "2019-06-13T13:58:12+0000"
}
Assistant
Responses are generated using AI and may contain mistakes.