Ir para o conteúdo
NimbusNexus

Portas de rede

Uma porta de rede é o ponto de conexão entre uma rede e algo que a usa — uma VM, um balanceador de carga, um roteador. A maioria dos usuários não gerencia portas diretamente; eles criam uma VM anexada a uma rede e a porta é criada nos bastidores. Esta parte da API serve para os casos em que você realmente precisa de controle direto: criar uma porta com um IP conhecido e anexá-la a uma VM em execução, anexar um balanceador de carga a um IP específico já conhecido ou migrar o IP de um serviço entre hosts.

As portas têm um endereço MAC, um ou mais endereços IP na sub-rede-mãe e, opcionalmente, grupos de segurança aplicados para filtrar o tráfego de entrada e de saída. Uma porta que você mesmo cria sobrevive à VM a que está anexada, pronta para uma VM substituta; as portas que uma VM recebe quando é criada em uma rede são excluídas junto com ela. Uma porta na rede externa é cobrada até você excluí-la (veja Dados de preços).

A criação de uma VM só recebe redes (network), então uma porta que você criou só entra em uma VM depois que ela sobe: POST /api/v1/instance/{server_id}/interfaces/ com o port_id dela.

Próximos passos

Reference

GET/api/v1/portal/port/

List Ports

Lists network ports owned by the project.

Parameters

NameInTypeDescription
admin_domainquerystring | null—
admin_projectquerystring | null—
namequerystring | nullPort name
network_idquerystring | nullNetwork ID filter
admin_state_upqueryboolean | nullAdministrative state of the port
device_idquerystring | nullDevice ID (server UUID) attached to the port
device_ownerquerystring | nullDevice owner of the port
qos_policy_idquerystring | nullQoS policy ID
project_idquerystring | nullProject ID
mac_addressquerystring | nullMAC address
port_security_enabledqueryboolean | nullPort security enabled
security_groupsqueryarray of string | nullSecurity group IDs
binding_vnic_typequerystring | nullVNIC type binding
descriptionquerystring | nullPort description
statusquerystring | nullPort status filter

Responses

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

Example

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

Create Port

Creates a network port, optionally attached to a server, and embeds billing metadata in its description.

Request body

FieldTypeDescription
admin_domainstring | null—
admin_projectstring | null—
namestring | nullPort name
network_id*stringNetwork ID to attach the port
admin_state_upboolean | nullAdministrative state of the port
device_idstring | nullDevice ID (server UUID) attached to the port
device_ownerstring | nullDevice owner of the port
qos_policy_idstring | nullQoS policy ID
project_idstring | nullProject ID
mac_addressstring | nullMAC address
port_security_enabledboolean | nullPort security enabled
security_groupsarray of string | nullSecurity group IDs
binding_vnic_typestring | nullVNIC type binding
descriptionstring | null—
fixed_ipsarray of FixedIps | nullList of fixed IPs to assign to the port
hintsobject | nullAdditional hints for Admin Only
extra_dhcp_optsarray of object | null—
allowed_address_pairsarray of object | null—
product_categorystringProduct category for billing
subscriptionobjectSubscription plan type

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/portal/port/" \
  -H "Authorization: Bearer $NIMBUS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "network_id": "<network_id>"
  }'
GET/api/v1/portal/port/artifacts

Port Artifacts

Returns subnets and QoS policies usable when creating a port.

Parameters

NameInTypeDescription
product_type_namequerystring—

Responses

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

Example

curl -X GET "https://api.nimbusnexus.net/api/v1/portal/port/artifacts" \
  -H "Authorization: Bearer $NIMBUS_KEY"
GET/api/v1/portal/port/{port_id}

Get Port

Returns the details of a single network port by ID.

Parameters

NameInTypeDescription
port_id*pathstring—

Responses

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

Example

curl -X GET "https://api.nimbusnexus.net/api/v1/portal/port/<port_id>" \
  -H "Authorization: Bearer $NIMBUS_KEY"
PUT/api/v1/portal/port/{port_id}

Update Port

Updates the mutable attributes of an existing network port.

Parameters

NameInTypeDescription
port_id*pathstring—

Request body

FieldTypeDescription
namestring | nullPort name
admin_state_upboolean | nullAdministrative state of the port
device_idstring | nullDevice ID (server UUID) attached to the port
device_ownerstring | nullDevice owner of the port
qos_policy_idstring | nullQoS policy ID
mac_addressstring | nullMAC address
port_security_enabledboolean | nullPort security enabled
security_groupsarray of string | nullSecurity group IDs
binding_vnic_typestring | nullVNIC type binding
descriptionstring | nullPort description
fixed_ipsarray of FixedIps | nullList of fixed IPs to update
hintsobject | nullAdditional hints for Admin Only

Responses

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

Example

curl -X PUT "https://api.nimbusnexus.net/api/v1/portal/port/<port_id>" \
  -H "Authorization: Bearer $NIMBUS_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
DELETE/api/v1/portal/port/{port_id}

Delete Port

Deletes a network port by ID, rejecting the request if the port is still in use.

Parameters

NameInTypeDescription
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/portal/port/<port_id>" \
  -H "Authorization: Bearer $NIMBUS_KEY"

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