Accounts
更新时间: 2026/11/04
在AtomGit上查看源码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 | - | 资源的名称 |
Members@odata.count | number | true | - | 当前用户数量 |
| Password | string | false | - | 用户密码 |
| UserName | string | false | - | 用户名 |
| RoleId | string | false | - | 用户角色ID |
| Locked | boolean | true | - | 用户是否被锁定 |
| Enabled | boolean | true | - | 用户是否启用 |
| Oem { | object | false | - | 自定义属性 |
| Oem.Public { | object | true | - | 自定义属性 |
| Oem.Public.AccountInsecurePromptEnabled | boolean | true | - | 用户账号不安全提示使能 |
| Oem.Public.Deleteable | boolean | true | - | 用户是否可删除 |
| Oem.Public.FirstLoginPolicy | string | true | - | 账户为初始状态时,首次登陆该账户时的密码修改策略 说明 openUBMC 25.12 LTS及以上版本支持 |
| Oem.Public.LoginAudit { | object | true | - | 登录审计信息,记录当前用户的上次登录情况 说明 openUBMC 25.12 LTS及以上版本支持 |
| Oem.Public.LoginAudit.LastLoginInterface | string | true | - | 上次登录方式,无信息则显示为空字符串 |
| Oem.Public.LoginAudit.LastLoginIp | string | true | - | 上次登录ip,无信息则显示为空字符串 |
| Oem.Public.LoginAudit.LastLoginTime | string | true | - | 上次登录时间,无信息则显示为空字符串 |
| } | ||||
| Oem.Public.MutualAuthClientCert | null | 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.SnmpV3AuthProtocol | string | true | MD5,SHA,SHA1,SHA256,SHA384,SHA512 | SnmpV3鉴权算法,包括: ● MD5 ● SHA ● SHA1(已废弃,不建议使用,等价于SHA) ● SHA256 ● SHA384 ● SHA512 ● 用户无SNMP权限返回空 说明:GA140C机型不支持 |
| Oem.Public.SnmpV3PrivPasswd | string | true | - | Snmp加密密码,固定返回null 说明:GA140C机型不支持 |
| Oem.Public.SnmpV3PrivProtocol | string | true | DES,AES,AES256 | SnmpV3加密算法,包括: ● DES ● AES ● AES256 说明:GA140C机型不支持 |
| Oem.Public.Actions { | object | true | - | 操作列表 |
| Oem.Public.Actions.#Account.DeleteMutualAuthClientCert { | object | true | - | 自定义属性 |
Oem.Public.Actions.#Account.DeleteMutualAuthClientCert.@Redfish.ActionInfo | string | true | - | 操作信息查询路径 |
| Oem.Public.Actions.#Account.DeleteMutualAuthClientCert.target | string | true | - | 操作路径 |
| } | ||||
| Oem.Public.Actions.#Account.DeleteSSHPublicKey { | object | true | - | 自定义属性 |
Oem.Public.Actions.#Account.DeleteSSHPublicKey.@Redfish.ActionInfo | string | true | - | 操作信息查询路径 |
| Oem.Public.Actions.#Account.DeleteSSHPublicKey.target | string | true | - | 操作路径 |
| } | ||||
| Oem.Public.Actions.#Account.ImportMutualAuthClientCert { | object | true | - | 自定义属性 |
Oem.Public.Actions.#Account.ImportMutualAuthClientCert.@Redfish.ActionInfo | string | true | - | 操作信息查询路径 |
| Oem.Public.Actions.#Account.ImportMutualAuthClientCert.target | string | true | - | 操作路径 |
| } | ||||
| Oem.Public.Actions.#Account.ImportSSHPublicKey { | object | true | - | 自定义属性 |
Oem.Public.Actions.#Account.ImportSSHPublicKey.@Redfish.ActionInfo | string | true | - | 操作信息查询路径 |
| Oem.Public.Actions.#Account.ImportSSHPublicKey.target | string | true | - | 操作路径 |
| } | ||||
| } | ||||
| Oem.Public.FingerPrint | string | true | - | 客户端证书指纹 |
| Oem.Public.IssueBy | string | true | - | 颁发者 |
| Oem.Public.IssueTo | string | true | - | 使用者 |
| Oem.Public.KeyUsage | string | true | - | 秘钥用法 |
| Oem.Public.PublicKeyLengthBits | number | true | - | 公钥长度 |
| Oem.Public.RevokedDate | string | true | - | 吊销日期 |
| Oem.Public.RevokedState | boolean | true | - | 客户端证书吊销状态: true:已吊销 false:未吊销 |
| Oem.Public.RootCertUploadedState | string | true | - | 根证书状态 |
| Oem.Public.SignatureAlgorithm | string | true | - | 签名算法 |
| Oem.Public.ValidFrom | string | true | - | 证书有效起始日期 |
| Oem.Public.ValidTo | string | true | - | 证书有效截止日期 |
| } | ||||
| } | ||||
| Links { | object | true | - | Accounts资源相关链接信息 |
| Links.Role { | object | true | - | 角色资源的链接信息 |
Links.Role.@odata.id | string | true | - | 角色资源的访问路径 |
| } | ||||
| } | ||||
| Members [ { | array | true | - | 用户列表 |
| } ] | ||||
| ReauthKey | string | true | - | 二次认证密码,该属性即为用户密码 |
supported_methods
- POST
HTTP methods
POST (CREATE)
命令功能
Web二次认证
命令格式
URL: https://device_ip/redfish/v1/AccountService/Accounts
请求头:
text
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>请求头:
text
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