diff options
author | Tibor Frank <tifrank@cisco.com> | 2016-04-28 15:44:25 +0200 |
---|---|---|
committer | Matej Klotton <mklotton@cisco.com> | 2016-05-06 14:57:37 +0000 |
commit | 07c0ae2e49665961af4a8b9734218e9c5f8cd3ca (patch) | |
tree | 7b8812a31aa56bb2cade01fa7b49428c85db522c /resources/libraries/python/HoneycombSetup.py | |
parent | 2e6b88e7c414e31336fd6644143b257e94b89624 (diff) |
Honeycomb API keywords - interface, bridge domain
- add keywords to manipulate data using Honeycomb REST API to configure
interfaces and bridge domains
- remove "add_vpp_to_honeycomb_network_topology" method from
HoneycombSetup.py
- remove "parse_json_response" from HoneycombUtil.py
- add methods to manipulate data from Honeycomb REST API
Change-Id: I5e6f87097fe9bfccffa3d4aae21f63281353cf29
Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'resources/libraries/python/HoneycombSetup.py')
-rw-r--r-- | resources/libraries/python/HoneycombSetup.py | 92 |
1 files changed, 0 insertions, 92 deletions
diff --git a/resources/libraries/python/HoneycombSetup.py b/resources/libraries/python/HoneycombSetup.py index bd2f3087c4..979b501522 100644 --- a/resources/libraries/python/HoneycombSetup.py +++ b/resources/libraries/python/HoneycombSetup.py @@ -13,8 +13,6 @@ """Implementation of keywords for Honeycomb setup.""" -from xml.etree import ElementTree as ET - from robot.api import logger from resources.libraries.python.topology import NodeType @@ -186,93 +184,3 @@ class HoneycombSetup(object): logger.info("Honeycomb on node {0} has stopped". format(node['host'])) return True - - @staticmethod - def add_vpp_to_honeycomb_network_topology(nodes): - """Add vpp node to Honeycomb network topology. - - :param nodes: All nodes in test topology. - :type nodes: dict - :return: Status code and response content from PUT requests. - :rtype: tuple - :raises HoneycombError: If a node was not added to Honeycomb topology. - - Reads HTML path from template file config_topology_node.url. - Path to the node to be added, e.g.: - ("/restconf/config/network-topology:network-topology" - "/topology/topology-netconf/node/") - There must be "/" at the end, as generated node name is added at the - end. - - Reads payload data from template file add_vpp_to_topology.xml. - Information about node as XML structure, e.g.: - <node xmlns="urn:TBD:params:xml:ns:yang:network-topology"> - <node-id> - {vpp_host} - </node-id> - <host xmlns="urn:opendaylight:netconf-node-topology"> - {vpp_ip} - </host> - <port xmlns="urn:opendaylight:netconf-node-topology"> - {vpp_port} - </port> - <username xmlns="urn:opendaylight:netconf-node-topology"> - {user} - </username> - <password xmlns="urn:opendaylight:netconf-node-topology"> - {passwd} - </password> - <tcp-only xmlns="urn:opendaylight:netconf-node-topology"> - false - </tcp-only> - <keepalive-delay xmlns="urn:opendaylight:netconf-node-topology"> - 0 - </keepalive-delay> - </node> - NOTE: The placeholders: - {vpp_host} - {vpp_ip} - {vpp_port} - {user} - {passwd} - MUST be there as they are replaced by correct values. - """ - path = HcUtil.read_path_from_url_file("config_topology_node") - try: - xml_data = ET.parse("{0}/add_vpp_to_topology.xml". - format(Const.RESOURCES_TPL_HC)) - except ET.ParseError as err: - raise HoneycombError(repr(err)) - data = ET.tostring(xml_data.getroot()) - - headers = {"Content-Type": "application/xml"} - - status_codes = [] - responses = [] - for node_name, node in nodes.items(): - if node['type'] == NodeType.DUT: - try: - payload = data.format( - vpp_host=node_name, - vpp_ip=node["host"], - vpp_port=node['honeycomb']["netconf_port"], - user=node['honeycomb']["user"], - passwd=node['honeycomb']["passwd"]) - status_code, resp = HTTPRequest.put( - node=node, - path="{0}/{1}".format(path, node_name), - headers=headers, - payload=payload) - if status_code != HTTPCodes.OK: - raise HoneycombError( - "VPP {0} was not added to topology. " - "Status code: {1}.".format(node["host"], - status_code)) - - status_codes.append(status_code) - responses.append(resp) - - except HTTPRequestError as err: - raise HoneycombError("VPP {0} was not added to topology.". - format(node["host"]), repr(err)) - return status_codes, responses |