All URIs are relative to http://localhost
| Method | HTTP request | Description |
|---|---|---|
| bulk_connections | PATCH /api/v2/connections | Bulk Connections |
| create_default_connections | POST /api/v2/connections/defaults | Create Default Connections |
| delete_connection | DELETE /api/v2/connections/{connection_id} | Delete Connection |
| get_connection | GET /api/v2/connections/{connection_id} | Get Connection |
| get_connections | GET /api/v2/connections | Get Connections |
| patch_connection | PATCH /api/v2/connections/{connection_id} | Patch Connection |
| post_connection | POST /api/v2/connections | Post Connection |
| test_connection | POST /api/v2/connections/test | Test Connection |
BulkResponse bulk_connections(bulk_body_connection_body)
Bulk Connections
Bulk create, update, and delete connections.
import airflow_client.client from airflow_client.client.models.bulk_body_connection_body import BulkBodyConnectionBody from airflow_client.client.models.bulk_response import BulkResponse from airflow_client.client.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = airflow_client.client.Configuration( host = "http://localhost" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. configuration.access_token = os.environ["ACCESS_TOKEN"] # Enter a context with an instance of the API client with airflow_client.client.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = airflow_client.client.ConnectionApi(api_client) bulk_body_connection_body = airflow_client.client.BulkBodyConnectionBody() # BulkBodyConnectionBody | try: # Bulk Connections api_response = api_instance.bulk_connections(bulk_body_connection_body) print("The response of ConnectionApi->bulk_connections:\n") pprint(api_response) except Exception as e: print("Exception when calling ConnectionApi->bulk_connections: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| bulk_body_connection_body | BulkBodyConnectionBody |
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 401 | Unauthorized | - |
| 403 | Forbidden | - |
| 422 | Validation Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
create_default_connections()
Create Default Connections
Create default connections.
import airflow_client.client from airflow_client.client.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = airflow_client.client.Configuration( host = "http://localhost" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. configuration.access_token = os.environ["ACCESS_TOKEN"] # Enter a context with an instance of the API client with airflow_client.client.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = airflow_client.client.ConnectionApi(api_client) try: # Create Default Connections api_instance.create_default_connections() except Exception as e: print("Exception when calling ConnectionApi->create_default_connections: %s\n" % e)
This endpoint does not need any parameter.
void (empty response body)
| Status code | Description | Response headers |
|---|---|---|
| 204 | Successful Response | - |
| 401 | Unauthorized | - |
| 403 | Forbidden | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
delete_connection(connection_id)
Delete Connection
Delete a connection entry.
import airflow_client.client from airflow_client.client.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = airflow_client.client.Configuration( host = "http://localhost" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. configuration.access_token = os.environ["ACCESS_TOKEN"] # Enter a context with an instance of the API client with airflow_client.client.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = airflow_client.client.ConnectionApi(api_client) connection_id = 'connection_id_example' # str | try: # Delete Connection api_instance.delete_connection(connection_id) except Exception as e: print("Exception when calling ConnectionApi->delete_connection: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| connection_id | str |
void (empty response body)
| Status code | Description | Response headers |
|---|---|---|
| 204 | Successful Response | - |
| 401 | Unauthorized | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 422 | Validation Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ConnectionResponse get_connection(connection_id)
Get Connection
Get a connection entry.
import airflow_client.client from airflow_client.client.models.connection_response import ConnectionResponse from airflow_client.client.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = airflow_client.client.Configuration( host = "http://localhost" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. configuration.access_token = os.environ["ACCESS_TOKEN"] # Enter a context with an instance of the API client with airflow_client.client.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = airflow_client.client.ConnectionApi(api_client) connection_id = 'connection_id_example' # str | try: # Get Connection api_response = api_instance.get_connection(connection_id) print("The response of ConnectionApi->get_connection:\n") pprint(api_response) except Exception as e: print("Exception when calling ConnectionApi->get_connection: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| connection_id | str |
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 401 | Unauthorized | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 422 | Validation Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ConnectionCollectionResponse get_connections(limit=limit, offset=offset, order_by=order_by, connection_id_pattern=connection_id_pattern)
Get Connections
Get all connection entries.
import airflow_client.client from airflow_client.client.models.connection_collection_response import ConnectionCollectionResponse from airflow_client.client.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = airflow_client.client.Configuration( host = "http://localhost" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. configuration.access_token = os.environ["ACCESS_TOKEN"] # Enter a context with an instance of the API client with airflow_client.client.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = airflow_client.client.ConnectionApi(api_client) limit = 50 # int | (optional) (default to 50) offset = 0 # int | (optional) (default to 0) order_by = 'id' # str | (optional) (default to 'id') connection_id_pattern = 'connection_id_pattern_example' # str | (optional) try: # Get Connections api_response = api_instance.get_connections(limit=limit, offset=offset, order_by=order_by, connection_id_pattern=connection_id_pattern) print("The response of ConnectionApi->get_connections:\n") pprint(api_response) except Exception as e: print("Exception when calling ConnectionApi->get_connections: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| limit | int | [optional] [default to 50] | |
| offset | int | [optional] [default to 0] | |
| order_by | str | [optional] [default to 'id'] | |
| connection_id_pattern | str | [optional] |
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 401 | Unauthorized | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 422 | Validation Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ConnectionResponse patch_connection(connection_id, connection_body, update_mask=update_mask)
Patch Connection
Update a connection entry.
import airflow_client.client from airflow_client.client.models.connection_body import ConnectionBody from airflow_client.client.models.connection_response import ConnectionResponse from airflow_client.client.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = airflow_client.client.Configuration( host = "http://localhost" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. configuration.access_token = os.environ["ACCESS_TOKEN"] # Enter a context with an instance of the API client with airflow_client.client.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = airflow_client.client.ConnectionApi(api_client) connection_id = 'connection_id_example' # str | connection_body = airflow_client.client.ConnectionBody() # ConnectionBody | update_mask = ['update_mask_example'] # List[str] | (optional) try: # Patch Connection api_response = api_instance.patch_connection(connection_id, connection_body, update_mask=update_mask) print("The response of ConnectionApi->patch_connection:\n") pprint(api_response) except Exception as e: print("Exception when calling ConnectionApi->patch_connection: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| connection_id | str | ||
| connection_body | ConnectionBody | ||
| update_mask | List[str] | [optional] |
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 400 | Bad Request | - |
| 401 | Unauthorized | - |
| 403 | Forbidden | - |
| 404 | Not Found | - |
| 422 | Validation Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ConnectionResponse post_connection(connection_body)
Post Connection
Create connection entry.
import airflow_client.client from airflow_client.client.models.connection_body import ConnectionBody from airflow_client.client.models.connection_response import ConnectionResponse from airflow_client.client.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = airflow_client.client.Configuration( host = "http://localhost" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. configuration.access_token = os.environ["ACCESS_TOKEN"] # Enter a context with an instance of the API client with airflow_client.client.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = airflow_client.client.ConnectionApi(api_client) connection_body = airflow_client.client.ConnectionBody() # ConnectionBody | try: # Post Connection api_response = api_instance.post_connection(connection_body) print("The response of ConnectionApi->post_connection:\n") pprint(api_response) except Exception as e: print("Exception when calling ConnectionApi->post_connection: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| connection_body | ConnectionBody |
| Status code | Description | Response headers |
|---|---|---|
| 201 | Successful Response | - |
| 401 | Unauthorized | - |
| 403 | Forbidden | - |
| 409 | Conflict | - |
| 422 | Validation Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ConnectionTestResponse test_connection(connection_body)
Test Connection
Test an API connection.
This method first creates an in-memory transient conn_id & exports that to an env var, as some hook classes tries to find out the conn from their init method & errors out if not found. It also deletes the conn id env connection after the test.
import airflow_client.client from airflow_client.client.models.connection_body import ConnectionBody from airflow_client.client.models.connection_test_response import ConnectionTestResponse from airflow_client.client.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = airflow_client.client.Configuration( host = "http://localhost" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. configuration.access_token = os.environ["ACCESS_TOKEN"] # Enter a context with an instance of the API client with airflow_client.client.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = airflow_client.client.ConnectionApi(api_client) connection_body = airflow_client.client.ConnectionBody() # ConnectionBody | try: # Test Connection api_response = api_instance.test_connection(connection_body) print("The response of ConnectionApi->test_connection:\n") pprint(api_response) except Exception as e: print("Exception when calling ConnectionApi->test_connection: %s\n" % e)
| Name | Type | Description | Notes |
|---|---|---|---|
| connection_body | ConnectionBody |
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 401 | Unauthorized | - |
| 403 | Forbidden | - |
| 422 | Validation Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]