Link Search Menu Expand Document Documentation Menu

You're viewing version 3.8 of the OpenSearch documentation. This version is no longer maintained. For the latest version, see the current documentation. For information about OpenSearch version maintenance, see Release Schedule and Maintenance Policy.

Get Role Mappings API

Introduced 1.0

Retrieves role mappings. Specify a role name to retrieve the mapping for one role, or omit the role name to retrieve all role mappings.

Endpoints

GET /_plugins/_security/api/rolesmapping
GET /_plugins/_security/api/rolesmapping/{role}

Path parameters

The following table lists the available path parameters.

Parameter Data type Required Description
role String No The name of the role whose mapping you want to retrieve. If omitted, all role mappings are returned.

Example request

The following request retrieves all role mappings:

GET _plugins/_security/api/rolesmapping

The following request retrieves the mapping for the role_starfleet role:

GET _plugins/_security/api/rolesmapping/role_starfleet

Example response

The response is abbreviated here:

{
  "manage_snapshots": {
    "and_backend_roles": [],
    "backend_roles": [
      "snapshotrestore"
    ],
    "hidden": false,
    "hosts": [],
    "reserved": false,
    "users": []
  },
  "logstash": {
    "and_backend_roles": [],
    "backend_roles": [
      "logstash"
    ],
    "hidden": false,
    "hosts": [],
    "reserved": false,
    "users": []
  },
  "kibana_user": {
    "and_backend_roles": [],
    "backend_roles": [
      "kibanauser"
    ],
    "description": "Maps kibanauser to kibana_user",
    "hidden": false,
    "hosts": [],
    "reserved": false,
    "users": []
  },
  ...
}

The response to a request for one role mapping contains only that mapping:

{
  "role_starfleet": {
    "and_backend_roles": [],
    "backend_roles": [
      "starfleet",
      "captains",
      "defectors",
      "cn=ldaprole,ou=groups,dc=example,dc=com"
    ],
    "hidden": false,
    "hosts": [
      "*.starfleetintranet.com"
    ],
    "reserved": false,
    "users": [
      "worf"
    ]
  }
}
350 characters left

Have a question? .

Want to contribute? or .