Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

API reference

wpg-server serves a REST (JSON) API under /api and pushes live statistics, job state changes and logs over a WebSocket (GET /api/ws). This page is generated from the OpenAPI document of the server (utoipa). A running server serves the same document at /api/openapi.json with Swagger UI at /api/docs/, and a copy is kept in docs/schema/openapi.json. Log in with POST /api/auth/login (or POST /api/auth/setup on first run); the wpg_session cookie then authenticates every request, and POST / PUT / DELETE must also send the CSRF token of GET /api/auth/status in the X-CSRF-Token header. Errors are a JSON object error with code, message (in the language of Accept-Language) and details. The endpoint and schema descriptions below come from the code.

Endpoints

TagEndpointSummary
authPOST /api/auth/loginLogs in (rate limited per client address: 5 failures a minute, then an exponentially growing lock-out up to 15 minutes). Requires Content-Type: application/json.
authPOST /api/auth/logoutLogs out (needs X-CSRF-Token when the session is live) and clears the cookies.
authPOST /api/auth/setupFirst-run setup: sets the admin password and logs in. Only while no password is configured, and only from a loopback client unless the server runs with --allow-insecure. Requires Content-Type: application/json.
authGET /api/auth/statusAuthentication state of the caller (never requires a session).
authGET /api/tokensAPI tokens (admins: all; others: their own), oldest first.
authPOST /api/tokensCreates a token for the logged-in user, with that user’s role. The response is the only place the secret appears.
authDELETE /api/tokens/{id}Revokes (deletes) a token; requests with it fail from now on.
systemGET /api/healthLiveness probe.
systemGET /api/system/backendsTransmit backends of this build.
systemGET /api/system/doctorSelf-diagnosis (wpg doctor --json), with localised summary / fix.
systemGET /api/system/ifacesNetwork interfaces with usable (up, running, not loopback) and allowed (by tx.allowed_ifaces).
systemGET /api/versionBuild information.
protocolsGET /api/protocolsThe catalog in palette order.
protocolsGET /api/protocols/extensionsThe user-defined protocol files in use ([protocols] dirs, --protocols-dir; loaded at startup or by POST /api/protocols/reload): their definitions and bindings, so that the web UI can add them to its in-browser catalog. Empty without extensions.
protocolsPOST /api/protocols/reloadReads the user-defined protocol directories of the server again ([protocols] dirs, --protocols-dir) and switches the catalog to what they hold now; WebSocket clients get a protocols_changed event. Jobs that are already running keep the catalog they started with. On an error nothing changes. Admin only.
protocolsGET /api/protocols/{id}The full definition (wpg_core::ProtocolDef): fields with types, defaults, auto computations and bindings. Every description_key gets a localised description next to it.
packetsPOST /api/lintChecks a template (wpg template lint). A template that does not even parse is reported as a single error at path "".
packetsPOST /api/parseDecodes raw bytes into layers (Hex paste import).
packetsPOST /api/renderRenders packets of a template (preview).
templatesGET /api/templatesLists / searches templates.
templatesPOST /api/templatesCreates a template in the user directory (file name from meta.name).
templatesPOST /api/templates/importImports a .wpg.yaml (or JSON) document into the user directory.
templatesGET /api/templates/{id}One template (also marks it as recently used).
templatesPUT /api/templates/{id}Replaces a user template.
templatesDELETE /api/templates/{id}Deletes a user template.
templatesPOST /api/templates/{id}/duplicateCopies a template (library or user) into the user directory.
templatesGET /api/templates/{id}/exportDownloads a template as .wpg.yaml (the file itself, comments included).
templatesPOST /api/templates/{id}/favoriteSets (or, without a body, toggles) the favourite flag.
jobsGET /api/jobsAll live jobs (created, running and recently finished), newest first.
jobsPOST /api/jobsCreates (and by default starts) a job.
jobsGET /api/jobs/historyFinished jobs (last 100), newest first.
jobsGET /api/jobs/{id}One job (live or from the history).
jobsDELETE /api/jobs/{id}Removes a job (a running one is stopped first and recorded in the history).
jobsPOST /api/jobs/{id}/pausePauses a running job.
jobsPOST /api/jobs/{id}/resumeResumes a paused job.
jobsPOST /api/jobs/{id}/startStarts a job created with start: false.
jobsGET /api/jobs/{id}/statsLatest statistics snapshot of a job.
jobsPOST /api/jobs/{id}/stopStops a job (asynchronously; watch job_state or poll the job).
jobsGET /api/stats/overviewDashboard summary.
capturesGET /api/capturesAll captures (running and the last finished ones), newest first.
capturesPOST /api/capturesStarts a capture.
capturesGET /api/captures/backendsReceive backend availability on this build / OS.
capturesPOST /api/captures/filterChecks a capture filter without starting a capture.
capturesGET /api/captures/{id}One capture.
capturesDELETE /api/captures/{id}Removes a capture (a running one is stopped first; a saved pcapng file stays on disk).
capturesGET /api/captures/{id}/packetsThe first N matching frames of a capture (live while it runs).
capturesGET /api/captures/{id}/pcapngThe pcapng file of a finished capture started with save.
capturesPOST /api/captures/{id}/stopStops a running capture (asynchronously; watch capture_state).
eventsGET /api/wsWebSocket upgrade.
terminalGET /api/terminal/known-hostsTrusted SSH host keys (<data_dir>/terminal/known_hosts).
terminalDELETE /api/terminal/known-hosts/{host}/{port}Forgets the host key(s) of host:port (after a legitimate key change).
terminalGET /api/terminal/logsSession logs, newest first.
terminalGET /api/terminal/logs/{name}Downloads a session log (text/plain, also while it is being written).
terminalDELETE /api/terminal/logs/{name}Deletes a session log (not one that is being written).
terminalGET /api/terminal/statusConfiguration and running sessions (also when the terminal is disabled, so the UI can explain how to enable it).
terminalGET /api/terminal/wsOpens a terminal session (WebSocket). Send connect first; see TerminalClientMessage / TerminalServerMessage. Remote output arrives as binary frames, keystrokes may be sent as binary frames or input messages.
snmpGET /api/snmp/captureRecording state.
snmpPOST /api/snmp/captureStarts / stops the recording of every SNMP datagram this server sends or receives (requests, responses, traps), or clears it.
snmpGET /api/snmp/capture/downloadThe recorded frames as a pcap / pcapng file (Ethernet / IP / UDP synthesised around the real datagrams; placeholder MAC addresses).
snmpPOST /api/snmp/getGetRequest.
snmpPOST /api/snmp/getbulkGetBulkRequest (v2c / v3).
snmpPOST /api/snmp/getnextGetNextRequest.
snmpPOST /api/snmp/informSends an InformRequest (v2c / v3) and waits for the acknowledgement.
snmpGET /api/snmp/mibsLoaded MIB modules with their load state.
snmpPOST /api/snmp/mibsUploads MIB files (stored under <data_dir>/mibs, loaded at once).
snmpGET /api/snmp/mibs/nodeDetails of a MIB node (longest-prefix match for instances).
snmpGET /api/snmp/mibs/searchFinds MIB objects by name (for OID autocompletion).
snmpGET /api/snmp/mibs/treeOne level of the MIB tree.
snmpDELETE /api/snmp/mibs/{module}Deletes an uploaded module (its whole file). Bundled modules cannot be deleted.
snmpGET /api/snmp/receiverReceiver state.
snmpPOST /api/snmp/receiver/startStarts (or restarts) the trap / inform receiver.
snmpPOST /api/snmp/receiver/stopStops the receiver.
snmpPOST /api/snmp/setSetRequest.
snmpGET /api/snmp/statusWhether the SNMP tool is enabled, with MIB / receiver / recording summaries.
snmpPOST /api/snmp/trapSends a trap (v1 Trap-PDU, SNMPv2-Trap, or a v3 trap with this server as the authoritative engine). The result lists the bindings sent.
snmpGET /api/snmp/trapsReceived notifications, newest first (also pushed as snmp_trap events on the WebSocket).
snmpDELETE /api/snmp/trapsForgets the received notifications.
snmpPOST /api/snmp/walkWalks one or more subtrees (GetBulk on v2c / v3, GetNext on v1); conceptual tables in the result are also returned as rows × columns.
dhcpGET /api/dhcpState, settings and counters.
dhcpPUT /api/dhcpSaves the settings; a running server restarts with them.
dhcpGET /api/dhcp/activityRecent requests and replies, newest first (wpg_dhcp::Activity).
dhcpDELETE /api/dhcp/activityClears the activity log.
dhcpGET /api/dhcp/leasesLeases (wpg_dhcp::Lease: kind v4 / na / pd, addr, plen, client, iaid, mac, hostname, state, expires, updated).
dhcpDELETE /api/dhcp/leasesDeletes one lease (key) or all of them. The client keeps using the address until it renews.
dhcpPOST /api/dhcp/startStarts (or restarts) the server; it also starts at boot until stopped.
dhcpPOST /api/dhcp/stopStops the server (and its start at boot).

auth

Login, logout and first-run setup.

POST /api/auth/login

Logs in (rate limited per client address: 5 failures a minute, then an exponentially growing lock-out up to 15 minutes). Requires Content-Type: application/json.

Request body: application/json LoginRequest

Responses

StatusDescriptionBody
204Logged in; Set-Cookie: wpg_session, wpg_csrf
401unauthorized / setup_requiredapplication/json ErrorBody
415Not JSONapplication/json ErrorBody
429rate_limited: details.retry_after_secs, Retry-Afterapplication/json ErrorBody

POST /api/auth/logout

Logs out (needs X-CSRF-Token when the session is live) and clears the cookies.

Responses

StatusDescriptionBody
204Logged out
403csrf_failedapplication/json ErrorBody

POST /api/auth/setup

First-run setup: sets the admin password and logs in. Only while no password is configured, and only from a loopback client unless the server runs with --allow-insecure. Requires Content-Type: application/json.

Request body: application/json SetupRequest

Responses

StatusDescriptionBody
204Password set; Set-Cookie: wpg_session, wpg_csrf
400Passwords differ / too shortapplication/json ErrorBody
403forbidden: remote clientapplication/json ErrorBody
409already_configuredapplication/json ErrorBody
415Not JSONapplication/json ErrorBody

GET /api/auth/status

Authentication state of the caller (never requires a session).

Responses

StatusDescriptionBody
200Stateapplication/json AuthStatus

GET /api/tokens

API tokens (admins: all; others: their own), oldest first.

Responses

StatusDescriptionBody
200Tokens (without secrets)application/json TokenInfo[]
403forbidden: bearer requests cannot manage tokensapplication/json ErrorBody

POST /api/tokens

Creates a token for the logged-in user, with that user’s role. The response is the only place the secret appears.

Request body: application/json CreateToken

Responses

StatusDescriptionBody
201Createdapplication/json CreatedToken
400Invalid name or expiryapplication/json ErrorBody
403forbidden: bearer requests cannot manage tokensapplication/json ErrorBody

DELETE /api/tokens/{id}

Revokes (deletes) a token; requests with it fail from now on.

Parameters

NameInTypeRequiredDescription
idpathintegeryesToken id

Responses

StatusDescriptionBody
204Revoked
403forbidden: bearer requests cannot manage tokensapplication/json ErrorBody
404Unknown idapplication/json ErrorBody

system

Health, version, interfaces, self-diagnosis and transmit backends.

GET /api/health

Liveness probe.

Responses

StatusDescriptionBody
200The server is upapplication/json Health

GET /api/system/backends

Transmit backends of this build.

Responses

StatusDescriptionBody
200Backendsapplication/json Backends

GET /api/system/doctor

Self-diagnosis (wpg doctor --json), with localised summary / fix.

Responses

StatusDescriptionBody
200{ ok, locale, checks: [...] }application/json object

GET /api/system/ifaces

Network interfaces with usable (up, running, not loopback) and allowed (by tx.allowed_ifaces).

Parameters

NameInTypeRequiredDescription
refreshquerybooleanRe-read the interfaces instead of using the few-seconds cache.

Responses

StatusDescriptionBody
200Interfaces (wpg ifaces --json plus usable / allowed)application/json object``[]
500Enumeration failedapplication/json ErrorBody

GET /api/version

Build information.

Responses

StatusDescriptionBody
200Version and build infoapplication/json VersionInfo

protocols

The protocol catalog (see the protocol reference).

GET /api/protocols

The catalog in palette order.

Responses

StatusDescriptionBody
200Catalog summaryapplication/json ProtocolSummary[]

GET /api/protocols/extensions

The user-defined protocol files in use ([protocols] dirs, --protocols-dir; loaded at startup or by POST /api/protocols/reload): their definitions and bindings, so that the web UI can add them to its in-browser catalog. Empty without extensions.

Responses

StatusDescriptionBody
200Extension files (protocols, bind, source)application/json object``[]

POST /api/protocols/reload

Reads the user-defined protocol directories of the server again ([protocols] dirs, --protocols-dir) and switches the catalog to what they hold now; WebSocket clients get a protocols_changed event. Jobs that are already running keep the catalog they started with. On an error nothing changes. Admin only.

Responses

StatusDescriptionBody
200Loaded filesapplication/json ReloadResult
403forbidden: not an adminapplication/json ErrorBody
422invalid_protocols: a file does not load (details.file, details.reason)application/json ErrorBody

GET /api/protocols/{id}

The full definition (wpg_core::ProtocolDef): fields with types, defaults, auto computations and bindings. Every description_key gets a localised description next to it.

Parameters

NameInTypeRequiredDescription
idpathstringyesProtocol id

Responses

StatusDescriptionBody
200Protocol definition IRapplication/json object
404Unknown protocolapplication/json ErrorBody

packets

Rendering, decoding and linting packets.

POST /api/lint

Checks a template (wpg template lint). A template that does not even parse is reported as a single error at path "".

Request body: application/json LintRequest

Responses

StatusDescriptionBody
200Lint resultapplication/json LintResponse
400Bad requestapplication/json ErrorBody

POST /api/parse

Decodes raw bytes into layers (Hex paste import).

Request body: application/json ParseRequest

Responses

StatusDescriptionBody
200Decoded packetapplication/json ParseResponse
400Invalid hexapplication/json ErrorBody
422Cannot be decodedapplication/json ErrorBody

POST /api/render

Renders packets of a template (preview).

Request body: application/json RenderRequest

Responses

StatusDescriptionBody
200Rendered packetsapplication/json RenderResponse
400Bad requestapplication/json ErrorBody
422Invalid template (details: lint issues)application/json ErrorBody

templates

The template library.

GET /api/templates

Lists / searches templates.

Parameters

NameInTypeRequiredDescription
qquerystringCase-insensitive search in id, name, descriptions, tags and protocols.
tagquerystringRequired tag(s), comma separated.
favoritequerybooleanOnly favourites (true) / non-favourites (false).
sourcequeryTemplateSourceOnly user or library templates.

Responses

StatusDescriptionBody
200Templatesapplication/json TemplateList

POST /api/templates

Creates a template in the user directory (file name from meta.name).

Request body: application/json object — Template (JSON form of .wpg.yaml)

Responses

StatusDescriptionBody
201Createdapplication/json TemplateDetail
422Invalid templateapplication/json ErrorBody

POST /api/templates/import

Imports a .wpg.yaml (or JSON) document into the user directory.

Request body: text/yaml string — Template YAML

Responses

StatusDescriptionBody
201Importedapplication/json TemplateDetail
422Invalid templateapplication/json ErrorBody

GET /api/templates/{id}

One template (also marks it as recently used).

Parameters

NameInTypeRequiredDescription
idpathstringyesTemplate id

Responses

StatusDescriptionBody
200Templateapplication/json TemplateDetail
404Unknown idapplication/json ErrorBody
422The file does not parseapplication/json ErrorBody

PUT /api/templates/{id}

Replaces a user template.

Parameters

NameInTypeRequiredDescription
idpathstringyesTemplate id

Request body: application/json object — Template (JSON form of .wpg.yaml)

Responses

StatusDescriptionBody
200Updatedapplication/json TemplateDetail
403Read-only library templateapplication/json ErrorBody
404Unknown idapplication/json ErrorBody
422Invalid templateapplication/json ErrorBody

DELETE /api/templates/{id}

Deletes a user template.

Parameters

NameInTypeRequiredDescription
idpathstringyesTemplate id

Responses

StatusDescriptionBody
204Deleted
403Read-only library templateapplication/json ErrorBody
404Unknown idapplication/json ErrorBody

POST /api/templates/{id}/duplicate

Copies a template (library or user) into the user directory.

Parameters

NameInTypeRequiredDescription
idpathstringyesTemplate id

Responses

StatusDescriptionBody
201The copyapplication/json TemplateDetail
404Unknown idapplication/json ErrorBody

GET /api/templates/{id}/export

Downloads a template as .wpg.yaml (the file itself, comments included).

Parameters

NameInTypeRequiredDescription
idpathstringyesTemplate id

Responses

StatusDescriptionBody
200YAMLtext/yaml string
404Unknown idapplication/json ErrorBody

POST /api/templates/{id}/favorite

Sets (or, without a body, toggles) the favourite flag.

Parameters

NameInTypeRequiredDescription
idpathstringyesTemplate id

Request body: application/json Favorite | null — {"favorite": bool}; empty or null = toggle

Responses

StatusDescriptionBody
200New stateapplication/json FavoriteState
404Unknown idapplication/json ErrorBody

jobs

Transmit jobs and statistics.

GET /api/jobs

All live jobs (created, running and recently finished), newest first.

Responses

StatusDescriptionBody
200Jobsapplication/json JobInfo[]

POST /api/jobs

Creates (and by default starts) a job.

Request body: application/json CreateJob

Responses

StatusDescriptionBody
201Createdapplication/json JobInfo
400Invalid jobapplication/json ErrorBody
403policy_violation: interface or rate not allowedapplication/json ErrorBody
404Unknown template idapplication/json ErrorBody
422Invalid templateapplication/json ErrorBody
502backend_error: the backend could not be openedapplication/json ErrorBody

GET /api/jobs/history

Finished jobs (last 100), newest first.

Responses

StatusDescriptionBody
200Finished jobsapplication/json JobInfo[]

GET /api/jobs/{id}

One job (live or from the history).

Parameters

NameInTypeRequiredDescription
idpathstringyesJob id

Responses

StatusDescriptionBody
200Jobapplication/json JobInfo
404Unknown idapplication/json ErrorBody

DELETE /api/jobs/{id}

Removes a job (a running one is stopped first and recorded in the history).

Parameters

NameInTypeRequiredDescription
idpathstringyesJob id

Responses

StatusDescriptionBody
204Deleted
404Unknown idapplication/json ErrorBody

POST /api/jobs/{id}/pause

Pauses a running job.

Parameters

NameInTypeRequiredDescription
idpathstringyesJob id

Responses

StatusDescriptionBody
200Pausingapplication/json JobInfo
404Unknown idapplication/json ErrorBody
409Not runningapplication/json ErrorBody

POST /api/jobs/{id}/resume

Resumes a paused job.

Parameters

NameInTypeRequiredDescription
idpathstringyesJob id

Responses

StatusDescriptionBody
200Resumingapplication/json JobInfo
404Unknown idapplication/json ErrorBody
409Not runningapplication/json ErrorBody

POST /api/jobs/{id}/start

Starts a job created with start: false.

Parameters

NameInTypeRequiredDescription
idpathstringyesJob id

Responses

StatusDescriptionBody
200Startedapplication/json JobInfo
404Unknown idapplication/json ErrorBody
409Not in state createdapplication/json ErrorBody
502Backend errorapplication/json ErrorBody

GET /api/jobs/{id}/stats

Latest statistics snapshot of a job.

Parameters

NameInTypeRequiredDescription
idpathstringyesJob id

Responses

StatusDescriptionBody
200wpg_tx::job::StatsSnapshotapplication/json object
404Unknown idapplication/json ErrorBody
409Never startedapplication/json ErrorBody

POST /api/jobs/{id}/stop

Stops a job (asynchronously; watch job_state or poll the job).

Parameters

NameInTypeRequiredDescription
idpathstringyesJob id

Responses

StatusDescriptionBody
200Stoppingapplication/json JobInfo
404Unknown idapplication/json ErrorBody
409Already endedapplication/json ErrorBody

GET /api/stats/overview

Dashboard summary.

Responses

StatusDescriptionBody
200Dashboard dataapplication/json Overview

captures

Receive counters, captured frames and signature verification

GET /api/captures

All captures (running and the last finished ones), newest first.

Responses

StatusDescriptionBody
200Capturesapplication/json CaptureInfo[]

POST /api/captures

Starts a capture.

Request body: application/json CaptureSpec

Responses

StatusDescriptionBody
201Startedapplication/json CaptureInfo
400Invalid spec or filterapplication/json ErrorBody
404Unknown interface / input fileapplication/json ErrorBody
502backend_error: the backend could not be openedapplication/json ErrorBody

GET /api/captures/backends

Receive backend availability on this build / OS.

Responses

StatusDescriptionBody
200Backends (name, available, reason)application/json object``[]

POST /api/captures/filter

Checks a capture filter without starting a capture.

Request body: application/json FilterCheck

Responses

StatusDescriptionBody
200Resultapplication/json FilterCheckResult

GET /api/captures/{id}

One capture.

Parameters

NameInTypeRequiredDescription
idpathstringyesCapture id

Responses

StatusDescriptionBody
200Captureapplication/json CaptureInfo
404Unknown idapplication/json ErrorBody

DELETE /api/captures/{id}

Removes a capture (a running one is stopped first; a saved pcapng file stays on disk).

Parameters

NameInTypeRequiredDescription
idpathstringyesCapture id

Responses

StatusDescriptionBody
204Deleted
404Unknown idapplication/json ErrorBody

GET /api/captures/{id}/packets

The first N matching frames of a capture (live while it runs).

Parameters

NameInTypeRequiredDescription
idpathstringyesCapture id

Responses

StatusDescriptionBody
200Kept framesapplication/json CapturedFrame[]
404Unknown idapplication/json ErrorBody

GET /api/captures/{id}/pcapng

The pcapng file of a finished capture started with save.

Parameters

NameInTypeRequiredDescription
idpathstringyesCapture id

Responses

StatusDescriptionBody
200pcapng fileapplication/octet-stream
404Unknown id or nothing savedapplication/json ErrorBody
409Still runningapplication/json ErrorBody

POST /api/captures/{id}/stop

Stops a running capture (asynchronously; watch capture_state).

Parameters

NameInTypeRequiredDescription
idpathstringyesCapture id

Responses

StatusDescriptionBody
200Stoppingapplication/json CaptureInfo
404Unknown idapplication/json ErrorBody
409Already endedapplication/json ErrorBody

events

The WebSocket event stream.

GET /api/ws

WebSocket upgrade.

Responses

StatusDescriptionBody
101WebSocket: JSON ServerEvent messagesapplication/json ServerEvent

terminal

Web terminal: SSH / Telnet sessions, session logs, host keys

GET /api/terminal/known-hosts

Trusted SSH host keys (<data_dir>/terminal/known_hosts).

Responses

StatusDescriptionBody
200Host keysapplication/json KnownHost[]

DELETE /api/terminal/known-hosts/{host}/{port}

Forgets the host key(s) of host:port (after a legitimate key change).

Parameters

NameInTypeRequiredDescription
hostpathstringyesHost as stored
portpathintegeryesPort

Responses

StatusDescriptionBody
204Removed
404No key storedapplication/json ErrorBody

GET /api/terminal/logs

Session logs, newest first.

Responses

StatusDescriptionBody
200Logsapplication/json LogInfo[]

GET /api/terminal/logs/{name}

Downloads a session log (text/plain, also while it is being written).

Parameters

NameInTypeRequiredDescription
namepathstringyesLog file name

Responses

StatusDescriptionBody
200The logtext/plain
404Unknown logapplication/json ErrorBody

DELETE /api/terminal/logs/{name}

Deletes a session log (not one that is being written).

Parameters

NameInTypeRequiredDescription
namepathstringyesLog file name

Responses

StatusDescriptionBody
204Deleted
404Unknown logapplication/json ErrorBody
409invalid_state: the session is still recordingapplication/json ErrorBody

GET /api/terminal/status

Configuration and running sessions (also when the terminal is disabled, so the UI can explain how to enable it).

Responses

StatusDescriptionBody
200Terminal statusapplication/json TerminalStatus

GET /api/terminal/ws

Opens a terminal session (WebSocket). Send connect first; see TerminalClientMessage / TerminalServerMessage. Remote output arrives as binary frames, keystrokes may be sent as binary frames or input messages.

Responses

StatusDescriptionBody
101WebSocket: TerminalServerMessage JSON + binary outputapplication/json TerminalServerMessage
403terminal_disabled (terminal.enabled = false) or forbidden (viewer role)application/json ErrorBody

snmp

SNMP manager tool: Get / Walk / Set / traps, MIBs, trap receiver, pcap recording

GET /api/snmp/capture

Recording state.

Responses

StatusDescriptionBody
200Stateapplication/json CaptureStatus

POST /api/snmp/capture

Starts / stops the recording of every SNMP datagram this server sends or receives (requests, responses, traps), or clears it.

Request body: application/json CaptureControl

Responses

StatusDescriptionBody
200Stateapplication/json CaptureStatus

GET /api/snmp/capture/download

The recorded frames as a pcap / pcapng file (Ethernet / IP / UDP synthesised around the real datagrams; placeholder MAC addresses).

Parameters

NameInTypeRequiredDescription
formatpathstring | nullyespcap (default) or pcapng.

Responses

StatusDescriptionBody
200pcap / pcapng fileapplication/octet-stream
400Unknown formatapplication/json ErrorBody

POST /api/snmp/get

GetRequest.

Request body: application/json SnmpOidsRequest

Responses

StatusDescriptionBody
200Response (check error_status)application/json SnmpResult
400Bad target / OID / v3 settingsapplication/json ErrorBody
502snmp_error: Report PDU, authentication or decoding failureapplication/json ErrorBody
504snmp_error: no responseapplication/json ErrorBody

POST /api/snmp/getbulk

GetBulkRequest (v2c / v3).

Request body: application/json SnmpBulkRequest

Responses

StatusDescriptionBody
200Responseapplication/json SnmpResult
400Bad request (also: GetBulk on v1)application/json ErrorBody
502snmp_errorapplication/json ErrorBody
504snmp_error: no responseapplication/json ErrorBody

POST /api/snmp/getnext

GetNextRequest.

Request body: application/json SnmpOidsRequest

Responses

StatusDescriptionBody
200Responseapplication/json SnmpResult
400Bad requestapplication/json ErrorBody
502snmp_errorapplication/json ErrorBody
504snmp_error: no responseapplication/json ErrorBody

POST /api/snmp/inform

Sends an InformRequest (v2c / v3) and waits for the acknowledgement.

Request body: application/json SnmpNotifyRequest

Responses

StatusDescriptionBody
200Acknowledged (the Response’s bindings)application/json SnmpResult
400Bad request (also: inform on v1)application/json ErrorBody
502snmp_errorapplication/json ErrorBody
504snmp_error: not acknowledgedapplication/json ErrorBody

GET /api/snmp/mibs

Loaded MIB modules with their load state.

Responses

StatusDescriptionBody
200Modulesapplication/json MibModuleOut[]

POST /api/snmp/mibs

Uploads MIB files (stored under <data_dir>/mibs, loaded at once).

Request body: application/json MibUpload

Responses

StatusDescriptionBody
200Per-file result and module stateapplication/json MibUploadResult
400Bad file name / too largeapplication/json ErrorBody

GET /api/snmp/mibs/node

Details of a MIB node (longest-prefix match for instances).

Parameters

NameInTypeRequiredDescription
idpathstringyesName (ifOperStatus, IF-MIB::ifOperStatus, ifOperStatus.3) or dotted OID.

Responses

StatusDescriptionBody
200Nodeapplication/json NodeOut
400Unparsable idapplication/json ErrorBody
404No MIB defines itapplication/json ErrorBody

GET /api/snmp/mibs/search

Finds MIB objects by name (for OID autocompletion).

Parameters

NameInTypeRequiredDescription
qpathstringyesPart of a descriptor (ifOper, IF-MIB::ifH).
limitpathinteger | nullyesMost hits (default 20, at most 200).

Responses

StatusDescriptionBody
200Hits, prefix matches firstapplication/json SearchHit[]

GET /api/snmp/mibs/tree

One level of the MIB tree.

Parameters

NameInTypeRequiredDescription
oidpathstring | nullyesParent (name or dotted OID; empty = the roots).
modulepathstring | nullyesOnly the branches leading to definitions of this module; without oid, the module’s top nodes.

Responses

StatusDescriptionBody
200Childrenapplication/json TreeChildOut[]
400Unknown name or moduleapplication/json ErrorBody

DELETE /api/snmp/mibs/{module}

Deletes an uploaded module (its whole file). Bundled modules cannot be deleted.

Parameters

NameInTypeRequiredDescription
modulepathstringyesModule name

Responses

StatusDescriptionBody
200Deletedapplication/json MibDeleted
404Unknown moduleapplication/json ErrorBody
409read_only: bundled moduleapplication/json ErrorBody

GET /api/snmp/receiver

Receiver state.

Responses

StatusDescriptionBody
200Stateapplication/json ReceiverStatus

POST /api/snmp/receiver/start

Starts (or restarts) the trap / inform receiver.

Request body: application/json ReceiverStart

Responses

StatusDescriptionBody
200Listeningapplication/json ReceiverStatus
400Bad address / usersapplication/json ErrorBody
502backend_error: cannot bind (privileged port, in use)application/json ErrorBody

POST /api/snmp/receiver/stop

Stops the receiver.

Responses

StatusDescriptionBody
200Stoppedapplication/json ReceiverStatus

POST /api/snmp/set

SetRequest.

Request body: application/json SnmpSetRequest

Responses

StatusDescriptionBody
200Response (check error_status: notWritable, wrongType, …)application/json SnmpResult
400Bad target / OID / valueapplication/json ErrorBody
502snmp_errorapplication/json ErrorBody
504snmp_error: no responseapplication/json ErrorBody

GET /api/snmp/status

Whether the SNMP tool is enabled, with MIB / receiver / recording summaries.

Responses

StatusDescriptionBody
200Statusapplication/json SnmpStatus

POST /api/snmp/trap

Sends a trap (v1 Trap-PDU, SNMPv2-Trap, or a v3 trap with this server as the authoritative engine). The result lists the bindings sent.

Request body: application/json SnmpNotifyRequest

Responses

StatusDescriptionBody
200Sentapplication/json SnmpResult
400Bad requestapplication/json ErrorBody

GET /api/snmp/traps

Received notifications, newest first (also pushed as snmp_trap events on the WebSocket).

Parameters

NameInTypeRequiredDescription
limitpathinteger | nullyesMost notifications (default 200, at most 1000).

Responses

StatusDescriptionBody
200Notificationsapplication/json TrapOut[]

DELETE /api/snmp/traps

Forgets the received notifications.

Responses

StatusDescriptionBody
204Cleared

POST /api/snmp/walk

Walks one or more subtrees (GetBulk on v2c / v3, GetNext on v1); conceptual tables in the result are also returned as rows × columns.

Request body: application/json SnmpWalkRequest

Responses

StatusDescriptionBody
200Bindings and tablesapplication/json SnmpResult
400Bad requestapplication/json ErrorBody
502snmp_errorapplication/json ErrorBody
504snmp_error: no responseapplication/json ErrorBody

dhcp

DHCP server tool: DHCPv4 / DHCPv6 (IA_NA, IA_PD) pools and options, router advertisements, leases, activity

GET /api/dhcp

State, settings and counters.

Responses

StatusDescriptionBody
200Stateapplication/json DhcpStatus
404dhcp.enabled = falseapplication/json ErrorBody

PUT /api/dhcp

Saves the settings; a running server restarts with them.

Request body: application/json DhcpUpdate

Responses

StatusDescriptionBody
200Savedapplication/json DhcpStatus
400Invalid settings (details: [{ field, message }])application/json ErrorBody
403policy_violation: interface not in tx.allowed_ifacesapplication/json ErrorBody
502backend_error: the restart failedapplication/json ErrorBody

GET /api/dhcp/activity

Recent requests and replies, newest first (wpg_dhcp::Activity).

Parameters

NameInTypeRequiredDescription
limitpathinteger | nullyesMost entries returned (newest first; default 200).

Responses

StatusDescriptionBody
200Activityapplication/json object``[]

DELETE /api/dhcp/activity

Clears the activity log.

Responses

StatusDescriptionBody
204Cleared

GET /api/dhcp/leases

Leases (wpg_dhcp::Lease: kind v4 / na / pd, addr, plen, client, iaid, mac, hostname, state, expires, updated).

Responses

StatusDescriptionBody
200Leasesapplication/json object``[]

DELETE /api/dhcp/leases

Deletes one lease (key) or all of them. The client keeps using the address until it renews.

Parameters

NameInTypeRequiredDescription
keypathstring | nullyesThe lease (192.168.100.10, 2001:db8::10, 2001:db8:100::/56); absent: every lease.

Responses

StatusDescriptionBody
204Deleted
404No such leaseapplication/json ErrorBody

POST /api/dhcp/start

Starts (or restarts) the server; it also starts at boot until stopped.

Responses

StatusDescriptionBody
200Runningapplication/json DhcpStatus
400No / unknown interface, invalid settingsapplication/json ErrorBody
502backend_error: sockets (ports 67 / 547 need CAP_NET_BIND_SERVICE, RA CAP_NET_RAW; Linux only)application/json ErrorBody

POST /api/dhcp/stop

Stops the server (and its start at boot).

Responses

StatusDescriptionBody
200Stoppedapplication/json DhcpStatus

Schemas

Request and response bodies referenced above.

ActiveSession

A running session (GET /api/terminal/status).

KeyTypeRequiredDescription
hoststringyesTarget host as entered.
idstringyesSession id.
logstring | nullLog file being written, if recording.
portintegeryesTarget port.
protocolProtocolyesProtocol.
startedintegeryesStart (Unix seconds).
userstringyeswpg user who opened it.
viastring``[]SSH jump hosts in order (user@host:port), empty for a direct session.

AuthStatus

GET /api/auth/status.

KeyTypeRequiredDescription
authenticatedbooleanyesThe request carries a valid session.
configuredbooleanyesA password exists (configured or set on the setup screen).
csrf_tokenstring | nullCSRF token to send as X-CSRF-Token on POST / PUT / DELETE (also in the wpg_csrf cookie); null when not logged in.
setup_requiredbooleanyesNo password yet: show the setup screen (POST /api/auth/setup).
userUserInfo | null

BackendItem

One transmit backend.

KeyTypeRequiredDescription
availablebooleanyesCompiled in and supported on this OS (privileges not checked).
multi_workerbooleanyesSeveral TX workers per job.
namestringyesName (null, pcapfile, afpacket, pcap, afxdp, dpdk).
reasonstring | nullWhy it is unavailable / requirements.

Backends

GET /api/system/backends response body.

KeyTypeRequiredDescription
backendsBackendItem[]yesAll backends.
defaultstringyesBackend used when a job names none.

CaptureControl

POST /api/snmp/capture body.

KeyTypeRequiredDescription
clearbooleanDiscard the recorded frames first.
enabledboolean | nullStart (true) / stop (false) recording.

CaptureInfo

A capture as returned by the API.

KeyTypeRequiredDescription
backendstringyesResolved backend.
filterstringyesNormalised filter text (empty = every frame).
finishedinteger | nullEnd time, Unix milliseconds.
idstringyesCapture id.
ifacestringyesResolved interface (input path for pcapfile).
namestringyesDisplay name (spec.name, else <backend>:<iface>).
savedbooleanyesWhether a pcapng file was written (download with GET /api/captures/{id}/pcapng).
specCaptureSpecyesThe request.
startedintegeryesStart time, Unix milliseconds.
statsobject | nullLatest statistics (wpg_rx::RxSnapshot).
statusobjectyes{ "state": "running" }, { "state": "finished", "detail": "count_reached" | "duration_elapsed" | "end_of_input" | "stopped" }, { "state": "failed", "detail": "<error>" }.

CaptureSpec

What to capture (all fields are optional).

KeyTypeRequiredDescription
backendstring | nullBackend: afpacket, pcap, pcapfile, null (default: afpacket on Linux, else pcap).
countinteger | nullStop after this many matching frames.
durationstring | nullStop after this long, e.g. 10s, 2m.
filterstring | nulltcpdump-style filter (udp port 5001 and wpg); empty = every frame.
ifacestring | nullInterface (any = every interface with afpacket); for pcapfile the name of a capture file under <data_dir>/captures (e.g. a dry-run output).
include_outgoingbooleanAlso count frames this host transmits.
keepintegerMatching frames kept for display (default 100, at most 10000).
namestring | nullDisplay name.
promiscbooleanPromiscuous mode.
savestring | nullSave the matching frames as a pcapng file of this name under <data_dir>/captures.
verifybooleanCheck the signatures of matching frames (loss / order / latency).

CaptureStatus

pcap recording state.

KeyTypeRequiredDescription
droppedintegeryesFrames dropped because the buffer was full.
enabledbooleanyesRecording.
framesintegeryesKept frames.

CapturedFrame

One kept frame.

KeyTypeRequiredDescription
hexstringyesCaptured octets as lower-case hex (decode with POST /api/parse).
indexintegeryesPosition among the matching frames (0-based).
lenintegeryesOriginal length.
signatureobject | nullThe frame’s signature (stream_id, seq, ts_ns), if any.
ts_nsintegeryesCapture time, nanoseconds since the Unix epoch.

ClientMessage

Client → server message.

type: "subscribe"

Selects the jobs whose stats / job_state events are sent.

KeyTypeRequiredDescription
jobsobject"all" or a list of job ids.
logsboolean | nullReceive log events (default true).
type"subscribe"yes

CreateJob

POST /api/jobs body: a [JobSpec] plus start.

KeyTypeRequiredDescription
startbooleanStart immediately (default true); false leaves it in state created.

CreateToken

POST /api/tokens body.

KeyTypeRequiredDescription
expires_in_daysinteger | nullExpiry in days (1 to 3650); omitted or null: never expires.
namestringyesName, to recognise the token later (1 to 100 characters).

CreatedToken

POST /api/tokens response.

KeyTypeRequiredDescription
secretstringyesThe secret to send as Authorization: Bearer <secret>. Only this response contains it.
tokenTokenInfoyesThe stored token.

DhcpStatus

GET /api/dhcp.

KeyTypeRequiredDescription
added_addressesstring``[]Addresses this server put on the interface (removed when it stops).
enabledbooleanyesdhcp.enabled.
errorstring | nullWhy the last start (at boot) failed.
ifacestringyesInterface used (pinned or chosen; empty: none chosen yet).
leasesintegeryesLeases in the table.
pinned_ifacestring | nulldhcp.iface (fixed at deploy time); the screen cannot change it.
runningbooleanyesAnswering.
server_duidstring | nullDHCPv6 server DUID in use.
server_ipstring | nullDHCPv4 server identifier in use.
settingsobjectyesPools and options (wpg_dhcp::Settings).
started_msinteger | nullStart time (milliseconds since the Unix epoch).
statsobjectyesPacket counters of the running server.
supportedbooleanyesBuilt for Linux (elsewhere the server cannot start).

DhcpUpdate

PUT /api/dhcp body.

KeyTypeRequiredDescription
ifacestring | nullInterface to answer on (ignored when dhcp.iface pins one; must be allowed by tx.allowed_ifaces).
settingsobjectyesPools and options (wpg_dhcp::Settings: v4, v6).

EndReason

Why a job ended normally (mirrors wpg_tx::job::FinishReason).

Type: "count_reached" | "duration_elapsed" | "source_exhausted" | "stopped"

ErrorBody

{ "error": ... } body (OpenAPI schema of every error response).

KeyTypeRequiredDescription
errorErrorInfoyesThe error.

ErrorInfo

Error object.

KeyTypeRequiredDescription
codestringyesStable machine code: not_found, bad_request, invalid_template, policy_violation, read_only, invalid_state, backend_error, unauthorized, setup_required, rate_limited, csrf_failed, forbidden, already_configured, terminal_disabled, snmp_error, internal.
detailsanyExtra data, e.g. the lint issues of an invalid template.
messagestringyesHuman readable message in the language of Accept-Language.

ExtensionFile

One loaded extension file.

KeyTypeRequiredDescription
bindingsintegeryesNumber of its bind entries.
protocolsstring``[]yesIds of the protocols it defines.
sourcestringyesThe file.

Favorite

Body of POST /api/templates/{id}/favorite (empty body = toggle).

KeyTypeRequiredDescription
favoritebooleanyesNew value.

FavoriteState

POST /api/templates/{id}/favorite response.

KeyTypeRequiredDescription
favoritebooleanyesCurrent value.
idstringyesTemplate id.

FilterCheck

POST /api/captures/filter request.

KeyTypeRequiredDescription
filterstringyesFilter text.

FilterCheckResult

POST /api/captures/filter response.

KeyTypeRequiredDescription
errorstring | nullWhat is wrong (when invalid).
normalizedstring | nullNormalised filter text (when valid).
okbooleanyesThe filter is valid.
posinteger | nullByte offset of the error (when invalid).

Health

GET /api/health response body.

KeyTypeRequiredDescription
localestringyesNegotiated locale.
messagestringyesLocalised human-readable status.
statusstringyesAlways "ok" when the server answers.
uptime_secsintegeryesSeconds since the server started.
versionstringyesServer version.

IfaceBrief

An interface on the dashboard.

KeyTypeRequiredDescription
allowedbooleanyesAllowed by the transmit policy.
loopbackbooleanyesLoopback.
namestringyesName.
runningbooleanyesCarrier / running.
speed_mbpsinteger | nullLink speed.
upbooleanyesAdministratively up.

JobBrief

A running job on the dashboard.

KeyTypeRequiredDescription
backendstringyesBackend.
bpsnumberyesL2 bits per second.
idstringyesJob id.
ifacestringyesInterface.
namestringyesName.
packetsintegeryesPackets sent.
ppsnumberyesPackets per second.
statusJobStatusyesState.

JobInfo

A job as returned by the API (also the persisted history record).

KeyTypeRequiredDescription
backendstringyesResolved backend.
createdintegeryesCreation time, Unix milliseconds.
finishedinteger | nullEnd time, Unix milliseconds.
idstringyesJob id.
ifacestringyesResolved interface (output path for pcapfile).
namestringyesDisplay name (spec.name, else the first template’s name).
plansobject``[]yesExpansion plan of each stream.
ratestringyesResolved rate.
reportobject | nullFinal report (after the job ended).
specJobSpecyesThe request.
startedinteger | nullStart time, Unix milliseconds.
statsobject | nullLatest statistics.
statusJobStatusyesCurrent state.
workersintegeryesTX workers.

JobSpec

What to send, where and how (all fields but streams are optional).

KeyTypeRequiredDescription
backendstring | nullBackend: null, pcapfile, afpacket, pcap, … (default: tx.default_backend).
batchinteger | nullFrames per send_batch call.
burstinteger | nullFrames per rate-control grant.
countinteger | nullTotal packets (default: the template’s tx.count for a single stream).
dry_runstring | nullDry run: write a pcapng file of this name under <data_dir>/captures instead of sending (forces the pcapfile backend).
durationstring | nullDuration limit, e.g. 10s, 2m.
ifacestring | nullInterface (not needed for null; the output file name for pcapfile).
mixMixInterleaving of several streams.
namestring | nullDisplay name.
pin_coresinteger``[]Core per worker (Linux).
planstring | nullExpansion strategy: auto, prerender, onthefly.
ramp_upstring | nullLinear rate ramp-up time, e.g. 5s.
ratestring | nullRate: 1000pps, 1Mpps, 10Gbps, 50%, ifg=10us, unlimited (default: the first template’s tx.rate, then tx.max_rate, else unlimited).
signaturebooleanStamp every frame with a receive-verification signature (magic + stream id + sequence number + TX time over the last 24 payload octets; see /api/captures with verify).
start_atstring | nullScheduled start: RFC 3339 or +10s.
stream_idinteger | nullSignature stream id of the first stream (stream i gets stream_id + i; default 0).
streamsJobStream[]Streams (at least one). Several streams are mixed into one TX worker.
workersinteger | nullTX worker threads (single stream only).

JobStatus

Job lifecycle state: { "state": "running" }, { "state": "finished", "detail": "count_reached" }, { "state": "failed", "detail": "<error>" }.

state: "created"

Created with start: false, not started yet.

KeyTypeRequiredDescription
state"created"yes

state: "scheduled"

Waiting for start_at.

KeyTypeRequiredDescription
state"scheduled"yes

state: "running"

Sending.

KeyTypeRequiredDescription
state"running"yes

state: "paused"

Paused.

KeyTypeRequiredDescription
state"paused"yes

state: "finished"

Ended normally (count_reached, duration_elapsed, source_exhausted, stopped).

KeyTypeRequiredDescription
detailEndReasonyesEnded normally (count_reached, duration_elapsed, source_exhausted, stopped).
state"finished"yes

state: "failed"

Ended with an error.

KeyTypeRequiredDescription
detailstringyesEnded with an error.
state"failed"yes

JobStream

One stream of a job: a stored template (template_id) or an inline one.

KeyTypeRequiredDescription
templateobject | nullInline template (takes precedence over template_id).
template_idstring | nullId of a stored template.
varsmap<string, ``string``>Template variable values (name → human notation).
weightintegerWeight for mix: weighted (0 counts as 1).

JobTotals

Dashboard aggregate of the running jobs.

KeyTypeRequiredDescription
activeintegeryesJobs that are scheduled, running or paused.
bpsnumberyesSum of the jobs’ L2 bits per second.
l1_bpsnumberyesSum of the jobs’ L1 bits per second.
ppsnumberyesSum of the jobs’ packets per second.
runningintegeryesJobs currently sending.

JumpHost

One SSH jump host of a [ConnectRequest].

KeyTypeRequiredDescription
hoststringyesHost name or address (resolved by the previous hop, or by the server for the first one).
passphrasestring | nullPassphrase of private_key.
passwordstring | nullPassword (also answers a single keyboard-interactive password prompt); empty: the server’s prompts are shown.
portinteger | nullSSH port (default 22).
private_keystring | nullPrivate key (OpenSSH / PEM / PuTTY .ppk text).
usernamestringyesUser name on the jump host.

KnownHost

A stored host key (GET /api/terminal/known-hosts).

KeyTypeRequiredDescription
algorithmstringyesKey algorithm (ssh-ed25519, rsa-sha2-512, …).
commentstringyesThe entry’s comment (who accepted it and when).
fingerprintstringyesSHA256:... fingerprint.
hoststringyesHost as typed by the user who accepted the key (lower case).
portintegeryesTCP port.

LintRequest

POST /api/lint request.

KeyTypeRequiredDescription
templateobjectyesTemplate: object or YAML text.

LintResponse

POST /api/lint response.

KeyTypeRequiredDescription
errorsintegeryesNumber of errors.
issuesobject``[]yesFindings (level, path, key, args, localised message).
okbooleanyesNo errors (warnings allowed).
warningsintegeryesNumber of warnings.

LogInfo

A past or running session log (GET /api/terminal/logs).

KeyTypeRequiredDescription
activebooleanyesStill being written by a live session.
modifiedintegeryesLast modification (Unix seconds).
namestringyesFile name (the id in /api/terminal/logs/{name}).
sizeintegeryesSize in bytes.

LoginRequest

POST /api/auth/login body.

KeyTypeRequiredDescription
passwordstringyesPassword.
usernamestring | nullUser name (default admin).

MibDeleted

Removed modules.

KeyTypeRequiredDescription
removedstring``[]yesModules removed with the file.

MibFileIn

One file of an upload.

KeyTypeRequiredDescription
contentstringyesFile content (text).
namestringyesFile name (CISCO-SMI.my; .mib, .txt, .my, .smi, .asn, .asn1 or none).

MibModuleOut

A loaded MIB module.

KeyTypeRequiredDescription
bundledbooleanyesBundled with wpg (cannot be deleted).
errorsstring``[]yesProblems: parse warnings, unresolved definitions.
filestring | nullUploaded file it came from.
missing_importsstring``[]yesModules named in IMPORTS that are not loaded (upload them).
namestringyesModule name.
nodesintegeryesResolved definitions.
statusstringyesok, partial (loaded with problems) or error.

MibUpload

POST /api/snmp/mibs body.

KeyTypeRequiredDescription
filesMibFileIn[]yesFiles.

MibUploadResult

POST /api/snmp/mibs result.

KeyTypeRequiredDescription
filesUploadedFile[]yesPer file.
modulesMibModuleOut[]yesThe state of the uploaded modules after loading (missing imports are named here).

Mix

How several streams are interleaved.

Type: "weighted" | "sequential" | "round_robin"

NamedNumber

An enumeration value / BITS position.

KeyTypeRequiredDescription
labelstringyesLabel.
valueintegeryesNumber.

NodeOut

MIB node details.

KeyTypeRequiredDescription
accessstring | nullMAX-ACCESS.
augmentsstring | nullAUGMENTS.
base_typestring | nullBase type.
defvalstring | nullDEFVAL.
descriptionstring | nullDESCRIPTION.
display_hintstring | nullDISPLAY-HINT.
enumsNamedNumber[]yesEnumeration / BITS names.
indexstring``[]yesINDEX (of a row; AUGMENTS followed).
instancestringyesInstance part of the requested id (3 of ifDescr.3).
kindstringyesobject_type, object_identifier, …
modulestringyesModule.
namestringyesDescriptor.
objectsstring``[]yesOBJECTS / VARIABLES (notifications).
oidstringyesOID of the definition.
pathPathElem[]yesPath from the root.
referencestring | nullREFERENCE.
rolestring | nullTable / row / column / scalar.
statusstring | nullSTATUS.
syntaxstring | nullSYNTAX text.
type_namestring | nullTextual convention.
unitsstring | nullUNITS.

Overview

GET /api/stats/overview response.

KeyTypeRequiredDescription
historyintegeryesJobs in the history.
ifacesIfaceBrief[]yesInterfaces.
jobsJobBrief[]yesActive jobs.
templatesintegeryesTemplates in the library.
totalsJobTotalsyesTotals over the active jobs.
uptime_secsintegeryesSeconds since the server started.

ParseRequest

POST /api/parse request.

KeyTypeRequiredDescription
bytes_hexstringyesFrame bytes as hex (whitespace, : / - separators and 0x allowed).
fcsbooleanThe frame ends with a 4-octet FCS.
first_protocolstring | nullProtocol of the first octet (default ethernet2).

ParseResponse

POST /api/parse response.

KeyTypeRequiredDescription
bytes_hexstringyesNormalised hex of the input.
diagnosticsobject``[]yesParse and build findings with localised message.
layoutobject``[]yesLayer / field positions.
lenintegeryesFrame length in octets.
packetobjectyesDecoded packet (wpg_core::Packet: layers with Manual field values).
trailersobject``[]yesPadding / FCS.

PathElem

Breadcrumb element.

KeyTypeRequiredDescription
namestringyesName (or the number).
oidstringyesOID.

PromptItem

One keyboard-interactive prompt.

KeyTypeRequiredDescription
echobooleanyesWhether the answer may be shown while typed.
promptstringyesPrompt text from the server.

Protocol

Remote protocol.

Type: "ssh" | "telnet"

ProtocolSummary

Catalog entry.

KeyTypeRequiredDescription
fieldsstring``[]yesField names in wire order.
idstringyesStable id (ethernet2, ipv4, …).
layerobjectyesPalette classification (l2, l3, l4, payload, …).
namestringyesDisplay name.
nextstring``[]yesProtocols this one can carry (its next-layer binding table).
synthbooleanyesContent generator instead of wire fields (payload).

ReceiverStart

POST /api/snmp/receiver/start body.

KeyTypeRequiredDescription
communitiesstring``[]Accepted communities (empty = any; others are listed with an error).
listenstringyesListen address (0.0.0.0:162, [::]:1162).
usersReceiverUserIn[]v3 users (kept in memory while the receiver runs).

ReceiverStatus

Trap receiver state.

KeyTypeRequiredDescription
communitiesstring``[]yesAccepted communities (empty = any).
engine_idstringyesThis receiver’s engine id (hex), for v3 informs.
from_configbooleanyesStarted at boot from snmp.trap_listen.
listenstring | nullBound address.
receivedintegeryesNotifications received since the start.
runningbooleanyesListening.
usersstring``[]yesConfigured v3 user names.

ReceiverUserIn

A v3 user of the receiver.

KeyTypeRequiredDescription
auth_passwordstring | nullAuthentication pass phrase.
auth_protocolstring | nullAuthentication protocol (default SHA).
priv_passwordstring | nullPrivacy pass phrase.
priv_protocolstring | nullPrivacy protocol (default AES).
userstringyesUser name.

ReloadResult

Result of POST /api/protocols/reload.

KeyTypeRequiredDescription
dirsstring``[]yesDirectories that were read.
filesExtensionFile[]yesThe files now in use, in load order.

RenderRequest

POST /api/render request.

KeyTypeRequiredDescription
countinteger | nullPackets to render (1..=server.preview_max, default 1; 256 unless configured).
indexinteger | nullStream index of the first packet (default 0).
templateobjectyesTemplate: object (JSON form of .wpg.yaml) or YAML text.
varsmap<string, ``string``>Variable values.

RenderResponse

POST /api/render response.

KeyTypeRequiredDescription
cardinalityinteger | nullPackets in the whole stream (null = unbounded).
packetsRenderedPacket[]yesThe packets.
planobjectyesHow a job would expand the stream (pre-render vs on-the-fly).

RenderedPacket

One rendered packet.

KeyTypeRequiredDescription
bytes_hexstringyesFrame bytes as lower-case hex (without FCS unless the template asks for one).
diagnosticsobject``[]yesBuilder findings with localised message.
indexintegeryesStream index.
layoutobject``[]yesLayer / field positions (wpg_core::LayerLayout).
lenintegeryesLength in octets.
trailersobject``[]yesPadding / FCS after the layers.

Role

A user role (only admin is created for now; operator / viewer are P1).

Type: "admin" | "operator" | "viewer"

SearchHit

A search hit.

KeyTypeRequiredDescription
kindstringyesKind.
modulestringyesModule.
namestringyesDescriptor.
oidstringyesOID.
rolestring | nullTable / row / column / scalar.
syntaxstring | nullSYNTAX text.

ServerEvent

One message from the server to WebSocket clients.

type: "stats"

Latest statistics of a running job (every 100 ms, one per job).

KeyTypeRequiredDescription
job_idstringyesJob id.
snapshotobjectyesCounters and rates (wpg_tx::job::StatsSnapshot).
type"stats"yes

type: "job_state"

A job changed state.

KeyTypeRequiredDescription
job_idstringyesJob id.
stateJobStatusyesNew state.
type"job_state"yes

type: "log"

A log line (ts, level, target, message, fields).

KeyTypeRequiredDescription
type"log"yes

type: "templates_changed"

The template index changed (file watcher or API write).

KeyTypeRequiredDescription
type"templates_changed"yes

type: "rx_stats"

Latest statistics of a capture (every 100 ms while it runs, once more at the end).

KeyTypeRequiredDescription
capture_idstringyesCapture id.
snapshotobjectyesCounters, rates and verification (wpg_rx::RxSnapshot).
type"rx_stats"yes

type: "capture_state"

A capture started or ended.

KeyTypeRequiredDescription
capture_idstringyesCapture id.
stateobjectyesNew state ({ "state": "running" | "finished" | "failed", "detail" }).
type"capture_state"yes

type: "snmp_trap"

The SNMP trap receiver got a notification (also listed by GET /api/snmp/traps).

KeyTypeRequiredDescription
trapTrapOutyesThe rendered notification.
type"snmp_trap"yes

type: "dhcp_activity"

The DHCP server handled a request or sent a router advertisement (also listed by GET /api/dhcp/activity).

KeyTypeRequiredDescription
activityobjectyesThe exchange (wpg_dhcp::Activity).
type"dhcp_activity"yes

type: "dhcp_state"

The DHCP server started / stopped, its settings changed or leases expired / were deleted: reload GET /api/dhcp.

KeyTypeRequiredDescription
type"dhcp_state"yes

type: "protocols_changed"

The user-defined protocols were reloaded (POST /api/protocols/reload): fetch GET /api/protocols and GET /api/protocols/extensions again.

KeyTypeRequiredDescription
type"protocols_changed"yes

SetupRequest

POST /api/auth/setup body.

KeyTypeRequiredDescription
confirmstringyesThe same password again.
passwordstringyesThe new admin password (at least 8 characters).

SnmpBulkRequest

GetBulk request body.

KeyTypeRequiredDescription
max_repetitionsinteger | nullmax-repetitions (default 10).
non_repeatersinteger | nullnon-repeaters (default 0).
oidsstring``[]yesObjects (the first non_repeaters are fetched once).
targetSnmpTargetyesThe agent.

SnmpNotifyRequest

Trap / Inform request body.

KeyTypeRequiredDescription
targetSnmpTargetyesThe receiver (port default 162).
trap_oidstringyessnmpTrapOID (linkDown, IF-MIB::linkUp, 1.3.6.1.6.3.1.1.5.1). v1 traps are converted per RFC 3584.
uptimeinteger | nullsysUpTime in hundredths of a second (default: the server’s uptime).
varbindsVarBindIn[]Extra bindings.

SnmpOidsRequest

Get / GetNext request body.

KeyTypeRequiredDescription
oidsstring``[]yesObjects: names (sysDescr.0, IF-MIB::ifDescr.1) or dotted OIDs.
targetSnmpTargetyesThe agent.

SnmpResult

Result of an operation.

KeyTypeRequiredDescription
elapsed_msnumberyesRound trip(s) in milliseconds.
engine_idstring | nullThe agent’s engine id (v3, hex).
error_indexintegeryeserror-index (1-based binding, 0 = none).
error_statusintegeryeserror-status of the response (0 = noError).
error_status_namestring | nullIts name (noSuchName, notWritable, …), when not 0.
opstringyesget, getnext, getbulk, walk, set, trap, inform.
requestsintegeryesRequests sent.
tablesTableOut[]Conceptual tables found among the bindings (walks).
targetstringyesThe agent / receiver address.
truncatedbooleanThe walk stopped at its limit.
varbindsVarBindOut[]yesThe bindings (response, walk results, or the notification sent).
versionstringyesv1, v2c, v3.

SnmpSetRequest

Set request body.

KeyTypeRequiredDescription
targetSnmpTargetyesThe agent.
varbindsVarBindIn[]yesBindings to set.

SnmpStatus

GET /api/snmp/status.

KeyTypeRequiredDescription
captureCaptureStatus | null
enabledbooleanyessnmp.enabled.
mib_dirstringyesDirectory of uploaded MIBs.
modulesintegeryesLoaded modules.
nodesintegeryesResolved MIB nodes.
receiverReceiverStatus | null

SnmpTarget

Where to send a request.

KeyTypeRequiredDescription
communitystring | nullCommunity for v1 / v2c (default public).
hoststringyesHost name or address.
portinteger | nullUDP port (default 161 for requests, 162 for notifications).
retriesinteger | nullExtra attempts (default 1, at most 10).
timeout_msinteger | nullWait per attempt in milliseconds (default 2000, at most 60000).
v3V3In | null
versionSnmpVersionVersion (default v2c).

SnmpVersion

SNMP protocol version.

Type: "v1" | "v2c" | "v3"

SnmpWalkRequest

Walk request body.

KeyTypeRequiredDescription
limitinteger | nullMost bindings returned in all (default 10000, at most 100000).
max_repetitionsinteger | nullmax-repetitions per GetBulk (default 20; v1 walks with GetNext).
oidstringSubtree root: name (ifTable, system) or dotted OID.
oidsstring``[]More subtree roots, walked one after another after oid (either may be empty, not both).
targetSnmpTargetyesThe agent.

TableColumnOut

A table column.

KeyTypeRequiredDescription
counterbooleanyesCounter column (rates make sense).
namestringyesDescriptor.
oidstringyesColumn OID.
syntaxstringyesSyntax text.

TableOut

A conceptual table assembled from walk results.

KeyTypeRequiredDescription
columnsTableColumnOut[]yesColumns present, in OID order.
entrystringyesIF-MIB::ifEntry.
index_namesstring``[]yesINDEX objects.
rowsTableRowOut[]yesRows in instance order.
tablestring | nullIF-MIB::ifTable.

TableRowOut

A table row.

KeyTypeRequiredDescription
cells(string | null)[]yesReadable cells (one per column; null = absent).
indexstring``[]yesDecoded INDEX values (empty when not decodable).
instancestringyesInstance sub-identifiers.
numeric(integer | null)[]yesNumeric cells (integer types).

TemplateDetail

A template with its index entry and lint findings.

KeyTypeRequiredDescription
issuesobject``[]yesLint findings with localised message.
summaryTemplateSummaryyesIndex entry.
templateobjectyesThe template (JSON form of .wpg.yaml).

TemplateList

GET /api/templates response.

KeyTypeRequiredDescription
recentstring``[]yesRecently used template ids, most recent first.
templatesTemplateSummary[]yesMatching templates, sorted by name.

TemplateSource

Where a template comes from.

Type: "user" | "library"

TemplateSummary

Index entry of a template.

KeyTypeRequiredDescription
authorstring | nullAuthor.
descriptionstring | nullDescription in the requested language (meta.descriptions[lang], else meta.description, else meta.descriptions.en).
descriptionsmap<string, ``string``>All localised descriptions (language tag → text, e.g. ja, en).
errorstring | nullLoad error when the file does not parse.
favoritebooleanyesMarked as favourite.
idstringyesStable id (slug of the relative path).
last_usedinteger | nullLast use (open in the GUI, job start), Unix milliseconds.
modifiedinteger | nullFile modification time, Unix milliseconds.
namestringyesmeta.name (the file stem when the file does not parse).
pathstringyesPath relative to its root directory.
protocolsstring``[]yesProtocol stack, outermost first.
rootstringyesThe root directory.
sourceTemplateSourceyesLibrary or user template.
tagsstring``[]yesTags.
writablebooleanyesWhether it can be updated / deleted through the API.

TerminalClientMessage

Client → server message on /api/terminal/ws. Keystrokes may also arrive as binary frames (raw bytes).

type: "connect"

First message: opens the session.

KeyTypeRequiredDescription
type"connect"yes

type: "input"

Keystrokes / pasted text (UTF-8).

KeyTypeRequiredDescription
datastringyesThe text.
type"input"yes

type: "resize"

The terminal was resized.

KeyTypeRequiredDescription
colsintegeryesColumns.
rowsintegeryesRows.
type"resize"yes

type: "host_key"

Answer to a host_key prompt.

KeyTypeRequiredDescription
acceptbooleanyesTrust the key.
savebooleanStore it in the known hosts (otherwise trust it for this session).
type"host_key"yes

type: "auth_response"

Answers to an auth_prompt (one per prompt).

KeyTypeRequiredDescription
responsesstring``[]yesThe answers.
type"auth_response"yes

type: "record"

Starts / stops the session log.

KeyTypeRequiredDescription
enabledbooleanyesRecord from now on.
strip_ansiboolean | nullRemove escape sequences (default true).
type"record"yes

type: "disconnect"

Ends the session.

KeyTypeRequiredDescription
type"disconnect"yes

TerminalConnectRequest

connect: where to and how to log in.

KeyTypeRequiredDescription
colsintegerTerminal width.
hoststringyesHost name or address.
jumpJumpHost[]SSH jump hosts (ProxyJump), nearest first: the server logs in to each in turn and reaches the next one (and finally host) through a direct-tcpip channel. Works for SSH and Telnet targets.
passphrasestring | nullPassphrase of private_key.
passwordstring | nullSSH password (also answers a single keyboard-interactive password prompt).
portinteger | nullPort (default 22 / 23).
private_keystring | nullSSH private key (OpenSSH / PEM / PuTTY .ppk text).
protocolProtocolyesssh or telnet.
recordboolean | nullRecord a session log (default: terminal.record_sessions).
rowsintegerTerminal height.
strip_ansiboolean | nullRemove escape sequences from the log (default true).
usernamestring | nullSSH user name.

TerminalServerMessage

Server → client message on /api/terminal/ws. Remote output travels as binary frames.

type: "state"

Progress: resolving, connecting, authenticating; with jump hosts, jumping (opening the tunnel from host onwards) and the other phases carry the host they concern.

KeyTypeRequiredDescription
hoststring | nullThe host of this phase (sessions with jump hosts).
statestringyesThe phase.
type"state"yes

type: "host_key"

An unknown SSH host key: confirm the fingerprint (host_key message).

KeyTypeRequiredDescription
algorithmstringyesKey algorithm.
fingerprintstringyesSHA256:....
hoststringyesHost.
portintegeryesPort.
type"host_key"yes

type: "auth_prompt"

The server asks questions (keyboard-interactive, or the password when none was given): answer with auth_response.

KeyTypeRequiredDescription
hoststringyesThe host asking (the target or a jump host).
instructionsstringyesInstructions from the server.
namestringyesRequest name from the server.
promptsPromptItem[]yesThe prompts.
type"auth_prompt"yes

type: "connected"

The session is up.

KeyTypeRequiredDescription
addressstringyesAddress actually connected to.
fingerprintstring | nullSSH host key fingerprint.
hoststringyesHost.
portintegeryesPort.
protocolProtocolyesProtocol.
session_idstringyesSession id.
type"connected"yes
viastring``[]Jump hosts the session goes through (user@host:port).

type: "record"

Log state after connected / record.

KeyTypeRequiredDescription
enabledbooleanyesRecording.
filestring | nullThe log file (GET /api/terminal/logs/{name}).
type"record"yes

type: "error"

A failure; fatal ones are followed by closed.

KeyTypeRequiredDescription
codestringyestarget_not_allowed, too_many_sessions, resolve_failed, connect_failed, host_key_changed, host_key_rejected, auth_failed, key_invalid, ssh_error, timeout, bad_request, recording_disabled, log_failed.
detailstring | nullUntranslated detail (an OS / protocol error).
fatalbooleanyesThe session ends.
infoobject | nullhost_key_changed: {algorithm, fingerprint, known_algorithm, known_fingerprint}; a failure at a jump host adds {hop: "host:port"}.
type"error"yes

type: "closed"

The session ended.

KeyTypeRequiredDescription
bytes_inintegeryesBytes received from the host.
bytes_outintegeryesBytes sent to the host.
duration_secsintegeryesSession length in seconds.
reasonstringyesremote (the host closed it), client, idle, shutdown, error.
type"closed"yes

TerminalStatus

GET /api/terminal/status.

KeyTypeRequiredDescription
allowed_targetsstring``[]yesterminal.allowed_targets (empty = any target).
enabledbooleanyesterminal.enabled.
idle_timeout_secsintegeryesterminal.idle_timeout_secs.
max_sessionsintegeryesterminal.max_sessions.
record_sessionsbooleanyesterminal.record_sessions.
sessionsActiveSession[]yesRunning sessions (all users).

TokenInfo

An API token as listed (never the secret).

KeyTypeRequiredDescription
createdintegeryesCreation time (Unix seconds).
expiresinteger | nullExpiry (Unix seconds); null: never expires.
idintegeryesToken id (for revoking).
last_usedinteger | nullLast use (Unix seconds, updated at most once a minute).
namestringyesName given at creation.
prefixstringyesThe first characters of the secret (wpg_ + 8 hex digits), to recognise it.
userstringyesOwner: requests with the token act as this user, with its role.

TrapOut

A received notification.

KeyTypeRequiredDescription
acknowledgedbooleanyesAn inform that was acknowledged.
communitystring | nullCommunity (v1 / v2c).
errorstring | nullWhy the message was not accepted (wrong community, digest, …).
idintegeryesSequence number (increasing).
levelstring | nullv3 security level.
pdu_typestring | nulltrap_v1, trap_v2, inform (absent when undecodable).
received_msintegeryesArrival, milliseconds since the Unix epoch.
sourcestringyesSender address:port.
trap_namestring | nullThe trap OID’s name (IF-MIB::linkDown).
trap_oidstring | nullsnmpTrapOID.0 (dotted).
uptimeinteger | nullsysUpTime.0 / v1 time-stamp (hundredths of a second).
uptime_textstring | nullUptime as 1d 02:03:04.56.
userstring | nullUser (v3).
v1V1Out | null
varbindsVarBindOut[]yesBindings (without sysUpTime.0 / snmpTrapOID.0).
versionstringyesv1, v2c, v3.

TreeChildOut

A tree entry.

KeyTypeRequiredDescription
arcintegeryesLast sub-identifier.
has_childrenbooleanyesSomething is defined below.
kindstring | nullobject_type, object_identifier, notification_type, …
modulestring | nullModule.
namestring | nullDescriptor (absent for an undefined intermediate OID).
oidstringyesOID.
rolestring | nullTable / row / column / scalar for OBJECT-TYPEs.

UploadedFile

Result of one uploaded file.

KeyTypeRequiredDescription
errorsstring``[]yesProblems (no module found: the file was not stored).
filestringyesStored file name.
modulesstring``[]yesModules found in it.
storedbooleanyesWhether the file was stored.

UserInfo

user of [AuthStatus].

KeyTypeRequiredDescription
namestringyesUser name.
roleRoleyesadmin, operator or viewer.

V1Out

SNMPv1 trap header.

KeyTypeRequiredDescription
agent_addrstringyesagent-addr.
enterprisestringyesenterprise (name or dotted).
genericintegeryesgeneric-trap.
specificintegeryesspecific-trap.

V3In

SNMPv3 parameters. The level follows from the pass phrases given: none = noAuthNoPriv, auth_password = authNoPriv, both = authPriv.

KeyTypeRequiredDescription
auth_passwordstring | nullAuthentication pass phrase (at least 8 characters).
auth_protocolstring | nullMD5, SHA (SHA-1), SHA-224, SHA-256, SHA-384, SHA-512 (default SHA).
context_engine_idstring | nullcontextEngineID (hex; default: the agent’s engine id).
context_namestring | nullcontextName.
priv_passwordstring | nullPrivacy pass phrase (at least 8 characters).
priv_protocolstring | nullDES, AES (AES-128), AES-192, AES-256 (default AES).
userstringyesUser name.

VarBindIn

A variable binding to send (Set, notifications).

KeyTypeRequiredDescription
oidstringyesObject instance: name (sysName.0, IF-MIB::ifAdminStatus.2) or dotted OID.
typestring | nullauto (default: from the MIB), or i / integer, u / unsigned, c / counter32, C / counter64, t / timeticks, a / ipaddress, o / oid, s / string, x / hex, d / decimal, n / null, opaque.
valuestringValue text (enum labels such as down and object names are accepted).

VarBindOut

A rendered variable binding.

KeyTypeRequiredDescription
instancestringyesInstance sub-identifiers (3).
modulestring | nullDefining module.
namestringyesIF-MIB::ifDescr.3 (numeric when no MIB knows it).
numericinteger | nullNumeric value of integer types (rates, charts).
objectstring | nullObject descriptor (ifDescr).
oidstringyesOID (dotted decimal).
rawstringyesThe value without MIB knowledge.
syntaxstring | nullTextual convention of the object (DisplayString, InterfaceIndex).
typestringyesWire type (Counter32, OCTET STRING, noSuchInstance, …).
unitsstring | nullUNITS of the object.
valuestringyesReadable value (enum labels, display hints, units, names).

VersionInfo

GET /api/version response body.

KeyTypeRequiredDescription
api_versionintegeryesREST API version (bumped on incompatible changes).
archstringyesTarget CPU architecture.
featuresstring``[]yesOptional features compiled in (pcap, …).
localesstring``[]yesSupported UI / message languages.
osstringyesTarget OS.
versionstringyesServer version.