From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <pve-devel-bounces@lists.proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
	by lore.proxmox.com (Postfix) with ESMTPS id DDBBD1FF16B
	for <inbox@lore.proxmox.com>; Thu, 20 Mar 2025 10:22:18 +0100 (CET)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
	by firstgate.proxmox.com (Proxmox) with ESMTP id 42EA930727;
	Thu, 20 Mar 2025 10:22:17 +0100 (CET)
To: <h.duerr@proxmox.com>, <lou.lecrivain@orange.fr>,
 <pve-devel@lists.proxmox.com>
Date: Thu, 20 Mar 2025 09:22:12 +0000
References: <20250306110831.6426-1-lou.lecrivain@orange.fr>
 <20250306110831.6426-2-lou.lecrivain@orange.fr>
 <08362efa-5bd4-4fd4-b364-d9e14af7196d@proxmox.com>
 <FR2PPF45D006270BAE05B48B2B7C1D2E18F85D92@FR2PPF45D006270.DEUP281.PROD.OUTLOOK.COM>
 <c6ad5335-d12b-4ae0-ad60-e96346684423@proxmox.com>
In-Reply-To: <c6ad5335-d12b-4ae0-ad60-e96346684423@proxmox.com>
MIME-Version: 1.0
Message-ID: <mailman.150.1742462536.416.pve-devel@lists.proxmox.com>
List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com>
List-Post: <mailto:pve-devel@lists.proxmox.com>
From: Lou Lecrivain via pve-devel <pve-devel@lists.proxmox.com>
Precedence: list
Cc: Lou.Lecrivain@wdz.de, jonatan.crystall@gwdg.de
X-Mailman-Version: 2.1.29
X-BeenThere: pve-devel@lists.proxmox.com
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe>
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/>
Reply-To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help>
Subject: Re: [pve-devel] [!!ACHTUNG extern!!] - Re: [!!ACHTUNG extern!!] -
 Re: [PATCH pve-network v3 1/3] ipam: nautobot: base plugin
Content-Type: multipart/mixed; boundary="===============8931150162129054685=="
Errors-To: pve-devel-bounces@lists.proxmox.com
Sender: "pve-devel" <pve-devel-bounces@lists.proxmox.com>

--===============8931150162129054685==
Content-Type: message/rfc822
Content-Disposition: inline

Return-Path: <Lou.Lecrivain@wdz.de>
X-Original-To: pve-devel@lists.proxmox.com
Delivered-To: pve-devel@lists.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 03D25CAA3F
	for <pve-devel@lists.proxmox.com>; Thu, 20 Mar 2025 10:22:16 +0100 (CET)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
	by firstgate.proxmox.com (Proxmox) with ESMTP id D89953070D
	for <pve-devel@lists.proxmox.com>; Thu, 20 Mar 2025 10:22:15 +0100 (CET)
Received: from FR4P281CU032.outbound.protection.outlook.com (mail-germanywestcentralazlp170120004.outbound.protection.outlook.com [IPv6:2a01:111:f403:c20c::4])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange ECDHE (secp384r1) 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>; Thu, 20 Mar 2025 10:22:15 +0100 (CET)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=ERZAt6XWs7nLxDVUkwrBcX6+PC5i3NvBun1PqFcpCP7c4WFuOIitn7u9Ix7zQs1tZidsYojVkrXpLotKRmH9WXSN+QGfbYCUSWrr2GbBp0/VFRRN+cqSdH9S8tOXPRwZpmrlx78NH3kuU9r1+Jgm3CZvQuQFPFweocGgaC3dRVKL1x1LUIPWe6r2fbeMVZuwoImq3jaRqMOOcnQC0iSmio+hEfjnrGc8K/kkm5Bfz78bDYX2O5g4oRMn1lpHnBmhsf3xAMf511dLa7Fbogp+b50velwReTDa/bdAJa6MQ9Ji7XCX5rJQvfx9/p1l9GqgY6UTvHcQtxsLoSO16iAIcw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=0yur3tGYpmrEKZfLQXPZuDqomTIhrehs2NqP9rOnQ1k=;
 b=EQnA87W4wSPOQ4HWMW4cR8vzbHFq58gmqFkfV0uR+SgErqmPJD7VvG5WzC95yXP2zDYkZQUnP3KMSyxIluP+CSePK/oJerKsRes9dex8R198y2zd5hZPwfMPQKTMuh0h6ZF6N162cyV94qvIvTIUU5Dsd5bAm4Ox3SefiM0ByjjY6+Vky0pL3lIi9jS4XjL2yVNvv2em42hZLRMkLhtSt4FzIyjAqTlQCkfXQCFFq59w02eRMeibRz2n0LOALjR5BgUZBSQrdA7V/Y6UL1NhfJCt4f+GKDjG5eF7jHcKxF3S1KqxFgPynwZ4Mv6IkoMCSETj8thBUJUYt3RcxwdUiw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=wdz.de; dmarc=pass action=none header.from=wdz.de; dkim=pass
 header.d=wdz.de; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=lswnetz.onmicrosoft.com; s=selector1-lswnetz-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=0yur3tGYpmrEKZfLQXPZuDqomTIhrehs2NqP9rOnQ1k=;
 b=scvCtyZ1v4i+6oDkeZJxDd0tWmN30aw0k4X5c5lcJ0un5YG8MJNcIva33kF3ZNJlyRkqGVRlEOOLv1IlKfEmROIGJKJ9Imy2x8pGWd7S8gMWMc2sgEPP8XASkxGYiH3v/zF9GWktcdH6BeFuZzcilcuikRSVMvPTymPiFgacBKw=
Received: from FR2PPF45D006270.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d18:2::2e)
 by FR3P281MB1760.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:7f::5) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8534.33; Thu, 20 Mar
 2025 09:22:13 +0000
Received: from FR2PPF45D006270.DEUP281.PROD.OUTLOOK.COM
 ([fe80::e9be:62fd:393f:d4fd]) by FR2PPF45D006270.DEUP281.PROD.OUTLOOK.COM
 ([fe80::e9be:62fd:393f:d4fd%5]) with mapi id 15.20.8534.031; Thu, 20 Mar 2025
 09:22:13 +0000
From: <Lou.Lecrivain@wdz.de>
To: <h.duerr@proxmox.com>, <lou.lecrivain@orange.fr>,
	<pve-devel@lists.proxmox.com>
CC: <jonatan.crystall@gwdg.de>
Subject: RE: [!!ACHTUNG extern!!] - Re: [!!ACHTUNG extern!!] - Re: [PATCH
 pve-network v3 1/3] ipam: nautobot: base plugin
Thread-Topic: [!!ACHTUNG extern!!] - Re: [!!ACHTUNG extern!!] - Re: [PATCH
 pve-network v3 1/3] ipam: nautobot: base plugin
Thread-Index: AQHbmLBJ8S0t9V48vk+WXG6HfcFjVLN6MA4qgABvDoCAASFhVQ==
Date: Thu, 20 Mar 2025 09:22:12 +0000
Message-ID:  <FR2PPF45D00627086D700C9AD27A7B44F2A85D82@FR2PPF45D006270.DEUP281.PROD.OUTLOOK.COM>
References: <20250306110831.6426-1-lou.lecrivain@orange.fr>
 <20250306110831.6426-2-lou.lecrivain@orange.fr>
 <08362efa-5bd4-4fd4-b364-d9e14af7196d@proxmox.com>
 <FR2PPF45D006270BAE05B48B2B7C1D2E18F85D92@FR2PPF45D006270.DEUP281.PROD.OUTLOOK.COM>
 <c6ad5335-d12b-4ae0-ad60-e96346684423@proxmox.com>
In-Reply-To: <c6ad5335-d12b-4ae0-ad60-e96346684423@proxmox.com>
Accept-Language: fr-FR, en-US
Content-Language: fr-FR
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
msip_labels: 
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=wdz.de;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: FR2PPF45D006270:EE_|FR3P281MB1760:EE_
x-ms-office365-filtering-correlation-id: 6c6600e6-655e-4793-f5b0-08dd6790b2c8
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:  BCL:0;ARA:13230040|366016|1800799024|10070799003|376014|38070700018;
x-microsoft-antispam-message-info:  =?Windows-1252?Q?PQTXIMbraWHypBTbP+h1SxEI4LBgoK0NLWeitRXvLmi+/jHa0gExLz6G?=
 =?Windows-1252?Q?KXWjs406tm4shgPVj6eHX+NILfX++6GOx4pto6fy0rJdowHdgGa6sXB5?=
 =?Windows-1252?Q?upx6ouf4ckAdXZDLrgKxo9EJ6vyvyQdrpwaeD6+j1Ccn2zINlQeMBFH/?=
 =?Windows-1252?Q?lBepD2PbP1+pywykJAF8bngwi3m7q99gc0f5JeiybOSfYtGlK7N9kyO9?=
 =?Windows-1252?Q?NA9JfOTArtCd/A2YuozlP9Rqw/Aj8ZZiAKl3HDdeYmTnP4T1i9SWxqkk?=
 =?Windows-1252?Q?usccZ+7vsij0yEjhJBfBfYcwtQtfFiesR/3xkK4v2cDHOsBVs8Oab5Fr?=
 =?Windows-1252?Q?bSb/yc0bkt4RC7gX7RVNSH5J+I3Ar08gAX52I4v8i9MulrqSVOfxe7dq?=
 =?Windows-1252?Q?VPXs9O0NuEGwNwJIhsFJcrzFKGBvzHciaVIpDe+iqYpaD/StTjuJI8cO?=
 =?Windows-1252?Q?ICTu3q+UB5cJ+y7Hn5MlVj3tsKTdaGet3IndTM4Xhf9gU06oKdNwqZPg?=
 =?Windows-1252?Q?+fhQx/W7Dcx/R3AEis11Sk715E7hy4VVNDMFe8lAEnt8BlCduc/V0gdb?=
 =?Windows-1252?Q?4UEs/4qBqsha6/SUYpc9Sga8JQwkBMDtvFmB67hvROHDmBy7loumKxkg?=
 =?Windows-1252?Q?yhrYilWIniESq0W+8n0qujEivjkcE4j9rhFNEBNGgy61ugOhayZk0Rlw?=
 =?Windows-1252?Q?T2buOPFQQsMnIHmsYqUwLLhQHyGvkrXO0e1CjgQGbJi72VQom8Ws2Nmw?=
 =?Windows-1252?Q?1DkAYgARu84RIZ9wQ1IGcTYTDacOijC3bmYayz1IKS1bzNRuEOIBAeZc?=
 =?Windows-1252?Q?QoQzD92ctuMxiCSDBpXnqGiPheBUT1ZqtMdkQI6f6bgqokTRP0E66VOK?=
 =?Windows-1252?Q?pW0ysiPXk2ua0u2tA5YjpvsthtVs0+/SPRnOs2nwp6As6Yf43/9CLu6G?=
 =?Windows-1252?Q?IJ62KdqKnRku+11iX2b6R4MK/cDSQqNm7kZl3v0e7uGGEn2x2WAnbVIT?=
 =?Windows-1252?Q?RDqkHNK1aBEy9vWpzeAaBf6be33c8REehv/2czjHSSRXfcbMl9lTkphJ?=
 =?Windows-1252?Q?zwH89FVGDqYyBksC4pTbTmU/tSlMlwssWuk7Q0k0N8j+2yVYx3dKuzwY?=
 =?Windows-1252?Q?ZA4sT3YgFLQVgJXp3z4AfW5g7krHrKlHG2fuR+e6szO3vusJl/tH7YmE?=
 =?Windows-1252?Q?Q0upRIFfE3Ww03ss7ysb8SSqty6+x5sKItLN88Az8dgHHHOkTnf69iaO?=
 =?Windows-1252?Q?Q2SB8BHZscHUuFpCg/bmox/gDDE/gVIAz8gqHoHPVxSlaZuuGy69pb/5?=
 =?Windows-1252?Q?3yNKHcUuJ4dP1CfprKwCmvdC1J8n3tg8BhufUJ92Un5zks4PVE8jNOZn?=
 =?Windows-1252?Q?rQEAz3i/JxJB+ZZ7XLD+ECpRr2SY+Zm1THmGpvPa06dzMyE1FeoN4672?=
 =?Windows-1252?Q?AHOBFF4pTE/G3nZicdsd+2YZE93z77YFrpnqiLGW/n/jXB9o/cBGMDaU?=
 =?Windows-1252?Q?7dAPeqGLqTTsTyWc/PkJuKoECdMMIpbiTMtHGzG8OGMNwoqw8vU=3D?=
x-forefront-antispam-report:  CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:FR2PPF45D006270.DEUP281.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(10070799003)(376014)(38070700018);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:  =?Windows-1252?Q?pEHMHPb87iHo9wjzmCBlm/6pOZf59icoufd3ZFhl2hIl4ghF+R+7NGop?=
 =?Windows-1252?Q?GnBh8WrQVSU+Hc02TBk7XU5Q4eKM3SotlYt5zoMyoSY8Kbe9ZIzB+q74?=
 =?Windows-1252?Q?KdPs6PSssj6n94Fa+ch8RP2FTNG9g1t00U0oIZK74stRUjkImACVoapx?=
 =?Windows-1252?Q?VF8+6aY3rxZFS/yTdxyyoNO+XTQgrTRQf9rzYzbLKGmFfhCne3a4b+uk?=
 =?Windows-1252?Q?+rcPOU+e1FUnlm5Kq10+ewlq+M6bJLDJSkXwht63UulV1agc1nGsg1OE?=
 =?Windows-1252?Q?o6zURGb4LNDTifGVt74XXsOAJEAfgIYqLFadAFqqDCf2CPEo+Yxm051D?=
 =?Windows-1252?Q?GsX861LPpYuuOAsuzdm9ARqsLgObB9FKK1L5CzA+HRFS6XtR9G0rdT2+?=
 =?Windows-1252?Q?lSsZ6nWtILjLDMVX6hGjYSUUflsIiMKV6C7gax32pMMx0wozulaaHMQt?=
 =?Windows-1252?Q?F+q32CRtIJhQPM2fNsIFPoSMTyYqSS7FGihDF4lV63N0cqfpBW50plHY?=
 =?Windows-1252?Q?QYSsX5oilQCED2gdjFYS7WC+FPmSi2snCdsVDcEOnrxKk5uvmfwbuPrp?=
 =?Windows-1252?Q?PvCunLs5Lxlh9nIhtlfoi3cu/mZTVlYXqWrTrOVlCU0l1EhEoCZZLvu4?=
 =?Windows-1252?Q?DSBJWob3I0EH1N97YIHB7YX3vMbCvo02qvsSXHu+oUTY1ZR6HtoYJbgU?=
 =?Windows-1252?Q?qA/WNbYDVrFn4UMOuEXWklzRKtj6dLqhbG9pBfRKArcSRLHhOZm8RQvC?=
 =?Windows-1252?Q?oqFON8hluQB2qXwSU8BvSV9GdbUbSJM7ymgAoepxje5VFQ+p9x03dL8h?=
 =?Windows-1252?Q?K5X5aEcXo/g/s3X36vdpJHTFOc+9VvejyWWMF7RrLg/OO7WPb8dUINP6?=
 =?Windows-1252?Q?BBMC+M0SJcFLcBuUKsEIp4CEPys1b1HtPshx+bpQdgU3wLop/H8UzOYM?=
 =?Windows-1252?Q?xbP26myRnMGHgR7LxHSzrWlvWBtMsNutaW5boGPULSOgXBY3opNfaYo9?=
 =?Windows-1252?Q?UxsIKEICWulIv9eYS1zZb+JFoB/u7Szc0RvNvCgGM8/fsnScrVKlqy3E?=
 =?Windows-1252?Q?g25lymMllMro1ns8wLrhJb3qJsRPzXGBMlog5qM0r4Xqg7Hi96sXB8yS?=
 =?Windows-1252?Q?PE+ZayOZr1JhjA6ZZfrHUk5DX/7R4MTwjBhIP7/2HJeL+vEjjSr2Q1nE?=
 =?Windows-1252?Q?QUg+oaaMkm7xX5d3vGAfbEEz3VlbhCbKoSzpkvpCTiRBnvlgkLZxsegv?=
 =?Windows-1252?Q?6feRxg6buKm4UyByokjb1cfa9SGxZLM/KOd0iwjAh4ch66lWZDzaT8tg?=
 =?Windows-1252?Q?7JOt7ScYHAwNambBWjElr/jwYdUGajk4zcNTF7D//oLmUFQMt5oWRU2S?=
 =?Windows-1252?Q?Vhwt2FLUjF0Ro36CIUh/fplJVZcZQ45/3ZxiVDPVORDZP5LvJr6ZtvyR?=
 =?Windows-1252?Q?xpuhJmKhbx+OWLlTR1d4EOO7LCjEo5pnljb7FzGlebYc1LwL0Jyo6Mxv?=
 =?Windows-1252?Q?SOytMepsMeonUxYQn1wVE8aHleozgTKRuWssJ8l19KaVxsrT1PEp69bz?=
 =?Windows-1252?Q?B0BcKxjbID2u0P67oMVyfvtdpbaEe7VWRiq+jjvAHZTIEgaCbXmDK8lD?=
 =?Windows-1252?Q?9v3hz18oUCd1gqhRKvo/WjUoPaxJ4rhaxkasRPGwumBPO70L8Wj5CgFz?=
 =?Windows-1252?Q?98ONWWbhn9kX4WzvKNis8hmlU/CQshG+xq5CRcWBAXx+NWHcTFNr+y3a?=
 =?Windows-1252?Q?k+4Obr0nuc6thJ+3oBGRidSrv5hHEka1NQrXqJS0?=
Content-Type: text/plain; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: wdz.de
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: FR2PPF45D006270.DEUP281.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-Network-Message-Id: 6c6600e6-655e-4793-f5b0-08dd6790b2c8
X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Mar 2025 09:22:12.8470
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: d1b757c4-c391-4d47-b0de-c8365891bd6b
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: 8DYRNT1g9hCrvwOg80UPRxt0UQQ+Al11aW2QIMD/D96OwIrwsUJXkM4jws9+yU3uxc2+c7tJVGecq4YCfVLLRA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: FR3P281MB1760
X-SPAM-LEVEL: Spam detection results:  0
	ARC_SIGNED              0.001 Message has a ARC signature
	ARC_VALID               0.001 Message has a valid ARC signature
	AWL                    -0.900 Adjusted score from AWL reputation of From: address
	BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
	DKIM_SIGNED               0.1 Message has a DKIM or DK signature, not necessarily valid
	DKIM_VALID               -0.1 Message has at least one valid DKIM or DK signature
	DMARC_PASS               -0.1 DMARC pass policy
	FORGED_SPF_HELO             1 -
	KAM_ASCII_DIVIDERS        0.8 Email that uses ascii formatting dividers and possible spam tricks
	KAM_MAILER                  2 Automated Mailer Tag Left in Email
	SPF_HELO_PASS          -0.001 SPF: HELO matches SPF record
	T_SPF_PERMERROR          0.01 SPF: test of record failed (permerror)
	URIBL_BLOCKED           0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked.  See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [nautobot.com,lswnetz.onmicrosoft.com]

Regarding the Accept header,=0A=
=0A=
=A0>> sub default_headers {=0A=
=A0>>=A0 =A0=A0 my ($plugin_config) =3D @_;=0A=
=A0>>=A0 =A0=A0 my $token =3D $plugin_config->{token};=0A=
=A0>>=A0 =A0=A0 return [=0A=
=A0>>=A0 =A0=A0 'Content-Type' =3D> "application/json", 'Authorization' =3D=
> "token=0A=
$token",=0A=
=A0>>=A0 =A0=A0 'Accept' =3D> "application/json"=0A=
=A0>>=A0 =A0=A0 ];=0A=
=0A=
> Another question, why did you set Accept to application/json here, is=0A=
> that necessary?=0A=
=0A=
I simply followed the documentation:=0A=
https://docs.nautobot.com/projects/core/en/stable/user-guide/platform-funct=
ionality/rest-api/overview/#creating-a-new-object=0A=
=0A=
They recommend it (and it's also needed if you need to use the API versioni=
ng feature), but afaik it's not *mandatory*. Feel free to delete if not nec=
essary.=0A=
=0A=
BR=0A=
=0A=
________________________________________=0A=
De :=A0Hannes Duerr <h.duerr@proxmox.com>=0A=
Envoy=E9 :=A0mercredi 19 mars 2025 17:01=0A=
=C0 :=A0Lecrivain, Lou (WDZ) <Lou.Lecrivain@wdz.de>; lou.lecrivain@orange.f=
r <lou.lecrivain@orange.fr>; pve-devel@lists.proxmox.com <pve-devel@lists.p=
roxmox.com>=0A=
Cc=A0:=A0jonatan.crystall@gwdg.de <jonatan.crystall@gwdg.de>=0A=
Objet :=A0[!!ACHTUNG extern!!] - Re: [!!ACHTUNG extern!!] - Re: [PATCH pve-=
network v3 1/3] ipam: nautobot: base plugin=0A=
=A0=0A=
=0A=
On 3/19/25 10:50, Lou.Lecrivain@wdz.de wrote:=0A=
> Re,=0A=
>=0A=
> Ok so. Answering on that.=0A=
>=0A=
> By default, the status "Active" already exists for fresh installs. Howeve=
r,=0A=
> since the users are free to define whatever status they want (and delete =
the=0A=
> pre-existing ones!), I thought it'd be best if we checked it did exist fi=
rst.=0A=
> There could be a case where we use a Nautobot instance where the status=
=0A=
> "Active" does not exist. But I agree it's a bit far-fetched.=0A=
>=0A=
> I wrote it this way since IMO it is better to have an explicit error mess=
age=0A=
> rather than something like "incorrect API request" on subsequent API call=
s with=0A=
> potentially no more details.=0A=
=0A=
Sounds sensible, thanks for the clarification!=0A=
=0A=
=A0> sub default_headers {=0A=
=A0>=A0 =A0=A0 my ($plugin_config) =3D @_;=0A=
=A0>=A0 =A0=A0 my $token =3D $plugin_config->{token};=0A=
=A0>=A0 =A0=A0 return [=0A=
=A0>=A0 =A0=A0 'Content-Type' =3D> "application/json", 'Authorization' =3D>=
 "token=0A=
$token",=0A=
=A0>=A0 =A0=A0 'Accept' =3D> "application/json"=0A=
=A0>=A0 =A0=A0 ];=0A=
=0A=
Another question, why did you set Accept to application/json here, is=0A=
that necessary?=0A=
=0A=
> HTH=0A=
>=0A=
> ________________________________________=0A=
> De :=A0Hannes D=FCrr <h.duerr@proxmox.com>=0A=
> Envoy=E9 :=A0mercredi 19 mars 2025 10:21=0A=
> =C0 :=A0lou.lecrivain@orange.fr <lou.lecrivain@orange.fr>; pve-devel@list=
s.proxmox.com <pve-devel@lists.proxmox.com>=0A=
> Cc=A0:=A0jonatan.crystall@gwdg.de <jonatan.crystall@gwdg.de>; Lecrivain, =
Lou (WDZ) <Lou.Lecrivain@wdz.de>=0A=
> Objet :=A0[!!ACHTUNG extern!!] - Re: [PATCH pve-network v3 1/3] ipam: nau=
tobot: base plugin=0A=
>=A0=A0=0A=
>=0A=
> On 3/6/25 12:08, lou.lecrivain@orange.fr wrote:=0A=
>=0A=
> [...]=0A=
>=0A=
>> +sub verify_api {=0A=
>> +=A0=A0=A0 my ($class, $plugin_config) =3D @_;=0A=
>> +=0A=
>> +=A0=A0=A0 my $url =3D $plugin_config->{url};=0A=
>> +=A0=A0=A0 my $namespace =3D $plugin_config->{namespace};=0A=
>> +=A0=A0=A0 my $headers =3D default_headers($plugin_config);=0A=
>> +=0A=
>> +=A0=A0=A0 # check that the namespace exists AND that default IP active =
status=0A=
>> +=A0=A0=A0 # exists AND that we have indeed API access=0A=
>> +=A0=A0=A0 eval {=0A=
>> +=A0=A0=A0=A0 get_namespace_id($url, $namespace, $headers, 0)=0A=
>> +=A0=A0=A0=A0=A0=A0=A0=A0 // die "namespace $namespace does not exist";=
=0A=
>> +=A0=A0=A0=A0 get_status_id($url, default_ip_status(), $headers, 0)=0A=
>> +=A0=A0=A0=A0=A0=A0=A0=A0 // die "default IP status ". default_ip_status=
() . " not found";=0A=
>> +=A0=A0=A0 };=0A=
>> +=A0=A0=A0 if ($@) {=0A=
>> +=A0=A0=A0=A0 die "Can't use nautobot api: $@";=0A=
>> +=A0=A0=A0 }=0A=
>> +}=0A=
>> +=0A=
> [...]=0A=
>=0A=
>> +sub get_status_id {=0A=
>> +=A0=A0=A0 my ($url, $status, $headers, $noerr) =3D @_;=0A=
>> +=0A=
>> +=A0=A0=A0 my $result =3D eval {=0A=
>> +=A0=A0=A0=A0 return PVE::Network::SDN::api_request(=0A=
>> +=A0=A0=A0=A0=A0=A0=A0=A0 "GET", "$url/extras/statuses/?q=3D$status", $h=
eaders);=0A=
>> +=A0=A0=A0 };=0A=
> Unfortunately, I don't quite understand what this check actually does,=0A=
> or why we need this check.=0A=
> The documentation [0] says:=0A=
> `Nautobot provides the ability for custom statuses to be defined=0A=
> within an organisation to be used on various objects to facilitate=0A=
> business workflows around object statuses.`=0A=
>=0A=
> And as I understand the API call, it checks whether the=0A=
> status object =91Active=92 exists and gets its ID. But I don't=0A=
> understand why this should be checked with `verify_api`?=0A=
> In my opinion, we don't really need this check, unless I'm missing=0A=
> something here.=0A=
>=0A=
> [0]=0A=
> https://docs.nautobot.com/projects/core/en/stable/user-guide/platform-fun=
ctionality/status/=0A=
>=0A=
>> +=A0=A0=A0 if ($@) {=0A=
>> +=A0=A0=A0=A0 die "error while querying for status $status id: $@" if !$=
noerr;=0A=
>> +=A0=A0=A0 }=0A=
>> +=0A=
>> +=A0=A0=A0 my $data =3D @{$result->{results}}[0];=0A=
>> +=A0=A0=A0 my $internalid =3D $data->{id};=0A=
>> +=A0=A0=A0 return $internalid;=0A=
>> +}=0A=


--===============8931150162129054685==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

--===============8931150162129054685==--