Modifying Information About a User
Function
This interface is used to modify information about a specified user, including the user name, password, role, lockout status, enablement status, and login interface.
Syntax
Operation type: PATCH
URL:https://device_ip/redfish/v1/AccountService/Accounts/member_id
Request header:
X-Auth-Token: auth_value
Content-Type: header_type
Request message body:
- Change only the password or change both the user name and password.
{ "UserName": "admin", "old_password": "old_password", "Password":"new_password", "new_password_second": "new_password_second" }
- Change only the user name.
{ "UserName": "admin", "old_password": "old_password" }
Parameters
Parameter |
Description |
Value |
---|---|---|
device_ip |
IP address for logging in to a device |
An IPv4 or IPv6 address |
member-id |
ID of the account whose information is to be modified |
Account ID |
auth_value |
Authentication parameter contained in the request |
You can obtain the value from the session created by using /redfish/v1/SessionService/Sessions. |
header_type |
Request format |
Supported formats include:
|
username |
New user name |
Value: a string of 1 to 16 characters Setting rules:
|
old_password |
Password to be changed |
Value: a string of a maximum of 20 characters
|
password |
New password |
Value: a string of a maximum of 20 characters
|
new_password_second |
New password to be confirmed |
Value: a string of a maximum of 20 characters
|
Usage Guidelines
You can modify one or several attributes in the request message body for specified users.
Example
Request:
PATCH https://10.10.10.10/redfish/v1//AccountService/Accounts/1
Request header:
X-Auth-Token: 6599174c38c36838737d9749179e1ee1
Content-Type: application/json
Request message body:
Change only the password or change both the user name and password.
{
"UserName": "test",
"old_password": "@12345678",
"Password":"@123456789",
"new_password_second":"@123456789"
}
Response:
{@odata.context: "/redfish/v1/$metadata#AccountService/Accounts/Members/$entity"
@odata.id: "/redfish/v1/AccountService/Accounts/1"
@odata.type: "#ManagerAccount.v1_0_2.ManagerAccount"
AccountInsecurePrompt: false
AuthFailureLoggingCnt: 0
AuthFailureLoggingThreshold: 5
ConfigNavigatorPrompt: false
Enabled: true
Id: "1"
LastLoginFailureTime: "2019-07-09 16:27:05"
LastLoginSuccessTime: "2019-07-09 19:35:48"
Links: {Role: {@odata.id: "/redfish/v1/AccountService/Roles/Administrator"}}
Locked: false
Name: "User Account"
Password: null
PasswordValidDays: 29
RoleId: "Administrator"
UserName: "admin"}
Response code: 201
Output Description
Field |
Type |
Description |
---|---|---|
@odata.context |
Character string |
OData information of the user resource model |
@odata.id |
Character string |
Access path of the user resource node |
@odata.type |
Character string |
Type of the user resource |
Id |
Character string |
ID of the user resource |
Name |
Character string |
Name of the user resource |
Password |
Character string |
Attribute used with PATCH or POST to set the user password. It is empty when used with GET. |
UserName |
Character string |
User name |
RoleId |
Character string |
ID of the role resource configured for the user |
AuthFailureLoginCnt |
Numeric value |
Number of consecutive login failures |
AuthFailureLoginThreshold |
Numeric value |
Maximum number of consecutive login failures. If the number of consecutive login failures exceeds this value, the account will be locked. |
LastLoginSuccessTime |
Character string |
Time of the last successful login If this parameter is empty, the user logs in to the system for the first time. |
LastLoginFailureTime |
Character string |
Time of the last login failure If this parameter is empty, no login failure occurs. |
AccountInsecurePrompt |
Boolean |
Specifies whether to remind the user to change the password. If the password is the initial password, a reminder is required. |
PasswordValidDays |
Character string |
Number of days before the password expires -- indicates the initial password, which will never expire. |
ConfigNavigatorPrompt |
Boolean |
Specifies whether to open the quick configuration wizard. The value can be true or false. The default value is true. When the configuration is complete, the value will be changed to false. |
Locked |
Boolean |
The account is locked. When this attribute is set to true, the account is locked. The administrator can set this attribute to false to unlock the account manually. The account will also be unlocked once the lock duration has elapsed. |
Enabled |
Boolean |
Function of disabling the user who has the permission to delete user information. If this attribute is set to true, the user can log in to the system. If this attribute is set to false, the user is disabled and cannot log in to the system. |
Links |
Object |
Related links of the user |
Roles |
Object |
Link information of the user role |
@odata.id |
Character string |
Access path of the user role resource |