Listing roles

GET /v3/roles

List existing roles. Use this request to find the role IDs required for role assignment requests.

Source: https://docs.openstack.org/api-ref/identity/v3/index.html?expanded=list-roles-detail#list-roles

Request

Parameters

Name In Type Description
name (Optional) query string Filters the response by a role name.
domain_id (Optional) query string Filters the response by a domain ID.

Example

# curl -ks -H 'Content-Type: application/json' -H 'X-Auth-Token: gAAAAA<...>' \
https://<node_IP_addr>:5000/v3/roles

Response

Parameters

Name In Type Description
links body object The link to the collection of resources.
roles body array A list of role objects.
description body string The role description.
domain_id body string The ID of the domain.
id body string The role ID.
links body object The link to the role resource.
options body object The role options, such as whether the role is immutable.
name body string The role name.

Status codes

Success

Code Reason
200 - OK Request was successful.

Error

Code Reason
400 - Bad Request

Some content in the request was invalid.

401 - Unauthorized

User must authenticate before making a request.

403 - Forbidden

Policy does not allow current user to do this operation.

Example

{
  "roles": [
    {
      "id": "2e97de958ab545b381e4a9fe90fe72aa",
      "name": "image_upload",
      "domain_id": null,
      "description": null,
      "options": {},
      "links": {
        "self": "https://<node_IP_addr>:5000/v3/roles/2e97de958ab545b381e4a9fe90fe72aa"
      }
    },
    {
      "id": "8b807cb2205441ea90312279bf4cb1c9",
      "name": "domain_admin",
      "domain_id": null,
      "description": null,
      "options": {},
      "links": {
        "self": "https://<node_IP_addr>:5000/v3/roles/8b807cb2205441ea90312279bf4cb1c9"
      }
    },
    {
      "id": "c5a4bdb288024515bbc2d6842a59a749",
      "name": "member",
      "domain_id": null,
      "description": null,
      "options": {
        "immutable": true
      },
      "links": {
        "self": "https://<node_IP_addr>:5000/v3/roles/c5a4bdb288024515bbc2d6842a59a749"
      }
    }
  ],
  "links": {
    "next": null,
    "self": "https://<node_IP_addr>:5000/v3/roles",
    "previous": null
  }
}