代码仓
中
Accounts
更新时间: 2026/11/04
在AtomGit上查看源码

ResourceDefinition ​

uris ​

  • /redfish/v1/AccountService/Accounts

properties ​

名称类型是否只读取值范围/枚举值说明
@odata.contextstringtrue-资源模型的OData描述信息
@odata.idstringtrue-资源节点的访问路径
@odata.typestringtrue-资源类型
Idstringtrue-资源的唯一标识
Namestringtrue-资源的名称
Members@odata.countnumbertrue-当前用户数量
Passwordstringfalse-用户密码
UserNamestringfalse-用户名
RoleIdstringfalse-用户角色ID
Lockedbooleantrue-用户是否被锁定
Enabledbooleantrue-用户是否启用
Oem {objectfalse-自定义属性
Oem.Public {objecttrue-自定义属性
Oem.Public.AccountInsecurePromptEnabledbooleantrue-用户账号不安全提示使能
Oem.Public.Deleteablebooleantrue-用户是否可删除
Oem.Public.FirstLoginPolicystringtrue-账户为初始状态时,首次登陆该账户时的密码修改策略
说明
openUBMC 25.12 LTS及以上版本支持
Oem.Public.LoginAudit {objecttrue-登录审计信息,记录当前用户的上次登录情况
说明
openUBMC 25.12 LTS及以上版本支持
Oem.Public.LoginAudit.LastLoginInterfacestringtrue-上次登录方式,无信息则显示为空字符串
Oem.Public.LoginAudit.LastLoginIpstringtrue-上次登录ip,无信息则显示为空字符串
Oem.Public.LoginAudit.LastLoginTimestringtrue-上次登录时间,无信息则显示为空字符串
}
Oem.Public.MutualAuthClientCertnulltrue-双向认证客户端证书
Oem.Public.SSHPublicKeyHashstringtrue-SSH公钥哈希
Oem.Public.LoginInterface[ ]arraytrue-登录接口列表
Oem.Public.SNMPEncryptPwdInitbooleantrue-SNMP加密密码初始化
Oem.Public.LoginRule[ ]arraytrue-登录规则
Oem.Public.PasswordValidityDaysnumbertrue-密码有效期天数
Oem.Public.SnmpV3AuthProtocolstringtrueMD5,SHA,SHA1,SHA256,SHA384,SHA512SnmpV3鉴权算法,包括:
● MD5
● SHA
● SHA1(已废弃,不建议使用,等价于SHA)
● SHA256
● SHA384
● SHA512
● 用户无SNMP权限返回空
说明:GA140C机型不支持
Oem.Public.SnmpV3PrivPasswdstringtrue-Snmp加密密码,固定返回null
说明:GA140C机型不支持
Oem.Public.SnmpV3PrivProtocolstringtrueDES,AES,AES256SnmpV3加密算法,包括:
● DES
● AES
● AES256
说明:GA140C机型不支持
Oem.Public.Actions {objecttrue-操作列表
Oem.Public.Actions.#Account.DeleteMutualAuthClientCert {objecttrue-自定义属性
Oem.Public.Actions.#Account.DeleteMutualAuthClientCert.@Redfish.ActionInfostringtrue-操作信息查询路径
Oem.Public.Actions.#Account.DeleteMutualAuthClientCert.targetstringtrue-操作路径
}
Oem.Public.Actions.#Account.DeleteSSHPublicKey {objecttrue-自定义属性
Oem.Public.Actions.#Account.DeleteSSHPublicKey.@Redfish.ActionInfostringtrue-操作信息查询路径
Oem.Public.Actions.#Account.DeleteSSHPublicKey.targetstringtrue-操作路径
}
Oem.Public.Actions.#Account.ImportMutualAuthClientCert {objecttrue-自定义属性
Oem.Public.Actions.#Account.ImportMutualAuthClientCert.@Redfish.ActionInfostringtrue-操作信息查询路径
Oem.Public.Actions.#Account.ImportMutualAuthClientCert.targetstringtrue-操作路径
}
Oem.Public.Actions.#Account.ImportSSHPublicKey {objecttrue-自定义属性
Oem.Public.Actions.#Account.ImportSSHPublicKey.@Redfish.ActionInfostringtrue-操作信息查询路径
Oem.Public.Actions.#Account.ImportSSHPublicKey.targetstringtrue-操作路径
}
}
Oem.Public.FingerPrintstringtrue-客户端证书指纹
Oem.Public.IssueBystringtrue-颁发者
Oem.Public.IssueTostringtrue-使用者
Oem.Public.KeyUsagestringtrue-秘钥用法
Oem.Public.PublicKeyLengthBitsnumbertrue-公钥长度
Oem.Public.RevokedDatestringtrue-吊销日期
Oem.Public.RevokedStatebooleantrue-客户端证书吊销状态:
true:已吊销
false:未吊销
Oem.Public.RootCertUploadedStatestringtrue-根证书状态
Oem.Public.SignatureAlgorithmstringtrue-签名算法
Oem.Public.ValidFromstringtrue-证书有效起始日期
Oem.Public.ValidTostringtrue-证书有效截止日期
}
}
Links {objecttrue-Accounts资源相关链接信息
Links.Role {objecttrue-角色资源的链接信息
Links.Role.@odata.idstringtrue-角色资源的访问路径
}
}
Members [ {arraytrue-用户列表
} ]
ReauthKeystringtrue-二次认证密码,该属性即为用户密码

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