replace-pattern
使用
<rpc>
<load-configuration>
<!-- replace a pattern globally -->
<configuration replace-pattern="pattern1" with="pattern2" [upto="n"]>
</configuration>
<!-- replace a pattern at a specific hierarchy level -->
<configuration>
<!-- opening tag for each parent element -->
<level-or-object replace-pattern="pattern1" with="pattern2"
[upto="n"]/>
<!-- closing tag for each parent element -->
</configuration>
<!-- replace a pattern for an object that has an identifier -->
<configuration>
<!-- opening tag for each parent element -->
<container-tag replace-pattern="pattern1" with="pattern2"
[upto="n"]>
<name>identifier</name>
</container-tag>
<!-- closing tag for each parent element -->
</configuration>
</load-configuration>
</rpc>
描述
更换候选配置或开放配置数据库中的变量或标识符。Junos OS使用属性定义的替换 replace-pattern 模式来替换属性指定的 with 模式。 upto 可选属性限制已更换的对象数量。更换的范围由配置数据中属性的位置决定。
属性
replace-pattern="pattern1" |
一种文本字符串或正则表达式,用于定义要匹配的标识符或值。 |
with="pattern2" |
用于替换 的标识符和值的文本字符串或正则表达式 pattern1。 |
upto="n" |
更换的对象数。的值控制 n 在配置中更换的对象总数(而非模式发生的总次数)。首先更换处于相同层级的对象(设置设置)。给定对象中模式多次出现被视为单个替换。如果不包括 属性
|
发布信息
在版本Junos OS中引入15.1R1。