Tried yang model cisco-ios-xr 6.2.1 version for finding coredump check below cli command
P/0/RP0/CPU0:Router#dir harddisk:
Mon May 8 00:10:28.134 EDT
Directory of harddisk:
20 drwxr-xr-x 2 4096 Jul 1 2016 dumper
55 -rw-r--r-- 1 117127 Apr 19 18:33 cleaf1_show_tech_arp.c2.tgz
57 -rw-r--r-- 1 83445 Apr 19 18:34 cleaf1_show_tech_spp.c2.tgz
52 -rwxr--r-- 1 679137 Apr 19 19:15 netio_trace.c1
12 drwxr-xr-x 2 4096 Jul 1 2016 tftpboot
107 -rwx------ 1 61169 Mar 1 13:17 dedsdf1003jl1-sh-run-03012017
60 -rw-r--r-- 1 68443 Apr 19 18:38 cleaf1_show_tech_spio.c2.tgz
So could you please let me know the yang model for finding dir harddisk:
An RPC model is required for that action. It is currently not available on released software. The target date for the release of file system RPCs hasn't been confirmed yet. Currently, you'd need to retrieve the fails in the file system vis CLI. We're working on closing these gaps as soon as possible, but we just don't have a firm date for this one in particular. In a month or two, we should have better visibility.
I think you can try these yang modules for the above commands.
http://ydk.cisco.com/py/docs/gen_doc_6697ca93cba56c4a7b49a7e5c1f13a1539440b9d.html
http://ydk.cisco.com/py/docs/gen_doc_392e32629c2098812ffdf4c1246e8367d81f2ffd.html
- Trying to find the cli output for yangmodel
RP/0/RP0/CPU0:dedsdf1011jl1#sh bgp ipv4 unicast advertised neighbor 10.20.20.26
Wed May 24 07:11:19.574 EDT
10.20.20.70/32 is advertised to 10.20.20.26
Path info:
neighbor: Local neighbor router id: 10.20.20.70
valid redistributed best
Received Path ID 0, Local Path ID 0, version 6
Attributes after inbound policy was applied:
next hop: 0.0.0.0
MET ORG AS COMM
origin: incomplete metric: 0
aspath:
community: 13979:3111 62301:21
Attributes after outbound policy was applied:
next hop: 10.20.20.70
MET ORG AS COMM
origin: incomplete metric: 0
aspath:
community: 13979:3111 62301:21
Please let us know which yang model needs to refer this above cli putput . We are getting in XML rpcreply with community as 916130845 instead of 13979:3111
916130845 is the equivalent of 13979:3101 if you treat it as a 64-bit number. The upper 32-bits are 13979, and the lower 32-bits are 3101.
What path are you using to retrieve the data you get.
would like to show the RPC which i am using to get route-policy community output .
def read(host, user, password):
try:
with manager.connect(host=host, username=user, password=password, look_for_keys=False,timeout=150) as m:
bgp_filter = '''
<bgp xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ipv4-bgp-oper">
<instances>
<instance>
<instance-name>default</instance-name>
<instance-active>
<default-vrf>
<afs>
<af>
<af-name>ipv4-unicast</af-name>
<advertised-path-xr>
<advertised-path/>
</advertised-path-xr>
</af>
</afs>
</default-vrf>
</instance-active>
</instance>
</instances>
</bgp>
'''
cisco_bgp = m.get(('subtree', bgp_filter))
print (cisco_bgp)
with open("/tmp/difficultipv4ncc167new1.xml", "w+") as file_obj:
file_obj.write(str(cisco_bgp))
except Exception as exe:
print 'Exception caught in read()',exe
With these RPC , we are getting XML RPC reply . But when we are grepping community set its showing as 916130845 instead of 13979:3101
So how we can get the community output as 13979:3101 .
Here we are trying show bgp ipv4 unicast advertised neighbor 10.80.65.60 and out put will provide the nexthop and community value.
The content is a single 32-bit number with two 16-bit values in it. The community list is here in the YANG tree (and maybe in other places):
module: Cisco-IOS-XR-ipv4-bgp-oper
+--ro bgp
+--ro instances
+--ro instance*
+--ro instance-active
+--ro default-vrf
+--ro afs
+--ro af*
+--ro advertised-path-xr
+--ro advertised-path*
+--ro attributes-after-policy-in
+--ro common-attributes
+--ro community*
+--ro entry? uint32
As you can see, the type is a uint32, which means that a number, as you received, is the correct wire representation. A display like "13979:3101” is a presentation layer issue, and must be implemented by your code. For example:
14:54 $ python
Python 2.7.13 (default, Dec 18 2016, 07:03:39)
on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> community = 916130845
>>> c_upper = community & 0xffff0000
>>> c_lower = community & 0x0000ffff
>>> print('%d:%d' % (c_upper >> 16, c_lower))
13979:3101
>>>
Comments
0 comments
Please sign in to leave a comment.