[pve-devel] [PATCH v4 pve-network 10/33] api: add endpoints for managing PVE IPAM

DERUMIER, Alexandre alexandre.derumier at groupe-cyllene.com
Mon Nov 20 17:25:49 CET 2023


On 11/20/23 13:28, DERUMIER, Alexandre wrote:
> Hi,
> 
> > > I'll look again into this, maybe POST / PUT / DELETE
> > > `/ipams/pve/mapping` or `/ipams/pve/ip` would be a good
> > > alternative
> > > here? We need to move away from MAC addresses as a unique
> > > identifier
> > > anyway (since with dual-stack there can be multiple IP addresses
> > > for
> > > the same MAC address) so I would need to adjust those endpoints
> > > anyway to
> > > work on IP/MAC pairings).
> 
> > > So the endpoints would then look like this:
> > > 
> > > GET /ipams/pve
> > > 
> > > POST /ipams/pve/ip
> > > PUT /ipams/pve/ip
> > > DELETE /ipams/pve/ip
> 
> 
> You should use plugin name in path    ,for me it should work with any
> ipam plugin
> 
> 
> so, simply : "/ipams/ip"

>>Not sure about this, since the endpoint returns the state of the PVE
>>IPAM and never returns the state of Netbox IPAM, for instance. Since
>>if
>>you want to inspect that state you would use the Netbox API / Web UI.
>>For that reason it would make sense for me to use pve in the API
path.


I think it could be great to be able to manage external ipam the
future, for example, if you only want to display only proxmox
subnets/ips from the proxmox gui, without need to give access to real
external ipam.




> So, I think that theses should be subpath of subnets
> 
> /subnets/<subnetid/ips

>>This sounds like a good idea - and is probably better than what I
>>proposed. I'll quickly talk with Thomas about this.
>>
>>What would you think about adding it to /vnets instead of subnets?
>>
>>Since the API endpoints are calling the VNets functions - which are
>>mostly calling the Subnet-Functions, yes - but they require less
>>parameters and are therefore easier to handle because we don't have
>>to
>>send too much (implicitly available) information to/from the
frontend.


Thinking about that, I wonder if it should be should be located in the
zone path
(as you can have duplicated ips in duplicate subnet in 2 zones)


listing
-------
/zone/<zoneid>/ips 

f you want to list all ips in 1 api call.  (if we put it on vnet or
subnet, we'll need multiple api call)


add|del|update an ip
-----------------------
/zone/<zoneid>/ips/<ip>

just loop on the subnets, the zoneid is in the subnetid




More information about the pve-devel mailing list