Replies: 1 comment
-
There is a JSON bulk-add endpoint for IP addresses, but you'll have to enumerate them yourself (i.e. build a single payload containing a list of 100 separate IP addresses). You POST this list to See: https://docs.netbox.dev/en/stable/integrations/rest-api/#creating-multiple-objects
You can't assume that, because Netbox's web UI doesn't eat its own API dogfood. That is: there is separate code which is specific to UI and forms processing, and it does not internally make use of the REST API. Instead, the web UI and the REST API both talk to the underlying Django ORM. This means there are various things you can do in the web UI, which do not have directly equivalent REST endpoints. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm using Netbox 2.5.13 (can't use higher version)
On the Netbox GUI, I notice there's a way to bulk create multiple IP addresses using a pattern with a mask, for example 10.1.0.[1-100]/24. Is there an equivalent API somewhere that does the same thing, using a JSON as payload? I tried to tweak the URL (used by the GUI) around to see if anything might work, but couldn't find any.
Searching old discussions here yields nothing either.
The demo docs (https://demo.netbox.dev/api/docs/) doesn't seem have bulk-add API for IP addresses. (It's also of a later version. The netbox I'm using doesn't expose API docs, and I'm not sure where to go to see API docs of 2.5.13 version).
However I assume there must be one such API, otherwise what is the GUI using to do its bulk-create?
Sorry if this sounds like a newbie question. I'm quite new to Netbox indeed.
Beta Was this translation helpful? Give feedback.
All reactions