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 1414from arangoasync .connection import Connection
1515from arangoasync .errno import HTTP_FORBIDDEN , HTTP_NOT_FOUND
1616from arangoasync .exceptions import (
17+ AnalyzerListError ,
1718 AsyncJobClearError ,
1819 AsyncJobListError ,
1920 CollectionCreateError ,
@@ -1461,6 +1462,28 @@ def response_handler(resp: Response) -> bool:
14611462
14621463 return await self ._executor .execute (request , response_handler )
14631464
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+
14641487 async def has_user (self , username : str ) -> Result [bool ]:
14651488 """Check if a user exists.
14661489
Original file line number Diff line number Diff line change @@ -135,6 +135,10 @@ class AQLQueryValidateError(ArangoServerError):
135135 """Failed to parse and validate query."""
136136
137137
138+ class AnalyzerListError (ArangoServerError ):
139+ """Failed to retrieve analyzers."""
140+
141+
138142class AsyncExecuteError (ArangoServerError ):
139143 """Failed to execute async API request."""
140144
You can’t perform that action at this time.
0 commit comments