我正在查看apache Ranger
REST API 以将现有的内部用户/用户添加到现有的内部组。
我一直在查看文档,但似乎找不到有用的东西,是否有 API?
我正在查看apache Ranger
REST API 以将现有的内部用户/用户添加到现有的内部组。
我一直在查看文档,但似乎找不到有用的东西,是否有 API?
尝试以下 api 调用:-
curl -ivk -u admin:admin -H "Content-Type: application/json" -d '{"id":13,"createDate":"2020-12-23T07:55:04Z","updateDate":"2020-12-23T07:55:04Z","owner":"rangerusersync","updatedBy":"rangerusersync","name":"atlas","password":"*****","description":"atlas - add from Unix box","groupIdList":[6,59,4,131,133],"groupNameList":["atlas","hadoop","shadow"],"status":0,"isVisible":1,"userSource":1,"userRoleList":["ROLE_USER"],"otherAttributes":"{\"full_name\":\"atlas\",\"original_name\":\"atlas\"}"}' -X PUT https://RANGER_HOST:6182/service/xusers/users
它有点大,但如果用户已经添加到游侠然后运行以下 api 来获取用户的 id 信息:-
curl -ivk -u admin:admin -H "Accept : application/json" -X GET https://RANGER_HOST:6182/service/xusers/users
获得所有用户的 ID 后,您可以运行以下 curl api 来获取 json 格式的数据,您可以使用这些数据进行修改,然后在我提到的第一个 API 中使用 PUT 方法:-
curl -ivk -u admin:admin -H "Accept: application/json" -X GET https://RANGER_HOST:6182/service/xusers/users/13
以上 Curl api 应返回如下内容:-
{"id":13,"createDate":"2020-12-23T07:55:04Z","updateDate":"2020-12-23T16:45:14Z","owner":"rangerusersync","updatedBy":"admin","name":"atlas","password":"*****","description":"atlas - add from Unix box","groupIdList":[133,6],"groupNameList":["apitest","atlas","hadoop","shadow","ssb"],"status":0,"isVisible":1,"userSource":1,"userRoleList":["ROLE_USER"],"otherAttributes":"{\"full_name\":\"atlas\",\"original_name\":\"atlas\"}"}
您必须"groupIdList":[133,6]
从上面的输出中修改复制整个输出并使用 PUT 方法传递它,如上面提到的第一个 api 调用所示。