cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
832
Views
1
Helpful
3
Replies

Traffic engineering service model

Etts Equinox
Level 1
Level 1

I have been trying to create a service model for TE explicit path but what happens is that the xml merges ip addresses together and the only solution, i know is to repeat the xml like the l2vpn model but it looks illogical for me because i have no idea how many indexes that customer will create so my question is there any solution without repeating the xml manually?

   

admin@ncs(config)# show configuration

devices device pe0

config

cisco-ios-xr:explicit-path name xxx

   index 1 next-address ipv4 unicast 3.3.3.3

   index 2 next-address ipv4 unicast 4.4.4.4

Yang

=================

module TE {

  namespace "http://com/example/TE";

  prefix TE;

  import ietf-inet-types { prefix inet; }

  import tailf-ncs { prefix ncs; }

  import tailf-common { prefix tailf; }

  import ietf-yang-types { prefix yang-type; }

  augment /ncs:services {

    list TE {

key device;

uses ncs:service-data;

      ncs:servicepoint "TE";

      leaf device {

      tailf:info "PE Router";

      container Explicit-path {

        when "../Explicit='true'";

list ex-name {

          key name;

          leaf name {

            type string;

          }

          list PATH {

            key number;

            leaf number {

              type uint32;

            }

            leaf option {

              type enumeration {

                enum loose;

                enum strict;

              }

            }

            leaf ip-add {         

              type inet:ipv4-address;

            }

          }

        }

      } 

}     

  }

}

===================================

XML

=======

?xml version="1.0" encoding="utf-8"?>

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

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

               <device>

                 <name>{/device}</name>

                 <config>

                   <explicit-path xmlns="http://tail-f.com/ned/cisco-ios-xr">

                     <name>

                       <pathname>{/Explicit-path/ex-name/name}</pathname>

                       <index>

                         <index-id>{/Explicit-path/ex-name/PATH/number}</index-id>

                         <keyword>next-address</keyword>

                         <ipv4>

                           <unicast>{/Explicit-path/ex-name/PATH/ip-add}</unicast>

                         </ipv4>

                       </index>

                     </name>

                   </explicit-path

Thanks

1 Accepted Solution

Accepted Solutions

It is in the doc/pdf directory under your NSO installation

View solution in original post

3 Replies 3

rogaglia
Cisco Employee
Cisco Employee

Hi,

The the attribute foreach may solve your problem.

You should check the "Loop Statement" section in the NSO developement guide.

Regards,

Roque

Hello Roque,


Could send me a link for development guide as i'm depending on NSO student guide all the time.


Thanks,

Amr Emad

It is in the doc/pdf directory under your NSO installation