Ir para o conteúdo
NimbusNexus

Interfaces de VM

Uma interface de VM é uma conexão de rede em uma VM — o vínculo entre a VM e uma das suas portas de rede. Para a maioria das VMs, a interface padrão criada quando a VM sobe basta; você só gerencia interfaces diretamente quando precisa anexar uma VM a várias redes (por exemplo, serviços conectados a duas redes, trocas de rede blue/green).

Anexar uma interface é uma operação a quente — a VM não reinicia. O kernel vê a nova NIC imediatamente; talvez você precise ativá-la (ip link set <name> up) e configurar o endereçamento manualmente, a menos que o cloud-init da imagem cuide disso.

Desanexar também é a quente. Os sockets vinculados à interface desanexada caem; os sockets em outras interfaces não são afetados.

Próximos passos

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 →