
VMware, Inc. 19
Chapter 2 vShield Manager Management
Role Management
Get Role for a User
Youcanretrieveinformationabouttheroleassignedtothisuser.
Example 2-13. Retrieve the role of a user
Request:
GET https://<vsm-ip>/api/2.0/services/usermgmt/role/<userId>
Possiblerolesaresuper_user,vshield_admin,enterprise_admin,security_admin,andauditor.
Add Role and Resources for a User
Youcanaddroleandaccessibleresourcesforthespecifieduser.ItaffectsonlyvCenterusers,notlocalusers.
ForlocalvShieldManagerusers,itthrowserror“400:Useralreadypresent.”
Example 2-14. Update the role of a user
RequestHeader:
POST https://<vsm-ip>/api/2.0/services/usermgmt/role/<userId>
RequestBody:
<accessControlEntry>
<role>new_role</role>
<resource>
<resourceId>resource-num</resourceId>
...
</resource>
</accessControlEntry>
ThisAPIreturns“204NoContent”ifsuccessful.
Change Role for a User
Youcanupdatetheroleassignmentforagivenuser.TheAPIreturnsanoutputrepresentationspecifyinga
new<accessControlEntry>fortheuser.
Example 2-15. Change the role of a user
RequestHeader:
PUT https://<vsm-ip>/api/2.0/services/usermgmt/role/<userId>
RequestBody:
<accessControlEntry>
<role>new_role</role>
<resource>
<resourceId>resource-num</resourceId>
...
</resource>
</accessControlEntry>
Possiblerolesaresuper_user,vshield_admin,enterprise_admin,security_admin,andauditor.
Kommentare zu diesen Handbüchern