cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
524
Views
0
Helpful
1
Replies

How to create LSA dispatcher in CFS node corresponding to the package in RFS node.

chandans
Cisco Employee
Cisco Employee

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?
   

1 Accepted Solution

Accepted Solutions

alam.bilal
Cisco Employee
Cisco Employee

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>

View solution in original post

1 Reply 1

alam.bilal
Cisco Employee
Cisco Employee

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>