Skip to content

Commit

Permalink
Merge pull request #2 from 111pontes/cleu2018
Browse files Browse the repository at this point in the history
Add updated material for Cisco Live EU 2018
  • Loading branch information
111pontes authored Jan 28, 2018
2 parents 92609d8 + 4b9a990 commit a4e4ca6
Show file tree
Hide file tree
Showing 963 changed files with 60,652 additions and 19,038 deletions.
2 changes: 1 addition & 1 deletion ansible/Cisco-IOS-XR-ping-act.yang
3 changes: 3 additions & 0 deletions ansible/ip_destination_reachable/hosts
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
[LERs]
198.18.1.11

[LERs:vars]
ansible_python_interpreter=/usr/bin/python3
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#!/usr/bin/env python3
#
# Copyright 2017 Cisco Systems, Inc.
# Copyright 2018 Cisco Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -77,8 +77,8 @@
aliases: []
requirements:
- ydk 0.5.4 (python)
- ydk-models-cisco-ios-xr 6.2.1 (python)
- ydk 0.6.3 (python)
- ydk-models-cisco-ios-xr 6.3.1 (python)
"""

EXAMPLES = """
Expand Down Expand Up @@ -117,6 +117,7 @@

def ping(host, destination, repeat_count, vrf_name):
"""Execute Ping RPC over NETCONF."""

# create NETCONF provider
provider = NetconfServiceProvider(address=host,
port=830,
Expand All @@ -125,18 +126,18 @@ def ping(host, destination, repeat_count, vrf_name):
protocol='ssh')
executor = ExecutorService() # create executor service

ping_rpc = xr_ping_act.PingRpc() # create ping RPC object
ping = xr_ping_act.Ping() # create ping RPC object

ping_rpc.input.destination.destination = destination
ping_rpc.input.destination.repeat_count = repeat_count
ping_rpc.input.destination.vrf_name = vrf_name
ping.input.destination.destination = destination
ping.input.destination.repeat_count = repeat_count
ping.input.destination.vrf_name = vrf_name

ping_rpc.output = executor.execute_rpc(provider, ping_rpc)
ping = executor.execute_rpc(provider, ping, xr_ping_act.Ping())

return dict(success_rate=ping_rpc.output.ping_response.ipv4[0].success_rate,
rtt_min=ping_rpc.output.ping_response.ipv4[0].rtt_min,
rtt_avg=ping_rpc.output.ping_response.ipv4[0].rtt_avg,
rtt_max=ping_rpc.output.ping_response.ipv4[0].rtt_max)
return dict(success_rate=int(str(ping.output.ping_response.ipv4[0].success_rate)),
rtt_min=int(str(ping.output.ping_response.ipv4[0].rtt_min)),
rtt_avg=int(str(ping.output.ping_response.ipv4[0].rtt_avg)),
rtt_max=int(str(ping.output.ping_response.ipv4[0].rtt_max)))


def main():
Expand Down
3 changes: 2 additions & 1 deletion ansible/ip_destination_reachable/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
# Playbook to verify rechability of LER2 prefix (192.168.255.2) for VRF RED
#
# Santiago Alvarez ([email protected])
# Jun 2017
# Jan 2018

- name: Verify IPv4 VPN service
hosts: LERs
connection: local
Expand Down
2 changes: 1 addition & 1 deletion grpc/Cisco-IOS-XR-clns-isis-cfg.yang
2 changes: 1 addition & 1 deletion grpc/Cisco-IOS-XR-clns-isis-oper.yang
2 changes: 1 addition & 1 deletion grpc/Cisco-IOS-XR-ifmgr-cfg.yang
2 changes: 1 addition & 1 deletion grpc/Cisco-IOS-XR-ip-rib-ipv4-oper.yang
2 changes: 1 addition & 1 deletion grpc/Cisco-IOS-XR-ipv4-io-cfg.yang
32 changes: 0 additions & 32 deletions grpc/merge-config-oc-if-gi1.json

This file was deleted.

35 changes: 35 additions & 0 deletions grpc/oc-interfaces-gi1-cfg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"openconfig-interfaces:interfaces": {
"interface": [
{
"name": "GigabitEthernet0/0/0/1",
"config": {
"name": "GigabitEthernet0/0/0/1",
"type": "iana-if-type:ethernetCsmacd",
"description": "CONNECTS TO LSR2 (g0/0/0/1)"
},
"subinterfaces": {
"subinterface": [
{
"index": 0,
"openconfig-if-ip:ipv4": {
"addresses": {
"address": [
{
"ip": "172.16.1.2",
"config": {
"ip": "172.16.1.2",
"prefix-length": 31
}
}
]
}
}
}
]
}
}
]
}
}

File renamed without changes.
2 changes: 1 addition & 1 deletion grpc/openconfig-if-ip.yang
2 changes: 1 addition & 1 deletion grpc/openconfig-interfaces.yang
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 1 addition & 2 deletions grpc/merge-config-xr-isis.json → grpc/xr-isis-cfg.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
"metric-style": [
{
"level": "not-set",
"style": "new-metric-style",
"transition-state": "disabled"
"style": "new-metric-style"
}
]
}
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion md-api/Cisco-IOS-XR-ip-rib-ipv4-oper.yang
2 changes: 1 addition & 1 deletion md-api/Cisco-IOS-XR-ipv4-bgp-cfg.yang
2 changes: 1 addition & 1 deletion md-api/Cisco-IOS-XR-ipv4-bgp-oper.yang
2 changes: 1 addition & 1 deletion md-api/Cisco-IOS-XR-mpls-ldp-cfg.yang
2 changes: 1 addition & 1 deletion md-api/Cisco-IOS-XR-mpls-ldp-oper.yang
20 changes: 9 additions & 11 deletions md-api/nc-create-xr-ipv4-bgp-cfg-99-ydk.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#!/usr/bin/env python3
#
# Copyright 2016 Cisco Systems, Inc.
# Copyright 2018 Cisco Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -29,7 +29,7 @@
"""

from argparse import ArgumentParser
from urlparse import urlparse
import urllib.parse

from ydk.services import CRUDService
from ydk.providers import NetconfServiceProvider
Expand All @@ -52,7 +52,7 @@ def config_bgp(bgp):
four_byte_as.as_ = 65172
four_byte_as.bgp_running = Empty()
global_af = four_byte_as.default_vrf.global_.global_afs.GlobalAf()
global_af.af_name = xr_ipv4_bgp_datatypes.BgpAddressFamilyEnum.vp_nv4_unicast
global_af.af_name = xr_ipv4_bgp_datatypes.BgpAddressFamily.vpnv4_unicast
global_af.enable = Empty()
four_byte_as.default_vrf.global_.global_afs.global_af.append(global_af)

Expand All @@ -63,7 +63,7 @@ def config_bgp(bgp):
neighbor.remote_as.as_yy = 65172
neighbor.update_source_interface = "Loopback0"
neighbor_af = neighbor.neighbor_afs.NeighborAf()
neighbor_af.af_name = xr_ipv4_bgp_datatypes.BgpAddressFamilyEnum.vp_nv4_unicast
neighbor_af.af_name = xr_ipv4_bgp_datatypes.BgpAddressFamily.vpnv4_unicast
neighbor_af.activate = Empty()
neighbor.neighbor_afs.neighbor_af.append(neighbor_af)
four_byte_as.default_vrf.bgp_entity.neighbors.neighbor.append(neighbor)
Expand All @@ -72,12 +72,12 @@ def config_bgp(bgp):
vrf = four_byte_as.vrfs.Vrf()
vrf.vrf_name = "RED"
vrf.vrf_global.exists = Empty()
vrf.vrf_global.route_distinguisher.type = xr_ipv4_bgp_cfg.BgpRouteDistinguisherEnum.as_
vrf.vrf_global.route_distinguisher.type = xr_ipv4_bgp_cfg.BgpRouteDistinguisher.as_
vrf.vrf_global.route_distinguisher.as_ = 65172
vrf.vrf_global.route_distinguisher.as_xx = 0
vrf.vrf_global.route_distinguisher.as_index = 0
vrf_global_af = vrf.vrf_global.vrf_global_afs.VrfGlobalAf()
vrf_global_af.af_name = xr_ipv4_bgp_datatypes.BgpAddressFamilyEnum.ipv4_unicast
vrf_global_af.af_name = xr_ipv4_bgp_datatypes.BgpAddressFamily.ipv4_unicast
vrf_global_af.enable = Empty()
vrf_global_af.connected_routes = vrf_global_af.ConnectedRoutes()
vrf_global_af.connected_routes.default_metric = 10
Expand All @@ -90,7 +90,6 @@ def config_bgp(bgp):
bgp.instance.append(instance)



if __name__ == "__main__":
"""Execute main program."""
parser = ArgumentParser()
Expand All @@ -99,12 +98,12 @@ def config_bgp(bgp):
parser.add_argument("device",
help="NETCONF device (ssh://user:password@host:port)")
args = parser.parse_args()
device = urlparse(args.device)
device = urllib.parse.urlparse(args.device)

# log debug messages if verbose argument specified
if args.verbose:
logger = logging.getLogger("ydk")
logger.setLevel(logging.DEBUG)
logger.setLevel(logging.INFO)
handler = logging.StreamHandler()
formatter = logging.Formatter(("%(asctime)s - %(name)s - "
"%(levelname)s - %(message)s"))
Expand All @@ -126,6 +125,5 @@ def config_bgp(bgp):
# create configuration on NETCONF device
crud.create(provider, bgp)

provider.close()
exit()
# End of script
11 changes: 5 additions & 6 deletions md-api/nc-create-xr-mpls-ldp-cfg-99-ydk.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#!/usr/bin/env python3
#
# Copyright 2016 Cisco Systems, Inc.
# Copyright 2018 Cisco Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -29,7 +29,7 @@
"""

from argparse import ArgumentParser
from urlparse import urlparse
import urllib.parse

from ydk.services import CRUDService
from ydk.providers import NetconfServiceProvider
Expand Down Expand Up @@ -63,12 +63,12 @@ def config_mpls_ldp(mpls_ldp):
parser.add_argument("device",
help="NETCONF device (ssh://user:password@host:port)")
args = parser.parse_args()
device = urlparse(args.device)
device = urllib.parse.urlparse(args.device)

# log debug messages if verbose argument specified
if args.verbose:
logger = logging.getLogger("ydk")
logger.setLevel(logging.DEBUG)
logger.setLevel(logging.INFO)
handler = logging.StreamHandler()
formatter = logging.Formatter(("%(asctime)s - %(name)s - "
"%(levelname)s - %(message)s"))
Expand All @@ -90,6 +90,5 @@ def config_mpls_ldp(mpls_ldp):
# create configuration on NETCONF device
crud.create(provider, mpls_ldp)

provider.close()
exit()
# End of script
Loading

0 comments on commit a4e4ca6

Please sign in to comment.