02-06-2018 09:16 PM - edited 03-01-2019 04:05 AM
I have created a simple LSA which contain one node in CFS side two nods in RFS side and created a simple package for which I am pasting the template and yang model below. I have created the NETCONF-NED in CFS side for the same package in RFS side.
I have added a device in each RFS node lets say ios1 and ios2.
<config-template 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">
<GigabitEthernet>
<name>{$DEVICE_ID}</name>
<description>{$DESCRIPTION}</description>
</GigabitEthernet>
</interface>
</config>
</device>
</devices>
</config-template>
module chandan-rfs {
namespace "http://example.com/chandan-rfs";
prefix rfs;
import tailf-common {
prefix tailf;
}
import tailf-ncs {
prefix ncs;
}
description
"Bla bla...";
revision 2016-01-01 {
description
"Initial revision.";
}
list chandan-rfs {
description "This is an RFS skeleton service";
key name;
leaf name {
tailf:info "Unique service id";
tailf:cli-allow-range;
type string;
}
uses ncs:service-data;
ncs:servicepoint chandan-rfs-servicepoint;
// may replace this with other ways of refering to the devices.
leaf device {
type string;
}
// replace with your own stuff here
leaf description {
type string;
}
leaf device_id {
type string;
}
}
}
Can anyone please help how to write the dispatcher in CFS side node?
Solved! Go to Solution.
02-06-2018 10:01 PM
Here is a very basic example (repeat, basic example ) but you will get the gist of it. The following would be the CFS model and the accompanying mapping. I've used a basic XML based crude dispatch. Proper way would be to have another model which keeps the mappings (which requests get mapped to which rfs-node). Look that up (using python/java logic) to find out the rfs-node the request should go to:
module chandan-cfs {
namespace "http://example.com/chandan-cfs";
prefix cfs;
import tailf-common {
prefix tailf;
}
import tailf-ncs {
prefix ncs;
}
description
"Bla bla...";
revision 2016-01-01 {
description
"Initial revision.";
}
list chandan-cfs {
description "This is an cfs skeleton service";
key name;
leaf name {
tailf:info "Unique service id";
tailf:cli-allow-range;
type string;
}
uses ncs:service-data;
ncs:servicepoint chandan-cfs-servicepoint;
// may replace this with other ways of refering to the devices.
leaf device {
type string;
}
// replace with your own stuff here
leaf description {
type string;
}
leaf device_id {
type string;
}
}
}
<config-template xmlns="http://tail-f.com/ns/config/1.0" servicepoint="chandan-cfs-servicepoint">
<devices xmlns="http://tail-f.com/ns/ncs">
<device>
<name when="{starts-with(/device, 'SYD')}">rfs-node-syd</name>
<name when="{starts-with(/device, 'MEL')}">rfs-node-mel</name>
<config>
<chandan-rfs xmlns=""http://example.com/chandan-rfs>
<name>{/name}</name>
<device>{/device}</device>
<description>{/description}</description>
<device_id>{/device_id}</device_id>
</chandan-rfs>
</config>
</device>
</devices>
</config-template>
02-06-2018 10:01 PM
Here is a very basic example (repeat, basic example ) but you will get the gist of it. The following would be the CFS model and the accompanying mapping. I've used a basic XML based crude dispatch. Proper way would be to have another model which keeps the mappings (which requests get mapped to which rfs-node). Look that up (using python/java logic) to find out the rfs-node the request should go to:
module chandan-cfs {
namespace "http://example.com/chandan-cfs";
prefix cfs;
import tailf-common {
prefix tailf;
}
import tailf-ncs {
prefix ncs;
}
description
"Bla bla...";
revision 2016-01-01 {
description
"Initial revision.";
}
list chandan-cfs {
description "This is an cfs skeleton service";
key name;
leaf name {
tailf:info "Unique service id";
tailf:cli-allow-range;
type string;
}
uses ncs:service-data;
ncs:servicepoint chandan-cfs-servicepoint;
// may replace this with other ways of refering to the devices.
leaf device {
type string;
}
// replace with your own stuff here
leaf description {
type string;
}
leaf device_id {
type string;
}
}
}
<config-template xmlns="http://tail-f.com/ns/config/1.0" servicepoint="chandan-cfs-servicepoint">
<devices xmlns="http://tail-f.com/ns/ncs">
<device>
<name when="{starts-with(/device, 'SYD')}">rfs-node-syd</name>
<name when="{starts-with(/device, 'MEL')}">rfs-node-mel</name>
<config>
<chandan-rfs xmlns=""http://example.com/chandan-rfs>
<name>{/name}</name>
<device>{/device}</device>
<description>{/description}</description>
<device_id>{/device_id}</device_id>
</chandan-rfs>
</config>
</device>
</devices>
</config-template>
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide