Making an api call in netbox

184 views
Skip to first unread message

Anesu Mukanya

unread,
Aug 14, 2021, 7:19:34 AM8/14/21
to NetBox
Hello, 
I want to make an api call to the endpoint /ipam/ip-addresses/ however i would like to add a search filter so that i can get results where a custom field has values set in them. Can you please help and also i would like to get all the values from one call, they exceed 2000.How do i go about it.

I have been using offset like so
and getting results but i dont want to use offsets as this could affect the program that i am building since i want it to be dynamic in the sense that even if a call is made later it can have effect on newly created fields.

Anesu Mukanya

unread,
Aug 16, 2021, 7:08:15 AM8/16/21
to NetBox
I got it. what i had to do was to use
and in the configuration file set MAX-PAGE to None 
and make the calls. hope this helps someone else
now i can then target the last fields by looping through the ids
like so tenant = results[i]['tenant']['display'] this returns a tenant at id i.. even 
after 50



--
You received this message because you are subscribed to the Google Groups "NetBox" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netbox-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netbox-discuss/67343335-a058-47a4-855c-e0830cecf9abn%40googlegroups.com.

Anesu Mukanya

unread,
Aug 16, 2021, 7:10:43 AM8/16/21
to NetBox
netbox has it that there are security issues associated with getting a lof calls above 1000 guese the workaround would be to switch
the MAX-PAGE setting if the script is not oftenly used
Reply all
Reply to author
Forward
0 new messages