nsmcp::AccessFileSummaryTool method options (protected)

 <instance of nsmcp::AccessFileSummaryTool[i]> options arguments

Defined in /usr/local/ns/tcl/nsmcp/log-traffic-summary.tcl

Parameters:
arguments (required)

Testcases:
No testcase defined.
Source code:
if {[lindex $arguments 1] ne "object"} {error "Expected arguments object"}
set base {}; set seen {}; set extras {pathLiteral {} includeRotations true selection ordered mode summary maxRecords 5000}
foreach {key type value} [lindex $arguments 2] {
    if {$key in $seen} {error "Duplicate access summary argument"}; lappend seen $key
    if {$key in {status statusClass pool method recordSource bucketSeconds}} {
        set expected [expr {$key in {status bucketSeconds} ? "number" : "string"}]
        if {$type ne $expected || ($expected eq "string" && $value eq {})} {error "Invalid failed-traffic filter type/value"}
        dict set extras $key $value
    } elseif {$key in {selection mode}} {
        if {$type ne "string" || ($key eq "selection" && $value ni {ordered exhaustive}) || ($key eq "mode" && $value ni {summary evidence totals})} {error "Invalid access summary selection or mode"}
        dict set extras $key $value
    } elseif {$key eq "maxRecords"} {
        if {$type ne "number" || ![string is integer -strict $value] || $value<1 || $value>10000} {error "maxRecords must be 1..10000"}
        dict set extras $key $value
    } elseif {$key eq "pathLiteral"} {
        if {$type ne "string" || [string length [encoding convertto utf-8 $value]]<1
            || [string length [encoding convertto utf-8 $value]]>256 || [regexp {[\x00-\x1f\x7f]} $value]} {error "pathLiteral must be 1..256 UTF-8 bytes without control characters"}
        dict set extras $key $value
    } elseif {$key eq "includeRotations"} {
        if {$type ne "boolean"} {error "includeRotations must be boolean"}
        dict set extras $key [expr {$value eq "true"}]
    } elseif {$key in {period timezone lastMinutes from to maxGroups}} {
        lappend base $key $type $value
    } else {error "Unknown access summary argument"}
}
return [::nsmcp::accessFailureOptions [dict merge [next [list [list {} object $base]]] $extras]]
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: