From 353cb00b642934f146a5c3af4c718aff347e0d1e Mon Sep 17 00:00:00 2001 From: Nicklas Gehlen <42550633+N1CK145@users.noreply.github.com> Date: Sat, 9 Nov 2024 00:09:03 +0100 Subject: [PATCH] Add dictionary-style indexing --- pynetbox/core/app.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pynetbox/core/app.py b/pynetbox/core/app.py index 10cc644..908961d 100644 --- a/pynetbox/core/app.py +++ b/pynetbox/core/app.py @@ -113,6 +113,10 @@ def __setstate__(self, d): def __getattr__(self, name): return App(self.api, "plugins/{}".format(name.replace("_", "-"))) + def __getitem__(self, name): + """Allows access to endpoint by dictionary-style indexing.""" + return App(self.api, f"plugins/{name}") + def installed_plugins(self): """Returns raw response with installed plugins