NOISSUE - Implement Thing Delete (#179)

* add: delete function in things interface

Signed-off-by: Arvindh <arvindh91@gmail.com>

* add: remove things

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: things event streams

Signed-off-by: Arvindh <arvindh91@gmail.com>

* add: things delete test

Signed-off-by: Arvindh <arvindh91@gmail.com>

* add: delete thing http transport

Signed-off-by: Arvindh <arvindh91@gmail.com>

* add: delete thing sdk, sdk_test, cli

Signed-off-by: Arvindh <arvindh91@gmail.com>

* gofumpt -ed

Signed-off-by: Arvindh <arvindh91@gmail.com>

* add: openapi

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix: things change status response

Signed-off-by: Arvindh <arvindh91@gmail.com>

* add: openapi

Signed-off-by: Arvindh <arvindh91@gmail.com>

* rename events: from thing delete to thing remove

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix wordings

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix wordings in openapi

Signed-off-by: Arvindh <arvindh91@gmail.com>

* add: type check

Signed-off-by: Arvindh <arvindh91@gmail.com>

* update open api yaml

Signed-off-by: Arvindh <arvindh91@gmail.com>

* fix things mocks

Signed-off-by: Arvindh <arvindh91@gmail.com>

---------

Signed-off-by: Arvindh <arvindh91@gmail.com>
This commit is contained in:
Arvindh
2023-12-21 00:25:38 +05:30
committed by GitHub
parent 822515e9cf
commit 1fe2e74a74
23 changed files with 471 additions and 46 deletions
+18
View File
@@ -81,6 +81,24 @@ var cmdThings = []cobra.Command{
logJSON(t)
},
},
{
Use: "delete <thing_id> <user_auth_token>",
Short: "Delete thing",
Long: "Delete thing by id\n" +
"Usage:\n" +
"\tmagistrala-cli things delete <thing_id> $USERTOKEN - delete thing with <thing_id>\n",
Run: func(cmd *cobra.Command, args []string) {
if len(args) != 2 {
logUsage(cmd.Use)
return
}
if err := sdk.DeleteThing(args[0], args[1]); err != nil {
logError(err)
return
}
logOK()
},
},
{
Use: "identify <thing_key>",
Short: "Identify thing",