-def mount_device(node_id, sim):
- url = "{}/data/network-topology:network-topology/topology=topology-netconf/node={}"
- body = {"node": [{
- "node-id": node_id,
- "netconf-node-topology:username": NODES_LOGIN,
- "netconf-node-topology:password": NODES_PWD,
- "netconf-node-topology:host": "127.0.0.1",
- "netconf-node-topology:port": SIMS[sim]['port'],
- "netconf-node-topology:tcp-only": "false",
- "netconf-node-topology:pass-through": {}}]}
- response = put_request(url.format('{}', node_id), body)
- if wait_until_log_contains(TPCE_LOG, re.escape("Triggering notification stream NETCONF for node " + node_id), 180):
- print("Node " + node_id + " correctly added to tpce topology", end='... ', flush=True)
+def mount_device(node: str, sim: str):
+ url = {'rfc8040': '{}/data/network-topology:network-topology/topology=topology-netconf/node={}',
+ 'draft-bierman02': '{}/config/network-topology:network-topology/topology/topology-netconf/node/{}'}
+ body = {'node': [{
+ 'node-id': node,
+ 'netconf-node-topology:username': NODES_LOGIN,
+ 'netconf-node-topology:password': NODES_PWD,
+ 'netconf-node-topology:host': '127.0.0.1',
+ 'netconf-node-topology:port': SIMS[sim]['port'],
+ 'netconf-node-topology:tcp-only': 'false',
+ 'netconf-node-topology:pass-through': {}}]}
+ response = put_request(url[RESTCONF_VERSION].format('{}', node), body)
+ if wait_until_log_contains(TPCE_LOG, re.escape('Triggering notification stream NETCONF for node ' + node), 180):
+ print('Node ' + node + ' correctly added to tpce topology', end='... ', flush=True)