cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
306
Views
0
Helpful
2
Replies

how to modularize a NSO Service

wuppi1
Level 1
Level 1

Hi,

I am looking for examples how to devide a NSO Service-model (YANG + XML) into several small servicees which can be reused in other services.

Thx

Dirk

1 Accepted Solution

Accepted Solutions

frjansso
Cisco Employee
Cisco Employee

Some pseudo YANG/templates below.

The top service would create instances of the lower services (bottom-1 and bottom-2), the bottom services are usually "normal" services, i.e. writing config to a device (but they can invoke more stacked services as well).

Hope it makes sense.

list top {

  ncs:servicepoint top;

  leaf device {}

  leaf a {}

  leaf b {}

}

top-template.xml:

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

servicepoint="top">

  <bottom-1>

    <name>XXX</name>

    <device>{/device}</device>

    <bottom-a>{/a}</bottom-a>

</bottom-1>

  <bottom-2>

    <name>XXX</name>

    <device>{/device}</device>  

    <bottom-b>{/b}</bottom-b>

</bottom-2>

</config-template>

list bottom-1 {

   ncs:servicepoint bottom-1;

   leaf device {}

   leaf bottom-a {}

}

list bottom-1 {

   ncs:servicepoint bottom-1;

   leaf device {}

   leaf bottom-b {}

}

View solution in original post

2 Replies 2

frjansso
Cisco Employee
Cisco Employee

Some pseudo YANG/templates below.

The top service would create instances of the lower services (bottom-1 and bottom-2), the bottom services are usually "normal" services, i.e. writing config to a device (but they can invoke more stacked services as well).

Hope it makes sense.

list top {

  ncs:servicepoint top;

  leaf device {}

  leaf a {}

  leaf b {}

}

top-template.xml:

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

servicepoint="top">

  <bottom-1>

    <name>XXX</name>

    <device>{/device}</device>

    <bottom-a>{/a}</bottom-a>

</bottom-1>

  <bottom-2>

    <name>XXX</name>

    <device>{/device}</device>  

    <bottom-b>{/b}</bottom-b>

</bottom-2>

</config-template>

list bottom-1 {

   ncs:servicepoint bottom-1;

   leaf device {}

   leaf bottom-a {}

}

list bottom-1 {

   ncs:servicepoint bottom-1;

   leaf device {}

   leaf bottom-b {}

}

Shouldn't that be

...

list bottom-1 {

   ncs:servicepoint bottom-1;

   leaf device {}

   leaf bottom-a {}

}

list bottom-2 {

   ncs:servicepoint bottom-2;

   leaf device {}

   leaf bottom-b {}

}

Regards

Lothar