mirror of
https://github.com/absmach/supermq.git
synced 2026-06-23 07:30:25 +00:00
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:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user