Create Local Accounts
If vSphere APIs begin with /rest (vs /api), any maps are consumed/returned instead as arrays of objects, each containing a key and a value property field.
Create a new local user account.
Request
URLURL
https://{api_host}/rest/appliance/local-accounts/{username}
Parameters
Parameters
string
username
Required
User login name
The parameter must be an identifier for the resource type: com.vmware.appliance.local_accounts.
Header Parameters
Header Parameters
string
vmware-api-session-id
Required
Required session ID, obtained by first calling Create Session API
Example: b00db39f948d13ea1e59b4d6fce56389
Request Body
Request Body
LocalAccountsCreateRequestBody of type application/json (required){
"config": {
"password": "string",
"roles": [
"string"
]
}
}
cURL Command
curl -X POST -H "vmware-api-session-id: b00db39f948d13ea1e59b4d6fce56389" -H "Content-Type: application/json" -d '{"config":{"days_after_password_expiration":0,"email":"string","enabled":false,"full_name":"string","inactive_after_password_expiration":false,"max_days_between_password_change":0,"min_days_between_password_change":0,"old_password":"string","password":"string","password_expires":false,"password_expires_at":"string","roles":["string"],"warn_days_before_password_expiration":0}}' https://{api_host}/rest/appliance/local-accounts/{username}
Errors
400
com.vmware.vapi.std.errors.invalid_argument : If a username is invalid (username is validated against [a-zA-Z0-9][a-zA-Z0-9\-\.@]*[a-zA-Z0-9] pattern)
On This Page
Local Accounts Operations
patch
delete