acs::Cluster method current_server_locations (protected)
<instance of acs::Cluster> current_server_locations \ [ -network_drivers network_drivers ]
Defined in packages/acs-tcl/tcl/cluster-procs.tcl
Return a list of valid locations of the current server. Since "ns_driver info" is not yet available at the time, the *-init files are loaded, this method goes a long way to check for properties of all of the loaded modules. Network drivers with empty "port" or port == 0 are ignored.
- Switches:
- -network_drivers (optional, defaults to
"nssock nsssl nsudp"
)- Testcases:
- No testcase defined.
Source code: set result {} set protos {nssock http nsssl https nsudp udp nscoap coap} set module_file_regexp [join [dict keys $protos] |] set containerMapping [::acs::container mapping] if {$containerMapping ne ""} { # # We have a container mapping. Return locations from # this mappings as externally callable locations. # foreach {label mapping} $containerMapping { dict with mapping { lappend result [util::join_location -proto $proto -hostname $host -port $port] } } } else { # # Standard setup, no docker involved. We determine the # network configuration of the current node from the # configuration settings. # foreach module_section [list ns/server/[ns_info server]/modules ns/modules] { set modules [ns_configsection $module_section] if {$modules ne ""} { foreach {module file} [ns_set array $modules] { # # To obtain independence of the driver name, we # check whether the name of the binary (*.so # or *.dylib) is one of the supported driver # modules. # if {![regexp ($module_file_regexp) $file . module_type]} { continue } #ns_log notice "current_server_locations: use module <$module> $file" set driver_section [ns_driversection -driver $module] foreach ip [ns_config $driver_section address] { foreach port [ns_config -int $driver_section port] { if {$port == 0} { continue } lappend result [:qualified_location [util::join_location -proto [dict get $protos $module_type] -hostname $ip -port $port]] } } } } } } set result [lsort -unique $result] ns_log notice "[self] current_server_locations returns $result" return $resultXQL Not present: Generic, PostgreSQL, Oracle