Get role mappings Added in 5.5.0
Role mappings define which roles are assigned to each user. The role mapping APIs are generally the preferred way to manage role mappings rather than using role mapping files. The get role mappings API cannot retrieve role mappings that are defined in role mapping files.
GET
/_security/role_mapping
curl \
-X GET http://api.example.com/_security/role_mapping
Response examples (200)
{
"additionalProperty1": {
"enabled": true,
"metadata": {
"additionalProperty1": {},
"additionalProperty2": {}
},
"roles": [
"string"
],
"role_templates": [
{
"format": "string",
"template": {
"source": "string",
"id": "string",
"params": {
"additionalProperty1": {},
"additionalProperty2": {}
},
"": "painless",
"options": {
"additionalProperty1": "string",
"additionalProperty2": "string"
}
}
}
],
"rules": {
"any": [
{}
],
"all": [
{}
],
"field": {
"username": "string",
"dn": "string",
"groups": "string"
},
"except": {}
}
},
"additionalProperty2": {
"enabled": true,
"metadata": {
"additionalProperty1": {},
"additionalProperty2": {}
},
"roles": [
"string"
],
"role_templates": [
{
"format": "string",
"template": {
"source": "string",
"id": "string",
"params": {
"additionalProperty1": {},
"additionalProperty2": {}
},
"": "painless",
"options": {
"additionalProperty1": "string",
"additionalProperty2": "string"
}
}
}
],
"rules": {
"any": [
{}
],
"all": [
{}
],
"field": {
"username": "string",
"dn": "string",
"groups": "string"
},
"except": {}
}
}
}