File tree Expand file tree Collapse file tree
documentation/docs/guides Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,6 +37,12 @@ Test connection (basic):
3737ok = client.connectors.test_connection(conn.id)
3838```
3939
40+ Test connection (detailed):
41+ ``` python
42+ details = client.connectors.test_connection_detailed(conn.id)
43+ # {'ok': True, 'elapsed_ms': 123}
44+ ```
45+
4046Filter by type:
4147``` python
4248pg = client.connectors.list_by_type(" postgres" )
@@ -64,4 +70,5 @@ snowflake_conn = client.connectors.create(
6470
6571# Optional: test the connection
6672ok = client.connectors.test_connection(snowflake_conn.id)
73+ details = client.connectors.test_connection_detailed(snowflake_conn.id)
6774```
Original file line number Diff line number Diff line change @@ -37,6 +37,12 @@ Test connection (basic):
3737ok = client.connectors.test_connection(conn.id)
3838```
3939
40+ Test connection (detailed):
41+ ``` python
42+ details = client.connectors.test_connection_detailed(conn.id)
43+ # {'ok': True, 'elapsed_ms': 123}
44+ ```
45+
4046Filter by type:
4147``` python
4248pg = client.connectors.list_by_type(" postgres" )
@@ -64,6 +70,7 @@ snowflake_conn = client.connectors.create(
6470
6571# Optional: test the connection
6672ok = client.connectors.test_connection(snowflake_conn.id)
73+ details = client.connectors.test_connection_detailed(snowflake_conn.id)
6774```
6875
6976
Original file line number Diff line number Diff line change @@ -267,12 +267,21 @@ def test_connection(self, connector_id: str) -> bool:
267267 ```
268268 """
269269 try :
270- # This would typically be a separate endpoint, but for now we'll use get
271- # In a real implementation, there might be a POST /connectors/{id}/test endpoint
272- connector = self .get (connector_id )
273- return True
270+ resp = self ._client .post (f"/connectors/{ connector_id } /test" )
271+ return bool (resp .get ("ok" , False ))
274272 except Exception as e :
275273 raise ValidationError (f"Connection test failed: { str (e )} " )
274+
275+ def test_connection_detailed (self , connector_id : str ) -> dict :
276+ """Test a connector and return detailed response (e.g., elapsed_ms).
277+
278+ Args:
279+ connector_id: The connector ID to test
280+
281+ Returns:
282+ Dict with fields like { ok: bool, elapsed_ms: int }
283+ """
284+ return self ._client .post (f"/connectors/{ connector_id } /test" )
276285
277286 def list_by_type (self , db_type : str ) -> List [Connector ]:
278287 """List connectors by database type.
You can’t perform that action at this time.
0 commit comments