get-secret() Function (SLAX and XSLT) and get_secret() (Python)
Function introduced in Junos OS Release 9.5R2.
Support for the slax namespace http://xml.libslax.org/slax added in Junos OS Release 12.2.
Support for Python added in Junos OS Release 16.1R1 on QFX Series switches and ACX Series, MX Series, PTX Series, and T Series routers.
Support for Python added in Junos OS Release 17.1R1 on ACX500, ACX1000, ACX1100, ACX2000, ACX2100, ACX2200, and ACX4000 routers, and EX Series switches.
Support for Python added in Junos OS Release 17.3R1 on SRX1500, SRX4100, SRX4200, SRX5400, SRX5600, and SRX5800 devices and vSRX instances.
Support for Python added in Junos OS Release 18.3R1 on ACX5048 and ACX5096 routers.
Invoke a CLI prompt and wait for user input. Unlike
jcs:get-input() function, the input
is not echoed back to the user, which makes the function useful for
obtaining passwords. The user input is defined as a string for subsequent
use. This function cannot be used with commit or event scripts.
The prefix associated with the namespace URI should be defined in the prefix-to-namespace mapping in the style sheet.
string—CLI prompt text.
input—Text typed by the user and stored as a string.
The following SLAX example shows how to prompt for a password that is not echoed back to the user:
var $password = jcs:get-secret("Enter password: ");
password = jcs.get_secret("Enter password")