• Native OpenStack API

noa
  1. Help Center
  2. Native OpenStack API
  3. API Reference
  4. Keystone
  5. Permission
  6. Querying the Permission List

Querying the Permission List

Function Description

This interface is used to query the permission list. This interface applies only to domain names in the Global zone.

URI

  • URI format

    GET /v3/roles

  • URI parameter description

    Parameter

    Mandatory

    Type

    Description

    name

    No

    String

    Name of a role.

    domain_id

    No

    String

    ID of a domain.

Request

  • Request header parameter description

    Parameter

    Mandatory

    Type

    Description

    Content-Type

    Yes

    String

    Fill application/json;charset=utf8 in this field.

    X-Auth-Token

    Yes

    String

    Valid token (the token of a user with the op_auth or secu_admin 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?name=readonly

Response

  • Response body parameter description

    Parameter

    Mandatory

    Type

    Description

    links

    Yes

    Dict

    Links of a role, including nextprevious, and self.

    roles

    Yes

    Array

    List of roles.

  • Description for the role format

    Parameter

    Mandatory

    Type

    Description

    id

    Yes

    String

    ID of a role.

    links

    Yes

    Dict

    Links of a role.

    name

    Yes

    String

    Name of a role.

    domain_id

    Yes

    String

    ID of the domain to which a role belongs.

    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
    {
      "links": {
        "self": "www.example.com/v3/roles?name=readonly",
        "previous": null,
        "next": null
      },
      "roles": [
        {
          "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.