Skip to main content
PUT
/
api
/
v1
/
cvms
/
{cvm_id}
/
ports
Set port mappings
curl --request PUT \
  --url https://cloud-api.phala.com/api/v1/cvms/{cvm_id}/ports \
  --header 'Content-Type: application/json' \
  --data '
{
  "ports": [
    {
      "vm_port": 32768,
      "protocol": "tcp"
    }
  ]
}
'
[
  {
    "id": "<string>",
    "host_port": 123,
    "vm_port": 123,
    "protocol": "<string>",
    "host_address": "<string>"
  }
]

Path Parameters

cvm_id
string
required

Body

application/json

Bulk-replace all port mappings for a CVM.

ports
PortMappingEntry · object[]
required

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