rosrestpy icon indicating copy to clipboard operation
rosrestpy copied to clipboard

how to remove or delete item with API?

Open nmc79 opened this issue 2 years ago • 1 comments

Hi You can guide me how to remove or delete item with your API? I tried test but error.

test = ros.queue.simple(name="Test")[0] ros.queue.simple.remove(test.id) Traceback (most recent call last): File "", line 1, in File "D:\Mikrotik\API\rosrestpy-main\ros_base.py", line 96, in remove self.ros.session.delete(self.filename + f"/{self._getid(o)}") File "D:\Mikrotik\API\rosrestpy-main\ros_base.py", line 64, in _getid assert hasattr(o, "id"), f"{o} didnt have id from the router" AssertionError: *1 didnt have id from the router

nmc79 avatar Jan 15 '24 10:01 nmc79

Just pass the object not the id

test = ros.queue.simple(name="Test")[0]
ros.queue.simple.remove(test)

hexatester avatar Jul 10 '24 14:07 hexatester