Skip to main content
Answer

Set Project Role through API V3

  • June 5, 2020
  • 4 replies
  • 3909 views

Hello,

I’m working with Rest API, to “automate” some operations with Ansible, trought URI Module and Jinja2.

I need to create a Project, and set permission to a specific user.

How can i do this with API V3? I can add user to a Project, but i can’t set the Role.. When i check trought the Web Interface, i see the user without role.

Thanks!

Best answer by AnishWalia20

Hi @DanielePesciallo Can you try doing the below:

1) List the roles using this API:

API: 

https://<PCVM_IP>:9440/api/nutanix/v3/roles/list

2) And then update the project using this API:

https://<PCVM_IP>:9440/api/nutanix/v3/projects_internal/<Project_UUID>

For assigning roles to users in the project, this should work, given you know which user to add and that is already configured through directory services.

You can find more details in Rest API explorer about the above.  Let me know if this works. :relaxed:

This topic has been closed for replies.

4 replies

AnishWalia20
Nutanix Employee
Forum|alt.badge.img+5
  • Nutanix Employee
  • Answer
  • June 8, 2020

Hi @DanielePesciallo Can you try doing the below:

1) List the roles using this API:

API: 

https://<PCVM_IP>:9440/api/nutanix/v3/roles/list

2) And then update the project using this API:

https://<PCVM_IP>:9440/api/nutanix/v3/projects_internal/<Project_UUID>

For assigning roles to users in the project, this should work, given you know which user to add and that is already configured through directory services.

You can find more details in Rest API explorer about the above.  Let me know if this works. :relaxed:


Hello @AnishWalia20

Thanks!

Unfortunately, I can’t find any reference about “project_internal”.. I can’t find it on my Rest API Explorer (i’ve Prism Central 5.17.0.3).

Can you help me? Do you have any "documentation" about this?

Thanks

Daniele


AnishWalia20
Nutanix Employee
Forum|alt.badge.img+5
  • Nutanix Employee
  • June 8, 2020

Really sorry but, this API is actually internal @DanielePesciallo . We don’t have this listed in any public documentation.


AnishWalia20
Nutanix Employee
Forum|alt.badge.img+5
  • Nutanix Employee
  • June 10, 2020

Hi @DanielePesciallo , any update. Did it work? Do you need anything else related to this?