Listing IP addresses with site names #11603
Unanswered
markkuleinio
asked this question in
Q&A
Replies: 1 comment
-
have you figured this out? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I was faced with a need to list IP addresses + descriptions along with the site names, in the GUI.
As it currently is, there is no relation between IP addresses and sites. My first attempt to tackle this is a script:
ObjectVar
to get the tenant that the user is interested inip_addresses = IPAddress.objects.filter(tenant=data["tenant"])
)prefix = Prefix.objects.get(prefix=str(ip.address.cidr))
self.log_info()
to output markdown with text (and links) showing the site name and IP address + descriptionThis works as rough output, gets me numbered lines with whatever text (markdown) I want.
Is there a more clever way to output this as "NetBox-like" list of objects, with sorting and maybe filtering? Could a plugin do that?
I have plenty of experience using NetBox API but not these other ways of dealing with NetBox data (scripts, reports, plugins). I have always said that user input and data presentation are the hardest in everything 😄
Beta Was this translation helpful? Give feedback.
All reactions