Skip to content
Snippets Groups Projects
Commit fc520898 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Merge branch 'feat/tid-add-interface-information-to-network-instance' into 'develop'

Resolve "(TID) Add interface information to network instance"

See merge request !220
parents 5f07ac38 77c6a4ee
No related branches found
No related tags found
2 merge requests!294Release TeraFlowSDN 4.0,!220Resolve "(TID) Add interface information to network instance"
......@@ -23,6 +23,8 @@ XPATH_NETWORK_INSTANCES = "//ocni:network-instances/ocni:network-instance"
XPATH_NI_PROTOCOLS = ".//ocni:protocols/ocni:protocol"
XPATH_NI_TABLE_CONNECTS = ".//ocni:table-connections/ocni:table-connection"
XPATH_NI_INTERFACE = ".//ocni:interfaces/ocni:interface"
XPATH_NI_IIP_AP = ".//ocni:inter-instance-policies/ocni:apply-policy"
XPATH_NI_IIP_AP_IMPORT = ".//ocni:config/ocni:import-policy"
XPATH_NI_IIP_AP_EXPORT = ".//ocni:config/ocni:export-policy"
......@@ -136,6 +138,21 @@ def parse(xml_data : ET.Element) -> List[Tuple[str, Dict[str, Any]]]:
table_connection['address_family'])
response.append((resource_key, table_connection))
for xml_interface in xml_network_instance.xpath(XPATH_NI_INTERFACE, namespaces=NAMESPACES):
LOGGER.info('xml_interfaces = {:s}'.format(str(ET.tostring(xml_interface))))
interface = {}
name_iface = xml_interface.find('ocni:config/ocni:interface', namespaces=NAMESPACES)
if name_iface is None or name_iface.text is None: continue
add_value_from_tag(interface, 'name_iface', name_iface)
name_subiface = xml_interface.find('ocni:config/ocni:subinterface', namespaces=NAMESPACES)
add_value_from_tag(interface, 'name_subiface', name_subiface)
resource_key = '/network_instance[{:s}]/interface[{:s}]'.format(
network_instance['name'], interface['name_iface'])
response.append((resource_key, interface))
for xml_iip_ap in xml_network_instance.xpath(XPATH_NI_IIP_AP, namespaces=NAMESPACES):
#LOGGER.info('xml_iip_ap = {:s}'.format(str(ET.tostring(xml_iip_ap))))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment