def delete_link( self, session_id, node_one_id, node_two_id, interface_one_id=None, interface_two_id=None, ): """ Delete a link between nodes. :param int session_id: session id :param int node_one_id: node one id :param int node_two_id: node two id :param int interface_one_id: node one interface id :param int interface_two_id: node two interface id :return: response with result of success or failure :rtype: core_pb2.DeleteLinkResponse :raises grpc.RpcError: when session doesn't exist """ request = core_pb2.DeleteLinkRequest( session_id=session_id, node_one_id=node_one_id, node_two_id=node_two_id, interface_one_id=interface_one_id, interface_two_id=interface_two_id, ) return self.stub.DeleteLink(request)
def delete_link(self, session_id: int, link: wrappers.Link, source: str = None) -> bool: """ Delete a link between nodes. :param session_id: session id :param link: link to delete :param source: application source :return: response with result of success or failure :raises grpc.RpcError: when session doesn't exist """ iface1_id = link.iface1.id if link.iface1 else None iface2_id = link.iface2.id if link.iface2 else None request = core_pb2.DeleteLinkRequest( session_id=session_id, node1_id=link.node1_id, node2_id=link.node2_id, iface1_id=iface1_id, iface2_id=iface2_id, source=source, ) response = self.stub.DeleteLink(request) return response.result