I am configuring static routes using xml, and I had a question regarding the structure of the xml. Both of these ways work, and I want to know if there is any differences between them, or do they both do the same thing.
Method 1: Using the xml schema
<?xml version="1.0" encoding="UTF-8"?>
<Request MajorVersion="1" MinorVersion="0">
<Set>
<Configuration>
<RouterStatic MajorVersion="3" MinorVersion="2">
<DefaultVRF>
<AddressFamily>
<VRFIPV4>
<VRFUnicast>
<VRFPrefixTable>
<VRFPrefix>
<Naming>
<Prefix>
<IPV4Address>200.0.0.0</IPV4Address>
</Prefix>
<PrefixLength>8</PrefixLength>
</Naming>
<VRFRoute>
<VRFNextHopTable>
<VRFNextHop>
<Naming>
<NextHopAddress>
<IPV4Address>192.168.1.2</IPV4Address>
</NextHopAddress>
</Naming>
</VRFNextHop>
</VRFNextHopTable>
</VRFRoute>
</VRFPrefix>
</VRFPrefixTable>
</VRFUnicast>
</VRFIPV4>
</AddressFamily>
</DefaultVRF>
</RouterStatic>
</Configuration>
</Set>
<Commit Mode="Atomic" Label="IPV4_Static_Routes" Comment="IPV4 Static routes config updates"/>
</Request>
Method 2: Using the CLI encapsulation tags
<?xml version="1.0" encoding="UTF-8"?>
<Request MajorVersion="1" MinorVersion="0">
<CLI>
<Configuration>
router static
address-family ipv4 unicast
200.0.0.0/8 192.168.1.2
</Configuration>
</CLI>
<Commit/>
</Request>
On another note, is there a tool out there, that takes CLI commands and translates them into xml schema, like in method 1?
Thanks