API 使用手冊API manualAPI マニュアル

jt-ipam 的 REST API、phpIPAM 相容層、Graylog 查表、機櫃圖嵌入與 MCP。以下所有網址請把 https://ipam.example.com 換成你自己的位址。 The jt-ipam REST API, phpIPAM compatibility layer, Graylog lookups, rack embeds and MCP. Replace https://ipam.example.com below with your own address.jt-ipam の REST API、phpIPAM 互換レイヤ、Graylog 用のルックアップ、ラック図の埋め込み、そして MCP です。以下の URL の https://ipam.example.com は、ご自身のアドレスに置き換えてください。

API 一律走 HTTPS。jt-ipam 強制 HTTPS:nginx 模式下 80 埠只回 301 轉址到 HTTPS,不提供 API。唯一的例外是給 Graylog DSV 查表用的明文 8088 埠(見第 17 節)。若你的 jt-ipam 用自簽憑證,curl 要加 -k(或把 CA 加進信任庫)。 The API is HTTPS-only. jt-ipam enforces HTTPS: in nginx mode, port 80 only answers with a 301 redirect to HTTPS and serves no API. The one exception is the plain-HTTP port 8088 for Graylog DSV lookups (see section 17). If your instance uses a self-signed certificate, add -k to curl (or add the CA to your trust store).API は HTTPS のみです。jt-ipam は HTTPS を強制します。nginx モードでは 80 番ポートは HTTPS への 301 リダイレクトを返すだけで、API は提供しません。唯一の例外は Graylog DSV ルックアップ用の平文 8088 番ポートです(第 17 節を参照)。自己署名証明書を使っている場合は curl に -k を付けてください(または CA を信頼ストアに追加します)。

1認證:API 權杖Auth: API tokens認証:API トークン

外部程式一律用 API 權杖,不要用帳號密碼登入拿 JWT(JWT 只有 15 分鐘、是給網頁前端用的)。 External programs should always use an API token rather than logging in for a JWT (JWTs last 15 minutes and exist for the web UI).外部のプログラムからは必ず API トークンを使ってください。ユーザー名とパスワードでログインして JWT を取得する方法は避けてください(JWT は 15 分で切れ、Web UI のためのものです)。

怎麼取得權杖Getting a tokenトークンの取得

登入 jt-ipam → 右上角使用者選單 → API 權杖 → 新增。填名稱、有效天數(1~365,預設 90)、權限範圍,按儲存。 Sign in to jt-ipam → user menu (top right) → API tokens → Add. Give it a name, a lifetime (1–365 days, default 90) and a scope, then save.jt-ipam にログイン → 右上のユーザーメニュー → API トークン → 追加。名称、有効日数(1~365、既定は 90)、スコープを入力して保存します。

明文只出現一次。建立完成的那個視窗是你唯一能看到完整權杖的機會:資料庫只存 SHA-256 雜湊。沒抄到就撤銷重建,沒有別的辦法找回來。 The plaintext is shown once. The dialog right after creation is your only chance to see the full token; only its SHA-256 hash is stored. If you lose it, revoke and create a new one; there is no way to recover it.平文は一度しか表示されません。作成直後のダイアログが、完全なトークンを見られる唯一の機会です。データベースには SHA-256 ハッシュしか保存されません。控え損ねた場合は失効させて作り直すしかなく、復元する方法はありません。

怎麼帶權杖Sending the tokenトークンの送り方

curl -H "Authorization: Bearer jt_prod_xxxxxxxxxxxxxxxx" \
  https://ipam.example.com/api/v1/subnets

權杖首碼 jt_ 會讓後端自動辨識為 API 權杖(沒有這個首碼則當成 JWT 解析)。 The jt_ prefix tells the backend this is an API token (without it, the value is parsed as a JWT).先頭の jt_ によって、バックエンドはこれが API トークンだと判断します(この接頭辞が無ければ JWT として解析されます)。

權限範圍(scope)Scopesスコープ

scopes 效果Effect効果
[] 不限制:沿用權杖擁有者的權限,可讀可寫。 Unrestricted: inherits the owner's permissions, read and write.制限なし。トークンの所有者の権限をそのまま引き継ぎ、読み書きできます。
["read"] 唯讀:GET/HEAD/OPTIONS 可用;POST/PATCH/PUT/DELETE 一律回 403。 Read-only: GET/HEAD/OPTIONS work; POST/PATCH/PUT/DELETE always return 403.読み取り専用。GET/HEAD/OPTIONS は使えます。POST/PATCH/PUT/DELETE は常に 403 を返します。

建立權杖時只接受這兩種。填其他值(例如 write、subnets:read)會被拒絕回 422,這是刻意的:不提供無法真正強制執行的權限旋鈕。唯一的例外是 phpIPAM 相容層登入時發出的權杖,它帶 phpipam:*,效果等同不限制(見第 16 節)。 These are the only two values accepted when you create a token. Any other value (e.g. write, subnets:read) is rejected with 422, deliberately, so there is no knob that looks like a restriction but isn't enforced. The one exception is the token issued by the phpIPAM compatibility login: it carries phpipam:*, which behaves as unrestricted (see section 16).トークン作成時に受け付けるのはこの二つだけです。それ以外の値(write や subnets:read など)は 422 で拒否されます。これは意図的な仕様で、実際には強制されない「制限のように見えるつまみ」を用意しないためです。唯一の例外は phpIPAM 互換レイヤのログインで発行されるトークンで、phpipam:* を持ち、制限なしと同じ扱いになります(第 16 節を参照)。

有些「只查不改」的操作是 POST,唯讀權杖用不了。唯讀判斷只看 HTTP 方法,所以下列端點雖然不改資料,唯讀權杖一樣回 403:POST /api/v1/addresses/uptime/batch、POST /api/v1/investigate/narrative/stream、POST /api/v1/ai/chat(含 /ai/chat/stream)、POST /api/v1/tools/net/*。需要這些功能時,請用低權限使用者建立的不限制權杖。 Some read-like operations are POST, so read-only tokens cannot use them. The read-only check looks only at the HTTP method, so these endpoints return 403 to a read-only token even though they change no data: POST /api/v1/addresses/uptime/batch, POST /api/v1/investigate/narrative/stream, POST /api/v1/ai/chat (and /ai/chat/stream), POST /api/v1/tools/net/*. If you need them, use an unrestricted token owned by a low-privilege user.「参照だけ」の操作の一部は POST なので、読み取り専用トークンでは使えません。読み取り専用の判定は HTTP メソッドだけを見るため、次のエンドポイントはデータを変更しないにもかかわらず、読み取り専用トークンには 403 を返します:POST /api/v1/addresses/uptime/batch、POST /api/v1/investigate/narrative/stream、POST /api/v1/ai/chat(/ai/chat/stream を含む)、POST /api/v1/tools/net/*。これらが必要な場合は、権限の低いユーザーで作成した制限なしのトークンを使ってください。
權杖繼承擁有者權限。用 admin 帳號建的權杖就是一把 admin 全權金鑰。要給第三方受限的存取,正確做法是:另建一個低權限使用者 → 授權它需要的物件(區段/子網路/裝置…;在「管理 → 權限指派」或用第 14 節的 /api/v1/system/permissions)→ 用那個帳號登入建立權杖。以前有一個 object_filters 欄位可以填卻沒有作用,已經移除(送了會回 422)。 A token inherits its owner's permissions. A token created by an admin is a full-privilege admin key. To give a third party restricted access: create a low-privilege user, grant it the objects it needs (sections / subnets / devices…; under Admin → Permissions, or with /api/v1/system/permissions from section 14), then sign in as that user to create the token. An object_filters field used to be accepted without being enforced; it has been removed (sending it returns 422).トークンは所有者の権限を引き継ぎます。admin アカウントで作ったトークンは、admin の全権限を持つ鍵そのものです。第三者に限定的なアクセスを渡すには、権限の低いユーザーを別に作り、必要なオブジェクト(セクション/サブネット/機器など)を許可し(「管理 → 権限」または第 14 節の /api/v1/system/permissions)、そのアカウントでログインしてトークンを作成してください。以前は object_filters 項目を指定できましたが強制されていなかったため、削除しました(送ると 422 になります)。

每把權杖每分鐘最多 600 次請求(REST 與 MCP 合計,超過回 429)。權杖在到期前 14、7、1 天與當天會通知擁有者;帳號停用時,它的權杖全部撤銷(重新啟用帳號也不會回來)。 Each token is limited to 600 requests a minute (REST and MCP combined; more returns 429). The owner is notified 14, 7 and 1 days before a token expires and on the day; deactivating an account revokes all of its tokens (reactivating the account does not bring them back).トークンごとに毎分 600 リクエストまでです(REST と MCP の合計。超えると 429)。期限の 14・7・1 日前と当日に所有者へ通知します。アカウントを無効化すると、そのトークンはすべて失効します(アカウントを再度有効にしても戻りません)。

網頁登入的權杖不給程式用。POST /api/v1/auth/login 只回 15 分鐘的存取權杖;更新權杖放在 HttpOnly Cookie(只送到認證端點 /api/v1/auth/refresh 與 /api/v1/auth/logout,兩者都要帶 X-Requested-With: jt-ipam),每次換發都換新,已經換掉的再被使用會撤銷整個工作階段。管理員要求雙因素驗證時,登入第一步回的是 mfa_required 或 mfa_setup_required。外部程式請用上面的 API 權杖。 Web sign-in tokens are not meant for programs. POST /api/v1/auth/login returns only a 15-minute access token; the refresh token is in an HttpOnly cookie (sent only to the sign-in endpoints /api/v1/auth/refresh and /api/v1/auth/logout, both of which need X-Requested-With: jt-ipam), it changes on every refresh, and reusing a replaced one revokes the whole session. When administrators require two-factor authentication, the first sign-in step returns mfa_required or mfa_setup_required. Programs should use the API tokens above.Web ログインのトークンはプログラム向けではありません。POST /api/v1/auth/login が返すのは 15 分のアクセストークンだけです。リフレッシュトークンは HttpOnly Cookie にあり(認証エンドポイント /api/v1/auth/refresh と /api/v1/auth/logout にだけ送られ、どちらにも X-Requested-With: jt-ipam が必要)、更新のたびに入れ替わり、入れ替え済みのものを再使用するとセッション全体が取り消されます。管理者が 二要素認証を必須にしている場合、ログインの第一段階は mfa_required または mfa_setup_required を返します。プログラムからは上の API トークンを使ってください。

用 API 管理權杖Managing tokens via the APIAPI からのトークン管理

方法Methodメソッド路徑Pathパス說明Description説明
GET/api/v1/api-tokens 列出自己的權杖(分頁,page_size 上限 200;admin 可加 ?user_id= 看別人的)List your own tokens (paginated, page_size up to 200; admins may add ?user_id=)自分のトークンを一覧(ページング、page_size の上限は 200。admin は ?user_id= で他人の分も参照可)
POST/api/v1/api-tokens 建立;回應帶權杖明文,只會出現這單次Create; the response carries the plaintext token, this one time only作成。応答にトークンの平文が含まれます(この一回限り)
DELETE/api/v1/api-tokens/{id} 撤銷(立即失效,不可復原)Revoke (immediate, irreversible)失効(即時、取り消し不可)
curl -X POST https://ipam.example.com/api/v1/api-tokens \
  -H "Authorization: Bearer <jwt-or-token>" \
  -H "Content-Type: application/json" \
  -d '{"name":"monitoring","expires_in_days":180,"scopes":["read"]}'
{
  "id": "3f1c...", "name": "monitoring",
  "token": "jt_prod_XXXXXXXXXXXXXXXXXXXX",
  "token_prefix": "jt_prod_", "expires_at": "2027-01-26T00:00:00Z",
  "scopes": ["read"]
}

2通用慣例Conventions共通の決まり

  • 基底路徑:/api/v1。請求與回應預設是 JSON(Content-Type: application/json);例外會在各節明講(CSV 匯出、multipart 匯入、DSV 純文字、SVG、SSE 串流)。 Base path: /api/v1. Requests and responses are JSON (Content-Type: application/json) unless a section says otherwise (CSV exports, multipart imports, DSV text, SVG, SSE streams).ベースパスは /api/v1 です。リクエストもレスポンスも既定は JSON(Content-Type: application/json)で、例外は各節で明記します(CSV エクスポート、multipart の取り込み、DSV のテキスト、SVG、SSE ストリーム)。
  • 識別碼是 UUID,不是遞增整數。 Identifiers are UUIDs, not incrementing integers.識別子は UUID であり、連番の整数ではありません。
  • 時間一律是 UTC 的 ISO 8601,但寫法有兩種:用 schema 定義回應的端點寫成 2026-07-30T12:34:56.123456Z,直接回字典的端點寫成 2026-07-30T12:34:56.123456+00:00,兩者都可能帶微秒。phpIPAM 相容層的權杖到期時間則是 YYYY-MM-DD HH:MM:SS(UTC)。請用通用的 ISO 8601 解析器,不要比對固定格式字串。 Timestamps are always UTC ISO 8601, written two ways: endpoints with a response schema return 2026-07-30T12:34:56.123456Z, endpoints that return a plain dict return 2026-07-30T12:34:56.123456+00:00, and either may carry microseconds. The phpIPAM layer's token expiry is YYYY-MM-DD HH:MM:SS (UTC). Use a general ISO 8601 parser instead of matching a fixed format string.時刻はすべて UTC の ISO 8601 ですが、書き方が二通りあります。スキーマで応答を定義したエンドポイントは 2026-07-30T12:34:56.123456Z、辞書をそのまま返すエンドポイントは 2026-07-30T12:34:56.123456+00:00 で、どちらもマイクロ秒が付くことがあります。phpIPAM 互換レイヤのトークン有効期限は YYYY-MM-DD HH:MM:SS(UTC)です。固定の書式文字列と照合せず、汎用の ISO 8601 パーサを使ってください。
  • 未知欄位會被拒絕。寫入用的 schema 是嚴格模式(extra=forbid):多送一個拼錯的欄位會回 422,而不是安靜忽略。 Unknown fields are rejected. Write schemas are strict (extra=forbid): a misspelled extra field returns 422 instead of being silently ignored.未知の項目は拒否されます。書き込み用のスキーマは厳格モード(extra=forbid)です。綴りを誤った項目を余分に送ると、黙って無視されるのではなく 422 が返ります。
  • 部分更新用 PATCH,只送要改的欄位。 Use PATCH for partial updates, sending only the fields you want to change.部分更新には PATCH を使い、変更したい項目だけを送ってください。

分頁與列表的三種形狀Pagination: three list shapesページング:一覧の三つの形

列表端點有三種形狀。各端點用哪一種、上限多少,以該端點的 schema 為準(見第 22 節): List endpoints come in three shapes. Which one an endpoint uses, and its limits, is defined by that endpoint's schema (see section 22):一覧系のエンドポイントには三つの形があります。どの形か、上限はいくつかは、各エンドポイントのスキーマで確認してください(第 22 節を参照)。

形狀Shape形參數Parametersパラメータ回應Response応答例子Examples例
頁碼式(最常見)Page-based (most common)ページ番号式(最も多い) page(從 1 起,上限 10000)、 (1-based, max 10000), (1 起算、上限 10000)、page_size {"items":[…],"total":…,"page":…,"page_size":…} /sections /subnets /addresses /devices
位移式Offset-basedオフセット式 limit、, 、offset 同樣的外層(page 由 offset 換算);/pfsense 只有 items 與 totalThe same envelope (page is derived from offset); /pfsense returns only items and total同じ外枠(page は offset から換算)。/pfsense は items と total のみ /audit /users /groups /firewalls/opnsense /pfsense /wazuh/instances /wazuh/agents
純陣列(不分頁)Bare array (no paging)配列のみ(ページングなし) 無Noneなし [ … ] 約 25 個,例如About 25, e.g.約 25 本。例: /device-ports /dhcp-ranges /esxi /ssh-credentials /subnets/{id}/ranges /system/permissions

page_size(或 limit)的上限因端點而異:多數是 500(預設 50);/api-tokens、/notifications、/webhooks、/ip-requests、/scan-agents、/cert-agents、/tasks 等是 200;/addresses 是 1000(預設 100),/dns/records、/librenms/arp、/librenms/fdb 也是 1000。超過上限回 422,不會自動截斷。要抓完整資料就依 total 逐頁取。 The page_size (or limit) cap varies: most endpoints allow 500 (default 50); /api-tokens, /notifications, /webhooks, /ip-requests, /scan-agents, /cert-agents, /tasks and a few others allow 200; /addresses allows 1000 (default 100), as do /dns/records, /librenms/arp and /librenms/fdb. Exceeding the cap returns 422 rather than silently truncating. To fetch everything, page through using total.page_size(または limit)の上限はエンドポイントごとに異なります。多くは 500(既定 50)、/api-tokens・/notifications・/webhooks・/ip-requests・/scan-agents・/cert-agents・/tasks などは 200、/addresses は 1000(既定 100)で、/dns/records・/librenms/arp・/librenms/fdb も 1000 です。上限を超えると黙って切り詰めるのではなく 422 を返します。全件取得するには total を見ながらページを進めてください。

3錯誤與狀態碼Errors & status codesエラーとステータスコード

錯誤回應的外層是 {"detail": …},但 detail 有兩種型別,客戶端兩種都要處理: Error responses are wrapped as {"detail": …}, but detail comes in two types, and clients must handle both:エラー応答の外枠は {"detail": …} ですが、detail には二つの型があり、クライアントは両方を扱う必要があります。

  • 字串:例如 {"detail": "Admin required"}。 A string, e.g. {"detail": "Admin required"}.文字列:例 {"detail": "Admin required"}。
  • 物件 {code, params, message}:code 是穩定的機器可讀代碼,params 是代入句子的參數(常含 reason,也就是底層錯誤原文),message 是給人看的後備句子,可能是中文。請依 code 判斷,顯示時用 message。 An object {code, params, message}: code is a stable machine-readable code, params holds values for the sentence (often including reason, the underlying error text), and message is a human-readable fallback that may be in Chinese. Branch on code; show message to people.オブジェクト {code, params, message}:code は安定した機械可読のコード、params は文に埋め込む値(下層のエラー原文である reason を含むことが多い)、message は人が読むための代替文で、中国語の場合があります。判定には code を使い、表示には message を使ってください。
{ "detail": "Admin required" }

{ "detail": { "code": "range_auto_managed",
              "params": { "source": "fw-a · KEA" },
              "message": "…" } }

欄位驗證失敗(422)固定是 {"detail": "Invalid request", "errors": […]},errors 指出哪個欄位不合法。未預期的錯誤回 500 {"detail": "Internal Server Error"},伺服器端不會回 stack trace。 Validation failures (422) are always {"detail": "Invalid request", "errors": […]}, with errors pinpointing the invalid fields. Unexpected errors return 500 {"detail": "Internal Server Error"}; stack traces are never returned.項目の検証エラー(422)は常に {"detail": "Invalid request", "errors": […]} で、errors がどの項目が不正かを示します。想定外のエラーは 500 {"detail": "Internal Server Error"} を返し、スタックトレースが返ることはありません。

{ "detail": "Invalid request",
  "errors": [ { "loc": ["body","cidr"], "msg": "value is not a valid IPv4 network", "type": "value_error" } ] }
狀態Statusステータス意義與常見原因Meaning & common cause意味とよくある原因
200 / 201 / 202 / 204成功(202 表示已受理、稍後由背景作業或代理執行;204 用於刪除,無內容)Success (202 means accepted and carried out later by a background task or an agent; 204 for deletes, no body)成功(202 は受け付け済みで、後からバックグラウンド処理やエージェントが実行。削除は本文なしの 204)
400請求內容不合理但 schema 擋不到,例如批次 ID 太多、範圍超出子網路A request the schema cannot catch, e.g. too many IDs in a batch, a range outside its subnetスキーマでは検出できない不正な要求。一括処理の ID が多すぎる、範囲がサブネット外など
401沒帶權杖、權杖無效、已撤銷或已到期(回應帶 WWW-Authenticate: Bearer)Missing, invalid, revoked or expired token (the response carries WWW-Authenticate: Bearer)トークンが無い、無効、失効済み、または期限切れ(応答に WWW-Authenticate: Bearer が付きます)
403認證過但不准:RBAC 不足,或是唯讀權杖用了 POST/PATCH/PUT/DELETEAuthenticated but not allowed: insufficient RBAC, or a read-only token using POST/PATCH/PUT/DELETE認証は通ったが許可されていない。RBAC が不足しているか、読み取り専用トークンで POST/PATCH/PUT/DELETE を使った
404不存在,也用於「存在但你無權看見」,以免洩漏存在性Not found, also returned for "exists but you may not see it", to avoid leaking existence存在しない。「存在するが閲覧権限が無い」場合にもこれを返し、存在そのものが漏れないようにしています
409衝突,例如重疊網段或範圍、同一目標已有作業在跑、要改的是自動管理的資料Conflict, e.g. overlapping subnets or ranges, a job already running for the same target, or editing auto-managed data競合。サブネットや範囲の重複、同じ対象の処理が実行中、自動管理のデータを変更しようとした、など
413上傳檔案太大(匯入類端點)Uploaded file too large (import endpoints)アップロードしたファイルが大きすぎる(取り込み系)
422欄位驗證失敗(含未知欄位、不支援的 scope、超過 page_size 上限)Validation failed (including unknown fields, unsupported scopes, page_size over the cap)項目の検証に失敗(未知の項目、未対応のスコープ、page_size の上限超過を含む)
429超過速率限制(見第 21 節)。回應帶 Retry-After(秒),照它等再重試Rate limited (see section 21). The response carries Retry-After (seconds); wait that long before retryingレート制限の超過(第 21 節を参照)。応答に Retry-After(秒)が付くので、その時間だけ待ってから再試行してください
503服務暫時無法使用,例如 /readyz 偵測到資料庫或 Redis 不通Temporarily unavailable, e.g. /readyz found the database or Redis unreachable一時的に利用不可。/readyz がデータベースや Redis に到達できないなど

4權限模型Permission model権限モデル

jt-ipam 是預設關閉(deny by default)。你的權杖看得到什麼,完全取決於擁有者被授權了什麼: jt-ipam is deny by default. What your token can see depends entirely on what its owner has been granted:jt-ipam は既定で拒否(deny by default)です。トークンで何が見えるかは、その所有者に何が許可されているかで決まります。

  • 可逐物件授權的資料(客戶/區段/子網路/IP/裝置/機櫃/地點)→ 只回你可見範圍內的,連 total、統計與趨勢都會跟著縮放。授權分 read/write/admin 三級,區段、子網路與 IP 的寫入依該物件的等級判斷。但建立區段,以及裝置、客戶、地點、機櫃的新增/修改/刪除只有 admin 能做。 Per-object data (customers / sections / subnets / IPs / devices / racks / locations) → only what you can see, and total, counts and trends scale with it. Grants have three levels, read / write / admin, and writes to sections, subnets and IPs are checked against the level on that object. However, creating sections and creating, editing or deleting devices, customers, locations and racks is admin-only.オブジェクト単位で許可されるデータ(顧客/セクション/サブネット/IP/機器/ラック/拠点)→ 閲覧可能な範囲だけが返り、total・集計・傾向もその範囲に合わせて縮小します。許可は read/write/admin の三段階で、セクション・サブネット・IP への書き込みはそのオブジェクトの段階で判定します。ただしセクションの作成と、機器・顧客・拠点・ラックの作成/変更/削除は admin だけが行えます。
  • 全域基礎設施資料(VLAN/VRF/NAT/DNS/虛擬化/佈線/電力、以及多數整合帶回的資料…)→ 讀取需要「全域讀取」(admin 或萬用讀取授權),寫入需要 admin。只被指派特定物件的帳號會拿到 403。有些整合連讀取都只給 admin(見第 12 節)。 Global infrastructure (VLAN / VRF / NAT / DNS / virtualization / cabling / power, and most data pulled in by integrations…) → reading requires global read (admin or a wildcard read grant); writing requires admin. Accounts scoped to specific objects get 403. Some integrations are admin-only even for reads (see section 12).全体に関わる基盤データ(VLAN/VRF/NAT/DNS/仮想化/配線/電源、および多くの連携が取り込んだデータなど)→ 読み取りには全体の読み取り権限(admin またはワイルドカードの読み取り許可)、書き込みには admin が必要です。特定のオブジェクトだけを割り当てられたアカウントは 403 になります。読み取りも admin 限定の連携があります(第 12 節を参照)。
  • 純管理資料(稽核記錄、使用者/群組/權限、系統與整合設定)→ 需要 admin。例外是少數顯示用的設定(例如 GET /system/ui-display、/system/ip-cooldown、/system/search-settings)與 GET /custom-fields,任何登入帳號都能讀。 Administrative data (audit log, users / groups / permissions, system and integration settings) → requires admin. The exceptions are a few display settings (e.g. GET /system/ui-display, /system/ip-cooldown, /system/search-settings) and GET /custom-fields, which any signed-in account can read.管理系のデータ(監査ログ、ユーザー/グループ/権限、システムと連携の設定)→ admin が必要です。例外は表示用の一部の設定(GET /system/ui-display・/system/ip-cooldown・/system/search-settings など)と GET /custom-fields で、ログイン済みの任意のアカウントが読めます。

想知道自己這把權杖有什麼能力,打 GET /api/v1/auth/me:回應含 is_admin、has_visibility(是否有任何可見範圍)、has_global_read、can_edit(是否有任何 write/admin 授權)、can_ssh、ai_enabled 等欄位。注意路徑在 /auth 底下;/api/v1/me/preferences 則是個人偏好設定。 To discover what your token can do, call GET /api/v1/auth/me: the response includes is_admin, has_visibility (any visible scope at all), has_global_read, can_edit (any write/admin grant), can_ssh, ai_enabled and more. Note that the path is under /auth; /api/v1/me/preferences holds personal preferences.自分のトークンに何ができるかを知るには GET /api/v1/auth/me を呼びます。応答に is_admin・has_visibility(閲覧可能な範囲があるか)・has_global_read・can_edit(write/admin の許可があるか)・can_ssh・ai_enabled などが含まれます。パスは /auth の下にある点に注意してください。/api/v1/me/preferences は個人の設定です。

curl -H "Authorization: Bearer $TOKEN" https://ipam.example.com/api/v1/auth/me

5區段(Sections)Sectionsセクション(Sections)

最上層的分組容器,子網路掛在區段底下。可有父子階層。 The top-level grouping container that subnets belong to. Supports parent/child nesting.最上位のグループ用コンテナで、サブネットはこの下にぶら下がります。親子の入れ子にも対応します。

方法Methodメソッド路徑Pathパス說明與權限Description & access説明と権限
GET/api/v1/sections列出(分頁,page_size 上限 500),只含可見的區段List (paginated, page_size up to 500), visible sections only一覧(ページング、page_size の上限は 500)。閲覧可能なものだけ
GET/api/v1/sections/{id}單筆詳情(read)Get one (read)単件の詳細(read)
POST/api/v1/sections建立(admin)Create (admin)作成(admin)
PATCH/api/v1/sections/{id}部分更新(該區段 write)Partial update (write on the section)部分更新(そのセクションの write)
DELETE/api/v1/sections/{id}刪除(該區段 admin,見下方警告)Delete (admin on the section; see the warning below)削除(そのセクションの admin。下の警告を参照)
POST/api/v1/sections/bulk-delete批次刪除 {"ids":[…]},一次最多 500 筆(admin)Bulk delete {"ids":[…]}, up to 500 per call (admin)一括削除 {"ids":[…]}、1 回最大 500 件(admin)
刪除區段會連帶刪除底下所有子網路與其 IP 記錄(資料庫外鍵 ON DELETE CASCADE),不會因為還有內容就被擋下;下層區段則改為最上層。刪除前請先確認。 Deleting a section also deletes every subnet in it and all their IP records (database foreign keys with ON DELETE CASCADE); it is not blocked because the section still has content. Child sections become top-level. Double-check before deleting.セクションを削除すると、配下のすべてのサブネットとその IP レコードも削除されます(データベースの外部キーが ON DELETE CASCADE)。中身が残っていても拒否されません。下位のセクションは最上位になります。削除前に必ず確認してください。

建立區段Create a sectionセクションの作成

欄位Field項目型別Type型必填Required必須說明Description説明
namestring是yesはい1~128 字1–128 chars1~128 文字
descriptionstring否noいいえ最多 1024 字up to 1024 chars最大 1024 文字
parent_iduuid否noいいえ上層區段Parent section親セクション
customer_iduuid否noいいえ歸屬客戶/管理單位Owning customer / managing unit所属する顧客/管理組織
strict_modebool否noいいえ嚴格模式Strict mode厳格モード
display_orderint否noいいえ顯示排序(0~10000)Display order (0–10000)表示順(0~10000)
curl -X POST https://ipam.example.com/api/v1/sections \
  -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -d '{"name":"Main DC","description":"main site"}'

6子網路(Subnets)Subnetsサブネット(Subnets)

方法Methodメソッド路徑Pathパス說明與權限Description & access説明と権限
GET/api/v1/subnets列出。可加 section_id、archived、page、page_size(上限 500)List. Accepts section_id, archived, page, page_size (up to 500)一覧。section_id・archived・page・page_size(上限 500)を受け取ります
GET/api/v1/subnets/{id}單筆詳情(read)Get one (read)単件の詳細(read)
GET/api/v1/subnets/{id}/usage使用率統計(已用/可用)Usage stats (used / free)使用率の集計(使用中/空き)
GET/api/v1/subnets/{id}/blocks每個 /24 區塊已用幾個位址(IPv4,給大網段看分布)Used addresses per /24 block (IPv4; for large subnets)/24 ブロックごとの使用数(IPv4。大きなサブネットの分布確認用)
GET/api/v1/subnets/{id}/first_free_address第一個可用 IP(只查不配發);已有記錄與冷卻中的位址都跳過(配發下一個可用、IP 申請核准、AI 工具的配發也是)First free IP (lookup only, does not allocate); skips addresses with a record and addresses in cooldown (so do allocate-next-free, IP request approval and the AI allocation tool)最初の空き IP(参照のみ、確保はしない)。既にレコードがあるアドレスとクールダウン中のアドレスは飛ばします(次の空きを払い出す・IP 申請の承認・AI ツールの払い出しも同様)
POST/api/v1/subnets建立(需要目標區段的 write)Create (write on the target section)作成(対象セクションの write が必要)
PATCH/api/v1/subnets/{id}部分更新(write);cidr 不可修改。scan_agent_id、console_agent_id、jump_host_id 只有管理員能改,關掉 anomaly_enabled/ai_audit_enabled 也是(值沒變照常存,否則 403 infra_assignment_admin_only/subnet_monitoring_admin_only);改 section_id 或 customer_id 要對這個子網路有 admin、對目的地有 write(否則 403 move_needs_admin);master_subnet_id 要看得到。區段的 customer_id、IP 的 customer_id 同一套規則Partial update (write); cidr cannot be changed. Only admins may change scan_agent_id, console_agent_id and jump_host_id or turn off anomaly_enabled/ai_audit_enabled (unchanged values save normally; otherwise 403 infra_assignment_admin_only/subnet_monitoring_admin_only). Changing section_id or customer_id needs admin on the subnet and write on the destination (otherwise 403 move_needs_admin); master_subnet_id must be visible. The same rule applies to a section's and an IP's customer_id部分更新(write)。cidr は変更できません。scan_agent_id、console_agent_id、jump_host_id の変更と anomaly_enabled/ai_audit_enabled の無効化は管理者のみです(値が同じなら通常どおり保存、それ以外は 403 infra_assignment_admin_only/subnet_monitoring_admin_only)。section_id や customer_id の変更には、そのサブネットへの admin と移動先への write が必要です(ない場合は 403 move_needs_admin)。master_subnet_id は見えるものに限ります。セクションと IP の customer_id も同じ規則です
POST/api/v1/subnets/{id}/archive封存 / /unarchive 取消封存(write)Archive / /unarchive to restore (write)アーカイブ(/unarchive で復帰。write)
DELETE/api/v1/subnets/{id}刪除(該子網路 admin;連同 IP 一起刪,見下方警告)Delete (admin on the subnet; deletes its IPs too, see the warning below)削除(そのサブネットの admin。IP も一緒に削除。下の警告を参照)
POST/api/v1/subnets/bulk-delete批次刪除 {"ids":[…]},最多 500 筆;逐筆檢查 admin,沒權限的列在 errorsBulk delete {"ids":[…]}, up to 500; admin is checked per subnet and refusals are listed in errors一括削除 {"ids":[…]}、最大 500 件。admin を 1 件ずつ確認し、権限の無いものは errors に入ります
POST/api/v1/subnets/{id}/scan由 jt-ipam 伺服器本身同步做一次 ICMP 掃描(admin)。要叫掃描代理立刻掃,請用 POST /api/v1/scan-agents/{id}/scan-nowRun a synchronous ICMP sweep from the jt-ipam server itself (admin). To make the scan agent sweep now, use POST /api/v1/scan-agents/{id}/scan-nowjt-ipam サーバー自身から ICMP スキャンを同期実行(admin)。スキャンエージェントに即時スキャンさせるには POST /api/v1/scan-agents/{id}/scan-now を使います
GET/api/v1/subnets/overlaps/exists是否存在重疊網段(admin)Whether any overlapping subnets exist (admin)サブネットの重複が存在するか(admin)
PUT/api/v1/subnets/ai-audit-scope
/api/v1/subnets/anomaly-scope
一次設定哪些子網路納入 AI 巡檢/異常偵測 {"subnet_ids":[…]}(admin)Set which subnets are in AI audit / anomaly detection, {"subnet_ids":[…]} (admin)AI 監査/異常検知の対象サブネットをまとめて設定 {"subnet_ids":[…]}(admin)
刪除子網路是破壞性操作。底下的 IP 記錄與位址範圍會一起被刪除(資料庫外鍵 ON DELETE CASCADE),不會因為還有 IP 就被擋下;下層子網路則重新掛到上一層。需要的是該子網路的 admin 等級。只想讓它退出日常畫面,請改用 archive。 Deleting a subnet is destructive. Its IP records and address ranges are deleted with it (database foreign keys with ON DELETE CASCADE); it is not blocked while IPs remain. Child subnets are re-parented to the next level up. It requires admin on that subnet. If you only want it out of the way, use archive instead.サブネットの削除は破壊的な操作です。配下の IP レコードとアドレス範囲も一緒に削除され(データベースの外部キーが ON DELETE CASCADE)、IP が残っていても拒否されません。下位のサブネットは一つ上の階層に付け替えられます。そのサブネットの admin 権限が必要です。日常の画面から外したいだけなら archive を使ってください。
使用率請用 /usage,不要自己算 CIDR。jt-ipam 的「已用/可用」是依實際 IP 記錄與網段設定算的,跟純數學的 CIDR 容量不一樣(IPv4 會扣掉網路位址與廣播位址)。 Use /usage rather than computing from the CIDR. jt-ipam's used/free figures come from the actual IP records and subnet settings, which differ from raw CIDR arithmetic (IPv4 excludes the network and broadcast addresses).使用率は CIDR から自分で計算せず /usage を使ってください。jt-ipam の「使用中/空き」は実際の IP レコードとサブネットの設定から算出しており、単純な CIDR の計算とは異なります(IPv4 ではネットワークアドレスとブロードキャストアドレスを除きます)。

建立子網路的欄位Create fields作成時の項目

欄位Field項目說明Description説明
section_id, cidr必填。cidr 可為 IPv4 或 IPv6,主機位元會被正規化Required. cidr may be IPv4 or IPv6; host bits are normalised必須。cidr は IPv4/IPv6 のどちらでもよく、ホスト部は正規化されます
description最多 1024 字Up to 1024 chars最大 1024 文字
gateway, dns_servers預設閘道(須為 IP)與 DNS 伺服器(字串)Default gateway (must be an IP) and DNS servers (string)デフォルトゲートウェイ(IP であること)と DNS サーバー(文字列)
vlan_id, vrf_id, customer_id, location_id關聯的 VLAN、VRF、客戶、地點Linked VLAN, VRF, customer, location関連付ける VLAN・VRF・顧客・拠点
scan_enabled, scan_agent_id, scan_method是否掃描(預設否)、由哪個掃描代理掃、用哪些探測:icmp arp rdns netbios mdns dhcp os(預設 ["icmp"])Whether to scan (default off), which scan agent, and which probes: icmp arp rdns netbios mdns dhcp os (default ["icmp"])スキャンするか(既定は無効)、どのスキャンエージェントか、どの方法か:icmp arp rdns netbios mdns dhcp os(既定 ["icmp"])
scan_scope掃描範圍:auto(預設;4,096 個位址以內全掃,更大的子網路已知位址每輪掃、其餘每輪背景探索 1,024 個)、all(一律全掃,太大就分段輪替)、known(只掃已登記的 IP 與最近 7 天 ARP 看過的位址)、ranges(只掃這個子網路的位址範圍)。需要掃描代理 1.18.0 以上Scan scope: auto (default; subnets up to 4,096 addresses are swept, larger ones scan known addresses every cycle and explore 1,024 others per cycle in the background), all (always sweep, rotating through large subnets), known (only registered IPs and addresses seen in ARP in the last 7 days), ranges (only this subnet's address ranges). Needs scan agent 1.18.0 or laterスキャン範囲:auto(既定。4,096 アドレス以下は全スキャン、それより大きいサブネットは既知のアドレスを毎周、残りを毎周 1,024 個ずつバックグラウンドで探索)、all(常に全スキャン、大きければ分割巡回)、known(登録済みの IP と過去 7 日間に ARP で見えたアドレスのみ)、ranges(このサブネットのアドレス範囲のみ)。スキャンエージェント 1.18.0 以降が必要
threshold_pct使用率警示門檻(0~100)Usage alert threshold (0–100)使用率の警告しきい値(0~100)
ai_audit_enabled, anomaly_enabled是否納入 AI 巡檢/異常偵測(預設都是 true)Include in AI audit / anomaly detection (both default to true)AI 監査/異常検知の対象にするか(既定はどちらも true)
is_pool, is_full, auto_dns, jump_host_id, console_agent_id, custom_fields其他選用設定;jump_host_id 是主控台連線用的跳板,console_agent_id 是經由掃描代理中繼(兩者擇一,見第 13 節)Other optional settings; jump_host_id is the console jump host and console_agent_id relays through a scan agent (one or the other, see section 13)その他の任意設定。jump_host_id はコンソール接続用の踏み台、console_agent_id はスキャンエージェント経由の中継(どちらか一方、第 13 節を参照)
allow_overlap只在建立時有效:允許與既有網段重疊(例如不同客戶共用同一段)。不帶時重疊回 409Create-only: allow overlapping an existing subnet (e.g. different customers using the same range). Without it, an overlap returns 409作成時のみ有効:既存のサブネットとの重複を許可します(異なる顧客が同じ範囲を使う場合など)。付けないと重複時に 409

上層子網路(master_subnet_id)在建立時依包含關係自動算出,之後可以用 PATCH 調整。 The parent subnet (master_subnet_id) is computed from containment on create; you can adjust it later with PATCH.親サブネット(master_subnet_id)は作成時に包含関係から自動で決まり、後から PATCH で調整できます。

curl -X POST https://ipam.example.com/api/v1/subnets \
  -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -d '{"cidr":"192.0.2.0/24","section_id":"<section-uuid>","description":"office LAN",
       "gateway":"192.0.2.1","scan_enabled":true,"scan_agent_id":"<agent-uuid>",
       "scan_method":["icmp","arp","rdns"]}'

位址範圍(集區)Address ranges (pools)アドレス範囲(プール)

子網路底下可以劃出位址範圍,purpose 是 dhcp(預設)、reserved 或 other。讀取需要子網路 read、寫入需要 write。清單是純陣列,每筆附 size、used、first_free。自動建立的範圍(auto)被 DHCP 排除區間切成好幾段時合成一列:起訖是設定的整個範圍,size 已扣掉排除的位址,excluded 是排除數,segments 是各段起訖(first_free 會跳過排除的位址)。範圍超出子網路回 400、與既有範圍重疊回 409;依偵測到的 DHCP 發放範圍自動建立的(auto: true)跟著上游同步,不能手動修改或刪除(409 range_auto_managed)。 A subnet can hold address ranges whose purpose is dhcp (default), reserved or other. Reading needs read on the subnet; writing needs write. The list is a bare array, each item with size, used and first_free. An auto range (auto) that DHCP exclusions split into pieces is shown as one row: the start and end are the whole configured range, size leaves out excluded addresses, excluded is how many, and segments lists each piece (first_free skips excluded addresses). A range outside the subnet returns 400; an overlap with an existing range returns 409. Ranges created automatically from a detected DHCP pool (auto: true) follow the upstream server and cannot be edited or deleted by hand (409 range_auto_managed).サブネットの中にアドレス範囲を設けられます。purpose は dhcp(既定)・reserved・other のいずれかです。読み取りにはサブネットの read、書き込みには write が必要です。一覧は配列のみで、各要素に size・used・first_free が付きます。DHCP の除外範囲で複数に分かれた自動範囲(auto)は 1 行にまとめ、開始と終了は設定された範囲全体、size は除外アドレスを除いた数、excluded は除外数、segments は各区間です(first_free は除外アドレスを飛ばします)。サブネット外の範囲は 400、既存の範囲との重複は 409 です。検出した DHCP 配布範囲から自動作成されたもの(auto: true)は上流に従って同期され、手動では変更も削除もできません(409 range_auto_managed)。

方法Methodメソッド路徑Pathパス說明Description説明
GET POST/api/v1/subnets/{id}/ranges列出/建立(start_ip、end_ip 必填,另有 purpose、name、description)List / create (start_ip and end_ip required; also purpose, name, description)一覧/作成(start_ip・end_ip は必須。ほかに purpose・name・description)
PATCH DELETE/api/v1/subnets/{id}/ranges/{range_id}修改/刪除Update / delete変更/削除
curl -X POST https://ipam.example.com/api/v1/subnets/<subnet-uuid>/ranges \
  -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -d '{"start_ip":"192.0.2.100","end_ip":"192.0.2.199","purpose":"dhcp","name":"office DHCP"}'

7IP 位址(Addresses)IP addressesIP アドレス(Addresses)

IP 的權限跟著所屬子網路走:讀取要 read、新增與修改要 write、刪除要 admin。下表括號內是需要的等級。 IP permissions follow the parent subnet: reading needs read, creating and editing need write, deleting needs admin. The level each call needs is shown in brackets below.IP の権限は所属するサブネットに従います。読み取りは read、作成と変更は write、削除は admin が必要です。下表の括弧内が必要な段階です。

方法Methodメソッド路徑Pathパス說明Description説明
GET/api/v1/addresses列出/查詢(見下方參數)List / query (parameters below)一覧/検索(パラメータは下記)
GET/api/v1/addresses/{id}單筆詳情(read);另帶 liveness_rule(上線判定採信的來源與時限,與系統設定相同)、seen_integrations({"librenms": true, "adguard": false}:這些來源有沒有設定整合,只有布林值;畫面據此不列沒設定的來源),以及 rustdesk(對應到這個 IP 的 RustDesk ID:id、online、last_online_at、server_name、connect_uri、web_available、file_available,有客戶端回報時另有 hostname、os、username、version、evidence;沒有對應時為 null)。connect_uri 是 rustdesk://connect/…,不含密碼,只給有遠端主控台權限的人,其他人是 null。web_available 為 true 表示可以用相容 RustDesk 的網頁連線(伺服器開放網頁連線、而且你有權限),file_available 為 true 表示還可以用網頁檔案傳輸(伺服器設定 web_file_transfer 也打開),沒有權限兩個一律是 false。rustdesk 為 null、但同一台裝置的其他 IP 有 RustDesk 時(一台電腦多張網卡,RustDesk 只對應得到連線用的那個位址),rustdesk_elsewhere 列出那些 IP:address_id、ip、rustdesk_id、enabled(那個 IP 是否已啟用 RustDesk 連線);只認掛在同一台裝置上的 IP,只列你看得到的子網路,其他情況是空陣列。device_since 是目前這台設備開始用這個位址的時間(MAC 換成另一台時記下,唯讀;在這之前得到的 OS、類型等推導資料不採用)Get one (read); also carries liveness_rule (the liveness sources and time limit from system settings), seen_integrations ({"librenms": true, "adguard": false}: whether those sources have an integration configured, booleans only; the screen leaves out sources without one) and rustdesk (the RustDesk ID mapped to this IP: id, online, last_online_at, server_name, connect_uri, web_available, file_available, plus hostname, os, username, version and evidence when the client reports; null when nothing is mapped). connect_uri is a rustdesk://connect/… link without a password, given only to users with remote console rights; for others it is null. web_available is true when the RustDesk-compatible web connection can be used (the server allows web connections and you have the rights), and file_available is true when web file transfer can be used as well (the server setting web_file_transfer is on); without rights both are always false. When rustdesk is null but another IP of the same device has RustDesk (a computer with several network cards; RustDesk maps only to the address it connects from), rustdesk_elsewhere lists those IPs: address_id, ip, rustdesk_id, enabled (whether that IP has the RustDesk connection turned on). Only IPs linked to the same device count, only subnets you can see are listed, and otherwise it is an empty array. device_since is when the current device took the address (recorded when the MAC changes to a different device; read-only; OS, type and other derived data from before it are not used)単件の詳細(read)。liveness_rule(稼働判定に使うソースと時間。システム設定と同じ)、seen_integrations({"librenms": true, "adguard": false}:それらのソースの連携が設定されているか。真偽値のみ。画面は未設定のソースを表示しません)と rustdesk(この IP に対応する RustDesk ID:id・online・last_online_at・server_name・connect_uri・web_available・file_available。クライアントの報告があれば hostname・os・username・version・evidence も。対応がなければ null)も含みます。connect_uri はパスワードを含まない rustdesk://connect/… で、リモートコンソール権限のある人にだけ返し、それ以外は null。web_available が true なら RustDesk 互換の Web 接続が使えます(サーバーが Web 接続を許可し、権限もある場合)。file_available が true なら Web ファイル転送も使えます(サーバー設定 web_file_transfer もオン)。権限がなければどちらも常に false。rustdesk が null でも同じデバイスの別の IP に RustDesk がある場合(複数の NIC を持つコンピューター。RustDesk は接続に使うアドレスにだけ対応します)、rustdesk_elsewhere にその IP を返します:address_id・ip・rustdesk_id・enabled(その IP で RustDesk 接続が有効か)。同じデバイスに紐付いた IP だけが対象で、見えるサブネットのものだけを返し、それ以外は空の配列です。device_since は現在の機器がこのアドレスを使い始めた時刻です(MAC が別の機器に変わったときに記録、読み取り専用。それ以前に得た OS や種類などの推定データは採用しません)
POST/api/v1/addresses/{id}/rustdesk/local-open使用者要用本機的 RustDesk 客戶端軟體開啟這台時呼叫,只寫一筆稽核 rustdesk.local_client_open(誰、何時、哪個 RustDesk ID),回 204;連線在客戶端與對方之間,不經過 jt-ipam。權限同 IP 詳細資料給 rustdesk.connect_uri 的條件,沒有權限回 403、沒有對應的 RustDesk 裝置回 404。Call it when the user opens this host in the RustDesk client software on their own computer. It only writes the audit entry rustdesk.local_client_open (who, when, which RustDesk ID) and returns 204; the connection runs between that client and the device, not through jt-ipam. Same rights as the rustdesk.connect_uri field of the IP details: 403 without them, 404 when no RustDesk device matches.利用者が自分のコンピューターの RustDesk クライアントソフトでこのホストを開くときに呼びます。監査ログ rustdesk.local_client_open(誰が、いつ、どの RustDesk ID)を 1 件書くだけで、204 を返します。接続はクライアントと相手の間で行われ、jt-ipam は経由しません。権限は IP 詳細の rustdesk.connect_uri と同じで、権限がなければ 403、対応する RustDesk デバイスがなければ 404。
POST/api/v1/addresses/{id}/rustdesk/ticket相容 RustDesk 的網頁連線(只給瀏覽器用):換發 30 秒、單次有效的票證,之後用它開 WebSocket /api/v1/addresses/{id}/rustdesk/ws?ticket=…(後端只轉送密文)。body 可以帶 {"kind": "file"} 要檔案傳輸的票證(不帶或 "desktop" 是遠端桌面):權限與遠端桌面相同,另外要伺服器設定 web_file_transfer 打開,沒開回 409 rd_file_disabled;回應多 kind 與 file_limits(max_file_bytes、max_total_bytes,由瀏覽器照著擋)。檔案傳輸的 WebSocket 多一則瀏覽器送的控制訊息 {"t": "file_audit", "op", "path", "size", "result"}:op 只收 download、upload、delete、rename、mkdir(改名可以多帶 to),result 只收 ok、error、cancelled,size 要是非負整數,路徑截到 512 個字元;登入後才收,每條連線限流,不合格的丟掉。後端寫稽核 rustdesk.file_<op>(source: "browser",標明是瀏覽器回報、後端無法驗證),不含檔案內容。RustDesk-compatible web connection (browser only): issues a single-use ticket valid for 30 seconds, then used to open the WebSocket /api/v1/addresses/{id}/rustdesk/ws?ticket=… (the backend relays ciphertext only). The body may carry {"kind": "file"} for a file transfer ticket (none or "desktop" means remote desktop): same rights as the remote desktop, plus the server setting web_file_transfer must be on, otherwise 409 rd_file_disabled; the reply adds kind and file_limits (max_file_bytes, max_total_bytes, enforced by the browser). On a file transfer WebSocket the browser also sends the control message {"t": "file_audit", "op", "path", "size", "result"}: op is one of download, upload, delete, rename, mkdir (a rename may add to), result is ok, error or cancelled, size must be a non-negative integer and the path is capped at 512 characters; it is accepted only after login, rate-limited per connection, and anything else is dropped. The backend writes the audit entry rustdesk.file_<op> (source: "browser", marked as reported by the browser and not verifiable by the backend), without file contents.RustDesk 互換の Web 接続(ブラウザー専用):30 秒間・1 回だけ有効なチケットを発行し、それで WebSocket /api/v1/addresses/{id}/rustdesk/ws?ticket=… を開きます(バックエンドは暗号文を中継するだけ)。body に {"kind": "file"} を付けるとファイル転送用のチケットになります(なし、または "desktop" はリモートデスクトップ)。権限はリモートデスクトップと同じで、さらにサーバー設定 web_file_transfer がオンである必要があり、オフなら 409 rd_file_disabled。応答には kind と file_limits(max_file_bytes・max_total_bytes。ブラウザーが守ります)が加わります。ファイル転送の WebSocket ではブラウザーが制御メッセージ {"t": "file_audit", "op", "path", "size", "result"} も送ります:op は download・upload・delete・rename・mkdir のいずれか(名前の変更は to も付けられます)、result は ok・error・cancelled、size は 0 以上の整数、パスは 512 文字までに切り詰めます。ログイン後だけ受け付け、接続ごとに流量を制限し、条件に合わないものは捨てます。バックエンドは監査ログ rustdesk.file_<op> を書きます(source: "browser"。ブラウザーからの報告でバックエンドは検証できないと明記)。ファイルの中身は含みません。
GET/api/v1/addresses/{id}/console-route主控台會走哪條路(read):kind(direct/jump/agent)、name、source(ip/subnet)、ok;走不通時帶錯誤代碼(例如 jump_host_disabled、relay_agent_not_allowed)Which path consoles take (read): kind (direct / jump / agent), name, source (ip / subnet), ok; an error code when it cannot be used (e.g. jump_host_disabled, relay_agent_not_allowed)コンソールの接続経路(read):kind(direct/jump/agent)、name、source(ip/subnet)、ok。使えない場合はエラーコード(例:jump_host_disabled、relay_agent_not_allowed)
POST/api/v1/addresses建立(write;subnet_id、ip 必填)Create (write; subnet_id and ip required)作成(write。subnet_id・ip は必須)
POST/api/v1/addresses/first_free取得並配發第一個可用 IP(write)Claim the first free IP (write)最初の空き IP を確保する(write)
PATCH/api/v1/addresses/{id}部分更新(write)。liveness_from_device:上線狀態跟著所屬設備(多 LAN 路由器各網段的閘道這類不回應探測的介面位址):每輪同步把同一台設備其他位址最新的會過期證據、或 LibreNMS 回報設備在線的時間,記成 arp_seen.device,讀取時的 device_evidence_ip 是提供依據的位址;沒掛設備時不算離線。整合回報的設備介面位址另外記成 arp_seen 的 iface:opnsense、iface:pfsense、iface:fortigate、iface:mikrotik、iface:librenmsPartial update (write). liveness_from_device: liveness follows the linked device (for interface addresses that do not answer probes, such as the gateway of each LAN on a multi-LAN router): every sync records the newest expiring evidence of the device's other addresses, or the time LibreNMS reported the device up, as arp_seen.device, and reads return the address that supplied it as device_evidence_ip; with no device linked it does not count as offline. Device interface addresses reported by integrations are recorded in arp_seen as iface:opnsense, iface:pfsense, iface:fortigate, iface:mikrotik and iface:librenms部分更新(write)。liveness_from_device:オンライン状態を所属機器に従わせます(複数 LAN のルーターの各セグメントのゲートウェイなど、プローブに応答しないインターフェースアドレス向け)。同期のたびに、同じ機器のほかのアドレスの最新の期限切れする証拠、または LibreNMS が機器のオンラインを報告した時刻を arp_seen.device に記録し、読み取り時の device_evidence_ip がその根拠となったアドレスです。機器が紐づいていない場合はオフラインにしません。連携が報告した機器のインターフェースアドレスは arp_seen の iface:opnsense・iface:pfsense・iface:fortigate・iface:mikrotik・iface:librenms に記録します
DELETE/api/v1/addresses/{id}刪除(admin);位址會進入冷卻期Delete (admin); the address enters a cooldown period削除(admin)。アドレスはクールダウン期間に入ります
GET/api/v1/addresses/{id}/history異動記錄(limit/offset,上限 1000)Change history (limit/offset, up to 1000)変更履歴(limit/offset、上限 1000)
GET/api/v1/addresses/{id}/relations關係鏈(地點 → 機櫃 → 裝置 → 位址 → 子網路 → 區段)Relation chain (location → rack → device → address → subnet → section)関係の連鎖(拠点 → ラック → 機器 → アドレス → サブネット → セクション)
GET/api/v1/addresses/{id}/switch-port在 FDB 裡對到的交換器與連接埠The switch and port it is seen on in the FDBFDB 上で観測されたスイッチとポート
GET/api/v1/addresses/{id}/same-mac同一個 MAC 的其他位址(read;只列看得到的子網路,最多 20 筆,格式同單筆詳情)。給「上線狀態跟著設備」的提示用:多 LAN 路由器各網段的閘道常是同一個 MACOther addresses with the same MAC (read; only subnets you can see, at most 20, same shape as the detail). Used for the "Liveness follows its device" hint: the gateways of a multi-LAN router often share one MAC同じ MAC のほかのアドレス(read。見えるサブネットのみ、最大 20 件、単一取得と同じ形式)。「オンライン状態を所属機器に従わせる」の提案に使います。複数 LAN のルーターの各セグメントのゲートウェイは同じ MAC のことが多いためです
GET/api/v1/addresses/{id}/firewall哪些防火牆規則/NAT/別名管到這個 IP(另需全域讀取)Which firewall rules / NAT / aliases cover this IP (also needs global read)この IP に関係するファイアウォールのルール/NAT/エイリアス(全体の読み取りも必要)
GET POST/api/v1/addresses/{id}/device-suggestion
…/device-suggestion/apply
GET 只回「這個 IP 像是哪台裝置、或該建哪台」的建議,不改任何東西;apply(write)關聯到既有裝置 device_id,或以 create_name 新建(新建限 admin),link_ip_ids 可一併關聯其他 IPGET only suggests which device this IP belongs to (or which one to create) and changes nothing; apply (write) links an existing device via device_id or creates one via create_name (creating is admin-only), and link_ip_ids links other IPs at the same timeGET は「この IP がどの機器のものか、どの機器を作るべきか」の提案を返すだけで何も変更しません。apply(write)は device_id で既存の機器に関連付けるか、create_name で新規作成します(作成は admin のみ)。link_ip_ids で他の IP も同時に関連付けられます
GET DELETE/api/v1/addresses/{id}/hostname-sources
…/hostname-sources/{source}
各來源觀測到的主機名稱、目前釘選與全域優先序。每個觀測帶 reports(逐台回報:kind 為 scan_agent、integration、legacy 或 unknown,label 是代理或整合的名稱,另有 hostname、first_seen_at、last_seen_at)與 last_seen_at(任何一台最後一次回報;observed_at 只在名稱改變時更新);DELETE(write)清掉某來源的觀測並重算有效主機名稱。釘選來源用 PATCH 的 hostname_source_pinHostnames observed per source, the current pin and the global precedence. Each observation has reports (one per reporter: kind is scan_agent, integration, legacy or unknown, label is the agent or integration name, plus hostname, first_seen_at and last_seen_at) and last_seen_at (the last time any reporter sent it; observed_at only changes when the name changes); DELETE (write) clears one source's observation and recomputes the effective hostname. Pin a source with hostname_source_pin in PATCHソースごとに観測したホスト名、現在の固定、全体の優先順位。各観測には reports(報告元ごと:kind は scan_agent・integration・legacy・unknown、label はエージェントまたは連携の名前、ほかに hostname・first_seen_at・last_seen_at)と last_seen_at(いずれかの報告元が最後に報告した日時。observed_at は名前が変わったときだけ更新)が付きます。DELETE(write)はあるソースの観測を消して有効なホスト名を再計算します。ソースの固定は PATCH の hostname_source_pin で行います
GET POST/api/v1/addresses/cooldowns/{subnet_id}
…/cooldowns/{subnet_id}/{ip}/clear
仍在冷卻期(剛釋放、暫不配發)的位址;clear(admin)提前解除並可附 reason,記錄會保留Addresses still in cooldown (recently released, not handed out yet); clear (admin) ends it early with an optional reason, and the record is keptクールダウン中(解放直後で割り当て保留中)のアドレス。clear(admin)で早期解除でき、reason を付けられます。記録は残ります
POST/api/v1/addresses/bulk-delete
/api/v1/addresses/bulk-state
批次刪除 {"ids":[…]}/批次改狀態 {"ids":[…],"state":"…"},一次最多 5000 筆;逐筆檢查子網路 admin,失敗的列在 errorsBulk delete {"ids":[…]} / bulk state change {"ids":[…],"state":"…"}, up to 5000 per call; admin on each subnet is checked per item and failures are listed in errors一括削除 {"ids":[…]}/状態の一括変更 {"ids":[…],"state":"…"}、1 回最大 5000 件。サブネットの admin を 1 件ずつ確認し、失敗分は errors に入ります
POST/api/v1/addresses/notify-stale對選定的失聯 IP 發一則提醒給所有管理者 {"subnet_id","ids","days"}(write;筆數只算真的在這個子網路裡的 IP,days 0 到 36500)Send all admins a reminder about selected stale IPs, {"subnet_id","ids","days"} (write; only IPs that are really in the subnet are counted, days 0 to 36500)選んだ応答の無い IP について、全管理者に通知を送ります {"subnet_id","ids","days"}(write。件数はそのサブネットに実在する IP だけ、days は 0 から 36500)
GET/api/v1/addresses/{id}/uptime每日存活狀態,days 7~365(預設 90)Daily up/down status, days 7–365 (default 90)日ごとの生存状態。days は 7~365(既定 90)
POST/api/v1/addresses/uptime/batch多個 IP 一次查 {"ip_ids":[…],"days":90},最多 30 個;看不到的 ID 直接略過,不報錯Several IPs at once, {"ip_ids":[…],"days":90}, up to 30; IDs you cannot see are silently skipped複数の IP をまとめて {"ip_ids":[…],"days":90}、最大 30 件。閲覧できない ID はエラーにせず飛ばします
GET/api/v1/addresses/export.csv匯出 CSV;subnet_id 必填(read),UTF-8 含 BOMExport as CSV; subnet_id is required (read); UTF-8 with BOMCSV としてエクスポート。subnet_id は必須(read)。BOM 付き UTF-8
POST/api/v1/addresses/import匯入 CSV(write),見下方Import CSV (write), see belowCSV の取り込み(write)。下記を参照
POST GET/api/v1/addresses/{id}/identifyIP 探測(admin),見第 10 節IP probe (admin), see section 10IP プローブ(admin)。第 10 節を参照
DELETE/api/v1/addresses/{id}/ssh/host-key清除 SSH/SFTP 主控台記住的主機金鑰(位址換給另一台設備、或對方重新安裝後,舊金鑰一定對不上)。要子網路的 write(只有連線權限不夠,403 console_hostkey_reset_forbidden);看不到的位址回 404。回 {"cleared": true},沒有記住的金鑰時是 false(不寫稽核);稽核 ssh.hostkey_reset 附舊金鑰的指紋。下次連線會先送出新金鑰的指紋讓人確認。已存帳密清單(/api/v1/ssh-credentials)的 device_changed 為 true 表示這筆指定給某個位址的帳密是在位址換給目前這台設備之前存的Forget the host key the SSH/SFTP consoles saved (after the address goes to a different device or the host is reinstalled, the old key can never match). Needs write on the subnet (console permission alone is not enough: 403 console_hostkey_reset_forbidden); an address you cannot see returns 404. Returns {"cleared": true}, or false when no key was saved (no audit entry); the audit entry ssh.hostkey_reset carries the old key's fingerprint. The next connection sends the new key's fingerprint for confirmation first. In the saved credential list (/api/v1/ssh-credentials), device_changed true means a credential for a specific address was saved before the address went to its current deviceSSH/SFTP コンソールが記憶したホスト鍵を消去します(アドレスが別の機器に割り当てられたり、ホストを再インストールしたりすると、古い鍵とは一致しません)。サブネットへの write が必要です(接続権限だけでは不可:403 console_hostkey_reset_forbidden)。見えないアドレスは 404。{"cleared": true} を返し、記憶した鍵がない場合は false(監査ログなし)。監査ログ ssh.hostkey_reset には古い鍵のフィンガープリントが入ります。次回の接続では、まず新しい鍵のフィンガープリントを確認用に送ります。保存済み認証情報の一覧(/api/v1/ssh-credentials)の device_changed が true の場合、特定アドレス向けの認証情報が、そのアドレスが現在の機器に割り当てられる前に保存されたことを示します

查詢參數Query parametersクエリパラメータ

參數Parameterパラメータ說明Description説明
subnet_id限定某個子網路Restrict to one subnet特定のサブネットに限定
section_id限定某個區段Restrict to one section特定のセクションに限定
customer_id限定某個客戶/管理單位Restrict to one customer特定の顧客/管理組織に限定
device_id限定掛在某個裝置上Restrict to one device特定の機器に紐づくものに限定
q關鍵字(IP、主機名稱、MAC、說明…)Free text (IP, hostname, MAC, description…)キーワード(IP、ホスト名、MAC、説明など)
exact精準比對而非模糊Exact match instead of fuzzyあいまい検索ではなく完全一致
sort / order排序欄位:ip(預設)、hostname、mac、mac_vendor、state、owner、switch_port、device(裝置名稱)、description、note、discovery_source、device_kind、last_seen(掃描代理、LibreNMS、ARP 最新的那個)、stale_days(失聯天數,只看掃描代理與 LibreNMS;從沒看過的最久)/ asc|desc。沒有值的一律排最後Sort field: ip (default), hostname, mac, mac_vendor, state, owner, switch_port, device (device name), description, note, discovery_source, device_kind, last_seen (newest of scan agent, LibreNMS and ARP), stale_days (days without a sighting, scan agent and LibreNMS only; never seen counts as longest) / asc|desc. Rows without a value always sort last並べ替えの項目:ip(既定)、hostname、mac、mac_vendor、state、owner、switch_port、device(デバイス名)、description、note、discovery_source、device_kind、last_seen(スキャンエージェント・LibreNMS・ARP のうち最新)、stale_days(未確認日数。スキャンエージェントと LibreNMS のみ。一度も確認されていないものが最長)/ asc|desc。値のない行は常に最後
page / page_size分頁;page_size 預設 100、上限 1000Paging; page_size defaults to 100, max 1000ページング。page_size は既定 100、上限 1000

全站 IP 異動記錄:GET /api/v1/ip-changes,依子網路可見範圍過濾。參數:q(IP、欄位、新舊值、備註)、ip_id、subnet_id、section_id、customer_id、event_type、source、since / until、page / page_size(上限 500)、sort(created_at 預設、ip 照位址大小、event_type、field、source、actor)/ order(預設 desc)。沒有值的排最後;每筆帶 ip_id,IP 已刪除時是 null。Site-wide IP change log: GET /api/v1/ip-changes, filtered by subnet visibility. Parameters: q (IP, field, old/new value, note), ip_id, subnet_id, section_id, customer_id, event_type, source, since / until, page / page_size (max 500), sort (created_at default, ip by address value, event_type, field, source, actor) / order (default desc). Rows without a value sort last; each row carries ip_id, which is null once the IP has been deleted.全体の IP 変更履歴:GET /api/v1/ip-changes(サブネットの閲覧範囲で絞り込み)。パラメータ:q(IP・項目・新旧の値・備考)、ip_id、subnet_id、section_id、customer_id、event_type、source、since / until、page / page_size(上限 500)、sort(created_at が既定、ip はアドレスの大小順、event_type、field、source、actor)/ order(既定 desc)。値のない行は最後。各行に ip_id があり、IP が削除されると null になります。

# 查某網段裡所有 IP / all IPs in one subnet
curl -G https://ipam.example.com/api/v1/addresses \
  -H "Authorization: Bearer $TOKEN" \
  --data-urlencode "subnet_id=<subnet-uuid>" --data-urlencode "page_size=1000"

# 依主機名稱找 / find by hostname
curl -G https://ipam.example.com/api/v1/addresses \
  -H "Authorization: Bearer $TOKEN" --data-urlencode "q=web01"
同一個 IP 字串可能出現多筆。唯一鍵是「子網路 + IP」,所以在重疊網段(不同客戶共用 198.51.100.0/24)的環境裡,同一個 IP 會跨多個子網路各有一筆,這是設計如此。用 subnet_id 限定範圍,不要假設 IP 唯一。 The same IP string may appear more than once. The unique key is (subnet, IP), so with overlapping subnets (different customers sharing 198.51.100.0/24) one IP legitimately has a row per subnet. Scope your queries with subnet_id; don't assume an IP is unique.同じ IP 文字列が複数件現れることがあります。一意キーは「サブネット + IP」です。したがって重複するサブネット(異なる顧客が同じ 198.51.100.0/24 を使っている環境)では、同じ IP がサブネットごとに 1 件ずつ存在します。これは仕様です。subnet_id で範囲を限定し、IP が一意であると仮定しないでください。

CSV 匯入CSV importCSV の取り込み

POST /api/v1/addresses/import 是 multipart/form-data,欄位是 subnet_id(必填)、file(必填,UTF-8 CSV,最大 16 MB)、dry_run(預設 false)。CSV 依標題列對欄,至少要有 ip;已存在的「子網路 + IP」會略過。dry_run=true 同步回預覽、不寫入;實際匯入走背景作業,回 task_id,進度用 GET /api/v1/tasks/{task_id} 查。 POST /api/v1/addresses/import is multipart/form-data with subnet_id (required), file (required, UTF-8 CSV, up to 16 MB) and dry_run (default false). Columns are matched by the header row, which must include ip; existing (subnet, IP) pairs are skipped. dry_run=true returns a preview synchronously without writing; a real import runs as a background task and returns a task_id you can follow with GET /api/v1/tasks/{task_id}.POST /api/v1/addresses/import は multipart/form-data で、項目は subnet_id(必須)、file(必須、UTF-8 の CSV、最大 16 MB)、dry_run(既定 false)です。列は見出し行で対応付け、ip が必須です。既存の「サブネット + IP」は飛ばします。dry_run=true は書き込まずにプレビューを同期で返し、実際の取り込みはバックグラウンド処理になって task_id を返します。進捗は GET /api/v1/tasks/{task_id} で確認します。

GET /api/v1/addresses/unmanaged?subnet_id=… 回這個子網路裡沒有 IP 記錄、但最近 7 天看得到在用的位址(掃描代理的目擊與 LibreNMS ARP 表),每筆有 ip、last_seen_at、sources(scanner、arp:librenms…)、mac、vendor、hostname。權限同 IP 清單(子網路的讀取權限,沒有回 404)。 GET /api/v1/addresses/unmanaged?subnet_id=… returns the addresses in that subnet that have no IP record but were seen in use in the last 7 days (scan agent sightings and LibreNMS ARP), each with ip, last_seen_at, sources (scanner, arp:librenms, …), mac, vendor and hostname. Same permission as the IP list (read access to the subnet, 404 otherwise).GET /api/v1/addresses/unmanaged?subnet_id=… は、そのサブネットで IP の記録はないが直近 7 日に使用が見えたアドレス(スキャンエージェントの観測と LibreNMS の ARP)を返します。各件に ip・last_seen_at・sources(scanner、arp:librenms など)・mac・vendor・hostname があります。権限は IP 一覧と同じです(サブネットの読み取り権限、無ければ 404)。

curl -X POST https://ipam.example.com/api/v1/addresses/import \
  -H "Authorization: Bearer $TOKEN" \
  -F subnet_id=<subnet-uuid> -F dry_run=true -F file=@addresses.csv

8裝置(Devices)Devices機器(Devices)

讀取依裝置的可見範圍;新增、修改、刪除與匯入都只有 admin 能做。 Reads follow device visibility; creating, editing, deleting and importing are admin-only.読み取りは機器の閲覧範囲に従います。作成・変更・削除・取り込みは admin のみです。

方法Methodメソッド路徑Pathパス說明Description説明
GET/api/v1/devices列出。可篩選 type、location_id、rack_id、subnet_id、q(page_size 上限 500)List. Filters: type, location_id, rack_id, subnet_id, q (page_size up to 500)一覧。type・location_id・rack_id・subnet_id・q で絞り込めます(page_size の上限は 500)
GET/api/v1/devices/{id}單筆詳情Get one単件の詳細
GET/api/v1/devices/{id}/relations關聯(IP/機櫃/佈線…)Relations (IPs / rack / cabling…)関連(IP/ラック/配線など)
GET/api/v1/devices/{id}/integrations各整合帶回的資料Data pulled in by integrations各連携が取り込んだデータ
GET/api/v1/devices/{id}/librenms對應的 LibreNMS 裝置資料The matching LibreNMS device data対応する LibreNMS の機器データ
GET/api/v1/devices/{id}/vlansVLAN 對應(純陣列)VLAN mappings (bare array)VLAN の対応(配列のみ)
GET/api/v1/devices/{id}/uptime每日存活狀態,days 7~365(預設 90)Daily up/down status, days 7–365 (default 90)日ごとの生存状態。days は 7~365(既定 90)
POST/api/v1/devices建立(admin;name 必填)Create (admin; name required)作成(admin。name は必須)
PATCH/api/v1/devices/{id}部分更新(admin)Partial update (admin)部分更新(admin)
DELETE/api/v1/devices/{id}刪除(admin)Delete (admin)削除(admin)
POST/api/v1/devices/bulk-delete批次刪除 {"ids":[…]},一次最多 500 筆(admin)Bulk delete {"ids":[…]}, up to 500 per call (admin)一括削除 {"ids":[…]}、1 回最大 500 件(admin)
GET/api/v1/devices/import-template匯入範本 CSV;?include_devices=true 會帶出全部現有裝置,改完用「更新」模式匯回(admin)Import template CSV; ?include_devices=true includes every existing device so you can edit and re-import in update mode (admin)取り込み用テンプレート CSV。?include_devices=true で既存の全機器を含め、編集後に「更新」モードで取り込み直せます(admin)
POST/api/v1/devices/import批次匯入(admin),見下方Bulk import (admin), see below一括取り込み(admin)。下記を参照

裝置匯入Device import機器の取り込み

POST /api/v1/devices/import 是 multipart/form-data:file(CSV 或 Excel .xlsx,最大 16 MB、最多 5,000 列)、dry_run、on_existing(skip 預設/update)。注意 dry_run 預設是 true:不帶參數時只回每一列的預覽(新增/更新/略過/錯誤與原因),不寫入。帶 dry_run=false 才真的匯入,走背景作業並回 task_id。 POST /api/v1/devices/import is multipart/form-data: file (CSV or Excel .xlsx, up to 16 MB and 5,000 rows), dry_run, and on_existing (skip by default, or update). Note that dry_run defaults to true: without it you only get a per-row preview (create / update / skip / error with the reason) and nothing is written. Send dry_run=false to import for real; that runs as a background task and returns a task_id.POST /api/v1/devices/import は multipart/form-data で、file(CSV または Excel の .xlsx、最大 16 MB・5,000 行)、dry_run、on_existing(既定 skip、または update)を受け取ります。dry_run の既定は true である点に注意してください。指定しないと行ごとのプレビュー(作成/更新/スキップ/エラーと理由)だけが返り、何も書き込まれません。実際に取り込むには dry_run=false を送ります。バックグラウンド処理になり task_id を返します。

curl -X POST https://ipam.example.com/api/v1/devices/import \
  -H "Authorization: Bearer $TOKEN" \
  -F file=@devices.xlsx -F dry_run=false -F on_existing=update

GET /api/v1/search?q=…&limit_per_type=… 是全站搜尋(q 1~128 字,limit_per_type 1~50、預設 8),跨區段/子網路/IP/裝置/客戶/機櫃/地點/VLAN/虛擬機/NAT/DNS 記錄等型別,並依你的可見範圍過濾。支援部分 MAC 首碼(如 00:00:5e)。每個型別先排真正包含查詢字的結果,再排相似的;有任何包含查詢字的結果時,只回傳那些。搜哪些型別、比對哪些欄位、排列順序照管理員的全站搜尋設定(GET/PUT /api/v1/system/search-settings:instant 隨打即找、types 依排列順序列出 {type, enabled, fields}、catalog 是每個型別可比對的欄位;任何登入帳號可讀,修改要 admin 並留稽核,一個型別都沒開或開了沒勾欄位時回 422 search_settings_no_type/search_settings_no_field)。回應的 order 是分組順序。虛擬機:vm 的 id 是它的 IP 記錄,vm_record(沒有 IP 記錄,需全域讀取)的 id 是「平台.VM id」。 GET /api/v1/search?q=…&limit_per_type=… is a global search (q 1–128 chars, limit_per_type 1–50, default 8) across sections, subnets, IPs, devices, customers, racks, locations, VLANs, VMs, NAT, DNS records and more, filtered to what you may see. Partial MAC prefixes (e.g. 00:00:5e) work. Each type ranks results that contain the query before similar ones, and when any result contains the query only those are returned. Which types and fields are searched, and in what order, follows the administrator's global search settings (GET/PUT /api/v1/system/search-settings: instant for search as you type, types as {type, enabled, fields} in display order, and catalog with the fields each type can match; any signed-in account can read it, changing it needs admin and is audited, and no enabled type or an enabled type without fields returns 422 search_settings_no_type/search_settings_no_field). The response's order is the group order. Virtual machines: a vm hit's id is its IP record; a vm_record hit (no IP record, needs global read) has id "platform.VM id".GET /api/v1/search?q=…&limit_per_type=… は横断検索です(q は 1~128 文字、limit_per_type は 1~50・既定 8)。セクション/サブネット/IP/機器/顧客/ラック/拠点/VLAN/仮想マシン/NAT/DNS レコードなどの種別をまたぎ、閲覧可能な範囲に絞って返します。MAC の部分的な接頭辞(00:00:5e など)にも対応します。各種別でクエリを含む結果を類似の結果より先に並べ、クエリを含む結果があればそれだけを返します。検索する種別・照合するフィールド・並び順は管理者の全体検索設定に従います(GET/PUT /api/v1/system/search-settings:instant は入力中に検索、types は並び順どおりの {type, enabled, fields}、catalog は各種別で照合できるフィールド。ログイン済みなら読めますが、変更は admin のみで監査ログに残り、種別が 1 つもオンでない・オンの種別にフィールドがない場合は 422 search_settings_no_type/search_settings_no_field)。応答の order はグループの順序です。仮想マシン:vm の id は IP レコード、vm_record(IP レコードなし、全体の閲覧権限が必要)の id は「プラットフォーム.VM id」です。

計算與查詢工具(GET)Calculators and lookups (GET)計算と照会のツール(GET)

以下 /api/v1/tools/* 都是 GET、不改任何資料,任何登入帳號都能用,唯讀權杖也可以。其中 dns-lookup、dns-mail 會由伺服器向 DNS 解析器查詢,geoip 會呼叫 MaxMind GeoLite2 網路服務(管理者要先填好憑證)。 The /api/v1/tools/* calls below are all GET, change no data, and work for any signed-in account, read-only tokens included. dns-lookup and dns-mail query DNS resolvers from the server, and geoip calls the MaxMind GeoLite2 web service (an admin must configure credentials first).以下の /api/v1/tools/* はすべて GET でデータを変更せず、ログイン済みの任意のアカウント(読み取り専用トークンを含む)で使えます。dns-lookup と dns-mail はサーバーから DNS リゾルバに問い合わせ、geoip は MaxMind GeoLite2 の Web サービスを呼びます(管理者が先に認証情報を設定する必要があります)。

端點Endpointエンドポイント用途Purpose用途
ip-info / cidr-infoIP/網段基本資訊IP / CIDR factsIP/ネットワークの基本情報
cidr-split / aggregate切分 / 聚合網段Split / aggregate prefixesネットワークの分割・集約
ip-in-cidr / cidr-relation包含關係判斷Containment and relation checks包含関係の判定
range-to-cidr / cidr-to-range範圍 ↔ 網段互轉Range ↔ CIDR conversion範囲 ↔ ネットワークの相互変換
netmask / eui64 / mac-format遮罩換算、EUI-64、MAC 格式化Netmask conversion, EUI-64, MAC formattingサブネットマスクの換算、EUI-64、MAC の整形
dns-lookup / fqdn / dns-mail / geoipDNS 查詢(A/AAAA/PTR)、FQDN 解析、郵件記錄(MX/SPF/DMARC/DKIM)、GeoIPDNS lookups (A / AAAA / PTR), FQDN parsing, mail records (MX / SPF / DMARC / DKIM), GeoIPDNS の問い合わせ(A/AAAA/PTR)、FQDN の解析、メール関連レコード(MX/SPF/DMARC/DKIM)、GeoIP

網路診斷 tools/net/*(會實際送封包)Network diagnostics tools/net/* (send real traffic)ネットワーク診断 tools/net/*(実際にパケットを送ります)

這組不是無副作用的計算。它們會由 jt-ipam 伺服器(agent-probe 則是掃描代理)對你指定的目標實際發送封包。每次呼叫都會寫稽核,並有每位使用者每分鐘 30 次的限流;單次最多 64 個目標。因為是 POST,唯讀權杖一律 403。agent-probe 只有 admin 能用。 These are not side-effect-free calculators. They send real packets to the targets you name, from the jt-ipam server (or, for agent-probe, from a scan agent). Every call is audited and limited to 30 per minute per user, with at most 64 targets per call. Being POST, they always return 403 to read-only tokens. agent-probe is admin-only.これらは副作用の無い計算ではありません。jt-ipam サーバーから(agent-probe はスキャンエージェントから)指定した対象へ実際にパケットを送ります。呼び出しはすべて監査に記録され、ユーザーごとに毎分 30 回の制限があり、1 回の対象は最大 64 件です。POST なので読み取り専用トークンは常に 403 になります。agent-probe は admin のみです。
方法Methodメソッド路徑(接在 /api/v1/tools/net/ 之後)Path (after /api/v1/tools/net/)パス(/api/v1/tools/net/ に続く部分)用途Purpose用途
GETcapabilities這台伺服器有哪些診斷工具可用(不送封包、不限流)Which diagnostic tools this server has (no traffic, not rate limited)このサーバーで使える診断ツール(パケット送信なし、制限なし)
POSTpingping 一個或多個目標(targets 可用換行、逗號或 CIDR;count 1~10)Ping one or more targets (targets separated by newlines or commas, or a CIDR; count 1–10)1 件以上の対象に ping(targets は改行・カンマ区切りまたは CIDR。count は 1~10)
POSTtraceroute / traceroute/stream路徑追蹤(最多 30 跳,含路徑 MTU);/stream 以 SSE 一跳一列即時回報Path trace (up to 30 hops, with path MTU); /stream reports each hop live over SSE経路の追跡(最大 30 ホップ、経路 MTU を含む)。/stream は SSE で 1 ホップずつ送ります
POSTtcp / udpTCP/UDP 埠連通性(每次最多 8 個埠;UDP 分 open/closed/no_reply)TCP / UDP port checks (up to 8 ports per call; UDP reports open / closed / no_reply)TCP/UDP ポートの疎通(1 回最大 8 ポート。UDP は open/closed/no_reply)
POSTtls對方實際送出的憑證:主體、簽發者、效期、SAN、是否受信任The certificate the target actually presents: subject, issuer, validity, SAN, trust相手が実際に提示する証明書:主体、発行者、有効期間、SAN、信頼性
POSThttp狀態碼、轉址鏈與重要回應標頭Status code, redirect chain and key response headersステータスコード、リダイレクトの連鎖、主要な応答ヘッダ
POSTrdns整批查 PTR,找出沒有反解的位址Bulk PTR lookups, to find addresses without reverse DNSPTR の一括照会。逆引きの無いアドレスを見つけます
POSTagent-probe(admin)指派一次探測給某個掃描代理 {"agent_id","kind","targets",…},kind 為 ping/tcp/traceroute/rdns;回 202 與 job_id(admin) Hand one probe to a scan agent, {"agent_id","kind","targets",…}, with kind ping / tcp / traceroute / rdns; returns 202 and a job_id(admin)スキャンエージェントに 1 回のプローブを割り当てます {"agent_id","kind","targets",…}。kind は ping/tcp/traceroute/rdns。202 と job_id を返します
GETagent-probe/{job_id}(admin)輪詢結果,直到 status 不是 pending/running;代理 2 分鐘內沒領走就作廢(admin) Poll for the result until status is no longer pending/running; a job the agent does not pick up within 2 minutes expires(admin)status が pending/running でなくなるまで結果をポーリングします。2 分以内にエージェントが受け取らなければ無効になります
curl -X POST https://ipam.example.com/api/v1/tools/net/tcp \
  -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -d '{"targets":"192.0.2.10, 192.0.2.11","ports":[22,443]}'

10IP 探測IP probeIP プローブ

IP 探測是管理員限定的單次深度識別:由該位址所屬子網路的掃描代理,對目標跑一次 nmap 服務偵測(前面先做反解、NetBIOS、mDNS),再用已安裝的 Recog 指紋庫把結果歸納成作業系統與產品。jt-ipam 伺服器本身不會連到目標。代理要跑的腳本清單寫死在代理程式裡(banner、http-title、http-server-header、ssl-cert、ssh-hostkey、smb-os-discovery、rdp-ntlm-info),伺服器改不了。banner 只跑在 FTP、SSH、Telnet、SMTP、POP3、IMAP 的埠(代理 1.18.1 起):nmap 的 banner 在不先說話的埠上會改用 TLS 再連一次,印表機的 RAW 列印埠(9100)會把那段 TLS 交握當成列印工作印出來。服務偵測可能觸發 IDS 告警,請只對你負責的主機使用。 The IP probe is an admin-only, single deep identification: the scan agent of the address's subnet runs one nmap service scan against the target (after reverse DNS, NetBIOS and mDNS lookups), and the result is summarised into OS and product using the installed Recog fingerprint database. The jt-ipam server never connects to the target itself. The list of scripts is hard-coded in the agent (banner, http-title, http-server-header, ssl-cert, ssh-hostkey, smb-os-discovery, rdp-ntlm-info) and cannot be changed by the server. banner runs only on FTP, SSH, Telnet, SMTP, POP3 and IMAP ports (agent 1.18.1 and later): on a port that does not speak first, nmap's banner retries over TLS, and a printer's raw print port (9100) prints that TLS handshake as a job. Service detection may trigger IDS alerts; only probe hosts you are responsible for.IP プローブは管理者限定の、一回ごとの詳細な識別です。そのアドレスが属するサブネットのスキャンエージェントが、対象に nmap のサービス検出を一度実行し(その前に逆引き、NetBIOS、mDNS を照会)、導入済みの Recog フィンガープリントで OS と製品にまとめます。jt-ipam サーバー自身が対象に接続することはありません。実行するスクリプトの一覧はエージェント側に固定されており(banner、http-title、http-server-header、ssl-cert、ssh-hostkey、smb-os-discovery、rdp-ntlm-info)、サーバーからは変更できません。banner は FTP・SSH・Telnet・SMTP・POP3・IMAP のポートだけで実行します(エージェント 1.18.1 以降)。nmap の banner は先に話さないポートでは TLS で接続し直し、プリンターの RAW 印刷ポート(9100)はその TLS ハンドシェイクを印刷ジョブとして印刷してしまうためです。サービス検出は IDS の警告を招くことがあるため、担当しているホストにだけ使ってください。

方法Methodメソッド路徑Pathパス說明Description説明
POST/api/v1/addresses/{id}/identify對已登記的 IP 發起探測,回 202 與工作 idStart a probe for a registered IP; returns 202 and a job id登録済みの IP にプローブを開始。202 とジョブ ID を返します
GET/api/v1/addresses/{id}/identify
…/identify/history
…/identify/{job_id}
最近一次結果/歷次探測(limit 最多 200)/單次結果。結果會附上與前一次相比的變化。summary.vendor 是設備本身的廠牌(服務自己講的、或可信的指紋),summary.nic_vendor 是網卡的 OUI 廠牌,兩者不一定相同;summary.ipam({kind, reason})是 IP 記錄對照 IPAM 已知的事實後採用的類型與依據(device: 裝置記錄、librenms:、wazuh:、rustdesk:、ocs:、virt: 虛擬化平台),沒有改變時不帶。device_type 可能是 mobile(手機/平板)。summary 另外帶:scan_failed/scan_error(nmap 本身失敗,跟 no_response 主機沒回應是兩回事)、windows(RDP 與 SMB 講的電腦名稱、網域、工作群組、版本)、certs(每個 TLS 埠的主體、簽發者、有效期間、SHA-256/SHA-1 指紋、金鑰、SAN)、ssh_keys(主機金鑰指紋,代理 1.17.4 起是 SHA256)、port_counts(開放/關閉/過濾,舊代理的 filtered 是 null)、distance、uptime_seconds、elapsed、os_scan(false =代理不是 root、沒做 OS 指紋)、name_sources(每個名稱的來源)、mac(算網卡廠牌用的 MAC)/mac_seen(這次 nmap 看到的)、notes(判斷的理由,[{code, params}])。changes 另外帶 fields(MAC、作業系統、設備類型)、names_added/names_removed、ssh_keys、certs;其中一次沒回應或失敗時連接埠不比,baseline/current 說明原因。探測早於這個位址換給目前這台設備時帶 before_device_change: true,也不跟之後的結果比較Latest result / past probes (limit up to 200) / one result. Each result includes what changed since the previous probe. summary.vendor is the device's own vendor (what its services say, or a trusted fingerprint) and summary.nic_vendor is the NIC's OUI vendor; they are not always the same. summary.ipam ({kind, reason}) is the type the IP record uses after checking what IPAM already knows, and why (device: device record, librenms:, wazuh:, rustdesk:, ocs:, virt: virtualization platform); it is absent when nothing changes. device_type can be mobile (phone/tablet). summary also has: scan_failed/scan_error (nmap itself failed, which is not the same as no_response, the host not answering), windows (computer name, domain, workgroup and version from RDP and SMB), certs (per TLS port: subject, issuer, validity, SHA-256/SHA-1 fingerprint, key, SAN), ssh_keys (host key fingerprints, SHA256 from agent 1.17.4), port_counts (open/closed/filtered; filtered is null for older agents), distance, uptime_seconds, elapsed, os_scan (false means the agent is not root and skipped OS fingerprinting), name_sources (where each name came from), mac (the MAC the NIC vendor came from) / mac_seen (what nmap saw this time) and notes (the reasons behind the result, [{code, params}]). changes also has fields (MAC, OS, device type), names_added/names_removed, ssh_keys and certs; when either probe got no response or failed, ports are not compared and baseline/current says why. A probe from before the address went to its current device has before_device_change: true and is not compared with later ones直近の結果/過去のプローブ(limit は最大 200)/単一の結果。各結果には前回からの変化が付きます。summary.vendor はデバイス自体のメーカー(サービス自身の申告か信頼できる指紋)、summary.nic_vendor は NIC の OUI メーカーで、同じとは限りません。summary.ipam({kind, reason})は IPAM が既に知っている事実と照合したうえで IP レコードが採用した種類と根拠(device: デバイス記録、librenms:、wazuh:、rustdesk:、ocs:、virt: 仮想化プラットフォーム)で、変化がなければ付きません。device_type は mobile(スマートフォン/タブレット)の場合があります。summary にはさらに次が付きます:scan_failed/scan_error(nmap 自体の失敗。ホストが応答しない no_response とは別物)、windows(RDP と SMB が示すコンピューター名・ドメイン・ワークグループ・バージョン)、certs(TLS ポートごとのサブジェクト・発行者・有効期間・SHA-256/SHA-1 フィンガープリント・鍵・SAN)、ssh_keys(ホストキーのフィンガープリント。エージェント 1.17.4 から SHA256)、port_counts(オープン/クローズ/フィルタ。古いエージェントの filtered は null)、distance、uptime_seconds、elapsed、os_scan(false はエージェントが root でなく OS 指紋を省略)、name_sources(各名前の出所)、mac(NIC ベンダーの算出に使った MAC)/mac_seen(今回 nmap が見た MAC)、notes(判定の理由、[{code, params}])。changes には fields(MAC・OS・機器の種類)、names_added/names_removed、ssh_keys、certs も付きます。どちらかのプローブが無応答または失敗した場合はポートを比較せず、baseline/current に理由が入ります。アドレスが現在の機器に割り当てられる前のプローブには before_device_change: true が付き、それ以降の結果とは比較しません
GET/api/v1/identify/ip/{ip}以位址查:所屬子網路、負責的代理、是否已有記錄By address: its subnet, the responsible agent, and whether a record existsアドレスで照会:所属サブネット、担当エージェント、レコードの有無
POST GET/api/v1/identify/ip/{ip}
…/ip/{ip}/history · …/ip/{ip}/{job_id}
對尚未登記的位址探測,但它必須落在 jt-ipam 管理的(未封存)子網路內Probe an address that is not registered, as long as it falls inside a (non-archived) subnet jt-ipam manages未登録のアドレスをプローブします。ただし jt-ipam が管理する(アーカイブされていない)サブネット内であること
POST/api/v1/addresses/{id}/identify/{job_id}/cancel
/api/v1/identify/ip/{ip}/{job_id}/cancel
取消等待中或執行中的探測(已結束回 409 identify_not_running);代理之後送回的結果不會寫回,寫稽核 identify_cancelCancel a pending or running probe (a finished one returns 409 identify_not_running); results the agent sends later are not recorded; audited as identify_cancel待機中または実行中のプローブを中止します(終了済みは 409 identify_not_running)。エージェントが後から送る結果は記録しません。identify_cancel として監査に記録されます

常見的拒絕:位址不在任何管理中的子網路 → 404 identify_not_managed;不是單一位址或是網路/廣播位址 → 400 identify_bad_target;重疊網段分屬不同代理 → 409 identify_ambiguous;子網路沒有啟用中的掃描代理 → 409 identify_no_agent;同一位址已有探測在跑 → 409 identify_in_progress。每個代理最多 20 件待處理工作,代理領走後 9 分鐘沒回報就作廢。每次發起都會寫稽核。tools/net/agent-probe 不接受 identify,只能從這裡發起。 Common refusals: address outside every managed subnet → 404 identify_not_managed; not a single address, or the network/broadcast address → 400 identify_bad_target; overlapping subnets served by different agents → 409 identify_ambiguous; no enabled scan agent on the subnet → 409 identify_no_agent; a probe already running for that address → 409 identify_in_progress. Each agent holds at most 20 pending jobs, and a claimed job with no report after 9 minutes expires. Every start is audited. tools/net/agent-probe refuses identify; start it only from these endpoints.よくある拒否:管理中のどのサブネットにも含まれない → 404 identify_not_managed、単一のアドレスでない・ネットワーク/ブロードキャストアドレス → 400 identify_bad_target、重複するサブネットが別々のエージェントの担当 → 409 identify_ambiguous、サブネットに有効なスキャンエージェントが無い → 409 identify_no_agent、同じアドレスのプローブが実行中 → 409 identify_in_progress。エージェントごとの待機ジョブは最大 20 件で、受け取られてから 9 分以内に報告が無ければ無効になります。開始のたびに監査に記録されます。tools/net/agent-probe は identify を受け付けないため、ここからだけ開始できます。

curl -X POST https://ipam.example.com/api/v1/identify/ip/192.0.2.50 \
  -H "Authorization: Bearer $TOKEN"

11IP 變更評估IP change assessmentIP 変更評価

改 IP、除役裝置、交換器維護或節點停機之前的評估:找出引用、判定影響、列出資料不足的項目與待辦。引用的來源包括 IPAM(新位址的記錄、冷卻期、待審核的 IP 申請、IP 範圍)、子網路的閘道與 DNS、DNS/DHCP(含掃描代理看到的 DHCP 伺服器與它發的預設閘道)、防火牆與 NAT、監控、虛擬化、憑證、VPN 端點、線路、跳板主機、各整合與 jt-ipam 系統設定(LDAP、SMTP、AI 模型、稽核轉送、Webhook)的連線位址、服務的依賴與端點(除役時照服務的依賴判定哪些服務會中斷),以及說明欄裡的文字線索。評估只讀,不會改任何設備、不會推送 DNS/DHCP/防火牆設定。功能預設關閉,管理員以 PUT /api/v1/change-impact/settings(或系統設定頁)打開;關閉時下列端點回 403 impact_feature_disabled。An assessment before renumbering an IP, decommissioning a device, switch maintenance or node downtime: it finds references, judges the impact, and lists data gaps and tasks. References come from IPAM (records at the new address, cooldowns, pending IP requests, IP ranges), subnet gateways and DNS servers, DNS/DHCP (including DHCP servers seen by scan agents and the default gateway they hand out), firewalls and NAT, monitoring, virtualization, certificates, VPN endpoints, circuits, jump hosts, the connection addresses of integrations and of jt-ipam's own settings (LDAP, SMTP, AI model, audit forwarding, webhooks), service dependencies and endpoints (a decommission works out which services break from their dependencies), and text hints in descriptions. It is read-only: no device is changed and no DNS, DHCP or firewall setting is pushed. It is off by default; an admin turns it on with PUT /api/v1/change-impact/settings (or the system settings page). While off, the endpoints below return 403 impact_feature_disabled.ログイン中のアカウントは enabled、ai_available を取得できます。管理者は config も取得・変更できます(スイッチ、AI、有効時間、保存日数、上限)。監査に記録されます。確認者は下の /change-impact/review-policy(画面では「申請の承認設定」)で設定します。旧フィールド reviewer_user_ids/reviewer_group_ids/allow_self_review も書き込めて、確認の設定に反映されます。リストには存在するユーザーとグループだけが残ります

方法Methodメソッド路徑Pathパス說明Notes説明
GET PUT/api/v1/change-impact/review-policy限管理員。IP 變更評估的審核關卡(「申請審核設定」的「IP 變更評估審核」):approver_mode 為 editors(對目標有修改權的人,預設)、admin、designated(管理員+designated_user_ids/designated_group_ids)、parallel(多組會簽,每一組都要有人核准)、stages(依序多關卡);stages 是 [{name, user_ids, group_ids}],最多 20 關;allow_self_approve。多關卡沒有關卡或某關沒有審核人回 422 approval_need_stage/approval_stage_need_approver,指定人員一個都沒有回 approval_need_designated。沒存過時由舊的審核人名單推出來(有名單=designated,沒有=editors)。修改寫稽核。IP 申請的審核關卡是 GET/PUT /api/v1/ip-requests/policy/config(同一頁的另一個頁籤,沒有 editors)Admin only. The review policy for IP change assessments ("IP change assessment review" in Approval settings): approver_mode is editors (people who can edit the target, the default), admin, designated (admins plus designated_user_ids/designated_group_ids), parallel (every group must approve) or stages (sequential); stages is [{name, user_ids, group_ids}], up to 20; allow_self_approve. A multi-stage policy without stages or with a stage lacking approvers returns 422 approval_need_stage/approval_stage_need_approver, a designated policy without anyone returns approval_need_designated. Until saved it is derived from the old reviewer list (list present = designated, none = editors). Changes are audited. The IP request policy is GET/PUT /api/v1/ip-requests/policy/config (the other tab of the same page, without editors)管理者のみ。IP 変更評価の確認の設定(「申請の承認設定」の「IP 変更評価の確認」):approver_mode は editors(対象を編集できる人、既定)、admin、designated(管理者+designated_user_ids/designated_group_ids)、parallel(並行承認、すべてのグループの承認が必要)、stages(順次承認)。stages は [{name, user_ids, group_ids}] で最大 20 段階、allow_self_approve。多段階で段階がない、または承認者のいない段階があると 422 approval_need_stage/approval_stage_need_approver、指定した人がいないと approval_need_designated。保存前は旧確認者リストから導出します(リストあり=designated、なし=editors)。変更は監査に記録されます。IP 申請の承認設定は GET/PUT /api/v1/ip-requests/policy/config(同じ画面の別タブ、editors はありません)
GET/api/v1/change-impact/target-subnets建立評估時選子網路用:只列你可以修改的子網路(含區段、單位、VRF 名稱),單位與區段選項也只從這些子網路推出來。q 是位址時找包含它的子網路(最小的一層排前面),否則比對 CIDR、說明、區段與單位名稱;另可帶 section_id、customer_id。最多 50 筆,超過時 truncated 為 true。Subnet picker for creating an assessment: lists only subnets you can edit (with section, customer and VRF names); the customer and section options come from those subnets only. When q is an address it finds the subnets containing it (most specific first); otherwise it matches CIDR, description, section and customer names. Also takes section_id and customer_id. Up to 50 rows; truncated is true when there are more.評価を作成するときのサブネット選択用です。編集できるサブネットだけを返し(セクション、顧客、VRF 名つき)、顧客とセクションの選択肢もそれらのサブネットから作ります。q がアドレスならそれを含むサブネット(最も細かいものから)、それ以外は CIDR、説明、セクション名、顧客名で検索します。section_id、customer_id も指定できます。最大 50 件で、それを超えると truncated が true になります。
GET POST
PUT DELETE
/api/v1/change-impact/services
…/services/{id}
…/services/object-search?type=&q=
M2 的服務:名稱、重要性(critical/high/normal/low)、狀態、端點,與依賴群組 groups[{name, required_count, confirmed, members[{object_type, object_id, relation_type}]}]。每個群組都必要,群組內 required_count 個成員可用才滿足;成員類型 device/vm/ip/subnet/service,關係 hosted_on/requires_network/requires_storage/requires_power/requires_service,references/observed_on 不傳播停機。看要全域讀取、改只有管理員(PUT 是整份取代,可帶 expected_version),寫稽核。object-search 是選擇器用的搜尋,只回看得到的物件M2 services: name, criticality (critical/high/normal/low), status, endpoints and dependency groups groups[{name, required_count, confirmed, members[{object_type, object_id, relation_type}]}]. Every group is required and is satisfied when required_count members are available; member types device/vm/ip/subnet/service, relations hosted_on/requires_network/requires_storage/requires_power/requires_service, while references/observed_on do not propagate outages. Viewing needs global read and editing is admin-only (PUT replaces the whole service and accepts expected_version), audited. object-search backs the pickers and returns only objects you can seeM2 のサービス:名前、重要度(critical/high/normal/low)、状態、エンドポイント、依存グループ groups[{name, required_count, confirmed, members[{object_type, object_id, relation_type}]}]。すべてのグループが必須で、グループ内の required_count 個のメンバーが利用可能なら満たされます。メンバー種別は device/vm/ip/subnet/service、関係は hosted_on/requires_network/requires_storage/requires_power/requires_service、references/observed_on は停止を伝播しません。閲覧には全体の閲覧権限、変更は管理者のみ(PUT は全体の置き換えで expected_version を指定可)、監査に記録します。object-search は選択欄用の検索で、見える対象だけを返します
GET/api/v1/impact-runs/{id}/relations?limit=關係圖:根目標、看得到的發現主體與保存下來的關係(交換器維護時裝置連到實際接的交換器、虛擬機連到節點、服務連到受影響的依賴)。依讀者過濾,預設最多 100 個節點(上限 500),超過時 truncated 為 true。節點帶 category(發現的分類,例如 dns;不是發現主體的節點為 null),畫面用它把同一類的葉節點收成群組Relation graph: the target, the visible finding subjects and the stored relations (in switch maintenance devices link to the switch they are cabled to, VMs to their node and services to their affected dependencies). Filtered for the reader, 100 nodes by default (500 at most); truncated is true when there are more. Nodes carry category (the finding category such as dns; null for nodes that are not finding subjects), which the screen uses to group leaves of the same kind関係図:評価対象、見える発見の主体、保存された関係(スイッチのメンテナンスでは機器から実際に接続されたスイッチへ、VM からノードへ、サービスから影響を受けた依存へ)。閲覧者で絞り込み、既定 100 ノード(最大 500)、超えると truncated が true。ノードには category(発見の分類。例:dns。発見の主体でないノードは null)があり、画面は同じ種類の末端ノードをグループにまとめるのに使います
GET POST/api/v1/change-plans清單(scenario_type、lifecycle、q、awaiting_my_review=true 只列輪到我覆核的、page/page_size,只列看得到根目標的計畫;單筆另回 can_review 與 reviewers)/建立(scenario_type 為 ip_renumber、device_decommission,或 M2 的 switch_maintenance、node_downtime(parameters.mode 為 direct/migrate_first/ha_failure;兩者都可帶 parameters.also_down 一起停機的裝置,最多共 20 台、每台都要有寫入權)、target_type、target_id、parameters.new_ip、選用的 parameters.target_subnet_id、planned_start/planned_end)。建立需要對根目標有寫入權,可帶 Idempotency-Key 標頭(同一個鍵、不同內容回 409)。根目標一律是物件 id:同一個位址在重疊網段有好幾筆時,先用 GET /api/v1/change-impact/candidates?ip=(可帶 subnet_id 只找那個子網路)選;沒有看得到的記錄時會說明原因:403 impact_target_no_permission(沒有這個位址或所在子網路的權限)、404 impact_target_not_registered(子網路看得到但 IPAM 沒有這筆,附 subnet)、404 impact_target_unmanaged(不在任何管理的子網路)、422 impact_target_outside_subnet(不在指定的子網路內)。新位址所在子網路看不到時建立回 403 impact_new_ip_no_permission。只會多透露「有子網路包含這個位址」,看不到的內容一律不給List (scenario_type, lifecycle, q, awaiting_my_review=true for plans waiting for my review, page/page_size; only plans whose target you can see; a single plan also returns can_review and reviewers) / create (scenario_type ip_renumber, device_decommission, or the M2 switch_maintenance and node_downtime (parameters.mode direct/migrate_first/ha_failure; both accept parameters.also_down for devices down at the same time, up to 20 in total, each needing write access), target_type, target_id, parameters.new_ip, optional parameters.target_subnet_id, planned_start/planned_end). Creating needs write access to the target and accepts an Idempotency-Key header (the same key with different content returns 409). The target is always an object id: when an address exists in several overlapping subnets, pick one with GET /api/v1/change-impact/candidates?ip= first (add subnet_id to search one subnet only). When nothing visible matches, the reason is given: 403 impact_target_no_permission (no permission on the address or its subnet), 404 impact_target_not_registered (the subnet is visible but IPAM has no such record; subnet is included), 404 impact_target_unmanaged (not in any managed subnet), 422 impact_target_outside_subnet (not in the given subnet). Creating returns 403 impact_new_ip_no_permission when the new IP's subnet is not visible. The only extra fact revealed is that some subnet contains the address一覧(scenario_type、lifecycle、q、自分の確認待ちだけの awaiting_my_review=true、page/page_size。対象を閲覧できる計画のみ。1 件取得では can_review と reviewers も返します)/作成(scenario_type は ip_renumber、device_decommission、または M2 の switch_maintenance、node_downtime(parameters.mode は direct/migrate_first/ha_failure。どちらも parameters.also_down で同時に停止する機器を指定でき、合計 20 台まで、各機器に書き込み権限が必要)、target_type、target_id、parameters.new_ip、任意の parameters.target_subnet_id、planned_start/planned_end)。作成には対象への書き込み権限が必要で、Idempotency-Key ヘッダーを使えます(同じキーで内容が違えば 409)。対象は常にオブジェクト ID です。重複サブネットに同じアドレスが複数ある場合は、先に GET /api/v1/change-impact/candidates?ip=(subnet_id で 1 つのサブネットに絞れます)で選んでください。見えるレコードがないときは理由を返します:403 impact_target_no_permission(アドレスまたはそのサブネットへの権限なし)、404 impact_target_not_registered(サブネットは見えるが IPAM に記録がない。subnet つき)、404 impact_target_unmanaged(管理対象のサブネットに含まれない)、422 impact_target_outside_subnet(指定したサブネットに含まれない)。新しい IP のサブネットが見えない場合、作成は 403 impact_new_ip_no_permission を返します。追加で分かるのは「そのアドレスを含むサブネットがある」ことだけです
GET PATCH DELETE/api/v1/change-plans/{id}讀取/修改(If-Match: <版本>,版本不符回 409 impact_plan_revision_conflict;每次修改產生新版本、計畫回到草稿)/封存。…/revisions 是歷次版本Read / edit (If-Match: <revision>; a stale revision returns 409 impact_plan_revision_conflict; every edit creates a new revision and returns the plan to draft) / archive. …/revisions lists past revisions取得/編集(If-Match: <版>。版が古いと 409 impact_plan_revision_conflict。編集のたびに新しい版になり、計画は下書きに戻ります)/アーカイブ。…/revisions は過去の版
POST GET/api/v1/change-plans/{id}/runs開始分析(202,背景作業;同一個單位同時進行中的分析有上限,超過回 409 impact_concurrency_limit)/分析記錄Start an analysis (202, background job; concurrent analyses per unit are limited, beyond that 409 impact_concurrency_limit) / list analyses分析を開始(202、バックグラウンド。単位ごとの同時実行数に上限があり、超えると 409 impact_concurrency_limit)/分析履歴
GET/api/v1/impact-runs/{id}
…/findings · …/evidence · …/evidence/{evidence_id} · …/gaps
狀態(job_status、decision_status:blocked/needs_review/no_known_blocker、completeness、counts、expires_at)、發現(每筆有 rule_id/rule_version、impact、severity、disposition、evidence_strength、reason_code、params、evidence_ids、fingerprint)、證據(觀察與收錄時間分開)、資料不足的項目(reason_code 例如 not_configured、source_stale、permission_limited;affected_analysis 是受影響的分析項目,同一類別可能有好幾筆,例如看不到的 VPN 端點與線路)。每次讀取都依目前權限重新過濾,權限範圍跟分析時不同會帶 permission_scope_changedStatus (job_status, decision_status: blocked/needs_review/no_known_blocker, completeness, counts, expires_at), findings (each with rule_id/rule_version, impact, severity, disposition, evidence_strength, reason_code, params, evidence_ids, fingerprint), evidence (observed and collected times kept apart) and data gaps (reason_code such as not_configured, source_stale, permission_limited; affected_analysis names the part of the analysis affected, so one category can have several, e.g. VPN endpoints and circuits you cannot see). Every read is filtered by your current permissions; when they differ from the analysis, permission_scope_changed is set状態(job_status、decision_status:blocked/needs_review/no_known_blocker、completeness、counts、expires_at)、発見事項(rule_id/rule_version、impact、severity、disposition、evidence_strength、reason_code、params、evidence_ids、fingerprint)、証拠(観測時刻と収集時刻は別)、データの欠落(not_configured、source_stale、permission_limited など。affected_analysis は影響を受ける分析項目で、同じカテゴリに複数ある場合があります。例:見えない VPN 端点と回線)。取得のたびに現在の権限で絞り込みます。分析時と権限が異なる場合は permission_scope_changed が付きます
POST/api/v1/impact-runs/{id}/cancel取消排隊或執行中的分析(冪等);中間產物不會留下Cancel a queued or running analysis (idempotent); no partial results are kept待機中または実行中の分析を中止(冪等)。途中の結果は残りません
GET/api/v1/impact-runs/{id}/export?format=md|json即時產生的檔案(不存檔、不產生永久網址),內容依下載者目前的權限過濾,寫稽核A file generated on the fly (not stored, no permanent link), filtered by the downloader's current permissions, auditedその場で生成するファイル(保存せず、恒久的なリンクもなし)。ダウンロードする人の現在の権限で絞り込み、監査に記録します
POST/api/v1/reports/pdf把報告大綱(title、subtitle、meta 欄名與值的配對、sections:heading、paragraphs、bullets、table(cols、rows、widths 比例、tones:danger/warning/info)、caption,另有 note、footer_text、generated_at、lang:zh-TW/en-US/ja-JP、filename)排成 A4 的 PDF 檔回傳(application/pdf,內嵌中文/日文字型子集)。IP 變更評估的「匯出 PDF」就是用它。只做排版、不讀任何資料,所以只要求登入;有大小上限(表格儲存格最多 12,000 格、單格 4,000 字,超過回 422)、每人每分鐘 30 次,同時最多排 2 份。伺服器沒有中文字型時回 503、report_pdf_no_font(要裝 fonts-noto-cjk)Lays out a report outline (title, subtitle, meta as label/value pairs, sections with heading, paragraphs, bullets, table (cols, rows, widths ratios, tones: danger/warning/info) and caption, plus note, footer_text, generated_at, lang: zh-TW/en-US/ja-JP and filename) as an A4 PDF file (application/pdf, with an embedded Chinese/Japanese font subset). The IP change assessment "Export PDF" uses it. It only does layout and reads no data, so any signed-in user may call it; input is capped (at most 12,000 table cells, 4,000 characters per cell, otherwise 422), 30 calls per user per minute and at most 2 renders at once. Without a CJK font on the server it returns 503 with report_pdf_no_font (install fonts-noto-cjk)レポートの構成(title、subtitle、ラベルと値の組の meta、sections:heading・paragraphs・bullets・table(cols・rows・比率の widths・tones:danger/warning/info)・caption、ほかに note・footer_text・generated_at・lang:zh-TW/en-US/ja-JP・filename)を A4 の PDF ファイルにして返します(application/pdf、中国語・日本語フォントのサブセットを埋め込み)。IP 変更評価の「PDF をエクスポート」がこれを使います。レイアウトだけでデータは読まないため、ログインしていれば呼び出せます。入力には上限があり(表のセルは合計 12,000、1 セル 4,000 文字まで。超えると 422)、1 人 1 分あたり 30 回、同時に作成するのは 2 件までです。サーバーに CJK フォントがないと 503 と report_pdf_no_font を返します(fonts-noto-cjk をインストール)
POST/api/v1/change-plans/{id}/transitions{"action": …}:submit(要有這個版本未過期的分析;依審核關卡通知:editors/admin 通知管理員、designated 通知名單裡看得到目標的人、parallel 通知每一組、stages 先通知第 1 關)、start(重新分析並比對快照,證據變了回 409 impact_run_stale 並退回草稿)、verify(驗證待辦都完成或略過)、close、reopen(送審中、已核准或已取消的回到草稿;已取消的重新開啟後可以再分析)、cancel{"action": …}: submit (needs an unexpired analysis of this revision; notifies per the review policy: admins for editors/admin, the people on the list who can see the target for designated, every group for parallel, stage 1 for stages), start (re-analyses and compares the snapshot; changed evidence returns 409 impact_run_stale and moves the plan back to draft), verify (verification tasks done or skipped), close, reopen (in review, approved or cancelled back to draft; a reopened cancelled plan can be analysed again), cancel{"action": …}:submit(この版の期限内の分析が必要。確認の設定に従って通知:editors/admin は管理者、designated はリストのうち対象を見られる人、parallel は各グループ、stages はまず第 1 段階)、start(再分析してスナップショットを比較。証拠が変わっていれば 409 impact_run_stale で下書きに戻る)、verify(検証タスクが完了またはスキップ済み)、close、reopen(確認中・承認済み・取り消し済みを下書きに戻す。取り消し済みも再び分析できます)、cancel
POST GET/api/v1/change-plans/{id}/reviews覆核:decision 為 approve/accept_risk/request_changes/reject,綁定(版本、run、快照雜湊)。阻擋項目不可核准;資料不完整只能 accept_risk 並填理由;每個需覆核項目都要在 dispositions 給處置;預設建立者不能覆核自己的計畫(管理員例外)。誰能覆核依審核關卡(/change-impact/review-policy):editors 要對目標有 write;admin 只有管理員;designated 要在名單裡且看得到目標;多關卡時核准記在 step_index,parallel 每一組都有人核准、stages 逐關通過到最後一關才算核准,還沒輪到的關卡回 403 impact_review_not_your_stage,不在任何關卡回 impact_not_reviewer;管理員任何一關都能核准。退回或撤回後重新送審,關卡重新算。計畫的 review_mode 與 review_steps(每關的名稱、審核人、是否通過、是否目前這關)顯示進度。依序模式通過一關就通知下一關;全部結束才通知建立者。覆核記錄只能新增Review: decision is approve/accept_risk/request_changes/reject, bound to (revision, run, snapshot hash). Blocking items cannot be approved; incomplete data allows only accept_risk with a reason; every item that needs review needs an entry in dispositions; by default creators cannot review their own plans (admins excepted). Reviews are append-only Who may review follows the review policy (/change-impact/review-policy): editors needs write on the target; admin admins only; designated the people on the list who can see the target; with stages each approval records its step_index, parallel needs every group and stages passes stage by stage until the last one approves; a stage that is not yet due returns 403 impact_review_not_your_stage, someone in no stage gets impact_not_reviewer; admins can approve any stage. After a plan is sent back or withdrawn and submitted again, the stages start over. A plan's review_mode and review_steps (each stage's name, reviewers, approved, current) show the progress. Sequential review notifies the next stage after each approval; the creator is notified when review ends.確認:decision は approve/accept_risk/request_changes/reject。(版、run、スナップショットのハッシュ)に紐付きます。ブロック項目は承認できず、データが不完全なら理由付きの accept_risk のみ。要確認項目にはすべて dispositions で処置が必要です。既定では作成者は自分の計画を確認できません(管理者を除く)。確認記録は追記のみです誰が確認できるかは確認の設定(/change-impact/review-policy)に従います。editors は対象への write、admin は管理者のみ、designated はリストに含まれ対象を見られる人。多段階では承認ごとに step_index を記録し、parallel はすべてのグループ、stages は最後の段階まで順に承認されると成立します。まだ順番でない段階は 403 impact_review_not_your_stage、どの段階にも含まれない人は impact_not_reviewer。管理者はどの段階も承認できます。差し戻しや取り下げの後に再送信すると段階はやり直しです。計画の review_mode と review_steps(各段階の名称、確認者、承認済みか、現在の段階か)で進捗がわかります。順次承認では段階ごとに次の段階へ通知し、確認が終わると作成者に通知します。
GET POST PATCH/api/v1/change-plans/{id}/tasks
…/tasks/from-ai · /api/v1/change-tasks/{id}
待辦(人工操作;標完成不會改設備)。範本待辦依分析結果產生(template_code 加 template_params),可另加手動待辦、或勾選 AI 草稿存入;修改要帶 expected_version,略過要填原因,depends_on 不可形成循環Tasks (manual work; marking done changes no device). Template tasks come from the analysis (template_code plus template_params); add manual tasks or save selected AI drafts. Updates need expected_version, skipping needs a reason, and depends_on must not form a cycleタスク(手作業。完了にしても機器は変わりません)。テンプレートのタスクは分析結果から作られます(template_code と template_params)。手動のタスクや、選択した AI の下書きも追加できます。更新には expected_version、スキップには理由が必要で、depends_on は循環できません
POST GET/api/v1/impact-runs/{id}/ai-artifacts
…/questions
AI 解說(summary/checklist/explanation)與追問,背景產生。只根據看得到的資料;回覆必須是約定的 JSON,引用的 id 與文字裡的位址都要出自資料,不合格修一次、再不合格改用範本摘要(status: fallback,error_code 說明原因)。執行中 stage 是做到哪一步(collecting/asking/checking/retrying,做完是 null),畫面輪詢時顯示。AI 不能用時回 409 impact_ai_unavailable,分析結果不受影響AI explanations (summary/checklist/explanation) and questions, generated in the background from the data you can see. Replies must follow a fixed JSON contract; cited ids and addresses in the text must come from the data. An invalid reply is repaired once, then replaced by a template summary (status: fallback, with the reason in error_code). While running, stage says which step it is on (collecting/asking/checking/retrying, null when done), shown by the screen as it polls. Without AI the endpoint returns 409 impact_ai_unavailable; analysis results are unaffectedAI の解説(summary/checklist/explanation)と質問。閲覧できるデータだけを使ってバックグラウンドで作成します。応答は決まった JSON 形式で、引用する ID や本文中のアドレスはデータ内のものに限ります。不正な応答は 1 回だけ修正させ、それでも駄目ならテンプレートの要約(status: fallback、理由は error_code)に置き換えます。実行中の stage はどの段階か(collecting/asking/checking/retrying、終わると null)で、画面がポーリングして表示します。AI が使えない場合は 409 impact_ai_unavailable。分析結果には影響しません
GET PUT/api/v1/change-impact/settings任何登入帳號讀 enabled、ai_available;管理員另外拿到 config 並可修改(開關、AI、有效時數、保存天數、上限),寫稽核。誰能覆核改在下面的 /change-impact/review-policy(畫面在「申請審核設定」);舊欄位 reviewer_user_ids/reviewer_group_ids/allow_self_review 仍可寫入,會同步到審核關卡;名單只留存在的使用者與群組Any signed-in account reads enabled and ai_available; admins also get config and can change it (switches, AI, validity hours, retention days, limits), audited. Who reviews is set in /change-impact/review-policy below (Approval settings in the UI); the old fields reviewer_user_ids/reviewer_group_ids/allow_self_review are still accepted and copied into the review policy; the lists keep only existing users and groupsログイン済みのアカウントは enabled と ai_available を取得できます。管理者は config も取得・変更できます(各スイッチ、AI、自己確認、確認者リスト reviewer_user_ids/reviewer_group_ids、有効時間、保持日数、上限)。監査に記録します。リストには実在するユーザーとグループだけが残ります

資料來源(M1):IPAM 本身(位址、子網路閘道與 DNS 伺服器、冷卻期、跳板、整合端點、說明裡的文字線索)、DNS 的 A/AAAA/PTR、DHCP 保留、租約與發放範圍、OPNsense、pfSense、FortiGate(依 VDOM)、Palo Alto(依 vsys)、Check Point(依網域與政策套件)、MikroTik 的規則與別名/位址物件(群組遞迴並偵測循環,停用與反向比對分開)、NAT、LibreNMS、Zabbix、Wazuh、OCS、RustDesk、Proxmox VE 與 ESXi 的虛擬機、憑證的 IP SAN。尚未支援、會列成資料不足的:DNS 的 CNAME 與 view、DHCP 租約到期時間、對不上 IP 記錄的租約與 NAT 位址、Proxmox VE 防火牆、虛擬化 HA。Data sources (M1): IPAM itself (addresses, subnet gateways and DNS servers, cooldowns, jump hosts, integration endpoints, text hints in descriptions), DNS A/AAAA/PTR, DHCP reservations, leases and pools, rules and aliases/address objects on OPNsense, pfSense, FortiGate (per VDOM), Palo Alto (per vsys), Check Point (per domain and policy package) and MikroTik (groups resolved recursively with cycle detection; disabled and negated rules kept apart), NAT, LibreNMS, Zabbix, Wazuh, OCS, RustDesk, Proxmox VE and ESXi VMs, and certificate IP SANs. Not supported yet and reported as gaps: DNS CNAMEs and views, DHCP lease expiry, leases and NAT addresses without an IP record, the Proxmox VE firewall, and virtualization HA.データソース(M1):IPAM 自体(アドレス、サブネットのゲートウェイと DNS サーバー、クールダウン、踏み台、連携の接続先、説明文中のテキスト)、DNS の A/AAAA/PTR、DHCP の予約・リース・配布範囲、OPNsense・pfSense・FortiGate(VDOM ごと)・Palo Alto(vsys ごと)・Check Point(ドメインとポリシーパッケージごと)・MikroTik のルールとエイリアス/アドレスオブジェクト(グループは再帰的に展開し循環を検出。無効なルールと否定条件は区別)、NAT、LibreNMS、Zabbix、Wazuh、OCS、RustDesk、Proxmox VE と ESXi の仮想マシン、証明書の IP SAN。未対応でデータの欠落として表示するもの:DNS の CNAME と view、DHCP リースの期限、IP レコードに対応しないリースと NAT のアドレス、Proxmox VE のファイアウォール、仮想化の HA。

MCP 工具:impact_list_plans、impact_get_run、impact_list_findings、impact_get_evidence、impact_prepare_scenario(只驗證、不寫入,回伺服器簽發的 draft_token;四種情境都可以,維護與停機可帶 mode、also_down);impact_create_plan(要帶 draft_token,內容被改過就拒絕)、impact_start_run、impact_accept_task_draft 屬於異動工具,只給管理員、唯讀金鑰不能呼叫。功能關閉時這些工具不出現在清單裡。MCP tools: impact_list_plans, impact_get_run, impact_list_findings, impact_get_evidence, impact_prepare_scenario (validates only, writes nothing, returns a server-signed draft_token; all four scenarios, with mode and also_down for maintenance and downtime); impact_create_plan (needs the draft_token and refuses a changed payload), impact_start_run and impact_accept_task_draft change data, so they are admin-only and blocked for read-only keys. While the feature is off, the tools are not listed.MCP ツール:impact_list_plans、impact_get_run、impact_list_findings、impact_get_evidence、impact_prepare_scenario(検証のみで書き込まず、サーバーが署名した draft_token を返します。4 つのシナリオすべてに対応し、メンテナンスと停止では mode と also_down を指定できます)。impact_create_plan(draft_token が必要で、内容が変わっていれば拒否)、impact_start_run、impact_accept_task_draft はデータを変更するツールのため管理者専用で、読み取り専用キーでは使えません。機能が無効の間、これらのツールは一覧に出ません。

12整合Integrations連携

每種整合的端點形狀大致相同:清單與 POST 建立、PATCH/DELETE 單筆、POST …/{id}/test(連線診斷)、POST …/{id}/sync(立即同步)。多數同步走背景作業並回 task_id(用 GET /api/v1/tasks/{task_id} 查進度);ESXi 與 pfSense 的同步是同步執行,上游出錯回 502。密碼與 API 金鑰只寫不讀,讀取時最多只看到 has_password 之類的旗標。設定一律需要 admin;讀取權限見下表。 Every integration has roughly the same shape: a list and POST to create, PATCH/DELETE per item, POST …/{id}/test (connection diagnostics) and POST …/{id}/sync (sync now). Most syncs run as a background task and return a task_id (follow it with GET /api/v1/tasks/{task_id}); ESXi and pfSense sync synchronously and return 502 on an upstream error. Passwords and API keys are write-only; reads show at most a flag such as has_password. Configuration always requires admin; read access is in the table below.どの連携もエンドポイントの形はほぼ同じです。一覧と POST での作成、単件の PATCH/DELETE、POST …/{id}/test(接続診断)、POST …/{id}/sync(即時同期)。多くの同期はバックグラウンド処理で task_id を返します(進捗は GET /api/v1/tasks/{task_id})。ESXi と pfSense の同期は同期実行で、上流のエラー時は 502 を返します。パスワードと API キーは書き込み専用で、読み取り時は has_password のようなフラグが見える程度です。設定には常に admin が必要で、読み取り権限は下表のとおりです。

作業清單 GET /api/v1/tasks 可帶 status_in(逗號分隔)、kind、trigger(manual/scheduled)、q(搜尋類型、目標、錯誤訊息,不分大小寫,% 與 _ 照字面比對)與 active_only;GET /api/v1/tasks/kinds 回看得到的作業裡出現過的類型。排程同步、代理回報(rustdesk.sync、isc_dhcp.sync)與資料庫更新(oui.refresh、recog.refresh、geoip.refresh)每個來源只保留一列 trigger=scheduled,每次更新同一列;手動操作每次一列。 The task list GET /api/v1/tasks accepts status_in (comma separated), kind, trigger (manual/scheduled), q (searches type, target and error, case insensitive, with % and _ matched literally) and active_only; GET /api/v1/tasks/kinds returns the types that appear among the tasks you can see. Scheduled syncs, agent reports (rustdesk.sync, isc_dhcp.sync) and database refreshes (oui.refresh, recog.refresh, geoip.refresh) keep one trigger=scheduled row per source that every run updates; manual actions add one row each time.作業一覧 GET /api/v1/tasks には status_in(カンマ区切り)、kind、trigger(manual/scheduled)、q(種類・対象・エラーを大文字小文字を区別せず検索し、% と _ は文字どおりに照合)、active_only を指定できます。GET /api/v1/tasks/kinds は見える作業に現れた種類を返します。定期同期、エージェントの報告(rustdesk.sync、isc_dhcp.sync)、データベースの更新(oui.refresh、recog.refresh、geoip.refresh)はソースごとに trigger=scheduled の行を 1 行だけ持ち、実行のたびに同じ行を更新します。手動操作は毎回 1 行ずつ追加されます。

整合Integration連携基底路徑Base pathベースパス做什麼What it does内容讀取Read access読み取り
OPNsense/firewalls/opnsenseDHCP 租約與範圍、ARP、OpenVPN 連線、過濾規則(含異動偵測)、NAT、別名。方向為 push 的別名對應會把 IPAM 的 IP 寫進 OPNsense 別名DHCP leases and ranges, ARP, OpenVPN sessions, filter rules (with change detection), NAT, aliases. Alias mappings with direction push write IPAM addresses into an OPNsense aliasDHCP のリースと範囲、ARP、OpenVPN 接続、フィルタルール(変更検知付き)、NAT、エイリアス。方向が push のエイリアス対応は IPAM の IP を OPNsense のエイリアスに書き込みますadmin
pfSense/pfsenseDHCP 租約/範圍/保留、ARP、別名、規則與 NAT(pfSense-pkg-RESTAPI v2)。GET /{id}/nat 會即時向防火牆抓取DHCP leases / ranges / reservations, ARP, aliases, rules and NAT (pfSense-pkg-RESTAPI v2). GET /{id}/nat fetches live from the firewallDHCP のリース/範囲/予約、ARP、エイリアス、ルールと NAT(pfSense-pkg-RESTAPI v2)。GET /{id}/nat はファイアウォールからその場で取得します清單、/{id}/rules、/{id}/aliases 需全域讀取;/{id} 與 /{id}/nat 需 adminList, /{id}/rules, /{id}/aliases: global read; /{id} and /{id}/nat: admin一覧・/{id}/rules・/{id}/aliases は全体の読み取り、/{id} と /{id}/nat は admin
FortiGate/fortigate唯讀 FortiOS REST,支援多 VDOM:DHCP、ARP、VPN、政策、NAT、位址物件。NAT 的 VIP 對外 IP(extip)與單一位址的 IP pool 存成 src_ip_id、內部目標存成 dst_ip_id;對外 IP 不在關聯子網路時,全站唯一完全相符也算Read-only FortiOS REST, multi-VDOM: DHCP, ARP, VPN, policies, NAT, address objects. A VIP's external IP (extip) and a single-address IP pool are stored as src_ip_id and the internal target as dst_ip_id; an external IP outside the integration's subnets still links when it is the only exact match読み取り専用の FortiOS REST、複数 VDOM 対応:DHCP、ARP、VPN、ポリシー、NAT、アドレスオブジェクト。NAT の VIP の外部 IP(extip)と単一アドレスの IP プールは src_ip_id、内部の宛先は dst_ip_id に保存します。外部 IP が連携のサブネット外でも、全体で唯一完全に一致すれば対応付けます全域讀取Global read全体の読み取り
Palo Alto/paloalto只用 GET,REST 加 XML 操作 API,支援多 vsys:政策、NAT、位址物件、ARP、DHCP 租約、站對站 IPsec VPN(sync_vpn,預設開;通道寫進 /vpn-tunnels,並與其他防火牆依端點位址配對)GET only, REST plus the XML op API, multi-vsys: policies, NAT, address objects, ARP, DHCP leases, site-to-site IPsec VPN (sync_vpn, on by default; tunnels land in /vpn-tunnels and are paired with other firewalls by endpoint address)GET のみ。REST と XML 操作 API、複数 vsys 対応:ポリシー、NAT、アドレスオブジェクト、ARP、DHCP リース、サイト間 IPsec VPN(sync_vpn、既定オン。トンネルは /vpn-tunnels に入り、ほかのファイアウォールとエンドポイントのアドレスで対応付けます)全域讀取Global read全体の読み取り
Check Point (Beta)(Beta)(Beta)/checkpoint/servers
/checkpoint/servers/{id}/test
/checkpoint/servers/{id}/sync
/checkpoint/servers/{id}/rules
/checkpoint/servers/{id}/objects
/checkpoint/servers/{id}/gateways
/checkpoint/servers/{id}/gaia-targets
/checkpoint/gaia-targets/{id}
/checkpoint/gaia-targets/{id}/test
/checkpoint/gaia-targets/{id}/sync
/checkpoint/gaia-targets/{id}/dhcp
管理伺服器(Security Management Server 或 Multi-Domain,R81.20)的 Management API,唯讀:登入時要求唯讀工作階段,結束一定登出。整合單位是管理伺服器,一台管的所有閘道與政策套件都在裡面;domains 留空是單一管理伺服器,Multi-Domain 每個網域各登入一次;packages 留空是全部政策套件。同步閘道清單、網路物件(host、network、address-range、group、group-with-exclusion)、存取規則(段落攤平、內嵌層標成「上層 › 內嵌層」、保留 negate 與命中數)與 NAT(只收目的地轉換,以 port_forward 寫進共用 NAT 表);IP 詳細資料的防火牆反查、規則異動偵測與 IP 變更評估都會用到。建立時 secret 必填(auth_mode 為 api_key(建議)放 API key,password 時另填 username),讀取不會回傳,只有 has_secret;修改時留空=不更改。sync 是背景作業(類型 checkpoint.sync);test 逐網域回報 API 版本與閘道、主機、網路物件、政策套件的數量。rules 與 objects 是上一次同步存下的鏡像,伺服器端分頁(q、page、page_size),另可用 rule_id / name 只取一筆。第二階段:gaia-targets 是每台閘道的 Gaia API 連線(閘道自己的帳密,跟管理伺服器的 API key 不同;secret 是 Gaia 密碼,規則同上)。唯讀部分(sync_dhcp,預設開)讀 show-dhcp-server:發放範圍扣掉排除區間後寫進共用的發放範圍,子網路設定(預設閘道、DNS)由 dhcp 讀出,也會用在 IP 變更評估。allow_scripts(預設開)用 run-script 跑兩個寫死的讀取指令讀 ARP 表與租約檔,這需要能執行指令的帳號;帳號沒權限、Gaia 沒有 run-script、閘道沒有租約檔、DHCP 伺服器沒開時,同步不算失敗,原因記在 last_summary.skipped(arp / leases 對應 no_permission、unsupported、no_lease_file、dhcp_off)。test 在打開時試跑 echo,回報 scripts(not_enabled、ok、denied、unsupported、failed)。sync 的背景作業類型是 checkpoint_gaia.sync。VPN 狀態還沒做Management API of the management server (Security Management Server or Multi-Domain, R81.20), read-only: the login asks for a read-only session and always logs out. The integration unit is the management server, covering every gateway and policy package it manages; leave domains empty for a single management server, or list Multi-Domain domains (one login each); empty packages means all policy packages. Syncs gateways, network objects (host, network, address-range, group, group-with-exclusion), access rules (sections flattened, inline layers shown as "parent › inline layer", negate flags and hit counts kept) and NAT (destination translations only, written as port_forward into the shared NAT table); the IP detail firewall lookup, rule change detection and IP change assessment use them. secret is required on create (the API key when auth_mode is api_key (recommended); with password also set username), is never returned (only has_secret) and is kept when left empty on update. sync runs as a background task (kind checkpoint.sync); test reports, per domain, the API version and the gateway, host, network and policy package counts. rules and objects are the mirror saved by the last sync, paged on the server (q, page, page_size); rule_id / name return a single entry. Phase 2: gaia-targets are per-gateway Gaia API connections (the gateway's own account, not the management server's API key; secret is the Gaia password, same rules as above). The read-only part (sync_dhcp, on by default) reads show-dhcp-server: pools minus exclusions go to the shared pool table, and the subnet settings (default gateway, DNS) are returned by dhcp and used by IP change assessment. allow_scripts (on by default) uses run-script to run two fixed read commands for the ARP table and the lease file; this needs an account that may run commands. When the account lacks permission, the Gaia API has no run-script, the gateway has no lease file or its DHCP server is off, the sync does not fail and records the reason in last_summary.skipped (arp / leases set to no_permission, unsupported, no_lease_file or dhcp_off). test tries an echo when enabled and reports scripts (not_enabled, ok, denied, unsupported, failed). sync runs as background task kind checkpoint_gaia.sync. VPN status is not done yet管理サーバー(Security Management Server または Multi-Domain、R81.20)の Management API(読み取り専用):読み取り専用セッションでログインし、終了時は必ずログアウトします。連携の単位は管理サーバーで、管理するすべてのゲートウェイとポリシーパッケージを含みます。domains が空なら単一の管理サーバー、Multi-Domain ではドメインごとにログインします。packages が空ならすべてのポリシーパッケージです。ゲートウェイ一覧、ネットワークオブジェクト(host、network、address-range、group、group-with-exclusion)、アクセスルール(セクションは展開、インラインレイヤーは「親 › インラインレイヤー」と表示、negate とヒット数を保持)、NAT(宛先変換のみ、port_forward として共用 NAT 表へ)を同期し、IP 詳細のファイアウォール照会・ルール変更検出・IP 変更評価で使います。作成時は secret が必須(auth_mode が api_key(推奨)なら API キー、password なら username も指定)で、読み取りでは返さず has_secret だけを返します。更新時に空欄なら変更しません。sync はバックグラウンドのタスク(種別 checkpoint.sync)、test はドメインごとに API バージョンとゲートウェイ・ホスト・ネットワーク・ポリシーパッケージの数を返します。rules と objects は前回の同期で保存したミラーで、サーバー側でページ分割します(q、page、page_size)。rule_id / name で 1 件だけ取得できます。第 2 段階:gaia-targets はゲートウェイごとの Gaia API 接続です(ゲートウェイ自身のアカウントで、管理サーバーの API キーとは別。secret は Gaia のパスワードで扱いは上と同じ)。読み取り専用の部分(sync_dhcp、既定でオン)は show-dhcp-server を読み、除外範囲を差し引いた配布範囲を共用の配布範囲表へ書き、サブネット設定(デフォルトゲートウェイ、DNS)は dhcp で返して IP 変更評価にも使います。allow_scripts(既定でオン)では run-script で固定の読み取りコマンド 2 つを実行し、ARP テーブルとリースファイルを読みます。コマンドを実行できるアカウントが必要です。アカウントに権限がない、Gaia API に run-script がない、ゲートウェイにリースファイルがない、DHCP サーバーが無効のいずれかの場合、同期は失敗にならず、理由を last_summary.skipped に記録します(arp / leases に no_permission、unsupported、no_lease_file、dhcp_off)。test は有効時に echo を試し、scripts(not_enabled、ok、denied、unsupported、failed)を返します。sync のバックグラウンドタスク種別は checkpoint_gaia.sync です。VPN の状態はまだ対応していませんadmin
MikroTik/mikrotikRouterOS REST(v7.1+),只用 GET:ARP、DHCP、位址集區、防火牆 filter/nat/mangle、address list、介面、LLDP/CDP/MNDP 鄰居、bridge FDB。依序抓取、會看 CPU 負載退讓,避免拖慢路由器。介面、鄰居、FDB 要落在一台裝置上:設定的 device_id,沒設就用 API 位址對到的 IP 所屬裝置(對不到時這三段略過,last_cost.<區段>.skipped 為 no_device,不算失敗)。開關是 sync_interfaces、sync_neighbors(預設開)與 sync_fdb(預設關);GET /{id}/neighbors 列出鄰居與對到的裝置RouterOS REST (v7.1+), GET only: ARP, DHCP, pools, firewall filter / nat / mangle, address lists, interfaces, LLDP/CDP/MNDP neighbors, bridge FDB. Sections are fetched one at a time and it backs off under CPU load so the router is not slowed down. Interfaces, neighbors and FDB are stored on a device: the configured device_id, or else the device that owns the IP of the API address (if none matches, those three sections are skipped with last_cost.<section>.skipped = no_device, not a failure). Toggles: sync_interfaces, sync_neighbors (on by default) and sync_fdb (off by default); GET /{id}/neighbors lists neighbors with the matched deviceRouterOS REST(v7.1 以降)、GET のみ:ARP、DHCP、アドレスプール、ファイアウォールの filter/nat/mangle、アドレスリスト、インターフェース、LLDP/CDP/MNDP ネイバー、ブリッジ FDB。順番に取得し、CPU 負荷が高いと控えるため、ルーターを遅くしません。インターフェース・ネイバー・FDB はデバイスに保存されます:設定した device_id、未設定なら API アドレスの IP が属するデバイス(一致しなければこの 3 セクションはスキップし、last_cost.<セクション>.skipped が no_device になります。失敗扱いではありません)。切り替えは sync_interfaces・sync_neighbors(既定オン)と sync_fdb(既定オフ)。GET /{id}/neighbors はネイバーと一致したデバイスを返します全域讀取Global read全体の読み取り
Windows DHCP/windows-dhcp/servers伺服器以 WinRM+PowerShell 唯讀抓取範圍(扣掉排除區間)、排除區間、保留與租約,不需代理;port 預設 5985、use_ssl 預設 false(Windows Server 防火牆預設封鎖 5986,走 HTTP 時一律以 NTLM 加密)The server reads scopes (minus exclusions), exclusions, reservations and leases over WinRM + PowerShell, read-only, no agent; port defaults to 5985 and use_ssl to false (the Windows Server firewall blocks 5986 by default; over HTTP content is always NTLM-encrypted)サーバーが WinRM+PowerShell でスコープ(除外範囲を差し引き)・除外範囲・予約・リースを読み取ります(読み取り専用、エージェント不要)。port の既定は 5985、use_ssl の既定は false(Windows Server のファイアウォールは既定で 5986 をブロック。HTTP の場合も内容は常に NTLM で暗号化)admin
Kea DHCP/kea-dhcp/serversJSON 控制 API(自動判斷 2.x 的控制代理或 3.0 直連):設定、保留、租約JSON control API (auto-detects the 2.x control agent or a direct 3.0 socket): config, reservations, leasesJSON 制御 API(2.x の制御エージェントか 3.0 の直接接続かを自動判定):設定、予約、リースadmin
Technitium DHCP/technitium-dhcp/servers
/technitium-dhcp/servers/{id}/test
/technitium-dhcp/servers/{id}/sync
/technitium-dhcp/servers/{id}/scopes
Technitium DNS Server 的 HTTP API,唯讀:範圍(扣掉排除區間)寫進發放範圍、保留寫進 DHCP 保留、租約標記既有 IP;/scopes 是上一次同步看到的範圍與發給用戶端的閘道、DNS、NTP、WINS(IP 變更評估會比對)。建立時 token 必填(Technitium 的 API token,只需要 DHCP 檢視權限),讀取不會回傳,只有 has_token;token 放在 POST 表單送出,不出現在網址。test 回報版本、帳號、範圍與租約數,以及 can_modify(token 權限給太多)。DNS 紀錄是 /dns/servers 的 technitium 類型Technitium DNS Server HTTP API, read-only: scopes (minus their exclusions) become pools, reservations go to DHCP reservations and leases tag existing IPs; /scopes lists the scopes seen by the last sync with the gateway, DNS, NTP and WINS handed to clients (IP change assessment checks them). token is required on create (a Technitium API token; DHCP view permission is enough), is never returned (only has_token) and is sent in the POST form body, never in the URL. test reports the version, account, scope and lease counts, and can_modify (the token has more rights than needed). DNS records come from the technitium type under /dns/serversTechnitium DNS Server の HTTP API(読み取り専用):スコープ(除外範囲を差し引いたもの)は配布範囲に、予約は DHCP 予約に書き込み、リースは既存の IP に印を付けます。/scopes は前回の同期で見えたスコープと、クライアントへ配布するゲートウェイ・DNS・NTP・WINS(IP 変更評価が照合します)。作成時は token が必須(Technitium の API トークン。DHCP の閲覧権限で十分)で、読み取りでは返さず has_token だけを返します。トークンは POST フォームで送り、URL には出しません。test はバージョン、アカウント、スコープ数とリース数、can_modify(トークンの権限が必要以上)を返します。DNS レコードは /dns/servers の technitium 種別ですadmin
ISC DHCP/isc-dhcp/servers伺服器不連線:指派的掃描代理在本機讀 dhcpd.conf/dhcpd.leases,只送解析後的結果(見第 20 節 dhcpd-report)。一個代理只能負責一個 ISC 來源;沒有 test/sync 端點No connection from the server: the assigned scan agent reads dhcpd.conf / dhcpd.leases locally and sends only parsed results (see dhcpd-report in section 20). One agent serves at most one ISC source; there is no test/sync endpointサーバーからは接続しません。割り当てたスキャンエージェントがローカルで dhcpd.conf/dhcpd.leases を読み、解析結果だけを送ります(第 20 節の dhcpd-report)。1 台のエージェントが担当できる ISC ソースは 1 つだけで、test/sync のエンドポイントはありませんadmin
ISOinsight/isoinsight/sources
/isoinsight/leases
登入 ISOinsight 的 HTTP(S) 介面讀 DHCP 租約(只登入與查詢),配對到允許的子網路並寫進來源租約記錄;細節見下方「ISOinsight 整合」Logs in to the ISOinsight HTTP(S) interface and reads DHCP leases (login and read only), matches them to the allowed subnets and keeps them as source lease records; details in "ISOinsight integration" belowISOinsight の HTTP(S) インターフェイスにログインして DHCP リースを読み(ログインと参照のみ)、許可されたサブネットに対応付けてソースのリース記録として保存します。詳細は下の「ISOinsight 連携」admin(/isoinsight/leases 依可見子網路)admin (/isoinsight/leases: by visible subnets)admin(/isoinsight/leases は閲覧できるサブネットに限る)
SNMP/snmp/credentials
/snmp/targets
/snmp/targets/bulk
/snmp/targets/{id}/test
/snmp/targets/{id}/collect
/snmp/targets/{id}/runs
/snmp/runs
/snmp/jobs/{job_id}
/snmp/collectors
/snmp/agents
/snmp/neighbors
伺服器不連線:負責的掃描代理(1.19.0 以上、裝了 net-snmp 用戶端工具)以唯讀 SNMP v2c/v3 讀指派的網路設備:ARP 表、MAC 表(含 Cisco 逐 VLAN)、LLDP/CDP 鄰居、介面;結果經第 20 節 snmp-report 回報。細節見下方「SNMP 收集」No connection from the server: the responsible scan agent (1.19.0 or later, with the net-snmp client tools) reads the assigned network devices over read-only SNMP v2c/v3: ARP tables, MAC tables (Cisco per VLAN included), LLDP/CDP neighbors, interfaces; results come back through snmp-report in section 20. Details in "SNMP collection" belowサーバーからは接続しません。担当のスキャンエージェント(1.19.0 以降で net-snmp のクライアントツールを導入済み)が、割り当てられたネットワーク機器を読み取り専用の SNMP v2c/v3 で読みます:ARP テーブル、MAC テーブル(Cisco の VLAN ごとを含む)、LLDP/CDP のネイバー、インターフェイス。結果は第 20 節の snmp-report で報告します。詳細は下の「SNMP 収集」admin
RustDesk/rustdesk/servers
/rustdesk/servers/{id}/peers
/rustdesk/servers/{id}/audit
/rustdesk/servers/{id}/test
/rustdesk/servers/{id}/sync-now
/rustdesk/servers/{id}/agent-key
/rustdesk/servers/{id}/rotate-agent-key
/rustdesk/servers/{id}/peers/delete
/rustdesk/servers/{id}/peer-deletes
RustDesk Server(開源版)。伺服器不連線:RustDesk 主機上裝專用的 RustDesk 代理(不是掃描代理;協定見第 20 節「RustDesk 代理」),唯讀讀取 hbbs 的資料庫、查線上狀態,只送 ID、首次註冊時間、登記 IP、是否上線、版本與公鑰,私鑰檔絕不讀。POST /rustdesk/servers 回應帶這台伺服器專用的 agent_key(只出現這一次);GET …/{id}/agent-key 再看一次(留稽核)、POST …/{id}/rotate-agent-key 換新(舊的立刻失效)。POST …/{id}/sync-now(202,代理下一次輪詢、最多約 10 秒內讀一次回報;回應的 agent_online 說明代理目前有沒有連線);POST …/{id}/test 請代理在主機上逐項檢查,GET …/{id}/test 取結果(checks[]:key、ok、detail)。伺服器讀取時另帶 agent_online(後端在回應當下判斷代理是否上線)、agent_version、agent_latest_version、agent_last_seen_at、agent_source_ip、agent_hostname、agent_status(接收端是否在聽、綁不上的原因)。client_address 是客戶端用的伺服器位址(主機名稱或 IP,可帶 :埠),用來組連線網址。相容 RustDesk 的網頁連線:web_enabled(預設 false)、hbbs_host(後端連 hbbs 的位址,可帶 :埠;空白=代理回報的來源位址)、relay_host(後端連 hbbr 的位址;空白=hbbs 主機加預設中繼埠)、transport(tcp 用 21116/21117,ws 用 21118/21119)、web_file_transfer(網頁檔案傳輸,預設 false)、web_file_max_file_mb 與 web_file_max_total_mb(上傳的單檔與單次總量上限,MB,預設 2048 與 10240,1 到 1048576)。後端只連這兩個位址,金鑰與輸入的密碼只在瀏覽器裡;選擇「記住密碼」時,密碼存進連線帳密金庫(/ssh-credentials,protocol=rustdesk),連線時後端只回這一次連線用的雜湊,密碼不會回到瀏覽器(票證回應的 has_saved_password 表示這個 IP 有沒有已存的密碼)。hbbs 要用金鑰檔啟動(官方 deb 的 .env 設 KEY=_),用 -k 加公鑰字串啟動的 hbbs 不簽受控端身分,網頁連線會被拒絕。peers 支援 q(ID、IP、主機名稱)、online、key_problem(true=只列 Key 設錯的裝置)、match_status(matched、not_seen_online、stale、shared、ambiguous、unmanaged、no_ip、device_changed(最後看到早於位址換給目前這台設備,不再對應)與分頁。ID 只在登記 IP 唯一、最近 7 天內上線、同一 IP 不超過 2 個 ID 時才對應到 IP 記錄。一台伺服器一把代理金鑰。receive_reports(預設開)與 api_port(預設 21114):RustDesk 代理在 RustDesk 主機上收客戶端自己送的心跳、系統資訊、連線與檔案稽核、告警(客戶端沒填 API 伺服器時本來就會送到 ID 伺服器的 21114),在本機比對 uuid 後轉送;peers 因此多了 hostname、os_name、username、last_heartbeat_at、report_ip,對應改用多個訊號(回報來源 IP、登記 IP、主機名稱,見 match_evidence;主機名稱矛盾為 conflict,只有名稱相符為 hostname_only 並給 candidate_address_id)。audit 支援 q、kind(conn、file、alarm、note)、rustdesk_id、since 與分頁;告警(密碼錯太多次等)另發 rustdesk.alarm 通知。Key 設錯:代理 1.1.0 起讀 hbbr/hbbs 日誌,peers 的 key_problem 為 {at, scope, count}(scope:relay=中繼拒絕這台、hbbs=ID 伺服器拒絕這台發出的連線;之後通過中繼就變回 null),伺服器讀取另帶 key_problems(目前幾台)與 agent_status.logs(日誌讀不讀得到);IP 詳情的 rustdesk.key_problem 相同。刪除舊註冊(0182):伺服器設定 allow_peer_delete(預設 false),RustDesk 主機上也要以 --allow-delete 安裝代理。POST …/{id}/peers/delete({"rustdesk_ids":[…]},1 到 500 個;202,回應 queued、already_pending、requested_at、eta_seconds、agent_online)只收這台伺服器的、jt-ipam 看來離線的 ID,整批檢查,一個不合就整批不收:沒開設定回 409 rustdesk_peer_delete_off,代理沒有寫入權限回 409 rustdesk_peer_delete_agent(params.reason 是代理回報的原因),有 ID 上線中回 409 rustdesk_peer_delete_online,有 ID 不在這台的清單回 422 rustdesk_peer_delete_unknown,伺服器停用回 409 rustdesk_server_disabled;留稽核 rustdesk.peer_delete_requested(誰、哪些 ID)。GET …/{id}/peer-deletes 列出請求與結果(新的在前;支援 status、since 與分頁;每筆 rustdesk_id、status(pending、deleted、skipped_online、not_found、failed、cancelled)、detail、requested_by_name、requested_at、finished_at)。超過一天沒被代理取走的變 failed,關掉設定時等待中的變 cancelled。伺服器讀取的 agent_status.capabilities 是代理回報的寫入能力(delete、delete_reason)。peers 另支援 never_online=true(jt-ipam 從沒看過上線的裝置)RustDesk Server (open source). No connection from the server: a dedicated RustDesk agent on the RustDesk host (not the scan agent; protocol under "RustDesk agent" in section 20) reads the hbbs database read-only and queries online state, sending only the ID, first registration time, registered IP, online state, version and public key; the private key file is never opened. POST /rustdesk/servers returns this server's own agent_key (shown only this once); GET …/{id}/agent-key shows it again (audited), POST …/{id}/rotate-agent-key replaces it (the old one stops working at once). POST …/{id}/sync-now (202; the agent reads and reports on its next poll, within about 10 seconds; agent_online in the reply says whether it is connected); POST …/{id}/test asks the agent to run its checks on the host and GET …/{id}/test returns them (checks[]: key, ok, detail). Server reads also carry agent_online (whether the agent counts as online, decided by the server at response time), agent_version, agent_latest_version, agent_last_seen_at, agent_source_ip, agent_hostname and agent_status (whether the receiver is listening, and why not). client_address is the server address clients use (host name or IP, optional :port) and goes into the connect link. RustDesk-compatible web connection: web_enabled (default false), hbbs_host (the address the backend uses for hbbs, optional :port; empty = the source address the agent reports), relay_host (the address for hbbr; empty = the hbbs host plus the default relay port), transport (tcp uses 21116/21117, ws uses 21118/21119), web_file_transfer (web file transfer, default false), web_file_max_file_mb and web_file_max_total_mb (upload limits per file and per upload in MB, default 2048 and 10240, 1 to 1048576). The backend connects only to these addresses; keys and typed passwords stay in the browser. With “Remember password” the password goes into the credential vault (/ssh-credentials, protocol=rustdesk) and, at connect time, the backend returns only the hash for that one connection, never the password (the ticket's has_saved_password says whether this IP has a saved password). hbbs must run with its key file (KEY=_ in the .env of the official deb); an hbbs started with -k and a public key string does not sign the device identity, so web connections are refused. peers takes q (ID, IP, host name), online, key_problem (true = only devices with a wrong Key), match_status (matched, not_seen_online, stale, shared, ambiguous, unmanaged, no_ip, device_changed: last seen before the address went to its current device, so no longer matched) and paging. An ID is mapped to an IP record only when its registered IP is unique, it was online within 7 days and no more than 2 IDs share that IP. One agent key per server. receive_reports (default on) and api_port (default 21114): the RustDesk agent receives what the clients report themselves (heartbeat, system info, connection and file audit, alarms; clients without an API server setting already send to port 21114 of the ID server), checks the uuid locally and forwards it. peers therefore also carries hostname, os_name, username, last_heartbeat_at and report_ip, and mapping uses several signals (report source IP, registered IP, host name; see match_evidence; a contradicting host name gives conflict, a host-name-only match gives hostname_only with candidate_address_id). audit takes q, kind (conn, file, alarm, note), rustdesk_id, since and paging; alarms (too many wrong passwords and so on) also raise the rustdesk.alarm notification. Wrong Key: from agent 1.1.0 the agent reads the hbbr/hbbs logs; key_problem in peers is {at, scope, count} (scope: relay = the relay refused this device, hbbs = the ID server refused a connection from it; back to null after it passes the relay), server reads also carry key_problems (how many devices now) and agent_status.logs (whether the logs can be read); rustdesk.key_problem in the IP detail is the same. Deleting old registrations (0182): the server setting allow_peer_delete (default false), and the agent on the RustDesk host installed with --allow-delete. POST …/{id}/peers/delete ({"rustdesk_ids":[…]}, 1 to 500; 202 with queued, already_pending, requested_at, eta_seconds, agent_online) accepts only IDs of this server that are offline in jt-ipam's view, checked as a whole (one bad ID refuses the request): setting off gives 409 rustdesk_peer_delete_off, an agent without write access 409 rustdesk_peer_delete_agent (params.reason is the agent's reason), an online ID 409 rustdesk_peer_delete_online, an ID not in this server's list 422 rustdesk_peer_delete_unknown, a disabled server 409 rustdesk_server_disabled; audited as rustdesk.peer_delete_requested (who, which IDs). GET …/{id}/peer-deletes lists requests and results (newest first; status, since and paging; each with rustdesk_id, status (pending, deleted, skipped_online, not_found, failed, cancelled), detail, requested_by_name, requested_at, finished_at). Requests not taken by the agent within a day become failed; turning the setting off makes waiting ones cancelled. agent_status.capabilities in server reads is the write access the agent reports (delete, delete_reason). peers also takes never_online=true (devices jt-ipam has never seen online)RustDesk Server(オープンソース版)。サーバーからは接続しません。RustDesk ホストに入れた専用の RustDesk エージェント(スキャンエージェントではありません。プロトコルは第 20 節「RustDesk エージェント」)が hbbs のデータベースを読み取り専用で読み、オンライン状態を問い合わせ、ID・初回登録時刻・登録 IP・オンライン状態・バージョン・公開鍵だけを送ります。秘密鍵ファイルは決して開きません。POST /rustdesk/servers の応答にこのサーバー専用の agent_key が付きます(表示はこの 1 回だけ)。GET …/{id}/agent-key で再表示(監査あり)、POST …/{id}/rotate-agent-key で再発行(古いキーはすぐ無効)。POST …/{id}/sync-now(202。エージェントの次のポーリング、約 10 秒以内に読み取って報告。応答の agent_online で接続中かどうか分かります)、POST …/{id}/test でホスト上の各項目チェックを依頼し、GET …/{id}/test で結果(checks[]:key・ok・detail)を取得します。サーバーの読み取りには agent_online(エージェントがオンラインかどうか、応答時にサーバーが判断)・agent_version・agent_latest_version・agent_last_seen_at・agent_source_ip・agent_hostname・agent_status(受信の待ち受け状態と失敗理由)も含まれます。client_address はクライアントが使うサーバーアドレス(ホスト名または IP、:ポート 付きも可)で、接続リンクに使います。RustDesk 互換の Web 接続:web_enabled(既定 false)、hbbs_host(バックエンドが hbbs に接続するアドレス、:ポート 付きも可。空欄ならエージェントの送信元アドレス)、relay_host(hbbr に接続するアドレス。空欄なら hbbs のホストと既定の中継ポート)、transport(tcp は 21116/21117、ws は 21118/21119)、web_file_transfer(Web ファイル転送。既定 false)、web_file_max_file_mb と web_file_max_total_mb(アップロードの 1 ファイルと 1 回合計の上限。MB、既定 2048 と 10240、1 から 1048576)。バックエンドが接続するのはこの 2 つのアドレスだけで、鍵と入力したパスワードはブラウザーの中にだけあります。「パスワードを記憶する」を選ぶとパスワードは接続資格情報の保管庫(/ssh-credentials、protocol=rustdesk)に保存され、接続時にバックエンドはその接続専用のハッシュだけを返し、パスワードはブラウザーに戻りません(チケット応答の has_saved_password でこの IP に保存済みのパスワードがあるか分かります)。hbbs は鍵ファイルで起動する必要があります(公式 deb の .env で KEY=_)。-k に公開鍵の文字列を指定した hbbs は接続先の ID に署名しないため、Web 接続は拒否されます。peers は q(ID・IP・ホスト名)、online、key_problem(true で Key が誤っているデバイスだけ)、match_status(matched・not_seen_online・stale・shared・ambiguous・unmanaged・no_ip、device_changed:最後に見えたのがアドレスが現在の機器に割り当てられる前のため、対応付けなし)とページングに対応。ID を IP レコードに対応付けるのは、登録 IP が一意で、7 日以内にオンラインで、同じ IP の ID が 2 個以下のときだけです。サーバー 1 台につきエージェントキーは 1 つです。receive_reports(既定オン)と api_port(既定 21114):エージェントが RustDesk ホストでクライアント自身の報告(ハートビート、システム情報、接続とファイルの監査、警告。API サーバー未設定のクライアントはもともと ID サーバーの 21114 に送ります)を受け取り、uuid をローカルで照合してから転送します。そのため peers には hostname・os_name・username・last_heartbeat_at・report_ip も含まれ、対応付けは複数の手がかり(報告元 IP、登録 IP、ホスト名。match_evidence を参照。ホスト名が矛盾すれば conflict、名前だけ一致すれば hostname_only と candidate_address_id)で行います。audit は q・kind(conn・file・alarm・note)・rustdesk_id・since とページングに対応。警告(パスワード誤り過多など)は rustdesk.alarm 通知も出します。Key の誤り:エージェント 1.1.0 以降は hbbr/hbbs のログを読み、peers の key_problem が {at, scope, count} になります(scope:relay は中継がこのデバイスを拒否、hbbs は ID サーバーがこのデバイスからの接続を拒否。その後中継を通れば null に戻る)。サーバーの読み取りには key_problems(現在の台数)と agent_status.logs(ログを読めるか)も含まれ、IP 詳細の rustdesk.key_problem も同じです。古い登録の削除(0182):サーバー設定 allow_peer_delete(既定 false)に加え、RustDesk ホストのエージェントを --allow-delete 付きでインストールする必要があります。POST …/{id}/peers/delete({"rustdesk_ids":[…]}、1 から 500 件。202 で queued・already_pending・requested_at・eta_seconds・agent_online)は、このサーバーの ID で jt-ipam から見てオフラインのものだけを受け付け、まとめて検査します(1 件でも不適合なら全体を拒否)。設定がオフなら 409 rustdesk_peer_delete_off、エージェントに書き込み権限がなければ 409 rustdesk_peer_delete_agent(params.reason はエージェントが報告した理由)、オンラインの ID があれば 409 rustdesk_peer_delete_online、このサーバーの一覧にない ID があれば 422 rustdesk_peer_delete_unknown、サーバーが無効なら 409 rustdesk_server_disabled。監査は rustdesk.peer_delete_requested(誰が、どの ID を)。GET …/{id}/peer-deletes は依頼と結果の一覧(新しい順。status・since とページングに対応。各行に rustdesk_id・status(pending・deleted・skipped_online・not_found・failed・cancelled)・detail・requested_by_name・requested_at・finished_at)。1 日以内にエージェントが受け取らなかった依頼は failed、設定をオフにすると待機中のものは cancelled になります。サーバーの読み取りの agent_status.capabilities はエージェントが報告した書き込み能力(delete・delete_reason)です。peers は never_online=true(jt-ipam が一度もオンラインを確認していないデバイス)にも対応しますadmin
Proxmox VE/virt/proxmox設定在 /virt/proxmox;抓回的資料在 /virt/clusters、/virt/vms、/virt/vms/{id}/interfaces、/virt/pve-firewallConfigured under /virt/proxmox; data lands in /virt/clusters, /virt/vms, /virt/vms/{id}/interfaces, /virt/pve-firewall設定は /virt/proxmox。取り込んだデータは /virt/clusters・/virt/vms・/virt/vms/{id}/interfaces・/virt/pve-firewall資料需全域讀取;/virt/proxmox 設定需 adminData: global read; /virt/proxmox config: adminデータは全体の読み取り、/virt/proxmox の設定は admin
ESXi / vCenter/esxivSphere SOAP 抓虛擬機,結果出現在 /virt/vms;清單是純陣列Pulls VMs over vSphere SOAP; they appear in /virt/vms. The list is a bare arrayvSphere SOAP で仮想マシンを取得し、/virt/vms に現れます。一覧は配列のみadmin
OCS Inventory NG/ocs電腦資產清冊,依網卡 MAC 對到既有 IP;/ocs/agents 每台電腦一列,/ocs/missing-agents 列出有主機名稱卻從未被盤點的 IP。timezone 是 OCS 主機的 IANA 時區(LASTDATE 沒有時區),新建時不給=jt-ipam 主機的 APP_TIMEZONE;同步結果 last_cost.future_lastdate 表示換算後有盤點時間落在未來(時區多半設錯)Computer inventory matched to existing IPs by NIC MAC; /ocs/agents lists one row per computer and /ocs/missing-agents lists IPs with a hostname that OCS has never inventoried. timezone is the OCS host's IANA time zone (LASTDATE carries none); omitted on create, it is the jt-ipam host's APP_TIMEZONE. last_cost.future_lastdate in the sync result means some converted inventory times are in the future (the time zone is probably wrong)PC の資産台帳。NIC の MAC で既存の IP に対応付けます。/ocs/agents は PC ごとに 1 行、/ocs/missing-agents はホスト名があるのに一度も棚卸しされていない IP の一覧です。timezone は OCS ホストの IANA タイムゾーンです(LASTDATE はタイムゾーンを持ちません)。作成時に省略すると jt-ipam ホストの APP_TIMEZONE になります。同期結果の last_cost.future_lastdate は換算後の棚卸し日時が未来になっていること(タイムゾーンの設定ミスの可能性)を示しますGET /ocs 需全域讀取;agents、missing-agents 需 adminGET /ocs: global read; agents, missing-agents: adminGET /ocs は全体の読み取り、agents・missing-agents は admin
Zabbix/zabbix唯讀 JSON-RPC:主機與 IP 對應、可用性、維護狀態;/{id}/hosts、/{id}/coverage-gap(有主機名稱但沒被監控的 IP)Read-only JSON-RPC: host-to-IP mapping, availability, maintenance; /{id}/hosts and /{id}/coverage-gap (IPs with a hostname that are not monitored)読み取り専用の JSON-RPC:ホストと IP の対応、可用性、メンテナンス状態。/{id}/hosts、/{id}/coverage-gap(ホスト名があるのに監視されていない IP)全域讀取Global read全体の読み取り
LibreNMS/librenms裝置、ARP、FDB、鄰接連線、/trace/ip/{ip}(ARP → MAC → 交換器連接埠);執行個體設定在 /librenms/instances。/librenms/fdb 也包含 MikroTik 回報的列:source 為 mikrotik 時 device_id 是空的,交換器看 switch_device_id(jt-ipam 裝置)。執行個體的 auto_create_from_arp(依 ARP 表自動建立 IP,預設 false)、arp_create_require_fdb(要交換器 MAC 表 24 小時內也看過,預設 true)、arp_create_skip_dhcp(略過 DHCP 動態範圍,預設 true);建出來的位址 discovery_source 為 librenms_arp。vlan_domain_id(VLAN 同步寫進哪個 domain,null 為專用的 LibreNMS domain;指定後沿用同編號的既有 VLAN、不覆寫已有的名稱)、vlan_create_missing(指定 domain 時,domain 裡沒有的編號要不要新建,預設 true)。LibreNMS 停用輪詢的裝置在 /librenms/devices 的 status 是 disabled,不提供任何資料Devices, ARP, FDB, links, /trace/ip/{ip} (ARP → MAC → switch port); configured under /librenms/instances. /librenms/fdb also includes rows reported by MikroTik: when source is mikrotik, device_id is empty and the switch is switch_device_id (a jt-ipam device). Instance fields auto_create_from_arp (create IPs from the ARP table, default false), arp_create_require_fdb (a switch MAC table must also have seen the MAC within 24 hours, default true) and arp_create_skip_dhcp (skip DHCP dynamic ranges, default true); addresses created this way have discovery_source librenms_arp. vlan_domain_id (the VLAN domain to sync into; null is the dedicated LibreNMS domain; when set, existing VLANs with the same number are reused and their names kept) and vlan_create_missing (with a domain set, whether to create numbers the domain lacks; default true). Devices with polling disabled in LibreNMS have status disabled in /librenms/devices and supply no data機器、ARP、FDB、隣接リンク、/trace/ip/{ip}(ARP → MAC → スイッチのポート)。設定は /librenms/instances。/librenms/fdb には MikroTik が報告した行も含まれます:source が mikrotik の場合 device_id は空で、スイッチは switch_device_id(jt-ipam のデバイス)です。インスタンスの auto_create_from_arp(ARP テーブルから IP を作成、既定 false)、arp_create_require_fdb(スイッチの MAC テーブルでも 24 時間以内に見えていること、既定 true)、arp_create_skip_dhcp(DHCP の動的範囲をスキップ、既定 true)。こうして作成されたアドレスの discovery_source は librenms_arp。vlan_domain_id(VLAN の同期先ドメイン。null は専用の LibreNMS ドメイン。指定すると同じ番号の既存 VLAN を使い、既存の名前は上書きしない)、vlan_create_missing(ドメイン指定時、ドメインにない番号を作成するか。既定 true)。LibreNMS でポーリングを無効にした機器は /librenms/devices の status が disabled になり、データを提供しません資料需全域讀取;instances 需 adminData: global read; instances: adminデータは全体の読み取り、instances は admin
DNS/dnsPowerDNS、BIND9、OPNsense 上的 Unbound、Windows DNS、Univention、Technitium;區域、記錄、正反解一致性。伺服器設定在 /dns/servers(Technitium 的 API token 放在 api_key,只讀取;Technitium 逐個區域給權限,test 的 unreadable_zones 列出讀不到的區域。Windows DNS 走 WinRM:extra_config 的 use_ssl 選 HTTP 5985(預設:Windows Server 防火牆預設封鎖 5986;一律以 NTLM 加密內容)或 HTTPS 5986,winrm_port 可改連接埠,HTTPS 用自簽憑證時把 verify_tls 設成 false)。比對群組在 /dns/compare-groups(jt-ipam 不會在伺服器之間同步紀錄,只比對各台拉取回來的資料):建立時帶 name、server_ids(台數不限)、grace_minutes(0 到 1440,預設 30)、notify_enabled、compare_types(比對的紀錄類型,預設 ["A","AAAA","PTR"],可另選 CNAME、MX、TXT、NS、SRV、CAA;勾了其他類型,成員拉取時也會存那些紀錄,拿掉後下一次拉取清掉)、excluded_zones(不比對的 zone,最多 500 個;讀取時另有 zones 列出成員拉回來的 zone;還沒存檔或改了成員時用 GET /dns/compare-groups/zone-options?server_ids=…(可重複,最多 200 個)取那幾台的 zone);改成員、compare_types 或 excluded_zones 時馬上重新比對;伺服器也可以用 compare_group_id 加入或退出(給 null 才清掉)。不同軟體可以混搭,但 Unbound(OPNsense)只能和 Unbound 同組,混在一起會回 422(代碼 dns_compare_group_mixed_kinds)。每台拉取後自動比對(compare_types 勾的類型;AD 的服務定位資料不比),POST /dns/compare-groups/{id}/check 立即比對,GET /dns/compare-groups/{id}/diffs 列出差異(present_on、missing_on 是伺服器清單,confirmed 表示已確認:沒有的那台在差異出現加寬限時間之後重新拉取過,仍然沒有;first_seen_at 是有這筆的伺服器拉取的時間)。GET /dns/records?merge=true(/dns/records/type-counts 也一樣)把同一組裡相同的紀錄合成一筆,servers 列出哪幾台都有、compare_group_name 是群組名稱PowerDNS, BIND9, Unbound on OPNsense, Windows DNS, Univention, Technitium; zones, records, forward/reverse consistency. Servers are configured under /dns/servers (for Technitium the API token goes in api_key and it is read-only; Technitium grants access per zone, and test lists zones it cannot read in unreadable_zones. Windows DNS uses WinRM: use_ssl in extra_config picks HTTP 5985 (the default, since the Windows Server firewall blocks 5986 by default; content is always NTLM-encrypted) or HTTPS 5986, winrm_port changes the port, and verify_tls set to false accepts a self-signed HTTPS certificate). Comparison groups live under /dns/compare-groups (jt-ipam does not sync records between the servers; it only compares the data pulled from each): create with name, server_ids (any number), grace_minutes (0 to 1440, default 30), notify_enabled, compare_types (record types compared, default ["A","AAAA","PTR"], optionally CNAME, MX, TXT, NS, SRV and CAA; ticking other types makes the members store those records from their next pull, and removing a type clears them at the next pull) and excluded_zones (zones not compared, up to 500; reads also return zones, the zones pulled from the members; before saving, or after changing the members, GET /dns/compare-groups/zone-options?server_ids=… (repeatable, up to 200) returns the zones of those servers); changing the members, compare_types or excluded_zones compares the group again right away; a server can also join or leave with compare_group_id (only an explicit null clears it). Different products can be mixed, but Unbound (OPNsense) can only be grouped with other Unbound servers; mixing returns 422 (code dns_compare_group_mixed_kinds). Members are compared after every pull (the types in compare_types; AD service locator data is left out); POST /dns/compare-groups/{id}/check compares now and GET /dns/compare-groups/{id}/diffs lists the differences (present_on and missing_on are server lists, confirmed means the server missing it was pulled again after the difference appeared plus the grace period and still lacks it; first_seen_at is when the server holding it was pulled). GET /dns/records?merge=true (and /dns/records/type-counts) folds identical records within a group into one row, with the holders in servers and the group in compare_group_namePowerDNS、BIND9、OPNsense 上の Unbound、Windows DNS、Univention、Technitium。ゾーン、レコード、正引き/逆引きの整合性。サーバーの設定は /dns/servers(Technitium の API トークンは api_key に入れ、読み取り専用です。Technitium はゾーンごとに権限を与えるため、test の unreadable_zones に読み取れないゾーンを返します。Windows DNS は WinRM を使います:extra_config の use_ssl で HTTP 5985(既定。Windows Server のファイアウォールは既定で 5986 をブロック。内容は常に NTLM で暗号化)か HTTPS 5986 を選び、winrm_port でポートを変更、HTTPS が自己署名証明書なら verify_tls を false にします)。比較グループは /dns/compare-groups(jt-ipam はサーバー間でレコードを同期せず、各サーバーから取得したデータを比較するだけです):作成時に name、server_ids(台数制限なし)、grace_minutes(0〜1440、既定 30)、notify_enabled、compare_types(比較するレコードの種類。既定は ["A","AAAA","PTR"]、ほかに CNAME・MX・TXT・NS・SRV・CAA を選べます。ほかの種類を選ぶとメンバーの次回の取得からそのレコードも保存し、外すと次回の取得で消します)、excluded_zones(比較しないゾーン、最大 500。読み取り時はメンバーから取得したゾーンを zones で返します。保存前やメンバーを変えたときは GET /dns/compare-groups/zone-options?server_ids=…(繰り返し指定可、最大 200)でそのサーバーのゾーンを取得します)を指定します。メンバー、compare_types、excluded_zones を変えるとすぐに再比較します。サーバー側の compare_group_id でも参加・脱退できます(明示的に null を送ったときだけ解除)。異なる製品を混在できますが、Unbound(OPNsense)は Unbound 同士でしかグループにできず、混在させると 422(コード dns_compare_group_mixed_kinds)を返します。取得のたびに自動で比較し(compare_types の種類。AD のサービスロケーター情報は比較しません)、POST /dns/compare-groups/{id}/check で即時比較、GET /dns/compare-groups/{id}/diffs で差分を一覧します(present_on・missing_on はサーバーの一覧、confirmed は確定したもの:違いが現れて猶予時間がたった後に、ないサーバーを取得し直してもまだない。first_seen_at はあるサーバーを取得した時刻)。GET /dns/records?merge=true(/dns/records/type-counts も同様)はグループ内の同じレコードを 1 行にまとめ、保持サーバーを servers、グループ名を compare_group_name に返します資料需全域讀取;/dns/servers、/dns/compare-groups 需 adminData: global read; /dns/servers and /dns/compare-groups: adminデータは全体の読み取り、/dns/servers・/dns/compare-groups は admin
Wazuh/wazuh代理清單(狀態、作業系統、CVE 數)與未安裝代理的主機Agents (status, OS, CVE counts) and hosts without an agentエージェント一覧(状態、OS、CVE 件数)とエージェント未導入のホストadmin
AdGuard Home/adguard/instances用戶端、DNS 改寫與 DHCP,作為主機名稱來源Clients, DNS rewrites and DHCP, as a hostname sourceクライアント、DNS の書き換え、DHCP をホスト名のソースとして使いますadmin

ISOinsight 整合(Beta,/isoinsight)ISOinsight integration (Beta, /isoinsight)ISOinsight 連携(Beta、/isoinsight)

jt-ipam 伺服器登入 ISOinsight 的網頁介面,再以同一個 Session 讀 /isosvc?act=DhcpLease。原廠說明的方式(新增時的預設)是 POST JSON 到 /logon 取得 SessionID,以網址參數 sessionid 帶給租約網址:auth_mode=token、token_path=SessionID、token_in=query、token_param=sessionid(token_in=header 時改用 token_header 與 token_prefix)。GET 或 POST form/JSON、Cookie 或 Token 都由管理員明確選擇,不會自動切換。網址裡的 Session ID 不會出現在連線記錄與日誌。只做登入與查詢,不改設備的 DHCP 設定或租約。密碼加密保存、寫入後不回傳(只有 has_password);Cookie 與 Token 只在單次工作的記憶體裡,不存資料庫。待真機驗證:登入回應的格式(Cookie 或 Token 欄位)、GET 與 POST 何者可用、租約是否全量與時區,這裡的設定都只是相容性選項。 The jt-ipam server logs in to the ISOinsight web interface, then reads /isosvc?act=DhcpLease with the same session. The vendor's method (the default for new sources) is to POST JSON to /logon for a SessionID and pass it to the lease URL as the sessionid query parameter: auth_mode=token, token_path=SessionID, token_in=query, token_param=sessionid (with token_in=header, token_header and token_prefix are used instead). GET or POST form/JSON and cookie or token are explicit admin choices and never switch automatically. A session ID in the URL never appears in the connection trace or the logs. It only logs in and reads; it never changes DHCP settings or leases on the device. The password is stored encrypted and never returned (only has_password); cookies and tokens live only in the memory of a single job and are never stored. Pending verification on a real device: the login response (cookie or token field), whether GET or POST works, whether the lease list is complete, and the time zone; these settings are compatibility options only.jt-ipam サーバーが ISOinsight の Web インターフェイスにログインし、同じセッションで /isosvc?act=DhcpLease を読みます。メーカーが案内している方式(新規作成時の既定値)は、/logon に JSON を POST して SessionID を取得し、URL パラメーター sessionid としてリース URL に付ける方式です:auth_mode=token、token_path=SessionID、token_in=query、token_param=sessionid(token_in=header のときは token_header と token_prefix を使用)。GET か POST form/JSON か、Cookie かトークンかは管理者が明示的に選び、自動では切り替えません。URL 内のセッション ID は接続記録とログに出ません。ログインと参照のみで、機器の DHCP 設定やリースは変更しません。パスワードは暗号化して保存し、書き込み後は返しません(has_password のみ)。Cookie とトークンは 1 回のジョブのメモリ内だけにあり、保存しません。実機での検証待ち:ログイン応答の形式(Cookie またはトークン項目)、GET と POST のどちらが使えるか、リースが全件か、タイムゾーン。ここの設定は互換性のための選択肢にすぎません。

端點Endpointエンドポイント說明Meaning説明
GET/POST /api/v1/isoinsight/sources
GET/PATCH/DELETE /api/v1/isoinsight/sources/{id}
來源設定(admin)。scope_all=true 時允許 customer_id 的所有子網路(沒填=不屬於任何客戶的子網路),之後新建的也算;建立時沒帶 scope_subnet_ids 就預設是全部。帶了 scope_subnet_ids 時全部要屬於 customer_id,否則回 422 isoinsight_scope_mixed_tenant;scope_all=false 又沒有清單回 isoinsight_scope_empty;timezone_confirmed 必須是 true(來源時區由管理員確認)。PATCH 的 password 留空=保留原密碼。改了連線或配對相關欄位會清掉 last_test_ok_at/preview_ok_at,要重新測試與預覽;schedule_enabled 預設 true、隨時可以切換;還沒用目前設定成功預覽過時,排程輪到不會同步,來源的 last_error_code 記 PREVIEW_REQUIREDSource settings (admin). With scope_all=true every subnet of customer_id is allowed (empty means subnets without a customer), including subnets created later; leaving scope_subnet_ids out on create means all. When scope_subnet_ids is given, every subnet must belong to customer_id, otherwise 422 isoinsight_scope_mixed_tenant; scope_all=false with no list returns isoinsight_scope_empty; timezone_confirmed must be true (the admin confirms the source time zone). An empty password in PATCH keeps the current one. Changing connection or matching fields clears last_test_ok_at/preview_ok_at, so test and preview again; schedule_enabled defaults to true and can be switched at any time; until a preview with the current settings succeeds, scheduled turns do not sync and the source's last_error_code is PREVIEW_REQUIREDソース設定(admin)。scope_all=true のときは customer_id のすべてのサブネット(空欄は顧客なしのサブネット)が許可され、後から作成したものも含みます。作成時に scope_subnet_ids を省略すると全サブネットになります。scope_subnet_ids を指定した場合はすべて customer_id に属している必要があり、違反すると 422 isoinsight_scope_mixed_tenant。scope_all=false で一覧もない場合は isoinsight_scope_empty。timezone_confirmed は true が必須です(ソースのタイムゾーンは管理者が確認)。PATCH の password が空ならパスワードはそのままです。接続や対応付けに関わる項目を変えると last_test_ok_at/preview_ok_at が消え、テストとプレビューのやり直しが必要です。schedule_enabled の既定値は true で、いつでも切り替えられます。現在の設定でプレビューに成功するまでは、スケジュールの番が来ても同期せず、ソースの last_error_code は PREVIEW_REQUIRED になります
POST /api/v1/isoinsight/sources/{id}/test分階段測試:登入、讀租約、結構驗證,全部通過才是 ok: true。回傳每一步的方法、已遮蔽的路徑、HTTP 狀態與耗時;Cookie 只列名稱,Token、密碼、Set-Cookie 的值一律不出現。Token 模式取不到值時,登入那一步帶 response_shape:登入回應的欄位與型別(字串只給長度,code/msg 這類狀態欄位才給值),用來判斷 Token 欄位路徑該填什麼;設定的路徑大小寫不同、但同一層只有一個同名欄位時照樣採用,實際欄位放在 token_path_used。Token 是整數也接受。{"anonymous_check": true} 另外測試不登入是否也讀得到(人工診斷,不列入排程)。不寫任何 IP 或租約資料Step-by-step test: login, read leases, validate the structure; ok: true only when every step passes. Each step reports the method, the masked path, the HTTP status and the time; cookies are listed by name only, and token, password and Set-Cookie values never appear. In token mode, when no token is found the login step carries response_shape: the login response's fields and types (strings as lengths only; values only for status fields such as code/msg) to show what the token field path should be. When the configured path differs only in letter case and exactly one field at that level matches, it is used and the actual field is in token_path_used. An integer token is accepted. {"anonymous_check": true} also checks whether leases can be read without logging in (manual diagnosis, never scheduled). Writes no IP or lease data段階的なテスト:ログイン、リース読み取り、構造の検証。すべて通過したときだけ ok: true。各段階の方式、伏せ字のパス、HTTP ステータス、所要時間を返します。Cookie は名前のみで、トークン・パスワード・Set-Cookie の値は出しません。トークン方式で値が取れないときは、ログインの段階に response_shape(ログイン応答のフィールドと型。文字列は長さのみ、code/msg などの状態フィールドだけ値を表示)が付き、トークンのフィールドパスを判断できます。設定したパスと大文字小文字だけが違い、同じ階層に一致するフィールドが 1 つだけなら採用し、実際のフィールドを token_path_used に入れます。整数のトークンも受け付けます。{"anonymous_check": true} でログインなしで読めるかも確認します(手動の診断。スケジュールには含めません)。IP やリースのデータは書き込みません
POST /api/v1/isoinsight/sources/{id}/preview測試的全部步驟+子網路配對結果(counts 與最多 500 列的 rows,applied 永遠是 false)。成功一次後排程才會開始同步Every test step plus the subnet matching result (counts and up to 500 rows; applied is always false). The schedule starts syncing after one successテストの全段階+サブネット対応付けの結果(counts と最大 500 行の rows。applied は常に false)。一度成功するとスケジュールの同期が始まります
POST /api/v1/isoinsight/sources/{id}/sync立即同步(背景作業,回 task_id)。手動與排程共用同一把鎖,已有工作在跑回 409 isoinsight_sync_already_runningSync now (background task, returns task_id). Manual and scheduled runs share one lock; if a job is already running the answer is 409 isoinsight_sync_already_running今すぐ同期(バックグラウンド処理、task_id を返す)。手動とスケジュールは同じロックを共有し、実行中のジョブがあれば 409 isoinsight_sync_already_running
GET /api/v1/isoinsight/sources/{id}/runs同步記錄(測試、預覽、同步):結果(success/partial/failed/skipped)、階段、HTTP 狀態、錯誤代碼,以及互斥的處理結果計數(created、updated、unchanged、observed_only、expired、unknown_time、unmatched、conflicts);品質標籤另計在 quality,可重疊Sync records (tests, previews, syncs): result (success/partial/failed/skipped), step, HTTP status, error code, and mutually exclusive outcome counts (created, updated, unchanged, observed_only, expired, unknown_time, unmatched, conflicts); quality tags are counted separately in quality and may overlap同期記録(テスト・プレビュー・同期):結果(success/partial/failed/skipped)、段階、HTTP ステータス、エラーコード、互いに排他な処理結果の件数(created・updated・unchanged・observed_only・expired・unknown_time・unmatched・conflicts)。品質タグは quality に別途集計し、重複することがあります
GET /api/v1/isoinsight/leases來源租約(任何登入帳號,依可見子網路過濾;配對不到子網路的只有 admin 看得到)。參數 source_id、ip、mac、q(主機名稱或 IP 開頭)、subnet_id、state(active/expired/not_started/invalid_period/unknown)、match_status、observed_since/observed_until、page/page_size;回 items、total 與各來源的最近同步時間。state 是查詢當下依租約時間推定,不是設備上線Source leases (any signed-in account, filtered by visible subnets; leases that match no subnet are admin-only). Parameters source_id, ip, mac, q (host name, or IP prefix), subnet_id, state (active/expired/not_started/invalid_period/unknown), match_status, observed_since/observed_until, page/page_size; returns items, total and each source's last sync time. state is derived from the lease times at query time; it is not whether the device is onlineソースのリース(ログイン済みの任意のアカウント。閲覧できるサブネットで絞り込み、どのサブネットにも対応しないリースは admin のみ)。パラメータは source_id・ip・mac・q(ホスト名または IP の先頭)・subnet_id・state(active/expired/not_started/invalid_period/unknown)・match_status・observed_since/observed_until・page/page_size。items・total と各ソースの最終同期時刻を返します。state は取得時点でリース時刻から推定したもので、機器がオンラインかどうかではありません

合併規則:只有租約期間內、沒有 MAC 衝突、唯一配對到允許子網路的那一筆會碰 IP 記錄;MAC 與主機名稱照既有的來源優先序(人工維護的值不會被蓋),名稱空白不清除、MAC 不合法不寫,租約有效不更新上線時間。不依「這次沒出現」推定釋放,租約只依到期時間管理;空清單、失敗、停用或刪除來源都不刪正式 IP。登入失敗後排程自動暫停(避免反覆送出帳密觸發帳號鎖定),修改設定或測試成功後解除;429 依 Retry-After 延後。AI 對話與 MCP 用唯讀工具 list_isoinsight_leases 查同一份資料,權限與這個端點相同。 Merge rules: only a lease that is within its lease period, has no MAC conflict and matches exactly one allowed subnet touches the IP record; MAC and host name follow the existing source precedence (values maintained by people are never overwritten), an empty name clears nothing, an invalid MAC is not written, and a valid lease never updates the last-seen time. Absence from a response never releases a lease; leases are managed by their end time only. An empty list, a failure, or disabling or deleting the source never deletes IP records. After a login failure the schedule pauses on its own (so credentials are not sent again and again, which could lock the account) until the settings change or a test succeeds; HTTP 429 postpones it by Retry-After. AI chat and MCP read the same data with the read-only tool list_isoinsight_leases, with the same permissions as this endpoint.統合のルール:リース期間内で MAC の競合がなく、許可されたサブネットに一意に対応したものだけが IP レコードに反映されます。MAC とホスト名は既存のソース優先順位に従い(人が管理している値は上書きしません)、空の名前は消さず、不正な MAC は書かず、有効なリースでも最終確認時刻は更新しません。応答に現れなかったことを理由にリースを解放せず、リースは期限時刻だけで管理します。空のリスト、失敗、ソースの無効化や削除で IP レコードを削除することはありません。ログインに失敗するとスケジュールは自動で一時停止し(資格情報を繰り返し送ってアカウントがロックされないように)、設定の変更またはテスト成功で解除されます。HTTP 429 では Retry-After に従って延期します。AI チャットと MCP は読み取り専用ツール list_isoinsight_leases で同じデータを参照し、権限はこのエンドポイントと同じです。

curl -X POST https://ipam.example.com/api/v1/isoinsight/sources \
  -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -d '{"name":"iso-hq","base_url":"https://192.0.2.10","login_method":"POST","post_format":"form",
       "username":"ipam-ro","password":"...","scope_all":true,
       "source_timezone":"Asia/Taipei","timezone_confirmed":true}'

SNMP 收集(/snmp)SNMP collection (/snmp)SNMP 収集(/snmp)

伺服器不連設備:負責的掃描代理(1.19.0 以上,工具盤點要有 snmpbulkwalk,也就是裝了 net-snmp 用戶端工具)只對指派給它的收集目標做唯讀 SNMP 讀取(GET、GETNEXT、GETBULK),OID 是代理裡寫死的允許清單:路由器的 ARP 表(IP-MIB ipNetToPhysicalTable,沒有時用 ipNetToMediaTable)、交換器的 MAC 表(Q-BRIDGE-MIB,沒有時用 BRIDGE-MIB;Cisco 依 vtpVlanState 逐個 VLAN 讀,v2c 用 community@vlan、v3 用 context vlan-N)、LLDP 與 CDP 鄰居、介面(IF-MIB)與介面位址。收集目標就是既有的裝置(一台裝置一筆),管理位址用裝置的主要 IP,必要時填 ip_override。憑證集中管理:v2c 社群字串,或 v3 帳號、安全等級(authPriv/authNoPriv,不開放 noAuthNoPriv)、認證(MD5/SHA/SHA-224/SHA-256/SHA-384/SHA-512)與加密(DES/AES-128/AES-192/AES-256)。v2c 的社群字串在網路上是明文。全部端點限 admin。 The server never connects to the devices: the responsible scan agent (1.19.0 or later, with snmpbulkwalk in its tool inventory, that is, the net-snmp client tools installed) reads only the collection targets assigned to it, read-only (GET, GETNEXT, GETBULK), from an OID allowlist hard-coded in the agent: router ARP tables (IP-MIB ipNetToPhysicalTable, falling back to ipNetToMediaTable), switch MAC tables (Q-BRIDGE-MIB, falling back to BRIDGE-MIB; on Cisco one VLAN at a time from vtpVlanState, community@vlan for v2c and context vlan-N for v3), LLDP and CDP neighbors, interfaces (IF-MIB) and interface addresses. A collection target is an existing device (one per device); the management address is the device's primary IP unless ip_override is set. Credentials are managed centrally: a v2c community, or a v3 user with a security level (authPriv/authNoPriv; noAuthNoPriv is not offered), authentication (MD5/SHA/SHA-224/SHA-256/SHA-384/SHA-512) and privacy (DES/AES-128/AES-192/AES-256). A v2c community travels in plain text. Every endpoint is admin-only.サーバーは機器に接続しません。担当のスキャンエージェント(1.19.0 以降で、ツール一覧に snmpbulkwalk があるもの、つまり net-snmp のクライアントツールを導入済み)が、割り当てられた収集対象だけを読み取り専用(GET・GETNEXT・GETBULK)で、エージェントに固定で書かれた OID の許可リストから読みます:ルーターの ARP テーブル(IP-MIB ipNetToPhysicalTable、なければ ipNetToMediaTable)、スイッチの MAC テーブル(Q-BRIDGE-MIB、なければ BRIDGE-MIB。Cisco は vtpVlanState から VLAN ごとに読み、v2c は community@vlan、v3 はコンテキスト vlan-N)、LLDP と CDP のネイバー、インターフェイス(IF-MIB)とインターフェイスのアドレス。収集対象は既存の機器(機器ごとに 1 件)で、管理アドレスは機器のプライマリ IP、必要なら ip_override を指定します。認証情報は一元管理です:v2c のコミュニティ、または v3 のユーザー、セキュリティレベル(authPriv/authNoPriv。noAuthNoPriv は選べません)、認証(MD5/SHA/SHA-224/SHA-256/SHA-384/SHA-512)と暗号化(DES/AES-128/AES-192/AES-256)。v2c のコミュニティはネットワーク上を平文で流れます。すべてのエンドポイントは admin 限定です。

端點Endpointエンドポイント說明Notes説明
GET/POST /api/v1/snmp/credentials
GET/PATCH/DELETE /api/v1/snmp/credentials/{id}
憑證。欄位:name(唯一)、is_default(最多一組,設了新的預設就取消舊的)、customer_id(選用,只能指派給該單位的裝置)、version(v2c/v3)、username、security_level、auth_protocol、priv_protocol、timeout_s(1 到 30,預設 5)、retries(0 到 5,預設 1)、description;機密 community、auth_passphrase、priv_passphrase(最多 128 字元)只寫不讀,回應只有 has_community、has_auth_passphrase、has_priv_passphrase,另有 customer_name 與 target_count(使用中的收集目標數)。PATCH 的機密留空=不變;換版本或改成 authNoPriv 時用不到的機密會清掉。清單回 {"items":[…],"total":…}。錯誤:422 snmp_cred_community_required、snmp_cred_username_required、snmp_cred_level_required、snmp_cred_auth_required、snmp_cred_priv_required、snmp_cred_passphrase_short(v3 密碼至少 8 字元)、snmp_cred_bad_chars(換行或其他控制字元、帳號有空白)、snmp_customer_not_found;409 snmp_credential_name_taken、snmp_credential_scope_conflict(改成限定單位,但已指派給其他單位的裝置;params.devices 列出)、snmp_credential_in_use(刪除時還有收集目標在用;params.count 與 params.targets,每筆 target_id、device_id、device_name)Credentials. Fields: name (unique), is_default (at most one; setting a new default clears the old one), customer_id (optional; then assignable only to that unit's devices), version (v2c/v3), username, security_level, auth_protocol, priv_protocol, timeout_s (1 to 30, default 5), retries (0 to 5, default 1), description. The secrets community, auth_passphrase and priv_passphrase (up to 128 characters) are write-only: responses carry only has_community, has_auth_passphrase and has_priv_passphrase, plus customer_name and target_count (collection targets using it). An empty secret in PATCH keeps the current one; secrets the new version or authNoPriv no longer needs are cleared. The list returns {"items":[…],"total":…}. Errors: 422 snmp_cred_community_required, snmp_cred_username_required, snmp_cred_level_required, snmp_cred_auth_required, snmp_cred_priv_required, snmp_cred_passphrase_short (v3 passphrases need 8 characters), snmp_cred_bad_chars (line breaks or other control characters, or a space in the user name), snmp_customer_not_found; 409 snmp_credential_name_taken, snmp_credential_scope_conflict (limiting it to a unit while it is assigned to other units' devices; listed in params.devices), snmp_credential_in_use (deleting while collection targets use it; params.count and params.targets, each with target_id, device_id, device_name)認証情報。項目:name(一意)、is_default(最大 1 つ。新しい既定を設定すると以前の既定は外れます)、customer_id(任意。指定するとその組織の機器にだけ割り当て可能)、version(v2c/v3)、username、security_level、auth_protocol、priv_protocol、timeout_s(1 から 30、既定 5)、retries(0 から 5、既定 1)、description。機密の community・auth_passphrase・priv_passphrase(最大 128 文字)は書き込み専用で、応答には has_community・has_auth_passphrase・has_priv_passphrase と customer_name・target_count(使用中の収集対象数)だけが入ります。PATCH で機密が空ならそのままです。バージョン変更や authNoPriv で不要になった機密は消去します。一覧は {"items":[…],"total":…}。エラー:422 snmp_cred_community_required・snmp_cred_username_required・snmp_cred_level_required・snmp_cred_auth_required・snmp_cred_priv_required・snmp_cred_passphrase_short(v3 のパスフレーズは 8 文字以上)・snmp_cred_bad_chars(改行などの制御文字、ユーザー名の空白)・snmp_customer_not_found、409 snmp_credential_name_taken・snmp_credential_scope_conflict(他の組織の機器に割り当て済みなのに組織限定にしようとした。params.devices に一覧)・snmp_credential_in_use(削除時に使用中の収集対象がある。params.count と params.targets、各 target_id・device_id・device_name)
GET/POST /api/v1/snmp/targets
GET/PATCH/DELETE /api/v1/snmp/targets/{id}
收集目標。建立時給 device_id,或改給 ip_address_id(二擇一;子網路頁「對閘道啟用 SNMP 收集」用:那筆 IP 已連結裝置就用那台,裝置的主要 IP 不是它時自動填 ip_override;沒有連結就以它建一台裝置,類型 router、主要 IP=它、單位跟子網路),以及 credential_id(空=預設憑證)、ip_override、port(預設 161)、collect_arp/collect_fdb/collect_neighbors/collect_interfaces(預設都開)、intervals(秒,{"arp":300,"fdb":900,"neighbors":3600,"interfaces":3600} 是預設;低於下限 60/300/900/900 一律拉回下限)、collector(auto=管理位址所在子網路的負責代理、agent=agent_id、server=本機代理)、agent_id、enabled、auto_create_ips(預設關,見下方)、description。回應另有 device_name、customer_id、credential_name、credential_version、mgmt_ip、effective_intervals、effective_agent_id/effective_agent_name、collector_subnet_id/collector_subnet_cidr、collector_error({code, params, message} 或 null)、last_run_at、last_ok_at、last_error、last_error_code、last_summary(system 與逐區段的 status、rows、matched、new、removed、at、error)。清單參數 device_id、credential_id、agent_id(依實際判定的收集者)、q(裝置名稱)、page/page_size(最多 500),回 {"items","total","page","page_size"}。錯誤:404 snmp_device_not_found、snmp_ip_not_found、snmp_target_not_found;409 snmp_target_exists;422 snmp_no_default_credential、snmp_credential_not_found、snmp_credential_scope、snmp_agent_required、snmp_agent_not_found。刪除時 FDB、鄰居與收集記錄跟著刪,寫進裝置連接埠的介面沒接線的刪、接了線的留著Collection targets. Create with device_id, or instead ip_address_id (exactly one; used by the subnet page's "enable SNMP collection for the gateway": a linked device is used, with ip_override filled in when its primary IP is a different one; otherwise a device is created from it, type router, primary IP = that address, unit taken from the subnet), plus credential_id (empty means the default credential), ip_override, port (default 161), collect_arp/collect_fdb/collect_neighbors/collect_interfaces (all on by default), intervals (seconds; {"arp":300,"fdb":900,"neighbors":3600,"interfaces":3600} is the default, and values below the minimums 60/300/900/900 are raised to them), collector (auto = the agent assigned to the subnet of the management address, agent = agent_id, server = the local agent), agent_id, enabled, auto_create_ips (off by default, see below), description. Responses add device_name, customer_id, credential_name, credential_version, mgmt_ip, effective_intervals, effective_agent_id/effective_agent_name, collector_subnet_id/collector_subnet_cidr, collector_error ({code, params, message} or null), last_run_at, last_ok_at, last_error, last_error_code and last_summary (system plus per section status, rows, matched, new, removed, at, error). List parameters device_id, credential_id, agent_id (by the resolved collector), q (device name), page/page_size (max 500); returns {"items","total","page","page_size"}. Errors: 404 snmp_device_not_found, snmp_ip_not_found, snmp_target_not_found; 409 snmp_target_exists; 422 snmp_no_default_credential, snmp_credential_not_found, snmp_credential_scope, snmp_agent_required, snmp_agent_not_found. Deleting a target removes its FDB rows, neighbors and run records; interfaces it wrote to device ports are removed unless cabled収集対象。作成時は device_id、または代わりに ip_address_id(どちらか一方。サブネット画面の「ゲートウェイで SNMP 収集を有効にする」で使用:その IP に機器が連結されていればその機器を使い、機器のプライマリ IP が別なら ip_override を自動で設定します。連結がなければその IP から機器を作成します(種類 router、プライマリ IP=その IP、組織はサブネットから))と、credential_id(空なら既定の認証情報)、ip_override、port(既定 161)、collect_arp/collect_fdb/collect_neighbors/collect_interfaces(既定ですべて有効)、intervals(秒。{"arp":300,"fdb":900,"neighbors":3600,"interfaces":3600} が既定で、下限 60/300/900/900 を下回る値は下限に引き上げ)、collector(auto=管理アドレスのサブネットの担当エージェント、agent=agent_id、server=ローカルのエージェント)、agent_id、enabled、auto_create_ips(既定は無効。下記参照)、description。応答には device_name・customer_id・credential_name・credential_version・mgmt_ip・effective_intervals・effective_agent_id/effective_agent_name・collector_subnet_id/collector_subnet_cidr・collector_error({code, params, message} または null)・last_run_at・last_ok_at・last_error・last_error_code・last_summary(system と区分ごとの status・rows・matched・new・removed・at・error)も入ります。一覧のパラメータは device_id・credential_id・agent_id(実際に判定された収集者)・q(機器名)・page/page_size(最大 500)で、{"items","total","page","page_size"} を返します。エラー:404 snmp_device_not_found・snmp_ip_not_found・snmp_target_not_found、409 snmp_target_exists、422 snmp_no_default_credential・snmp_credential_not_found・snmp_credential_scope・snmp_agent_required・snmp_agent_not_found。削除すると FDB・ネイバー・収集記録も消え、機器ポートに書いたインターフェイスはケーブル接続がなければ削除します
POST /api/v1/snmp/targets/bulk裝置清單的批次指派:device_ids(1 到 1,000)、credential_id(空=預設),選用 collect_*、collector、agent_id、enabled。沒有收集目標的裝置新建(沒給的收集項目依裝置類型:路由器與防火牆 ARP+介面、交換器 MAC 表+鄰居+介面、其他只讀介面)、已有的改憑證與有給的欄位。回 {"created","updated","skipped":[{device_id, device_name, code}]}(snmp_device_not_found、snmp_credential_scope)Bulk assignment from the device list: device_ids (1 to 1,000), credential_id (empty means the default), optional collect_*, collector, agent_id, enabled. Devices without a target get one (collect items not given follow the device type: routers and firewalls ARP and interfaces, switches MAC table, neighbours and interfaces, others interfaces only); existing targets get the credential and the given fields. Returns {"created","updated","skipped":[{device_id, device_name, code}]} (snmp_device_not_found, snmp_credential_scope)機器一覧からの一括割り当て:device_ids(1 から 1,000)、credential_id(空なら既定)、任意で collect_*・collector・agent_id・enabled。収集対象のない機器は新規作成し(指定のない収集項目は機器の種類に従う:ルーターとファイアウォールは ARP とインターフェイス、スイッチは MAC テーブル・隣接機器・インターフェイス、その他はインターフェイスのみ)、既存のものは認証情報と指定した項目を更新します。{"created","updated","skipped":[{device_id, device_name, code}]} を返します(snmp_device_not_found・snmp_credential_scope)
POST /api/v1/snmp/targets/{id}/test
POST /api/v1/snmp/targets/{id}/collect
經由負責代理的工作通道執行,回 202 {"job_id","run_id","agent_id","agent_name","ip","expires_at"}。測試可帶 {"credential_ids":[…]}(最多 5 組,都只對這一台設備試),讀 sysName、sysDescr、sysObjectID、sysUpTime,再逐區段看有沒有回應、有幾列;立即收集跑所有收集項目並照一般回報寫入。資料庫的工作記錄只存 id,解密後的憑證在負責代理領取時才放進回應。錯誤:409 收集者判定不出來(snmp_no_mgmt_ip、snmp_no_subnet、snmp_no_collector、snmp_collector_ambiguous、snmp_no_local_agent、snmp_agent_disabled、snmp_agent_no_snmp、snmp_agent_not_found)、snmp_job_busy、snmp_target_disabled(立即收集);422 snmp_credential_not_foundRun through the responsible agent's job channel; returns 202 {"job_id","run_id","agent_id","agent_name","ip","expires_at"}. A test may pass {"credential_ids":[…]} (up to 5, all tried against this one device only); it reads sysName, sysDescr, sysObjectID and sysUpTime, then checks per section whether the device answers and how many rows it has. Collect now runs every collection item and is written like a regular report. The job record in the database holds only ids; the decrypted credentials are put into the response only when the responsible agent claims the job. Errors: 409 when no collector can be resolved (snmp_no_mgmt_ip, snmp_no_subnet, snmp_no_collector, snmp_collector_ambiguous, snmp_no_local_agent, snmp_agent_disabled, snmp_agent_no_snmp, snmp_agent_not_found), snmp_job_busy, snmp_target_disabled (collect now); 422 snmp_credential_not_found担当エージェントのジョブ経路で実行し、202 {"job_id","run_id","agent_id","agent_name","ip","expires_at"} を返します。テストでは {"credential_ids":[…]}(最大 5 つ。すべてこの 1 台にだけ試す)を指定でき、sysName・sysDescr・sysObjectID・sysUpTime を読んだ後、区分ごとに応答の有無と行数を確認します。今すぐ収集はすべての収集項目を実行し、通常の報告と同じように書き込みます。データベースのジョブ記録には id だけを保存し、復号した認証情報は担当エージェントがジョブを受け取るときに応答に入れます。エラー:収集者を判定できないときは 409(snmp_no_mgmt_ip・snmp_no_subnet・snmp_no_collector・snmp_collector_ambiguous・snmp_no_local_agent・snmp_agent_disabled・snmp_agent_no_snmp・snmp_agent_not_found)、snmp_job_busy、snmp_target_disabled(今すぐ収集)、422 snmp_credential_not_found
GET /api/v1/snmp/jobs/{job_id}測試/立即收集的進度與結果:status(pending/running/done/failed/expired)、error、run(對應的收集記錄)、created_at/claimed_at/finished_at;測試另有 result.items[]:credential_id、credential_name、ok、elapsed_ms、error、system(sys_name、sys_descr、sys_object_id、sys_uptime)、sections(逐區段 status、rows、error、elapsed_ms、table、truncated)。不含任何機密Progress and result of a test or collect now: status (pending/running/done/failed/expired), error, run (the matching run record), created_at/claimed_at/finished_at; a test also has result.items[]: credential_id, credential_name, ok, elapsed_ms, error, system (sys_name, sys_descr, sys_object_id, sys_uptime) and sections (per section status, rows, error, elapsed_ms, table, truncated). Contains no secretsテストまたは今すぐ収集の進捗と結果:status(pending/running/done/failed/expired)、error、run(対応する収集記録)、created_at/claimed_at/finished_at。テストには result.items[](credential_id・credential_name・ok・elapsed_ms・error・system(sys_name・sys_descr・sys_object_id・sys_uptime)・sections(区分ごとの status・rows・error・elapsed_ms・table・truncated))もあります。機密は含みません
GET /api/v1/snmp/targets/{id}/runs
GET /api/v1/snmp/runs
收集記錄(新到舊):kind(test/collect)、trigger(scheduled/manual)、result(running/success/partial/failed)、agent_id/agent_name、job_id、started_at/finished_at、duration_ms、sections(逐區段計數)、info(系統資訊、測試的逐組結果)、error_code、error。單一目標的參數 limit(最多 300)、kind;全部目標的參數 limit(最多 500)、result、kind,每筆另有 device_id、device_name。每個目標只留 14 天、最多 300 筆;按下去十分鐘還沒結果的記成 snmp_job_expiredRun records, newest first: kind (test/collect), trigger (scheduled/manual), result (running/success/partial/failed), agent_id/agent_name, job_id, started_at/finished_at, duration_ms, sections (per-section counts), info (system information, per-credential test results), error_code, error. Per target: limit (max 300) and kind; across targets: limit (max 500), result and kind, each row adding device_id and device_name. Records are kept 14 days, at most 300 per target; a manual run with no result after ten minutes becomes snmp_job_expired収集記録(新しい順):kind(test/collect)、trigger(scheduled/manual)、result(running/success/partial/failed)、agent_id/agent_name、job_id、started_at/finished_at、duration_ms、sections(区分ごとの件数)、info(システム情報、テストの認証情報ごとの結果)、error_code、error。対象ごとのパラメータは limit(最大 300)と kind、全対象は limit(最大 500)・result・kind で、各行に device_id・device_name が付きます。対象ごとに 14 日・最大 300 件だけ保持し、手動で実行して 10 分たっても結果がないものは snmp_job_expired になります
GET /api/v1/snmp/collectors表單的「自動=哪台代理」提示:參數 device_id(用主要 IP)或 ip(覆寫)、collector、agent_id。回 {"ip","collector","agent_id","agent_name","capable","subnet_id","subnet_cidr","error"},error 是 {code, params, message} 或 null;位址不合法回 422 snmp_bad_ipThe form's "automatic = which agent" hint: parameters device_id (uses its primary IP) or ip (an override), collector, agent_id. Returns {"ip","collector","agent_id","agent_name","capable","subnet_id","subnet_cidr","error"}, where error is {code, params, message} or null; an invalid address returns 422 snmp_bad_ipフォームの「自動=どのエージェント」の表示用:パラメータ device_id(プライマリ IP を使う)または ip(上書き)、collector、agent_id。{"ip","collector","agent_id","agent_name","capable","subnet_id","subnet_cidr","error"} を返し、error は {code, params, message} または null。不正なアドレスは 422 snmp_bad_ip
GET /api/v1/snmp/agents每台掃描代理的 SNMP 能力與指派數:agent_id、name、is_local、enabled、agent_version、capable、tool_installed、tool_version、version_ok、target_count、last_seen_at,以及 min_agent_versionSNMP capability and assignment count per scan agent: agent_id, name, is_local, enabled, agent_version, capable, tool_installed, tool_version, version_ok, target_count, last_seen_at, plus min_agent_versionスキャンエージェントごとの SNMP 対応状況と割り当て数:agent_id・name・is_local・enabled・agent_version・capable・tool_installed・tool_version・version_ok・target_count・last_seen_at、および min_agent_version
GET /api/v1/snmp/neighborsLLDP/CDP 鄰居:參數 target_id、device_id、page/page_size(最多 1,000)。每筆 protocol(lldp/cdp)、local_port、remote_sysname、remote_port、remote_chassis_id、remote_mac、remote_mgmt_address、remote_platform、first_seen_at/last_seen_at,以及依宣告的管理位址、chassis MAC 或系統名稱對到的 remote_device_id/remote_device_name(對到多台就不填)LLDP / CDP neighbors: parameters target_id, device_id, page/page_size (max 1,000). Each row has protocol (lldp/cdp), local_port, remote_sysname, remote_port, remote_chassis_id, remote_mac, remote_mgmt_address, remote_platform, first_seen_at/last_seen_at, and remote_device_id/remote_device_name matched by the advertised management address, chassis MAC or system name (left empty when several devices match)LLDP / CDP のネイバー:パラメータ target_id・device_id・page/page_size(最大 1,000)。各行に protocol(lldp/cdp)・local_port・remote_sysname・remote_port・remote_chassis_id・remote_mac・remote_mgmt_address・remote_platform・first_seen_at/last_seen_at と、通知された管理アドレス・シャーシ MAC・システム名で対応付けた remote_device_id/remote_device_name(複数台に一致する場合は空)

寫入規則:ARP 只補既有 IP 記錄的 MAC(MAC 來源優先序的 snmp,與防火牆的 ARP 表同一級),同一個位址在好幾個子網路都有(重疊網段)就不寫。上線證據分兩個來源:arp:snmp(ipNetToMediaTable 與不是 reachable 的項目,沒有時間,只補 MAC、不會過期、預設不採信)、arp:snmp_live(ipNetToPhysicalState 為 reachable 的動態項目,會過期、預設採信,升級前存過的上線來源設定也會自動加入);介面位址所在介面 ifOperStatus 為 up 時記 iface:snmp(會過期)。MAC 表寫進 fdb_entries(source=snmp、switch_device_id 是目標裝置),跟 LibreNMS、MikroTik 的列一起推交換器位置與拓樸;鄰居畫成拓樸的交換器連線;介面寫進裝置連接埠(VLAN、loopback 等邏輯介面不寫)。舊資料只在該區段完整讀到時才清,部分失敗只新增與更新。auto_create_ips 開了才依 ARP 建立 IPAM 沒有的位址(discovery_source=snmp_arp,與 LibreNMS 依 ARP 建立同一套把關:唯一且最精確的既有子網路、略過代理 ARP、冷卻期與 DHCP 動態範圍、一輪最多 500 筆;沒有時間的項目要交換器 MAC 表 24 小時內也看過,reachable 的項目不必)。 Write rules: ARP only fills the MAC of existing IP records (MAC source precedence snmp, at the same level as firewall ARP tables), and nothing is written when the same address exists in several subnets (overlapping networks). Liveness evidence comes in two sources: arp:snmp (ipNetToMediaTable and entries that are not reachable; no time, so it only fills the MAC, never expires and is not trusted by default) and arp:snmp_live (dynamic entries whose ipNetToPhysicalState is reachable; expires and is trusted by default, also on sites that saved their liveness sources before the upgrade). An interface address whose interface has ifOperStatus up is recorded as iface:snmp (expires). The MAC table goes to fdb_entries (source=snmp, switch_device_id = the target device) and works with the LibreNMS and MikroTik rows for switch positions and the topology; neighbors become switch links in the topology; interfaces become device ports (logical interfaces such as VLANs and loopbacks are skipped). Old data is cleared only after a complete read of that section; a partial failure only adds and updates. With auto_create_ips on, ARP entries the IPAM does not have are created (discovery_source=snmp_arp) with the same guards as the LibreNMS ARP auto-create: a unique, most specific existing subnet, no proxy ARP, no cooldown or DHCP dynamic ranges, at most 500 per round; entries without a time need the switch MAC table to have seen the MAC within 24 hours, reachable entries do not.書き込みのルール:ARP は既存の IP レコードの MAC だけを補います(MAC ソースの優先順位は snmp で、ファイアウォールの ARP テーブルと同じ段階)。同じアドレスが複数のサブネットにある場合(重複ネットワーク)は書きません。稼働の根拠は 2 つのソースに分かれます:arp:snmp(ipNetToMediaTable と reachable でないエントリ。時刻がないため MAC を補うだけで、期限切れにならず、既定では採用しません)と arp:snmp_live(ipNetToPhysicalState が reachable の動的エントリ。期限があり、既定で採用し、アップグレード前に稼働ソースを保存したサイトでも自動で加わります)。インターフェイスの ifOperStatus が up のインターフェイスアドレスは iface:snmp(期限あり)として記録します。MAC テーブルは fdb_entries(source=snmp、switch_device_id は対象機器)に入り、LibreNMS や MikroTik の行と一緒にスイッチの位置とトポロジーに使われます。ネイバーはトポロジーのスイッチ間リンクになり、インターフェイスは機器ポートになります(VLAN やループバックなどの論理インターフェイスは除外)。古いデータはその区分を最後まで読めたときだけ消し、一部失敗した場合は追加と更新のみです。auto_create_ips を有効にすると、IPAM にない ARP のアドレスを作成します(discovery_source=snmp_arp)。LibreNMS の ARP による自動作成と同じ確認を行います:一意で最も詳細な既存サブネット、プロキシ ARP・クールダウン・DHCP 動的範囲は除外、1 回最大 500 件。時刻のないエントリは 24 時間以内にスイッチの MAC テーブルにも現れている必要があり、reachable のエントリは不要です。

curl -X POST https://ipam.example.com/api/v1/snmp/credentials \
  -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -d '{"name":"core-v3","is_default":true,"version":"v3","username":"ipam-ro",
       "security_level":"authPriv","auth_protocol":"SHA-256","auth_passphrase":"...",
       "priv_protocol":"AES-128","priv_passphrase":"..."}'

curl -X POST https://ipam.example.com/api/v1/snmp/targets \
  -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -d '{"device_id":"<device uuid>","collector":"auto","collect_fdb":true}'

未安裝代理的 IP(/wazuh/missing-agents、/ocs/missing-agents)IPs without an agent (/wazuh/missing-agents, /ocs/missing-agents)エージェント未導入の IP(/wazuh/missing-agents・/ocs/missing-agents)

不帶 page 時回整份清單(陣列,與舊版相同)。大站台可能有數萬筆,請改帶 page:由伺服器篩選、排序、分頁,回 {"items":[…],"total":…,"total_all":…,"facets":{…}}。total 是符合篩選的筆數、total_all 是全部缺口,facets 列出可用的區段、子網路(選了區段就只列該區段的)、單位與上線狀態。每筆多一個 status(online/stale/offline/unknown),判斷規則與 IP 清單的燈號相同;另帶 device_kind、device_model(掃描代理判讀出的設備類型與型號)。 Without page the full list comes back (an array, as before). Large sites can have tens of thousands of rows, so pass page: the server filters, sorts and pages, returning {"items":[…],"total":…,"total_all":…,"facets":{…}}. total counts rows matching the filters and total_all counts every gap; facets lists the available sections, subnets (only those in the chosen section, if any), units and liveness states. Each row gains a status (online/stale/offline/unknown) decided by the same rule as the lights in the IP list, plus device_kind and device_model (the device type and model the scan agent identified).page を付けないと一覧全体(配列、従来どおり)を返します。大規模なサイトでは数万行になるため、page を付けてください。サーバー側で絞り込み・並べ替え・ページングを行い、{"items":[…],"total":…,"total_all":…,"facets":{…}} を返します。total は条件に合う件数、total_all は未導入の全件数です。facets には選べるセクション、サブネット(セクションを選んだ場合はその配下のみ)、単位、稼働状態が入ります。各行には status(online/stale/offline/unknown)が付き、判定規則は IP 一覧のランプと同じです。各行には device_kind・device_model(スキャンエージェントが判定した機器タイプと型番)も含まれます。

參數Parameterパラメータ說明Meaning説明
page / page_size從 1 起;page_size 預設 100、上限 1000001-based; page_size defaults to 100, max 1000001 起算。page_size は既定 100、上限 100000
section_id / subnet_id / customer_id依所屬區段、子網路、單位篩選(單位會從子網路、區段繼承)Filter by section, subnet or unit (the unit is inherited from the subnet or section)セクション・サブネット・単位で絞り込み(単位はサブネットやセクションから継承)
statusonline / stale / offline / unknown
q主機名稱或位址包含這段文字(不分大小寫)Hostname or address contains this text (case-insensitive)ホスト名またはアドレスにこの文字列を含む(大文字小文字を区別しない)
sort / orderip(預設)、hostname、subnet、section、customer、status、device_kind;asc(預設)或 desc。沒有值的一律排最後ip (default), hostname, subnet, section, customer, status, device_kind; asc (default) or desc. Rows without a value always sort lastip(既定)・hostname・subnet・section・customer・status・device_kind、asc(既定)または desc。値の無い行は常に最後

算好的缺口在伺服器上保留最多 60 秒(IP 或代理資料一有變動就重算),翻頁與換篩選不必每次重算。The computed gaps are kept on the server for up to 60 seconds (recomputed as soon as IP or agent data changes), so paging and changing filters do not recompute each time.算出した未導入の一覧はサーバー側で最長 60 秒保持され(IP やエージェントのデータが変わるとすぐ再計算)、ページ送りや条件変更のたびに再計算はしません。

curl -G https://ipam.example.com/api/v1/wazuh/missing-agents \
  -H "Authorization: Bearer $TOKEN" \
  --data-urlencode "page=1" --data-urlencode "page_size=100" \
  --data-urlencode "status=online" --data-urlencode "sort=hostname"

13AI、事件規則與跳板AI, event rules & jump hostsAI・イベントルール・踏み台

AI 對話AI chatAI チャット

POST /api/v1/ai/chat(或 SSE 串流的 /ai/chat/stream)讓任何登入帳號用自然語言查 IPAM,前提是管理員已啟用 LLM;每個來源 IP 每分鐘最多 20 次。模型要呼叫會改資料的工具時,對話會先停下來等使用者確認,確認後由 POST /api/v1/ai/chat/confirm {"tool","args"} 執行。工具清單見 GET /api/v1/ai/tools(第 19 節)。 POST /api/v1/ai/chat (or /ai/chat/stream over SSE) lets any signed-in account query the IPAM in natural language, once an admin has enabled the LLM; each source IP may call it at most 20 times per minute. When the model wants a tool that changes data, the chat stops and waits for the user to confirm, and POST /api/v1/ai/chat/confirm {"tool","args"} then runs it. The tool list is at GET /api/v1/ai/tools (section 19).POST /api/v1/ai/chat(または SSE の /ai/chat/stream)で、ログイン済みの任意のアカウントが自然言語で IPAM に問い合わせられます。管理者が LLM を有効にしていることが前提で、送信元 IP ごとに毎分最大 20 回です。モデルがデータを変更するツールを使おうとすると会話は止まってユーザーの確認を待ち、確認後に POST /api/v1/ai/chat/confirm {"tool","args"} で実行されます。ツール一覧は GET /api/v1/ai/tools(第 19 節)です。

三個 SSE 串流(/ai/chat/stream、/investigate/narrative/stream、/tools/net/traceroute/stream)在等待模型或沒回應的躍點時,每 10 秒送一行 : keepalive,這是 SSE 規格的註解行,讓反向代理不會因為等太久而切斷連線。自己解析串流時只讀 data: 開頭的行,冒號開頭的行請略過。 The three SSE streams (/ai/chat/stream, /investigate/narrative/stream, /tools/net/traceroute/stream) send a : keepalive line every 10 seconds while waiting for the model or a silent hop. It is an SSE comment line that keeps reverse proxies from timing out the connection. If you parse the stream yourself, read only lines starting with data: and skip lines starting with a colon.3 つの SSE ストリーム(/ai/chat/stream、/investigate/narrative/stream、/tools/net/traceroute/stream)は、モデルや応答のないホップを待つ間、10 秒ごとに : keepalive の行を送ります。これは SSE 仕様のコメント行で、待ち時間が長くてもリバースプロキシに接続を切られないようにするためのものです。ストリームを自前で解析する場合は data: で始まる行だけを読み、コロンで始まる行は読み飛ばしてください。

兩個管理員用的模型檢查(都只讀、不改資料):GET /api/v1/ai/embedding-check 實際取一次向量,回報維度是否與資料庫欄位相符;GET /api/v1/ai/thinking-check 用 AI 巡檢與判讀同一套「關閉思考」參數,對對話模型以及另外指定的巡檢、判讀模型各問一句極短的話,回 {"results":[{"role","model","ok","thinking","reasoning_chars","think_tag","empty_answer","seconds","rejected_params","error"}]}。thinking 為 true 表示伺服器或閘道沒有照做(回答是空的也算,有些閘道不把思考內容轉出來)。維度不合時 embedding-check 回 dim(模型實際回幾維)與 expected,error 為 null。GET /api/v1/ai/index-status(管理員,只讀資料庫、不呼叫模型)回語意搜尋的索引需不需要重建:{"model","last","counts","described","missing","needs_reindex","reason"},reason 是 never(還沒用目前模型重建過)、model_changed(上次重建的模型跟現在不同)、missing(有說明卻沒有向量)或 null;last 是上次 POST /api/v1/ai/reindex 的模型、維度、時間與筆數。reindex 的回應多了 error_code、error_params(第一個失敗的錯誤代碼,例如 ai_embedding_dim_mismatch 帶 got、expected)。 Two admin-only model checks (read-only): GET /api/v1/ai/embedding-check fetches one vector and reports whether its dimension matches the database column; GET /api/v1/ai/thinking-check sends one very short question to the chat model and to any separately set audit or interpretation model, with the same thinking-off controls AI audit and interpretation use, and returns {"results":[{"role","model","ok","thinking","reasoning_chars","think_tag","empty_answer","seconds","rejected_params","error"}]}. thinking true means the server or gateway ignored the controls (an empty answer counts too: some gateways do not pass the reasoning through). On a dimension mismatch embedding-check returns dim (what the model actually returned) and expected, with error null. GET /api/v1/ai/index-status (admin; reads the database only, no model call) says whether the semantic search index needs a rebuild: {"model","last","counts","described","missing","needs_reindex","reason"}, where reason is never (not rebuilt with the current model), model_changed (the last rebuild used another model), missing (items with a description but no vector) or null; last is the model, dimension, time and counts of the last POST /api/v1/ai/reindex. The reindex response also carries error_code and error_params (the first failure's code, for example ai_embedding_dim_mismatch with got and expected).管理者向けのモデルチェックが二つあります(どちらも読み取りのみ)。GET /api/v1/ai/embedding-check はベクトルを一度取得し、次元がデータベースの列と一致するかを返します。GET /api/v1/ai/thinking-check は AI 監査・判定と同じ「思考を無効にする」パラメータで、チャットモデルと個別に指定した監査・判定モデルにごく短い質問を送り、{"results":[{"role","model","ok","thinking","reasoning_chars","think_tag","empty_answer","seconds","rejected_params","error"}]} を返します。thinking が true ならサーバーやゲートウェイが従っていません(回答が空の場合も含みます。思考内容を転送しないゲートウェイがあるため)。次元が合わない場合 embedding-check は dim(モデルが実際に返した次元)と expected を返し、error は null です。GET /api/v1/ai/index-status(管理者、データベースだけを読みモデルは呼ばない)はセマンティック検索のインデックスを再構築すべきかを返します:{"model","last","counts","described","missing","needs_reindex","reason"}。reason は never(現在のモデルで未再構築)、model_changed(前回の再構築とモデルが異なる)、missing(説明があるのにベクトルがない)または null。last は前回の POST /api/v1/ai/reindex のモデル・次元・時刻・件数です。reindex の応答には error_code と error_params(最初の失敗のエラーコード。例:ai_embedding_dim_mismatch と got・expected)も含まれます。

GET /api/v1/ai/semantic-search?q=&limit=:以描述的向量找相近的子網路、IP 與裝置(需要已啟用 LLM 與嵌入模型)。結果依呼叫者的可見範圍過濾(先過濾再取前幾筆),歸檔的子網路與其中的 IP 不列。GET /api/v1/ai/semantic-search?q=&limit=: finds subnets, IPs and devices with similar descriptions by vector (needs the LLM and an embedding model). Results are filtered by what the caller can see (filtered before the limit), and archived subnets and their IPs are left out.GET /api/v1/ai/semantic-search?q=&limit=:説明文のベクトルで似たサブネット、IP、機器を探します(LLM と埋め込みモデルが必要)。結果は呼び出し元が見える範囲だけに絞られ(絞り込んでから件数を制限)、アーカイブ済みのサブネットとその IP は含みません。

AI 巡檢(/ai-audit)AI audit (/ai-audit)AI 監査(/ai-audit)

全部限 admin,讀取也是。POST /api/v1/ai-audit/run 在背景跑一輪巡檢(已有一輪在跑時回 409),GET /ai-audit/status 看進度,GET /ai-audit/summary 與 GET /ai-audit/findings(status、severity、category,page_size 上限 200)看結論。POST /ai-audit/dismiss//restore {"ids":[…]} 忽略或還原(被忽略的同一問題之後會自動忽略),DELETE /ai-audit/findings 刪掉全部結論。 Admin-only, reads included. POST /api/v1/ai-audit/run starts a run in the background (409 if one is already running), GET /ai-audit/status shows progress, and GET /ai-audit/summary and GET /ai-audit/findings (status, severity, category; page_size up to 200) return the results. POST /ai-audit/dismiss / /restore {"ids":[…]} dismiss or restore findings (a dismissed issue stays dismissed in later runs), and DELETE /ai-audit/findings deletes every finding.読み取りを含めすべて admin 限定です。POST /api/v1/ai-audit/run でバックグラウンドで監査を実行し(実行中なら 409)、GET /ai-audit/status で進捗、GET /ai-audit/summary と GET /ai-audit/findings(status・severity・category、page_size の上限 200)で結果を見ます。POST /ai-audit/dismiss//restore {"ids":[…]} で無視・復帰(無視した同じ問題は以後も自動で無視)、DELETE /ai-audit/findings で全件を削除します。

單一 IP 調查(/investigate)Investigate one IP (/investigate)IP の調査(/investigate)

GET /api/v1/investigate?ip=… 把一個位址在各來源的事實彙整成一份檔案(dossier),任何登入帳號都能用,但只看得到可見子網路裡的資料;看不到或不存在時回 found: false,而不是 403。加 narrative=true 會另外請 LLM 寫一段解讀(lang 預設 zh-TW)。POST /api/v1/investigate/narrative/stream?ip=… 以 SSE 串流同一段解讀,事件的 type 依序是 thinking/content、最後 done(或 error),逾時 120 秒。要求解讀時會寫稽核。 GET /api/v1/investigate?ip=… gathers the facts every source has about one address into a dossier. Any signed-in account can use it, but only for data in subnets it can see; an address you cannot see, or that does not exist, returns found: false rather than 403. Add narrative=true to also ask the LLM for an interpretation (lang defaults to zh-TW). POST /api/v1/investigate/narrative/stream?ip=… streams the same interpretation over SSE: event type is thinking / content, then done (or error), with a 120-second timeout. Requests for an interpretation are audited.GET /api/v1/investigate?ip=… は、1 つのアドレスについて各ソースが持つ事実を 1 つの dossier にまとめます。ログイン済みの任意のアカウントで使えますが、見えるのは閲覧可能なサブネットのデータだけで、見えない・存在しないアドレスには 403 ではなく found: false を返します。narrative=true を付けると LLM による解説も付きます(lang の既定は zh-TW)。POST /api/v1/investigate/narrative/stream?ip=… は同じ解説を SSE で送り、イベントの type は thinking/content、最後に done(または error)で、タイムアウトは 120 秒です。解説を求めた場合は監査に記録されます。

dossier 依權限分三層,沒有資料的段落不會出現在回應裡(原本就有的 hostname_sources、arp、changes、dns、nat、firewall_rules 沒資料時是空清單)。看得到子網路就有:address、other_records(重疊網段的同位址紀錄)、hostname_sources、os_candidates、identity(device_kind/device_model/os_family/os_guess、類型依據 kind_reason(如 wazuh:windows、librenms:…、virt:pve-node、hostname:…)、網卡廠牌 nic_vendor、隨機 MAC mac_random)、monitoring(wazuh、librenms(裝置關聯或 primary IP)、zabbix)、agents(ocs 盤點與硬體、rustdesk 裝置含 key_problem)、virtualization(對到的 VM/容器,MAC 要對得上)、dhcp(in_lease/reserved/in_pool/excluded、reservations、leases、exclusions)、switch_ports(交換器 MAC 表,依交換器的裝置可見性)、fw_evidence(防火牆的 ARP/VPN/租約證據)、last_seen(各來源最後出現與上線判定)、arp、changes。全域讀取才有:dns、nat、firewall_rules(OPNsense)、firewall_refs(OPNsense、pfSense、FortiGate、Palo Alto、MikroTik 涵蓋這個位址的別名/位址物件與規則)、dhcp_rogue(觀測到的 DHCP 回應)、dhcp.pools(發放範圍的設定)。只有 admin:probe(最近一次 IP 探測)、anomalies(最近一次異常偵測中講到這個位址的)、ai_findings(未處理的 AI 巡檢發現)、console_sessions(最近 10 次主控台連線:誰、何時、從哪裡)。conflicts 是後端以固定規則算出的矛盾清單 [{code, params}](names、stale_agent、duplicate、macs、macs_random、reservation_mac),畫面、匯出與 AI 解讀用的是同一份;主機名稱只差大小寫、結尾的點,或短名稱等於某個 FQDN 的第一段時算同一個名字。每段最多 20 筆。 The dossier has three tiers, and a section with no data is left out of the response (the original hostname_sources, arp, changes, dns, nat and firewall_rules are empty lists instead). Anyone who can see the subnet gets address, other_records (the same address in overlapping subnets), hostname_sources, os_candidates, identity (device_kind / device_model / os_family / os_guess, how the type was decided in kind_reason such as wazuh:windows, librenms:…, virt:pve-node or hostname:…, the NIC vendor nic_vendor and mac_random), monitoring (wazuh, librenms by device link or primary IP, zabbix), agents (ocs inventory and hardware, rustdesk devices with key_problem), virtualization (the matching VM or container; the MAC has to agree), dhcp (in_lease / reserved / in_pool / excluded, reservations, leases, exclusions), switch_ports (switch MAC tables, filtered by the switch's device visibility), fw_evidence (firewall ARP / VPN / lease evidence), last_seen (last seen by source with the liveness verdict), arp and changes. Global readers also get dns, nat, firewall_rules (OPNsense), firewall_refs (aliases, address objects and rules covering the address on OPNsense, pfSense, FortiGate, Palo Alto and MikroTik), dhcp_rogue (observed DHCP offers) and dhcp.pools (the pool configuration). Admins only: probe (the latest identify probe), anomalies (the latest anomaly run's findings about this address), ai_findings (open AI audit findings) and console_sessions (the last 10 console sessions: who, when, from where). conflicts is the list of contradictions the server computes with fixed rules, [{code, params}] (names, stale_agent, duplicate, macs, macs_random, reservation_mac); the screen, the exports and the AI interpretation all use it. Hostnames that differ only in letter case, a trailing dot, or a short name matching the first label of an FQDN count as one name. Each section has at most 20 rows.dossier は権限によって 3 段階に分かれ、データのないセクションは応答に含まれません(従来からある hostname_sources、arp、changes、dns、nat、firewall_rules は空の配列になります)。サブネットを閲覧できれば:address、other_records(重複するサブネットにある同じアドレス)、hostname_sources、os_candidates、identity(device_kind/device_model/os_family/os_guess、種別の根拠 kind_reason(wazuh:windows、librenms:…、virt:pve-node、hostname:… など)、NIC ベンダー nic_vendor、ランダム MAC の mac_random)、monitoring(wazuh、デバイスの関連付けまたはプライマリ IP による librenms、zabbix)、agents(ocs のインベントリとハードウェア、key_problem を含む rustdesk デバイス)、virtualization(対応する VM/コンテナ。MAC が一致する必要があります)、dhcp(in_lease/reserved/in_pool/excluded、reservations、leases、exclusions)、switch_ports(スイッチの MAC テーブル。スイッチのデバイス閲覧権限で絞り込み)、fw_evidence(ファイアウォールの ARP/VPN/リースの証拠)、last_seen(ソース別の最終確認と稼働判定)、arp、changes。グローバル閲覧権限があればさらに:dns、nat、firewall_rules(OPNsense)、firewall_refs(OPNsense、pfSense、FortiGate、Palo Alto、MikroTik でこのアドレスを含むエイリアス/アドレスオブジェクトとルール)、dhcp_rogue(観測された DHCP 応答)、dhcp.pools(配布範囲の設定)。admin のみ:probe(最新の IP 探査)、anomalies(最新の異常検知でこのアドレスに関するもの)、ai_findings(未処理の AI 監査の検出事項)、console_sessions(直近 10 回のコンソール接続:誰が、いつ、どこから)。conflicts はサーバーが固定のルールで算出した矛盾の一覧 [{code, params}](names、stale_agent、duplicate、macs、macs_random、reservation_mac)で、画面、書き出し、AI の解説はすべてこれを使います。大文字と小文字、末尾のドット、または短い名前と FQDN の先頭ラベルだけが違うホスト名は同じ名前として扱います。各セクションは最大 20 件です。

curl -G https://ipam.example.com/api/v1/investigate \
  -H "Authorization: Bearer $TOKEN" --data-urlencode "ip=192.0.2.10"

事件規則(/event-rules)Event rules (/event-rules)イベントルール(/event-rules)

限 admin。一條規則是「事件 → 條件 → 動作」:events 是事件名稱清單(["*"] 表示全部),conditions 是結構化的 {field, op, value}(不支援運算式或正規表示式),actions 是 notify_admins 或 webhook(要帶既有 webhook 訂閱的 subscription_id)。GET/POST /api/v1/event-rules、PATCH/DELETE /event-rules/{id};POST /event-rules/{id}/test {"event","payload"} 回傳每個條件的比對結果,不會執行動作。 Admin-only. A rule is "event → conditions → actions": events is a list of event names (["*"] means all), conditions are structured {field, op, value} objects (no expressions or regular expressions), and actions are notify_admins or webhook (with the subscription_id of an existing webhook subscription). GET/POST /api/v1/event-rules, PATCH/DELETE /event-rules/{id}; POST /event-rules/{id}/test {"event","payload"} returns how each condition evaluated and does not run the actions.admin のみ。ルールは「イベント → 条件 → アクション」です。events はイベント名の一覧(["*"] はすべて)、conditions は構造化された {field, op, value}(式や正規表現は使えません)、actions は notify_admins または webhook(既存の Webhook 購読の subscription_id が必要)です。GET/POST /api/v1/event-rules、PATCH/DELETE /event-rules/{id}。POST /event-rules/{id}/test {"event","payload"} は各条件の評価結果を返し、アクションは実行しません。

跳板主機(/jump-hosts)Jump hosts (/jump-hosts)踏み台ホスト(/jump-hosts)

限 admin。跳板是 SSH 跳板主機,作為六種網頁主控台(SSH、SFTP、RDP、VNC、noVNC、BMC)的連線出口,指定在子網路(jump_host_id),IP 也可以個別覆寫。GET/POST /api/v1/jump-hosts、PATCH/DELETE /jump-hosts/{id}、GET /jump-hosts/{id}/usage(哪些子網路與 IP 指向它)、POST /jump-hosts/{id}/test。主機金鑰還沒釘選前,test 只抓指紋、不送出帳密;用 PATCH 帶 host_key_fingerprint 釘選後才會真的被拿來連線。密碼與私鑰不會回傳(只有 has_secret)。刪除跳板會讓指向它的子網路與 IP 改回直連;停用的跳板則會拒絕連線(錯誤代碼 jump_host_disabled),不會改用直連,避免在重疊網段連錯主機。 Admin-only. A jump host is an SSH bastion used as the outbound route for the six web consoles (SSH, SFTP, RDP, VNC, noVNC, BMC). It is assigned on a subnet (jump_host_id) and can be overridden per IP. GET/POST /api/v1/jump-hosts, PATCH/DELETE /jump-hosts/{id}, GET /jump-hosts/{id}/usage (which subnets and IPs point to it), POST /jump-hosts/{id}/test. Until its host key is pinned, test only fetches the fingerprint and sends no credentials; it is used for connections only after you pin it with host_key_fingerprint via PATCH. Passwords and private keys are never returned (only has_secret). Deleting a jump host switches the subnets and IPs that used it back to direct connections; a disabled jump host refuses the connection instead (error code jump_host_disabled) and never falls back to direct, so overlapping networks cannot reach the wrong host.admin のみ。踏み台は SSH の踏み台ホストで、6 種類の Web コンソール(SSH、SFTP、RDP、VNC、noVNC、BMC)の接続経路になります。サブネットに割り当て(jump_host_id)、IP ごとに上書きもできます。GET/POST /api/v1/jump-hosts、PATCH/DELETE /jump-hosts/{id}、GET /jump-hosts/{id}/usage(参照しているサブネットと IP)、POST /jump-hosts/{id}/test。ホスト鍵を固定するまでは test はフィンガープリントを取得するだけで認証情報を送りません。PATCH で host_key_fingerprint を固定して初めて接続に使われます。パスワードと秘密鍵は返されません(has_secret のみ)。踏み台を削除すると、それを使っていたサブネットと IP は直接接続に戻ります。無効にした踏み台は接続を拒否し(エラーコード jump_host_disabled)、直接接続には切り替えません。重複するネットワークで別のホストにつながらないようにするためです。

經由掃描代理中繼主控台(console_agent_id)Console relay through a scan agent (console_agent_id)スキャンエージェント経由のコンソール中継(console_agent_id)

後端連不進客戶網路時,主控台(SSH、SFTP、RDP、VNC)可以由放在客戶端的掃描代理往外撥回來中繼。子網路與 IP 的 console_agent_id 指定經由哪一台代理,與 jump_host_id 擇一(只送一邊時另一邊自動清掉,兩邊都送非空值回 console_egress_both),而且必須是該子網路的掃描代理(否則 console_agent_not_assigned;換掉子網路的掃描代理時若出口還指著舊代理也會被擋)。兩道開關都開才會中繼:PUT /api/v1/system/console-security 的 console_relay、PATCH /scan-agents/{id} 的 relay_allowed;同一個端點另有 relay_ports(允許的埠,預設 "22,3389,5900-5910",格式不對回 relay_ports_invalid)與 relay_max_sessions。代理主機不必設定任何東西;主機擁有者可以用 JT_IPAM_RELAY=0 在本機否決(回 relay_agent_host_off),或用 JT_IPAM_RELAY_PORTS/JT_IPAM_RELAY_MAX/JT_IPAM_RELAY_CIDRS 再限縮。GET /scan-agents 另回 relay_caps(代理回報的狀態與本機限縮,舊代理為 null)與 relay_active。任何一道沒開、代理離線、代理拒絕,主控台都會以 relay_* 錯誤代碼拒絕,不會改用直連;BMC 主控台不經由代理。When the server cannot reach into a customer network, consoles (SSH, SFTP, RDP, VNC) can be relayed by the scan agent on site, which dials out. console_agent_id on a subnet or IP picks the agent; it is one or the other with jump_host_id (sending only one clears the other; two non-empty values return console_egress_both) and must be that subnet's scan agent (otherwise console_agent_not_assigned; changing a subnet's scan agent while its exit still points at the old one is refused too). Both switches must be on: console_relay in PUT /api/v1/system/console-security and relay_allowed in PATCH /scan-agents/{id}; the same endpoint takes relay_ports (allowed ports, default "22,3389,5900-5910"; an invalid list returns relay_ports_invalid) and relay_max_sessions. Nothing needs to be set on the agent host; its owner can refuse locally with JT_IPAM_RELAY=0 (relay_agent_host_off) or narrow things with JT_IPAM_RELAY_PORTS / JT_IPAM_RELAY_MAX / JT_IPAM_RELAY_CIDRS. GET /scan-agents also returns relay_caps (the agent's state and local limits, null for older agents) and relay_active. If any switch is off, the agent is offline or it refuses, the console fails with a relay_* error code and never connects directly; the BMC console is never relayed.サーバーから顧客ネットワークに入れない場合、現地のスキャンエージェントが外向きに接続してコンソール(SSH、SFTP、RDP、VNC)を中継できます。サブネットと IP の console_agent_id で経由するエージェントを指定します。jump_host_id とはどちらか一方で(片方だけ送るともう片方は自動的に消え、両方に値を送ると console_egress_both)、そのサブネットのスキャンエージェントでなければなりません(違う場合は console_agent_not_assigned。出口が旧エージェントを指したままサブネットのスキャンエージェントを変更する場合も拒否)。2 つのスイッチの両方が必要です:PUT /api/v1/system/console-security の console_relay と PATCH /scan-agents/{id} の relay_allowed。同じエンドポイントで relay_ports(許可するポート、既定 "22,3389,5900-5910"。形式が不正なら relay_ports_invalid)と relay_max_sessions も設定できます。エージェントホスト側の設定は不要です。ホスト所有者は JT_IPAM_RELAY=0 でローカルに拒否(relay_agent_host_off)したり、JT_IPAM_RELAY_PORTS/JT_IPAM_RELAY_MAX/JT_IPAM_RELAY_CIDRS で絞ったりできます。GET /scan-agents は relay_caps(エージェントの状態とローカル制限、古いエージェントは null)と relay_active も返します。どれかが無効、エージェントがオフライン、またはエージェントが拒否した場合、コンソールは relay_* エラーコードで失敗し、直接接続にはなりません。BMC コンソールは中継しません。

代理協定(代理 1.15.0 起):輪詢 /scan-agents/poll 時帶 X-Agent-Relay: enabled=1;ports=;max=0;pinned=0(enabled=0=主機擁有者否決;ports/max 是本機限縮,空或 0=不限)。回應的 relay_cidrs、relay_ports、relay_max 是網頁上允許的範圍(被指派掃描的子網路、允許的埠、同時上限),只有兩道開關都開時才有內容,否則是空的,代理什麼都不中繼(本機限縮只能縮小,伺服器無法放寬)。開一條主控台時伺服器派一筆 relay_open 工作(sid、單次票證、目標、埠,以及當下的範圍 scope,讓剛打開的開關立刻生效;這個種類無法經由工具頁的探測 API 建立),代理確認目標與埠、先連上目標,再撥 wss://<伺服器>/api/v1/scan-agents/relay/{sid}/ws,帶 X-Agent-Key 與 X-Relay-Ticket(30 秒、只能用一次、綁定這台代理)。伺服器在 127.0.0.1 開一個只接受第一個連線的埠交給主控台,雙向搬運二進位框;每條中繼都寫一筆稽核(console_relay:使用者、代理、目標、起訖、雙向位元組數、結束原因)。nginx 需要這個路徑的 WebSocket 設定,安裝與升級腳本會自動補上;外部反向代理請照 deploy/nginx/jt-ipam-external-proxy.conf 加上同樣的 location。Agent protocol (agent 1.15.0 and later): the agent polls /scan-agents/poll with X-Agent-Relay: enabled=1;ports=;max=0;pinned=0 (enabled=0 = the host owner refuses; ports / max are local limits, empty or 0 = none). relay_cidrs, relay_ports and relay_max in the reply are the scope allowed in the web UI (subnets it scans, allowed ports, session limit); they are filled only while both switches are on and empty otherwise, in which case the agent relays nothing (local limits can only narrow; the server cannot widen them). For each console the server queues a relay_open job (sid, one-time ticket, target, port, and the current scope so a switch that was just turned on works right away; this kind cannot be created through the Tools probe API). The agent checks target and port, connects to the target, then dials wss://<server>/api/v1/scan-agents/relay/{sid}/ws with X-Agent-Key and X-Relay-Ticket (30 seconds, single use, bound to that agent). The server opens a port on 127.0.0.1 that accepts only the first connection, hands it to the console and moves binary frames both ways; every relay writes an audit entry (console_relay: user, agent, target, start and end, bytes each way, reason). nginx needs a WebSocket location for this path; the install and upgrade scripts add it, and external reverse proxies should add the same location as deploy/nginx/jt-ipam-external-proxy.conf.エージェントのプロトコル(エージェント 1.15.0 以降):/scan-agents/poll のポーリング時に X-Agent-Relay: enabled=1;ports=;max=0;pinned=0 を送ります(enabled=0 はホスト所有者による拒否、ports/max はローカル制限で、空または 0 は制限なし)。応答の relay_cidrs、relay_ports、relay_max は Web 画面で許可された範囲(スキャン対象のサブネット、許可ポート、同時接続上限)で、2 つのスイッチが両方オンのときだけ値が入り、それ以外は空でエージェントは何も中継しません(ローカル制限は狭めるだけで、サーバーからは広げられません)。コンソールを開くたびにサーバーは relay_open ジョブ(sid、ワンタイムチケット、接続先、ポート、オンにしたばかりのスイッチがすぐ効くよう現在の範囲 scope。この種類はツール画面のプローブ API からは作成できません)を登録します。エージェントは接続先とポートを確認して接続先に接続してから、X-Agent-Key と X-Relay-Ticket(30 秒、1 回限り、そのエージェント専用)を付けて wss://<サーバー>/api/v1/scan-agents/relay/{sid}/ws へ接続します。サーバーは最初の接続だけを受け付ける 127.0.0.1 のポートを開いてコンソールに渡し、バイナリフレームを双方向に転送します。中継ごとに監査記録(console_relay:ユーザー、エージェント、接続先、開始と終了、双方向のバイト数、終了理由)を残します。このパスには nginx の WebSocket 設定が必要で、インストールとアップグレードのスクリプトが自動で追加します。外部のリバースプロキシでは deploy/nginx/jt-ipam-external-proxy.conf と同じ location を追加してください。

14系統管理System administrationシステム管理

本節的端點都需要 admin。 Everything in this section requires admin.この節のエンドポイントはすべて admin が必要です。

權限授權(/system/permissions)Permission grants (/system/permissions)権限の付与(/system/permissions)

這就是第 1 節說的「在『管理 → 權限指派』授權物件」背後的 API。 This is the API behind "grant objects under Admin → Permissions" from section 1.第 1 節の「管理 → 権限でオブジェクトを許可する」操作の裏側にある API です。

方法Methodメソッド路徑Pathパス說明Description説明
GET/api/v1/system/permissions列出授權(純陣列),可用 principal_type、principal_id 篩選List grants (bare array), filterable by principal_type and principal_id許可の一覧(配列のみ)。principal_type・principal_id で絞り込み可
POST/api/v1/system/permissions新增或更新一筆授權(同物件+同對象視為同一筆)Create or update a grant (same object + same principal is the same grant)許可を追加または更新(同じオブジェクト+同じ対象は同一の許可)
DELETE/api/v1/system/permissions/{grant_id}撤銷授權(204)Revoke a grant (204)許可の取り消し(204)
GET/api/v1/system/roles角色(即群組)清單、可用的物件類型與等級Roles (i.e. groups), plus the valid object types and levelsロール(=グループ)の一覧と、使えるオブジェクト種別・段階

POST 的欄位:object_type(customer/section/subnet/ip/device/rack/location)、object_id(UUID;null 表示該類型全部物件,也就是萬用授權)、principal_type(user/group)、principal_id、level(read/write/admin)。授權與撤銷都會寫稽核。 POST fields: object_type (customer / section / subnet / ip / device / rack / location), object_id (UUID; null means every object of that type, i.e. a wildcard grant), principal_type (user / group), principal_id, level (read / write / admin). Grants and revocations are audited.POST の項目:object_type(customer/section/subnet/ip/device/rack/location)、object_id(UUID。null はその種別のすべてのオブジェクト、つまりワイルドカードの許可)、principal_type(user/group)、principal_id、level(read/write/admin)。付与と取り消しは監査に記録されます。

curl -X POST https://ipam.example.com/api/v1/system/permissions \
  -H "Authorization: Bearer $ADMIN_TOKEN" -H "Content-Type: application/json" \
  -d '{"object_type":"subnet","object_id":"<subnet-uuid>",
       "principal_type":"user","principal_id":"<user-uuid>","level":"read"}'

帳號與群組本身在 /api/v1/users、/api/v1/groups(位移式分頁),群組成員用 POST/DELETE /api/v1/groups/{id}/members/{user_id}。稽核記錄在 GET /api/v1/audit(可依 object_type、object_id、actor_user_id、action、since、until 篩選,limit 上限 500),POST /api/v1/audit/verify 驗證稽核鏈是否完整。 Accounts and groups themselves live at /api/v1/users and /api/v1/groups (offset-based paging); group membership is POST/DELETE /api/v1/groups/{id}/members/{user_id}. The audit log is GET /api/v1/audit (filter by object_type, object_id, actor_user_id, action, since, until; limit up to 500), and POST /api/v1/audit/verify checks that the audit chain is intact.アカウントとグループ自体は /api/v1/users・/api/v1/groups(オフセット式ページング)、グループのメンバーは POST/DELETE /api/v1/groups/{id}/members/{user_id} です。監査ログは GET /api/v1/audit(object_type・object_id・actor_user_id・action・since・until で絞り込み、limit の上限 500)、POST /api/v1/audit/verify で監査チェーンが完全かを検証します。

登入安全、工作階段與備份加密Sign-in security, sessions and backup encryptionログインのセキュリティ・セッション・バックアップの暗号化

方法Methodメソッド路徑Pathパス說明Description説明
GET PUT/api/v1/system/auth-policy雙因素驗證政策:mfa_required(off/admins/all)、mfa_apply_to_sso(預設 false:SSO 交給身分提供者)。被要求但還沒設定的人登入時先完成設定Two-factor authentication policy: mfa_required (off / admins / all) and mfa_apply_to_sso (default false: SSO relies on the identity provider). People who are required but have not set it up do so at sign-in二要素認証のポリシー:mfa_required(off/admins/all)と mfa_apply_to_sso(既定 false:SSO は ID プロバイダーに任せる)。必須なのに未設定のユーザーはログイン時に設定します
GET/api/v1/users/{id}/sessions這個人登入中的工作階段(建立時間、最後使用、位址、瀏覽器、登入方式、是否通過雙因素驗證)That person's active sessions (created, last used, address, browser, sign-in method, whether two-factor authentication was passed)そのユーザーのログイン中のセッション(作成日時・最終使用・アドレス・ブラウザ・ログイン方法・二要素認証の有無)
POST/api/v1/users/{id}/revoke-sessions強制登出:撤銷所有工作階段,連已發出的存取權杖與開著的主控台一起失效(API 權杖不受影響)Sign out everywhere: revoke all sessions, together with access tokens already issued and open consoles (API tokens are not affected)強制ログアウト:すべてのセッションを取り消し、発行済みのアクセストークンと開いているコンソールも無効にします(API トークンには影響しません)
POST/api/v1/users/{id}/reset-mfa清掉這個人的 TOTP 與復原碼並撤銷所有登入Clear that person's TOTP and recovery codes and revoke all their sign-insそのユーザーの TOTP とリカバリーコードを削除し、すべてのログインを取り消します
GET PUT DELETE/api/v1/system/backup-encryption每日備份加密密碼(PUT {"passphrase"} 至少 12 字;回應只有 enabled 與 set_at,不回密碼)Daily backup encryption passphrase (PUT {"passphrase"}, at least 12 characters; the response has only enabled and set_at, never the passphrase)日次バックアップの暗号化パスフレーズ(PUT {"passphrase"} は 12 文字以上。応答は enabled と set_at だけで、パスフレーズは返しません)

停用帳號(PATCH /api/v1/users/{id} {"is_active":false})會撤銷工作階段與 API 權杖;管理員重設密碼會撤銷所有工作階段。每個人自己的工作階段在 GET /api/v1/auth/sessions、DELETE /auth/sessions/{id}、POST /auth/sessions/revoke-others;復原碼重新產生是 POST /auth/totp/recovery-codes(要帶目前密碼或驗證碼)。以上都寫稽核。 Deactivating an account (PATCH /api/v1/users/{id} {"is_active":false}) revokes its sessions and API tokens; an administrator password reset revokes all sessions. Everyone's own sessions are at GET /api/v1/auth/sessions, DELETE /auth/sessions/{id} and POST /auth/sessions/revoke-others; recovery codes are regenerated with POST /auth/totp/recovery-codes (with the current password or a code). All of these are audited.アカウントを無効化する(PATCH /api/v1/users/{id} {"is_active":false})とセッションと API トークンが取り消され、管理者によるパスワードのリセットはすべてのセッションを取り消します。各自のセッションは GET /api/v1/auth/sessions・DELETE /auth/sessions/{id}・POST /auth/sessions/revoke-others、リカバリーコードの再生成は POST /auth/totp/recovery-codes(現在のパスワードまたはコードが必要)です。いずれも監査に記録されます。

系統匯出/匯入(/system/transfer)System export / import (/system/transfer)システムのエクスポート/インポート(/system/transfer)

把整台的設定與資料搬到另一台。流程:GET /system/transfer/schema 看有哪些範圍可以選、各有多少筆 → POST /system/transfer/export {"scope":[…],"passphrase":"…"}(密語至少 8 字,背景作業,回 task_id)→ GET /system/transfer/export/{task_id}/download 下載加密檔(還沒好回 409,保留 48 小時,過期回 410)。匯入:POST /system/transfer/import/analyze 是 multipart(file、passphrase,最大 512 MiB),不寫入,回一個 token 與內容摘要 → POST /system/transfer/import/apply {"token","passphrase","mode":"merge"|"replace","dry_run":false}。 Moves a whole instance's settings and data to another one. Export: GET /system/transfer/schema shows the selectable scopes and row counts → POST /system/transfer/export {"scope":[…],"passphrase":"…"} (passphrase at least 8 characters; background task, returns task_id) → GET /system/transfer/export/{task_id}/download fetches the encrypted file (409 until ready; kept 48 hours, then 410). Import: POST /system/transfer/import/analyze is multipart (file, passphrase, up to 512 MiB), writes nothing, and returns a token plus a summary → POST /system/transfer/import/apply {"token","passphrase","mode":"merge"|"replace","dry_run":false}.インスタンス全体の設定とデータを別のインスタンスへ移します。エクスポート:GET /system/transfer/schema で選べる範囲と件数を確認 → POST /system/transfer/export {"scope":[…],"passphrase":"…"}(パスフレーズは 8 文字以上。バックグラウンド処理で task_id を返す)→ GET /system/transfer/export/{task_id}/download で暗号化ファイルを取得(準備中は 409、48 時間保持、期限切れは 410)。インポート:POST /system/transfer/import/analyze は multipart(file・passphrase、最大 512 MiB)で何も書き込まず、token と内容の要約を返します → POST /system/transfer/import/apply {"token","passphrase","mode":"merge"|"replace","dry_run":false}。

mode: "replace" 會先清掉目標站台上對應範圍的資料再寫入。請先用 dry_run: true 看報告,並確認有備份。 mode: "replace" wipes the matching data on the target before writing. Run with dry_run: true first to see the report, and make sure you have a backup.mode: "replace" は書き込む前に、対象インスタンスの該当範囲のデータを消去します。まず dry_run: true で報告を確認し、バックアップがあることを確かめてください。

版本與自我診斷Version and self-diagnosisバージョンと自己診断

GET /api/v1/system/version 回應用程式版本,以及套件、前端、主機、PostgreSQL 與選用工具的狀態;GET /system/version/check-latest 會對外連到 GitHub 查最新版。GET /api/v1/system/doctor 回一組 JSON 檢查項目(每項附修正建議),/system/doctor/report 是同樣內容的純文字版;GET /api/v1/system/doctor/stats 回各類資料的筆數(groups[].items[] 每項有 key、count、approx:大表逾時時是資料庫估計值),只在本機計算、不傳送到任何地方;GET /api/v1/system/doctor/storage 回容量用量:database(總大小、groups 依功能分類加總、tables 最大的幾張表,含索引與 TOAST)、directories(備份、程式與套件、資料目錄、日誌,approx 表示時間到沒量完、denied 表示有讀不到的檔案)與 disk,目錄大小快取幾分鐘,帶 refresh=true 重新量。後端看不到 systemd、nginx、備份等主機層面的狀態,那些請在主機上跑 jt-ipam.sh doctor。 GET /api/v1/system/version returns the application version plus package, frontend, host, PostgreSQL and optional-tool status; GET /system/version/check-latest makes an outbound request to GitHub for the latest release. GET /api/v1/system/doctor returns a set of JSON checks, each with a suggested fix, and /system/doctor/report is the same as plain text; GET /api/v1/system/doctor/stats returns record counts per kind (groups[].items[] with key, count and approx, true when a big table timed out and the database estimate is shown), counted locally and never sent anywhere; GET /api/v1/system/doctor/storage returns storage usage: database (total size, groups summed per feature, tables with the largest tables including indexes and TOAST), directories (backups, program and packages, data directory and logs; approx means the walk ran out of time, denied that some files were unreadable) and disk; directory sizes are cached for a few minutes, and refresh=true measures again. The backend cannot see host-level state such as systemd, nginx or backups; run jt-ipam.sh doctor on the host for those.GET /api/v1/system/version はアプリケーションのバージョンと、パッケージ・フロントエンド・ホスト・PostgreSQL・任意ツールの状態を返します。GET /system/version/check-latest は GitHub へ外部接続して最新版を確認します。GET /api/v1/system/doctor は修正案付きの JSON のチェック項目を返し、/system/doctor/report は同じ内容のテキスト版です。GET /api/v1/system/doctor/stats は種類ごとの件数を返します(groups[].items[] の各項目に key・count・approx。大きな表が時間切れのときはデータベースの推定値で approx が true)。このサーバー上でのみ数え、どこにも送信しません。GET /api/v1/system/doctor/storage は容量の使用状況を返します:database(全体の容量、機能別に合計した groups、大きいテーブルの tables。インデックスと TOAST を含む)、directories(バックアップ、プログラムとパッケージ、データディレクトリ、ログ。approx は時間切れで計測しきれなかったこと、denied は読み取れないファイルがあったことを示します)、disk。ディレクトリの容量は数分間キャッシュし、refresh=true で再計測します。systemd・nginx・バックアップなどホスト側の状態はバックエンドからは見えないため、ホスト上で jt-ipam.sh doctor を実行してください。

15完整資源索引Full resource indexリソース一覧

OpenAPI 列出約 466 條路徑、641 個操作,另外還有約 20 條不在 OpenAPI 裡的路由(WebSocket、代理用端點、安裝腳本、機櫃嵌入 SVG、健康檢查、phpIPAM 根路徑與 MCP)。上面詳述的是最常用的資源;其餘大多遵循同一套 GET 列表 / GET {id} / POST / PATCH / DELETE 慣例。下表的權限是整組的通則,個別端點以程式與 schema 為準。 OpenAPI lists about 466 paths and 641 operations, and about 20 more routes are hidden from it (WebSockets, agent endpoints, installer scripts, the rack embed SVG, health checks, the phpIPAM root and MCP). The sections above cover the most-used resources; most others follow the same GET list / GET {id} / POST / PATCH / DELETE convention. The access column states each group's general rule; individual endpoints are defined by the code and schema.OpenAPI にはおよそ 466 のパスと 641 の操作が載っており、ほかに OpenAPI に載らない経路が約 20 本あります(WebSocket、エージェント用エンドポイント、インストールスクリプト、ラック図の埋め込み SVG、ヘルスチェック、phpIPAM のルート、MCP)。上で詳しく説明したのはよく使うリソースで、それ以外の多くは同じ GET 一覧 / GET {id} / POST / PATCH / DELETE の作法に従います。下表の権限はグループ全体の原則で、個々のエンドポイントはコードとスキーマに従います。

分類Area分類基底路徑(皆在 /api/v1 下)Base paths (all under /api/v1)ベースパス(すべて /api/v1 配下)權限Access権限
核心 IPAMCore IPAMIPAM のコア /sections /subnets /subnets/{id}/ranges /addresses /devices /customers /locations /racks /racks/{id}/diagram 讀取依逐物件可見性。寫入:區段/子網路/IP 依該物件等級;POST /sections、裝置、客戶、地點、機櫃的寫入只限 adminReads: per-object visibility. Writes: sections / subnets / IPs by the level on the object; POST /sections and writes to devices, customers, locations and racks are admin-only読み取りはオブジェクト単位の可視性。書き込み:セクション/サブネット/IP はそのオブジェクトの段階、POST /sections と機器・顧客・拠点・ラックへの書き込みは admin のみ
網路資源Network resourcesネットワーク資源 /vlans /vlan-domains /vrfs /asns /nat /dhcp-ranges /vpn-tunnels /wireless 讀取需全域讀取;寫入需 admin。/nat 每一筆有 disabled(防火牆上停用的規則同步成 true,停用的規則不算對外開放);清單可用 type、device_id、ip_id(來源或目的指向這個 IP)、source_kind(可複選)、source_firewall_id 篩選Read: global read; write: admin. Each /nat rule has disabled (rules disabled on the firewall sync as true and do not count as exposure); the list filters by type, device_id, ip_id (source or destination is this IP), source_kind (repeatable) and source_firewall_id読み取りは全体の読み取り、書き込みは admin。/nat の各ルールには disabled があります(ファイアウォールで無効のルールは true で同期され、外部公開には数えません)。一覧は type・device_id・ip_id(送信元または宛先がこの IP)・source_kind(複数指定可)・source_firewall_id で絞り込めます
實體層Physical layer物理層 /cables /cable-terminations /device-ports /ports /power-feeds /power-panels /power-outlets /device-power-ports 讀取需全域讀取;寫入需 adminRead: global read; write: admin読み取りは全体の読み取り、書き込みは admin
商務/組織Business / orgビジネス/組織 /tenants /tenant-groups /providers /circuits /circuit-types /contacts /contact-groups /contact-assignments 讀取需全域讀取;寫入需 adminRead: global read; write: admin読み取りは全体の読み取り、書き込みは admin
整合(讀取需全域讀取)Integrations (global read)連携(全体の読み取り) /dns /librenms /virt /pfsense /fortigate /paloalto /mikrotik /zabbix /ocs 資料讀取需全域讀取;設定、測試、同步需 admin(例外見第 12 節)Data reads: global read; configure / test / sync: admin (exceptions in section 12)データの読み取りは全体の読み取り、設定・テスト・同期は admin(例外は第 12 節)
整合(限 admin)Integrations (admin-only)連携(admin のみ) /firewalls/opnsense /wazuh /windows-dhcp /adguard /esxi /kea-dhcp /isc-dhcp /technitium-dhcp /checkpoint /rustdesk /isoinsight /snmp 讀取也要 admin(例外:/isoinsight/leases 依可見子網路)admin, reads included (exception: /isoinsight/leases is filtered by visible subnets)読み取りも admin(例外:/isoinsight/leases は閲覧できるサブネットで絞り込み)
代理、憑證與連線Agents, certificates & connectionsエージェント・証明書・接続 /scan-agents /cert-agents /certificates /jump-hosts /ssh-credentials admin(代理自己的通道用代理金鑰,見第 20 節)。例外:/cert-agents/status 需全域讀取;/scan-agents/probes 任何登入帳號;/ssh-credentials 是每位使用者只管自己的(protocol:ssh、rdp、vnc、pve、bmc、rustdesk;rustdesk 只收密碼、帳號可以空白、一定要帶 target_ip_id,同一個 IP 再存一次會取代舊的)admin (the agents' own channel uses agent keys, see section 20). Exceptions: /cert-agents/status needs global read; /scan-agents/probes is open to any signed-in account; /ssh-credentials is per user (your own credentials only; protocol: ssh, rdp, vnc, pve, bmc, rustdesk; rustdesk takes a password only, the username may be empty, target_ip_id is required, and saving again for the same IP replaces the old one)admin(エージェント自身の経路はエージェント鍵を使います。第 20 節を参照)。例外:/cert-agents/status は全体の読み取り、/scan-agents/probes はログイン済みの任意のアカウント、/ssh-credentials はユーザーごとに自分の分だけ(protocol:ssh・rdp・vnc・pve・bmc・rustdesk。rustdesk はパスワードのみで、ユーザー名は空欄でもよく、target_ip_id が必須。同じ IP にもう一度保存すると古いものを置き換えます)
流程與通知Workflow & notificationsワークフローと通知 /ip-requests /notifications /webhooks /tasks /anomalies /ip-changes /event-rules IP 申請、通知、作業、IP 異動:任何登入帳號,依可見範圍或本人過濾(作業只看得到自己發起的,admin 看全部);/webhooks、/event-rules、/anomalies 需 admin(/anomalies/attack-surface 需全域讀取)。POST /anomalies/scan 執行偵測並保存結果,GET /anomalies/last 取回上一次的結果(手動或排程,trigger);有 IP 的列附 live(各來源最後看到的時間,取用當下才算,不是偵測時的快照),多個 IP 的列附 live_ips。unauthorized_ips 最多列 1,000 筆(最近看到的在前),總數在 unauthorized_totalIP requests, notifications, tasks, IP changes: any signed-in account, filtered by visibility or ownership (you see only tasks you started; admins see all); /webhooks, /event-rules, /anomalies: admin (/anomalies/attack-surface: global read). POST /anomalies/scan runs detection and keeps the result; GET /anomalies/last returns the last result (manual or scheduled, trigger). Rows with an IP carry live (when each source last saw it, computed at read time rather than at detection time); rows with several IPs carry live_ips. unauthorized_ips lists at most 1,000 rows (most recently seen first); the full count is unauthorized_totalIP 申請・通知・処理・IP の変更:ログイン済みの任意のアカウント。閲覧範囲または本人で絞り込み(処理は自分が開始したものだけ、admin はすべて)。/webhooks・/event-rules・/anomalies は admin(/anomalies/attack-surface は全体の読み取り)。POST /anomalies/scan は検出を実行して結果を保存し、GET /anomalies/last は前回の結果(手動またはスケジュール、trigger)を返します。IP を持つ行には live(各ソースが最後に観測した時刻。検出時点ではなく取得時に算出)、複数の IP を持つ行には live_ips が付きます。unauthorized_ips は最大 1,000 件(直近に見えたものから)で、総数は unauthorized_total
分析、AI 與探測Analytics, AI & probing分析・AI・プローブ /dashboard /topology /search /macs /tools /oui /ai /investigate /ai-audit /identify 儀表板、搜尋、MAC 歷程、工具、OUI、AI 對話、調查:任何登入帳號(依可見範圍縮放)。GET /macs/{mac}/history 以一個 MAC 為中心回傳用過的 IP(起訖時間、依據)、異動時間軸、交換器埠、DHCP 固定分配、裝置與虛擬機網卡,以及隨機 MAC 輪替時可能是同一台的其他 MAC;MAC 任何寫法都可以,不是 MAC 回 422 mac_invalid。/topology 任何有可見範圍的帳號(只被授權部分物件的帳號只看得到自己範圍內的裝置與子網路,不含 VPN 與虛擬機;回應帶 scope: "limited" 與 hidden_layers);/ai-audit、/identify、tools/net/agent-probe 與 AI 設定類端點需 adminDashboard, search, MAC history, tools, OUI, AI chat, investigate: any signed-in account (scaled to visibility). GET /macs/{mac}/history returns everything about one MAC: IPs it used (first and last seen, evidence), the change timeline, switch ports, DHCP reservations, device and VM interfaces, and other MACs that are probably the same device when a random MAC rotates; any MAC spelling works, and a non-MAC returns 422 mac_invalid. /topology: any account with some visibility (accounts granted only some objects see only their own devices and subnets, without VPNs and VMs; the response carries scope: "limited" and hidden_layers); /ai-audit, /identify, tools/net/agent-probe and AI settings endpoints: adminダッシュボード・検索・MAC の履歴・ツール・OUI・AI チャット・調査:ログイン済みの任意のアカウント(閲覧範囲に応じて縮小)。GET /macs/{mac}/history は 1 つの MAC について、使った IP(初回と最終、根拠)、変更のタイムライン、スイッチのポート、DHCP の予約、機器と仮想マシンのネットワークカード、ランダム MAC が切り替わったときに同じ端末と思われる別の MAC を返します。MAC はどの書式でもよく、MAC でなければ 422 mac_invalid を返します。/topology は閲覧範囲のある任意のアカウント(一部のオブジェクトだけを許可されたアカウントは自分の範囲の機器とサブネットだけが見え、VPN と仮想マシンは含みません。応答に scope: "limited" と hidden_layers が付きます)。/ai-audit・/identify・tools/net/agent-probe と AI の設定系は admin
管理Administration管理 /users /groups /audit /system /system/permissions /system/transfer /custom-fields /plugins /import /migration admin。例外:GET /custom-fields 與少數 /system 顯示設定的 GET,任何登入帳號可讀;/system/integration-presence 需全域讀取admin. Exceptions: GET /custom-fields and a few GET display settings under /system are readable by any signed-in account; /system/integration-presence needs global readadmin。例外:GET /custom-fields と /system の一部の表示設定の GET はログイン済みの任意のアカウントが読めます。/system/integration-presence は全体の読み取り
自助Self-serviceセルフサービス /auth/me /auth/sessions /auth/totp /me/preferences /api-tokens /export-events 任何已認證帳號(只管自己的)。POST /export-events {"source","format","rows","filename"} 是前端在瀏覽器產生匯出檔時回報的稽核(每人每分鐘 120 次)Any authenticated account (your own data). POST /export-events {"source","format","rows","filename"} is the audit record the frontend sends when it generates an export in the browser (120 a minute per user)認証済みの任意のアカウント(自分の分)。POST /export-events {"source","format","rows","filename"} はブラウザでエクスポートを生成したときにフロントエンドが送る監査記録です(ユーザーごとに毎分 120 回)
公開(無需登入)Public (no sign-in)公開(ログイン不要) /lookup/* /racks/{id}/embed.svg;根路徑的; at the root: 。ルートの /healthz /readyz DSV 與機櫃嵌入各自用系統權杖守門(第 17、18 節);健康檢查不需認證(第 20 節)DSV and rack embeds are each guarded by a system token (sections 17 and 18); health checks need no auth (section 20)DSV とラック図の埋め込みはそれぞれシステムトークンで保護(第 17・18 節)。ヘルスチェックは認証不要(第 20 節)

16phpIPAM 相容 API-compatible API 互換 API

給既有的 phpIPAM 腳本用的相容層:換掉網址與權杖就能沿用,回應是 phpIPAM 的外層格式 {code, success, data, message, time}。 A compatibility layer for existing phpIPAM scripts: change the URL and token and they keep working, with phpIPAM-shaped envelopes {code, success, data, message, time}.既存の phpIPAM 用スクリプトのための互換レイヤです。URL とトークンを差し替えればそのまま使え、応答も phpIPAM と同じ外枠 {code, success, data, message, time} で返します。

基底路徑:/api/phpipam/<app_id>/。<app_id> 沿用你原本 phpIPAM 的 App ID 字串。GET /api/phpipam/<app_id>/ 本身不需認證,回相容層版本與支援的資源(user、sections、subnets、addresses),可用來確認網址是否正確。 Base path: /api/phpipam/<app_id>/, where <app_id> is whatever App ID string your scripts already use. GET /api/phpipam/<app_id>/ itself needs no auth and returns the layer's version and supported resources (user, sections, subnets, addresses), handy for checking the URL.ベースパスは /api/phpipam/<app_id>/ です。<app_id> には、これまで使っていた phpIPAM の App ID 文字列をそのまま指定します。GET /api/phpipam/<app_id>/ 自体は認証不要で、互換レイヤのバージョンと対応リソース(user・sections・subnets・addresses)を返すので、URL の確認に使えます。

認證Authentication認証

三種標頭都收(挑一個就好):token: jt_…、phpipam-token: jt_…、Authorization: Bearer jt_…。也可以用帳號密碼走 Basic Auth 換一把 30 天的權杖: Any one of three headers works: token: jt_…, phpipam-token: jt_…, or Authorization: Bearer jt_…. You can also exchange username/password over Basic Auth for a 30-day token:次の三つのヘッダのいずれでも構いません。token: jt_…、phpipam-token: jt_…、Authorization: Bearer jt_…。また、Basic 認証でユーザー名とパスワードを送り、30 日間有効なトークンと交換することもできます。

curl -X POST -u 'user:password' \
  https://ipam.example.com/api/phpipam/myapp/user/
{ "code": 200, "success": true,
  "data": { "id": "…", "username": "user", "expires": "2026-10-30 12:00:00",
            "token": "jt_myapp_…" },
  "message": "", "time": 0.01 }
這把權杖是 jt_<app_id>_…,scope 為 phpipam:*,等同不限制。它是一把一般的 API 權杖,除了相容層之外,在原生 REST API 與 MCP 上也一樣有效,權限就是該帳號的全部權限。請比照帳號密碼保管;用完以 DELETE user/ 撤銷。每次登入都會寫稽核,也出現在該帳號的「API 權杖」清單裡。 This token is jt_<app_id>_… with scope phpipam:*, which is unrestricted. It is an ordinary API token: besides the compatibility layer it also works on the native REST API and MCP, with the account's full permissions. Guard it like the password, and revoke it with DELETE user/ when done. Every login is audited, and the token shows up in that account's API token list.このトークンは jt_<app_id>_… で、スコープは phpipam:*(制限なしと同じ)です。通常の API トークンなので、互換レイヤだけでなくネイティブの REST API や MCP でも有効で、そのアカウントの全権限を持ちます。パスワードと同様に管理し、使い終わったら DELETE user/ で失効させてください。ログインのたびに監査に記録され、そのアカウントの API トークン一覧にも表示されます。
方法Methodメソッド路徑(接在基底之後)Path (after the base)パス(ベースに続く部分)說明Description説明
GET(空,即基底本身)(empty: the base itself)(空。ベースそのもの)相容層資訊,不需認證Layer info, no auth互換レイヤの情報。認証不要
POSTuser/Basic Auth 換權杖Exchange Basic Auth for a tokenBasic 認証をトークンと交換する
GETuser/目前帳號資訊(id、username、email、role)Current account (id, username, email, role)現在のアカウント情報(id・username・email・role)
PATCHuser/把權杖期限從現在起延長 30 天Extend the token to 30 days from nowトークンの期限を現時点から 30 日後まで延長する
DELETEuser/撤銷權杖(登出)Revoke the token (log out)トークンを失効させる(ログアウト)
GETsections/ · sections/{id}/ · sections/{id}/subnets/區段Sectionsセクション
GETsubnets/{id}/ · subnets/cidr/{cidr}/ · subnets/{id}/usage/ · subnets/{id}/first_free/ · subnets/{id}/addresses/子網路Subnetsサブネット
GETaddresses/{id}/ · addresses/{ip}/{subnet_id}/ · addresses/search/{ip}/ · addresses/search_hostname/{host}/ · addresses/first_free/{subnet_id}/IP 位址IP addressesIP アドレス
POSTsections/ · subnets/ · addresses/建立Create作成
PATCH DELETEsections/{id}/ · subnets/{id}/ · addresses/{id}/更新/刪除(網址要帶 {id}/)。刪 IP 跟 REST 一樣要子網路 admin,也會寫異動記錄、進冷卻期Update / delete (the URL must include {id}/). Deleting an IP needs subnet admin like REST, and it is logged and put into cooldown更新/削除(URL に {id}/ が必要)。IP の削除は REST と同じくサブネットの admin が必要で、変更履歴とクールダウンも REST と同じです

寫入權限:區段與子網路的建立、更新、刪除需要 admin;IP 的寫入需要該子網路的 write。 Write access: creating, updating and deleting sections and subnets needs admin; IP writes need write on the subnet.書き込み権限:セクションとサブネットの作成・更新・削除には admin、IP の書き込みにはそのサブネットの write が必要です。

PATCH user/ 與 DELETE user/ 只從 token 或 phpipam-token 標頭讀權杖。只帶 Authorization: Bearer 會回 401(Missing token),呼叫這兩支時請用 phpIPAM 風格的標頭。 PATCH user/ and DELETE user/ read the token only from the token or phpipam-token header. Sending only Authorization: Bearer returns 401 (Missing token); use the phpIPAM-style header for these two calls.PATCH user/ と DELETE user/ はトークンを token または phpipam-token ヘッダからしか読みません。Authorization: Bearer だけを送ると 401(Missing token)になります。この二つを呼ぶときは phpIPAM 形式のヘッダを使ってください。
唯讀權杖在這一層同樣有效:POST/PATCH/DELETE 會被擋成 403。唯一例外是 DELETE user/(撤銷自己的權杖):那是降權、不是異動資料,所以照樣放行,老腳本的「登入 → 查詢 → 登出」流程不會斷。 Read-only tokens are enforced here too: POST/PATCH/DELETE get 403. The one exception is DELETE user/ (revoking your own token); that reduces privilege rather than changing data, so it is allowed and the classic login → query → logout flow keeps working.読み取り専用トークンはこのレイヤでも有効で、POST/PATCH/DELETE は 403 で拒否されます。唯一の例外は DELETE user/(自分のトークンの失効)です。これは権限を下げる操作であってデータの変更ではないため許可され、従来からの「ログイン → 問い合わせ → ログアウト」という流れが壊れません。
相容層只覆蓋 phpIPAM API 的常用子集,不是逐一對應。完整對照見原始碼裡的 docs/PHPIPAM_API_MAPPING.md。新寫的整合建議直接用原生 REST API。對 user/ 的所有呼叫都受 nginx 登入限流(每個來源 IP 每分鐘 10 次,見第 21 節)。 The layer covers the commonly-used subset of the phpIPAM API, not every call. See docs/PHPIPAM_API_MAPPING.md in the source for the full mapping. For new integrations, prefer the native REST API. Every call to user/ is subject to the nginx login limit (10 per minute per source IP, see section 21).この互換レイヤが覆うのは phpIPAM API のうちよく使われる一部であり、一対一の対応ではありません。完全な対応表はソース内の docs/PHPIPAM_API_MAPPING.md にあります。新しく連携を書く場合は、ネイティブな REST API を直接使うことをおすすめします。user/ への呼び出しはすべて nginx のログイン制限(送信元 IP ごとに毎分 10 回。第 21 節を参照)の対象です。

17Graylog DSV 查表 lookups ルックアップ

給 Graylog 的「DSV File from HTTP」配接器用的免登入唯讀端點,回 CSV 或 TSV。認證是一把系統層級的權杖,走網址參數 ?token=(也接受 X-Auth-Token 標頭,給支援自訂標頭的 Graylog 版本)。預設關閉:由 admin 在「管理 → 外部系統整合 → Graylog」(API:GET/PUT /api/v1/system/graylog-dsv)啟用,並設定格式(CSV 或 TSV)與網址名稱。第一次儲存時會產生權杖,也可以要求重新產生(regenerate_token,token_days 30 到 365,預設 365)。權杖會到期(過期回 401 Token expired,到期前通知管理員),加密存放;設定的回應不含權杖,要用 GET /api/v1/system/graylog-dsv/token 取(留稽核)。allowed_sources 可以限制只接受某些位址或網段來的查表。 Unauthenticated, read-only endpoints that return CSV or TSV for Graylog's "DSV File from HTTP" adapter. They are gated by a system-level token passed as ?token= (an X-Auth-Token header also works, for Graylog versions that can send custom headers). Off by default: an admin enables it under Admin → External integrations → Graylog (API: GET/PUT /api/v1/system/graylog-dsv) and chooses the format (CSV or TSV) and the path name. The token is generated on the first save and can be regenerated (regenerate_token, token_days 30 to 365, default 365). The token expires (an expired one returns 401 Token expired, and administrators are notified beforehand) and is stored encrypted; the settings response does not contain it, so fetch it with GET /api/v1/system/graylog-dsv/token (audited). allowed_sources restricts lookups to certain addresses or networks.Graylog の「DSV File from HTTP」アダプタ向けの認証不要・読み取り専用のエンドポイントで、CSV または TSV を返します。Graylog は取得時に独自ヘッダを送れないため、認証はシステムレベルのトークンを URL パラメータ ?token= で渡す方式です(独自ヘッダを送れる Graylog のバージョン向けに X-Auth-Token ヘッダも受け付けます)。既定では無効で、admin が「管理 → 外部システム連携 → Graylog」(API:GET/PUT /api/v1/system/graylog-dsv)で有効にし、形式(CSV または TSV)とパス名を設定します。トークンは最初の保存時に生成され、再生成もできます(regenerate_token、token_days は 30〜365、既定 365)。トークンには期限があり(期限切れは 401 Token expired、事前に管理者へ通知)、暗号化して保存されます。設定の応答にはトークンが含まれないため、GET /api/v1/system/graylog-dsv/token で取得します(監査に記録)。allowed_sources でルックアップを受け付けるアドレスやネットワークを制限できます。

路徑Pathパス對照Mapping対応
/api/v1/lookup/{name}IP → 主機名稱。{name} 是 admin 設定的網址名稱(預設 ip-fqdn,只能用英數、-、_);名稱不符或功能關閉時回 404IP → hostname. {name} is the path name the admin configured (default ip-fqdn; letters, digits, - and _ only); a different name, or the feature being off, returns 404IP → ホスト名。{name} は admin が設定したパス名(既定 ip-fqdn。英数字・-・_ のみ)で、名前が違う場合や機能が無効の場合は 404
/api/v1/lookup/firewall/{id}/rule-aliasesOPNsense 規則 rid → 別名OPNsense rule rid → aliasOPNsense のルール rid → エイリアス
/api/v1/lookup/firewall/{id}/aliasesOPNsense 別名 → 成員OPNsense alias → membersOPNsense のエイリアス → メンバー
/api/v1/lookup/pfsense/{id}/rulespfSense tracker → 說明pfSense tracker → descriptionpfSense の tracker → 説明
/api/v1/lookup/pfsense/{id}/aliasespfSense 別名 → 成員pfSense alias → memberspfSense のエイリアス → メンバー
/api/v1/lookup/proxmox/vms全部叢集:vmid → VM 名稱All clusters: vmid → VM name全クラスタ:vmid → VM 名
/api/v1/lookup/proxmox/{cluster_id}/vms單一叢集:vmid → VM 名稱One cluster: vmid → VM name単一クラスタ:vmid → VM 名
curl "https://ipam.example.com/api/v1/lookup/ip-fqdn?token=<dsv-token>"
"192.0.2.10","web01.example.com"
"192.0.2.11","db01.example.com"

CSV 每欄都用雙引號包起來(RFC 4180);TSV 不加引號,內容含 tab 或引號的列會被略過。同一個 IP 出現在多個重疊網段時只輸出一次。權杖錯誤回 401。在 Graylog 的 DSV 配接器裡設 Key column = 0、Value column = 1(欄位索引從 0 起算),選 TSV 時分隔字元改成 tab。防火牆類端點要先在該台整合設定裡勾選「提供防火牆 DSV」才會有資料。 CSV quotes every field (RFC 4180); TSV is unquoted and skips rows containing a tab or a quote. An IP present in several overlapping subnets is output once. A wrong token returns 401. In Graylog's DSV adapter set Key column = 0 and Value column = 1 (0-based), and set the separator to tab if you chose TSV. The firewall endpoints only return data once "expose firewall DSV" is enabled on that firewall.CSV はすべての項目を二重引用符で囲みます(RFC 4180)。TSV は引用符を付けず、タブや引用符を含む行は飛ばします。重複する複数のサブネットにある同じ IP は一度だけ出力します。トークンが誤っていると 401 です。Graylog の DSV アダプタでは Key column = 0、Value column = 1(0 起算)に設定し、TSV を選んだ場合は区切り文字をタブにしてください。ファイアウォール関連のエンドポイントは、そのファイアウォールの設定で「ファイアウォール DSV を提供する」を有効にして初めてデータを返します。

開關只管 IP → 主機名稱這張表。防火牆與 Proxmox 的查表只檢查同一把權杖(防火牆另外看該台的開關),所以權杖一旦產生,關掉主開關並不會讓它們停止回應。 The on/off switch only governs the IP → hostname table. The firewall and Proxmox tables check only the same token (firewalls also check their per-firewall switch), so once a token exists, turning the main switch off does not stop them from answering.オン/オフの切り替えが効くのは IP → ホスト名の表だけです。ファイアウォールと Proxmox の表は同じトークンだけを確認します(ファイアウォールは個別の切り替えも確認)。そのため、トークンが一度生成されると、主スイッチを切ってもこれらは応答し続けます。

明文 8088 埠(HTTPS 的唯一例外)Plain-HTTP port 8088 (the one HTTPS exception)平文の 8088 番ポート(HTTPS の唯一の例外)

隨附的 nginx 設定另外在 8088 埠以明文 HTTP 提供 /api/v1/lookup/(其他路徑一律 404),給無法用 HTTPS(例如不信任自簽憑證)的 Graylog 使用。後端只有在設定打開 allow_plain_http 之後才回應這個埠(新安裝預設關閉,關閉時一律 404;升級前已經啟用 DSV 的站台保留原本的行為)。權杖放在網址裡,走明文就會在網路上被看見,所以只適合在受信任的內網使用,並建議同時設定 allowed_sources。nginx 不會把網址上的權杖寫進存取記錄。direct 模式沒有 nginx,也就沒有 8088。 The shipped nginx config also serves /api/v1/lookup/ over plain HTTP on port 8088 (every other path returns 404), for Graylog installs that cannot use HTTPS (for example, they do not trust a self-signed certificate). The backend answers on this port only after allow_plain_http is turned on (off for new installs, always 404 while off; sites already using DSV before upgrading keep their previous behaviour). The token is in the URL, so over plain HTTP it is visible on the wire; use it only on a trusted internal network and consider setting allowed_sources too. nginx does not write the token in the URL to its access log. Direct mode has no nginx and therefore no port 8088.同梱の nginx 設定は、/api/v1/lookup/ を 8088 番ポートで平文 HTTP でも提供します(それ以外のパスはすべて 404)。HTTPS を使えない(自己署名証明書を信頼できないなど)Graylog 向けです。バックエンドがこのポートに応答するのは設定で allow_plain_http を有効にした後だけです(新規インストールでは無効で、無効の間は常に 404。アップグレード前から DSV を使っていたサイトは以前の動作を維持します)。トークンは URL に含まれるため、平文ではネットワーク上で見えてしまいます。信頼できる社内ネットワークでのみ使い、allowed_sources の設定もおすすめします。nginx は URL のトークンをアクセスログに書き込みません。direct モードには nginx が無いため、8088 番ポートもありません。

18機櫃圖嵌入 SVGRack embed SVGラック図の埋め込み SVG

GET /api/v1/racks/{id}/embed.svg?token=… 是免登入的機櫃正面圖(image/svg+xml),給 wiki 或監控面板以圖片嵌入。它用兩道開關守門,兩個都成立才會回圖:系統層的開關與權杖(admin 在 GET/PUT /api/v1/system/rack-embed 設定 enabled,regenerate_token 可重新產生權杖、token_days 決定有效天數;權杖加密存放、會到期,設定的回應不含權杖,用 GET /api/v1/system/rack-embed/token 取並留稽核),以及逐機櫃的 expose_svg(在機櫃的建立/修改欄位裡)。預設全關,因為機櫃圖會揭露裝置名稱與位置。 GET /api/v1/racks/{id}/embed.svg?token=… is an unauthenticated rack elevation (image/svg+xml) for embedding as an image in a wiki or monitoring dashboard. Two gates must both be open: the system-wide switch and token (an admin sets enabled with GET/PUT /api/v1/system/rack-embed, regenerate_token issues a new token and token_days sets its lifetime; the token is stored encrypted and expires, and the settings response does not contain it: fetch it with GET /api/v1/system/rack-embed/token, which is audited), and the per-rack expose_svg flag (a field on rack create/update). Everything is off by default, because a rack diagram reveals device names and positions.GET /api/v1/racks/{id}/embed.svg?token=… は認証不要のラック正面図(image/svg+xml)で、Wiki や監視ダッシュボードに画像として埋め込むためのものです。二つの関門が両方開いている必要があります。システム全体のスイッチとトークン(admin が GET/PUT /api/v1/system/rack-embed で enabled を設定し、regenerate_token でトークンを再発行、token_days で有効日数を指定。トークンは暗号化して保存され期限があり、設定の応答には含まれないため GET /api/v1/system/rack-embed/token で取得し、監査に記録されます)と、ラックごとの expose_svg(ラックの作成/変更の項目)です。ラック図は機器名と位置を明かすため、既定ではすべて無効です。

情況Situation状況回應Response応答
功能關閉,或權杖錯誤Feature off, or wrong token機能が無効、またはトークンが誤り401
權杖過期Token expiredトークンの期限切れ401 Token expired
機櫃不存在,或存在但沒開放Rack does not exist, or exists but is not sharedラックが存在しない、または存在するが公開されていない完全相同的 404(避免拿著權杖列舉機櫃)An identical 404 (so a token holder cannot enumerate racks)まったく同じ 404(トークンを持っていてもラックを列挙できないように)
都成立Both gates open両方とも満たす200 image/svg+xml
<img src="https://ipam.example.com/api/v1/racks/<rack-uuid>/embed.svg?token=<embed-token>"
     alt="Rack A01">

請用 <img> 而不是 iframe:jt-ipam 的頁面一律禁止被框進別的網站(frame-ancestors 'none')。這把權杖與 Graylog DSV 的是不同的兩把。 Use <img>, not an iframe: jt-ipam pages refuse to be framed by other sites (frame-ancestors 'none'). This token is separate from the Graylog DSV token.iframe ではなく <img> を使ってください。jt-ipam のページは他サイトへの埋め込み(フレーム)をすべて拒否します(frame-ancestors 'none')。このトークンは Graylog DSV のものとは別です。

19MCP(給 LLM 用) (for LLMs)(LLM 向け)

jt-ipam 內建 MCP(Model Context Protocol)伺服器,讓 LLM 用自然語言查 IPAM。走 JSON-RPC 2.0,有兩種傳輸方式。 jt-ipam ships an MCP (Model Context Protocol) server so an LLM can query the IPAM in natural language. It speaks JSON-RPC 2.0 over two transports.jt-ipam には MCP(Model Context Protocol)サーバーが組み込まれており、LLM が自然言語で IPAM を問い合わせられます。JSON-RPC 2.0 で、二つの通信方式があります。

Streamable HTTP(遠端用)Streamable HTTP (remote)Streamable HTTP(リモート用)

  • 網址:POST https://ipam.example.com/api/mcp(有沒有結尾斜線都可以)。/mcp 是給 direct 模式(uvicorn 自己終結 TLS)用的同一個服務;舊路徑 /api/mcp/messages 仍可用。 URL: POST https://ipam.example.com/api/mcp (with or without a trailing slash). /mcp is the same service for direct mode (uvicorn terminating TLS itself); the legacy path /api/mcp/messages still works.URL:POST https://ipam.example.com/api/mcp(末尾のスラッシュは有っても無くても可)。/mcp は direct モード(uvicorn が自ら TLS を終端)向けの同じサービスで、旧パス /api/mcp/messages も引き続き使えます。
  • 協定:支援 initialize、ping、tools/list、tools/call;協定版本 2024-11-05、2025-03-26、2025-06-18(用戶端要的版本不在其中時回 2025-03-26)。可送單筆或批次(陣列);initialize 的回應帶 Mcp-Session-Id 標頭。只有通知(沒有 id)時回 202、無內容;GET 回 405(不提供伺服器推播);DELETE 回 204。工具層的錯誤以 isError: true 的結果回傳,不是協定錯誤。參數會先檢查:不認得的參數名稱(會列出可用的參數)、格式不對的 IP、MAC、CIDR 或 UUID,都回 isError 並寫出是哪個參數、要什麼格式;數字或布林值寫成字串("5"、"true")會自動轉換。 Protocol: initialize, ping, tools/list and tools/call; protocol versions 2024-11-05, 2025-03-26 and 2025-06-18 (anything else gets 2025-03-26). Single messages and batches (arrays) are accepted; the initialize response carries an Mcp-Session-Id header. A request made only of notifications (no id) returns 202 with no body; GET returns 405 (no server push); DELETE returns 204. Tool-level errors come back as a result with isError: true, not as protocol errors. Arguments are checked first: an unknown argument name (the allowed ones are listed) or a malformed IP, MAC, CIDR or UUID returns isError naming the argument and the expected format; numbers and booleans sent as strings ("5", "true") are converted.プロトコル:initialize・ping・tools/list・tools/call に対応。プロトコルのバージョンは 2024-11-05・2025-03-26・2025-06-18(それ以外を求められた場合は 2025-03-26 を返す)。単一のメッセージもバッチ(配列)も受け付け、initialize の応答に Mcp-Session-Id ヘッダが付きます。通知(id なし)だけの場合は本文なしの 202、GET は 405(サーバーからのプッシュは無し)、DELETE は 204 です。ツール側のエラーはプロトコルエラーではなく isError: true の結果として返ります。引数は先に検査され、知らない引数名(使える引数を列挙)や形式の正しくない IP・MAC・CIDR・UUID は、どの引数でどの形式が必要かを書いた isError になります。文字列で送られた数値や真偽値("5"・"true")は自動で変換されます。
  • 認證:X-Auth-Token 或 Authorization: Bearer,可以是下面兩種之一。 Authentication: X-Auth-Token or Authorization: Bearer, with either of the two credentials below.認証:X-Auth-Token または Authorization: Bearer で、次の二種類のいずれかを使います。
「對外 MCP」開關管的是整個 HTTP MCP。admin 沒在「管理 → LLM / AI」打開之前,所有 HTTP MCP 請求一律回 403(MCP external access is disabled),連一般 jt_ 權杖也一樣,不只是 jtmcp_ 金鑰。 The "external MCP" switch gates all HTTP MCP. Until an admin turns it on under Admin → LLM / AI, every HTTP MCP request returns 403 (MCP external access is disabled), regular jt_ tokens included, not only jtmcp_ keys.「外部 MCP」のスイッチは HTTP MCP 全体を制御します。admin が「管理 → LLM / AI」で有効にするまで、HTTP MCP のリクエストはすべて 403(MCP external access is disabled)になります。jtmcp_ キーだけでなく、通常の jt_ トークンも同じです。
憑證Credential認証情報身分與能力Identity & capability身元と能力
對外 MCP 金鑰External MCP key外部 MCP キー
jtmcp_…
admin 在「管理 → LLM / AI」產生或輪替(POST /api/v1/system/llm/mcp-key/rotate),之後可用 GET /api/v1/system/llm/mcp-key 再讀出來(留稽核)。它以最後輪替它的那位 admin 的身分執行,但一律唯讀:會異動資料的工具從清單中隱藏,呼叫也會被擋下。該 admin 帳號停用後金鑰即失效。金鑰會到期:輪替時可帶 {"expires_in_days": 30~365}(預設 90),回應附 expires_at;過期的金鑰回 401,到期前通知管理員。每分鐘最多 600 次。Generated or rotated by an admin under Admin → LLM / AI (POST /api/v1/system/llm/mcp-key/rotate) and readable again later with GET /api/v1/system/llm/mcp-key (audited). It acts as the admin who last rotated it, but always read-only: mutating tools are hidden from the list and refused if called. It stops working if that admin account is deactivated. The key expires: rotation accepts {"expires_in_days": 30–365} (default 90) and the response includes expires_at; an expired key gets 401, and administrators are notified beforehand. It is limited to 600 requests a minute.admin が「管理 → LLM / AI」で生成・更新し(POST /api/v1/system/llm/mcp-key/rotate)、後から GET /api/v1/system/llm/mcp-key で再表示できます(監査に記録)。最後に更新した admin の身元で動きますが、常に読み取り専用です。変更系のツールは一覧から隠され、呼んでも拒否されます。その admin アカウントが無効になるとキーも使えなくなります。キーには期限があり、更新時に {"expires_in_days": 30~365}(既定 90)を指定でき、応答に expires_at が含まれます。期限切れのキーは 401 になり、事前に管理者へ通知します。毎分 600 回までです。
API 權杖API tokenAPI トークン
jt_…
依該權杖擁有者的權限。唯讀 scope 的權杖在 MCP 上同樣只給唯讀工具。Scoped to the token owner's permissions. A read-only token likewise gets only read-only tools over MCP.トークン所有者の権限に従います。読み取り専用スコープのトークンは、MCP でも読み取り専用のツールだけになります。
curl -X POST https://ipam.example.com/api/mcp \
  -H "X-Auth-Token: jtmcp_xxxxxxxx" -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

遠端的 Claude Desktop 等用戶端請走 HTTP,透過 mcp-remote 連線;「管理 → LLM / AI」有設定產生器,會直接產出 Claude Desktop、opencode、mcpo、Cursor/Cline/VS Code 的設定內容。 Remote clients such as Claude Desktop should use HTTP through mcp-remote; Admin → LLM / AI has a config generator that produces ready-to-paste settings for Claude Desktop, opencode, mcpo and Cursor / Cline / VS Code.リモートの Claude Desktop などのクライアントは、mcp-remote を介して HTTP で接続してください。「管理 → LLM / AI」に設定ジェネレーターがあり、Claude Desktop・opencode・mcpo・Cursor/Cline/VS Code 用の設定をそのまま出力します。

{ "mcpServers": { "jt-ipam": {
    "command": "npx",
    "args": ["-y", "mcp-remote", "https://ipam.example.com/api/mcp",
             "--header", "X-Auth-Token: jtmcp_xxxxxxxx"] } } }

stdio(只在 jt-ipam 主機上)stdio (on the jt-ipam host only)stdio(jt-ipam のホスト上のみ)

python -m app.mcp.stdio_server 直接連 jt-ipam 的資料庫,所以必須在 jt-ipam 主機上、載入 backend.env 後執行,不是裝在使用者筆電上的東西。它只接受 jt_ API 權杖(放在 JT_IPAM_MCP_TOKEN 或 JT_IPAM_API_TOKEN),不接受 jtmcp_ 金鑰,也不受「對外 MCP」開關影響。 python -m app.mcp.stdio_server connects straight to the jt-ipam database, so it must run on the jt-ipam host with backend.env loaded; it is not something to install on a user's laptop. It accepts only jt_ API tokens (in JT_IPAM_MCP_TOKEN or JT_IPAM_API_TOKEN), not jtmcp_ keys, and ignores the external MCP switch.python -m app.mcp.stdio_server は jt-ipam のデータベースに直接接続するため、jt-ipam のホスト上で backend.env を読み込んで実行する必要があります。ユーザーのノート PC に入れるものではありません。受け付けるのは jt_ の API トークン(JT_IPAM_MCP_TOKEN または JT_IPAM_API_TOKEN)だけで、jtmcp_ キーは使えず、「外部 MCP」のスイッチの影響も受けません。

cd /opt/jt-ipam/backend
set -a && . /etc/jt-ipam/backend.env && set +a
JT_IPAM_MCP_TOKEN=jt_prod_xxxxxxxx .venv/bin/python -m app.mcp.stdio_server

工具與權限Tools and permissionsツールと権限

目前有 104 個工具。完整目錄(參數與是否會異動資料的 mutating 旗標)在 GET /api/v1/ai/tools,這份目錄不依權限過濾;MCP 的 tools/list 則只列出你實際能呼叫的。每個工具都經過同一道權限閘: There are currently 104 tools. The full catalogue (parameters and a mutating flag) is at GET /api/v1/ai/tools; that catalogue is not filtered by permission, whereas MCP tools/list returns only the tools you can actually call. Every tool goes through the same permission gate:現在ツールは 104 個あります。完全な一覧(パラメータとデータを変更するかを示す mutating フラグ)は GET /api/v1/ai/tools にあり、この一覧は権限で絞り込まれません。一方 MCP の tools/list は実際に呼べるツールだけを返します。すべてのツールは同じ権限の関門を通ります。

類別Tier区分條件Requirement条件
計算、外部查詢與畫面地圖(19 個,如 calc_*、DNS、GeoIP、OUI,以及查功能或欄位在網頁哪裡的 find_ui_location)Calculators, external lookups and the UI map (19, e.g. calc_*, DNS, GeoIP, OUI, and find_ui_location, which finds where a feature or field is in the web UI)計算・外部照会・画面マップ(19 個。calc_*・DNS・GeoIP・OUI と、機能や項目が画面のどこにあるかを調べる find_ui_location など)永遠可用,連沒有任何可見範圍的帳號也可以Always allowed, even for an account with no visibility at all常に利用可。閲覧範囲がまったく無いアカウントでも使えます
逐物件資料(31 個,如 search_ip、list_subnets、get_device)Per-object data (31, e.g. search_ip, list_subnets, get_device)オブジェクト単位のデータ(31 個。search_ip・list_subnets・get_device など)要有可見範圍,結果依可見範圍過濾Needs some visibility; results are filtered to it閲覧範囲が必要で、結果はその範囲に絞られます
全域基礎設施(35 個,如 VLAN、NAT、防火牆、DNS、拓樸)Global infrastructure (35, e.g. VLAN, NAT, firewalls, DNS, topology)全体の基盤(35 個。VLAN・NAT・ファイアウォール・DNS・トポロジなど)admin 或萬用讀取授權admin or a wildcard read grantadmin またはワイルドカードの読み取り許可
管理資料唯讀(10 個:list_ai_findings、list_anomalies,以及掃描代理、憑證與派送、Wazuh 代理與缺口、OCS 電腦、RustDesk 裝置與稽核,這些資料在 REST 上也只給 admin)Admin-only reads (10: list_ai_findings, list_anomalies, plus scan agents, certificates and distribution, Wazuh agents and gaps, OCS computers, RustDesk devices and audit; the same data is admin-only over REST)管理データの参照(10 個:list_ai_findings・list_anomalies、およびスキャンエージェント、証明書と配布、Wazuh エージェントと未導入、OCS のコンピュータ、RustDesk のデバイスと監査。これらは REST でも admin 専用です)admin
會異動資料(9 個:allocate_ip、update_ip、create_subnet、create_device、approve_ip_request、reject_ip_request,以及 IP 變更評估的 impact_create_plan、impact_start_run、impact_accept_task_draft)Mutating (9: allocate_ip, update_ip, create_subnet, create_device, approve_ip_request, reject_ip_request, plus the IP change assessment tools impact_create_plan, impact_start_run and impact_accept_task_draft)データを変更(9 個:allocate_ip・update_ip・create_subnet・create_device・approve_ip_request・reject_ip_request、および IP 変更評価の impact_create_plan・impact_start_run・impact_accept_task_draft)admin,且憑證不是唯讀;核准或駁回 IP 申請另依審核政策(多關卡逐關核准、全部通過才配發,預設不能核准自己的申請)admin, with a credential that is not read-only; approving or rejecting an IP request also follows the approval policy (multi-step approval goes one step at a time and allocates only when every step is approved; approving your own request is off by default)admin で、かつ読み取り専用でない認証情報。IP 申請の承認・却下はさらに承認ポリシーに従う(多段階承認は一段ずつ、全段階が承認されて初めて割り当て。自分の申請の承認は既定で不可)

異常偵測(REST 的 POST /api/v1/anomalies/scan、GET /api/v1/anomalies/last,MCP 的 list_anomalies)依類別回傳清單。arp_flux 是同一台主機的多張網卡回應同一個 IP(從 ip_conflicts 分出來,附 host、每個 MAC 的 nic 與 fix 建議的 sysctl);l2_subnet_bleed 是兩個子網段混在同一個二層(subnets、evidence 為 arp_answer / switch_fdb、arp_examples、fdb_examples)。ip_conflicts 與 arp_flux 的每個 MAC 帶 reporters(哪台設備的 ARP 表、介面、最後一次)、reporter_count 與 suspect(corrupt:只有一個來源、查不到廠商、由另外兩個 MAC 拼成,多半是 SNMP 讀到一半;stale_cache:單一來源的本地管理位址與多來源佐證的 MAC 不一致),可疑的 MAC 照樣列出但不算機器數;ip_conflicts 另有 confidence(high / low)。list_anomalies 沒給 kind 時 items 是 {類別: [...]},指定 kind 時是該類別的陣列並回傳 kind。 Anomaly detection (REST POST /api/v1/anomalies/scan and GET /api/v1/anomalies/last, MCP list_anomalies) returns one list per category. arp_flux is one host answering an IP on several NICs (split out of ip_conflicts, with host, each MAC's nic and the suggested sysctl in fix); l2_subnet_bleed is two subnets sharing one layer 2 (subnets, evidence of arp_answer / switch_fdb, arp_examples, fdb_examples). Each MAC in ip_conflicts and arp_flux carries reporters (which device's ARP table, interface, last seen), reporter_count and suspect (corrupt: a single source, no vendor, spliced from two other MACs, usually a half-read SNMP walk; stale_cache: a single-source locally administered MAC contradicting a corroborated one); suspect MACs are listed but not counted as machines, and ip_conflicts also has confidence (high / low). Without kind, list_anomalies returns items as {category: [...]}; with kind it returns that category's array and echoes kind.異常検出(REST の POST /api/v1/anomalies/scan・GET /api/v1/anomalies/last、MCP の list_anomalies)はカテゴリごとの一覧を返します。arp_flux は同一ホストの複数 NIC が同じ IP に応答している状態です(ip_conflicts から分離。host、各 MAC の nic、推奨 sysctl の fix 付き)。l2_subnet_bleed は 2 つのサブネットが同じレイヤー 2 にある状態です(subnets、arp_answer / switch_fdb の evidence、arp_examples、fdb_examples)。ip_conflicts と arp_flux の各 MAC には reporters(どのデバイスの ARP テーブル、インターフェース、最終確認)、reporter_count、suspect(corrupt:報告元 1 つ・ベンダー不明・別の 2 つの MAC をつなぎ合わせた形で、多くは SNMP の途中読み取り。stale_cache:報告元 1 つのローカル管理アドレスが複数の報告元で一致する MAC と食い違う)が付きます。疑わしい MAC は表示しますが機器数には数えません。ip_conflicts には confidence(high / low)もあります。list_anomalies は kind 未指定なら items が {カテゴリ: [...]}、指定するとそのカテゴリの配列になり kind を返します。

沒有任何可見範圍的帳號,只拿得到第一類的計算工具與畫面地圖。 An account with no visibility at all gets only the first tier, the calculators and the UI map.閲覧範囲がまったく無いアカウントが使えるのは、最初の区分の計算ツールと画面マップだけです。

MCP 上的異動會立即執行。在網頁的 AI 對話裡,異動類工具會先停下來等使用者按確認;但走 MCP 的 tools/call 沒有確認這一步,呼叫就直接生效,事後會以 mcp_tool_exec 寫進稽核記錄。給外部代理(agent)用時,請發唯讀的 jtmcp_ 金鑰或唯讀 scope 的權杖。 Mutations over MCP execute immediately. In the web AI chat a mutating tool stops and waits for the user to confirm, but MCP tools/call has no confirmation step: the call takes effect at once and is recorded afterwards in the audit log as mcp_tool_exec. For external agents, issue the read-only jtmcp_ key or a read-only-scope token.MCP 経由の変更は即座に実行されます。Web の AI チャットでは変更系のツールは止まってユーザーの確認を待ちますが、MCP の tools/call には確認の段階がありません。呼び出すとすぐに反映され、後から監査ログに mcp_tool_exec として記録されます。外部のエージェントには、読み取り専用の jtmcp_ キーか読み取り専用スコープのトークンを渡してください。

20代理協定與健康檢查Agent protocols & health checksエージェントのプロトコルとヘルスチェック

掃描代理與憑證派送代理有自己的通道,用各自獨立的金鑰(X-Agent-Key 標頭)而不是 API 權杖。這些端點是給代理程式用的,一般整合不需要碰;代理端點與安裝腳本大多不在 OpenAPI 裡。 The scan agent and certificate-distribution agent have their own channel, authenticated by per-agent keys (the X-Agent-Key header) rather than API tokens. These endpoints are for the agents themselves; normal integrations don't need them, and most agent endpoints and installers are not in OpenAPI.スキャンエージェントと証明書配布エージェントは専用の経路を持ち、API トークンではなくエージェントごとの鍵(X-Agent-Key ヘッダ)で認証します。これらはエージェント自身のためのエンドポイントで、通常の連携で触る必要はありません。エージェント用エンドポイントとインストールスクリプトの多くは OpenAPI に載っていません。

  • 掃描代理的金鑰只存 SHA-256 雜湊,只在建立(POST /api/v1/scan-agents 回應的 enroll_key)或輪替(POST /scan-agents/{id}/rotate-key,舊金鑰立即失效)時顯示這單次,遺失就只能輪替。 Scan agent keys are stored only as a SHA-256 hash and shown this one time at creation (enroll_key in the POST /api/v1/scan-agents response) or rotation (POST /scan-agents/{id}/rotate-key; the old key stops working at once). If lost, rotate.スキャンエージェントの鍵は SHA-256 ハッシュだけを保存し、作成時(POST /api/v1/scan-agents の応答の enroll_key)または更新時(POST /scan-agents/{id}/rotate-key。旧鍵は即座に無効)の一度だけ表示されます。紛失したら更新するしかありません。
  • 憑證代理的金鑰除了雜湊,另以 AES-GCM 加密保存,admin 可以用 GET /api/v1/cert-agents/{id}/key 再讀出來(舊版建立、沒有存加密副本的回 404)。 Cert agent keys are stored as a hash plus an AES-GCM-encrypted copy, so an admin can read one again with GET /api/v1/cert-agents/{id}/key (agents created by older versions without a stored copy return 404).証明書エージェントの鍵はハッシュに加えて AES-GCM で暗号化した写しも保存しており、admin は GET /api/v1/cert-agents/{id}/key で再表示できます(写しを保存していない旧版で作成したものは 404)。

掃描代理Scan agentスキャンエージェント

路徑Pathパス用途Purpose用途
GET /api/v1/scan-agents/agent.py
GET /api/v1/scan-agents/installer.sh
代理程式本體與安裝腳本,公開可取、不含密鑰。安裝設定走環境變數(JT_IPAM_URL、JT_IPAM_AGENT_KEY 等)The agent and its installer; public, no secrets inside. The installer is configured through environment variables (JT_IPAM_URL, JT_IPAM_AGENT_KEY, …)エージェント本体とインストールスクリプト。公開されており秘密情報は含みません。インストールの設定は環境変数(JT_IPAM_URL・JT_IPAM_AGENT_KEY など)で行います
GET /api/v1/scan-agents/poll代理取得工作。請求標頭:X-Agent-Version、X-Agent-Probes(逗號分隔、實際跑得起來的探測)、X-Agent-Tools(名稱|1或0|版本,以 ; 分隔)。回應:subnets[](subnet_id、cidr、probes;需要時另有 plan:{"mode":"targets","known":[[起,迄],…],"discover":{"per_cycle":1024}|null},已知位址每輪掃、其餘每輪探索 per_cycle 個,代理 1.18.0 起;沒有 plan=照舊全掃)、interval_seconds、intervals(各探測的秒數)、ip_overrides(個別 IP 排除的探測)、agent_sha(伺服器上 agent.py 的 SHA-256,不同時代理自我更新)、force_scan(「立即掃描」旗標,取用一次即清除)、dhcpd(指派的 ISC 來源,或 null)、snmp(代理 1.19.0 起:指派給這台代理的 SNMP 收集目標,每筆 {target_id, ip, port, sections:{"arp":300,…}, credential:{credential_id, version, timeout_s, retries, community 或 username, security_level, auth_protocol, auth_passphrase, priv_protocol, priv_passphrase}},憑證已解密、只給被指派的代理;代理沒有 SNMP 能力時是空陣列)、snmp_budget(target_seconds、walk_seconds、max_rows、max_repetitions、pause_ms、max_vlans,代理端會再夾一次上限)The agent fetches its work. Request headers: X-Agent-Version, X-Agent-Probes (comma-separated probes it can actually run), X-Agent-Tools (name|1or0|version joined by ;). Response: subnets[] (subnet_id, cidr, probes, and when needed plan: {"mode":"targets","known":[[start,end],…],"discover":{"per_cycle":1024}|null}, meaning scan the known addresses every cycle and explore per_cycle others; agent 1.18.0 or later; no plan means sweep as before), interval_seconds, intervals (seconds per probe), ip_overrides (probes excluded for specific IPs), agent_sha (SHA-256 of the server's agent.py; the agent self-updates when it differs), force_scan (the "scan now" flag, cleared once delivered), dhcpd (the assigned ISC source, or null), snmp (agent 1.19.0 or later: the SNMP collection targets assigned to this agent, each {target_id, ip, port, sections:{"arp":300,…}, credential:{credential_id, version, timeout_s, retries, community or username, security_level, auth_protocol, auth_passphrase, priv_protocol, priv_passphrase}}, credentials decrypted and sent only to the assigned agent; an empty array when the agent cannot do SNMP), snmp_budget (target_seconds, walk_seconds, max_rows, max_repetitions, pause_ms, max_vlans; the agent clamps them again)エージェントが仕事を取得します。リクエストヘッダ:X-Agent-Version、X-Agent-Probes(実際に実行できるプローブをカンマ区切り)、X-Agent-Tools(名前|1または0|バージョン を ; で連結)。応答:subnets[](subnet_id・cidr・probes。必要なときは plan:{"mode":"targets","known":[[開始,終了],…],"discover":{"per_cycle":1024}|null}。既知のアドレスを毎周スキャンし、残りを毎周 per_cycle 個探索。エージェント 1.18.0 以降。plan がなければ従来どおり全スキャン)、interval_seconds、intervals(プローブごとの秒数)、ip_overrides(特定 IP で除外するプローブ)、agent_sha(サーバー上の agent.py の SHA-256。異なればエージェントが自己更新)、force_scan(「今すぐスキャン」のフラグ。一度渡すと消える)、dhcpd(割り当てられた ISC ソース、または null)、snmp(エージェント 1.19.0 以降:このエージェントに割り当てられた SNMP 収集対象。各 {target_id, ip, port, sections:{"arp":300,…}, credential:{credential_id, version, timeout_s, retries, community または username, security_level, auth_protocol, auth_passphrase, priv_protocol, priv_passphrase}}。認証情報は復号済みで、割り当てられたエージェントにだけ渡します。SNMP ができないエージェントでは空の配列)、snmp_budget(target_seconds・walk_seconds・max_rows・max_repetitions・pause_ms・max_vlans。エージェント側でも上限をかけ直します)
POST /api/v1/scan-agents/report回報結果,只在指派給這台代理的子網路內比對(沒有指派任何子網路的代理不會更新任何 IP,回應的 skipped_no_subnet 寫出略過幾筆)。results[](最多 100,000 筆)每筆有 ip(必填)、alive(false 的筆會被忽略)、mac、rdns、netbios、mdns、os_guess、nmap(代理 1.14.0 起:定期 OS 偵測的結構化結果,伺服器用 IP 探測同一套判讀推出 OS、設備類型與型號;超過 64 KB 就略過、只用 os_guess)、open_ports(目前收下但不儲存)、probes_run、liveness。liveness: false 表示這是背景重量探測的結果:會更新 MAC、作業系統與名稱,但不算存活證據,不會把位址標成上線,也不會新建 IP。另有 dhcp_servers[](最多 500 筆,偵測到的 DHCP 伺服器)與 cycle(本輪耗時與各子網路統計,保留 7 天供負載面板使用)Reports results, matched only within the subnets assigned to this agent (an agent with no assigned subnets updates no IP, and skipped_no_subnet in the response says how many were skipped). results[] (up to 100,000) each carry ip (required), alive (items with false are ignored), mac, rdns, netbios, mdns, os_guess, nmap (agent 1.14.0+: structured result of the periodic OS probe; the server judges OS, device type and model with the same logic as the IP probe; over 64 KB it is ignored and only os_guess is used), open_ports (accepted but currently not stored), probes_run and liveness. liveness: false marks a result from a background heavy probe: it updates MAC, OS and names but is not liveness evidence: it does not mark the address online and does not create new IPs. Also dhcp_servers[] (up to 500 detected DHCP servers) and cycle (the cycle's timing and per-subnet stats, kept 7 days for the load panel)結果を報告します。照合はこのエージェントに割り当てられたサブネット内だけで行います(サブネットが割り当てられていないエージェントはどの IP も更新せず、応答の skipped_no_subnet にスキップした件数が入ります)。results[](最大 100,000 件)の各要素は ip(必須)、alive(false の要素は無視)、mac、rdns、netbios、mdns、os_guess、nmap(エージェント 1.14.0 以降:定期 OS 検出の構造化結果。サーバーが IP プローブと同じ判定で OS・機器タイプ・型番を推定。64 KB を超えると無視して os_guess だけを使う)、open_ports(受け取るが現状は保存しない)、probes_run、liveness を持ちます。liveness: false はバックグラウンドの重いプローブの結果を示し、MAC・OS・名前は更新しますが生存の証拠にはならず、アドレスをオンラインにせず、新しい IP も作りません。ほかに dhcp_servers[](検出した DHCP サーバー、最大 500 件)と cycle(その周期の所要時間とサブネットごとの統計。負荷パネル用に 7 日間保持)
POST /api/v1/scan-agents/dhcpd-reportISC DHCP:代理送出解析後的 pools(最多 5,000)、reservations(最多 20,000)、leases(最多 50,000)與檔案讀取狀態,不送原始檔案。來源沒有指派給這個代理時回 404ISC DHCP: the agent sends parsed pools (up to 5,000), reservations (up to 20,000), leases (up to 50,000) and file status, never the raw files. Returns 404 if the source is not assigned to this agentISC DHCP:エージェントが解析済みの pools(最大 5,000)、reservations(最大 20,000)、leases(最大 50,000)とファイルの読み取り状態を送ります。元のファイルは送りません。ソースがこのエージェントに割り当てられていなければ 404
POST /api/v1/scan-agents/snmp-reportSNMP 收集結果(代理 1.19.0 起),只有解析後的列,不送設備的原始輸出:target_id、選用 job_id(立即收集)、credential_id、elapsed_ms、system(sys_name、sys_descr、sys_object_id、sys_uptime)、整台讀不到時的 error/error_code,以及 sections:逐區段 {status, error, elapsed_ms, truncated, rows},status 是 ok、partial、error 或 absent。arp.rows 是 [ip, mac, ifIndex, state, type](state 只有 ipNetToPhysicalTable 有,1=reachable)、fdb.rows 是 [mac, 埠名, vlan]、interfaces.rows 是 {if_index, name, descr, alias, type, mac, admin, oper},另有 interfaces.addresses {ip, if_index}、neighbors.rows 是 {protocol, local_port, remote_sysname, remote_port, remote_chassis_id, remote_mac, remote_mgmt_address, remote_platform};每個區段最多 200,000 列。比對與寫入全在伺服器,只有 ok/absent 才清舊資料。回 {"status":"ok","result":…,"sections":{…}};目標目前不是由這台代理收集(或不存在)回 404,停用的目標回 {"status":"disabled"}。資料太大時代理會逐區段分開送SNMP collection results (agent 1.19.0 or later), parsed rows only, never the device's raw output: target_id, optional job_id (collect now), credential_id, elapsed_ms, system (sys_name, sys_descr, sys_object_id, sys_uptime), error/error_code when the device could not be read at all, and sections, each {status, error, elapsed_ms, truncated, rows} with status one of ok, partial, error or absent. arp.rows are [ip, mac, ifIndex, state, type] (state only from ipNetToPhysicalTable, 1 = reachable), fdb.rows are [mac, port name, vlan], interfaces.rows are {if_index, name, descr, alias, type, mac, admin, oper} with interfaces.addresses as {ip, if_index}, and neighbors.rows are {protocol, local_port, remote_sysname, remote_port, remote_chassis_id, remote_mac, remote_mgmt_address, remote_platform}; at most 200,000 rows per section. All matching and writing happens on the server, and old data is cleared only for ok/absent. Returns {"status":"ok","result":…,"sections":{…}}; 404 when this agent does not currently collect the target (or it does not exist), {"status":"disabled"} for a disabled target. When the data is large the agent sends one section per requestSNMP の収集結果(エージェント 1.19.0 以降)。解析済みの行だけを送り、機器の生の出力は送りません:target_id、任意の job_id(今すぐ収集)、credential_id、elapsed_ms、system(sys_name・sys_descr・sys_object_id・sys_uptime)、機器をまったく読めなかったときの error/error_code、そして区分ごとの sections:{status, error, elapsed_ms, truncated, rows}(status は ok・partial・error・absent のいずれか)。arp.rows は [ip, mac, ifIndex, state, type](state は ipNetToPhysicalTable のみ、1=reachable)、fdb.rows は [mac, ポート名, vlan]、interfaces.rows は {if_index, name, descr, alias, type, mac, admin, oper} で interfaces.addresses は {ip, if_index}、neighbors.rows は {protocol, local_port, remote_sysname, remote_port, remote_chassis_id, remote_mac, remote_mgmt_address, remote_platform}。区分ごとに最大 200,000 行。照合と書き込みはすべてサーバーで行い、古いデータを消すのは ok/absent のときだけです。{"status":"ok","result":…,"sections":{…}} を返し、この対象を現在このエージェントが収集していない(または存在しない)場合は 404、無効な対象は {"status":"disabled"}。データが大きいときエージェントは区分ごとに分けて送ります
GET /api/v1/scan-agents/jobs?wait=0..25長輪詢取探測工作(最多等 25 秒,預設 0),一次最多領 5 件 {id, kind, params};kind 為 ping、tcp、traceroute、rdns、identify,以及 SNMP 的 snmp_test(params:target_id、ip、port、sections、credentials[](最多 5 組)、budget)與 snmp_collect(同上但只有一組 credential;收集結果走 snmp-report 並帶 job_id)。SNMP 工作的憑證只在這裡展開,資料庫的工作記錄只存 idLong-poll for probe jobs (wait up to 25 s, default 0), claiming at most 5 at a time as {id, kind, params}; kind is ping, tcp, traceroute, rdns or identify, plus the SNMP kinds snmp_test (params: target_id, ip, port, sections, credentials[] (up to 5), budget) and snmp_collect (the same with a single credential; the collected data goes to snmp-report with job_id). Credentials of SNMP jobs are expanded only here; the job record in the database holds only idsプローブのジョブをロングポーリングで取得(最大 25 秒待機、既定 0)。1 回に最大 5 件を {id, kind, params} で受け取ります。kind は ping・tcp・traceroute・rdns・identify、および SNMP の snmp_test(params:target_id・ip・port・sections・credentials[](最大 5 つ)・budget)と snmp_collect(同じく、ただし credential は 1 つ。収集結果は job_id を付けて snmp-report で送る)。SNMP ジョブの認証情報はここでだけ展開し、データベースのジョブ記録には id だけを保存します
POST …/scan-agents/jobs/{id}/progress
POST …/scan-agents/jobs/{id}/result
回報進度 {"progress":{…}}(序列化後最多 8,192 字元,超過回 413)與最終結果 {"result":…,"error":…}Report progress {"progress":{…}} (at most 8,192 characters once serialised, otherwise 413) and the final result {"result":…,"error":…}進捗 {"progress":{…}}(シリアライズ後最大 8,192 文字。超えると 413)と最終結果 {"result":…,"error":…} を報告

管理端(admin):POST /api/v1/scan-agents 建立、PATCH/DELETE /scan-agents/{id}、POST /scan-agents/{id}/rotate-key、POST /scan-agents/{id}/scan-now(202,下一次 poll 帶 force_scan)、GET/PUT /scan-agents/{id}/subnets({"subnet_ids":[…]},PUT 整組取代)、GET /scan-agents/{id}/load(最近一輪、負載評估 ok/busy/overloaded 與歷史)。GET /scan-agents/probes 列出探測目錄,任何登入帳號都能讀。 Admin side: POST /api/v1/scan-agents to create, PATCH/DELETE /scan-agents/{id}, POST /scan-agents/{id}/rotate-key, POST /scan-agents/{id}/scan-now (202; the next poll carries force_scan), GET/PUT /scan-agents/{id}/subnets ({"subnet_ids":[…]}; PUT replaces the whole set), GET /scan-agents/{id}/load (last cycle, load evaluation ok / busy / overloaded, and history). GET /scan-agents/probes lists the probe catalogue and is readable by any signed-in account.管理側(admin):POST /api/v1/scan-agents で作成、PATCH/DELETE /scan-agents/{id}、POST /scan-agents/{id}/rotate-key、POST /scan-agents/{id}/scan-now(202。次の poll に force_scan が付く)、GET/PUT /scan-agents/{id}/subnets({"subnet_ids":[…]}。PUT は全体を置き換え)、GET /scan-agents/{id}/load(直近の周期、負荷評価 ok/busy/overloaded、履歴)。GET /scan-agents/probes はプローブの一覧で、ログイン済みの任意のアカウントが読めます。

RustDesk 代理RustDesk agentRustDesk エージェント

路徑Pathパス用途Purpose用途
GET /api/v1/rustdesk/agent/agent.py
GET /api/v1/rustdesk/agent/installer.sh
專用 RustDesk 代理的程式與安裝腳本,公開可取、不含密鑰。在 RustDesk 主機上以 JT_IPAM_URL、JT_IPAM_AGENT_KEY(這台伺服器的金鑰)執行;選用 JT_IPAM_INSECURE=1、JT_IPAM_RUSTDESK_DIR、JT_IPAM_UNINSTALL=1。服務 jt-ipam-rustdesk-agent 以 hbbs 工作目錄的擁有者身分執行,那個目錄唯讀掛載。--allow-delete(或 JT_RD_ALLOW_DELETE=1)讓那個目錄對代理可寫(刪除舊註冊用;SQLite 要在旁邊建立日誌檔),私鑰檔 id_ed25519 對代理完全不可見,其餘加固照舊;不帶時維持唯讀,不帶旗標重新執行就變回唯讀。重新執行時沒給的 JT_IPAM_URL、JT_IPAM_AGENT_KEY、JT_IPAM_INSECURE、JT_IPAM_RUSTDESK_DIR 沿用既有設定檔The dedicated RustDesk agent and its installer; public, no secrets inside. Run on the RustDesk host with JT_IPAM_URL and JT_IPAM_AGENT_KEY (that server's key); optional JT_IPAM_INSECURE=1, JT_IPAM_RUSTDESK_DIR, JT_IPAM_UNINSTALL=1. The jt-ipam-rustdesk-agent service runs as the owner of the hbbs working directory, which it mounts read-only. --allow-delete (or JT_RD_ALLOW_DELETE=1) makes that directory writable for the agent (for deleting old registrations; SQLite needs to create its journal there) with the private key file id_ed25519 made inaccessible and all other hardening kept; without it the directory stays read-only, and re-running without the flag makes it read-only again. On a re-run, JT_IPAM_URL, JT_IPAM_AGENT_KEY, JT_IPAM_INSECURE and JT_IPAM_RUSTDESK_DIR that are not given are kept from the existing config専用 RustDesk エージェント本体とインストールスクリプト。公開されており秘密情報は含みません。RustDesk ホストで JT_IPAM_URL と JT_IPAM_AGENT_KEY(そのサーバーのキー)を付けて実行します。任意で JT_IPAM_INSECURE=1・JT_IPAM_RUSTDESK_DIR・JT_IPAM_UNINSTALL=1。サービス jt-ipam-rustdesk-agent は hbbs 作業ディレクトリの所有者として実行され、そのディレクトリを読み取り専用でマウントします。--allow-delete(または JT_RD_ALLOW_DELETE=1)を付けると、そのディレクトリがエージェントから書き込み可能になり(古い登録の削除用。SQLite が隣にジャーナルを作るため)、秘密鍵ファイル id_ed25519 はエージェントから一切見えなくなります。ほかの強化設定はそのままです。付けなければ読み取り専用のままで、フラグなしで再実行すると読み取り専用に戻ります。再実行時に指定しなかった JT_IPAM_URL・JT_IPAM_AGENT_KEY・JT_IPAM_INSECURE・JT_IPAM_RUSTDESK_DIR は既存の設定ファイルの値を使います
POST /api/v1/rustdesk/agent/poll每 10 秒一次。請求:version、hostname、data_dir、receiver(listening、port、error),1.1.0 起另有 key_checks(上次輪詢之後 hbbr/hbbs 日誌裡的 Key 檢查,依 IP 彙總、不含日誌原文:fails[] 為 scope、ip、n、first、last、target,ok[] 為通過中繼的 ip、last,logs 為讀取狀態);只在那個 IP 唯一的裝置上記錄。回應:source_id、enabled、interval_seconds、api_listen、api_port、report_now(「立即同步」,取用一次即清除)、test_id(待做的測試,結果送到前每次都帶)、agent_sha(不同時代理自我更新)、poll_seconds。1.2.0 起請求另有 capabilities(delete:寫不寫得了 hbbs 的資料庫,delete_reason:寫不了的原因),回應另有 peer_deletes(等待中的刪除舊註冊,每次最多 200 筆 req_id、rustdesk_id;只有允許刪除舊註冊、伺服器啟用時才有,結果送到前每次都帶)。金鑰錯或伺服器已刪除回 401Every 10 seconds. Request: version, hostname, data_dir, receiver (listening, port, error), and from 1.1.0 key_checks (Key checks from the hbbr/hbbs logs since the last poll, summed per IP, no log text: fails[] with scope, ip, n, first, last, target; ok[] with the ip and last time it passed the relay; logs with the read state); recorded only on the one device at that IP. Response: source_id, enabled, interval_seconds, api_listen, api_port, report_now ("sync now", cleared once delivered), test_id (a pending test, repeated until its result arrives), agent_sha (the agent self-updates when it differs), poll_seconds. From 1.2.0 the request also carries capabilities (delete: whether the agent can write the hbbs database; delete_reason: why not) and the response peer_deletes (waiting old-registration deletions, up to 200 per poll with req_id and rustdesk_id; only while deleting is allowed and the server is enabled, repeated until the result arrives). A wrong key or a deleted server gives 40110 秒ごと。リクエスト:version・hostname・data_dir・receiver(listening・port・error)。1.1.0 以降は key_checks(前回のポーリング以降の hbbr/hbbs ログの Key チェック。IP ごとに集計し、ログ本文は含まない:fails[] は scope・ip・n・first・last・target、ok[] は中継を通った ip と last、logs は読み取り状態)も。その IP に一意のデバイスにだけ記録します。応答:source_id・enabled・interval_seconds・api_listen・api_port・report_now(「今すぐ同期」。一度渡すと消える)・test_id(未実施のテスト。結果が届くまで毎回付く)・agent_sha(異なればエージェントが自己更新)・poll_seconds。1.2.0 以降はリクエストに capabilities(delete:hbbs のデータベースに書き込めるか、delete_reason:書き込めない理由)、応答に peer_deletes(待機中の古い登録の削除。1 回に最大 200 件の req_id・rustdesk_id。削除が許可されサーバーが有効なときだけ。結果が届くまで毎回付く)も含まれます。キーが違うかサーバーが削除済みなら 401
POST /api/v1/rustdesk/agent/reportRustDesk Server(開源版):source_id、version、public_key、files.db(path、ok、error、truncated)、online_ok、online_error、peers[](最多 50,000 筆:id、created_at、ip、online)。資料庫讀不到(ok: false)時不清掉既有裝置;truncated 時不刪除;查不到線上狀態時保留上一次的。source_id 不是金鑰所屬的伺服器時回 409RustDesk Server (open source): source_id, version, public_key, files.db (path, ok, error, truncated), online_ok, online_error, peers[] (up to 50,000: id, created_at, ip, online). An unreadable database (ok: false) does not clear existing devices, truncated deletes nothing, and a failed online query keeps the previous state. Returns 409 if source_id is not the key's own serverRustDesk Server(オープンソース版):source_id・version・public_key・files.db(path・ok・error・truncated)・online_ok・online_error・peers[](最大 50,000 件:id・created_at・ip・online)。データベースが読めない(ok: false)ときは既存のデバイスを消さず、truncated のときは削除せず、オンライン状態が取れないときは前回の値を保ちます。source_id がキーのサーバーでなければ 409
POST /api/v1/rustdesk/agent/eventsRustDesk 客戶端回報:source_id、dropped(代理丟掉的筆數,依原因)、events[](最多 5,000 筆;kind 為 heartbeat、sysinfo、conn、note、file、alarm)。事件逐筆驗證,格式不合的那筆跳過並計入 rejected,不會讓整批被拒。稽核以 nonce 去重。source_id 不是金鑰所屬的伺服器時回 409,關掉「接收客戶端回報」時回 {"status":"disabled"}RustDesk client reports: source_id, dropped (what the agent discarded, by reason), events[] (up to 5,000; kind is heartbeat, sysinfo, conn, note, file or alarm). Events are validated one by one: a malformed one is skipped and counted in rejected instead of failing the batch. Audit records are deduplicated by nonce. Returns 409 if source_id is not the key's own server and {"status":"disabled"} when client reports are switched offRustDesk クライアントの報告:source_id・dropped(エージェントが破棄した件数、理由別)・events[](最大 5,000 件。kind は heartbeat・sysinfo・conn・note・file・alarm)。イベントは 1 件ずつ検証し、形式の合わない 1 件は飛ばして rejected に数え、一括で拒否はしません。監査は nonce で重複を除きます。source_id がキーのサーバーでなければ 409、クライアント報告の受信がオフなら {"status":"disabled"}
POST /api/v1/rustdesk/agent/test-result測試結果:test_id、checks[](最多 20 項:key 為 data_dir、database、public_key、hbbs_version、online_query、peer_delete、logs、receiver,另有 ok、detail;peer_delete 在沒開刪除舊註冊時是 ok 且 detail 為 read-only (delete not enabled))。不是目前這一次的測試回 {"status":"stale"}Test results: test_id, checks[] (up to 20; key is data_dir, database, public_key, hbbs_version, online_query, peer_delete, logs or receiver, plus ok and detail; peer_delete is ok with detail read-only (delete not enabled) when deleting old registrations is not enabled). Results for an older test return {"status":"stale"}テスト結果:test_id・checks[](最大 20 項目。key は data_dir・database・public_key・hbbs_version・online_query・peer_delete・logs・receiver、ほかに ok・detail。古い登録の削除が無効なとき peer_delete は ok で detail は read-only (delete not enabled))。現在のテストでなければ {"status":"stale"}
POST /api/v1/rustdesk/agent/delete-result刪除舊註冊的結果(1.2.0 起):source_id、results[](最多 500 筆:req_id、status 為 deleted、skipped_online、not_found、failed,以及 detail)。代理刪之前用 OnlineRequest 再查一次線上狀態,上線中的回 skipped_online;只在同一個交易裡刪 peer 表中 ID 相符的列。jt-ipam 只認這台伺服器還在等待的請求,其餘計入 stale;deleted 的裝置一併從清單刪掉、留稽核 rustdesk.peer_deleted,並讓下一次輪詢帶 report_now。source_id 不是金鑰所屬的伺服器時回 409Results of deleting old registrations (from 1.2.0): source_id, results[] (up to 500: req_id, status of deleted, skipped_online, not_found or failed, and detail). Right before deleting, the agent checks the online state again with OnlineRequest and answers skipped_online for online devices; it deletes only rows of the peer table with a matching ID, in one transaction. jt-ipam accepts only requests of this server that are still waiting and counts the rest as stale; deleted devices are also removed from the list, audited as rustdesk.peer_deleted, and the next poll carries report_now. Returns 409 if source_id is not the key's own server古い登録の削除の結果(1.2.0 以降):source_id・results[](最大 500 件:req_id、status は deleted・skipped_online・not_found・failed、ほかに detail)。エージェントは削除の直前に OnlineRequest でオンライン状態をもう一度確認し、オンラインのデバイスには skipped_online を返します。削除するのは peer テーブルで ID が一致する行だけで、1 つのトランザクションで行います。jt-ipam はこのサーバーの待機中の依頼だけを受け付け、それ以外は stale に数えます。deleted のデバイスは一覧からも削除し、rustdesk.peer_deleted として監査し、次のポーリングに report_now を付けます。source_id がキーのサーバーでなければ 409

憑證派送代理Certificate agent証明書配布エージェント

路徑Pathパス用途Purpose用途
GET /api/v1/cert-agents/check比對指紋與到期日。format=json(預設)回 {"certificates":[{cert, cert_id, fingerprint, not_after, domains}], "agent_sha", "agent_ps1_sha"};format=text 第一行是 agent_sha=…,之後每行 名稱\t指紋\t到期日。只列這個代理範圍內、有現行版本的憑證Compare fingerprints and expiry. format=json (default) returns {"certificates":[{cert, cert_id, fingerprint, not_after, domains}], "agent_sha", "agent_ps1_sha"}; format=text starts with an agent_sha=… line followed by name\tfingerprint\tnot_after lines. Only certificates in the agent's scope that have a current version are listedフィンガープリントと有効期限の照合。format=json(既定)は {"certificates":[{cert, cert_id, fingerprint, not_after, domains}], "agent_sha", "agent_ps1_sha"}、format=text は 1 行目が agent_sha=…、以降は 名前\tフィンガープリント\t有効期限 の行です。エージェントの範囲内で現行バージョンのある証明書だけを返します
GET /api/v1/cert-agents/bundle?cert=…JSON {cert, fingerprint, not_after, cert_pem, chain_pem, key_pem},含私鑰。cert 是名稱或 UUIDJSON {cert, fingerprint, not_after, cert_pem, chain_pem, key_pem}, including the private key. cert is a name or UUIDJSON {cert, fingerprint, not_after, cert_pem, chain_pem, key_pem}。秘密鍵を含みます。cert は名前または UUID
GET /api/v1/cert-agents/bundle/raw?cert=…&part=…單一部分:cert、key、chain、fullchain(預設)、combined、pkcs12。回應標頭 X-Cert-Fingerprint、X-Cert-Not-AfterOne part: cert, key, chain, fullchain (default), combined, pkcs12. Response headers X-Cert-Fingerprint and X-Cert-Not-After1 つの部分:cert・key・chain・fullchain(既定)・combined・pkcs12。応答ヘッダ X-Cert-Fingerprint・X-Cert-Not-After
POST /api/v1/cert-agents/report回報派送結果,JSON {"deployments":[{cert, profile, fingerprint, not_after, applied_at, status, message, dry_run}]} 或 TSV(每行 cert\tprofile\tstatus\tfingerprint\tnot_after\tdry_run\tmessage),最多 200 列;每次回報取代上一次Report deployments as JSON {"deployments":[{cert, profile, fingerprint, not_after, applied_at, status, message, dry_run}]} or TSV (one cert\tprofile\tstatus\tfingerprint\tnot_after\tdry_run\tmessage per line), up to 200 rows; each report replaces the previous one配備結果の報告。JSON {"deployments":[{cert, profile, fingerprint, not_after, applied_at, status, message, dry_run}]} または TSV(1 行に cert\tprofile\tstatus\tfingerprint\tnot_after\tdry_run\tmessage)、最大 200 行。報告のたびに前回分を置き換えます
GET /api/v1/cert-agents/agent.sh · agent.ps1
GET /api/v1/cert-agents/installer.sh · installer.ps1
代理程式本體與安裝腳本(Linux/Windows),公開可取、不含密鑰;代理依 check 回的 SHA 自我更新The agents and their installers (Linux / Windows); public, no secrets inside. Agents self-update using the SHA values from checkエージェント本体とインストールスクリプト(Linux/Windows)。公開されており秘密情報は含みません。エージェントは check が返す SHA を使って自己更新します

範圍外與不存在的憑證回同樣的 404。bundle/raw?part=pkcs12 可帶 X-Pfx-Password 標頭:帶了就回以該密碼加密、且 Windows 匯得進去的 PKCS#12(PBESv1-SHA1-3DES),PBESv1 是 Windows CryptoAPI 全版本都吃的形式;函式庫預設的 PBESv2/AES-256 失敗時訊息是誤導的「密碼不正確」。不帶標頭時回的 PKCS#12 沒有加密。Windows 代理每次執行自產一組隨機密碼且只留在記憶體,私鑰不會為了匯入而寫到磁碟。 Certificates outside the agent's scope and missing ones return the same 404. bundle/raw?part=pkcs12 accepts an X-Pfx-Password header. With it you get a PKCS#12 encrypted with that password using the encryption Windows can actually import (PBESv1-SHA1-3DES): PBESv1 is the form every version of the Windows CryptoAPI accepts; the library default, PBESv2/AES-256, fails with a misleading "the password is incorrect". Without the header the PKCS#12 is unencrypted. The Windows agent generates a random password per run and keeps it in memory, so the private key is never written to disk on the way in.範囲外の証明書と存在しない証明書は同じ 404 を返します。bundle/raw?part=pkcs12 は X-Pfx-Password ヘッダを受け付けます。付けると、そのパスワードで暗号化されかつ Windows が実際に取り込める PKCS#12(PBESv1-SHA1-3DES)が返ります。PBESv1 はどのバージョンの Windows CryptoAPI でも受け付ける形式です。ライブラリの既定である PBESv2/AES-256 は、失敗したときに「パスワードが正しくありません」という誤解を招くメッセージになります。ヘッダを付けない場合、PKCS#12 は暗号化されません。Windows エージェントは実行のたびにランダムなパスワードを生成してメモリ上にだけ保持するため、取り込みのために秘密鍵がディスクへ書き出されることはありません。

憑證代理的取檔端點會即時解密並回傳私鑰,每次取檔都寫稽核(cert_bundle_download)。那把 X-Agent-Key 等同於它範圍內所有憑證的私鑰,請當成最高敏感憑證保管。jt-ipam 整體只走 HTTPS,但代理程式本身不會拒絕 http:// 網址,安裝時請確認 JT_IPAM_URL 是 https://。 The certificate bundle endpoints decrypt and return private keys, and every fetch is audited (cert_bundle_download). That X-Agent-Key is equivalent to the private keys of every certificate in its scope; treat it as a top-tier secret. jt-ipam as a whole serves only HTTPS, but the agents themselves do not refuse an http:// URL, so make sure JT_IPAM_URL is https:// when installing.証明書の取得エンドポイントはその場で復号して秘密鍵を返し、取得のたびに監査に記録します(cert_bundle_download)。その X-Agent-Key は、範囲内のすべての証明書の秘密鍵と同等です。最高機密として扱ってください。jt-ipam 全体は HTTPS のみですが、エージェント自身は http:// の URL を拒否しないため、インストール時に JT_IPAM_URL が https:// であることを確認してください。

健康檢查Health checksヘルスチェック

兩支都不需認證,位在根路徑(不在 /api/v1 底下),也不在 OpenAPI 裡: Both need no authentication, live at the root (not under /api/v1) and are not in OpenAPI:どちらも認証不要で、ルートにあり(/api/v1 配下ではない)、OpenAPI にも載っていません。

路徑Pathパス行為Behaviour動作
GET /healthz存活檢查。nginx 模式下由 nginx 直接回靜態的 ok,根本不會碰到後端,所以只能證明 nginx 活著;direct 模式由後端回 {"status":"ok"}Liveness. In nginx mode nginx answers with a static ok without touching the backend, so it only proves nginx is up; in direct mode the backend returns {"status":"ok"}生存確認。nginx モードでは nginx が静的な ok を直接返し、バックエンドには届かないため、nginx が動いていることしか分かりません。direct モードではバックエンドが {"status":"ok"} を返します
GET /readyz就緒檢查,轉給後端:檢查資料庫(SELECT 1)與 Redis(ping)。正常回 200 {"status":"ready"};任一不通回 503(db_unavailable 或 redis_unavailable)。監控請用這一支。Readiness, proxied to the backend: checks the database (SELECT 1) and Redis (ping). Returns 200 {"status":"ready"}, or 503 (db_unavailable or redis_unavailable) if either is down. Monitor this one.準備確認。バックエンドへ転送され、データベース(SELECT 1)と Redis(ping)を確認します。正常なら 200 {"status":"ready"}、どちらかに到達できなければ 503(db_unavailable または redis_unavailable)です。監視にはこちらを使ってください。

21速率限制與 CORSRate limits & CORSレート制限と CORS

限流分兩層:nginx(只在 nginx 模式)與後端(Redis 滑動視窗)。下表是隨附設定的預設值。超過一律回 429,並帶 Retry-After:後端是視窗長度(一般 60 秒、登入失敗鎖定 900 秒),nginx 那一層固定 60 秒。2026-10-01 以前 nginx 層的 429 不帶這個標頭,升級時會自動補上。 Rate limiting has two layers: nginx (nginx mode only) and the backend (a Redis sliding window). The table shows the shipped defaults. Exceeding any of them returns 429 with Retry-After: the window length from the backend (usually 60 seconds, 900 seconds for the failed-login lockout) and a fixed 60 seconds from the nginx layer. Before 2026-10-01 the nginx layer's 429 lacked the header; upgrading adds it.レート制限は二層です。nginx(nginx モードのみ)とバックエンド(Redis のスライディングウィンドウ)です。下表は同梱設定の既定値です。超過するといずれも 429 と Retry-After を返します。バックエンドはウィンドウの長さ(通常 60 秒、ログイン失敗によるロックは 900 秒)、nginx 層は固定の 60 秒です。2026-10-01 より前は nginx 層の 429 にこのヘッダが無く、アップグレード時に自動で追加されます。

層Layer層適用範圍Applies to対象限制Limit制限計算單位Keyed by単位
nginx zone=api443 埠上所有 /api/(含 REST、MCP、phpIPAM),以及 8088 埠的 /api/v1/lookup/Everything under /api/ on port 443 (REST, MCP, phpIPAM), plus /api/v1/lookup/ on port 8088443 番ポートの /api/ 配下すべて(REST・MCP・phpIPAM)と、8088 番ポートの /api/v1/lookup/每分鐘 1200 次,突發 801200/min, burst 80毎分 1200 回、バースト 80來源 IPSource IP送信元 IP
nginx zone=login/api/phpipam/<app_id>/user/(Basic Auth 登入,以及對 user/ 的其他呼叫)/api/phpipam/<app_id>/user/ (Basic-Auth login and every other call to user/)/api/phpipam/<app_id>/user/(Basic 認証のログインと user/ へのその他の呼び出し)每分鐘 10 次,突發 510/min, burst 5毎分 10 回、バースト 5來源 IPSource IP送信元 IP
後端 authBackend authバックエンド authPOST /api/v1/auth/login · /auth/mfa/verify · /auth/mfa/setup/* · /auth/refresh每分鐘 10 次10/min毎分 10 回來源 IPSource IP送信元 IP
後端 api_tokenBackend api_tokenバックエンド api_token用 API 權杖或對外 MCP 金鑰的請求(REST 與 MCP 合計)Requests made with an API token or the external MCP key (REST and MCP combined)API トークンまたは外部 MCP キーによるリクエスト(REST と MCP の合計)每分鐘 600 次600/min毎分 600 回每把權杖Per tokenトークンごと
後端 agentBackend agentバックエンド agent掃描、憑證、RustDesk 代理用金鑰呼叫的端點(Redis 連不上時放行)Endpoints the scan, certificate and RustDesk agents call with their key (allowed through when Redis is unreachable)スキャン・証明書・RustDesk エージェントがキーで呼ぶエンドポイント(Redis に接続できないときは通過)每分鐘 1200 次1200/min毎分 1200 回每台代理Per agentエージェントごと
後端 aiBackend aiバックエンド aiPOST /api/v1/ai/chat · /ai/chat/stream · /ai/chat/confirm每分鐘 20 次20/min毎分 20 回來源 IPSource IP送信元 IP
後端 主控台Backend consolesバックエンド コンソール網頁主控台的連線票證(SSH/SFTP、RDP、VNC、noVNC、BMC、相容 RustDesk 的網頁連線)。相容 RustDesk 的網頁連線另有登入失敗限制:每人每台受控端一分鐘 3 次、一天 10 次Web console connection tickets (SSH/SFTP, RDP, VNC, noVNC, BMC, RustDesk-compatible web connection). The RustDesk-compatible web connection also limits failed logins: 3 per minute and 10 per day per user and deviceWeb コンソールの接続チケット(SSH/SFTP、RDP、VNC、noVNC、BMC、RustDesk 互換の Web 接続)。RustDesk 互換の Web 接続にはログイン失敗の制限もあります:ユーザーとデバイスごとに毎分 3 回、1 日 10 回每種每分鐘 100 次100/min per kind種類ごとに毎分 100 回來源 IPSource IP送信元 IP
後端 網路診斷Backend network diagnosticsバックエンド ネットワーク診断POST /api/v1/tools/net/*每分鐘 30 次30/min毎分 30 回使用者Userユーザー
  • 一般 REST 呼叫(包括用 API 權杖)沒有逐權杖或逐使用者的限流,只受 nginx 的 zone=api 管。後端設定裡雖然有 api_token(600/分)與 default(100/分)兩組值,但並沒有套用在一般 REST 呼叫上。 Ordinary REST calls (API tokens included) have no per-token or per-user limit; only nginx zone=api applies. The backend config does define api_token (600/min) and default (100/min) values, but they are not applied to ordinary REST calls.通常の REST 呼び出し(API トークンを含む)にはトークン単位・ユーザー単位の制限はなく、nginx の zone=api だけが効きます。バックエンドの設定には api_token(毎分 600)と default(毎分 100)の値がありますが、通常の REST 呼び出しには適用されていません。
  • 原生登入 /api/v1/auth/login 只受後端的 auth 限流,nginx 的 zone=login 只套在 phpIPAM 的 user/。 The native login /api/v1/auth/login is limited only by the backend auth bucket; nginx zone=login covers only phpIPAM user/.ネイティブのログイン /api/v1/auth/login を制限するのはバックエンドの auth だけで、nginx の zone=login は phpIPAM の user/ にのみ適用されます。
  • direct 模式(uvicorn 自己終結 TLS、沒有 nginx)只剩後端這幾組限制。nginx 模式下,後端看到的來源 IP 取自本機 nginx 帶上的 X-Forwarded-For,也就是真正的用戶端位址。 In direct mode (uvicorn terminating TLS, no nginx) only the backend limits apply. In nginx mode the backend takes the source IP from the X-Forwarded-For set by the local nginx, i.e. the real client address.direct モード(uvicorn が TLS を終端し nginx が無い)では、バックエンドの制限だけが残ります。nginx モードでは、バックエンドは送信元 IP をローカルの nginx が付ける X-Forwarded-For、つまり実際のクライアントのアドレスから取得します。

CORS:正式環境只允許明確列出的 HTTPS 來源(不接受 *、不接受 HTTP)。因此瀏覽器端的跨網域呼叫預設不會通,第三方整合請走伺服器對伺服器。 CORS: in production only explicitly-listed HTTPS origins are allowed (no *, no HTTP). So cross-origin browser calls will not work by default; do third-party integrations server-to-server.CORS:本番環境では明示的に列挙された HTTPS のオリジンだけを許可します(* も HTTP も不可)。そのためブラウザからのクロスオリジン呼び出しは既定では通りません。第三者との連携はサーバー間で行ってください。

22OpenAPI

後端是 FastAPI,會自動產生 OpenAPI 規格。但正式環境(APP_ENV=production)一律關閉 /docs、/redoc 與 /openapi.json,避免對外洩漏完整攻擊面。 The backend is FastAPI and generates an OpenAPI spec automatically. However /docs, /redoc and /openapi.json are disabled in production (APP_ENV=production) so the full attack surface isn't published.バックエンドは FastAPI なので OpenAPI 仕様が自動生成されます。ただし本番環境(APP_ENV=production)では /docs・/redoc・/openapi.json をすべて無効化し、攻撃面の全体像が外部に公開されないようにしています。

要拿機器可讀的規格,可以在非正式環境的站台上開 /openapi.json,或在 jt-ipam 主機上(以 root 或服務帳號)直接由程式產生: To get the machine-readable spec, open /openapi.json on a non-production instance, or generate it directly on the jt-ipam host (as root or the service account):機械可読の仕様が必要な場合は、本番以外のインスタンスで /openapi.json を開くか、jt-ipam のホスト上で(root またはサービスアカウントで)プログラムから直接生成します。

cd /opt/jt-ipam/backend
set -a && . /etc/jt-ipam/backend.env && set +a
.venv/bin/python -c "from app.main import app; import json; print(json.dumps(app.openapi()))" \
  > jt-ipam-openapi.json

拿到 openapi.json 之後可以餵給 openapi-generator 產出各語言的 client。但請注意它不是全貌: You can feed that openapi.json to openapi-generator to produce a client in your language of choice. Be aware that it is not the whole picture:取得した openapi.json を openapi-generator に渡せば、好きな言語のクライアントを生成できます。ただし全体像ではない点に注意してください。

  • 有些路由刻意不列出:掃描代理的工作端點、代理程式與安裝腳本、機櫃嵌入 SVG、WebSocket、健康檢查、MCP 與 phpIPAM 根路徑。這些以本手冊為準。 Some routes are deliberately left out: the scan agent job endpoints, agent programs and installers, the rack embed SVG, WebSockets, health checks, MCP and the phpIPAM root. For those, this manual is the reference.意図的に載せていない経路があります:スキャンエージェントのジョブ用エンドポイント、エージェント本体とインストールスクリプト、ラック図の埋め込み SVG、WebSocket、ヘルスチェック、MCP、phpIPAM のルート。これらは本マニュアルを参照してください。
  • 不少回應沒有型別(約 90 個操作直接回字典),規格裡只看得到「一個物件」。這類端點的欄位請以實際回應為準。 Many responses are untyped (about 90 operations return a plain dict), so the spec only says "an object". For those endpoints, go by the actual response.型の無い応答が少なくありません(約 90 の操作が辞書をそのまま返す)。仕様上は「オブジェクト」としか分からないため、実際の応答で項目を確認してください。
  • 另外有一些只給瀏覽器用的流程不在本手冊範圍內,例如主控台票證與 WebSocket、單一登入(OIDC/SAML)、TOTP/MFA 與權杖更新、地圖圖磚與介面顯示設定;外部程式不需要也不應該依賴它們。 Some browser-only flows are outside the scope of this manual: console tickets and WebSockets, single sign-on (OIDC / SAML), TOTP / MFA and token refresh, map tiles and UI display settings; external programs neither need nor should rely on them.また、ブラウザ専用のフローの一部は本マニュアルの対象外です。コンソールのチケットと WebSocket、シングルサインオン(OIDC/SAML)、TOTP/MFA とトークンの更新、地図タイルと画面表示の設定などで、外部のプログラムが必要とすることはなく、依存すべきでもありません。