The problem with using a restricted keyword for security zones can be manually fixed by issuing the following command in configuration mode and subsequently changing all the references to the keyword:
rename security zones security-zone restricted-keyword to security-zone safe-name
Is it possible to replicate the same rename action through a script (to change the zone name without disturbing the contents)?
If using NETCONF with PERL, use the EZXML module that allows you to create XML to send to the Juniper Networks device easily. For more information, see the "Junos_XML_API_Day_One_Training_Workshop" document with the NETCONF downloads for at least the more recent versions of Junos OS.
From that document:
The following is equivalent to the CLI command “rename vlans Blue to Green”:
$vlan = $config->vlans->vlan; $vlan->name( ‘Blue’ ); junosRename $vlan ( ‘Green’ );
<vlans> <vlan rename="rename" name="Green"> <name>Blue</name> </vlan> </vlans>