Build out writable API #80

Closed
opened 2025-12-29 15:31:45 +01:00 by adam · 19 comments
Owner

Originally created by @netman2048 on GitHub (Jun 29, 2016).

I would like to put in a formal request for writable APIs for the IPAM portion of Netbox. I would love to consider swinging IPAM over to Netbox from Bluecat Address Manager but I have some provisioning scripts that obtain IP's from our existing IPAM when provisioning customers but without that functionality, it won't work for me.

Originally created by @netman2048 on GitHub (Jun 29, 2016). I would like to put in a formal request for writable APIs for the IPAM portion of Netbox. I would love to consider swinging IPAM over to Netbox from Bluecat Address Manager but I have some provisioning scripts that obtain IP's from our existing IPAM when provisioning customers but without that functionality, it won't work for me.
adam closed this issue 2025-12-29 15:31:45 +01:00
Author
Owner

@malaiam commented on GitHub (Jul 27, 2016):

I would also like to see this feature implemented sooner rather than later. I'm considering changing the IPAM we use in preparation for network automation and this is kind of a crucial element.

@malaiam commented on GitHub (Jul 27, 2016): I would also like to see this feature implemented sooner rather than later. I'm considering changing the IPAM we use in preparation for network automation and this is kind of a crucial element.
Author
Owner

@acortina-git commented on GitHub (Aug 4, 2016):

Writable api would be awesome, specially when using with packer/ansible/jenkins

@acortina-git commented on GitHub (Aug 4, 2016): Writable api would be awesome, specially when using with packer/ansible/jenkins
Author
Owner

@dqminh commented on GitHub (Oct 5, 2016):

@jeremystretch is there any ongoing work on this ? is this something that you would like contributions as we would also want to implement IPAM with writeable APIs.

@dqminh commented on GitHub (Oct 5, 2016): @jeremystretch is there any ongoing work on this ? is this something that you would like contributions as we would also want to implement IPAM with writeable APIs.
Author
Owner

@Zanthras commented on GitHub (Nov 18, 2016):

I've been working on a extending out the api to support full write operations on a private branch.

Generally speaking ive been following the url scheme of:

post to /module/resource/add/
put/patch to /module/resource/pk/edit/
delete to /module/resource/pk/delete/

If this fits and is desired I can work on a pull request to merge it back upstream. One thing I havent figured out how to do yet is handle custom fields, so ignoring that for now in favor of making progress.

@Zanthras commented on GitHub (Nov 18, 2016): I've been working on a extending out the api to support full write operations on a private branch. Generally speaking ive been following the url scheme of: post to /module/resource/add/ put/patch to /module/resource/pk/edit/ delete to /module/resource/pk/delete/ If this fits and is desired I can work on a pull request to merge it back upstream. One thing I havent figured out how to do yet is handle custom fields, so ignoring that for now in favor of making progress.
Author
Owner

@koenbud commented on GitHub (Nov 22, 2016):

I am really looking forward to full POST/PUT support too.

@koenbud commented on GitHub (Nov 22, 2016): I am really looking forward to full POST/PUT support too.
Author
Owner

@axlroden commented on GitHub (Nov 28, 2016):

@Zanthras nice!, although I really need custom fields as well so hoping it wont be forgotten.

@axlroden commented on GitHub (Nov 28, 2016): @Zanthras nice!, although I really need custom fields as well so hoping it wont be forgotten.
Author
Owner

@hwinkel commented on GitHub (Nov 30, 2016):

We have a use case where netbox should hold the own IP prefixes but a external IPAM Client is asking for registering a new IP or Prefix in netbox. is this covered by writable API?

@hwinkel commented on GitHub (Nov 30, 2016): We have a use case where netbox should hold the own IP prefixes but a external IPAM Client is asking for registering a new IP or Prefix in netbox. is this covered by writable API?
Author
Owner

@maradwan commented on GitHub (Dec 16, 2016):

writable API is important to integrate it with configuration management tools.

@maradwan commented on GitHub (Dec 16, 2016): writable API is important to integrate it with configuration management tools.
Author
Owner

@jsenecal commented on GitHub (Jan 11, 2017):

Would the jsonapi format be suitable for our needs?

I contributed to "djangorestframework-jsonapi" and would be available to contribute into netbox as well if the future functionality is in line with that format.

Let me know if you welcome contributions on that topic.

@jsenecal commented on GitHub (Jan 11, 2017): Would the jsonapi format be suitable for our needs? I contributed to "djangorestframework-jsonapi" and would be available to contribute into netbox as well if the future functionality is in line with that format. Let me know if you welcome contributions on that topic.
Author
Owner

@InsaneSplash commented on GitHub (Jan 12, 2017):

I'd be interested in the updating of fields of a device using the put/patch methods through the API. One field I would like to update in particular is the "Status" field which I want to use as a tie in to the success/failure of a connection to the device's primary IP. I'm all ready but just found that the PUT/PATCH wasn't supported...

@InsaneSplash commented on GitHub (Jan 12, 2017): I'd be interested in the updating of fields of a device using the put/patch methods through the API. One field I would like to update in particular is the "Status" field which I want to use as a tie in to the success/failure of a connection to the device's primary IP. I'm all ready but just found that the PUT/PATCH wasn't supported...
Author
Owner

@koenbud commented on GitHub (Jan 12, 2017):

@jsenecal For me jsonapi would be perfect.

@koenbud commented on GitHub (Jan 12, 2017): @jsenecal For me jsonapi would be perfect.
Author
Owner

@jeremystretch commented on GitHub (Jan 27, 2017):

Good news! I've started work on API v2.0 and it's going very well. I can't provide an ETA for the beta just yet, but you can keep an eye on the progress by watching the api2 branch.

This is by far the most-requested feature for NetBox, and I realize everyone is eager to try it out. However, I want to make sure we're investing a prudent amount of thought and effort into the new API up front so that we can avoid too many changes down the road.

@jeremystretch commented on GitHub (Jan 27, 2017): Good news! I've started work on API v2.0 and it's going very well. I can't provide an ETA for the beta just yet, but you can keep an eye on the progress by watching [the api2 branch](https://github.com/digitalocean/netbox/tree/api2). This is by far the most-requested feature for NetBox, and I realize everyone is eager to try it out. However, I want to make sure we're investing a prudent amount of thought and effort into the new API up front so that we can avoid too many changes down the road.
Author
Owner

@jbnance commented on GitHub (Feb 7, 2017):

I would like to see this follow the CRUD principle. An example of this can be seen here:

http://www.restapitutorial.com/lessons/httpmethods.html

Basically, you don't have to say, for example, "/something/create", the fact that you are POSTing is an indication that you want to create.

A working example of this can be seen in the Foreman API.

https://theforeman.org/api/1.14/index.html

@jbnance commented on GitHub (Feb 7, 2017): I would like to see this follow the CRUD principle. An example of this can be seen here: http://www.restapitutorial.com/lessons/httpmethods.html Basically, you don't have to say, for example, "/something/create", the fact that you are POSTing is an indication that you want to create. A working example of this can be seen in the Foreman API. https://theforeman.org/api/1.14/index.html
Author
Owner

@jeremystretch commented on GitHub (Feb 7, 2017):

@jbnance Yep, that's the plan. Each object type will generally have two URL endpoints.

  • /api/dcim/devices/ - List devices (GET) or create a new device (POST)
  • /api/dcim/devices/123/ - Retrieve (GET), update (PUT/PATCH), or delete (DELETE) the device with ID 123
@jeremystretch commented on GitHub (Feb 7, 2017): @jbnance Yep, that's the plan. Each object type will generally have two URL endpoints. * /api/dcim/devices/ - List devices (GET) or create a new device (POST) * /api/dcim/devices/123/ - Retrieve (GET), update (PUT/PATCH), or delete (DELETE) the device with ID 123
Author
Owner

@bwks commented on GitHub (Feb 15, 2017):

@jeremystretch are you looking for any contributors for this feature ? This would be really helpful for us and there is a possibility to get some engineering time allocated if so.

@bwks commented on GitHub (Feb 15, 2017): @jeremystretch are you looking for any contributors for this feature ? This would be really helpful for us and there is a possibility to get some engineering time allocated if so.
Author
Owner

@axlroden commented on GitHub (Mar 1, 2017):

Is the branch in any state to be tested/used yet ? Or you still doing breaking changes ?

@axlroden commented on GitHub (Mar 1, 2017): Is the branch in any state to be tested/used yet ? Or you still doing breaking changes ?
Author
Owner

@xbeaudouin commented on GitHub (Mar 7, 2017):

Hello,
The company who I am working for have some python developpers and may help you to build the RW API. How can we be in sync (seem that irc channel is more or less idle for that).
Regards

@xbeaudouin commented on GitHub (Mar 7, 2017): Hello, The company who I am working for have some python developpers and may help you to build the RW API. How can we be in sync (seem that irc channel is more or less idle for that). Regards
Author
Owner

@jeremystretch commented on GitHub (Mar 22, 2017):

Released the first beta of v2.0 today: https://github.com/digitalocean/netbox/releases/tag/v2.0-beta1

Please kick the tires and post to the mailing list or open a bug report for any issues.

@jeremystretch commented on GitHub (Mar 22, 2017): Released the first beta of v2.0 today: https://github.com/digitalocean/netbox/releases/tag/v2.0-beta1 Please kick the tires and post to the mailing list or open a bug report for any issues.
Author
Owner

@jeremystretch commented on GitHub (Mar 23, 2017):

Closing this out as the new API is essentially done. Further development and bug fixes will be handled as part of the beta process.

@jeremystretch commented on GitHub (Mar 23, 2017): Closing this out as the new API is essentially done. Further development and bug fixes will be handled as part of the beta process.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#80