Accounts
更新时间: 2026/06/29
在Gitcode上查看源码ResourceDefinition
uris
/redfish/v1/AccountService/Accounts
properties
| 名称 | 类型 | 是否只读 | 取值范围/枚举值 | 说明 |
|---|---|---|---|---|
| @odata.context | string | true | 资源模型的OData描述信息 | |
| @odata.id | string | true | 资源节点的访问路径 | |
| @odata.type | string | true | 资源类型 | |
| Id | string | true | 资源的唯一标识 | |
| Name | string | true | 资源的名称 | |
| Password | string | false | 用户密码 | |
| UserName | string | false | 用户名 | |
| RoleId | string | false | 用户角色ID | |
| Locked | boolean | true | 用户是否被锁定 | |
| Enabled | boolean | true | 用户是否启用 | |
| Oem.Public | object | true | 自定义属性 | |
| Oem.Public.AccountInsecurePromptEnabled | boolean | true | 用户账号不安全提示使能 | |
| Oem.Public.MutualAuthClientCert | string | true | 双向认证客户端证书 | |
| Oem.Public.SSHPublicKeyHash | string | true | SSH公钥哈希 | |
| Oem.Public.LoginInterface | array | true | 登录接口列表 | |
| Oem.Public.SNMPEncryptPwdInit | boolean | true | SNMP加密密码初始化 | |
| Oem.Public.LoginRule | array | true | 登录规则 | |
| Oem.Public.PasswordValidityDays | number | true | 密码有效期天数 | |
| Oem.Public.Actions | object | true | 操作列表 | |
| Links.Role.@odata.id | string | true | 角色资源的访问路径 |
supported_methods
- POST
HTTP methods
POST (CREATE)
命令功能
Web二次认证
命令格式
URL: https://device_ip/redfish/v1/AccountService/Accounts
请求头:
Content-Type: header_type
From: interface
Token:token
Cookie:SessionId=sessionid请求消息体:
json
{
"UserName": username,
"Password": password,
"RoleId": role,
"ReauthKey": reauthkey
}请求头参数说明
参见 请求头参数说明
请求体参数说明
| 参数 | 参数说明 | 取值 |
|---|---|---|
| username | 新建用户的用户名 | 取值范围:1~16位的字符串。取值原则: ● 由特殊符号、英文字母和数字组成,不能包含空格且首字符不能是"#","+","-" ● 特殊字符不包括:" :<>&,'"/% ● 用户名不能为"."或".." |
| password | 新建用户的密码 | 最大长度20的字符串。 ● 如果其他接口启用了密码复杂度检查功能,则设置和修改的密码必须遵循密码复杂度的规则 ● 如果其他接口未启用密码复杂度检查功能,则设置和修改的密码可以为任意字符 |
| role | 新建用户的角色 | 可设置的角色类型包括: ● Administrator ● Operator ● Commonuser ● Noaccess ● CustomRole1~CustomRole16 |
| reauthkey | 二次认证密码 | 当前用户的登录密码 |
使用指南
在Web页面操作中,二次认证包括:修改VNC密码、创建新用户、删除用户、修改指定用户信息、SSH公钥导入、SSH公钥删除、修改自定义角色权限、修改指定域控制器、修改SNMPV3加密密码的信息、新增/修改/删除LDAP和Kerberos用户组信息、导入LDAP证书或证书吊销列表、导入Kerberos密钥表、配置导入。
使用实例
请求样例:
http
POST https://device_ip/redfish/v1/AccountService/Accounts请求头:
Content-Type: application/json
From: WebUI
Token:123456789***********************
Cookie:SessionId=b2a8ab46d51a8add88618495bcbf99d5请求消息体:
json
{
"UserName": "username",
"Password": "password",
"RoleId": "Administrator",
"ReauthKey": "reauthkey"
}响应样例:
json
{
"@odata.context": "/redfish/v1/$metadata#AccountService/Accounts/Members/$entity",
"@odata.id": "/redfish/v1/AccountService/Accounts/4",
"@odata.type": "#ManagerAccount.v1_0_2.ManagerAccount",
"Id": "4",
"Name": "User Account",
"Password": null,
"UserName": "username",
"RoleId": "Administrator",
"Locked": false,
"Enabled": true,
"Oem": {
"Public": {
"AccountInsecurePromptEnabled": false,
"MutualAuthClientCert": null,
"SSHPublicKeyHash": null,
"LoginInterface": [
"Web",
"SNMP",
"IPMI",
"SSH",
"SFTP",
"Local",
"Redfish"
],
"SNMPEncryptPwdInit": false,
"LoginRule": [],
"PasswordValidityDays": 1,
"Actions": {
"#Account.ImportMutualAuthClientCert": {
"target": "/redfish/v1/AccountService/Accounts/4/Oem/Public/Actions/Account.ImportMutualAuthClientCert",
"@Redfish.ActionInfo": "/redfish/v1/AccountService/Accounts/4/ImportMutualAuthClientCertActionInfo"
},
"#Account.DeleteMutualAuthClientCert": {
"target": "/redfish/v1/AccountService/Accounts/4/Oem/Public/Actions/Account.DeleteMutualAuthClientCert",
"@Redfish.ActionInfo": "/redfish/v1/AccountService/Accounts/4/DeleteMutualAuthClientCertActionInfo"
},
"#Account.ImportSSHPublicKey": {
"target": "/redfish/v1/AccountService/Accounts/4/Oem/Public/Actions/Account.ImportSSHPublicKey",
"@Redfish.ActionInfo": "/redfish/v1/AccountService/Accounts/4/ImportSSHPublicKeyActionInfo"
},
"#Account.DeleteSSHPublicKey": {
"target": "/redfish/v1/AccountService/Accounts/4/Oem/Public/Actions/Account.DeleteSSHPublicKey",
"@Redfish.ActionInfo": "/redfish/v1/AccountService/Accounts/4/DeleteSSHPublicKeyActionInfo"
}
}
}
},
"Links": {
"Role": {
"@odata.id": "/redfish/v1/AccountService/Roles/Administrator"
}
}
}响应码:201