From 4e64c5f94500b1a9ec9d22a3a96120bddf88955a Mon Sep 17 00:00:00 2001 From: Yoann Abbes Date: Thu, 18 Mar 2021 17:12:14 +0100 Subject: [PATCH 01/10] clean-payloads-api-actions --- lib/controllers/DeviceController.ts | 37 +++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/lib/controllers/DeviceController.ts b/lib/controllers/DeviceController.ts index 2f87eb9e..cc1ffeb6 100644 --- a/lib/controllers/DeviceController.ts +++ b/lib/controllers/DeviceController.ts @@ -60,6 +60,10 @@ export class DeviceController extends CRUDController { handler: this.unlink.bind(this), http: [{ verb: 'delete', path: 'device-manager/:index/devices/:_id/_unlink' }] }, + clean: { + handler: this.clean.bind(this), + http: [{ verb: 'delete', path: 'device-manager/:index/devices/_clean/:_days' }] + }, } }; } @@ -122,6 +126,39 @@ export class DeviceController extends CRUDController { await this.deviceService.unlink(device); } + + /** + * Clean payload collection for a time period + */ + async clean (request: KuzzleRequest) { + const body = this.getBody(request); + + const date = new Date().setDate(new Date().getDate() - body.days || 7); + const filter = [] + filter.push({ + range: { + "_kuzzle_info.createdAt": { + lt: date + } + } + }, { term: { valid: body.valid || false } }); + + if (body.deviceModel) { + filter.push({ term: { deviceModel: body.deviceModel } }); + } + const query = { + bool: { + filter + } + } + + return await this.as(request.context.user).document.deleteByQuery( + this.config.adminIndex, + 'payloads', + { query } + ); + } + private async getDevice (deviceId: string): Promise { const document: any = await this.sdk.document.get( this.config.adminIndex, From b6a8304021911b187691d26e518fe4c2ce620220 Mon Sep 17 00:00:00 2001 From: Yoann Abbes Date: Tue, 23 Mar 2021 13:46:55 +0100 Subject: [PATCH 02/10] doc and test --- doc/1/controllers/device/clean/index.md | 51 +++++++++++++++++++++ features/DeviceController.feature | 36 +++++++++++++++ features/step_definitions/payloads-steps.js | 17 +++++++ lib/controllers/CRUDController.ts | 2 +- lib/controllers/DeviceController.ts | 17 ++----- 5 files changed, 110 insertions(+), 13 deletions(-) create mode 100644 doc/1/controllers/device/clean/index.md diff --git a/doc/1/controllers/device/clean/index.md b/doc/1/controllers/device/clean/index.md new file mode 100644 index 00000000..ba63c9c2 --- /dev/null +++ b/doc/1/controllers/device/clean/index.md @@ -0,0 +1,51 @@ +--- +code: true +type: page +title: clean +description: Cleans the payload collection +--- + +# clean + +Cleans the payload collection. + +--- + +## Query Syntax + +### HTTP + +```http +URL: http://kuzzle:7512/_/device-manager/devices/_clean_ +Method: DELETE +``` + +### Other protocols + +```js +{ + "controller": "device-manager/device", + "action": "clean", + "body": { + // + } +} +``` + +### Kourou + +```bash +kourou device-manager/device:clean '{"days": , "valid": "true|false", "deviceModel": ""}' +``` + +--- + +## Arguments + +- `days`: Specify on which period of time you want keep payloads (`default: 7`). +- `valid`: Specify which payloads are to be deleted (`default: true`). +- `deviceModel`: deviceModel name. + +## Response + +Returns an array with the deleted payloads ids. \ No newline at end of file diff --git a/features/DeviceController.feature b/features/DeviceController.feature index 23377357..287ac203 100644 --- a/features/DeviceController.feature +++ b/features/DeviceController.feature @@ -128,3 +128,39 @@ Feature: Device Manager device controller | _id | "DummyTemp_attached-ayse-unlinked" | Then I should receive an error matching: | message | "Device \"DummyTemp_attached-ayse-unlinked\" is not linked to an asset" | + + + Scenario: Clean payloads collection + Given I successfully execute the action "collection":"truncate" with args: + | index | "device-manager" | + | collection | "payloads" | + Then I successfully receive a "dummy-temp" payload with: + | deviceEUI | "12345" | + | register55 | 23.3 | + | batteryLevel | 0.8 | + And I successfully receive a "dummy-temp-position" payload with: + | deviceEUI | "12345" | + | register55 | 23.3 | + | location.lat | 42.2 | + | location.lon | 2.42 | + | location.accu | 2100 | + And I successfully execute the action "collection":"refresh" with args: + | index | "device-manager" | + | collection | "payloads" | + Then I successfully execute the action "document":"search" with args: + | index | "device-manager" | + | collection | "payloads" | + Then I should receive a result matching: + | total | 2 | + And I successfully execute the action "device-manager/device":"clean" with args: + | body.days | 0 | + | body.valid | true | + | body.deviceModel | "DummyTemp" | + And I successfully execute the action "collection":"refresh" with args: + | index | "device-manager" | + | collection | "payloads" | + Then I successfully execute the action "document":"search" with args: + | index | "device-manager" | + | collection | "payloads" | + Then I should receive a result matching: + | total | 1 | \ No newline at end of file diff --git a/features/step_definitions/payloads-steps.js b/features/step_definitions/payloads-steps.js index f1ad500f..c0507ba0 100644 --- a/features/step_definitions/payloads-steps.js +++ b/features/step_definitions/payloads-steps.js @@ -27,3 +27,20 @@ Then(/I (successfully )?receive a "(.*?)" payload with:/, async function (expect this.props.error = error; } }); + +Then(/I clean the payloads collection with args:/, async function (dataTable) { + const body = this.parseObject(dataTable); + + try { + const response = await this.sdk.query({ + controller: 'device-manager/devices', + action: clean, + body + }); + + this.props.result = response.result; + } + catch (error) { + throw error; + } +}); diff --git a/lib/controllers/CRUDController.ts b/lib/controllers/CRUDController.ts index 4403ef15..30e0353c 100644 --- a/lib/controllers/CRUDController.ts +++ b/lib/controllers/CRUDController.ts @@ -50,7 +50,7 @@ export class CRUDController extends NativeController { * * @param request */ - async delete (request: KuzzleRequest) { + delete (request: KuzzleRequest) { const index = this.getIndex(request); const id = this.getId(request); diff --git a/lib/controllers/DeviceController.ts b/lib/controllers/DeviceController.ts index cc1ffeb6..b7280457 100644 --- a/lib/controllers/DeviceController.ts +++ b/lib/controllers/DeviceController.ts @@ -62,7 +62,7 @@ export class DeviceController extends CRUDController { }, clean: { handler: this.clean.bind(this), - http: [{ verb: 'delete', path: 'device-manager/:index/devices/_clean/:_days' }] + http: [{ verb: 'delete', path: 'device-manager/devices/_clean' }] }, } }; @@ -126,7 +126,6 @@ export class DeviceController extends CRUDController { await this.deviceService.unlink(device); } - /** * Clean payload collection for a time period */ @@ -141,22 +140,16 @@ export class DeviceController extends CRUDController { lt: date } } - }, { term: { valid: body.valid || false } }); + }, { term: { valid: body.valid || true } }); if (body.deviceModel) { filter.push({ term: { deviceModel: body.deviceModel } }); } - const query = { - bool: { - filter - } - } - - return await this.as(request.context.user).document.deleteByQuery( + + return await this.as(request.context.user).bulk.deleteByQuery( this.config.adminIndex, 'payloads', - { query } - ); + { query: { bool: { filter } } }); } private async getDevice (deviceId: string): Promise { From f0d116470592449639745a8ba111b3ecc5704a80 Mon Sep 17 00:00:00 2001 From: Yoann Abbes Date: Tue, 23 Mar 2021 15:16:55 +0100 Subject: [PATCH 03/10] @aschen requested changes --- doc/1/controllers/device/clean/index.md | 14 +++++++++----- features/step_definitions/payloads-steps.js | 17 ----------------- lib/controllers/DeviceController.ts | 2 +- 3 files changed, 10 insertions(+), 23 deletions(-) diff --git a/doc/1/controllers/device/clean/index.md b/doc/1/controllers/device/clean/index.md index ba63c9c2..e65b27fe 100644 --- a/doc/1/controllers/device/clean/index.md +++ b/doc/1/controllers/device/clean/index.md @@ -7,7 +7,7 @@ description: Cleans the payload collection # clean -Cleans the payload collection. +Cleans payloads according to their age and/or validity and/or to which device model they are affiliated. --- @@ -16,7 +16,7 @@ Cleans the payload collection. ### HTTP ```http -URL: http://kuzzle:7512/_/device-manager/devices/_clean_ +URL: http://kuzzle:7512/_/device-manager/devices/_clean Method: DELETE ``` @@ -35,7 +35,11 @@ Method: DELETE ### Kourou ```bash -kourou device-manager/device:clean '{"days": , "valid": "true|false", "deviceModel": ""}' +kourou device-manager/device:clean '{ + days: , + valid: "true|false", + deviceModel: "" +}' ``` --- @@ -43,9 +47,9 @@ kourou device-manager/device:clean '{"days": , "valid": "true|false", "dev ## Arguments - `days`: Specify on which period of time you want keep payloads (`default: 7`). -- `valid`: Specify which payloads are to be deleted (`default: true`). +- `valid`: Specify if valid, invalid or both payload should be deleted (`default: true`). - `deviceModel`: deviceModel name. ## Response -Returns an array with the deleted payloads ids. \ No newline at end of file +Returns the number of deleted payloads. \ No newline at end of file diff --git a/features/step_definitions/payloads-steps.js b/features/step_definitions/payloads-steps.js index c0507ba0..f1ad500f 100644 --- a/features/step_definitions/payloads-steps.js +++ b/features/step_definitions/payloads-steps.js @@ -27,20 +27,3 @@ Then(/I (successfully )?receive a "(.*?)" payload with:/, async function (expect this.props.error = error; } }); - -Then(/I clean the payloads collection with args:/, async function (dataTable) { - const body = this.parseObject(dataTable); - - try { - const response = await this.sdk.query({ - controller: 'device-manager/devices', - action: clean, - body - }); - - this.props.result = response.result; - } - catch (error) { - throw error; - } -}); diff --git a/lib/controllers/DeviceController.ts b/lib/controllers/DeviceController.ts index b7280457..838e6c08 100644 --- a/lib/controllers/DeviceController.ts +++ b/lib/controllers/DeviceController.ts @@ -136,7 +136,7 @@ export class DeviceController extends CRUDController { const filter = [] filter.push({ range: { - "_kuzzle_info.createdAt": { + '_kuzzle_info.createdAt': { lt: date } } From 031e78fef1240c2650f2e2b8ad043ecc45325176 Mon Sep 17 00:00:00 2001 From: Yoann Abbes Date: Tue, 23 Mar 2021 15:19:56 +0100 Subject: [PATCH 04/10] nit --- doc/1/controllers/device/clean/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/1/controllers/device/clean/index.md b/doc/1/controllers/device/clean/index.md index e65b27fe..b6400d58 100644 --- a/doc/1/controllers/device/clean/index.md +++ b/doc/1/controllers/device/clean/index.md @@ -37,7 +37,7 @@ Method: DELETE ```bash kourou device-manager/device:clean '{ days: , - valid: "true|false", + valid: true|false, deviceModel: "" }' ``` From d570b77fbc5f8e2878534d5744d6fd7f314e9c8b Mon Sep 17 00:00:00 2001 From: Yoann Abbes Date: Tue, 23 Mar 2021 15:49:13 +0100 Subject: [PATCH 05/10] Change method name / asyncify CRUD methods --- doc/1/controllers/device/clean/index.md | 10 +++++----- features/DeviceController.feature | 2 +- lib/controllers/CRUDController.ts | 16 ++++++++-------- lib/controllers/DeviceController.ts | 8 ++++---- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/doc/1/controllers/device/clean/index.md b/doc/1/controllers/device/clean/index.md index b6400d58..b7cb5cc5 100644 --- a/doc/1/controllers/device/clean/index.md +++ b/doc/1/controllers/device/clean/index.md @@ -1,11 +1,11 @@ --- code: true type: page -title: clean +title: cleanPayloads description: Cleans the payload collection --- -# clean +# cleanPayloads Cleans payloads according to their age and/or validity and/or to which device model they are affiliated. @@ -16,7 +16,7 @@ Cleans payloads according to their age and/or validity and/or to which device mo ### HTTP ```http -URL: http://kuzzle:7512/_/device-manager/devices/_clean +URL: http://kuzzle:7512/_/device-manager/devices/_cleanPayloads Method: DELETE ``` @@ -25,7 +25,7 @@ Method: DELETE ```js { "controller": "device-manager/device", - "action": "clean", + "action": "cleanPayloads", "body": { // } @@ -35,7 +35,7 @@ Method: DELETE ### Kourou ```bash -kourou device-manager/device:clean '{ +kourou device-manager/device:cleanPayloads '{ days: , valid: true|false, deviceModel: "" diff --git a/features/DeviceController.feature b/features/DeviceController.feature index 287ac203..64fd5602 100644 --- a/features/DeviceController.feature +++ b/features/DeviceController.feature @@ -152,7 +152,7 @@ Feature: Device Manager device controller | collection | "payloads" | Then I should receive a result matching: | total | 2 | - And I successfully execute the action "device-manager/device":"clean" with args: + And I successfully execute the action "device-manager/device":"cleanPayloads" with args: | body.days | 0 | | body.valid | true | | body.deviceModel | "DummyTemp" | diff --git a/lib/controllers/CRUDController.ts b/lib/controllers/CRUDController.ts index 30e0353c..44f7001a 100644 --- a/lib/controllers/CRUDController.ts +++ b/lib/controllers/CRUDController.ts @@ -32,12 +32,12 @@ export class CRUDController extends NativeController { * * @param request */ - create (request: KuzzleRequest) { + async create (request: KuzzleRequest) { const index = this.getIndex(request); const asset = this.getBody(request); const id = request.input.resource._id; - return this.as(request.context.user).document.create( + return await this.as(request.context.user).document.create( index, this.collection, asset, @@ -50,11 +50,11 @@ export class CRUDController extends NativeController { * * @param request */ - delete (request: KuzzleRequest) { + async delete (request: KuzzleRequest) { const index = this.getIndex(request); const id = this.getId(request); - return this.as(request.context.user).document.delete( + return await this.as(request.context.user).document.delete( index, this.collection, id, @@ -66,11 +66,11 @@ export class CRUDController extends NativeController { * * @param request */ - search (request: KuzzleRequest) { + async search (request: KuzzleRequest) { const index = this.getIndex(request); const { searchBody } = this.getSearchParams(request); - return this.as(request.context.user).document.search( + return await this.as(request.context.user).document.search( index, this.collection, searchBody, @@ -82,12 +82,12 @@ export class CRUDController extends NativeController { * * @param request */ - update (request: KuzzleRequest) { + async update (request: KuzzleRequest) { const index = this.getIndex(request); const body = this.getBody(request); const id = this.getId(request); - return this.as(request.context.user).document.update( + return await this.as(request.context.user).document.update( index, this.collection, id, diff --git a/lib/controllers/DeviceController.ts b/lib/controllers/DeviceController.ts index 838e6c08..6bed1a4c 100644 --- a/lib/controllers/DeviceController.ts +++ b/lib/controllers/DeviceController.ts @@ -60,9 +60,9 @@ export class DeviceController extends CRUDController { handler: this.unlink.bind(this), http: [{ verb: 'delete', path: 'device-manager/:index/devices/:_id/_unlink' }] }, - clean: { - handler: this.clean.bind(this), - http: [{ verb: 'delete', path: 'device-manager/devices/_clean' }] + cleanPayloads: { + handler: this.cleanPayloads.bind(this), + http: [{ verb: 'delete', path: 'device-manager/devices/_cleanPayloads' }] }, } }; @@ -129,7 +129,7 @@ export class DeviceController extends CRUDController { /** * Clean payload collection for a time period */ - async clean (request: KuzzleRequest) { + async cleanPayloads (request: KuzzleRequest) { const body = this.getBody(request); const date = new Date().setDate(new Date().getDate() - body.days || 7); From 8e394ff8370d37464345bd269074a330fe3354b2 Mon Sep 17 00:00:00 2001 From: Yoann-Abbes <44844010+Yoann-Abbes@users.noreply.github.com> Date: Wed, 24 Mar 2021 17:28:03 +0100 Subject: [PATCH 06/10] Update doc/1/controllers/device/clean/index.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sébastien Cottinet --- doc/1/controllers/device/clean/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/1/controllers/device/clean/index.md b/doc/1/controllers/device/clean/index.md index b7cb5cc5..a300bfa9 100644 --- a/doc/1/controllers/device/clean/index.md +++ b/doc/1/controllers/device/clean/index.md @@ -46,10 +46,10 @@ kourou device-manager/device:cleanPayloads '{ ## Arguments -- `days`: Specify on which period of time you want keep payloads (`default: 7`). +- `days`: The maximum age of a payload, in days (`default: 7`). - `valid`: Specify if valid, invalid or both payload should be deleted (`default: true`). - `deviceModel`: deviceModel name. ## Response -Returns the number of deleted payloads. \ No newline at end of file +Returns the number of deleted payloads. From b2266a2359f19c3ca572aefe654937338edc82b4 Mon Sep 17 00:00:00 2001 From: Yoann Abbes Date: Wed, 24 Mar 2021 17:31:23 +0100 Subject: [PATCH 07/10] @scottinet requested changes --- .../device/{clean => prune-payloads}/index.md | 16 ++++++++-------- features/DeviceController.feature | 2 +- lib/controllers/DeviceController.ts | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) rename doc/1/controllers/device/{clean => prune-payloads}/index.md (57%) diff --git a/doc/1/controllers/device/clean/index.md b/doc/1/controllers/device/prune-payloads/index.md similarity index 57% rename from doc/1/controllers/device/clean/index.md rename to doc/1/controllers/device/prune-payloads/index.md index a300bfa9..421d86d8 100644 --- a/doc/1/controllers/device/clean/index.md +++ b/doc/1/controllers/device/prune-payloads/index.md @@ -1,13 +1,13 @@ --- code: true type: page -title: cleanPayloads +title: prunePayloads description: Cleans the payload collection --- -# cleanPayloads +# prunePayloads -Cleans payloads according to their age and/or validity and/or to which device model they are affiliated. +Delete payloads according to their age and/or validity and/or to which device model they are affiliated. --- @@ -16,7 +16,7 @@ Cleans payloads according to their age and/or validity and/or to which device mo ### HTTP ```http -URL: http://kuzzle:7512/_/device-manager/devices/_cleanPayloads +URL: http://kuzzle:7512/_/device-manager/devices/_prunePayloads Method: DELETE ``` @@ -25,7 +25,7 @@ Method: DELETE ```js { "controller": "device-manager/device", - "action": "cleanPayloads", + "action": "prunePayloads", "body": { // } @@ -35,7 +35,7 @@ Method: DELETE ### Kourou ```bash -kourou device-manager/device:cleanPayloads '{ +kourou device-manager/device:prunePayloads '{ days: , valid: true|false, deviceModel: "" @@ -47,9 +47,9 @@ kourou device-manager/device:cleanPayloads '{ ## Arguments - `days`: The maximum age of a payload, in days (`default: 7`). -- `valid`: Specify if valid, invalid or both payload should be deleted (`default: true`). +- `valid`: Specify if valid or invalid payloads should be deleted (`default: true`). - `deviceModel`: deviceModel name. ## Response -Returns the number of deleted payloads. +Returns the number of deleted payloads. \ No newline at end of file diff --git a/features/DeviceController.feature b/features/DeviceController.feature index 64fd5602..d1b1ad8f 100644 --- a/features/DeviceController.feature +++ b/features/DeviceController.feature @@ -152,7 +152,7 @@ Feature: Device Manager device controller | collection | "payloads" | Then I should receive a result matching: | total | 2 | - And I successfully execute the action "device-manager/device":"cleanPayloads" with args: + And I successfully execute the action "device-manager/device":"prunePayloads" with args: | body.days | 0 | | body.valid | true | | body.deviceModel | "DummyTemp" | diff --git a/lib/controllers/DeviceController.ts b/lib/controllers/DeviceController.ts index 6bed1a4c..8f7e978d 100644 --- a/lib/controllers/DeviceController.ts +++ b/lib/controllers/DeviceController.ts @@ -60,9 +60,9 @@ export class DeviceController extends CRUDController { handler: this.unlink.bind(this), http: [{ verb: 'delete', path: 'device-manager/:index/devices/:_id/_unlink' }] }, - cleanPayloads: { - handler: this.cleanPayloads.bind(this), - http: [{ verb: 'delete', path: 'device-manager/devices/_cleanPayloads' }] + prunePayloads: { + handler: this.prunePayloads.bind(this), + http: [{ verb: 'delete', path: 'device-manager/devices/_prunePayloads' }] }, } }; @@ -129,7 +129,7 @@ export class DeviceController extends CRUDController { /** * Clean payload collection for a time period */ - async cleanPayloads (request: KuzzleRequest) { + async prunePayloads (request: KuzzleRequest) { const body = this.getBody(request); const date = new Date().setDate(new Date().getDate() - body.days || 7); From 1daff296b24bdd3f99e6f35e3e017c8841aa0a20 Mon Sep 17 00:00:00 2001 From: Yoann Abbes Date: Wed, 31 Mar 2021 10:34:44 +0200 Subject: [PATCH 08/10] change option to keep invalid payloads --- doc/1/controllers/device/prune-payloads/index.md | 4 ++-- features/DeviceController.feature | 1 - lib/controllers/DeviceController.ts | 5 ++++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/1/controllers/device/prune-payloads/index.md b/doc/1/controllers/device/prune-payloads/index.md index 421d86d8..823b0af9 100644 --- a/doc/1/controllers/device/prune-payloads/index.md +++ b/doc/1/controllers/device/prune-payloads/index.md @@ -37,7 +37,7 @@ Method: DELETE ```bash kourou device-manager/device:prunePayloads '{ days: , - valid: true|false, + keepInvalid: true|false, deviceModel: "" }' ``` @@ -47,7 +47,7 @@ kourou device-manager/device:prunePayloads '{ ## Arguments - `days`: The maximum age of a payload, in days (`default: 7`). -- `valid`: Specify if valid or invalid payloads should be deleted (`default: true`). +- `keepInvalid`: If set to `true`, invalid payloads will not be deleted. - `deviceModel`: deviceModel name. ## Response diff --git a/features/DeviceController.feature b/features/DeviceController.feature index d1b1ad8f..07b089dd 100644 --- a/features/DeviceController.feature +++ b/features/DeviceController.feature @@ -154,7 +154,6 @@ Feature: Device Manager device controller | total | 2 | And I successfully execute the action "device-manager/device":"prunePayloads" with args: | body.days | 0 | - | body.valid | true | | body.deviceModel | "DummyTemp" | And I successfully execute the action "collection":"refresh" with args: | index | "device-manager" | diff --git a/lib/controllers/DeviceController.ts b/lib/controllers/DeviceController.ts index 8f7e978d..80b1d7cd 100644 --- a/lib/controllers/DeviceController.ts +++ b/lib/controllers/DeviceController.ts @@ -140,12 +140,15 @@ export class DeviceController extends CRUDController { lt: date } } - }, { term: { valid: body.valid || true } }); + }); if (body.deviceModel) { filter.push({ term: { deviceModel: body.deviceModel } }); } + if (body.keepInvalid) { + filter.push({ term: { valid: true } }) + } return await this.as(request.context.user).bulk.deleteByQuery( this.config.adminIndex, 'payloads', From 483a85c961416e7b7dd4ff0a2659ae9e90961e51 Mon Sep 17 00:00:00 2001 From: Yoann-Abbes <44844010+Yoann-Abbes@users.noreply.github.com> Date: Wed, 31 Mar 2021 10:40:38 +0200 Subject: [PATCH 09/10] Update doc/1/controllers/device/prune-payloads/index.md Co-authored-by: Michele Leo --- doc/1/controllers/device/prune-payloads/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/1/controllers/device/prune-payloads/index.md b/doc/1/controllers/device/prune-payloads/index.md index 823b0af9..4ba917f3 100644 --- a/doc/1/controllers/device/prune-payloads/index.md +++ b/doc/1/controllers/device/prune-payloads/index.md @@ -7,7 +7,7 @@ description: Cleans the payload collection # prunePayloads -Delete payloads according to their age and/or validity and/or to which device model they are affiliated. +Delete payloads according to their age and/or validity and/or to which device model they are affiliated with. --- @@ -52,4 +52,4 @@ kourou device-manager/device:prunePayloads '{ ## Response -Returns the number of deleted payloads. \ No newline at end of file +Returns the number of deleted payloads. From 6e9b1f2b1b877e072b713f3066f64511f390e29e Mon Sep 17 00:00:00 2001 From: Yoann-Abbes <44844010+Yoann-Abbes@users.noreply.github.com> Date: Wed, 31 Mar 2021 10:40:52 +0200 Subject: [PATCH 10/10] Update features/DeviceController.feature Co-authored-by: Michele Leo --- features/DeviceController.feature | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/features/DeviceController.feature b/features/DeviceController.feature index 07b089dd..dfee785e 100644 --- a/features/DeviceController.feature +++ b/features/DeviceController.feature @@ -129,7 +129,6 @@ Feature: Device Manager device controller Then I should receive an error matching: | message | "Device \"DummyTemp_attached-ayse-unlinked\" is not linked to an asset" | - Scenario: Clean payloads collection Given I successfully execute the action "collection":"truncate" with args: | index | "device-manager" | @@ -162,4 +161,4 @@ Feature: Device Manager device controller | index | "device-manager" | | collection | "payloads" | Then I should receive a result matching: - | total | 1 | \ No newline at end of file + | total | 1 |