<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: tailf:link Usage in NSO Developer Hub Discussions</title>
    <link>https://community.cisco.com/t5/nso-developer-hub-discussions/fetch-and-display-interface-description/m-p/3956487#M4495</link>
    <description>&lt;P&gt;Anyone please&amp;nbsp;suggest. Thanks&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Bjron&lt;/P&gt;</description>
    <pubDate>Mon, 11 Nov 2019 04:45:40 GMT</pubDate>
    <dc:creator>bjronmork</dc:creator>
    <dc:date>2019-11-11T04:45:40Z</dc:date>
    <item>
      <title>Fetch and display Interface Description</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/fetch-and-display-interface-description/m-p/3898643#M4083</link>
      <description>&lt;P&gt;Hi Experts;&lt;/P&gt;&lt;P&gt;I need to fetch interface description of selected interface in service creations.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below code lists the GigabitEthernet interfaces&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;leaf intf-number {
tailf:info "GigabitEthernet Interface ID";
mandatory true;
type leafref {
path "deref(../../device)/../ncs:config/ios:interface/ios:GigabitEthernet/ios:name";
}
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying below code but unable to fetch description, Once interface is selected in &lt;STRONG&gt;"intf-number"&lt;/STRONG&gt;; need to fetch and display its description in leaf &lt;STRONG&gt;"Interface-Description"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;leaf Interface-Description {
tailf:info "Interface specific description";
type leafref {
&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;path "deref(../../device)/../ncs:config/ios:interface/ios:GigabitEthernet[ios:name='../intf-number']/ios:description"; (not working)&lt;/STRONG&gt;
&lt;/FONT&gt;}
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;xPath for Interface-Description is path &lt;FONT face="courier new,courier"&gt;/devices/device[name='IOSPE']/config/ios:interface/GigabitEthernet[name='0/0']/description&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need help; how can i get interface description based on interface selection..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Bjron&lt;/P&gt;</description>
      <pubDate>Sat, 27 Jul 2019 07:19:48 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/fetch-and-display-interface-description/m-p/3898643#M4083</guid>
      <dc:creator>bjronmork</dc:creator>
      <dc:date>2019-07-27T07:19:48Z</dc:date>
    </item>
    <item>
      <title>Re: Fetch and display Interface Description</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/fetch-and-display-interface-description/m-p/3899305#M4087</link>
      <description>&lt;P&gt;You can use the following xpath function &lt;A title="RFC 7950" href="https://tools.ietf.org/html/rfc7950#section-10.1.1" target="_self"&gt;current()&lt;/A&gt; to set the path back to the current node, in this case Interface-Description.&amp;nbsp; You went ../name/.. to get out of the list and into the ncs:config. Using current()/../intf-number will bring you back to the Interface-Description then up one back to intf-number to get value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;leaf Interface-Description {
      tailf:info "Interface specific description";
      type leafref {
        path "deref(../name)/../ncs:config/ios:interface/ios:GigabitEthernet[ios:name=current()/../intf-number]/ios:description";
      }
    }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jul 2019 14:32:18 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/fetch-and-display-interface-description/m-p/3899305#M4087</guid>
      <dc:creator>tsiemers1</dc:creator>
      <dc:date>2019-07-29T14:32:18Z</dc:date>
    </item>
    <item>
      <title>Re: Fetch and display Interface Description</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/fetch-and-display-interface-description/m-p/3899393#M4088</link>
      <description>&lt;P&gt;I think it is time to take a step back and explain what it is you want to achieve. A leafref to a specific interface description is very unlikely to be useful so I am guessing that what you want is something else?&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jul 2019 15:52:44 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/fetch-and-display-interface-description/m-p/3899393#M4088</guid>
      <dc:creator>vleijon</dc:creator>
      <dc:date>2019-07-29T15:52:44Z</dc:date>
    </item>
    <item>
      <title>Re: Fetch and display Interface Description</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/fetch-and-display-interface-description/m-p/3899495#M4091</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe you need to think on using the "tailf:link" extension.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Roque&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;tailf:link target

This statement specifies that the data node should be implemented as a link to another data node, called the target data node. This means that whenever the node is modified, the system modifies the target data node instead, and whenever the data node is read, the system returns the value of target data node.

Note that if the data node is a leaf, the target node MUST also be a leaf, and if the data node is a leaf-list, the target node MUST also be a leaf-list.

Note that the type of the data node MUST be the same as the target data node. Currently the compiler cannot check this.

Using link inside a choice is discouraged due to the limitations of the construct. Updating the target of the link does not affect the active case in the source.

Example:

container source {
  choice source-choice {
    leaf a {
      type string;
      tailf:link "/target/a";
    }
    leaf b {
      type string;
      tailf:link "/target/b";
    }
  }
}

container target {
  choice target-choice {
    leaf a {
      type string;
    }
    leaf b {
      type string;
    }
  }
}

Setting /target/a will not activate the case of /source/a. Reading the value of /source/a will not return a value until the case is activated. Setting /source/a will activate both the case of /source/a and /target/a.

The argument is an XPath absolute location path. If the target lies within lists, all keys must be specified. A key either has a value, or is a reference to a key in the path of the source node, using the function current() as starting point for an XPath location path. For example:

/a/b[k1='paul'][k2=current()/../k]/c

The link statement can be used in: leaf and leaf-list.

The following substatements can be used:

tailf:inherit-set-hook This statement specifies that a 'tailf:set-hook' statement should survive through symlinks. If set to true a set hook gets called as soon as the value is set via a symlink but also during commit. The normal behaviour is to only call the set hook during commit time. &lt;/PRE&gt;</description>
      <pubDate>Mon, 29 Jul 2019 18:55:56 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/fetch-and-display-interface-description/m-p/3899495#M4091</guid>
      <dc:creator>rogaglia</dc:creator>
      <dc:date>2019-07-29T18:55:56Z</dc:date>
    </item>
    <item>
      <title>Re: tailf:link Usage</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/fetch-and-display-interface-description/m-p/3955551#M4491</link>
      <description>&lt;P&gt;I tried using tailf:link to assign first node data to other node.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;FONT size="2"&gt;        container IOSXR {
          when "/ncs:devices/ncs:device[ncs:name=current()/../Switch]/ncs:platform/ncs:name='ios-xr'";
          list GigabitEthernet {
            key "GigabitEthernet";
            leaf GigabitEthernet {
              tailf:info "GigabitEthernet Interface ID";
              mandatory true;
              type leafref {
                path "deref(../../../Switch)/../ncs:config/cisco-ios-xr:interface/cisco-ios-xr:GigabitEthernet/cisco-ios-xr:id";
              }
            }
            uses Trunk;
          }&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;Using above code for leaf GigabitEthernet, I can have drop-down list of interfaces.&lt;/P&gt;&lt;P&gt;Let say if i have selected "0/0/0/0"... I want to use the same node data "0/0/0/0" to other leaf "intf-number"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;FONT size="2"&gt;        grouping Trunk {
          list BD-ID {
            key "bridge-domain-id";
            leaf bridge-domain-id {
              tailf:info "Bridge Domain ID";
              mandatory true;
              type uint32 {
                range "1..65535";
              }
            }
	leaf intf-number {
              tailf:info "GigabitEthernet Interface ID";
              mandatory true;
              type leafref {
                path "deref(../../../../../../Switch)/../ncs:config/cisco-ios-xr:interface/cisco-ios-xr:GigabitEthernet/cisco-ios-xr:id";
              }
            }
            leaf Bridge-Domain-Description {
              tailf:info "Interface Description";
              type string {
                tailf:info "LINE;;Up to 50 characters describing this interface";
                length "0..50";
              }
            }
          }
        }&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;I tried below code ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;FONT size="2"&gt;leaf intf-number {
 {
&lt;FONT color="#0000FF"&gt;tailf:link "/ncs:devices/ncs:device[name=current()/../../../Switch]/ncs:config/cisco-ios-xr:interface/GigabitEthernet[id=current()/cisco-ios-xr:id]";&lt;/FONT&gt;&lt;BR /&gt;tailf:info "GigabitEthernet Interface ID";
mandatory true;
type leafref {
path "deref(../../../../../../Switch)/../ncs:config/cisco-ios-xr:interface/cisco-ios-xr:GigabitEthernet/cisco-ios-xr:id";
}
}&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;but facing below error.&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;yang/my-service.yang:324: error: the node 'GigabitEthernet' from module 'my-service' (in node 'interface' in module 'tailf-ned-cisco-ios-xr' from 'tailf-ned-cisco-ios-xr') is not found&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;How can i use the any leaf (node) data for other leaf (node) using YANG modeling....like below;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;GigabitEthernet=0/0/0/0&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;inft-number=GigabitEthernet&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Someone please suggest.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Regards,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;BMork&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2019 06:17:52 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/fetch-and-display-interface-description/m-p/3955551#M4491</guid>
      <dc:creator>bjronmork</dc:creator>
      <dc:date>2019-11-11T06:17:52Z</dc:date>
    </item>
    <item>
      <title>Re: tailf:link Usage</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/fetch-and-display-interface-description/m-p/3956487#M4495</link>
      <description>&lt;P&gt;Anyone please&amp;nbsp;suggest. Thanks&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Bjron&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2019 04:45:40 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/fetch-and-display-interface-description/m-p/3956487#M4495</guid>
      <dc:creator>bjronmork</dc:creator>
      <dc:date>2019-11-11T04:45:40Z</dc:date>
    </item>
  </channel>
</rss>

