File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change 14
14
from arangoasync .connection import Connection
15
15
from arangoasync .errno import HTTP_FORBIDDEN , HTTP_NOT_FOUND
16
16
from arangoasync .exceptions import (
17
+ AnalyzerListError ,
17
18
AsyncJobClearError ,
18
19
AsyncJobListError ,
19
20
CollectionCreateError ,
@@ -1461,6 +1462,28 @@ def response_handler(resp: Response) -> bool:
1461
1462
1462
1463
return await self ._executor .execute (request , response_handler )
1463
1464
1465
+ async def analyzers (self ) -> Result [Jsons ]:
1466
+ """List all analyzers in the database.
1467
+
1468
+ Returns:
1469
+ list: List of analyzers with their properties.
1470
+
1471
+ Raises:
1472
+ AnalyzerListError: If the operation fails.
1473
+
1474
+ References:
1475
+ - `list-all-analyzers <https://docs.arangodb.com/stable/develop/http-api/analyzers/#list-all-analyzers>`__
1476
+ """ # noqa: E501
1477
+ request = Request (method = Method .GET , endpoint = "/_api/analyzer" )
1478
+
1479
+ def response_handler (resp : Response ) -> Jsons :
1480
+ if resp .is_success :
1481
+ result : Jsons = self .deserializer .loads (resp .raw_body )["result" ]
1482
+ return result
1483
+ raise AnalyzerListError (resp , request )
1484
+
1485
+ return await self ._executor .execute (request , response_handler )
1486
+
1464
1487
async def has_user (self , username : str ) -> Result [bool ]:
1465
1488
"""Check if a user exists.
1466
1489
Original file line number Diff line number Diff line change @@ -135,6 +135,10 @@ class AQLQueryValidateError(ArangoServerError):
135
135
"""Failed to parse and validate query."""
136
136
137
137
138
+ class AnalyzerListError (ArangoServerError ):
139
+ """Failed to retrieve analyzers."""
140
+
141
+
138
142
class AsyncExecuteError (ArangoServerError ):
139
143
"""Failed to execute async API request."""
140
144
You can’t perform that action at this time.
0 commit comments