From 18596dbb042584ab3f27bea843395071197827ce Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Tue, 13 Feb 2024 13:16:29 +0100 Subject: [PATCH 1/5] add elete for devices to router --- lib/services/iotaRedirector.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/services/iotaRedirector.js b/lib/services/iotaRedirector.js index 1cb2fbc..9a82687 100644 --- a/lib/services/iotaRedirector.js +++ b/lib/services/iotaRedirector.js @@ -433,6 +433,7 @@ function loadContextRoutes(router) { router.get('/iot/devices', middlewareList); router.get('/iot/devices/:id', middlewareList); router.put('/iot/devices/:id', middlewareList); + router.delete('/iot/devices', middlewareList); router.delete('/iot/devices/:id', middlewareList); } From c4cd7eb84e840e0a70ac1a1e9125340a8cffecc7 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Tue, 13 Feb 2024 17:14:09 +0100 Subject: [PATCH 2/5] include body with delete --- lib/services/iotaRedirector.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/services/iotaRedirector.js b/lib/services/iotaRedirector.js index 9a82687..9b40cad 100644 --- a/lib/services/iotaRedirector.js +++ b/lib/services/iotaRedirector.js @@ -229,7 +229,7 @@ function createRequest(req, protocol, body) { } } - if (req.method === 'PUT' || req.method === 'POST') { + if (req.method === 'PUT' || req.method === 'POST' || req.method === 'DELETE') { options.body = JSON.stringify(body); } From 962bfce6113f2791b2d334f6496924023526b35e Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Thu, 15 Feb 2024 09:09:57 +0100 Subject: [PATCH 3/5] update CNR --- CHANGES_NEXT_RELEASE | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index 139597f..06df6ee 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1,2 +1 @@ - - +- ADD: support for new iotAgent HTTP API method to delete multiple devices at once (iota-node-lib#1578) From 86488fb0d21d83d03f52b01e10d7ecb1cace46e4 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Fri, 16 Feb 2024 11:18:31 +0100 Subject: [PATCH 4/5] rename delete /iot/devices to post /iot/op/delete --- lib/services/iotaRedirector.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/services/iotaRedirector.js b/lib/services/iotaRedirector.js index 9b40cad..1900a2f 100644 --- a/lib/services/iotaRedirector.js +++ b/lib/services/iotaRedirector.js @@ -229,7 +229,7 @@ function createRequest(req, protocol, body) { } } - if (req.method === 'PUT' || req.method === 'POST' || req.method === 'DELETE') { + if (req.method === 'PUT' || req.method === 'POST') { options.body = JSON.stringify(body); } @@ -433,7 +433,7 @@ function loadContextRoutes(router) { router.get('/iot/devices', middlewareList); router.get('/iot/devices/:id', middlewareList); router.put('/iot/devices/:id', middlewareList); - router.delete('/iot/devices', middlewareList); + router.post('/iot/op/delete', middlewareList); router.delete('/iot/devices/:id', middlewareList); } From 07028b3446360787bc0f4722c05cdf3b1d6b5e7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferm=C3=ADn=20Gal=C3=A1n=20M=C3=A1rquez?= Date: Mon, 19 Feb 2024 13:34:25 +0100 Subject: [PATCH 5/5] Update CHANGES_NEXT_RELEASE --- CHANGES_NEXT_RELEASE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index 06df6ee..0883a65 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1 +1 @@ -- ADD: support for new iotAgent HTTP API method to delete multiple devices at once (iota-node-lib#1578) +- Add: support `POST /iot/op/delete` operation at iotAgent API to delete multiple devices at once (iota-node-lib#1578)