Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

admin API issues (solved) #42

Closed
abiank opened this issue Nov 12, 2013 · 2 comments
Closed

admin API issues (solved) #42

abiank opened this issue Nov 12, 2013 · 2 comments

Comments

@abiank
Copy link

abiank commented Nov 12, 2013

Http admin API docs use the "name" parameter, but the correct paramter to pass is "username"

i am having a few issues using the admin api. for example:

(influx is running on host y)

i add a db called testing
ale@cu:$ curl -X POST 'http://y:8086/db?u=root&p=root' -d '{"name": "testing"}'
the following line should add a db admin according to docs, but returns 404.
ale@cu:
$ curl -X POST 'http://y:8086/db/testing/admins?u=root&p=root' -d '{"username": "admin", "password": "whatever"}'
404 page not found

another issue i have is that i cannot seem to add more than one user to a db:

ale@cu:~$ curl -X POST 'http://y:8086/db/testing/users?u=root&p=root' -d '{"name":"fulluser","password":"fulluser", "readPermissions":[{"matcher":"."}],"writePermissions":[{"matcher":"."}]}'

first added user is ok, but if i add another one:

ale@cu:~$ curl -X POST 'http://y:8086/db/testing/users?u=root&p=root' -d '{"name":"rouser","password":"rouser", "readPermissions":[{"matcher":".*"}],"writePermissions":[{"matcher":"null"}]}'
User already exists

it is telling me the user already exists even though names are different. and in the end if i do:

get a list of users for db testing

ale@cu:~$ curl 'http://y:8086/db/testing/users?u=root&p=root'
[{"username":""}]

...always an empty list, unless i use db site_dev, for which i get:

ale@cu:~$ curl 'http://y:8086/db/site_dev/users?u=root&p=daje'
[{"username":"al"},{"username":"public"}]

@jvshahid
Copy link
Contributor

I think there's an inconsistency between the docs and the actual implementation. I'll address those shortly and close this issue.

jvshahid added a commit that referenced this issue Nov 12, 2013
@jvshahid
Copy link
Contributor

Thanks @abiank for reporting this issue. The docs and implementation are in sync now. Please revisit the docs.

All of you examples should work except the /db/testing/admins. This endpoint doesn't exist anymore, you should use /db/testing/users and send a body that looks like {"admin": true} to add the admin privilege or false to remove it from a given user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants