API リファレンス
wpg-server は /api 以下で REST (JSON) API を提供し、リアルタイム統計・ジョブの状態変化・ログを WebSocket (GET /api/ws) で配信します。このページはサーバの OpenAPI ドキュメント (utoipa) から自動生成しています。起動中のサーバは同じドキュメントを /api/openapi.json で、Swagger UI を /api/docs/ で提供し、写しを docs/schema/openapi.json に置いています。POST /api/auth/login (初回は POST /api/auth/setup) でログインすると、以降は wpg_session クッキーで認証されます。POST / PUT / DELETE では GET /api/auth/status の CSRF トークンを X-CSRF-Token ヘッダでも送ってください。エラーは JSON オブジェクト error で、code、message (Accept-Language の言語)、details を持ちます。以下のエンドポイントとスキーマの説明はコード由来 (英語) です。
エンドポイント
| タグ | エンドポイント | 概要 |
|---|---|---|
| auth | 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. |
| auth | POST /api/auth/logout | Logs out (needs X-CSRF-Token when the session is live) and clears the cookies. |
| auth | 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. |
| auth | GET /api/auth/status | Authentication state of the caller (never requires a session). |
| auth | GET /api/tokens | API tokens (admins: all; others: their own), oldest first. |
| auth | 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. |
| auth | DELETE /api/tokens/{id} | Revokes (deletes) a token; requests with it fail from now on. |
| system | GET /api/health | Liveness probe. |
| system | GET /api/system/backends | Transmit backends of this build. |
| system | GET /api/system/doctor | Self-diagnosis (wpg doctor --json), with localised summary / fix. |
| system | GET /api/system/ifaces | Network interfaces with usable (up, running, not loopback) and allowed (by tx.allowed_ifaces). |
| system | GET /api/version | Build information. |
| protocols | GET /api/protocols | The catalog in palette order. |
| protocols | 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. |
| protocols | 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. |
| protocols | 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. |
| 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 "". |
| packets | POST /api/parse | Decodes raw bytes into layers (Hex paste import). |
| packets | POST /api/render | Renders packets of a template (preview). |
| templates | GET /api/templates | Lists / searches templates. |
| templates | POST /api/templates | Creates a template in the user directory (file name from meta.name). |
| templates | POST /api/templates/import | Imports a .wpg.yaml (or JSON) document into the user directory. |
| templates | GET /api/templates/{id} | One template (also marks it as recently used). |
| templates | PUT /api/templates/{id} | Replaces a user template. |
| templates | DELETE /api/templates/{id} | Deletes a user template. |
| templates | POST /api/templates/{id}/duplicate | Copies a template (library or user) into the user directory. |
| templates | GET /api/templates/{id}/export | Downloads a template as .wpg.yaml (the file itself, comments included). |
| templates | POST /api/templates/{id}/favorite | Sets (or, without a body, toggles) the favourite flag. |
| jobs | GET /api/jobs | All live jobs (created, running and recently finished), newest first. |
| jobs | POST /api/jobs | Creates (and by default starts) a job. |
| jobs | GET /api/jobs/history | Finished jobs (last 100), newest first. |
| jobs | GET /api/jobs/{id} | One job (live or from the history). |
| jobs | DELETE /api/jobs/{id} | Removes a job (a running one is stopped first and recorded in the history). |
| jobs | POST /api/jobs/{id}/pause | Pauses a running job. |
| jobs | POST /api/jobs/{id}/resume | Resumes a paused job. |
| jobs | POST /api/jobs/{id}/start | Starts a job created with start: false. |
| jobs | GET /api/jobs/{id}/stats | Latest statistics snapshot of a job. |
| jobs | POST /api/jobs/{id}/stop | Stops a job (asynchronously; watch job_state or poll the job). |
| jobs | GET /api/stats/overview | Dashboard summary. |
| captures | GET /api/captures | All captures (running and the last finished ones), newest first. |
| captures | POST /api/captures | Starts a capture. |
| captures | GET /api/captures/backends | Receive backend availability on this build / OS. |
| captures | POST /api/captures/filter | Checks a capture filter without starting a capture. |
| captures | GET /api/captures/{id} | One capture. |
| captures | DELETE /api/captures/{id} | Removes a capture (a running one is stopped first; a saved pcapng file stays on disk). |
| captures | GET /api/captures/{id}/packets | The first N matching frames of a capture (live while it runs). |
| captures | GET /api/captures/{id}/pcapng | The pcapng file of a finished capture started with save. |
| captures | POST /api/captures/{id}/stop | Stops a running capture (asynchronously; watch capture_state). |
| events | GET /api/ws | WebSocket upgrade. |
| terminal | GET /api/terminal/known-hosts | Trusted SSH host keys (<data_dir>/terminal/known_hosts). |
| terminal | DELETE /api/terminal/known-hosts/{host}/{port} | Forgets the host key(s) of host:port (after a legitimate key change). |
| terminal | GET /api/terminal/logs | Session logs, newest first. |
| terminal | GET /api/terminal/logs/{name} | Downloads a session log (text/plain, also while it is being written). |
| terminal | DELETE /api/terminal/logs/{name} | Deletes a session log (not one that is being written). |
| terminal | GET /api/terminal/status | Configuration and running sessions (also when the terminal is disabled, so the UI can explain how to enable it). |
| terminal | 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. |
| snmp | GET /api/snmp/capture | Recording state. |
| snmp | POST /api/snmp/capture | Starts / stops the recording of every SNMP datagram this server sends or receives (requests, responses, traps), or clears it. |
| snmp | GET /api/snmp/capture/download | The recorded frames as a pcap / pcapng file (Ethernet / IP / UDP synthesised around the real datagrams; placeholder MAC addresses). |
| snmp | POST /api/snmp/get | GetRequest. |
| snmp | POST /api/snmp/getbulk | GetBulkRequest (v2c / v3). |
| snmp | POST /api/snmp/getnext | GetNextRequest. |
| snmp | POST /api/snmp/inform | Sends an InformRequest (v2c / v3) and waits for the acknowledgement. |
| snmp | GET /api/snmp/mibs | Loaded MIB modules with their load state. |
| snmp | POST /api/snmp/mibs | Uploads MIB files (stored under <data_dir>/mibs, loaded at once). |
| snmp | GET /api/snmp/mibs/node | Details of a MIB node (longest-prefix match for instances). |
| snmp | GET /api/snmp/mibs/search | Finds MIB objects by name (for OID autocompletion). |
| snmp | GET /api/snmp/mibs/tree | One level of the MIB tree. |
| snmp | DELETE /api/snmp/mibs/{module} | Deletes an uploaded module (its whole file). Bundled modules cannot be deleted. |
| snmp | GET /api/snmp/receiver | Receiver state. |
| snmp | POST /api/snmp/receiver/start | Starts (or restarts) the trap / inform receiver. |
| snmp | POST /api/snmp/receiver/stop | Stops the receiver. |
| snmp | POST /api/snmp/set | SetRequest. |
| snmp | GET /api/snmp/status | Whether the SNMP tool is enabled, with MIB / receiver / recording summaries. |
| snmp | 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. |
| snmp | GET /api/snmp/traps | Received notifications, newest first (also pushed as snmp_trap events on the WebSocket). |
| snmp | DELETE /api/snmp/traps | Forgets the received notifications. |
| snmp | 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. |
| dhcp | GET /api/dhcp | State, settings and counters. |
| dhcp | PUT /api/dhcp | Saves the settings; a running server restarts with them. |
| dhcp | GET /api/dhcp/activity | Recent requests and replies, newest first (wpg_dhcp::Activity). |
| dhcp | DELETE /api/dhcp/activity | Clears the activity log. |
| dhcp | GET /api/dhcp/leases | Leases (wpg_dhcp::Lease: kind v4 / na / pd, addr, plen, client, iaid, mac, hostname, state, expires, updated). |
| dhcp | DELETE /api/dhcp/leases | Deletes one lease (key) or all of them. The client keeps using the address until it renews. |
| dhcp | POST /api/dhcp/start | Starts (or restarts) the server; it also starts at boot until stopped. |
| dhcp | POST /api/dhcp/stop | Stops the server (and its start at boot). |
auth
ログイン、ログアウト、初回セットアップ。
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.
リクエスト本文: application/json LoginRequest
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
204 | Logged in; Set-Cookie: wpg_session, wpg_csrf | |
401 | unauthorized / setup_required | application/json ErrorBody |
415 | Not JSON | application/json ErrorBody |
429 | rate_limited: details.retry_after_secs, Retry-After | application/json ErrorBody |
POST /api/auth/logout
Logs out (needs X-CSRF-Token when the session is live) and clears the cookies.
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
204 | Logged out | |
403 | csrf_failed | application/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.
リクエスト本文: application/json SetupRequest
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
204 | Password set; Set-Cookie: wpg_session, wpg_csrf | |
400 | Passwords differ / too short | application/json ErrorBody |
403 | forbidden: remote client | application/json ErrorBody |
409 | already_configured | application/json ErrorBody |
415 | Not JSON | application/json ErrorBody |
GET /api/auth/status
Authentication state of the caller (never requires a session).
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | State | application/json AuthStatus |
GET /api/tokens
API tokens (admins: all; others: their own), oldest first.
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Tokens (without secrets) | application/json TokenInfo[] |
403 | forbidden: bearer requests cannot manage tokens | application/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.
リクエスト本文: application/json CreateToken
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
201 | Created | application/json CreatedToken |
400 | Invalid name or expiry | application/json ErrorBody |
403 | forbidden: bearer requests cannot manage tokens | application/json ErrorBody |
DELETE /api/tokens/{id}
Revokes (deletes) a token; requests with it fail from now on.
パラメータ
| 名前 | 位置 | 型 | 必須 | 説明 |
|---|---|---|---|---|
id | path | integer | はい | Token id |
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
204 | Revoked | |
403 | forbidden: bearer requests cannot manage tokens | application/json ErrorBody |
404 | Unknown id | application/json ErrorBody |
system
ヘルスチェック、バージョン、インタフェース、自己診断、送出バックエンド。
GET /api/health
Liveness probe.
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | The server is up | application/json Health |
GET /api/system/backends
Transmit backends of this build.
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Backends | application/json Backends |
GET /api/system/doctor
Self-diagnosis (wpg doctor --json), with localised summary / fix.
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
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).
パラメータ
| 名前 | 位置 | 型 | 必須 | 説明 |
|---|---|---|---|---|
refresh | query | boolean | Re-read the interfaces instead of using the few-seconds cache. |
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Interfaces (wpg ifaces --json plus usable / allowed) | application/json object``[] |
500 | Enumeration failed | application/json ErrorBody |
GET /api/version
Build information.
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Version and build info | application/json VersionInfo |
protocols
プロトコルカタログ (プロトコルリファレンス参照)。
GET /api/protocols
The catalog in palette order.
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Catalog summary | application/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.
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Extension 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.
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Loaded files | application/json ReloadResult |
403 | forbidden: not an admin | application/json ErrorBody |
422 | invalid_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.
パラメータ
| 名前 | 位置 | 型 | 必須 | 説明 |
|---|---|---|---|---|
id | path | string | はい | Protocol id |
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Protocol definition IR | application/json object |
404 | Unknown protocol | application/json ErrorBody |
packets
パケットの合成、デコード、lint。
POST /api/lint
Checks a template (wpg template lint). A template that does not even parse is reported as a single error at path "".
リクエスト本文: application/json LintRequest
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Lint result | application/json LintResponse |
400 | Bad request | application/json ErrorBody |
POST /api/parse
Decodes raw bytes into layers (Hex paste import).
リクエスト本文: application/json ParseRequest
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Decoded packet | application/json ParseResponse |
400 | Invalid hex | application/json ErrorBody |
422 | Cannot be decoded | application/json ErrorBody |
POST /api/render
Renders packets of a template (preview).
リクエスト本文: application/json RenderRequest
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Rendered packets | application/json RenderResponse |
400 | Bad request | application/json ErrorBody |
422 | Invalid template (details: lint issues) | application/json ErrorBody |
templates
テンプレートライブラリ。
GET /api/templates
Lists / searches templates.
パラメータ
| 名前 | 位置 | 型 | 必須 | 説明 |
|---|---|---|---|---|
q | query | string | Case-insensitive search in id, name, descriptions, tags and protocols. | |
tag | query | string | Required tag(s), comma separated. | |
favorite | query | boolean | Only favourites (true) / non-favourites (false). | |
source | query | TemplateSource | Only user or library templates. |
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Templates | application/json TemplateList |
POST /api/templates
Creates a template in the user directory (file name from meta.name).
リクエスト本文: application/json object — Template (JSON form of .wpg.yaml)
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
201 | Created | application/json TemplateDetail |
422 | Invalid template | application/json ErrorBody |
POST /api/templates/import
Imports a .wpg.yaml (or JSON) document into the user directory.
リクエスト本文: text/yaml string — Template YAML
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
201 | Imported | application/json TemplateDetail |
422 | Invalid template | application/json ErrorBody |
GET /api/templates/{id}
One template (also marks it as recently used).
パラメータ
| 名前 | 位置 | 型 | 必須 | 説明 |
|---|---|---|---|---|
id | path | string | はい | Template id |
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Template | application/json TemplateDetail |
404 | Unknown id | application/json ErrorBody |
422 | The file does not parse | application/json ErrorBody |
PUT /api/templates/{id}
Replaces a user template.
パラメータ
| 名前 | 位置 | 型 | 必須 | 説明 |
|---|---|---|---|---|
id | path | string | はい | Template id |
リクエスト本文: application/json object — Template (JSON form of .wpg.yaml)
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Updated | application/json TemplateDetail |
403 | Read-only library template | application/json ErrorBody |
404 | Unknown id | application/json ErrorBody |
422 | Invalid template | application/json ErrorBody |
DELETE /api/templates/{id}
Deletes a user template.
パラメータ
| 名前 | 位置 | 型 | 必須 | 説明 |
|---|---|---|---|---|
id | path | string | はい | Template id |
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
204 | Deleted | |
403 | Read-only library template | application/json ErrorBody |
404 | Unknown id | application/json ErrorBody |
POST /api/templates/{id}/duplicate
Copies a template (library or user) into the user directory.
パラメータ
| 名前 | 位置 | 型 | 必須 | 説明 |
|---|---|---|---|---|
id | path | string | はい | Template id |
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
201 | The copy | application/json TemplateDetail |
404 | Unknown id | application/json ErrorBody |
GET /api/templates/{id}/export
Downloads a template as .wpg.yaml (the file itself, comments included).
パラメータ
| 名前 | 位置 | 型 | 必須 | 説明 |
|---|---|---|---|---|
id | path | string | はい | Template id |
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | YAML | text/yaml string |
404 | Unknown id | application/json ErrorBody |
POST /api/templates/{id}/favorite
Sets (or, without a body, toggles) the favourite flag.
パラメータ
| 名前 | 位置 | 型 | 必須 | 説明 |
|---|---|---|---|---|
id | path | string | はい | Template id |
リクエスト本文: application/json Favorite | null — {"favorite": bool}; empty or null = toggle
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | New state | application/json FavoriteState |
404 | Unknown id | application/json ErrorBody |
jobs
送出ジョブと統計。
GET /api/jobs
All live jobs (created, running and recently finished), newest first.
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Jobs | application/json JobInfo[] |
POST /api/jobs
Creates (and by default starts) a job.
リクエスト本文: application/json CreateJob
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
201 | Created | application/json JobInfo |
400 | Invalid job | application/json ErrorBody |
403 | policy_violation: interface or rate not allowed | application/json ErrorBody |
404 | Unknown template id | application/json ErrorBody |
422 | Invalid template | application/json ErrorBody |
502 | backend_error: the backend could not be opened | application/json ErrorBody |
GET /api/jobs/history
Finished jobs (last 100), newest first.
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Finished jobs | application/json JobInfo[] |
GET /api/jobs/{id}
One job (live or from the history).
パラメータ
| 名前 | 位置 | 型 | 必須 | 説明 |
|---|---|---|---|---|
id | path | string | はい | Job id |
レスポンス
DELETE /api/jobs/{id}
Removes a job (a running one is stopped first and recorded in the history).
パラメータ
| 名前 | 位置 | 型 | 必須 | 説明 |
|---|---|---|---|---|
id | path | string | はい | Job id |
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
204 | Deleted | |
404 | Unknown id | application/json ErrorBody |
POST /api/jobs/{id}/pause
Pauses a running job.
パラメータ
| 名前 | 位置 | 型 | 必須 | 説明 |
|---|---|---|---|---|
id | path | string | はい | Job id |
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Pausing | application/json JobInfo |
404 | Unknown id | application/json ErrorBody |
409 | Not running | application/json ErrorBody |
POST /api/jobs/{id}/resume
Resumes a paused job.
パラメータ
| 名前 | 位置 | 型 | 必須 | 説明 |
|---|---|---|---|---|
id | path | string | はい | Job id |
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Resuming | application/json JobInfo |
404 | Unknown id | application/json ErrorBody |
409 | Not running | application/json ErrorBody |
POST /api/jobs/{id}/start
Starts a job created with start: false.
パラメータ
| 名前 | 位置 | 型 | 必須 | 説明 |
|---|---|---|---|---|
id | path | string | はい | Job id |
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Started | application/json JobInfo |
404 | Unknown id | application/json ErrorBody |
409 | Not in state created | application/json ErrorBody |
502 | Backend error | application/json ErrorBody |
GET /api/jobs/{id}/stats
Latest statistics snapshot of a job.
パラメータ
| 名前 | 位置 | 型 | 必須 | 説明 |
|---|---|---|---|---|
id | path | string | はい | Job id |
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | wpg_tx::job::StatsSnapshot | application/json object |
404 | Unknown id | application/json ErrorBody |
409 | Never started | application/json ErrorBody |
POST /api/jobs/{id}/stop
Stops a job (asynchronously; watch job_state or poll the job).
パラメータ
| 名前 | 位置 | 型 | 必須 | 説明 |
|---|---|---|---|---|
id | path | string | はい | Job id |
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Stopping | application/json JobInfo |
404 | Unknown id | application/json ErrorBody |
409 | Already ended | application/json ErrorBody |
GET /api/stats/overview
Dashboard summary.
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Dashboard data | application/json Overview |
captures
Receive counters, captured frames and signature verification
GET /api/captures
All captures (running and the last finished ones), newest first.
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Captures | application/json CaptureInfo[] |
POST /api/captures
Starts a capture.
リクエスト本文: application/json CaptureSpec
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
201 | Started | application/json CaptureInfo |
400 | Invalid spec or filter | application/json ErrorBody |
404 | Unknown interface / input file | application/json ErrorBody |
502 | backend_error: the backend could not be opened | application/json ErrorBody |
GET /api/captures/backends
Receive backend availability on this build / OS.
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Backends (name, available, reason) | application/json object``[] |
POST /api/captures/filter
Checks a capture filter without starting a capture.
リクエスト本文: application/json FilterCheck
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Result | application/json FilterCheckResult |
GET /api/captures/{id}
One capture.
パラメータ
| 名前 | 位置 | 型 | 必須 | 説明 |
|---|---|---|---|---|
id | path | string | はい | Capture id |
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Capture | application/json CaptureInfo |
404 | Unknown id | application/json ErrorBody |
DELETE /api/captures/{id}
Removes a capture (a running one is stopped first; a saved pcapng file stays on disk).
パラメータ
| 名前 | 位置 | 型 | 必須 | 説明 |
|---|---|---|---|---|
id | path | string | はい | Capture id |
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
204 | Deleted | |
404 | Unknown id | application/json ErrorBody |
GET /api/captures/{id}/packets
The first N matching frames of a capture (live while it runs).
パラメータ
| 名前 | 位置 | 型 | 必須 | 説明 |
|---|---|---|---|---|
id | path | string | はい | Capture id |
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Kept frames | application/json CapturedFrame[] |
404 | Unknown id | application/json ErrorBody |
GET /api/captures/{id}/pcapng
The pcapng file of a finished capture started with save.
パラメータ
| 名前 | 位置 | 型 | 必須 | 説明 |
|---|---|---|---|---|
id | path | string | はい | Capture id |
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | pcapng file | application/octet-stream |
404 | Unknown id or nothing saved | application/json ErrorBody |
409 | Still running | application/json ErrorBody |
POST /api/captures/{id}/stop
Stops a running capture (asynchronously; watch capture_state).
パラメータ
| 名前 | 位置 | 型 | 必須 | 説明 |
|---|---|---|---|---|
id | path | string | はい | Capture id |
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Stopping | application/json CaptureInfo |
404 | Unknown id | application/json ErrorBody |
409 | Already ended | application/json ErrorBody |
events
WebSocket のイベント配信。
GET /api/ws
WebSocket upgrade.
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
101 | WebSocket: JSON ServerEvent messages | application/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).
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Host keys | application/json KnownHost[] |
DELETE /api/terminal/known-hosts/{host}/{port}
Forgets the host key(s) of host:port (after a legitimate key change).
パラメータ
| 名前 | 位置 | 型 | 必須 | 説明 |
|---|---|---|---|---|
host | path | string | はい | Host as stored |
port | path | integer | はい | Port |
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
204 | Removed | |
404 | No key stored | application/json ErrorBody |
GET /api/terminal/logs
Session logs, newest first.
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Logs | application/json LogInfo[] |
GET /api/terminal/logs/{name}
Downloads a session log (text/plain, also while it is being written).
パラメータ
| 名前 | 位置 | 型 | 必須 | 説明 |
|---|---|---|---|---|
name | path | string | はい | Log file name |
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | The log | text/plain |
404 | Unknown log | application/json ErrorBody |
DELETE /api/terminal/logs/{name}
Deletes a session log (not one that is being written).
パラメータ
| 名前 | 位置 | 型 | 必須 | 説明 |
|---|---|---|---|---|
name | path | string | はい | Log file name |
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
204 | Deleted | |
404 | Unknown log | application/json ErrorBody |
409 | invalid_state: the session is still recording | application/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).
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Terminal status | application/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.
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
101 | WebSocket: TerminalServerMessage JSON + binary output | application/json TerminalServerMessage |
403 | terminal_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.
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | State | application/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.
リクエスト本文: application/json CaptureControl
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | State | application/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).
パラメータ
| 名前 | 位置 | 型 | 必須 | 説明 |
|---|---|---|---|---|
format | path | string | null | はい | pcap (default) or pcapng. |
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | pcap / pcapng file | application/octet-stream |
400 | Unknown format | application/json ErrorBody |
POST /api/snmp/get
GetRequest.
リクエスト本文: application/json SnmpOidsRequest
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Response (check error_status) | application/json SnmpResult |
400 | Bad target / OID / v3 settings | application/json ErrorBody |
502 | snmp_error: Report PDU, authentication or decoding failure | application/json ErrorBody |
504 | snmp_error: no response | application/json ErrorBody |
POST /api/snmp/getbulk
GetBulkRequest (v2c / v3).
リクエスト本文: application/json SnmpBulkRequest
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Response | application/json SnmpResult |
400 | Bad request (also: GetBulk on v1) | application/json ErrorBody |
502 | snmp_error | application/json ErrorBody |
504 | snmp_error: no response | application/json ErrorBody |
POST /api/snmp/getnext
GetNextRequest.
リクエスト本文: application/json SnmpOidsRequest
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Response | application/json SnmpResult |
400 | Bad request | application/json ErrorBody |
502 | snmp_error | application/json ErrorBody |
504 | snmp_error: no response | application/json ErrorBody |
POST /api/snmp/inform
Sends an InformRequest (v2c / v3) and waits for the acknowledgement.
リクエスト本文: application/json SnmpNotifyRequest
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Acknowledged (the Response’s bindings) | application/json SnmpResult |
400 | Bad request (also: inform on v1) | application/json ErrorBody |
502 | snmp_error | application/json ErrorBody |
504 | snmp_error: not acknowledged | application/json ErrorBody |
GET /api/snmp/mibs
Loaded MIB modules with their load state.
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Modules | application/json MibModuleOut[] |
POST /api/snmp/mibs
Uploads MIB files (stored under <data_dir>/mibs, loaded at once).
リクエスト本文: application/json MibUpload
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Per-file result and module state | application/json MibUploadResult |
400 | Bad file name / too large | application/json ErrorBody |
GET /api/snmp/mibs/node
Details of a MIB node (longest-prefix match for instances).
パラメータ
| 名前 | 位置 | 型 | 必須 | 説明 |
|---|---|---|---|---|
id | path | string | はい | Name (ifOperStatus, IF-MIB::ifOperStatus, ifOperStatus.3) or dotted OID. |
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Node | application/json NodeOut |
400 | Unparsable id | application/json ErrorBody |
404 | No MIB defines it | application/json ErrorBody |
GET /api/snmp/mibs/search
Finds MIB objects by name (for OID autocompletion).
パラメータ
| 名前 | 位置 | 型 | 必須 | 説明 |
|---|---|---|---|---|
q | path | string | はい | Part of a descriptor (ifOper, IF-MIB::ifH). |
limit | path | integer | null | はい | Most hits (default 20, at most 200). |
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Hits, prefix matches first | application/json SearchHit[] |
GET /api/snmp/mibs/tree
One level of the MIB tree.
パラメータ
| 名前 | 位置 | 型 | 必須 | 説明 |
|---|---|---|---|---|
oid | path | string | null | はい | Parent (name or dotted OID; empty = the roots). |
module | path | string | null | はい | Only the branches leading to definitions of this module; without oid, the module’s top nodes. |
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Children | application/json TreeChildOut[] |
400 | Unknown name or module | application/json ErrorBody |
DELETE /api/snmp/mibs/{module}
Deletes an uploaded module (its whole file). Bundled modules cannot be deleted.
パラメータ
| 名前 | 位置 | 型 | 必須 | 説明 |
|---|---|---|---|---|
module | path | string | はい | Module name |
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Deleted | application/json MibDeleted |
404 | Unknown module | application/json ErrorBody |
409 | read_only: bundled module | application/json ErrorBody |
GET /api/snmp/receiver
Receiver state.
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | State | application/json ReceiverStatus |
POST /api/snmp/receiver/start
Starts (or restarts) the trap / inform receiver.
リクエスト本文: application/json ReceiverStart
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Listening | application/json ReceiverStatus |
400 | Bad address / users | application/json ErrorBody |
502 | backend_error: cannot bind (privileged port, in use) | application/json ErrorBody |
POST /api/snmp/receiver/stop
Stops the receiver.
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Stopped | application/json ReceiverStatus |
POST /api/snmp/set
SetRequest.
リクエスト本文: application/json SnmpSetRequest
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Response (check error_status: notWritable, wrongType, …) | application/json SnmpResult |
400 | Bad target / OID / value | application/json ErrorBody |
502 | snmp_error | application/json ErrorBody |
504 | snmp_error: no response | application/json ErrorBody |
GET /api/snmp/status
Whether the SNMP tool is enabled, with MIB / receiver / recording summaries.
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Status | application/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.
リクエスト本文: application/json SnmpNotifyRequest
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Sent | application/json SnmpResult |
400 | Bad request | application/json ErrorBody |
GET /api/snmp/traps
Received notifications, newest first (also pushed as snmp_trap events on the WebSocket).
パラメータ
| 名前 | 位置 | 型 | 必須 | 説明 |
|---|---|---|---|---|
limit | path | integer | null | はい | Most notifications (default 200, at most 1000). |
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Notifications | application/json TrapOut[] |
DELETE /api/snmp/traps
Forgets the received notifications.
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
204 | Cleared |
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.
リクエスト本文: application/json SnmpWalkRequest
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Bindings and tables | application/json SnmpResult |
400 | Bad request | application/json ErrorBody |
502 | snmp_error | application/json ErrorBody |
504 | snmp_error: no response | application/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.
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | State | application/json DhcpStatus |
404 | dhcp.enabled = false | application/json ErrorBody |
PUT /api/dhcp
Saves the settings; a running server restarts with them.
リクエスト本文: application/json DhcpUpdate
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Saved | application/json DhcpStatus |
400 | Invalid settings (details: [{ field, message }]) | application/json ErrorBody |
403 | policy_violation: interface not in tx.allowed_ifaces | application/json ErrorBody |
502 | backend_error: the restart failed | application/json ErrorBody |
GET /api/dhcp/activity
Recent requests and replies, newest first (wpg_dhcp::Activity).
パラメータ
| 名前 | 位置 | 型 | 必須 | 説明 |
|---|---|---|---|---|
limit | path | integer | null | はい | Most entries returned (newest first; default 200). |
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Activity | application/json object``[] |
DELETE /api/dhcp/activity
Clears the activity log.
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
204 | Cleared |
GET /api/dhcp/leases
Leases (wpg_dhcp::Lease: kind v4 / na / pd, addr, plen, client, iaid, mac, hostname, state, expires, updated).
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Leases | application/json object``[] |
DELETE /api/dhcp/leases
Deletes one lease (key) or all of them. The client keeps using the address until it renews.
パラメータ
| 名前 | 位置 | 型 | 必須 | 説明 |
|---|---|---|---|---|
key | path | string | null | はい | The lease (192.168.100.10, 2001:db8::10, 2001:db8:100::/56); absent: every lease. |
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
204 | Deleted | |
404 | No such lease | application/json ErrorBody |
POST /api/dhcp/start
Starts (or restarts) the server; it also starts at boot until stopped.
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Running | application/json DhcpStatus |
400 | No / unknown interface, invalid settings | application/json ErrorBody |
502 | backend_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).
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
200 | Stopped | application/json DhcpStatus |
スキーマ
上記で参照しているリクエスト・レスポンス本文の型です。
ActiveSession
A running session (GET /api/terminal/status).
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
host | string | はい | Target host as entered. |
id | string | はい | Session id. |
log | string | null | Log file being written, if recording. | |
port | integer | はい | Target port. |
protocol | Protocol | はい | Protocol. |
started | integer | はい | Start (Unix seconds). |
user | string | はい | wpg user who opened it. |
via | string``[] | SSH jump hosts in order (user@host:port), empty for a direct session. |
AuthStatus
GET /api/auth/status.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
authenticated | boolean | はい | The request carries a valid session. |
configured | boolean | はい | A password exists (configured or set on the setup screen). |
csrf_token | string | null | CSRF token to send as X-CSRF-Token on POST / PUT / DELETE (also in the wpg_csrf cookie); null when not logged in. | |
setup_required | boolean | はい | No password yet: show the setup screen (POST /api/auth/setup). |
user | UserInfo | null |
BackendItem
One transmit backend.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
available | boolean | はい | Compiled in and supported on this OS (privileges not checked). |
multi_worker | boolean | はい | Several TX workers per job. |
name | string | はい | Name (null, pcapfile, afpacket, pcap, afxdp, dpdk). |
reason | string | null | Why it is unavailable / requirements. |
Backends
GET /api/system/backends response body.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
backends | BackendItem[] | はい | All backends. |
default | string | はい | Backend used when a job names none. |
CaptureControl
POST /api/snmp/capture body.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
clear | boolean | Discard the recorded frames first. | |
enabled | boolean | null | Start (true) / stop (false) recording. |
CaptureInfo
A capture as returned by the API.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
backend | string | はい | Resolved backend. |
filter | string | はい | Normalised filter text (empty = every frame). |
finished | integer | null | End time, Unix milliseconds. | |
id | string | はい | Capture id. |
iface | string | はい | Resolved interface (input path for pcapfile). |
name | string | はい | Display name (spec.name, else <backend>:<iface>). |
saved | boolean | はい | Whether a pcapng file was written (download with GET /api/captures/{id}/pcapng). |
spec | CaptureSpec | はい | The request. |
started | integer | はい | Start time, Unix milliseconds. |
stats | object | null | Latest statistics (wpg_rx::RxSnapshot). | |
status | object | はい | { "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).
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
backend | string | null | Backend: afpacket, pcap, pcapfile, null (default: afpacket on Linux, else pcap). | |
count | integer | null | Stop after this many matching frames. | |
duration | string | null | Stop after this long, e.g. 10s, 2m. | |
filter | string | null | tcpdump-style filter (udp port 5001 and wpg); empty = every frame. | |
iface | string | null | Interface (any = every interface with afpacket); for pcapfile the name of a capture file under <data_dir>/captures (e.g. a dry-run output). | |
include_outgoing | boolean | Also count frames this host transmits. | |
keep | integer | Matching frames kept for display (default 100, at most 10000). | |
name | string | null | Display name. | |
promisc | boolean | Promiscuous mode. | |
save | string | null | Save the matching frames as a pcapng file of this name under <data_dir>/captures. | |
verify | boolean | Check the signatures of matching frames (loss / order / latency). |
CaptureStatus
pcap recording state.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
dropped | integer | はい | Frames dropped because the buffer was full. |
enabled | boolean | はい | Recording. |
frames | integer | はい | Kept frames. |
CapturedFrame
One kept frame.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
hex | string | はい | Captured octets as lower-case hex (decode with POST /api/parse). |
index | integer | はい | Position among the matching frames (0-based). |
len | integer | はい | Original length. |
signature | object | null | The frame’s signature (stream_id, seq, ts_ns), if any. | |
ts_ns | integer | はい | Capture time, nanoseconds since the Unix epoch. |
ClientMessage
Client → server message.
type: "subscribe"
Selects the jobs whose stats / job_state events are sent.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
jobs | object | "all" or a list of job ids. | |
logs | boolean | null | Receive log events (default true). | |
type | "subscribe" | はい |
CreateJob
POST /api/jobs body: a [JobSpec] plus start.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
start | boolean | Start immediately (default true); false leaves it in state created. |
CreateToken
POST /api/tokens body.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
expires_in_days | integer | null | Expiry in days (1 to 3650); omitted or null: never expires. | |
name | string | はい | Name, to recognise the token later (1 to 100 characters). |
CreatedToken
POST /api/tokens response.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
secret | string | はい | The secret to send as Authorization: Bearer <secret>. Only this response contains it. |
token | TokenInfo | はい | The stored token. |
DhcpStatus
GET /api/dhcp.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
added_addresses | string``[] | Addresses this server put on the interface (removed when it stops). | |
enabled | boolean | はい | dhcp.enabled. |
error | string | null | Why the last start (at boot) failed. | |
iface | string | はい | Interface used (pinned or chosen; empty: none chosen yet). |
leases | integer | はい | Leases in the table. |
pinned_iface | string | null | dhcp.iface (fixed at deploy time); the screen cannot change it. | |
running | boolean | はい | Answering. |
server_duid | string | null | DHCPv6 server DUID in use. | |
server_ip | string | null | DHCPv4 server identifier in use. | |
settings | object | はい | Pools and options (wpg_dhcp::Settings). |
started_ms | integer | null | Start time (milliseconds since the Unix epoch). | |
stats | object | はい | Packet counters of the running server. |
supported | boolean | はい | Built for Linux (elsewhere the server cannot start). |
DhcpUpdate
PUT /api/dhcp body.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
iface | string | null | Interface to answer on (ignored when dhcp.iface pins one; must be allowed by tx.allowed_ifaces). | |
settings | object | はい | Pools and options (wpg_dhcp::Settings: v4, v6). |
EndReason
Why a job ended normally (mirrors wpg_tx::job::FinishReason).
型: "count_reached" | "duration_elapsed" | "source_exhausted" | "stopped"
ErrorBody
{ "error": ... } body (OpenAPI schema of every error response).
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
error | ErrorInfo | はい | The error. |
ErrorInfo
Error object.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
code | string | はい | Stable 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. |
details | any | Extra data, e.g. the lint issues of an invalid template. | |
message | string | はい | Human readable message in the language of Accept-Language. |
ExtensionFile
One loaded extension file.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
bindings | integer | はい | Number of its bind entries. |
protocols | string``[] | はい | Ids of the protocols it defines. |
source | string | はい | The file. |
Favorite
Body of POST /api/templates/{id}/favorite (empty body = toggle).
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
favorite | boolean | はい | New value. |
FavoriteState
POST /api/templates/{id}/favorite response.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
favorite | boolean | はい | Current value. |
id | string | はい | Template id. |
FilterCheck
POST /api/captures/filter request.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
filter | string | はい | Filter text. |
FilterCheckResult
POST /api/captures/filter response.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
error | string | null | What is wrong (when invalid). | |
normalized | string | null | Normalised filter text (when valid). | |
ok | boolean | はい | The filter is valid. |
pos | integer | null | Byte offset of the error (when invalid). |
Health
GET /api/health response body.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
locale | string | はい | Negotiated locale. |
message | string | はい | Localised human-readable status. |
status | string | はい | Always "ok" when the server answers. |
uptime_secs | integer | はい | Seconds since the server started. |
version | string | はい | Server version. |
IfaceBrief
An interface on the dashboard.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
allowed | boolean | はい | Allowed by the transmit policy. |
loopback | boolean | はい | Loopback. |
name | string | はい | Name. |
running | boolean | はい | Carrier / running. |
speed_mbps | integer | null | Link speed. | |
up | boolean | はい | Administratively up. |
JobBrief
A running job on the dashboard.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
backend | string | はい | Backend. |
bps | number | はい | L2 bits per second. |
id | string | はい | Job id. |
iface | string | はい | Interface. |
name | string | はい | Name. |
packets | integer | はい | Packets sent. |
pps | number | はい | Packets per second. |
status | JobStatus | はい | State. |
JobInfo
A job as returned by the API (also the persisted history record).
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
backend | string | はい | Resolved backend. |
created | integer | はい | Creation time, Unix milliseconds. |
finished | integer | null | End time, Unix milliseconds. | |
id | string | はい | Job id. |
iface | string | はい | Resolved interface (output path for pcapfile). |
name | string | はい | Display name (spec.name, else the first template’s name). |
plans | object``[] | はい | Expansion plan of each stream. |
rate | string | はい | Resolved rate. |
report | object | null | Final report (after the job ended). | |
spec | JobSpec | はい | The request. |
started | integer | null | Start time, Unix milliseconds. | |
stats | object | null | Latest statistics. | |
status | JobStatus | はい | Current state. |
workers | integer | はい | TX workers. |
JobSpec
What to send, where and how (all fields but streams are optional).
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
backend | string | null | Backend: null, pcapfile, afpacket, pcap, … (default: tx.default_backend). | |
batch | integer | null | Frames per send_batch call. | |
burst | integer | null | Frames per rate-control grant. | |
count | integer | null | Total packets (default: the template’s tx.count for a single stream). | |
dry_run | string | null | Dry run: write a pcapng file of this name under <data_dir>/captures instead of sending (forces the pcapfile backend). | |
duration | string | null | Duration limit, e.g. 10s, 2m. | |
iface | string | null | Interface (not needed for null; the output file name for pcapfile). | |
mix | Mix | Interleaving of several streams. | |
name | string | null | Display name. | |
pin_cores | integer``[] | Core per worker (Linux). | |
plan | string | null | Expansion strategy: auto, prerender, onthefly. | |
ramp_up | string | null | Linear rate ramp-up time, e.g. 5s. | |
rate | string | null | Rate: 1000pps, 1Mpps, 10Gbps, 50%, ifg=10us, unlimited (default: the first template’s tx.rate, then tx.max_rate, else unlimited). | |
signature | boolean | Stamp 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_at | string | null | Scheduled start: RFC 3339 or +10s. | |
stream_id | integer | null | Signature stream id of the first stream (stream i gets stream_id + i; default 0). | |
streams | JobStream[] | Streams (at least one). Several streams are mixed into one TX worker. | |
workers | integer | null | TX 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.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
state | "created" | はい |
state: "scheduled"
Waiting for start_at.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
state | "scheduled" | はい |
state: "running"
Sending.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
state | "running" | はい |
state: "paused"
Paused.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
state | "paused" | はい |
state: "finished"
Ended normally (count_reached, duration_elapsed, source_exhausted,
stopped).
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
detail | EndReason | はい | Ended normally (count_reached, duration_elapsed, source_exhausted, stopped). |
state | "finished" | はい |
state: "failed"
Ended with an error.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
detail | string | はい | Ended with an error. |
state | "failed" | はい |
JobStream
One stream of a job: a stored template (template_id) or an inline one.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
template | object | null | Inline template (takes precedence over template_id). | |
template_id | string | null | Id of a stored template. | |
vars | map<string, ``string``> | Template variable values (name → human notation). | |
weight | integer | Weight for mix: weighted (0 counts as 1). |
JobTotals
Dashboard aggregate of the running jobs.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
active | integer | はい | Jobs that are scheduled, running or paused. |
bps | number | はい | Sum of the jobs’ L2 bits per second. |
l1_bps | number | はい | Sum of the jobs’ L1 bits per second. |
pps | number | はい | Sum of the jobs’ packets per second. |
running | integer | はい | Jobs currently sending. |
JumpHost
One SSH jump host of a [ConnectRequest].
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
host | string | はい | Host name or address (resolved by the previous hop, or by the server for the first one). |
passphrase | string | null | Passphrase of private_key. | |
password | string | null | Password (also answers a single keyboard-interactive password prompt); empty: the server’s prompts are shown. | |
port | integer | null | SSH port (default 22). | |
private_key | string | null | Private key (OpenSSH / PEM / PuTTY .ppk text). | |
username | string | はい | User name on the jump host. |
KnownHost
A stored host key (GET /api/terminal/known-hosts).
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
algorithm | string | はい | Key algorithm (ssh-ed25519, rsa-sha2-512, …). |
comment | string | はい | The entry’s comment (who accepted it and when). |
fingerprint | string | はい | SHA256:... fingerprint. |
host | string | はい | Host as typed by the user who accepted the key (lower case). |
port | integer | はい | TCP port. |
LintRequest
POST /api/lint request.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
template | object | はい | Template: object or YAML text. |
LintResponse
POST /api/lint response.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
errors | integer | はい | Number of errors. |
issues | object``[] | はい | Findings (level, path, key, args, localised message). |
ok | boolean | はい | No errors (warnings allowed). |
warnings | integer | はい | Number of warnings. |
LogInfo
A past or running session log (GET /api/terminal/logs).
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
active | boolean | はい | Still being written by a live session. |
modified | integer | はい | Last modification (Unix seconds). |
name | string | はい | File name (the id in /api/terminal/logs/{name}). |
size | integer | はい | Size in bytes. |
LoginRequest
POST /api/auth/login body.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
password | string | はい | Password. |
username | string | null | User name (default admin). |
MibDeleted
Removed modules.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
removed | string``[] | はい | Modules removed with the file. |
MibFileIn
One file of an upload.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
content | string | はい | File content (text). |
name | string | はい | File name (CISCO-SMI.my; .mib, .txt, .my, .smi, .asn, .asn1 or none). |
MibModuleOut
A loaded MIB module.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
bundled | boolean | はい | Bundled with wpg (cannot be deleted). |
errors | string``[] | はい | Problems: parse warnings, unresolved definitions. |
file | string | null | Uploaded file it came from. | |
missing_imports | string``[] | はい | Modules named in IMPORTS that are not loaded (upload them). |
name | string | はい | Module name. |
nodes | integer | はい | Resolved definitions. |
status | string | はい | ok, partial (loaded with problems) or error. |
MibUpload
POST /api/snmp/mibs body.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
files | MibFileIn[] | はい | Files. |
MibUploadResult
POST /api/snmp/mibs result.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
files | UploadedFile[] | はい | Per file. |
modules | MibModuleOut[] | はい | The state of the uploaded modules after loading (missing imports are named here). |
Mix
How several streams are interleaved.
型: "weighted" | "sequential" | "round_robin"
NamedNumber
An enumeration value / BITS position.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
label | string | はい | Label. |
value | integer | はい | Number. |
NodeOut
MIB node details.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
access | string | null | MAX-ACCESS. | |
augments | string | null | AUGMENTS. | |
base_type | string | null | Base type. | |
defval | string | null | DEFVAL. | |
description | string | null | DESCRIPTION. | |
display_hint | string | null | DISPLAY-HINT. | |
enums | NamedNumber[] | はい | Enumeration / BITS names. |
index | string``[] | はい | INDEX (of a row; AUGMENTS followed). |
instance | string | はい | Instance part of the requested id (3 of ifDescr.3). |
kind | string | はい | object_type, object_identifier, … |
module | string | はい | Module. |
name | string | はい | Descriptor. |
objects | string``[] | はい | OBJECTS / VARIABLES (notifications). |
oid | string | はい | OID of the definition. |
path | PathElem[] | はい | Path from the root. |
reference | string | null | REFERENCE. | |
role | string | null | Table / row / column / scalar. | |
status | string | null | STATUS. | |
syntax | string | null | SYNTAX text. | |
type_name | string | null | Textual convention. | |
units | string | null | UNITS. |
Overview
GET /api/stats/overview response.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
history | integer | はい | Jobs in the history. |
ifaces | IfaceBrief[] | はい | Interfaces. |
jobs | JobBrief[] | はい | Active jobs. |
templates | integer | はい | Templates in the library. |
totals | JobTotals | はい | Totals over the active jobs. |
uptime_secs | integer | はい | Seconds since the server started. |
ParseRequest
POST /api/parse request.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
bytes_hex | string | はい | Frame bytes as hex (whitespace, : / - separators and 0x allowed). |
fcs | boolean | The frame ends with a 4-octet FCS. | |
first_protocol | string | null | Protocol of the first octet (default ethernet2). |
ParseResponse
POST /api/parse response.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
bytes_hex | string | はい | Normalised hex of the input. |
diagnostics | object``[] | はい | Parse and build findings with localised message. |
layout | object``[] | はい | Layer / field positions. |
len | integer | はい | Frame length in octets. |
packet | object | はい | Decoded packet (wpg_core::Packet: layers with Manual field values). |
trailers | object``[] | はい | Padding / FCS. |
PathElem
Breadcrumb element.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
name | string | はい | Name (or the number). |
oid | string | はい | OID. |
PromptItem
One keyboard-interactive prompt.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
echo | boolean | はい | Whether the answer may be shown while typed. |
prompt | string | はい | Prompt text from the server. |
Protocol
Remote protocol.
型: "ssh" | "telnet"
ProtocolSummary
Catalog entry.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
fields | string``[] | はい | Field names in wire order. |
id | string | はい | Stable id (ethernet2, ipv4, …). |
layer | object | はい | Palette classification (l2, l3, l4, payload, …). |
name | string | はい | Display name. |
next | string``[] | はい | Protocols this one can carry (its next-layer binding table). |
synth | boolean | はい | Content generator instead of wire fields (payload). |
ReceiverStart
POST /api/snmp/receiver/start body.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
communities | string``[] | Accepted communities (empty = any; others are listed with an error). | |
listen | string | はい | Listen address (0.0.0.0:162, [::]:1162). |
users | ReceiverUserIn[] | v3 users (kept in memory while the receiver runs). |
ReceiverStatus
Trap receiver state.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
communities | string``[] | はい | Accepted communities (empty = any). |
engine_id | string | はい | This receiver’s engine id (hex), for v3 informs. |
from_config | boolean | はい | Started at boot from snmp.trap_listen. |
listen | string | null | Bound address. | |
received | integer | はい | Notifications received since the start. |
running | boolean | はい | Listening. |
users | string``[] | はい | Configured v3 user names. |
ReceiverUserIn
A v3 user of the receiver.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
auth_password | string | null | Authentication pass phrase. | |
auth_protocol | string | null | Authentication protocol (default SHA). | |
priv_password | string | null | Privacy pass phrase. | |
priv_protocol | string | null | Privacy protocol (default AES). | |
user | string | はい | User name. |
ReloadResult
Result of POST /api/protocols/reload.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
dirs | string``[] | はい | Directories that were read. |
files | ExtensionFile[] | はい | The files now in use, in load order. |
RenderRequest
POST /api/render request.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
count | integer | null | Packets to render (1..=server.preview_max, default 1; 256 unless configured). | |
index | integer | null | Stream index of the first packet (default 0). | |
template | object | はい | Template: object (JSON form of .wpg.yaml) or YAML text. |
vars | map<string, ``string``> | Variable values. |
RenderResponse
POST /api/render response.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
cardinality | integer | null | Packets in the whole stream (null = unbounded). | |
packets | RenderedPacket[] | はい | The packets. |
plan | object | はい | How a job would expand the stream (pre-render vs on-the-fly). |
RenderedPacket
One rendered packet.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
bytes_hex | string | はい | Frame bytes as lower-case hex (without FCS unless the template asks for one). |
diagnostics | object``[] | はい | Builder findings with localised message. |
index | integer | はい | Stream index. |
layout | object``[] | はい | Layer / field positions (wpg_core::LayerLayout). |
len | integer | はい | Length in octets. |
trailers | object``[] | はい | Padding / FCS after the layers. |
Role
A user role (only admin is created for now; operator / viewer are P1).
型: "admin" | "operator" | "viewer"
SearchHit
A search hit.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
kind | string | はい | Kind. |
module | string | はい | Module. |
name | string | はい | Descriptor. |
oid | string | はい | OID. |
role | string | null | Table / row / column / scalar. | |
syntax | string | null | SYNTAX text. |
ServerEvent
One message from the server to WebSocket clients.
type: "stats"
Latest statistics of a running job (every 100 ms, one per job).
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
job_id | string | はい | Job id. |
snapshot | object | はい | Counters and rates (wpg_tx::job::StatsSnapshot). |
type | "stats" | はい |
type: "job_state"
A job changed state.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
job_id | string | はい | Job id. |
state | JobStatus | はい | New state. |
type | "job_state" | はい |
type: "log"
A log line (ts, level, target, message, fields).
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
type | "log" | はい |
type: "templates_changed"
The template index changed (file watcher or API write).
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
type | "templates_changed" | はい |
type: "rx_stats"
Latest statistics of a capture (every 100 ms while it runs, once more at the end).
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
capture_id | string | はい | Capture id. |
snapshot | object | はい | Counters, rates and verification (wpg_rx::RxSnapshot). |
type | "rx_stats" | はい |
type: "capture_state"
A capture started or ended.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
capture_id | string | はい | Capture id. |
state | object | はい | New state ({ "state": "running" | "finished" | "failed", "detail" }). |
type | "capture_state" | はい |
type: "snmp_trap"
The SNMP trap receiver got a notification (also listed by
GET /api/snmp/traps).
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
trap | TrapOut | はい | The rendered notification. |
type | "snmp_trap" | はい |
type: "dhcp_activity"
The DHCP server handled a request or sent a router advertisement
(also listed by GET /api/dhcp/activity).
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
activity | object | はい | The exchange (wpg_dhcp::Activity). |
type | "dhcp_activity" | はい |
type: "dhcp_state"
The DHCP server started / stopped, its settings changed or leases
expired / were deleted: reload GET /api/dhcp.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
type | "dhcp_state" | はい |
type: "protocols_changed"
The user-defined protocols were reloaded (POST /api/protocols/reload):
fetch GET /api/protocols and GET /api/protocols/extensions again.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
type | "protocols_changed" | はい |
SetupRequest
POST /api/auth/setup body.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
confirm | string | はい | The same password again. |
password | string | はい | The new admin password (at least 8 characters). |
SnmpBulkRequest
GetBulk request body.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
max_repetitions | integer | null | max-repetitions (default 10). | |
non_repeaters | integer | null | non-repeaters (default 0). | |
oids | string``[] | はい | Objects (the first non_repeaters are fetched once). |
target | SnmpTarget | はい | The agent. |
SnmpNotifyRequest
Trap / Inform request body.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
target | SnmpTarget | はい | The receiver (port default 162). |
trap_oid | string | はい | snmpTrapOID (linkDown, IF-MIB::linkUp, 1.3.6.1.6.3.1.1.5.1). v1 traps are converted per RFC 3584. |
uptime | integer | null | sysUpTime in hundredths of a second (default: the server’s uptime). | |
varbinds | VarBindIn[] | Extra bindings. |
SnmpOidsRequest
Get / GetNext request body.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
oids | string``[] | はい | Objects: names (sysDescr.0, IF-MIB::ifDescr.1) or dotted OIDs. |
target | SnmpTarget | はい | The agent. |
SnmpResult
Result of an operation.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
elapsed_ms | number | はい | Round trip(s) in milliseconds. |
engine_id | string | null | The agent’s engine id (v3, hex). | |
error_index | integer | はい | error-index (1-based binding, 0 = none). |
error_status | integer | はい | error-status of the response (0 = noError). |
error_status_name | string | null | Its name (noSuchName, notWritable, …), when not 0. | |
op | string | はい | get, getnext, getbulk, walk, set, trap, inform. |
requests | integer | はい | Requests sent. |
tables | TableOut[] | Conceptual tables found among the bindings (walks). | |
target | string | はい | The agent / receiver address. |
truncated | boolean | The walk stopped at its limit. | |
varbinds | VarBindOut[] | はい | The bindings (response, walk results, or the notification sent). |
version | string | はい | v1, v2c, v3. |
SnmpSetRequest
Set request body.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
target | SnmpTarget | はい | The agent. |
varbinds | VarBindIn[] | はい | Bindings to set. |
SnmpStatus
GET /api/snmp/status.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
capture | CaptureStatus | null | ||
enabled | boolean | はい | snmp.enabled. |
mib_dir | string | はい | Directory of uploaded MIBs. |
modules | integer | はい | Loaded modules. |
nodes | integer | はい | Resolved MIB nodes. |
receiver | ReceiverStatus | null |
SnmpTarget
Where to send a request.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
community | string | null | Community for v1 / v2c (default public). | |
host | string | はい | Host name or address. |
port | integer | null | UDP port (default 161 for requests, 162 for notifications). | |
retries | integer | null | Extra attempts (default 1, at most 10). | |
timeout_ms | integer | null | Wait per attempt in milliseconds (default 2000, at most 60000). | |
v3 | V3In | null | ||
version | SnmpVersion | Version (default v2c). |
SnmpVersion
SNMP protocol version.
型: "v1" | "v2c" | "v3"
SnmpWalkRequest
Walk request body.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
limit | integer | null | Most bindings returned in all (default 10000, at most 100000). | |
max_repetitions | integer | null | max-repetitions per GetBulk (default 20; v1 walks with GetNext). | |
oid | string | Subtree root: name (ifTable, system) or dotted OID. | |
oids | string``[] | More subtree roots, walked one after another after oid (either may be empty, not both). | |
target | SnmpTarget | はい | The agent. |
TableColumnOut
A table column.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
counter | boolean | はい | Counter column (rates make sense). |
name | string | はい | Descriptor. |
oid | string | はい | Column OID. |
syntax | string | はい | Syntax text. |
TableOut
A conceptual table assembled from walk results.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
columns | TableColumnOut[] | はい | Columns present, in OID order. |
entry | string | はい | IF-MIB::ifEntry. |
index_names | string``[] | はい | INDEX objects. |
rows | TableRowOut[] | はい | Rows in instance order. |
table | string | null | IF-MIB::ifTable. |
TableRowOut
A table row.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
cells | (string | null)[] | はい | Readable cells (one per column; null = absent). |
index | string``[] | はい | Decoded INDEX values (empty when not decodable). |
instance | string | はい | Instance sub-identifiers. |
numeric | (integer | null)[] | はい | Numeric cells (integer types). |
TemplateDetail
A template with its index entry and lint findings.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
issues | object``[] | はい | Lint findings with localised message. |
summary | TemplateSummary | はい | Index entry. |
template | object | はい | The template (JSON form of .wpg.yaml). |
TemplateList
GET /api/templates response.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
recent | string``[] | はい | Recently used template ids, most recent first. |
templates | TemplateSummary[] | はい | Matching templates, sorted by name. |
TemplateSource
Where a template comes from.
型: "user" | "library"
TemplateSummary
Index entry of a template.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
author | string | null | Author. | |
description | string | null | Description in the requested language (meta.descriptions[lang], else meta.description, else meta.descriptions.en). | |
descriptions | map<string, ``string``> | All localised descriptions (language tag → text, e.g. ja, en). | |
error | string | null | Load error when the file does not parse. | |
favorite | boolean | はい | Marked as favourite. |
id | string | はい | Stable id (slug of the relative path). |
last_used | integer | null | Last use (open in the GUI, job start), Unix milliseconds. | |
modified | integer | null | File modification time, Unix milliseconds. | |
name | string | はい | meta.name (the file stem when the file does not parse). |
path | string | はい | Path relative to its root directory. |
protocols | string``[] | はい | Protocol stack, outermost first. |
root | string | はい | The root directory. |
source | TemplateSource | はい | Library or user template. |
tags | string``[] | はい | Tags. |
writable | boolean | はい | Whether 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.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
type | "connect" | はい |
type: "input"
Keystrokes / pasted text (UTF-8).
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
data | string | はい | The text. |
type | "input" | はい |
type: "resize"
The terminal was resized.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
cols | integer | はい | Columns. |
rows | integer | はい | Rows. |
type | "resize" | はい |
type: "host_key"
Answer to a host_key prompt.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
accept | boolean | はい | Trust the key. |
save | boolean | Store it in the known hosts (otherwise trust it for this session). | |
type | "host_key" | はい |
type: "auth_response"
Answers to an auth_prompt (one per prompt).
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
responses | string``[] | はい | The answers. |
type | "auth_response" | はい |
type: "record"
Starts / stops the session log.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
enabled | boolean | はい | Record from now on. |
strip_ansi | boolean | null | Remove escape sequences (default true). | |
type | "record" | はい |
type: "disconnect"
Ends the session.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
type | "disconnect" | はい |
TerminalConnectRequest
connect: where to and how to log in.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
cols | integer | Terminal width. | |
host | string | はい | Host name or address. |
jump | JumpHost[] | 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. | |
passphrase | string | null | Passphrase of private_key. | |
password | string | null | SSH password (also answers a single keyboard-interactive password prompt). | |
port | integer | null | Port (default 22 / 23). | |
private_key | string | null | SSH private key (OpenSSH / PEM / PuTTY .ppk text). | |
protocol | Protocol | はい | ssh or telnet. |
record | boolean | null | Record a session log (default: terminal.record_sessions). | |
rows | integer | Terminal height. | |
strip_ansi | boolean | null | Remove escape sequences from the log (default true). | |
username | string | null | SSH 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.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
host | string | null | The host of this phase (sessions with jump hosts). | |
state | string | はい | The phase. |
type | "state" | はい |
type: "host_key"
An unknown SSH host key: confirm the fingerprint (host_key message).
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
algorithm | string | はい | Key algorithm. |
fingerprint | string | はい | SHA256:.... |
host | string | はい | Host. |
port | integer | はい | Port. |
type | "host_key" | はい |
type: "auth_prompt"
The server asks questions (keyboard-interactive, or the password when
none was given): answer with auth_response.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
host | string | はい | The host asking (the target or a jump host). |
instructions | string | はい | Instructions from the server. |
name | string | はい | Request name from the server. |
prompts | PromptItem[] | はい | The prompts. |
type | "auth_prompt" | はい |
type: "connected"
The session is up.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
address | string | はい | Address actually connected to. |
fingerprint | string | null | SSH host key fingerprint. | |
host | string | はい | Host. |
port | integer | はい | Port. |
protocol | Protocol | はい | Protocol. |
session_id | string | はい | Session id. |
type | "connected" | はい | |
via | string``[] | Jump hosts the session goes through (user@host:port). |
type: "record"
Log state after connected / record.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
enabled | boolean | はい | Recording. |
file | string | null | The log file (GET /api/terminal/logs/{name}). | |
type | "record" | はい |
type: "error"
A failure; fatal ones are followed by closed.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
code | string | はい | target_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. |
detail | string | null | Untranslated detail (an OS / protocol error). | |
fatal | boolean | はい | The session ends. |
info | object | null | host_key_changed: {algorithm, fingerprint, known_algorithm, known_fingerprint}; a failure at a jump host adds {hop: "host:port"}. | |
type | "error" | はい |
type: "closed"
The session ended.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
bytes_in | integer | はい | Bytes received from the host. |
bytes_out | integer | はい | Bytes sent to the host. |
duration_secs | integer | はい | Session length in seconds. |
reason | string | はい | remote (the host closed it), client, idle, shutdown, error. |
type | "closed" | はい |
TerminalStatus
GET /api/terminal/status.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
allowed_targets | string``[] | はい | terminal.allowed_targets (empty = any target). |
enabled | boolean | はい | terminal.enabled. |
idle_timeout_secs | integer | はい | terminal.idle_timeout_secs. |
max_sessions | integer | はい | terminal.max_sessions. |
record_sessions | boolean | はい | terminal.record_sessions. |
sessions | ActiveSession[] | はい | Running sessions (all users). |
TokenInfo
An API token as listed (never the secret).
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
created | integer | はい | Creation time (Unix seconds). |
expires | integer | null | Expiry (Unix seconds); null: never expires. | |
id | integer | はい | Token id (for revoking). |
last_used | integer | null | Last use (Unix seconds, updated at most once a minute). | |
name | string | はい | Name given at creation. |
prefix | string | はい | The first characters of the secret (wpg_ + 8 hex digits), to recognise it. |
user | string | はい | Owner: requests with the token act as this user, with its role. |
TrapOut
A received notification.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
acknowledged | boolean | はい | An inform that was acknowledged. |
community | string | null | Community (v1 / v2c). | |
error | string | null | Why the message was not accepted (wrong community, digest, …). | |
id | integer | はい | Sequence number (increasing). |
level | string | null | v3 security level. | |
pdu_type | string | null | trap_v1, trap_v2, inform (absent when undecodable). | |
received_ms | integer | はい | Arrival, milliseconds since the Unix epoch. |
source | string | はい | Sender address:port. |
trap_name | string | null | The trap OID’s name (IF-MIB::linkDown). | |
trap_oid | string | null | snmpTrapOID.0 (dotted). | |
uptime | integer | null | sysUpTime.0 / v1 time-stamp (hundredths of a second). | |
uptime_text | string | null | Uptime as 1d 02:03:04.56. | |
user | string | null | User (v3). | |
v1 | V1Out | null | ||
varbinds | VarBindOut[] | はい | Bindings (without sysUpTime.0 / snmpTrapOID.0). |
version | string | はい | v1, v2c, v3. |
TreeChildOut
A tree entry.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
arc | integer | はい | Last sub-identifier. |
has_children | boolean | はい | Something is defined below. |
kind | string | null | object_type, object_identifier, notification_type, … | |
module | string | null | Module. | |
name | string | null | Descriptor (absent for an undefined intermediate OID). | |
oid | string | はい | OID. |
role | string | null | Table / row / column / scalar for OBJECT-TYPEs. |
UploadedFile
Result of one uploaded file.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
errors | string``[] | はい | Problems (no module found: the file was not stored). |
file | string | はい | Stored file name. |
modules | string``[] | はい | Modules found in it. |
stored | boolean | はい | Whether the file was stored. |
UserInfo
user of [AuthStatus].
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
name | string | はい | User name. |
role | Role | はい | admin, operator or viewer. |
V1Out
SNMPv1 trap header.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
agent_addr | string | はい | agent-addr. |
enterprise | string | はい | enterprise (name or dotted). |
generic | integer | はい | generic-trap. |
specific | integer | はい | specific-trap. |
V3In
SNMPv3 parameters. The level follows from the pass phrases given:
none = noAuthNoPriv, auth_password = authNoPriv, both = authPriv.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
auth_password | string | null | Authentication pass phrase (at least 8 characters). | |
auth_protocol | string | null | MD5, SHA (SHA-1), SHA-224, SHA-256, SHA-384, SHA-512 (default SHA). | |
context_engine_id | string | null | contextEngineID (hex; default: the agent’s engine id). | |
context_name | string | null | contextName. | |
priv_password | string | null | Privacy pass phrase (at least 8 characters). | |
priv_protocol | string | null | DES, AES (AES-128), AES-192, AES-256 (default AES). | |
user | string | はい | User name. |
VarBindIn
A variable binding to send (Set, notifications).
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
oid | string | はい | Object instance: name (sysName.0, IF-MIB::ifAdminStatus.2) or dotted OID. |
type | string | null | auto (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. | |
value | string | Value text (enum labels such as down and object names are accepted). |
VarBindOut
A rendered variable binding.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
instance | string | はい | Instance sub-identifiers (3). |
module | string | null | Defining module. | |
name | string | はい | IF-MIB::ifDescr.3 (numeric when no MIB knows it). |
numeric | integer | null | Numeric value of integer types (rates, charts). | |
object | string | null | Object descriptor (ifDescr). | |
oid | string | はい | OID (dotted decimal). |
raw | string | はい | The value without MIB knowledge. |
syntax | string | null | Textual convention of the object (DisplayString, InterfaceIndex). | |
type | string | はい | Wire type (Counter32, OCTET STRING, noSuchInstance, …). |
units | string | null | UNITS of the object. | |
value | string | はい | Readable value (enum labels, display hints, units, names). |
VersionInfo
GET /api/version response body.
| キー | 型 | 必須 | 説明 |
|---|---|---|---|
api_version | integer | はい | REST API version (bumped on incompatible changes). |
arch | string | はい | Target CPU architecture. |
features | string``[] | はい | Optional features compiled in (pcap, …). |
locales | string``[] | はい | Supported UI / message languages. |
os | string | はい | Target OS. |
version | string | はい | Server version. |