- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables
Class ::nsmcp::AccessDiagnosticTool
::nsmcp::AccessDiagnosticToolcreate ... \
[ -adminExample (default "") ] \
[ -adminSummary (default "") ] \
[ -authorizer:required authorizer:required ] \
[ -defaultMode (default "scan") ] \
[ -description:required description:required ] \
[ -inputSchema (default " { "type": "object", "properties": { "mode": { "type": "string", "enum": [ "scan", "page" ], "description": "Bot routing: aggregateTraffic true adds address-free source concentration and User-Agent rankings; path selects an exact queryless path. scan aggregates all pages in a background job, polled with log_results. page returns one bounded byte page. Slow requests remain paged." }, "authenticationState": { "type": "string", "enum": [ "anonymous", "authenticated", "unknown" ], "description": "Filter by logged authentication state; no identity is disclosed." }, "aggregateTraffic": { "type": "boolean", "default": false, "description": "Scan mode only: address-free source concentration and User-Agent rankings over all selected records, independent of evidence limits. No peer-disclosure permission required." }, "path": { "type": "string", "description": "Exact queryless path, e.g. /bugtracker/openacs/" }, "scanStrategy": { "type": "string", "enum": [ "window", "full" ], "default": "window", "description": "Background scans: window seeks by completion timestamps with a 300s margin and explicit ordering assumptions; full examines the entire current file." }, "lastMinutes": { "type": "integer", "minimum": 1, "maximum": 1440, "default": 60 }, "from": { "type": "number" }, "to": { "type": "number" }, "limit": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 }, "pool": { "type": "string", "default": "bots" }, "module": { "type": "string", "default": "nslog" }, "category": { "type": "string", "enum": [ "matching-rule-in-target", "matching-rule-other-pool-candidate", "bot-like-unmatched-heuristic", "no-target-rule-match", "unknown", "native-target-in-target", "native-target-other-pool-candidate", "bot-like-routed-elsewhere-heuristic", "native-other-pool" ], "description": "Bot routing only: retain evidence for this exact category. categoryTotals still covers all matching records; selectedMatches and filteredOutRecords distinguish selection from omitted evidence." }, "includePeerAddresses": { "type": "boolean", "default": false }, "beforeOffset": { "type": "integer", "minimum": 0 }, "sourceBytes": { "type": "integer", "minimum": 0 }, "sourceIdentity": { "type": "string" }, "mappingIdentity": { "type": "string" } }, "additionalProperties": false } ") ] \
[ -maxAggregateSources:integer (default "100000") ] \
[ -maxAggregateUserAgents:integer (default "4096") ] \
[ -maxReadBytes:integer (default "4194304") ] \
[ -name:required name:required ] \
[ -operation (default "bot") ] \
[ -outputSchema (default "") ] \
[ -peerRedactor:required peerRedactor:required ] \
[ -permission (default "diagnostics.logs.read") ] \
[ -redactor:required redactor:required ] \
[ -routing:required routing:required ] \
[ -seekMinimumBytes:integer (default "8388608") ] \
[ -service (default "") ]
Defined in /usr/local/ns/tcl/nsmcp/traffic-tools.tcl
Class Relations
Methods (to be applied on instances)
classify (scripted, public)
<instance of nsmcp::AccessDiagnosticTool> classify record maps \ target
Classify a request using the available fallback routing rules. Evaluate supported map forms in order and retain unknown conditions instead of claiming an exact match.
- Parameters:
- record (required)
- Recorded request fields or routing-evidence dictionary.
- maps (required)
- Ordered routing map entries to evaluate.
- target (required)
- Target connection pool used for the diagnostic comparison.
- Returns:
- The fallback classification dictionary.
- Testcases:
- No testcase defined.
contextComplete (scripted, public)
<instance of nsmcp::AccessDiagnosticTool> contextComplete record \ snapshot
Check whether recorded fields suffice for the routing snapshot. Inspect unavailable topology data and map conditions before claiming a complete request context.
- Parameters:
- record (required)
- Recorded request fields or routing-evidence dictionary.
- snapshot (required)
- Routing snapshot with availability metadata.
- Returns:
- True when the recorded context supports the required lookup, otherwise false.
- Testcases:
- No testcase defined.
execute (scripted, public)
<instance of nsmcp::AccessDiagnosticTool> execute context \ arguments
Run a bounded access-routing diagnostic operation. Validate the configured mode, require scan permissions where appropriate and retain unknown routing evidence.
- Parameters:
- context (required)
- Authenticated request context carrying the principal, grants and selected server.
- arguments (required)
- Rooted ns_json typed triples for the tool's JSON argument object.
- Returns:
- A rooted JSON tool-result object, including availability or job metadata as appropriate.
- Testcases:
- No testcase defined.
nativeClassify (scripted, public)
<instance of nsmcp::AccessDiagnosticTool> nativeClassify server \ record snapshot target
Classify a request using native contextual routing. Combine the native mapping with context completeness and target-pool diagnostics.
- Parameters:
- server (required)
- Selected NaviServer virtual-server name.
- record (required)
- Recorded request fields or routing-evidence dictionary.
- snapshot (required)
- Routing snapshot with availability metadata.
- target (required)
- Target connection pool used for the diagnostic comparison.
- Returns:
- The native classification dictionary with explicit uncertainty.
- Testcases:
- No testcase defined.
page (scripted, public)
<instance of nsmcp::AccessDiagnosticTool> page context arguments \ [ floor ] [ aggregationVar ]
Build one bounded routing-diagnostic evidence page. Validate options and authorize the requested evidence; optionally update the caller's aggregation variable.
- Parameters:
- context (required)
- Authenticated request context carrying the principal, grants and selected server.
- arguments (required)
- Rooted ns_json typed triples for the tool's JSON argument object.
- floor (optional, defaults to
"0")- Minimum candidate position used by the caller's paging operation. Defaults to '0'.
- aggregationVar (optional)
- Optional caller variable receiving traffic aggregation state.
- Returns:
- The rooted JSON evidence page.
- Testcases:
- No testcase defined.
scanStep (scripted, public)
<instance of nsmcp::AccessDiagnosticTool> scanStep context state
Run one bounded routing-diagnostic scan slice. Retain immutable bounds, filters, aggregation and coverage state so later slices continue the same scan.
- Parameters:
- context (required)
- Authenticated request context carrying the principal, grants and selected server.
- state (required)
- Opaque retained provider continuation or scan state.
- Returns:
- The updated scan state and diagnostic evidence.
- Testcases:
- No testcase defined.
validate (scripted, public)
<instance of nsmcp::AccessDiagnosticTool> validate arguments
Validate routing-diagnostic modes, filters and scan options. Decode the rooted JSON argument object and enforce this tool's option, range and combination constraints.
- Parameters:
- arguments (required)
- Rooted ns_json typed triples for the tool's JSON argument object.
- Returns:
- An empty result on success; invalid input raises RPC error -32602.
- Testcases:
- No testcase defined.
- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables
![[i]](/resources/acs-subsite/ZoomIn16.gif)