Re: [openwisp] using device context with static ip definition

2020-03-30 Thread Federico Capoano
Hey João, On Mon, Mar 30, 2020 at 1:06 PM João Henrique Albuquerque < joaohcca...@gmail.com> wrote: > I've made some more progress in a solution for my initial issue using > openwisp_ipam. I've managed to request an IP address and save the resulting > ip in the subnet with my signal function,

Re: [openwisp] using device context with static ip definition

2020-03-30 Thread João Henrique Albuquerque
I've made some more progress in a solution for my initial issue using openwisp_ipam. I've managed to request an IP address and save the resulting ip in the subnet with my signal function, now I need to assign to the static interface config of the device I'm trying to save. I've defined the

Re: [openwisp] using device context with static ip definition

2020-03-03 Thread João Henrique Albuquerque
Hi, just a little follow up on this topic, I've set up a git to work on a custom app called DeviceIP. you can check my progress here 1. I've added the openwisp_ipam and my DeviceIP app to the openwisp-controller project.

Re: [openwisp] using device context with static ip definition

2020-02-06 Thread Federico Capoano
Sorry, I meant one ForeignKey to the Device model of openwisp-controller and one to the Ip model of openwisp-ipam. You may as well create an admin inline and add it to the DeviceAdmin dynamically (it's called monkey patching) so you'll be able to see this in the django admin. Here's an example

Re: [openwisp] using device context with static ip definition

2020-02-06 Thread João Henrique Albuquerque
Just for clarifcation did you mean two ForeignKey pointing to the Device ? Shouldn't one be pointing to device config or device context? Creating a new django app in which you add a new model, eg: DeviceIp, in > which you add a ForeignKey field pointing to Device and a ForeignKey > pointing to

Re: [openwisp] using device context with static ip definition

2020-02-06 Thread Federico Capoano
There's no documentation on how to accomplish that yet, but we will help you out. If you do accomplish it and will want to share your solution I believe it will be beneficial to the community. As first thing, I suggest you to implement this in development mode (not on your instance). Creating a

Re: [openwisp] using device context with static ip definition

2020-02-05 Thread João Henrique Albuquerque
Thanks for the pointers, Oliver. I'll look into it later Em qua., 5 de fev. de 2020 às 17:39, Oliver Kraitschy escreveu: > On Wed, Feb 05, 2020 at 05:15:43PM -0300, João Henrique Albuquerque wrote: > > > > About the signal on device creation, I should probably do it under the DB > > I'm using,

Re: [openwisp] using device context with static ip definition

2020-02-05 Thread Oliver Kraitschy
On Wed, Feb 05, 2020 at 05:15:43PM -0300, João Henrique Albuquerque wrote: > > About the signal on device creation, I should probably do it under the DB > I'm using, right? > E.g, when a new entry is made to the config_device tables update the field > with context straight to the backend of the

Re: [openwisp] using device context with static ip definition

2020-02-05 Thread João Henrique Albuquerque
Thanks for the suggestions, Is there any documentation that you could help me get started with openwisp-ipam? About the signal on device creation, I should probably do it under the DB I'm using, right? E.g, when a new entry is made to the config_device tables update the field with context

Re: [openwisp] using device context with static ip definition

2020-02-05 Thread Federico Capoano
There's no out of the box solution to this yet. The simplest custom solution I can think of is to hook a signal on device creation which fills the context field accordingly. An even better solution could be to add openwisp-ipam to the instance, creating an ip each time and getting the first