cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
817
Views
0
Helpful
3
Replies

Is there a way to annotate configuration commands in service xml template?

jysoini
Level 1
Level 1

I wonder if there is a way to annotate configuration commands in service xml template.

For instance, our current configuration for Juniper static routes are annotated to include

customer name information and we would like to maintain that:

/* AS65535 Example.com loopback */

route 10.0.0.1/32 next-hop 196.254.0.1;

´

I know you can do it from ncs_cli command line like this:

ncs_cli> annotate device device juniper1 config  junos:configuration routing-options route 10.0.0.1/32 "AS65535 Example.com loopback"

3 Replies 3

dvlassop
Cisco Employee
Cisco Employee

You'll need to capture the annotation string in a variable (say DESCRIPTION) and then map it to your XML template.

Please adapt the following example to match your needs:

<config xmlns="http://tail-f.com/ns/config/1.0">

  <devices xmlns="http://tail-f.com/ns/ncs">

  <device>

    <name>{$DEVICE}</name>

      <config>

      <interface xmlns="urn:ios">

      <Loopback annotation="{$DESCRIPTION}">

        <name>0</name>

        <ip>

          <address>

            <primary>

              <address>{$IPADDRESS}</address>

              <mask>{$IPSUBNET}</mask>

            </primary>

          </address>

        </ip>

      </Loopback>

      </interface>

      </config>

  </device>

  </devices>

</config>

Let us know if this covers what you need.

Dimitris

That would be suitable for my needs, if it were working.

     <Loopback annotation="{$DESCRIPTION}">

Is accepted in xml template and the template is working like before.

Alas, annotation is not created, at least not shown in "commit dry-run".

I am running ncs-4.4.2.

JamesHarr74967
Level 1
Level 1

This still does not work in NSO 5.5.1. It just puts the raw value into the annotation and does not do variable substitution.