ManagerAccountCollection
更新时间: 2026/06/26
在Gitcode上查看源码

ResourceDefinition

uris

  • /redfish/v1/AccountService/Accounts

properties

名称类型是否只读取值范围/枚举值说明
@odata.contextstringtrue-Accounts资源模型的OData描述信息
@odata.idstringtrue-Accounts资源节点的访问路径
@odata.typestringtrue-Accounts资源类型
Namestringtrue-Accounts资源的名称
Membersobjecttrue-用户列表,提供所有用户URL的引用
Members@odata.countnumbertrue-当前用户数量

supported_methods

  • GET
  • POST

HTTP methods

GET

命令功能

查询用户集合资源信息

命令格式

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

请求头:


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

请求头:


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