Skip to main content

POST – Create a custom role

Use the POST method to create a custom role for Redfish service.

Request URL

POST https://<BMC_IPADDR>/redfish/v1/AccountService/Roles

Request body

FieldTypeDescription

RoleId

String

RoleId length is limited to 1~32 characters. Allowed characters: A-Z, a-z, 0-9, - (dash), . (period), and _ (underscore).

OemPrivileges

Array

The value of this property shall be the OEM privileges that this role includes. For pre-defined roles, this property shall be readOnly. For custom roles some implementations may not allow writing this property. The values can be

“UserAccountManagement”,

“RemoteConsoleAccess”,

“RemoteConsoleAndVirtualMediaAccess”,

“RemoteServerPowerRestartAccess”,

“AbilityClearEventLogs”,

“Configuration_Basic”,

“Configuration_NetworkingAndSecurity”,

“Configuration_Advanced”,

“Configuration_UEFISecurity”

Response body

The response returns the same content as GET operation with updated properties.

Status code

HTTP Status CodeError Message ID
500InternalError

Example

The following example is POST body.

{
"RoleId": "CustomRole",
"OemPrivileges" : [
"UserAccountManagement"
]
}

The following example JSON response is returned:

{
"Id": "CustomRole",
"Name": "CustomRole",
"@odata.type": "#Role.v1_3_1.Role",
"@odata.id": "/redfish/v1/AccountService/Roles/CustomRole",
"AssignedPrivileges": [
"Login"
],
"OemPrivileges@Redfish.AllowableValues": [
"UserAccountManagement",
"RemoteConsoleAccess",
"RemoteConsoleAndVirtualMediaAccess",
"RemoteServerPowerRestartAccess",
"AbilityClearEventLogs",
"Configuration_Basic",
"Configuration_NetworkingAndSecurity",
"Configuration_Advanced",
"Configuration_UEFISecurity"
],
"OemPrivileges": [
"UserAccountManagement"
],
"@odata.context": "/redfish/v1/$metadata#Role.Role",
"IsPredefined": false,
"Description": "This resource is used to represent a user role for the user account for a Redfish implementation.",
"RoleId": "CustomRole",
"@odata.etag": "\"59ed9257e5e1272b2bc\""
}