allow-url-for-python (Op Scripts)
Statement introduced in Junos OS Release 16.1R1 on QFX Series switches and MX Series, PTX Series, and T Series routers.
Statement introduced in Junos OS Release 17.1R1 on ACX500, ACX1000, ACX1100, ACX2000, ACX2100, ACX2200, and ACX4000 routers, and EX Series switches.
Statement introduced in Junos OS Release 17.3R1 on SRX1500, SRX4100, SRX4200, SRX5400, SRX5600, and SRX5800 devices and vSRX instances.
Statement introduced in Junos OS Release 18.3R1 on ACX5048 and ACX5096 routers.
Enable the execution of Python op scripts from a remote site.
When you configure the language python or language python3 statement at the [edit system scripts] hierarchy level, you can execute local Python scripts on a device running Junos OS. In order to execute Python op scripts from a remote site, you must also configure the allow-url-for-python statement.
To verify the integrity of the remote op script before it runs on the device, you can optionally confirm the checksum hash for the script. To determine the checksum, use the file checksum operational mode command. When you run the op url command you can provide the hash value for that script by using the key option. If the calculated and specified values do not match, script execution fails.
The no-allow-url statement takes precedence over the allow-url-for-python statement; if both statements are configured, you cannot execute Python op scripts from a remote site on the device.
If you do not include the allow-url-for-python statement, you cannot execute Python op scripts from a remote site, and the op url command generates an error.
Required Privilege Level
maintenance—To view this statement in
maintenance-control—To add this statement to the configuration.