Перейти до вмісту
NimbusNexus

Мережеві порти

Мережевий порт — це точка підключення між мережею й тим, що її використовує: VM, балансувальником навантаження, маршрутизатором. Більшість користувачів не керують портами напряму: вони створюють VM із підключенням до мережі, а порт створюється за лаштунками. Цей API призначений для випадків, коли вам таки потрібен прямий контроль: створити порт із відомим IP і підʼєднати його до запущеної VM, підʼєднати балансувальник навантаження до конкретного відомого IP або перенести IP сервісу між хостами.

Порт має MAC-адресу, одну або кілька IP-адрес у батьківській підмережі та, за потреби, групи безпеки, які фільтрують вхідний і вихідний трафік. Порт, який ви створили самі, переживає VM, до якої підʼєднаний, і готовий до підʼєднання до VM, що її замінить; порти, які VM отримує під час створення в мережі, видаляються разом із нею. Порт у зовнішній мережі тарифікується, доки ви його не видалите (див. Дані про ціни).

Під час створення VM можна вказати лише мережі (network), тож створений вами порт підʼєднується до VM після запуску: POST /api/v1/instance/{server_id}/interfaces/ з його port_id.

Що далі

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 →