Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to remove or delete item with API? #2

Open
nmc79 opened this issue Jan 15, 2024 · 1 comment
Open

how to remove or delete item with API? #2

nmc79 opened this issue Jan 15, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@nmc79
Copy link

nmc79 commented Jan 15, 2024

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 nmc79 added the bug Something isn't working label Jan 15, 2024
@hexatester
Copy link
Owner

Just pass the object not the id

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants