anishgirianish commented on code in PR #62343:
URL: https://github.com/apache/airflow/pull/62343#discussion_r2851603185
##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/connections.py:
##########
@@ -249,6 +256,88 @@ def test_connection(test_body: ConnectionBody) ->
ConnectionTestResponse:
os.environ.pop(conn_env_var, None)
+@connections_router.post(
+ "/test-async",
+ status_code=status.HTTP_202_ACCEPTED,
+ responses=create_openapi_http_exception_doc([status.HTTP_403_FORBIDDEN,
status.HTTP_404_NOT_FOUND]),
+ dependencies=[Depends(requires_access_connection(method="POST")),
Depends(action_logging())],
+)
+def test_connection_async(
+ test_body: ConnectionTestRequestBody,
+ session: SessionDep,
+) -> ConnectionTestQueuedResponse:
+ """
+ Queue an async connection test to be executed on a worker.
+
+ The connection must already be saved. Returns a token that can be used
+ to poll for the test result via GET /connections/test-async/{token}.
+ """
+ if conf.get("core", "test_connection",
fallback="Disabled").lower().strip() != "enabled":
Review Comment:
Extracted it to a util. thanks
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]