Get User Role Properties

The Get User Role Properties operation retrieves the properties of a single User Role object that is designated by its object ID.

HTTP method and URI

GET /api/user-roles/{user-role-id}

In this request, the URI variable {user-role-id} is the object ID of the User Role object whose properties are to be retrieved.

Response body contents

On successful completion, the response body contains a JSON object that provides the current values of the properties for the User Role object as defined in the data model section. Field names and data types in the JSON object are the same as the property names and data types defined in the Data model.

Description

This operation returns the current properties of a single User Role object that is designated by {user-role-id}.

On successful execution, all of the current properties as defined in the data model for the User Role object are provided in the response body, and HTTP status code 200 (OK) is returned.

The URI path must designate an existing User Role object and the API user must have user-related-access permission to it or action/task permission to the Manage User Roles task. If these conditions are not met, status code 404 (Not Found) is returned.

Authorization requirements

This operation has the following authorization requirement:
  • User-related-access permission to the User Role object specified in the request URI, or action/task permission to the Manage User Roles task.

HTTP status and reason codes

On success, HTTP status code 200 (OK) is returned and the response body is provided as described in Response body contents.

The following HTTP status codes are returned for the indicated errors, and the response body is a standard error response body providing the reason code indicated and associated error message.

HTTP error status code Reason code Description
400 (Bad Request) Various Errors were detected during common request validation. See Common request validation reason codes for a list of the possible reason codes.
404 (Not Found) 1 The request URI does not designate an existing resource of the correct type, or designates a resource for which the API user does not have the required authorization.

Additional standard status and reason codes can be returned, as described in Invoking API operations.

Usage notes

While it is intended that system-defined User Roles have a name that begins with hmc-, there is no such guarantee. API clients are cautioned to use the type property rather than name to reliably distinguish between system-defined and user-defined User Roles.

Example HTTP interaction

Figure 1. Get User Role Properties: Request
GET /api/user-roles/eb53f840-4a7a-11e4-affa-1c6f65065a91 HTTP/1.1
x-api-session: 2t4ixcf8nplr7yersi8i9b953fgxvvqxl8c4r066ge9kcyzr4c
Figure 2. Get User Role Properties: Response
200 OK
server: zSeries management console API web server / 2.0
cache-control: no-cache
date: Thu, 02 Oct 2014 21:27:32 GMT
content-type: application/json;charset=UTF-8
content-length: 847
{
   "associated-se-user-role-uri":null,
   "class":"user-role",
   "description":"Role for managing department business",
   "is-inheritance-enabled":false,
   "is-locked":false,
   "name":"Dept Admin",
   "object-id":"eb53f840-4a7a-11e4-affa-1c6f65065a91",
   "object-uri":"/api/user-roles/eb53f840-4a7a-11e4-affa-1c6f65065a91",
   "parent":"/api/console",
   "permissions":[
      {
         "permitted-object":"/api/console/tasks/4d5a39f0-c1df-4a2e-9a46-5bf6f6a759f3",
         "permitted-object-type":"object",
         "view-only-mode":false
      },
      {
         "include-members":true,
         "permitted-object":"/api/groups/cafb3a9b-6a34-4475-938f-98c5d60868a5",
         "permitted-object-type":"object"
      },
      {
         "permitted-object":"lpar-image",
         "permitted-object-type":"object-class"
      },
      {
         "permitted-object":"/api/console/tasks/45042443-7202-40b3-8630-b7a563a21d8d",
         "permitted-object-type":"object"
      }
   ],
   "replication-overwrite-possible":false,
   "type":"user-defined"
}