Get detailed role information by role name

Description

URL

scheme://domain:port/platform/ws/roles/{rolename}

Description

The logged on user must have view_configure permission on the setting resource to use this API.

Gets detailed information about roles with the specified role name including permissions and resources.

To specify multiple roles, separate with a comma(,). For example: normal,cluster_admin.

Use the keyword all to get detailed information for all roles in the cluster.

Use the API /platform/ws/roles/ to get a list of roles.

HTTP-Method

GET

Parameters

None

Request

Request-Method

GET

Request-URI

/platform/ws/roles/{rolename}

Request-Header

Name

Value

Accept

application/xml or application/json

Message-body

empty

Response

Response

Response Information

 

Response-Code

  • 200 Successful: Request was successful.
  • 403 Forbidden: logged on user does not have the Cluster administrator role.
  • 404 Not Found: No roles found.
  • 500 Internal Server Error: Exception occurred

Response-Header

Name

Value

Content-Type

application/xml or application/json

Message-body

Success Message

If successful, returns detailed information about roles.

For additional information, refer to the schema file ./schemas/rbac/role.xsd.

<role description="%s" buildIn="%s" name="%s">
<atom:link rel="self" href="%s"/>
  <permissions>
    <permission name="%s">
     <resources>
      <resource description="%s" name="%s"/>
        ...
     </resources>
    </permission>
    <permission name="%s">
     <resources>
      <resource description="%s" name="%s"/>
     </resources>
   </permission>
       ...
  </permissions>
</role>
  Failure Message

If not successful, returns an error message.

For additional information, refer to the schema file ./schemas/rbac/error.xsd.

<error>
  <message>
     %s
  </message>
</error>

Example: Get detailed information for the cluster administrator role


# Request
GET http://www.example.org/platform/ws/roles/cluster_admin HTTP/1.1
Host: www.example.org 
# Response 
200 Successful
Content-Type: application/xml;
<role description="Cluster Administrator" buildIn="true" name=" Cluster Administrator ">
<atom:link rel="self" href="http://www.example.org/platfom/ws/roles/Cluster%20Administrator "/>
<permission name=”view_control”>
   <resources>
     <resource name=”all_hosts”/>   
     <resource name=”all_jobs”/>
     <resource name=”all_queues”/>
    </resources>
</permission>
</role>

Related APIs

To get a list of roles, use the API /platform/ws/roles.