netbird icon indicating copy to clipboard operation
netbird copied to clipboard

Enable renaming of groups

Open Lamera opened this issue 10 months ago • 3 comments

Is your feature request related to a problem? Please describe. I defined a group and gave it a wrong name. Now I have to re-create the whole group with its policies.

Describe the solution you'd like I simply would like to rename the group name in the Dashboard.

Describe alternatives you've considered I thought about changing the name in the database. Perhaps I will break something by doing this.

Lamera avatar Jan 31 '25 16:01 Lamera

This would be a very handy feature! Especially with lots of policies, it is a lot of work currently.

Afaik, the API does support renaming already and it's mainly the dashboard that is missing the UI part? (e.g. Settings->Groups)

bc547 avatar May 27 '25 13:05 bc547

Any news about this?

MichalisDBA avatar Jun 02 '25 14:06 MichalisDBA

Hello Folks, early in Q3/2025, we plan to move the group management to a higher level in our dashboard, perhaps replacing setup keys, and then you should be able to rename the groups.

For now, you should be able to use the API to rename, as pointed out by @bc547

mlsmaycon avatar Jun 02 '25 14:06 mlsmaycon

I tried the API and to update the name but after that it removed itself from all the peers. I have a selfhosted Netbird.

Is this a bug or intended?

❯ curl -X PUT https://my-netbird/api/groups/d3dpv47k31bs73abamjg \
      -H 'Accept: application/json' \
      -H 'Content-Type: application/json' \
      -H 'Authorization: Token nbp_fCb*************' \
      --data-raw '{
    "name": "my-cloud-network"
  }'

{"id":"d3dpv47k31bs73abamjg","issued":"api","name":"my-cloud-network","peers":null,"peers_count":0,"resources":null,"resources_count":0}

hrvoj3e avatar Sep 30 '25 11:09 hrvoj3e

@hrvoj3e I'm like 90% sure this endpoint is for a full update of the Group (not a partial update/patch), meaning you need to pass the whole object to it, not just a different group name, otherwise it gets cleared.

nazarewk avatar Sep 30 '25 16:09 nazarewk

@hrvoj3e I'm like 90% sure this endpoint is for a full update of the Group (not a partial update/patch), meaning you need to pass the whole object to it, not just a different group name, otherwise it gets cleared.

@nazarewk: That doesn't seem to work for me either:

TOKEN=xxx
MGMT_URL=https://selfhostedurl.com
clear

# get groups
curl -X GET $MGMT_URL/api/groups \
-H "Accept: application/json" \
-H "Authorization: Token $TOKEN" | jq 

# relevant group output
# {
    # "id": "d3oprnce3knc73dkmbbg",
    # "issued": "api",
    # "name": "Test B",
    # "peers": [
      # {
        # "id": "d3mntjse3knc73e0c7bg",
        # "name": "mitch-macbook"
      # }
    # ],
    # "peers_count": 1,
    # "resources": null,
    # "resources_count": 0
#   }

# set group ID to rename
UPD_GROUP=d3oprnce3knc73dkmbbg

# tried to update it to "Test 3", including sending all peers
curl -X PUT $MGMT_URL/api/groups/$UPD_GROUP \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Token $TOKEN" \
--data-raw '{
  "name": "Test C",
  "peers": [
      {
        "id": "d3mntjse3knc73e0c7bg",
        "name": "mitch-macbook"
      }
    ],
}'

Produces:

{"message":"couldn't parse JSON request","code":400}

I even tried with the other null/empty fields that I believe are auto-generated:

curl -X PUT $MGMT_URL/api/groups/$UPD_GROUP \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Token $TOKEN" \
--data-raw '{
  "name": "Test C",
  "peers": [
      {
        "id": "d3mntjse3knc73e0c7bg",
        "name": "mitch-macbook"
      }
    ],
    "peers_count": 1,
    "resources": null,
    "resources_count": 0
}'

And it produces the same {"message":"couldn't parse JSON request","code":400}

mitchplze avatar Oct 17 '25 01:10 mitchplze