You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/05/20 17:42:29 UTC

[GitHub] [airflow] ephraimbuddy commented on a change in pull request #15795: Ability to test connections from UI or API

ephraimbuddy commented on a change in pull request #15795:
URL: https://github.com/apache/airflow/pull/15795#discussion_r633736653



##########
File path: airflow/api_connexion/endpoints/connection_endpoint.py
##########
@@ -129,3 +130,24 @@ def post_connection(session):
         session.commit()
         return connection_schema.dump(connection)
     raise AlreadyExists(detail=f"Connection already exist. ID: {conn_id}")
+
+
+@security.requires_access([(permissions.ACTION_CAN_EDIT, permissions.RESOURCE_CONNECTION)])
+@provide_session
+def test_connection(connection_id, session):
+    """Test a connection"""
+    try:
+        data = connection_schema.load(request.json, partial=True)

Review comment:
       I’ll suggest that we make this endpoint a GET since what we need is to run test_connection() on a connection instance




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org