PATCH – Update userid/password/role/ PasswordChangeRequired
Use the PATCH method to update properties in Account resource for Redfish service.
Request URL
PATCH https://<BMC_IPADDR>/redfish/v1/AccountService/Accounts/{1...12}
Request body
Properties to be updated are shown as bellow, all of these properties can be changed individually.
Field | Type | Description | |
---|---|---|---|
UserName | String | The user name for this account. | |
Password | String | The password of the account. Display null on a PATCH response. | |
RoleId | String | The ID of the Role resource that configured for this account. | |
Enabled | Boolean | Enable this account or not. | |
PasswordChangeRequired | Boolean | Set it to true if the password for this account must be changed before further access is allowed. | |
AccountTypes | Array | The various manager services that this 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 | Authentication conforms to the authentication protocol. | |
EncryptionKey | String | The secret authentication key for SNMPv3. | |
EncryptionProtocol | String | Encryption conforms to the encryption protocol. |
Response body
The response returns same content as GET operation with updated properties.
Status code
HTTP Status Code | Error Message ID |
---|---|
500 | InternalError |
400 | PropertyValueTypeError PropertyValueFormatError ResourceChangeRequried NotRecommandedOperation ForbiddenOperation ResourceAlreadyExists PropertyMissing PasswordChangeRequired |
Example
The following example is PATCH body.
{
"UserName": "USERID",
"RoleId": "Administrator",
"PasswordChangeRequired": false
}
The following example JSON response is returned:
{
"Enabled": true,
"Oem": {
…
},
"Links": {
"Role": {
"@odata.id": "/redfish/v1/AccountService/Roles/Administrator"
}
},
"Description": "This resource is used to represent an account for the manager for a Redfish implementation.",
"Locked": false,
"PasswordChangeRequired": false,
"Password": null,
"Id": "1",
"@odata.context": "/redfish/v1/$metadata#ManagerAccount.ManagerAccount",
"PasswordExpiration": null,
"@odata.id": "/redfish/v1/AccountService/Accounts/1",
"@odata.etag": "\"0000000000000000000000000000000032a05d16\"",
"UserName": "USERID",
"Name": "User1",
"HostBootstrapAccount": false,
"AccountTypes": [
"WebUI",
"Redfish",
"ManagerConsole"
],
"@odata.type": "#ManagerAccount.v1_8_1.ManagerAccount",
"RoleId": "Administrator",
"AccountTypes@Redfish.AllowableValues": [
"WebUI",
"Redfish",
"ManagerConsole",
"IPMI",
"SNMP"
],
"SNMP": {
"AuthenticationProtocol": "HMAC_SHA96",
"EncryptionKeySet": false,
"EncryptionKey": null,
"EncryptionProtocol": "CFB128_AES128"
}
}