This API has a deprecated equivalent from v7.0U1.
Create Local Accounts
DescriptionCreate a new local user account.
Request
URLURL
https://{api_host}/api/appliance/local-accounts
Header Parameters
Header Parameters
string
vmware-api-session-id
Required
Required session ID, acquired from Create Session API under CIS product
vmware-api-session-id example
"b00db39f948d13ea1e59b4d6fce56389"
Request Body
Request Body
LocalAccountsCreateRequestBody of mimetype application/json
Required
This is a request body class for an operation.
(The request body parameter is missing description)
{
"config": {
"password": "string",
"roles": [
"string"
]
},
"username": "string"
}
string
username
Required
User login name The parameter must be an identifier for the resource type: com.vmware.appliance.local_accounts.
Authentication
This operation uses the following authentication methods.
Errors
Errors
400
com.vmware.vapi.std.errors.already_exists : If an account already exists | 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)
default
‘Default’ means this response is used for all HTTP codes that are not covered individually for this operation.
Code Samples
PowerCLI Client SDK Example
$LocalAccountsConfig = Initialize-LocalAccountsConfig -Password "MyPassword" -Roles "MyRoles"
$LocalAccountsCreateRequestBody = Initialize-LocalAccountsCreateRequestBody -Username "MyUsername" -Config $LocalAccountsConfig
Invoke-CreateLocalAccounts -LocalAccountsCreateRequestBody $LocalAccountsCreateRequestBody
PowerCLI Client SDK All Parameters Example
$LocalAccountsConfig = Initialize-LocalAccountsConfig -Password "MyPassword" -OldPassword "MyOldPassword" -FullName "MyFullName" -Email "MyEmail" -Roles "MyRoles" -Enabled $false -PasswordExpires $false -PasswordExpiresAt (Get-Date) -InactiveAfterPasswordExpiration $false -DaysAfterPasswordExpiration 0 -MinDaysBetweenPasswordChange 0 -MaxDaysBetweenPasswordChange 0 -WarnDaysBeforePasswordExpiration 0
$LocalAccountsCreateRequestBody = Initialize-LocalAccountsCreateRequestBody -Username "MyUsername" -Config $LocalAccountsConfig
Invoke-CreateLocalAccounts -LocalAccountsCreateRequestBody $LocalAccountsCreateRequestBody
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},"username":"string"}' https://{api_host}/api/appliance/local-accounts
Vendor Extensions
This operation contains the following vendor extensions defined in the spec:
x-vmw-doc-deprecated-method: post
x-vmw-doc-deprecated-path: /rest/appliance/local-accounts/{username}
x-vmw-doc-operation: create
Availability
Added in 7.0U2
On This Page
Local Accounts Operations
patch
delete