{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/phala/json-schema/phala-update-port-mappings-request-schema.json",
  "title": "UpdatePortMappingsRequest",
  "description": "Bulk-replace all port mappings for a CVM.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/phala-cvms-network-config-api-openapi.yml#/components/schemas/UpdatePortMappingsRequest",
  "properties": {
    "ports": {
      "items": {
        "$ref": "#/$defs/PortMappingEntry"
      },
      "type": "array",
      "title": "Ports"
    }
  },
  "type": "object",
  "required": [
    "ports"
  ],
  "$defs": {
    "PortMappingEntry": {
      "properties": {
        "vm_port": {
          "type": "integer",
          "maximum": 65535.0,
          "minimum": 1.0,
          "title": "Vm Port"
        },
        "protocol": {
          "type": "string",
          "pattern": "^(tcp|udp)$",
          "title": "Protocol",
          "default": "tcp"
        }
      },
      "type": "object",
      "required": [
        "vm_port"
      ],
      "title": "PortMappingEntry",
      "description": "Single requested port mapping rule."
    }
  }
}