• Native OpenStack API

noa
  1. Help Center
  2. Native OpenStack API
  3. API Reference
  4. Keystone
  5. Permission Management
  6. Querying Role Details

Querying Role Details

Function Description

This interface is used to query role details, including the permission policies of a role. A role is a set of permissions and represents a group of actions.

URI

  • URI format

    GET /v3/roles/{role_id}

  • URI parameter description

    Parameter

    Mandatory

    Type

    Description

    role_id

    Yes

    String

    ID of a role.

Request

  • Request header parameter description

    Parameter

    Mandatory

    Type

    Description

    X-Auth-Token

    Yes

    String

    Authenticated token with the Security Administrator permission.

  • Sample request
    curl -i -k -H "X-Auth-Token:$token" -H 'Content-Type:application/json;charset=utf8' -X GET https://10.22.44.158:31943/v3/roles/19bb93eec4ca4f08aefdc02da76d8f3c

Response

  • Response body parameter description

    Parameter

    Mandatory

    Type

    Description

    role

    Yes

    Dict

    Details of the role.

  • Description for the role format

    Parameter

    Mandatory

    Type

    Description

    domain_id

    Yes

    String

    ID of the domain to which a role belongs.

    id

    Yes

    String

    ID of a role.

    links

    Yes

    Dict

    Resource links of a role.

    name

    Yes

    String

    Name of a role.

    type

    Yes

    String

    Display mode of a role.

    • AX: A role is displayed at the domain layer.
    • XA: A role is displayed at the project layer.
    • AA: A role is displayed at both the domain and project layers.
    • XX: A role is not displayed at the domain or project layer.

    display_name

    No

    String

    Displayed name of a role.

    catalog

    No

    String

    Directory where a role locates.

    policy

    No

    Dict

    Policy of a role.

    description

    No

    String

    Description of a role.

  • Sample response
    {
      "role": {
        "display_name": "Tanent Guest",
        "description": "Tanent Guest",
        "links": {
          "self": "www.example.com/v3/roles/19bb93eec4ca4f08aefdc02da76d8f3c"
        },
        "domain_id": null,
        "catalog": "BASE",
        "policy": {
          "Version": "1.0",
          "Statement": [
            {
              "Action": [
                "::Get",
                "::List"
              ],
              "Effect": "Allow"
            },
            {
              "Action": [
                "identity:*"
              ],
              "Effect": "Deny"
            }
          ]
        },
        "id": "19bb93eec4ca4f08aefdc02da76d8f3c",
        "type": "AA",
        "name": "readonly"
      }
    }

Status Codes

Status Code

Description

200

The request is successful.

400

The server failed to process the request.

401

You must enter a username and password to access the requested page.

403

You are forbidden to access the requested page.

404

The server could not find the requested page.