code wiki / (root) / nx_mgmt_call.nx

nx_mgmt_call.nx

buildroot/runtime/nx_mgmt_call.nx

10509 B161 linesdepth 11pulls 23 transitivereach 0 importersview sourcekind tooltopic mgmt
docsdependenciesstructsconstsfunctions

about

nx_mgmt_call.nx -- the mgmt-API driver forked as an MCP tool. Mints a FRESH admin session from the NAS key bundle (no staleness, no stored secret) and issues one authenticated call to the loopback mgmt API (:18098), printing the response body, or retains it privately with --response-file. This is what makes the SOTA control plane (deploy/reconcile/restart/services/health) reachable over MCP without the shell. Runs as the (root) tools daemon's child, which can read the elderwesto-owned key bundle. CLI: nx_mgmt_call <METHOD> <path> [body] e.g. nx_mgmt_call GET /api/services Body encoding is route-specific. Current form routes require target=..., not JSON. Example: nx_mgmt_call POST /api/organ_run 'target=nx_filehash&confirm=yes&args=nx_mgmt_api.elf.new' Resolve deployment targets through deploy_targets.conf; tool names and deployment names differ.

dependencies 3 imports · 0 importers

nx_mgmt_private_response.nx nx_session_mint_lib.nx nx_tool_http_backend.nx nx_mgmt_call.nx

imports: nx_mgmt_private_response.nxnx_session_mint_lib.nxnx_tool_http_backend.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main msm_slen mpr_eq mpr_len mpr_len ↻ mpr_put mpr_len ↻ mpr_begin mpr_init mpr_len ↻ mpr_absent mpr_word mc_private_end mpr_cleanup mpr_word ↻ fio_unlink mpr_report mpr_put ↻ mpr_num mpr_put ↻ mpr_digits mpr_digits ↻ msm_mint_b64 msm_mint_raw msm_load_edpriv msm_hexval nx_ncs_derive_user_id_hash sys_mmap nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable nxa_dump_sizes

structs

none

consts

12const MC_MAGIC_86400: i64 = 86400
13const MC_MAGIC_131072: i64 = 131072
14const MC_MAGIC_1048576: i64 = 1048576
16const MC_KEYS: *u8 = "opaque_keys.bin" as *u8 // relative to the daemon cwd (nishihost)
17const MC_REALM: *u8 = "nishi_site_admin" as *u8
18const MC_HANDLE: *u8 = "elderwesto" as *u8
19const MC_PORT: i64 = 18098

functions

21func mc_puts(buf: *u8, off: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { buf[off] = s[i]; off = off + 1; i = i + 1 } return off }
called by 1: main
22func mc_putn(buf: *u8, off: i64, s: *u8, n: i64) -> i64 { var i: i64 = 0; while i < n { buf[off] = s[i]; off = off + 1; i = i + 1 } return off }
called by 1: main
23func mc_puti(buf: *u8, off: i64, v: i64) -> i64
called by 1: main
32func mc_private_end(r:*NxMgmtPrivateResponse,session:*u8,reply:*u8,reply_n:i64)->i64
called by 1: main calls 2: mpr_cleanupmpr_report
39func main(argc: i64, argv: *i64) -> i64