Saltar al contenido
NimbusNexus

Interfaces de VM

Una interfaz de VM es una conexión de red de una VM — el vínculo entre la VM y uno de sus puertos de red. A la mayoría de las VMs les basta con la interfaz por defecto que se crea al lanzarlas; solo gestionas interfaces directamente cuando necesitas conectar una VM a varias redes (p. ej. servicios con doble conexión, cambios de red blue/green).

Conectar una interfaz se hace en caliente — la VM no se reinicia. El kernel ve la nueva NIC de inmediato; puede que tengas que activarla (ip link set <name> up) y configurar el direccionamiento a mano, salvo que se encargue el cloud-init de la imagen.

Desconectarla también se hace en caliente. Los sockets vinculados a la interfaz desconectada se cortan; los sockets de otras interfaces no se ven afectados.

Próximos pasos

Reference

GET/api/v1/instance/{server_id}/interfaces/

List Interfaces

List network interfaces currently attached to a virtual machine instance.

Parameters

NameInTypeDescription
server_id*pathstring—

Responses

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

Example

curl -X GET "https://api.nimbusnexus.net/api/v1/instance/<server_id>/interfaces/" \
  -H "Authorization: Bearer $NIMBUS_KEY"
POST/api/v1/instance/{server_id}/interfaces/

Attach Interface

Attach a new network interface (port) to a virtual machine instance.

Parameters

NameInTypeDescription
server_id*pathstring—

Request body

FieldTypeDescription
port_idstring | null—
net_idstring | null—
fixed_ipstring | null—
bandwidth_subscriptionPlanType | null—

Responses

  • 201Successful 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/instance/<server_id>/interfaces/" \
  -H "Authorization: Bearer $NIMBUS_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
GET/api/v1/instance/{server_id}/interfaces/artifacts

Interface Artifacts

Return reference data needed to attach a new interface (available networks, subnets and ports for the instance).

Parameters

NameInTypeDescription
server_id*pathstring—

Responses

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

Example

curl -X GET "https://api.nimbusnexus.net/api/v1/instance/<server_id>/interfaces/artifacts" \
  -H "Authorization: Bearer $NIMBUS_KEY"
DELETE/api/v1/instance/{server_id}/interfaces/{port_id}

Detach Interface

Detach a network interface (port) from a virtual machine instance.

Parameters

NameInTypeDescription
server_id*pathstring—
port_id*pathstring—

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/instance/<server_id>/interfaces/<port_id>" \
  -H "Authorization: Bearer $NIMBUS_KEY"

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