Documentation is useless
Closed this issue · 4 comments
http://cloudera.github.io/cm_api/apidocs/v6/ns0_apiUser.html is supposed to contain documentation. The only goal I want to achieve is to do a HTTP PUT request via e.g. curl for testing to set the password of the admin user. Unfortunately, you have documented absolutely nothing useful to obtain this goal.
For example, for the fields pwHash, pwSalt and pwLogin it says: NOTE: Only available in the "export" view
.
You should write down what the valid range of values is for those inputs without requiring me to reverse-engineer your "product" and you should write down all other conditions which need to be true before this call works, if any.
Your Python API is terrible too, because it doesn't actually do anything unless you specify the version of the API you want to use. This is an optional parameter in your API, but you actually require it, without documenting it. In other words: what are you smoking?
Aragnon,
You are looking at the data model instead of the REST API docs. If you look at the REST API it shows you how to make the changes using the data model:
To change user Woody's password to xyx I did the following:
curl -X PUT -u cmadmin:adminpassword http:/cmserver.domain.com:7180/api/v6/users/woody/ -H "Content-Type: application/json" -d '{"password":"xyz"}'
If you need further help with API usage I would strongly recommend the Cloudera Forums:
https://community.cloudera.com/t5/Cloudera-Manager-Installation/bd-p/CMInstall
And where are these imaginary "docs"?
I don't need you to show me a curl request, I want you to point me at an URL.
They are certainly also not here:
http://cloudera.github.io/cm_api/apidocs/v6/path__users_-userName-.html
It shows to use an http PUT:
http://cloudera.github.io/cm_api/apidocs/v6/path__users_-userName-.html
The type it accepts is a user element which is of type apiUser.
http://cloudera.github.io/cm_api/apidocs/v6/ns0_apiUser.html
If you do an HTTP put of an user JSON object it works, which is what the curl command is showing.
What part is unclear?
The documentation states:
"Returns the user password."
for the call you used. How can you not see that this is not wrong documentation? If you can also set a password via that method, how about you write that down instead?
Additionally, I still don't know what the various pw* fields are for and how they can be used. If they are not intended to be used, hide them, if they are, document them.