Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 

allow-url-for-python (Op Scripts)

 

Syntax

Hierarchy Level

Release Information

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.

Description

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.

Note

Starting in Junos OS Release 18.2R2 and 18.3R1, Junos OS supports only the SHA-256 hash function for script checksum hashes. Earlier releases support the MD5, SHA-1, and SHA-256 hash functions.

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.

Default

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 the configuration.

maintenance-control—To add this statement to the configuration.