
vShield API Programming Guide
18 VMware, Inc.
Update a Local User Account
Youcanupdatealocaluseraccountincludingpassword.Ifapasswordisnotprovided,theexistingpassword
isretained.The<userId>variableintherequestheadershouldbesameastheonespecifiedinXML.TheAPI
returnsupdatedinformationfortheuser.
Example 2-9. Update a local user account
RequestHeader:
PUT https://<vsm-ip>/api/2.0/services/usermgmt/user/local/<userId>
RequestBody:
<userInfo>
<userId>somebody</userId>
<password>123</password>
<fullname>Person Somebody</fullname>
<accessControlEntry>
<role>security_admin</role>
<resource><resourceId>datacenter-312</resourceId></resource>
</accessControlEntry>
</userInfo>
Enable or Disable a User Account
Youcandisableorenableauseraccount,eitherlocaluserorvCenteruser.Whenauseraccountiscreated,the
accountisenabledbydefault.
Example 2-10. Enable or disable a user account
Request:
PUT https://<vsm-ip>/api/2.0/services/usermgmt/user/<userId>/enablestate/<value>
The<value>canbe0(zero)todisabletheaccount,or1(one)toenabletheaccount.
ThisAPIreturns“204NoContent”ifsuccessful.
Remove a User Account
ThefirstAPIremovesalocaluseraccount,orremovestheVSMroleassignmentforavCenteruser,without
affectingthevCenteraccount.ThesecondAPIremovesavCenteruser’srolesbutisnotallowedforlocalusers.
Example 2-11. Remove a user account
Request:
DELETE https://<vsm-ip>/api/2.0/services/usermgmt/user/<userId>
Example 2-12. Removing a user role
Request:
DELETE https://<vsm-ip>/api/2.0/services/usermgmt/role/<userId>
BothAPIsreturn“204NoContent”ifsuccessful.
Komentáře k této Příručce