Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created on 09-08-2017 07:14 AM - edited 09-16-2022 05:12 AM
I am executing this curl command ,When I provide files view to a particular user, then in files views, only that user persisted and other users get deleted.
admin-> manage amabri -> views > files : here I find only user whom i given access with this curl command but users those were earlier there got deleted
curl -i -u $Ambariadmin:$ambaripass -H "X-Requested-By: ambari" -X PUT -d '[{"PrivilegeInfo":{"permission_name":"VIEW.USER","principal_name":"'$username'","principal_type":"USER"}}]' http://localhost:8080/api/v1/views/$viewname/versions/$version/instances/$instance/privileges
Created 09-08-2017 07:38 AM
- You will need to pass all the previous user privilege details as well along with the new user when you want to edit the list using API call:
Example if you already have users privilleges for "123jay", "jay". Now you want to add another user "jayyarn" in the privilleges list then you should PUT the whole list again.
Example:
curl -i -u $Ambariadmin:$ambaripass -H "X-Requested-By: ambari" -X PUT -d '[{"PrivilegeInfo":{"permission_name":"VIEW.USER","principal_name":"123jay","principal_type":"USER"}},{"PrivilegeInfo":{"permission_name":"VIEW.USER","principal_name":"jay","principal_type":"USER"}},{"PrivilegeInfo":{"permission_name":"VIEW.USER","principal_name":"jayyarn","principal_type":"USER"}},{"PrivilegeInfo":{"permission_name":"VIEW.USER","principal_name":"CLUSTER.ADMINISTRATOR","principal_type":"ROLE"}},{"PrivilegeInfo":{"permission_name":"VIEW.USER","principal_name":"CLUSTER.OPERATOR","principal_type":"ROLE"}},{"PrivilegeInfo":{"permission_name":"VIEW.USER","principal_name":"SERVICE.OPERATOR","principal_type":"ROLE"}},{"PrivilegeInfo":{"permission_name":"VIEW.USER","principal_name":"SERVICE.ADMINISTRATOR","principal_type":"ROLE"}},{"PrivilegeInfo":{"permission_name":"VIEW.USER","principal_name":"CLUSTER.USER","principal_type":"ROLE"}}]' http://localhost:8080/api/v1/views/$viewname/versions/$version/instances/$instance/privileges.
Created 09-08-2017 07:15 AM
@Jay SenSharma could you pls look into issue
Created 09-08-2017 07:38 AM
- You will need to pass all the previous user privilege details as well along with the new user when you want to edit the list using API call:
Example if you already have users privilleges for "123jay", "jay". Now you want to add another user "jayyarn" in the privilleges list then you should PUT the whole list again.
Example:
curl -i -u $Ambariadmin:$ambaripass -H "X-Requested-By: ambari" -X PUT -d '[{"PrivilegeInfo":{"permission_name":"VIEW.USER","principal_name":"123jay","principal_type":"USER"}},{"PrivilegeInfo":{"permission_name":"VIEW.USER","principal_name":"jay","principal_type":"USER"}},{"PrivilegeInfo":{"permission_name":"VIEW.USER","principal_name":"jayyarn","principal_type":"USER"}},{"PrivilegeInfo":{"permission_name":"VIEW.USER","principal_name":"CLUSTER.ADMINISTRATOR","principal_type":"ROLE"}},{"PrivilegeInfo":{"permission_name":"VIEW.USER","principal_name":"CLUSTER.OPERATOR","principal_type":"ROLE"}},{"PrivilegeInfo":{"permission_name":"VIEW.USER","principal_name":"SERVICE.OPERATOR","principal_type":"ROLE"}},{"PrivilegeInfo":{"permission_name":"VIEW.USER","principal_name":"SERVICE.ADMINISTRATOR","principal_type":"ROLE"}},{"PrivilegeInfo":{"permission_name":"VIEW.USER","principal_name":"CLUSTER.USER","principal_type":"ROLE"}}]' http://localhost:8080/api/v1/views/$viewname/versions/$version/instances/$instance/privileges.