From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <s.hanreich@proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by lists.proxmox.com (Postfix) with ESMTPS id A0FC89B39C
 for <pve-devel@lists.proxmox.com>; Mon, 20 Nov 2023 13:34:54 +0100 (CET)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
 by firstgate.proxmox.com (Proxmox) with ESMTP id 73914190A8
 for <pve-devel@lists.proxmox.com>; Mon, 20 Nov 2023 13:34:24 +0100 (CET)
Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com
 [94.136.29.106])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by firstgate.proxmox.com (Proxmox) with ESMTPS
 for <pve-devel@lists.proxmox.com>; Mon, 20 Nov 2023 13:34:23 +0100 (CET)
Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1])
 by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 29D394343C;
 Mon, 20 Nov 2023 13:34:23 +0100 (CET)
Message-ID: <e79be82a-fc28-433e-ad24-2fda2faa7a95@proxmox.com>
Date: Mon, 20 Nov 2023 13:34:22 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: "DERUMIER, Alexandre" <alexandre.derumier@groupe-cyllene.com>,
 "pve-devel@lists.proxmox.com" <pve-devel@lists.proxmox.com>,
 "t.lamprecht@proxmox.com" <t.lamprecht@proxmox.com>
References: <20231117114011.834002-1-s.hanreich@proxmox.com>
 <20231117114011.834002-11-s.hanreich@proxmox.com>
 <c7bb0c66-d789-4bce-86a3-b840a276be9b@proxmox.com>
 <bd53c06c-ee8d-4a79-a9ca-8c6218b5c215@proxmox.com>
 <b2aa57480a10b647540262e2642caee18d100f82.camel@groupe-cyllene.com>
From: Stefan Hanreich <s.hanreich@proxmox.com>
In-Reply-To: <b2aa57480a10b647540262e2642caee18d100f82.camel@groupe-cyllene.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-SPAM-LEVEL: Spam detection results:  0
 AWL 0.275 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DMARC_MISSING             0.1 Missing DMARC policy
 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment
 POISEN_SPAM_PILL          0.1 Meta: its spam
 POISEN_SPAM_PILL_1        0.1 random spam to be learned in bayes
 POISEN_SPAM_PILL_3        0.1 random spam to be learned in bayes
 SPF_HELO_NONE           0.001 SPF: HELO does not publish an SPF Record
 SPF_PASS               -0.001 SPF: sender matches SPF record
 T_SCC_BODY_TEXT_LINE    -0.01 -
Subject: Re: [pve-devel] [PATCH v4 pve-network 10/33] api: add endpoints for
 managing PVE IPAM
X-BeenThere: pve-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/>
List-Post: <mailto:pve-devel@lists.proxmox.com>
List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe>
X-List-Received-Date: Mon, 20 Nov 2023 12:34:54 -0000

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.

> 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.