Get roles
Get roles in the native realm. The role management APIs are generally the preferred way to manage roles, rather than using file-based role management. The get roles API cannot retrieve roles that are defined in roles files.
GET
/_security/role
curl \
-X GET http://api.example.com/_security/role
Response examples (200)
{
"additionalProperty1": {
"cluster": [
"string"
],
"indices": [
{
"field_security": {
"except": "string",
"grant": "string"
},
"names": "string",
"privileges": [
"string"
],
"": "string",
"allow_restricted_indices": true
}
],
"remote_indices": [
{
"clusters": "string",
"field_security": {
"except": "string",
"grant": "string"
},
"names": "string",
"privileges": [
"string"
],
"": "string",
"allow_restricted_indices": true
}
],
"remote_cluster": [
{
"clusters": "string",
"privileges": [
"monitor_enrich"
]
}
],
"metadata": {
"additionalProperty1": {},
"additionalProperty2": {}
},
"run_as": [
"string"
],
"transient_metadata": {
"additionalProperty1": {},
"additionalProperty2": {}
},
"applications": [
{
"application": "string",
"privileges": [
"string"
],
"resources": [
"string"
]
}
],
"role_templates": [
{
"format": "string",
"template": {
"source": "string",
"id": "string",
"params": {
"additionalProperty1": {},
"additionalProperty2": {}
},
"": "painless",
"options": {
"additionalProperty1": "string",
"additionalProperty2": "string"
}
}
}
],
"global": {
"additionalProperty1": {
"additionalProperty1": {
"additionalProperty1": [
"string"
],
"additionalProperty2": [
"string"
]
},
"additionalProperty2": {
"additionalProperty1": [
"string"
],
"additionalProperty2": [
"string"
]
}
},
"additionalProperty2": {
"additionalProperty1": {
"additionalProperty1": [
"string"
],
"additionalProperty2": [
"string"
]
},
"additionalProperty2": {
"additionalProperty1": [
"string"
],
"additionalProperty2": [
"string"
]
}
}
}
},
"additionalProperty2": {
"cluster": [
"string"
],
"indices": [
{
"field_security": {
"except": "string",
"grant": "string"
},
"names": "string",
"privileges": [
"string"
],
"": "string",
"allow_restricted_indices": true
}
],
"remote_indices": [
{
"clusters": "string",
"field_security": {
"except": "string",
"grant": "string"
},
"names": "string",
"privileges": [
"string"
],
"": "string",
"allow_restricted_indices": true
}
],
"remote_cluster": [
{
"clusters": "string",
"privileges": [
"monitor_enrich"
]
}
],
"metadata": {
"additionalProperty1": {},
"additionalProperty2": {}
},
"run_as": [
"string"
],
"transient_metadata": {
"additionalProperty1": {},
"additionalProperty2": {}
},
"applications": [
{
"application": "string",
"privileges": [
"string"
],
"resources": [
"string"
]
}
],
"role_templates": [
{
"format": "string",
"template": {
"source": "string",
"id": "string",
"params": {
"additionalProperty1": {},
"additionalProperty2": {}
},
"": "painless",
"options": {
"additionalProperty1": "string",
"additionalProperty2": "string"
}
}
}
],
"global": {
"additionalProperty1": {
"additionalProperty1": {
"additionalProperty1": [
"string"
],
"additionalProperty2": [
"string"
]
},
"additionalProperty2": {
"additionalProperty1": [
"string"
],
"additionalProperty2": [
"string"
]
}
},
"additionalProperty2": {
"additionalProperty1": {
"additionalProperty1": [
"string"
],
"additionalProperty2": [
"string"
]
},
"additionalProperty2": {
"additionalProperty1": [
"string"
],
"additionalProperty2": [
"string"
]
}
}
}
}
}