This repository has been archived on 2025-03-20. You can view files and clone it, but cannot push or open issues or pull requests.
sonic-buildimage/src/sonic-yang-mgmt/tests/libyang-python-tests/sample_config_db.json
Praveen Chaudhary 0ccdd70671
[sonic-yang-mgmt]: sonic-yang-mgmt package for configuration validation. (#3861)
**- What I did**

#### wheel package Makefiles

- wheel package Makefiles for sonic-yang-mgmt package.

#### libyang Python APIs:
- python APIs based on libyang
- functions to load/merge yang models and Yang data files
- function to validate data trees based on Yang models
- functions to merge yang data files/trees
- add/set/delete node in schema and data trees
- find data/schema nodes from xpath from the Yang data/schema tree in memory
- find dependencies
- dump the data tree in json/xml

#### Extension of libyang Python APIs:
-- Cropping input config based on Yang Model.
-- Translate input config based on Yang Model.
-- rev Translate input config based on Yang Model.
-- Find xpath of port, portleaf and a yang list.
-- Find if node is key of a list while deletion if yes, then delete the parent.

Signed-off-by: Praveen Chaudhary pchaudhary@linkedin.com
Signed-off-by: Ping Mao pmao@linkedin.com
2020-05-21 16:27:57 -07:00

649 lines
12 KiB
JSON

{
"VLAN_INTERFACE": {
"Vlan111|2a04:5555:45:6709::1/64": {
"scope": "global",
"family": "IPv6"
},
"Vlan111|10.222.10.65/26": {
"scope": "global",
"family": "IPv4"
},
"Vlan111|fe80::1/10": {
"scope": "local",
"family": "IPv6"
},
"Vlan777|2a04:5555:41:4e9::1/64": {
"scope": "global",
"family": "IPv6"
},
"Vlan777|10.111.58.65/26": {
"scope": "global",
"family": "IPv4"
},
"Vlan777|fe80::1/10": {
"scope": "local",
"family": "IPv6"
}
},
"ACL_RULE": {
"V4-ACL-TABLE|DEFAULT_DENY": {
"PACKET_ACTION": "DROP",
"IP_TYPE": "IPv4ANY",
"PRIORITY": "0"
},
"V4-ACL-TABLE|Rule_20": {
"PACKET_ACTION": "FORWARD",
"DST_IP": "10.222.72.0/26",
"SRC_IP": "10.222.0.0/15",
"PRIORITY": "777780",
"IP_TYPE": "IPv4ANY"
},
"V4-ACL-TABLE|Rule_40": {
"PACKET_ACTION": "FORWARD",
"DST_IP": "10.222.72.64/26",
"SRC_IP": "10.222.0.0/15",
"PRIORITY": "777760",
"IP_TYPE": "IPv4ANY"
},
"V4-ACL-TABLE|Rule_60": {
"PACKET_ACTION": "FORWARD",
"DST_IP": "10.222.80.0/26",
"SRC_IP": "10.222.0.0/15",
"PRIORITY": "777740",
"IP_TYPE": "IPv4ANY"
},
"V4-ACL-TABLE|Rule_80": {
"PACKET_ACTION": "FORWARD",
"DST_IP": "10.222.80.64/26",
"SRC_IP": "10.222.0.0/15",
"PRIORITY": "777720",
"IP_TYPE": "IPv4ANY"
},
"V4-ACL-TABLE|Rule_111": {
"PACKET_ACTION": "FORWARD",
"DST_IP": "10.152.17.52/32",
"SRC_IP": "10.222.0.0/15",
"PRIORITY": "777700",
"IP_TYPE": "IPv4ANY"
},
"V4-ACL-TABLE|Rule_120": {
"PACKET_ACTION": "FORWARD",
"DST_IP": "10.252.208.41/32",
"SRC_IP": "10.222.0.0/15",
"PRIORITY": "777880",
"IP_TYPE": "IPv4ANY"
},
"V4-ACL-TABLE|Rule_140": {
"PACKET_ACTION": "FORWARD",
"DST_IP": "10.148.128.245/32",
"SRC_IP": "10.222.0.0/15",
"PRIORITY": "777860",
"IP_TYPE": "IPv4ANY"
},
"V4-ACL-TABLE|Rule_160": {
"PACKET_ACTION": "FORWARD",
"DST_IP": "10.222.1.245/32",
"SRC_IP": "10.222.0.0/15",
"PRIORITY": "777840",
"IP_TYPE": "IPv4ANY"
},
"V4-ACL-TABLE|Rule_180": {
"PACKET_ACTION": "FORWARD",
"DST_IP": "10.252.222.21/32",
"SRC_IP": "10.222.0.0/15",
"PRIORITY": "777820",
"IP_TYPE": "IPv4ANY"
},
"V4-ACL-TABLE|Rule_9000": {
"PACKET_ACTION": "DROP",
"DST_IP": "0.0.0.0/0",
"SRC_IP": "10.222.0.0/15",
"PRIORITY": "991110",
"IP_TYPE": "IPv4ANY"
},
"V4-ACL-TABLE|Rule_11100": {
"PACKET_ACTION": "FORWARD",
"DST_IP": "0.0.0.0/0",
"SRC_IP": "0.0.0.0/0",
"PRIORITY": "990000",
"IP_TYPE": "IPv4ANY"
},
"V6-ACL-TBLE|DEFAULT_DENY": {
"PACKET_ACTION": "DROP",
"IP_TYPE": "IPv6ANY",
"PRIORITY": "0"
},
"V6-ACL-TBLE|Rule_20": {
"PACKET_ACTION": "FORWARD",
"IP_TYPE": "IPv6ANY",
"SRC_IPV6": "2a04:5555:41::/48",
"PRIORITY": "777780",
"DST_IPV6": "2a04:5555:43:320::/64"
},
"V6-ACL-TBLE|Rule_40": {
"PACKET_ACTION": "FORWARD",
"IP_TYPE": "IPv6ANY",
"SRC_IPV6": "2a04:5555:41::/48",
"PRIORITY": "777760",
"DST_IPV6": "2a04:5555:43:321::/64"
},
"V6-ACL-TBLE|Rule_60": {
"PACKET_ACTION": "FORWARD",
"IP_TYPE": "IPv6ANY",
"SRC_IPV6": "2a04:5555:41::/48",
"PRIORITY": "777740",
"DST_IPV6": "2a04:5555:43:340::/64"
},
"V6-ACL-TBLE|Rule_80": {
"PACKET_ACTION": "FORWARD",
"IP_TYPE": "IPv6ANY",
"SRC_IPV6": "2a04:5555:41::/48",
"PRIORITY": "777720",
"DST_IPV6": "2a04:5555:43:341::/64"
},
"V6-ACL-TBLE|Rule_111": {
"PACKET_ACTION": "FORWARD",
"IP_TYPE": "IPv6ANY",
"SRC_IPV6": "2a04:5555:41::/48",
"PRIORITY": "777700",
"DST_IPV6": "2a04:5555:32:12::/64"
},
"V6-ACL-TBLE|Rule_9000": {
"PACKET_ACTION": "DROP",
"IP_TYPE": "IPv6ANY",
"SRC_IPV6": "2a04:5555:41::/48",
"PRIORITY": "991110",
"DST_IPV6": "::/0"
},
"V6-ACL-TBLE|Rule_11100": {
"PACKET_ACTION": "FORWARD",
"IP_TYPE": "IPv6ANY",
"SRC_IPV6": "::/0",
"PRIORITY": "990000",
"DST_IPV6": "::/0"
}
},
"DEVICE_METADATA": {
"localhost": {
"mg_type": "ToR",
"mac": "00:11:22:33:dd:5a",
"hostname": "asw.dc",
"bgp_asn": "64850",
"hwsku": "Stone"
}
},
"VLAN": {
"Vlan111": {
"description": "svlan",
"dhcp_servers": [
"10.222.72.116"
],
"vlanid": "111",
"mtu": "9216",
"admin_status": "up",
"members": [
"Ethernet8",
"Ethernet3",
"Ethernet0",
"Ethernet1",
"Ethernet6",
"Ethernet4",
"Ethernet5",
"Ethernet9",
"Ethernet2",
"Ethernet7",
"Ethernet32",
"Ethernet30",
"Ethernet31",
"Ethernet36",
"Ethernet34",
"Ethernet33",
"Ethernet35",
"Ethernet29",
"Ethernet21",
"Ethernet20",
"Ethernet23",
"Ethernet22",
"Ethernet27",
"Ethernet26",
"Ethernet18",
"Ethernet19",
"Ethernet14",
"Ethernet15",
"Ethernet16",
"Ethernet17",
"Ethernet10",
"Ethernet11",
"Ethernet12",
"Ethernet13",
"Ethernet28"
]
},
"Vlan777": {
"description": "pvlan",
"dhcp_servers": [
"10.222.72.116"
],
"vlanid": "777",
"mtu": "9216",
"admin_status": "up",
"members": [
"Ethernet9",
"Ethernet2",
"Ethernet8",
"Ethernet27",
"Ethernet14",
"Ethernet35"
]
}
},
"DEVICE_NEIGHBOR": {
"Ethernet112": {
"name": "dccsw01.nw",
"port": "Eth18"
},
"Ethernet114": {
"name": "dccsw02.nw",
"port": "Eth18"
},
"Ethernet116": {
"name": "dccsw03.nw",
"port": "Eth18"
},
"Ethernet118": {
"name": "dccsw04.nw",
"port": "Eth18"
}
},
"PORT": {
"Ethernet0": {
"alias": "Eth1/1",
"lanes": "65",
"description": "",
"speed": "11100",
"admin_status": "up"
},
"Ethernet1": {
"alias": "Eth1/2",
"lanes": "66",
"description": "",
"speed": "11100",
"admin_status": "up"
},
"Ethernet2": {
"alias": "Eth1/3",
"lanes": "67",
"description": "",
"speed": "11100",
"admin_status": "up"
},
"Ethernet3": {
"alias": "Eth1/4",
"lanes": "68",
"description": "",
"speed": "11100",
"admin_status": "up"
},
"Ethernet4": {
"alias": "Eth2/1",
"lanes": "69",
"description": "",
"speed": "11100",
"admin_status": "up"
},
"Ethernet5": {
"alias": "Eth2/2",
"lanes": "70",
"description": "",
"speed": "11100",
"admin_status": "up"
},
"Ethernet6": {
"alias": "Eth2/3",
"lanes": "71",
"description": "",
"speed": "11100",
"admin_status": "up"
},
"Ethernet7": {
"alias": "Eth2/4",
"lanes": "72",
"description": "",
"speed": "11100",
"admin_status": "up"
},
"Ethernet8": {
"alias": "Eth3/1",
"lanes": "73",
"description": "",
"speed": "11100",
"admin_status": "up"
},
"Ethernet9": {
"alias": "Eth3/2",
"lanes": "74",
"description": "",
"speed": "11100",
"admin_status": "up"
},
"Ethernet10": {
"alias": "Eth3/3",
"lanes": "75",
"description": "",
"speed": "11100",
"admin_status": "up"
},
"Ethernet11": {
"alias": "Eth3/4",
"lanes": "76",
"description": "",
"speed": "11100",
"admin_status": "up"
},
"Ethernet12": {
"alias": "Eth4/1",
"lanes": "77",
"description": "",
"speed": "11100",
"admin_status": "up"
},
"Ethernet13": {
"alias": "Eth4/2",
"lanes": "78",
"description": "",
"speed": "11100",
"admin_status": "up"
},
"Ethernet14": {
"alias": "Eth4/3",
"lanes": "79",
"description": "",
"speed": "11100",
"admin_status": "up"
},
"Ethernet15": {
"alias": "Eth4/4",
"lanes": "80",
"description": "",
"speed": "11100",
"admin_status": "up"
},
"Ethernet16": {
"alias": "Eth5/1",
"lanes": "33",
"description": "",
"speed": "11100",
"admin_status": "up"
},
"Ethernet17": {
"alias": "Eth5/2",
"lanes": "34",
"description": "",
"speed": "11100",
"admin_status": "up"
},
"Ethernet18": {
"alias": "Eth5/3",
"lanes": "35",
"description": "",
"speed": "11100",
"admin_status": "up"
},
"Ethernet19": {
"alias": "Eth5/4",
"lanes": "36",
"description": "",
"speed": "11100",
"admin_status": "up"
},
"Ethernet20": {
"alias": "Eth6/1",
"lanes": "37",
"description": "",
"speed": "11100",
"admin_status": "up"
},
"Ethernet21": {
"alias": "Eth6/2",
"lanes": "38",
"description": "",
"speed": "11100",
"admin_status": "up"
},
"Ethernet22": {
"alias": "Eth6/3",
"lanes": "39",
"description": "",
"speed": "11100",
"admin_status": "up"
},
"Ethernet23": {
"alias": "Eth6/4",
"lanes": "40",
"description": "",
"speed": "11100",
"admin_status": "up"
},
"Ethernet24": {
"alias": "Eth7/1",
"lanes": "41",
"description": "",
"speed": "11100",
"admin_status": "up"
},
"Ethernet25": {
"alias": "Eth7/2",
"lanes": "42",
"description": "",
"speed": "11100",
"admin_status": "up"
},
"Ethernet26": {
"alias": "Eth7/3",
"lanes": "43",
"description": "",
"speed": "11100",
"admin_status": "up"
},
"Ethernet27": {
"alias": "Eth7/4",
"lanes": "44",
"description": "",
"speed": "11100",
"admin_status": "up"
},
"Ethernet28": {
"alias": "Eth8/1",
"lanes": "45",
"description": "",
"speed": "11100",
"admin_status": "up"
},
"Ethernet29": {
"alias": "Eth8/2",
"lanes": "46",
"description": "",
"speed": "11100",
"admin_status": "up"
},
"Ethernet30": {
"alias": "Eth8/3",
"lanes": "47",
"description": "",
"speed": "11100",
"admin_status": "up"
},
"Ethernet31": {
"alias": "Eth8/4",
"lanes": "48",
"description": "",
"speed": "11100",
"admin_status": "up"
},
"Ethernet32": {
"alias": "Eth9/1",
"lanes": "49",
"description": "",
"speed": "11100",
"admin_status": "up"
},
"Ethernet33": {
"alias": "Eth9/2",
"lanes": "50",
"description": "",
"speed": "11100",
"admin_status": "up"
},
"Ethernet34": {
"alias": "Eth9/3",
"lanes": "51",
"description": "",
"speed": "11100",
"admin_status": "up"
},
"Ethernet35": {
"alias": "Eth9/4",
"lanes": "52",
"description": "",
"speed": "11100",
"admin_status": "up"
},
"Ethernet36": {
"alias": "Eth10/1",
"lanes": "53",
"description": "",
"speed": "11100",
"admin_status": "up"
},
"Ethernet112": {
"alias": "Eth29/1",
"lanes": "113,114",
"description": "50G|dccsw01.nw|Eth18",
"fec": "fc",
"admin_status": "up"
}
},
"ACL_TABLE": {
"V4-ACL-TABLE": {
"type": "L3",
"policy_desc": "V4-ACL-TABLE",
"ports": [
"Ethernet26",
"Ethernet27",
"Ethernet24"
]
},
"V6-ACL-TBLE": {
"type": "L3V6",
"policy_desc": "V6-ACL-TBLE",
"ports": [
"Ethernet14",
"Ethernet15",
"Ethernet23",
"Ethernet30",
"Ethernet31",
"Ethernet18",
"Ethernet19",
"Ethernet25",
"Ethernet24"
]
}
},
"INTERFACE": {
"Ethernet112|2a04:5555:40:a709::2/126": {
"scope": "global",
"family": "IPv6"
},
"Ethernet112|10.184.228.211/31": {
"scope": "global",
"family": "IPv4"
},
"Ethernet14|2a04:5555:40:a749::2/126": {
"scope": "global",
"family": "IPv6"
},
"Ethernet14|10.184.229.211/31": {
"scope": "global",
"family": "IPv4"
},
"Ethernet16|2a04:5555:40:a789::2/126": {
"scope": "global",
"family": "IPv6"
},
"Ethernet16|10.184.230.211/31": {
"scope": "global",
"family": "IPv4"
},
"Ethernet18|2a04:5555:40:a7c9::2/126": {
"scope": "global",
"family": "IPv6"
},
"Ethernet18|10.184.231.211/31": {
"scope": "global",
"family": "IPv4"
}
},
"VLAN_MEMBER": {
"Vlan111|Ethernet0": {
"tagging_mode": "untagged"
},
"Vlan111|Ethernet1": {
"tagging_mode": "untagged"
},
"Vlan111|Ethernet2": {
"tagging_mode": "untagged"
},
"Vlan111|Ethernet3": {
"tagging_mode": "untagged"
},
"Vlan111|Ethernet4": {
"tagging_mode": "untagged"
},
"Vlan111|Ethernet5": {
"tagging_mode": "untagged"
},
"Vlan111|Ethernet6": {
"tagging_mode": "untagged"
},
"Vlan111|Ethernet29": {
"tagging_mode": "untagged"
},
"Vlan111|Ethernet30": {
"tagging_mode": "untagged"
},
"Vlan111|Ethernet31": {
"tagging_mode": "untagged"
},
"Vlan111|Ethernet32": {
"tagging_mode": "untagged"
},
"Vlan111|Ethernet33": {
"tagging_mode": "untagged"
},
"Vlan111|Ethernet34": {
"tagging_mode": "untagged"
},
"Vlan111|Ethernet35": {
"tagging_mode": "untagged"
},
"Vlan111|Ethernet36": {
"tagging_mode": "untagged"
}
},
"LOOPBACK_INTERFACE": {
"Loopback0|2a04:5555:40:4::4e9/128": {
"scope": "global",
"family": "IPv6"
},
"Loopback0|10.184.8.233/32": {
"scope": "global",
"family": "IPv4"
}
},
"CRM": {
"Config": {
"polling_interval": "0"
}
}
}