Search Files (grep)
Searches files under a directory on the disk for lines matching a regular expression. Listing and matching are fanned out across ephemeral exec containers, so the request finishes within the userβs time budget regardless of the size of the directory.
The user controls cost and latency with three knobs:
maxDurationSecondsis the wall-clock deadline (capped at 30s).concurrencyis the maximum number of parallel grep workers. Higher concurrency finishes larger datasets within the deadline, at proportionally more compute.maxResultscauses the search to short-circuit after the aggregator has collected this many matches.
With recursive: false only files directly under directory are
searched. With recursive: true subdirectories are walked
breadth-first and grep workers are dispatched as soon as each level
finishes listing β listing and matching overlap.
The matches returned when stopping early on maxResults are a sample
of whichever workers reported first, not the lexicographically first
N. The response surfaces stoppedReason so callers can distinguish
completion from early termination.
Authorizations
API key (format key-{API_KEY})
Path Parameters
Disk ID (format dsk-{16 hex chars})
^dsk-[0-9a-f]{16}$"dsk-0123456789abcdef"
Body
Directory on the disk to search, relative to the disk root. An empty string or "/" means the disk root.
"data/logs"
Extended regular expression (passed to grep -E)
"ERROR|FATAL"
When true, walks subdirectories breadth-first.
Wall-clock deadline for the entire request. Capped at 30 seconds because the runtime exec container itself is bounded at ~30s; longer requests would have their workers killed mid-scan.
1 <= x <= 30Maximum number of parallel grep workers. Higher values finish larger datasets within the deadline but consume proportionally more runtime capacity.
1 <= x <= 100Stop scanning once the aggregator has this many matches. Returned matches are a sample of whichever workers reported first, not the lexicographically first N.
1 <= x <= 10000