From b9e64045aee7d215bfe5e1f360f3d4a4b41a959c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20=C5=A0urda?= Date: Mon, 7 Mar 2022 09:25:29 +0100 Subject: [PATCH] Add 'ADMIN.md' --- ADMIN.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 ADMIN.md diff --git a/ADMIN.md b/ADMIN.md new file mode 100644 index 0000000..30b4322 --- /dev/null +++ b/ADMIN.md @@ -0,0 +1,23 @@ +# how to create an influx admin + +- create a config in a docker exec session: + +`influx config create --config-name a --host-url http://localhost:8086 --org MY_ORG --token AUTH_TOKEN --active` + +- create the user (as a normal member): + +`influx user create --name USERNAME --password PASSWORD` + +will print the user ID + +- list orgs so that you know the org ID: + +`influx org list` + +- remove the user from the org + +`curl -H "Authorization: Token SAME_TOKEN_AS_ABOVE" -XDELETE http://localhost:8086/api/v2/orgs/ORG_ID_FROM_ABOVE/members/USER_ID_FROM_ABOVE` + +- add the user as an admin to the org + +`curl -H "Authorization: Token SAME_TOKEN_AS_ABOVE" -XPOST -d '{"id": "USER_ID_FROM_ABOVE"}' http://localhost:8086/api/v2/orgs/ORG_ID_FROM_ABOVE/owners` \ No newline at end of file