Skip to main content

POST – Create an account

Create an account resource for Redfish service by HTTP POST method.

Request URL

Note
Before creating an account, please make sure the new account name and password follow the rules in AccountService, such as length, password complexity, changing interval, etc.
POST https://<BMC_IPADDR>/redfish/v1/AccountService/Accounts

Request body

Field

Type

Description

UserName

String

The new account name.

Enabled

Boolean

Indicates if this account is enabled.

Password

String

The new account password.

RoleId

String

Role ID for new account.

PasswordChangeRequired

Boolean

If need to change password when the first login.

AccountTypes

Array

The various manager services that the new account is allowed to access.

 

AccountTypes[N]

String

“Redfish”, “SNMP”, “ManagerConsole”, “IPMI”, “WebUI”

Note

If the account has IPMI access right, the password should be set to equal to or less than 20 characters. If the account has SNMP access right, the EncryptionKey should be set to equal to or less than 32 characters. In addition, if EncryptionProtocol is not “none”, AuthenticationProtocol should not be “none” either.

SNMP

Object

Expand

Note
This setting is not available when AccountTypes does not contain “SNMP”.
 

AuthenticationProtocol

String

This value indicates authentication conforms to the authentication protocol.

 

EncryptionKey

String

The secret authentication key for SNMPv3.

 

EncryptionProtocol

String

The value indicates encryption conforms to the encryption protocol.

Response body

The response returns the same content as GET operation with updated properties.

Status code

HTTP Status CodeError Message ID
500InternalError
400

CreateFailedMissingReqProperties

PropertyValueTypeError

PropertyValueFormatError

ResourceChangeRequried

NotRecommandedOperation

ForbiddenOperation

ResourceAlreadyExists

PropertyMissing

PasswordChangeRequired

Example

The following example is POST body

{
"UserName": "TempUser",
"Password": "Passw0rd4U",
"RoleId": "Administrator",
"PasswordChangeRequired": true,
"AccountTypes": [
"WebUI",
"Redfish",
"SNMP",
"ManagerConsole"
],
"SNMP": {
"AuthenticationProtocol": "HMAC_SHA96",
"EncryptionKey": "snmpPassw0rd",
"EncryptionProtocol": "CFB128_AES128"
}
}

The following example JSON response is returned:

{
"HostBootstrapAccount": false,
"AccountTypes@Redfish.AllowableValues": [
"WebUI",
"Redfish",
"ManagerConsole",
"IPMI",
"SNMP"
],
"@odata.context": "/redfish/v1/$metadata#ManagerAccount.ManagerAccount",
"UserName": "TempUser",
"Locked": false,
"RoleId": "Administrator",
"Name": "User2",
"PasswordChangeRequired": true,
"Password": null,
"@odata.etag": "\"0000000000000000000000000000000032a05d16\"",
"Oem": {

},
"Enabled": true,
"SNMP": {
"EncryptionProtocol": "CFB128_AES128",
"AuthenticationProtocol": "HMAC_SHA96",
"EncryptionKey": null,
"EncryptionKeySet": true
},
"@odata.id": "/redfish/v1/AccountService/Accounts/2",
"AccountTypes": [
"WebUI",
"Redfish",
"ManagerConsole",
"SNMP"
],
"Links": {
"Role": {
"@odata.id": "/redfish/v1/AccountService/Roles/Administrator"
}
},
"Id": "2",
"Description": "This resource is used to represent an account for the manager for a Redfish implementation.",
"@odata.type": "#ManagerAccount.v1_8_1.ManagerAccount",
"PasswordExpiration": "2022-08-12T05:56:08Z"
}