Accounts
更新时间: 2025/05/25
在Gitcode上查看源码

ResourceDefinition

uris

  • /redfish/v1/Oem/LCNService/LCNDevices/device_id/Accounts

properties

名称类型是否只读取值范围/枚举值说明
@odata.contextstringtrue-指定LCN设备用户资源模型的OData描述信息
@odata.idstringtrue-指定LCN设备用户资源的访问路径
@odata.typestringtrue-指定LCN设备用户资源的类型
Idstringtrue-指定LCN设备用户资源ID
Accountsarraytrue-指定LCN设备的用户信息显示
Accounts[].UserNamestringfalse-用户名
Accounts[].AdminLevelnumbertrue0~15用户权限级别。整数形式,取值范围是0~15,具体信息请查阅LCN用户指南获取
Accounts[].GroupIdnumbertrue-用户所属的用户组ID。具体信息请查阅LCN用户指南获取
Actionsobjecttrue-指定LCN设备可执行的操作
Actions.#LCN.CreateAccountobjecttrue-创建指定LCN设备的用户
Actions.#LCN.CreateAccount.targetstringtrue-创建指定LCN设备的用户动作的访问路径
Actions.#LCN.CreateAccount.@Redfish.ActionInfostringtrue-创建指定LCN设备的用户参数的查询路径
Actions.#LCN.DeleteAccountobjecttrue-删除指定LCN设备的用户
Actions.#LCN.DeleteAccount.targetstringtrue-删除指定LCN设备的用户动作的访问路径
Actions.#LCN.DeleteAccount.@Redfish.ActionInfostringtrue-删除指定LCN设备的用户参数的查询路径
Actions.#LCN.ChangePasswordobjecttrue-修改指定LCN设备的用户密码
Actions.#LCN.ChangePassword.targetstringtrue-修改指定LCN设备的用户密码动作的访问路径
Actions.#LCN.ChangePassword.@Redfish.ActionInfostringtrue-修改指定LCN设备的用户密码参数的查询路径

supported_methods

  • GET
  • POST

HTTP methods

GET

命令功能

查询 LCN 设备用户信息

说明

BMC300 5.8.3.27及以上版本,A900 A3 SuperPoD,A800T A3,A800I A3机型支持

命令格式

URL: https://device_ip/redfish/v1/Oem/LCNService/LCNDevices/device_id/Accounts

请求头:


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

请求消息体: 无

参数说明

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

使用指南

使用实例

请求样例:

http
GET https://device_ip/redfish/v1/Oem/LCNService/LCNDevices/LinkBoard1/Accounts

请求头:


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

请求消息体:无

响应样例:

json
{
  "@odata.context": "/redfish/v1/$metadata#LCNAccounts.LCNAccounts",
  "@odata.id": "/redfish/v1/Oem/LCNService/LCNDevices/LinkBoard1/Accounts",
  "@odata.type": "#LCNAccounts.v1_0_0.LCNAccounts",
  "Id": "LinkBoard1Accounts",
  "Accounts": [
    {
      "UserName": "User1",
      "AdminLevel": 3,
      "GroupId": 1
    }
  ],
  "Actions": {
    "#LCN.CreateAccount": {
      "target": "/redfish/v1/Oem/LCNService/LCNDevices/LinkBoard1/Accounts/Actions/LCN.CreateAccount",
      "@Redfish.ActionInfo": "/redfish/v1/Oem/LCNService/LCNDevices/LinkBoard1/Accounts/CreateAccountActionInfo"
    },
    "#LCN.DeleteAccount": {
      "target": "/redfish/v1/Oem/LCNService/LCNDevices/LinkBoard1/Accounts/Actions/LCN.DeleteAccount",
      "@Redfish.ActionInfo": "/redfish/v1/Oem/LCNService/LCNDevices/LinkBoard1/Accounts/DeleteAccountActionInfo"
    },
    "#LCN.ChangePassword": {
      "target": "/redfish/v1/Oem/LCNService/LCNDevices/LinkBoard1/Accounts/Actions/LCN.ChangePassword",
      "@Redfish.ActionInfo": "/redfish/v1/Oem/LCNService/LCNDevices/LinkBoard1/Accounts/ChangePasswordActionInfo"
    }
  }
}

响应码:200

POST (ACTION)

CreateAccount

命令功能

创建指定 LCN 设备的用户

说明

BMC300 5.8.3.27及以上版本,A900 A3 SuperPoD,A800T A3,A800I A3机型支持

命令格式

URL: https://device_ip/redfish/v1/Oem/LCNService/LCNDevices/device_id/Accounts/Actions/LCN.CreateAccount

请求头:


X-Auth-Token: 123456789***********************
Content-Type: header_type

请求消息体:

json
{
  "UserName": user_name,
  "Password": password
}

请求头参数说明

参见 请求头参数说明

请求体参数说明

参数参数说明取值
UserName创建用户的用户名字符串形式,不支持空格,不区分大小写。如果用户账号中携带@,则认为在@前面的部分是用户名,在@后面的部分是域名。用户名不能包括/、\、:、*、?、"、<、>、|、@、'、%、?和空格。长度范围是~253
Password创建用户的密码字符串形式,区分大小写。LCN设备开启用户账户安全策略时,长度范围是~128,密码不能与用户名及其用户名反向字符串相同,且密码必须包括大写字母、小写字母、数字及特殊字符(不包括"?"和空格)

使用指南

使用实例

请求样例:

http
POST https://device_ip/redfish/v1/Oem/LCNService/LCNDevices/LinkBoard1/Accounts/Actions/LCN.CreateAccount

请求头:


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

请求消息体:

json
{
  "UserName": "localuser1",
  "Password": "******"
}

响应样例:

json
{
  "error": {
    "code": "Base.1.0.GeneralError",
    "message": "A general error has occurred. See ExtendedInfo for more information.",
    "@Message.ExtendedInfo": [
      {
        "@odata.type": "#Message.v1_0_0.Message",
        "MessageId": "Base.1.0.Success",
        "RelatedProperties": [],
        "Message": "Successfully Completed Request",
        "MessageArgs": [],
        "Severity": "OK",
        "Resolution": "None",
        "Oem": {
          "": {
            "UserName": "localuser1",
            "AdminLevel": 3,
            "GroupId": 1
          }
        }
      }
    ]
  }
}

响应码:200

POST (ACTION)

DeleteAccount

命令功能

删除指定 LCN 设备的用户

说明

BMC300 5.8.3.27及以上版本,A900 A3 SuperPoD,A800T A3,A800I A3机型支持

命令格式

URL: https://device_ip/redfish/v1/Oem/LCNService/LCNDevices/device_id/Accounts/Actions/LCN.DeleteAccount

请求头:


X-Auth-Token: 123456789***********************
Content-Type: header_type

请求消息体:

json
{
  "UserName": user_name
}

请求头参数说明

参见 请求头参数说明

请求体参数说明

参数参数说明取值
UserName删除指定用户的用户名可通过LCN设备用户资源获取

使用指南

使用实例

请求样例:

http
POST https://device_ip/redfish/v1/Oem/LCNService/LCNDevices/LinkBoard1/Accounts/Actions/LCN.DeleteAccount

请求头:


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

请求消息体:

json
{
  "UserName": "localuser1"
}

响应样例:

json
{
  "error": {
    "code": "Base.1.0.GeneralError",
    "message": "A general error has occurred. See ExtendedInfo for more information.",
    "@Message.ExtendedInfo": [
      {
        "@odata.type": "#Message.v1_0_0.Message",
        "MessageId": "Base.1.0.Success",
        "RelatedProperties": [],
        "Message": "Successfully Completed Request",
        "MessageArgs": [],
        "Severity": "OK",
        "Resolution": "None"
      }
    ]
  }
}

响应码:200

POST (ACTION)

ChangePassword

命令功能

修改指定 LCN 设备的用户密码

说明

BMC300 5.8.3.27及以上版本,A900 A3 SuperPoD,A800T A3,A800I A3机型支持

命令格式

URL: https://device_ip/redfish/v1/Oem/LCNService/LCNDevices/device_id/Accounts/Actions/LCN.ChangePassword

请求头:


X-Auth-Token: 123456789***********************
Content-Type: header_type

请求消息体:

json
{
  "UserName": user_name,
  "Password": password,
  "BMCSaveOnly": bmc_save_only
}

请求头参数说明

参见 请求头参数说明

请求体参数说明

参数参数说明取值
UserName待修改密码的用户名可通过LCN设备用户资源获取
Password新设置的密码字符串形式,区分大小写。LCN设备开启用户账户安全策略时,长度范围是~128,密码不能与用户名及其用户名反向字符串相同,且密码必须包括大写字母、小写字母、数字及特殊字符(不包括"?"和空格)
BMCSaveOnly是否仅修改BMC保存的LCN设备密码,可选参数,默认为false,仅对内部通信用户生效● true:仅设置BMC保存的LCN设备内部通信用户密码
● false:设置的用户密码将同步到LCN设备

使用指南

BMCSaveOnly仅对内部通信用户生效。

使用实例

请求样例:

http
POST https://device_ip/redfish/v1/Oem/LCNService/LCNDevices/LinkBoard1/Accounts/Actions/LCN.ChangePassword

请求头:


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

请求消息体:

json
{
  "UserName": "localuser1",
  "Password": "******",
  "BMCSaveOnly": false
}

响应样例:

json
{
  "error": {
    "code": "Base.1.0.GeneralError",
    "message": "A general error has occurred. See ExtendedInfo for more information.",
    "@Message.ExtendedInfo": [
      {
        "@odata.type": "#Message.v1_0_0.Message",
        "MessageId": "Base.1.0.Success",
        "RelatedProperties": [],
        "Message": "Successfully Completed Request",
        "MessageArgs": [],
        "Severity": "OK",
        "Resolution": "None"
      }
    ]
  }
}

响应码:200