2020-09-23 23:18:53 +02:00
|
|
|
// Copyright (c) Mainflux
|
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
package cli
|
|
|
|
|
|
|
|
import (
|
|
|
|
"encoding/json"
|
|
|
|
|
2023-06-14 12:40:37 +02:00
|
|
|
mfclients "github.com/mainflux/mainflux/pkg/clients"
|
2020-09-23 23:18:53 +02:00
|
|
|
mfxsdk "github.com/mainflux/mainflux/pkg/sdk/go"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
|
|
|
var cmdGroups = []cobra.Command{
|
2022-02-11 13:22:57 +01:00
|
|
|
{
|
|
|
|
Use: "create <JSON_group> <user_auth_token>",
|
|
|
|
Short: "Create group",
|
2023-06-14 12:40:37 +02:00
|
|
|
Long: "Creates new group\n" +
|
|
|
|
"Usage:\n" +
|
|
|
|
"\tmainflux-cli groups create '{\"name\":\"new group\", \"description\":\"new group description\", \"metadata\":{\"key\": \"value\"}}' $USERTOKEN\n",
|
2020-09-23 23:18:53 +02:00
|
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
|
|
if len(args) != 2 {
|
2022-02-11 13:22:57 +01:00
|
|
|
logUsage(cmd.Use)
|
2020-09-23 23:18:53 +02:00
|
|
|
return
|
|
|
|
}
|
|
|
|
var group mfxsdk.Group
|
|
|
|
if err := json.Unmarshal([]byte(args[0]), &group); err != nil {
|
|
|
|
logError(err)
|
|
|
|
return
|
|
|
|
}
|
2023-06-14 12:40:37 +02:00
|
|
|
group.Status = mfclients.EnabledStatus.String()
|
|
|
|
group, err := sdk.CreateGroup(group, args[1])
|
2020-09-23 23:18:53 +02:00
|
|
|
if err != nil {
|
|
|
|
logError(err)
|
|
|
|
return
|
|
|
|
}
|
2023-06-14 12:40:37 +02:00
|
|
|
logJSON(group)
|
2020-09-23 23:18:53 +02:00
|
|
|
},
|
|
|
|
},
|
2022-02-11 13:22:57 +01:00
|
|
|
{
|
2023-05-25 06:02:46 +08:00
|
|
|
Use: "update <JSON_group> <user_auth_token>",
|
|
|
|
Short: "Update group",
|
2023-06-14 12:40:37 +02:00
|
|
|
Long: "Updates group\n" +
|
|
|
|
"Usage:\n" +
|
|
|
|
"\tmainflux-cli groups update '{\"id\":\"<group_id>\", \"name\":\"new group\", \"description\":\"new group description\", \"metadata\":{\"key\": \"value\"}}' $USERTOKEN\n",
|
2023-05-25 06:02:46 +08:00
|
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
|
|
if len(args) != 2 {
|
|
|
|
logUsage(cmd.Use)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
var group mfxsdk.Group
|
|
|
|
if err := json.Unmarshal([]byte(args[0]), &group); err != nil {
|
|
|
|
logError(err)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2023-06-14 12:40:37 +02:00
|
|
|
group, err := sdk.UpdateGroup(group, args[1])
|
|
|
|
if err != nil {
|
2023-05-25 06:02:46 +08:00
|
|
|
logError(err)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2023-06-14 12:40:37 +02:00
|
|
|
logJSON(group)
|
2023-05-25 06:02:46 +08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Use: "get [all | children <group_id> | parents <group_id> | members <group_id> | <group_id>] <user_auth_token>",
|
2022-02-11 13:22:57 +01:00
|
|
|
Short: "Get group",
|
2023-06-14 12:40:37 +02:00
|
|
|
Long: "Get all users groups, group children or group by id.\n" +
|
|
|
|
"Usage:\n" +
|
|
|
|
"\tmainflux-cli groups get all $USERTOKEN - lists all groups\n" +
|
|
|
|
"\tmainflux-cli groups get children <group_id> $USERTOKEN - lists all children groups of <group_id>\n" +
|
|
|
|
"\tmainflux-cli groups get parents <group_id> $USERTOKEN - lists all parent groups of <group_id>\n" +
|
|
|
|
"\tmainflux-cli groups get <group_id> $USERTOKEN - shows group with provided group ID\n",
|
2020-09-23 23:18:53 +02:00
|
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
|
|
if len(args) < 2 {
|
2022-02-11 13:22:57 +01:00
|
|
|
logUsage(cmd.Use)
|
2020-09-23 23:18:53 +02:00
|
|
|
return
|
|
|
|
}
|
MF-1718 - Use static code analysis in CI (#1729)
* things, twins, and logger lint fixed
Signed-off-by: aryan <aryangodara03@gmail.com>
* all services updated, auth jwt not working, ineffectual assignment issue
Signed-off-by: aryan <aryangodara03@gmail.com>
* handle error from grpc server in endpointtest
Signed-off-by: aryan <aryangodara03@gmail.com>
* temp commit, auth/jwt needs to be resolved
Signed-off-by: aryan <aryangodara03@gmail.com>
* revert back to jwt v4 temporarily
Signed-off-by: aryan <aryangodara03@gmail.com>
* updated jwt tokenizer
Signed-off-by: aryan <aryangodara03@gmail.com>
* resolve EOF error for httptest requests
Signed-off-by: aryan <aryangodara03@gmail.com>
* fix auth jwt, update to registeredclaims
Signed-off-by: aryan <aryangodara03@gmail.com>
* fix ineffective assignment, auth/api/grpc endpoint failing
Signed-off-by: aryan <aryangodara03@gmail.com>
* temp commit, remove later
Signed-off-by: aryan <aryangodara03@gmail.com>
* fix grpc server setup
Signed-off-by: aryan <aryangodara03@gmail.com>
* resolve golangci tests, remove debug statements
Signed-off-by: aryan <aryangodara03@gmail.com>
* update golangci version and modify linters used
Signed-off-by: aryan <aryangodara03@gmail.com>
* fix failing tests
Signed-off-by: aryan <aryangodara03@gmail.com>
* fix grpc server for setup tests
Signed-off-by: aryan <aryangodara03@gmail.com>
* fix logging and errors inlined
Signed-off-by: aryan <aryangodara03@gmail.com>
* fix remarks, update grpc setup_test
Signed-off-by: aryan <aryangodara03@gmail.com>
* fix setup_test
Signed-off-by: aryan <aryangodara03@gmail.com>
* update setup_test grpc
Signed-off-by: aryan <aryangodara03@gmail.com>
* fix data race
Signed-off-by: aryan <aryangodara03@gmail.com>
* update setup_test grpc
Signed-off-by: aryan <aryangodara03@gmail.com>
* fix grpc setup down to single simple function
Signed-off-by: aryan <aryangodara03@gmail.com>
* fix linting issues
Signed-off-by: aryan <aryangodara03@gmail.com>
* resolve pr comments
Signed-off-by: aryan <aryangodara03@gmail.com>
* fix tests, handle returned errors, go mod tidy vendor
Signed-off-by: aryan <aryangodara03@gmail.com>
* fix errors from new linters
Signed-off-by: aryan <aryangodara03@gmail.com>
---------
Signed-off-by: aryan <aryangodara03@gmail.com>
2023-04-22 08:14:35 -07:00
|
|
|
if args[0] == all {
|
2021-03-26 22:51:02 +01:00
|
|
|
if len(args) > 2 {
|
2022-02-11 13:22:57 +01:00
|
|
|
logUsage(cmd.Use)
|
2021-03-26 22:51:02 +01:00
|
|
|
return
|
|
|
|
}
|
2023-01-05 19:20:05 +03:00
|
|
|
pm := mfxsdk.PageMetadata{
|
2023-08-08 13:01:59 +03:00
|
|
|
Offset: Offset,
|
|
|
|
Limit: Limit,
|
2022-06-01 01:41:54 +02:00
|
|
|
}
|
2023-01-05 19:20:05 +03:00
|
|
|
l, err := sdk.Groups(pm, args[1])
|
2020-09-23 23:18:53 +02:00
|
|
|
if err != nil {
|
|
|
|
logError(err)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
logJSON(l)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if args[0] == "children" {
|
2021-03-26 22:51:02 +01:00
|
|
|
if len(args) > 3 {
|
2022-02-11 13:22:57 +01:00
|
|
|
logUsage(cmd.Use)
|
2021-03-26 22:51:02 +01:00
|
|
|
return
|
|
|
|
}
|
2023-01-05 19:20:05 +03:00
|
|
|
pm := mfxsdk.PageMetadata{
|
2023-08-08 13:01:59 +03:00
|
|
|
Offset: Offset,
|
|
|
|
Limit: Limit,
|
2023-01-05 19:20:05 +03:00
|
|
|
}
|
|
|
|
l, err := sdk.Children(args[1], pm, args[2])
|
2020-09-23 23:18:53 +02:00
|
|
|
if err != nil {
|
|
|
|
logError(err)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
logJSON(l)
|
|
|
|
return
|
|
|
|
}
|
2021-03-26 22:51:02 +01:00
|
|
|
if args[0] == "parents" {
|
|
|
|
if len(args) > 3 {
|
2022-02-11 13:22:57 +01:00
|
|
|
logUsage(cmd.Use)
|
2021-03-26 22:51:02 +01:00
|
|
|
return
|
|
|
|
}
|
2023-01-05 19:20:05 +03:00
|
|
|
pm := mfxsdk.PageMetadata{
|
2023-08-08 13:01:59 +03:00
|
|
|
Offset: Offset,
|
|
|
|
Limit: Limit,
|
2023-01-05 19:20:05 +03:00
|
|
|
}
|
|
|
|
l, err := sdk.Parents(args[1], pm, args[2])
|
2021-03-26 22:51:02 +01:00
|
|
|
if err != nil {
|
|
|
|
logError(err)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
logJSON(l)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if len(args) > 2 {
|
2022-02-11 13:22:57 +01:00
|
|
|
logUsage(cmd.Use)
|
2021-03-26 22:51:02 +01:00
|
|
|
return
|
|
|
|
}
|
2020-09-23 23:18:53 +02:00
|
|
|
t, err := sdk.Group(args[0], args[1])
|
|
|
|
if err != nil {
|
|
|
|
logError(err)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
logJSON(t)
|
|
|
|
},
|
|
|
|
},
|
2022-02-11 13:22:57 +01:00
|
|
|
{
|
NOISSUE: Listing of shared things with users & Update SDK (#1923)
* NOISSUE - Fix Bugs (#20)
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add Connect Disconnect endpoints (#23)
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: Things share with users (#25)
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: things share with other users
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: Listing of things, channels, groups, users (#26)
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: List of user groups & removed repeating code in groups (#29)
* removed repeating code in list groups
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: list of user group
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: otel handler operator name for endpoints
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* add: listing of shared things and users
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: listing of shared things and users
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: new SDK
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: new SDK
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: comment
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: sdk function names
Signed-off-by: Arvindh <arvindh91@gmail.com>
* update: api spec
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: channels connect request
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: listing of clients and groups
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: CLI
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: array len comparision
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: nginx
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2023-10-17 19:08:06 +05:30
|
|
|
Use: "assign user <relation> <user_ids> <group_id> <user_auth_token>",
|
|
|
|
Short: "Assign user",
|
|
|
|
Long: "Assign user to a group\n" +
|
2023-06-14 12:40:37 +02:00
|
|
|
"Usage:\n" +
|
NOISSUE: Listing of shared things with users & Update SDK (#1923)
* NOISSUE - Fix Bugs (#20)
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add Connect Disconnect endpoints (#23)
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: Things share with users (#25)
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: things share with other users
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: Listing of things, channels, groups, users (#26)
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: List of user groups & removed repeating code in groups (#29)
* removed repeating code in list groups
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: list of user group
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: otel handler operator name for endpoints
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* add: listing of shared things and users
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: listing of shared things and users
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: new SDK
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: new SDK
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: comment
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: sdk function names
Signed-off-by: Arvindh <arvindh91@gmail.com>
* update: api spec
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: channels connect request
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: listing of clients and groups
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: CLI
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: array len comparision
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: nginx
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2023-10-17 19:08:06 +05:30
|
|
|
"\tmainflux-cli groups assign user <relation> '[\"<user_id_1>\", \"<user_id_2>\"]' <group_id> $USERTOKEN\n",
|
2020-09-23 23:18:53 +02:00
|
|
|
Run: func(cmd *cobra.Command, args []string) {
|
NOISSUE: Listing of shared things with users & Update SDK (#1923)
* NOISSUE - Fix Bugs (#20)
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add Connect Disconnect endpoints (#23)
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: Things share with users (#25)
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: things share with other users
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: Listing of things, channels, groups, users (#26)
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: List of user groups & removed repeating code in groups (#29)
* removed repeating code in list groups
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: list of user group
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: otel handler operator name for endpoints
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* add: listing of shared things and users
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: listing of shared things and users
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: new SDK
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: new SDK
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: comment
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: sdk function names
Signed-off-by: Arvindh <arvindh91@gmail.com>
* update: api spec
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: channels connect request
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: listing of clients and groups
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: CLI
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: array len comparision
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: nginx
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2023-10-17 19:08:06 +05:30
|
|
|
if len(args) != 5 {
|
2022-02-11 13:22:57 +01:00
|
|
|
logUsage(cmd.Use)
|
2020-09-23 23:18:53 +02:00
|
|
|
return
|
|
|
|
}
|
NOISSUE: Listing of shared things with users & Update SDK (#1923)
* NOISSUE - Fix Bugs (#20)
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add Connect Disconnect endpoints (#23)
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: Things share with users (#25)
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: things share with other users
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: Listing of things, channels, groups, users (#26)
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: List of user groups & removed repeating code in groups (#29)
* removed repeating code in list groups
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: list of user group
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: otel handler operator name for endpoints
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* add: listing of shared things and users
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: listing of shared things and users
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: new SDK
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: new SDK
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: comment
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: sdk function names
Signed-off-by: Arvindh <arvindh91@gmail.com>
* update: api spec
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: channels connect request
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: listing of clients and groups
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: CLI
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: array len comparision
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: nginx
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2023-10-17 19:08:06 +05:30
|
|
|
var userIDs []string
|
|
|
|
if err := json.Unmarshal([]byte(args[1]), &userIDs); err != nil {
|
2021-03-26 22:51:02 +01:00
|
|
|
logError(err)
|
|
|
|
return
|
|
|
|
}
|
NOISSUE: Listing of shared things with users & Update SDK (#1923)
* NOISSUE - Fix Bugs (#20)
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add Connect Disconnect endpoints (#23)
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: Things share with users (#25)
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: things share with other users
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: Listing of things, channels, groups, users (#26)
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: List of user groups & removed repeating code in groups (#29)
* removed repeating code in list groups
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: list of user group
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: otel handler operator name for endpoints
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* add: listing of shared things and users
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: listing of shared things and users
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: new SDK
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: new SDK
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: comment
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: sdk function names
Signed-off-by: Arvindh <arvindh91@gmail.com>
* update: api spec
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: channels connect request
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: listing of clients and groups
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: CLI
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: array len comparision
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: nginx
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2023-10-17 19:08:06 +05:30
|
|
|
if err := sdk.AddUserToGroup(args[2], mfxsdk.UsersRelationRequest{Relation: args[0], UserIDs: userIDs}, args[3]); err != nil {
|
2020-09-23 23:18:53 +02:00
|
|
|
logError(err)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
logOK()
|
|
|
|
},
|
|
|
|
},
|
2022-02-11 13:22:57 +01:00
|
|
|
{
|
NOISSUE: Listing of shared things with users & Update SDK (#1923)
* NOISSUE - Fix Bugs (#20)
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add Connect Disconnect endpoints (#23)
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: Things share with users (#25)
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: things share with other users
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: Listing of things, channels, groups, users (#26)
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: List of user groups & removed repeating code in groups (#29)
* removed repeating code in list groups
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: list of user group
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: otel handler operator name for endpoints
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* add: listing of shared things and users
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: listing of shared things and users
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: new SDK
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: new SDK
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: comment
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: sdk function names
Signed-off-by: Arvindh <arvindh91@gmail.com>
* update: api spec
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: channels connect request
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: listing of clients and groups
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: CLI
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: array len comparision
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: nginx
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2023-10-17 19:08:06 +05:30
|
|
|
Use: "unassign user <relation> <user_ids> <group_id> <user_auth_token>",
|
|
|
|
Short: "Unassign user",
|
|
|
|
Long: "Unassign user from a group\n" +
|
2023-06-14 12:40:37 +02:00
|
|
|
"Usage:\n" +
|
NOISSUE: Listing of shared things with users & Update SDK (#1923)
* NOISSUE - Fix Bugs (#20)
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add Connect Disconnect endpoints (#23)
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: Things share with users (#25)
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: things share with other users
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: Listing of things, channels, groups, users (#26)
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: List of user groups & removed repeating code in groups (#29)
* removed repeating code in list groups
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: list of user group
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: otel handler operator name for endpoints
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* add: listing of shared things and users
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: listing of shared things and users
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: new SDK
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: new SDK
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: comment
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: sdk function names
Signed-off-by: Arvindh <arvindh91@gmail.com>
* update: api spec
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: channels connect request
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: listing of clients and groups
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: CLI
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: array len comparision
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: nginx
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2023-10-17 19:08:06 +05:30
|
|
|
"\tmainflux-cli groups unassign user <relation> '[\"<user_id_1>\", \"<user_id_2>\"]' <group_id> $USERTOKEN\n",
|
2020-09-23 23:18:53 +02:00
|
|
|
Run: func(cmd *cobra.Command, args []string) {
|
NOISSUE: Listing of shared things with users & Update SDK (#1923)
* NOISSUE - Fix Bugs (#20)
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add Connect Disconnect endpoints (#23)
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: Things share with users (#25)
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: things share with other users
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: Listing of things, channels, groups, users (#26)
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: List of user groups & removed repeating code in groups (#29)
* removed repeating code in list groups
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: list of user group
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: otel handler operator name for endpoints
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* add: listing of shared things and users
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: listing of shared things and users
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: new SDK
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: new SDK
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: comment
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: sdk function names
Signed-off-by: Arvindh <arvindh91@gmail.com>
* update: api spec
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: channels connect request
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: listing of clients and groups
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: CLI
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: array len comparision
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: nginx
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2023-10-17 19:08:06 +05:30
|
|
|
if len(args) != 5 {
|
2022-02-11 13:22:57 +01:00
|
|
|
logUsage(cmd.Use)
|
2020-09-23 23:18:53 +02:00
|
|
|
return
|
|
|
|
}
|
NOISSUE: Listing of shared things with users & Update SDK (#1923)
* NOISSUE - Fix Bugs (#20)
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add Connect Disconnect endpoints (#23)
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: Things share with users (#25)
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: things share with other users
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: Listing of things, channels, groups, users (#26)
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: List of user groups & removed repeating code in groups (#29)
* removed repeating code in list groups
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: list of user group
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: otel handler operator name for endpoints
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* add: listing of shared things and users
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: listing of shared things and users
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: new SDK
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: new SDK
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: comment
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: sdk function names
Signed-off-by: Arvindh <arvindh91@gmail.com>
* update: api spec
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: channels connect request
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: listing of clients and groups
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: CLI
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: array len comparision
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: nginx
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2023-10-17 19:08:06 +05:30
|
|
|
var userIDs []string
|
|
|
|
if err := json.Unmarshal([]byte(args[1]), &userIDs); err != nil {
|
|
|
|
logError(err)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if err := sdk.RemoveUserFromGroup(args[2], mfxsdk.UsersRelationRequest{Relation: args[0], UserIDs: userIDs}, args[3]); err != nil {
|
2020-09-23 23:18:53 +02:00
|
|
|
logError(err)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
logOK()
|
|
|
|
},
|
|
|
|
},
|
NOISSUE: Listing of shared things with users & Update SDK (#1923)
* NOISSUE - Fix Bugs (#20)
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add Connect Disconnect endpoints (#23)
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: Things share with users (#25)
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: things share with other users
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: Listing of things, channels, groups, users (#26)
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: List of user groups & removed repeating code in groups (#29)
* removed repeating code in list groups
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: list of user group
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: otel handler operator name for endpoints
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* add: listing of shared things and users
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: listing of shared things and users
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: new SDK
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: new SDK
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: comment
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: sdk function names
Signed-off-by: Arvindh <arvindh91@gmail.com>
* update: api spec
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: channels connect request
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: listing of clients and groups
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: CLI
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: array len comparision
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: nginx
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2023-10-17 19:08:06 +05:30
|
|
|
|
2022-02-11 13:22:57 +01:00
|
|
|
{
|
NOISSUE: Listing of shared things with users & Update SDK (#1923)
* NOISSUE - Fix Bugs (#20)
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add Connect Disconnect endpoints (#23)
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: Things share with users (#25)
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: things share with other users
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: Listing of things, channels, groups, users (#26)
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: List of user groups & removed repeating code in groups (#29)
* removed repeating code in list groups
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: list of user group
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: otel handler operator name for endpoints
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* add: listing of shared things and users
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: listing of shared things and users
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: new SDK
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: new SDK
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: comment
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: sdk function names
Signed-off-by: Arvindh <arvindh91@gmail.com>
* update: api spec
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: channels connect request
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: listing of clients and groups
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: CLI
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: array len comparision
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: nginx
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2023-10-17 19:08:06 +05:30
|
|
|
Use: "users <group_id> <user_auth_token>",
|
|
|
|
Short: "List users",
|
|
|
|
Long: "List users in a group\n" +
|
2023-06-14 12:40:37 +02:00
|
|
|
"Usage:\n" +
|
NOISSUE: Listing of shared things with users & Update SDK (#1923)
* NOISSUE - Fix Bugs (#20)
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add Connect Disconnect endpoints (#23)
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: Things share with users (#25)
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: things share with other users
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: Listing of things, channels, groups, users (#26)
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: List of user groups & removed repeating code in groups (#29)
* removed repeating code in list groups
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: list of user group
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: otel handler operator name for endpoints
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* add: listing of shared things and users
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: listing of shared things and users
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: new SDK
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: new SDK
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: comment
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: sdk function names
Signed-off-by: Arvindh <arvindh91@gmail.com>
* update: api spec
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: channels connect request
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: listing of clients and groups
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: CLI
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: array len comparision
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: nginx
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2023-10-17 19:08:06 +05:30
|
|
|
"\tmainflux-cli groups users <group_id> $USERTOKEN",
|
2020-09-23 23:18:53 +02:00
|
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
|
|
if len(args) != 2 {
|
2022-02-11 13:22:57 +01:00
|
|
|
logUsage(cmd.Use)
|
2020-09-23 23:18:53 +02:00
|
|
|
return
|
|
|
|
}
|
2023-06-14 12:40:37 +02:00
|
|
|
pm := mfxsdk.PageMetadata{
|
2023-08-08 13:01:59 +03:00
|
|
|
Offset: Offset,
|
|
|
|
Limit: Limit,
|
2023-06-14 12:40:37 +02:00
|
|
|
Status: Status,
|
|
|
|
}
|
NOISSUE: Listing of shared things with users & Update SDK (#1923)
* NOISSUE - Fix Bugs (#20)
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add Connect Disconnect endpoints (#23)
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: Things share with users (#25)
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: things share with other users
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: Listing of things, channels, groups, users (#26)
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: List of user groups & removed repeating code in groups (#29)
* removed repeating code in list groups
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: list of user group
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: otel handler operator name for endpoints
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* add: listing of shared things and users
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: listing of shared things and users
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: new SDK
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: new SDK
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: comment
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: sdk function names
Signed-off-by: Arvindh <arvindh91@gmail.com>
* update: api spec
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: channels connect request
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: listing of clients and groups
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: CLI
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: array len comparision
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: nginx
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2023-10-17 19:08:06 +05:30
|
|
|
users, err := sdk.ListGroupUsers(args[0], pm, args[1])
|
2023-06-14 12:40:37 +02:00
|
|
|
if err != nil {
|
2020-09-23 23:18:53 +02:00
|
|
|
logError(err)
|
|
|
|
return
|
|
|
|
}
|
NOISSUE: Listing of shared things with users & Update SDK (#1923)
* NOISSUE - Fix Bugs (#20)
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add Connect Disconnect endpoints (#23)
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: Things share with users (#25)
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: things share with other users
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: Listing of things, channels, groups, users (#26)
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: List of user groups & removed repeating code in groups (#29)
* removed repeating code in list groups
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: list of user group
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: otel handler operator name for endpoints
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* add: listing of shared things and users
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: listing of shared things and users
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: new SDK
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: new SDK
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: comment
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: sdk function names
Signed-off-by: Arvindh <arvindh91@gmail.com>
* update: api spec
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: channels connect request
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: listing of clients and groups
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: CLI
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: array len comparision
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: nginx
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2023-10-17 19:08:06 +05:30
|
|
|
logJSON(users)
|
2020-09-23 23:18:53 +02:00
|
|
|
},
|
|
|
|
},
|
2022-02-11 13:22:57 +01:00
|
|
|
{
|
NOISSUE: Listing of shared things with users & Update SDK (#1923)
* NOISSUE - Fix Bugs (#20)
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add Connect Disconnect endpoints (#23)
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: Things share with users (#25)
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: things share with other users
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: Listing of things, channels, groups, users (#26)
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: List of user groups & removed repeating code in groups (#29)
* removed repeating code in list groups
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: list of user group
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: otel handler operator name for endpoints
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* add: listing of shared things and users
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: listing of shared things and users
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: new SDK
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: new SDK
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: comment
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: sdk function names
Signed-off-by: Arvindh <arvindh91@gmail.com>
* update: api spec
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: channels connect request
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: listing of clients and groups
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: CLI
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: array len comparision
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: nginx
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2023-10-17 19:08:06 +05:30
|
|
|
Use: "channels <group_id> <user_auth_token>",
|
|
|
|
Short: "List channels",
|
|
|
|
Long: "List channels in a group\n" +
|
2023-06-14 12:40:37 +02:00
|
|
|
"Usage:\n" +
|
NOISSUE: Listing of shared things with users & Update SDK (#1923)
* NOISSUE - Fix Bugs (#20)
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add Connect Disconnect endpoints (#23)
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: Things share with users (#25)
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: things share with other users
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: Listing of things, channels, groups, users (#26)
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: List of user groups & removed repeating code in groups (#29)
* removed repeating code in list groups
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: list of user group
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: otel handler operator name for endpoints
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* add: listing of shared things and users
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: listing of shared things and users
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: new SDK
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: new SDK
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: comment
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: sdk function names
Signed-off-by: Arvindh <arvindh91@gmail.com>
* update: api spec
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: channels connect request
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: listing of clients and groups
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: CLI
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: array len comparision
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: nginx
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2023-10-17 19:08:06 +05:30
|
|
|
"\tmainflux-cli groups channels <group_id> $USERTOKEN",
|
2020-09-23 23:18:53 +02:00
|
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
|
|
if len(args) != 2 {
|
2022-02-11 13:22:57 +01:00
|
|
|
logUsage(cmd.Use)
|
2020-09-23 23:18:53 +02:00
|
|
|
return
|
|
|
|
}
|
2023-01-05 19:20:05 +03:00
|
|
|
pm := mfxsdk.PageMetadata{
|
2023-08-08 13:01:59 +03:00
|
|
|
Offset: Offset,
|
|
|
|
Limit: Limit,
|
NOISSUE: Listing of shared things with users & Update SDK (#1923)
* NOISSUE - Fix Bugs (#20)
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add Connect Disconnect endpoints (#23)
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: Things share with users (#25)
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: things share with other users
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: Listing of things, channels, groups, users (#26)
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: List of user groups & removed repeating code in groups (#29)
* removed repeating code in list groups
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: list of user group
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: otel handler operator name for endpoints
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* add: listing of shared things and users
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: listing of shared things and users
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: new SDK
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: new SDK
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: comment
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: sdk function names
Signed-off-by: Arvindh <arvindh91@gmail.com>
* update: api spec
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: channels connect request
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: listing of clients and groups
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: CLI
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: array len comparision
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: nginx
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2023-10-17 19:08:06 +05:30
|
|
|
Status: Status,
|
2023-01-05 19:20:05 +03:00
|
|
|
}
|
NOISSUE: Listing of shared things with users & Update SDK (#1923)
* NOISSUE - Fix Bugs (#20)
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add Connect Disconnect endpoints (#23)
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: Things share with users (#25)
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: things share with other users
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: Listing of things, channels, groups, users (#26)
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: List of user groups & removed repeating code in groups (#29)
* removed repeating code in list groups
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: list of user group
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: otel handler operator name for endpoints
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* add: listing of shared things and users
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: listing of shared things and users
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: new SDK
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: new SDK
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: comment
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: sdk function names
Signed-off-by: Arvindh <arvindh91@gmail.com>
* update: api spec
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: channels connect request
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: listing of clients and groups
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: CLI
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: array len comparision
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: nginx
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2023-10-17 19:08:06 +05:30
|
|
|
channels, err := sdk.ListGroupChannels(args[0], pm, args[1])
|
2020-09-23 23:18:53 +02:00
|
|
|
if err != nil {
|
|
|
|
logError(err)
|
|
|
|
return
|
|
|
|
}
|
NOISSUE: Listing of shared things with users & Update SDK (#1923)
* NOISSUE - Fix Bugs (#20)
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add Connect Disconnect endpoints (#23)
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: Things share with users (#25)
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: things share with other users
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: Listing of things, channels, groups, users (#26)
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: List of user groups & removed repeating code in groups (#29)
* removed repeating code in list groups
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: list of user group
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: otel handler operator name for endpoints
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* add: listing of shared things and users
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: listing of shared things and users
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: new SDK
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: new SDK
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: comment
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: sdk function names
Signed-off-by: Arvindh <arvindh91@gmail.com>
* update: api spec
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: channels connect request
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: listing of clients and groups
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: CLI
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: array len comparision
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: nginx
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2023-10-17 19:08:06 +05:30
|
|
|
logJSON(channels)
|
2020-09-23 23:18:53 +02:00
|
|
|
},
|
|
|
|
},
|
2022-02-11 13:22:57 +01:00
|
|
|
{
|
2023-06-14 12:40:37 +02:00
|
|
|
Use: "enable <group_id> <user_auth_token>",
|
|
|
|
Short: "Change group status to enabled",
|
|
|
|
Long: "Change group status to enabled\n" +
|
|
|
|
"Usage:\n" +
|
|
|
|
"\tmainflux-cli groups enable <group_id> $USERTOKEN\n",
|
2020-09-23 23:18:53 +02:00
|
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
|
|
if len(args) != 2 {
|
2022-02-11 13:22:57 +01:00
|
|
|
logUsage(cmd.Use)
|
2020-09-23 23:18:53 +02:00
|
|
|
return
|
|
|
|
}
|
2023-06-14 12:40:37 +02:00
|
|
|
|
|
|
|
group, err := sdk.EnableGroup(args[0], args[1])
|
|
|
|
if err != nil {
|
|
|
|
logError(err)
|
|
|
|
return
|
2023-01-05 19:20:05 +03:00
|
|
|
}
|
2023-06-14 12:40:37 +02:00
|
|
|
|
|
|
|
logJSON(group)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Use: "disable <group_id> <user_auth_token>",
|
|
|
|
Short: "Change group status to disabled",
|
|
|
|
Long: "Change group status to disabled\n" +
|
|
|
|
"Usage:\n" +
|
|
|
|
"\tmainflux-cli groups disable <group_id> $USERTOKEN\n",
|
|
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
|
|
if len(args) != 2 {
|
|
|
|
logUsage(cmd.Use)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
group, err := sdk.DisableGroup(args[0], args[1])
|
2020-09-23 23:18:53 +02:00
|
|
|
if err != nil {
|
|
|
|
logError(err)
|
|
|
|
return
|
|
|
|
}
|
2023-06-14 12:40:37 +02:00
|
|
|
|
|
|
|
logJSON(group)
|
2020-09-23 23:18:53 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewGroupsCmd returns users command.
|
|
|
|
func NewGroupsCmd() *cobra.Command {
|
|
|
|
cmd := cobra.Command{
|
NOISSUE: Listing of shared things with users & Update SDK (#1923)
* NOISSUE - Fix Bugs (#20)
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add Connect Disconnect endpoints (#23)
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix bugs
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: Things share with users (#25)
* fix list of things in a channel and Add connect disconnect endpoint
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: things share with other users
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: Listing of things, channels, groups, users (#26)
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: listing of channels, users, groups, things
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* Add: List of user groups & removed repeating code in groups (#29)
* removed repeating code in list groups
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: list of user group
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: otel handler operator name for endpoints
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
* add: listing of shared things and users
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: listing of shared things and users
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: new SDK
Signed-off-by: Arvindh <arvindh91@gmail.com>
* add: new SDK
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: comment
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: sdk function names
Signed-off-by: Arvindh <arvindh91@gmail.com>
* update: api spec
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: channels connect request
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: listing of clients and groups
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: CLI
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: array len comparision
Signed-off-by: Arvindh <arvindh91@gmail.com>
* fix: nginx
Signed-off-by: Arvindh <arvindh91@gmail.com>
---------
Signed-off-by: Arvindh <arvindh91@gmail.com>
Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
Co-authored-by: Dušan Borovčanin <dusan.borovcanin@mainflux.com>
2023-10-17 19:08:06 +05:30
|
|
|
Use: "groups [create | get | update | delete | assign | unassign | users | channels ]",
|
2020-09-23 23:18:53 +02:00
|
|
|
Short: "Groups management",
|
2023-05-25 06:02:46 +08:00
|
|
|
Long: `Groups management: create, update, delete group and assign and unassign member to groups"`,
|
2020-09-23 23:18:53 +02:00
|
|
|
}
|
2022-02-11 13:22:57 +01:00
|
|
|
|
2020-09-23 23:18:53 +02:00
|
|
|
for i := range cmdGroups {
|
|
|
|
cmd.AddCommand(&cmdGroups[i])
|
|
|
|
}
|
2022-02-11 13:22:57 +01:00
|
|
|
|
2020-09-23 23:18:53 +02:00
|
|
|
return &cmd
|
|
|
|
}
|