Find roles with a query Added in 8.15.0
Get roles in a paginated manner. You can optionally filter the results with a query.
Body
-
query object
Additional properties are allowed.
-
from number
Starting document offset. By default, you cannot page through more than 10,000 hits using the from and size parameters. To page through more hits, use the
search_after
parameter. -
size number
The number of hits to return. By default, you cannot page through more than 10,000 hits using the
from
andsize
parameters. To page through more hits, use thesearch_after
parameter. -
search_after array[number | string | boolean | null | object]
A field value.
One of: Additional properties are allowed.
GET /_security/_query/role
curl \
-X GET http://api.example.com/_security/_query/role \
-H "Content-Type: application/json" \
-d '{"query":{"match":{},"prefix":{},"range":{},"term":{},"wildcard":{}},"from":42.0,"":"string","size":42.0,"search_after":[42.0]}'
Request examples
{
"query": {
"match": {},
"prefix": {},
"range": {},
"term": {},
"wildcard": {}
},
"from": 42.0,
"": "string",
"size": 42.0,
"search_after": [
42.0
]
}
Response examples (200)
{
"total": 42.0,
"count": 42.0,
"roles": [
{
"cluster": [
"string"
],
"indices": [
{
"field_security": {},
"names": "string",
"privileges": [
"string"
],
"allow_restricted_indices": true
}
],
"global": [
{}
],
"applications": [
{
"application": "string",
"privileges": [
"string"
],
"resources": [
"string"
]
}
],
"metadata": {
"additionalProperty1": {},
"additionalProperty2": {}
},
"run_as": [
"string"
],
"description": "string",
"transient_metadata": {
"additionalProperty1": {},
"additionalProperty2": {}
},
"_sort": [
42.0
],
"name": "string"
}
]
}