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

ResourceDefinition ​

uris ​

  • /redfish/v1/AccountService/Accounts

properties ​

名称类型是否只读取值范围/枚举值说明
@odata.contextstringtrue-Accounts资源模型的OData描述信息
@odata.idstringtrue-Accounts资源节点的访问路径
@odata.typestringtrue-Accounts资源类型
Namestringtrue-Accounts资源的名称
Members [ {arraytrue-用户列表,提供所有用户URL的引用
Members[].@odata.contextstringtrue-指定用户资源模型的OData描述信息
Members[].@odata.idstringtrue-指定用户资源节点的访问路径
Members[].@odata.typestringtrue-指定用户资源类型
Members[].Enabledbooleanfalsetrue,false用户管理员使用该属性来禁用具有删除用户信息的帐户,当设置为true时,用户可以登录,当设置为false时,该帐户被管理禁用,用户无法登录
Members[].Idstringtrue-指定用户资源的ID
Members[].Links {objecttrue-用户资源相关链接信息
Members[].Links.Role {objecttrue-用户资源相关链接信息
Members[].Links.Role.@odata.idstringtrue-指定用户资源节点的访问路径
}
}
Members[].Lockedbooleanfalsetrue,false此属性表示帐户服务已被自动锁定,因为超出了锁定阈值,当设置为true时,该帐户被锁定。用户管理员可以将该属性写入false以手动解锁,或者一旦锁定持续时间过去,帐户服务就会解锁
Members[].Namestringtrue-指定用户资源的名称
Members[].Oem {objecttrue-成员的自定义属性
Members[].Oem.Public {objectfalse-自定义属性
Members[].Oem.Public.AccountInsecurePromptEnabledbooleanfalsetrue,false账户不安全提示使能
Members[].Oem.Public.Actions {objectfalse-自定义属性
Members[].Oem.Public.Actions.#Account.DeleteMutualAuthClientCert {objectfalse-自定义属性
Members[].Oem.Public.Actions.#Account.DeleteMutualAuthClientCert.@Redfish.ActionInfostringtrue-操作信息查询路径
Members[].Oem.Public.Actions.#Account.DeleteMutualAuthClientCert.targetstringtrue-操作路径
}
Members[].Oem.Public.Actions.#Account.DeleteSSHPublicKey {objectfalse-自定义属性
Members[].Oem.Public.Actions.#Account.DeleteSSHPublicKey.@Redfish.ActionInfostringtrue-操作信息查询路径
Members[].Oem.Public.Actions.#Account.DeleteSSHPublicKey.targetstringtrue-操作路径
}
Members[].Oem.Public.Actions.#Account.ImportMutualAuthClientCert {objectfalse-自定义属性
Members[].Oem.Public.Actions.#Account.ImportMutualAuthClientCert.@Redfish.ActionInfostringtrue-操作信息查询路径
Members[].Oem.Public.Actions.#Account.ImportMutualAuthClientCert.targetstringtrue-操作路径
}
Members[].Oem.Public.Actions.#Account.ImportSSHPublicKey {objectfalse-自定义属性
Members[].Oem.Public.Actions.#Account.ImportSSHPublicKey.@Redfish.ActionInfostringtrue-操作信息查询路径
Members[].Oem.Public.Actions.#Account.ImportSSHPublicKey.targetstringtrue-操作路径
}
}
Members[].Oem.Public.Deleteablebooleantrue-用户是否可删除
Members[].Oem.Public.FirstLoginPolicystringfalseForcePasswordReset,PromptPasswordReset账户为初始状态时,首次登陆该账户时的密码修改策略,包括:
● ForcePasswordReset:账户为初始状态时首次登录的密码修改策略
● PromptPasswordReset:账户为初始状态时首次登录的密码修改策略
说明
openUBMC 25.12 LTS及以上版本支持
Members[].Oem.Public.LoginAudit {objectfalse-自定义属性
Members[].Oem.Public.LoginAudit.LastLoginInterfacestringtrue-上次登录方式,无信息则显示为空字符串
Members[].Oem.Public.LoginAudit.LastLoginIpstringtrue-上次登录ip,无信息则显示为空字符串
Members[].Oem.Public.LoginAudit.LastLoginTimestringtrue-上次登录时间,无信息则显示为空字符串
}
Members[].Oem.Public.LoginInterface[ ]arrayfalse-自定义属性
Members[].Oem.Public.LoginRule[ ]arrayfalse-自定义属性
Members[].Oem.Public.PasswordValidityDaysnumbertrue-密码有效期,永不过期时显示为null
Members[].Oem.Public.SNMPEncryptPwdInitbooleantrue-SNMP加密密码是否初始化,其中true为未初始化,false为已经初始化
说明:GA140C机型不支持
Members[].Oem.Public.SSHPublicKeyHashstringtrue-SSH公钥的哈希值
Members[].Oem.Public.SnmpV3AuthProtocolstringfalseMD5,SHA,SHA1,SHA256,SHA384,SHA512SnmpV3鉴权算法,包括:
● MD5:MD5
● SHA:SHA
● SHA1:SHA1
● SHA256:SHA256
● SHA384:SHA384
● SHA512:SHA512
说明:GA140C机型不支持
Members[].Oem.Public.SnmpV3PrivPasswdstringfalse-Snmp加密密码,固定返回null
说明:GA140C机型不支持
Members[].Oem.Public.SnmpV3PrivProtocolstringfalseDES,AES,AES256SnmpV3加密算法,包括:
● AES:AES
● AES256:AES256
● DES:DES
说明:GA140C机型不支持
Members[].Oem.Public.FingerPrintstringtrue-客户端证书指纹
Members[].Oem.Public.IssueBystringtrue-颁发者
Members[].Oem.Public.IssueTostringtrue-使用者
Members[].Oem.Public.KeyUsagestringtrue-秘钥用法
Members[].Oem.Public.PublicKeyLengthBitsnumbertrue-公钥长度
Members[].Oem.Public.RevokedDatestringtrue-吊销日期
Members[].Oem.Public.RevokedStatebooleantrue-客户端证书吊销状态:
true:已吊销
false:未吊销
Members[].Oem.Public.RootCertUploadedStatestringtrue-根证书状态
Members[].Oem.Public.SignatureAlgorithmstringtrue-签名算法
Members[].Oem.Public.ValidFromstringtrue-证书有效起始日期
Members[].Oem.Public.ValidTostringtrue-证书有效截止日期
}
}
Members[].Passwordstringfalse-该属性与PATCH或POST一起使用以写入该帐户的密码,该属性在GET上为空
说明:已屏蔽该属性值频繁变化导致的事件上报
Members[].ReauthKeystringtrue-二次认证密码,该属性即为用户密码
Members[].RoleIdstringfalseAdministrator,Operator,Commonuser,Noaccess,CustomRole1~CustomRole16帐户配置的角色资源的ID,包括:
● Administrator:管理员
● Commonuser:普通用户
● CustomRole1~CustomRole16:自定义用户1~自定义用户16
● Noaccess:无权限用户
● Operator:操作员
Members[].UserNamestringfalse-账户用户名
} ]
Members@odata.countnumbertrue-当前用户数量

supported_methods ​

  • GET
  • POST

HTTP methods ​

GET ​

命令功能

查询用户集合资源信息

命令格式

URL: https://device_ip/redfish/v1/AccountService/Accounts

请求头:

text

X-Auth-Token: 123456789***********************

请求消息体: 无

参数说明

参数参数说明取值
device_ip登录设备的IP地址IPv4或IPv6地址
auth_value执行该GET请求时,必须在"Headers"中携带"X-Auth-Token"值用于鉴权可通过/redfish/v1/SessionService/Sessions创建会话时获得

使用指南

无

使用实例

请求样例:

http
GET <https://device_ip/redfish/v1/AccountService/Accounts>

请求头:

text

X-Auth-Token: 123456789***********************

请求消息体:无

响应样例:

json
{
"@odata.context": "/redfish/v1/$metadata#ManagerAccountCollection.ManagerAccountCollection",
"@odata.id": "/redfish/v1/AccountService/Accounts",
"@odata.type": "#ManagerAccountCollection.ManagerAccountCollection",
"Name": "Accounts Collection",
"Members@odata.count": 8,
"Members": [
{
"@odata.context": "/redfish/v1/$metadata#AccountService/Accounts/Members/$entity",
"@odata.id": "/redfish/v1/AccountService/Accounts/2",
"@odata.type": "#ManagerAccount.v1_0_2.ManagerAccount",
"Id": "2",
"Name": "User Account",
"Password": null,
"UserName": "Administrator",
"RoleId": "Administrator",
"ReauthKey": "null",
"Locked": false,
"Enabled": true,
"Oem": {
"Public": {
"AccountInsecurePromptEnabled": false,
"FirstLoginPolicy": "ForcePasswordReset",
"SSHPublicKeyHash": null,
"LoginInterface": [
"Web",
"SNMP",
"IPMI",
"SSH",
"SFTP",
"Local",
"Redfish"
],
"SnmpV3AuthProtocol": "SHA256",
"SnmpV3PrivProtocol": "AES",
"SnmpV3PrivPasswd": null,
"SNMPEncryptPwdInit": true,
"Deleteable": false,
"LoginRule": [],
"PasswordValidityDays": 1,
"LoginAudit": {
"LastLoginTime": "2023-07-28T04:46:34+08:00",
"LastLoginIp": "192.168.1.1",
"LastLoginInterface": ""
},
"Actions": {
"#Account.ImportMutualAuthClientCert": {
"target": "/redfish/v1/AccountService/Accounts/2/Oem/Public/Actions/Account.ImportMutualAuthClientCert",
"@Redfish.ActionInfo": "/redfish/v1/AccountService/Accounts/2/ImportMutualAuthClientCertActionInfo"
},
"#Account.DeleteMutualAuthClientCert": {
"target": "/redfish/v1/AccountService/Accounts/2/Oem/Public/Actions/Account.DeleteMutualAuthClientCert",
"@Redfish.ActionInfo": "/redfish/v1/AccountService/Accounts/2/DeleteMutualAuthClientCertActionInfo"
},
"#Account.ImportSSHPublicKey": {
"target": "/redfish/v1/AccountService/Accounts/2/Oem/Public/Actions/Account.ImportSSHPublicKey",
"@Redfish.ActionInfo": "/redfish/v1/AccountService/Accounts/2/ImportSSHPublicKeyActionInfo"
},
"#Account.DeleteSSHPublicKey": {
"target": "/redfish/v1/AccountService/Accounts/2/Oem/Public/Actions/Account.DeleteSSHPublicKey",
"@Redfish.ActionInfo": "/redfish/v1/AccountService/Accounts/2/DeleteSSHPublicKeyActionInfo"
}
}
}
},
"Links": {
"Role": {
"@odata.id": "/redfish/v1/AccountService/Roles/Administrator"
}
}
},
{
"@odata.context": "/redfish/v1/$metadata#AccountService/Accounts/Members/$entity",
"@odata.id": "/redfish/v1/AccountService/Accounts/3",
"@odata.type": "#ManagerAccount.v1_0_2.ManagerAccount",
"Id": "3",
"Name": "User Account",
"Password": null,
"UserName": "operator",
"RoleId": "Operator",
"Locked": false,
"Enabled": true,
"Oem": {
"Public": {
"AccountInsecurePromptEnabled": true,
"FirstLoginPolicy": "ForcePasswordReset",
"SSHPublicKeyHash": null,
"LoginInterface": [
"Web",
"SNMP",
"IPMI",
"SSH",
"SFTP",
"Local",
"Redfish"
],
"SnmpV3AuthProtocol": "SHA256",
"SnmpV3PrivProtocol": "AES",
"SnmpV3PrivPasswd": null,
"SNMPEncryptPwdInit": true,
"Deleteable": false,
"LoginRule": [],
"PasswordValidityDays": null,
"LoginAudit": {
"LastLoginTime": "",
"LastLoginIp": "",
"LastLoginInterface": ""
},
"Actions": {
"#Account.ImportMutualAuthClientCert": {
"target": "/redfish/v1/AccountService/Accounts/3/Oem/Public/Actions/Account.ImportMutualAuthClientCert",
"@Redfish.ActionInfo": "/redfish/v1/AccountService/Accounts/3/ImportMutualAuthClientCertActionInfo"
},
"#Account.DeleteMutualAuthClientCert": {
"target": "/redfish/v1/AccountService/Accounts/3/Oem/Public/Actions/Account.DeleteMutualAuthClientCert",
"@Redfish.ActionInfo": "/redfish/v1/AccountService/Accounts/3/DeleteMutualAuthClientCertActionInfo"
},
"#Account.ImportSSHPublicKey": {
"target": "/redfish/v1/AccountService/Accounts/3/Oem/Public/Actions/Account.ImportSSHPublicKey",
"@Redfish.ActionInfo": "/redfish/v1/AccountService/Accounts/3/ImportSSHPublicKeyActionInfo"
},
"#Account.DeleteSSHPublicKey": {
"target": "/redfish/v1/AccountService/Accounts/3/Oem/Public/Actions/Account.DeleteSSHPublicKey",
"@Redfish.ActionInfo": "/redfish/v1/AccountService/Accounts/3/DeleteSSHPublicKeyActionInfo"
}
}
}
},
"Links": {
"Role": {
"@odata.id": "/redfish/v1/AccountService/Roles/Operator"
}
}
}
]
}

响应码:200

POST (CREATE) ​

命令功能

创建新用户

说明

创建用户成功之后,需等待约5秒之后才能生效。

命令格式

URL:https://device_ip/redfish/v1/AccountService/Accounts

请求头: X-Auth-Token: 123456789*********************** Content-Type: header_type

请求消息体:

json
{
"Id": user_id,
"UserName": username,
"Password": password,
"RoleId": role
}

请求头参数说明

参见 请求头参数说明

请求体参数说明

参数参数说明取值
user_id新建用户的Id可选参数,取值范围:2-17,不能和已存在用户的Id重复
username新建用户的用户名取值范围:1~16位的字符串。取值原则:
● 由特殊符号、英文字母和数字组成,不能包含空格且首字符不能是"#","+","-"
● 特殊字符不包括:" :<>&,'"/\%
● 用户名不能为"."或".."
password新建用户的密码最大长度20的字符串。
● 如果其他接口启用了密码复杂度检查功能,则设置和修改的密码必须遵循密码复杂度的规则
● 如果其他接口未启用密码复杂度检查功能,则设置和修改的密码可以为任意字符
role新建用户的角色可设置的角色类型包括:
● Administrator
● Operator
● Commonuser
● Noaccess
● CustomRole1~CustomRole16

使用指南

创建用户成功之后,需等待约5秒之后才能生效。

使用实例

请求样例:

POST https://device_ip/redfish/v1/AccountService/Accounts

请求头:

X-Auth-Token: 123456789*********************** Content-Type: application/json

请求消息体:

json
{
"Id": "4",
"UserName": "username",
"Password": "password",
"RoleId": "Administrator"
}

响应样例:

json
{
"@odata.context": "/redfish/v1/$metadata#ManagerAccount.ManagerAccount",
"@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",
"ReauthKey": "null",
"Locked": false,
"Enabled": true,
"Oem": {
"Public": {
"AccountInsecurePromptEnabled": false,
"FirstLoginPolicy": "ForcePasswordReset",
"SSHPublicKeyHash": null,
"LoginInterface": [
"Web",
"SNMP",
"IPMI",
"SSH",
"SFTP",
"Local",
"Redfish"
],
"SnmpV3AuthProtocol": "SHA256",
"SnmpV3PrivProtocol": "AES",
"SnmpV3PrivPasswd": null,
"SNMPEncryptPwdInit": false,
"Deleteable": false,
"LoginRule": [],
"PasswordValidityDays": 1,
"LoginAudit": {
"LastLoginTime": "",
"LastLoginIp": "",
"LastLoginInterface": ""
},
"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