ashb commented on a change in pull request #3684: [AIRFLOW-2840] - add update 
connections cli option
URL: https://github.com/apache/incubator-airflow/pull/3684#discussion_r230378800
 
 

 ##########
 File path: airflow/api/client/local_client.py
 ##########
 @@ -51,3 +51,83 @@ def create_pool(self, name, slots, description):
     def delete_pool(self, name):
         p = pool.delete_pool(name=name)
         return p.pool, p.slots, p.description
+
+    def add_connection(self, conn_id,
+                       conn_uri=None,
+                       conn_type=None,
+                       conn_host=None,
+                       conn_login=None,
+                       conn_password=None,
+                       conn_schema=None,
+                       conn_port=None,
+                       conn_extra=None):
+        """
+
+        :param conn_id:
+        :param conn_uri:
+        :param conn_type:
+        :param conn_host:
+        :param conn_login:
+        :param conn_password:
+        :param conn_schema:
+        :param conn_port:
+        :param conn_extra:
+        :return: The new Connection
+        """
+        return connections.add_connection(conn_id,
 
 Review comment:
   We probably shouldn't return objects over the API  (as only the "Local" api 
can do this - we couldn't return an object over JSON for instance) - this 
should be the conn_id that we return I think.
   
   It is possibly worth returning the numeric ID (the `id` column, not to be 
confused with the `conn_id` column!) as this would let us delete individual 
connections if there are multiple ones with the same conn_id.
   
   Similarly for the other APIs- ids or JSON representations of the conn.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to