Saltar al contenido
NimbusNexus

IPs flotantes

Una IP flotante es una dirección IP pública que pertenece a tu proyecto, no a una VM concreta. Reservas una en una red externa, la asignas a un puerto de una VM y se convierte en la IP pública de esa VM. Más adelante, desasóciala y vuelve a asociarla a otra VM — tu tráfico pasa a ir a la VM nueva, sin que cambie la dirección.

Por qué existen las IPs flotantes

La IP que recibe una VM por defecto es efímera — al destruir la VM, la IP vuelve al pool y una VM recreada recibe una nueva. Eso está bien para workers sin estado detrás de un balanceador de carga. Es terrible para:

  • Cualquier cosa a la que se acceda mediante un registro DNS A/AAAA (el registro se rompe cada vez que se recrea la VM)
  • Cualquier cosa que esté en la lista de IPs permitidas de un socio (el socio tiene que volver a añadirla a su lista de permitidos)
  • Despliegues blue/green en los que quieres mover el tráfico entre dos VMs en caliente sin esperar a la propagación de DNS

Una IP flotante resuelve los tres casos. La IP sobrevive a cualquier VM concreta; la mueves de una VM a otra con una sola llamada a la API.

Alcance regional

Las IPs flotantes son de alcance regional. Una IP sale de la red externa de una región y solo se asocia a puertos de esa región.

Facturación

Una IP flotante se factura a su propio precio desde que se crea hasta que se borra, esté asociada o no. Asociarla a una VM no hace que pase a formar parte del coste de la VM. En Datos de precios está el precio actual.

El patrón estándar: crea la IP cuando la necesites, asóciala de inmediato y bórrala cuando termines.

IPv4 frente a IPv6

No hay ningún campo de versión: una dirección sale de la red externa que indicas en floating_network_id, y POST /api/v1/floating_ip/reserve también puede recibir una ip_address concreta. GET /api/v1/floating_ip/artifacts lista las redes externas con la ip_version de cada subred.

Cada IP flotante se vincula a una IP fija de un puerto (vm_port_id y vm_ip_address), así que una VM con varias IPs fijas puede llevar una IP flotante en cada una.

Semántica de asociar / desasociar

  • Asociar es POST /api/v1/floating_ip/allocate, con la red externa (floating_network_id), el puerto (vm_port_id) y su IP fija (vm_ip_address). Pasa floating_ip_id para asociar una dirección que ya tienes; sin él, allocate crea una nueva. GET /api/v1/floating_ip/artifacts?resource_id=<id> lista los puertos de una VM o de un balanceador de carga.
  • Desasociar es POST /api/v1/floating_ip/deallocate. No libera la IP; solo la desvincula de la VM. La IP se sigue facturando hasta que la borras, con DELETE /api/v1/floating_ip/ (su id en ids) o con deallocate y delete: true.
  • Volver a asociar la misma IP a otra VM: este es exactamente el camino del failover. Desasocias, asocias al nuevo destino y el DNS no cambia.

Próximos pasos

Reference

GET/api/v1/floating_ip/

Floating Ips List

Lists floating IPs visible to the project, resolving the attached compute, router, or load balancer.

Parameters

NameInTypeDescription
admin_domainquerystring | null—
admin_projectquerystring | null—

Responses

  • 200Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 422Validation error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X GET "https://api.nimbusnexus.net/api/v1/floating_ip/" \
  -H "Authorization: Bearer $NIMBUS_KEY"
DELETE/api/v1/floating_ip/

Delete Ips

Deletes a batch of floating IPs by their IDs.

Request body

FieldTypeDescription
admin_domainstring | null—
admin_projectstring | null—
ids*array of string—

Responses

  • 204Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflict
  • 422Validation error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X DELETE "https://api.nimbusnexus.net/api/v1/floating_ip/" \
  -H "Authorization: Bearer $NIMBUS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "ids": [
      "example"
    ]
  }'
POST/api/v1/floating_ip/allocate

Allocate Ip

Allocates a floating IP to a port, attaching a bandwidth-billed QoS policy and creating the billing order.

Request body

FieldTypeDescription
admin_domainstring | null—
admin_projectstring | null—
floating_network_id*string—
vm_port_id*string—
vm_ip_address*string—
floating_ip_idstring | null—
bandwidth_subscriptionPlanType | null—
bandwidth_mbpsinteger | null—
product_categorystringProduct category for billing
subscriptionobjectSubscription plan type

Responses

  • 200Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflict
  • 422Validation error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X POST "https://api.nimbusnexus.net/api/v1/floating_ip/allocate" \
  -H "Authorization: Bearer $NIMBUS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "floating_network_id": "<floating_network_id>",
    "vm_port_id": "<vm_port_id>",
    "vm_ip_address": "example"
  }'
GET/api/v1/floating_ip/artifacts

Floating Ip Artifacts

Returns reservable floating IPs, external networks, and the target resource's interfaces for floating-IP allocation.

Parameters

NameInTypeDescription
admin_domainquerystring | null—
admin_projectquerystring | null—
resource_idquerystring | null—
product_type_namequerystring—

Responses

  • 200Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 422Validation error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X GET "https://api.nimbusnexus.net/api/v1/floating_ip/artifacts" \
  -H "Authorization: Bearer $NIMBUS_KEY"
POST/api/v1/floating_ip/deallocate

Deallocate Ip

Detaches a floating IP from its port, optionally deleting the floating IP entirely.

Request body

FieldTypeDescription
admin_domainstring | null—
admin_projectstring | null—
id*string—
deleteboolean—

Responses

  • 200Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflict
  • 422Validation error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X POST "https://api.nimbusnexus.net/api/v1/floating_ip/deallocate" \
  -H "Authorization: Bearer $NIMBUS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "example"
  }'
POST/api/v1/floating_ip/reserve

Reserve Ip

Reserves a floating IP on an external network without binding it to any port.

Request body

FieldTypeDescription
admin_domainstring | null—
admin_projectstring | null—
floating_network_id*string—
ip_addressstring | null—
descriptionstring | null—

Responses

  • 201Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 409Conflict
  • 422Validation error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X POST "https://api.nimbusnexus.net/api/v1/floating_ip/reserve" \
  -H "Authorization: Bearer $NIMBUS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "floating_network_id": "<floating_network_id>"
  }'

Need to make a real call? Try these endpoints in the live Swagger UI →