Skip to main content
PUT
Set port mappings

Path Parameters

cvm_id
string
required

Body

application/json

Bulk-replace all port mappings for a CVM.

Adding or removing a user-NIC mapping, or changing its host_port, requires a CVM restart. Bridge-NIC mappings are applied live. Set confirm_restart=True to accept the restart; otherwise the server responds with HTTP 409 and the detailed change list so the client can prompt the user before retrying.

ports
PortMappingEntry · object[]
required
confirm_restart
boolean
default:false

Explicit consent to restart the CVM if the change requires it. source_cidrs-only changes never trigger a restart.

Response

Updated port mappings

id
string<hashid>
required

A hashed identifier that maps to an internal database ID

Pattern: ^pm_.+
Example:

"pm_0123abcd"

host_port
integer
required
vm_port
integer
required
protocol
string
required
host_address
string
required
nic_index
integer
default:0
source_cidrs
string[]
description
string | null
public_host
string | null

Node-level public DNS/IP; None when the node is not publicly reachable.

forwarding_backend
string
default:vmm_hostfwd

"vmm_hostfwd" when QEMU forwards the port on a user-mode NIC, "netd_forward" when teescope-netd DNATs it to a bridge-mode NIC, "unknown" when the node has not reported its default network mode.

restart_required
boolean
default:false

Whether adding or removing this rule needs a CVM restart. Always false for netd_forward rules: netd installs them on the live host.

guest_ip
string | null

Guest address a netd_forward rule currently resolves to, read back from the node. None for vmm_hostfwd rules and when the node was not reachable. Empty string means the NIC's DHCP reservation is gone and the rule is inert.