import latitudesh_python_sdk
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.elastic_ips.update_elastic_ip(elastic_ip_id="eip_KeQbB4BoO6x10", data={
"type": latitudesh_python_sdk.UpdateElasticIPType.ELASTIC_IPS,
"attributes": {
"server_id": "sv_oDEBlwBGRO2me",
},
})
# Handle response
print(res){
"data": {
"id": "eip_KeQbB4BoO6x10",
"type": "elastic_ips",
"attributes": {
"address": "177.54.156.7",
"family": "IPv4",
"prefix_length": 32,
"mode": "routed",
"status": "moving",
"created_at": "2026-02-24T17:06:28.108Z",
"server": {
"id": "sv_oDEBlwBGRO2me",
"hostname": "new-server",
"primary_ipv4": "177.54.157.180",
"operating_system": "ubuntu_24_04_x64_lts"
},
"project": {
"id": "proj_AoW6vRnwkvLn0",
"name": "My Project",
"slug": "my-project"
},
"region": {
"id": "region_sa_sao_paulo",
"name": "São Paulo",
"location": {
"id": "site_sao",
"name": "São Paulo",
"slug": "SAO"
}
}
}
}
}Moves an Elastic IP to a different server within the same project. The reassignment is performed asynchronously.
Note: This feature requires the elastic_ips feature flag to be enabled for your team. The Elastic IP must be in active status and the target server must belong to the same project.
import latitudesh_python_sdk
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.elastic_ips.update_elastic_ip(elastic_ip_id="eip_KeQbB4BoO6x10", data={
"type": latitudesh_python_sdk.UpdateElasticIPType.ELASTIC_IPS,
"attributes": {
"server_id": "sv_oDEBlwBGRO2me",
},
})
# Handle response
print(res){
"data": {
"id": "eip_KeQbB4BoO6x10",
"type": "elastic_ips",
"attributes": {
"address": "177.54.156.7",
"family": "IPv4",
"prefix_length": 32,
"mode": "routed",
"status": "moving",
"created_at": "2026-02-24T17:06:28.108Z",
"server": {
"id": "sv_oDEBlwBGRO2me",
"hostname": "new-server",
"primary_ipv4": "177.54.157.180",
"operating_system": "ubuntu_24_04_x64_lts"
},
"project": {
"id": "proj_AoW6vRnwkvLn0",
"name": "My Project",
"slug": "my-project"
},
"region": {
"id": "region_sa_sao_paulo",
"name": "São Paulo",
"location": {
"id": "site_sao",
"name": "São Paulo",
"slug": "SAO"
}
}
}
}
}Was this page helpful?