airflow_client.client.DagRunApi

All URIs are relative to http://localhost

MethodHTTP requestDescription
clear_dag_runPOST /api/v2/dags/{dag_id}/dagRuns/{dag_run_id}/clearClear Dag Run
delete_dag_runDELETE /api/v2/dags/{dag_id}/dagRuns/{dag_run_id}Delete Dag Run
get_dag_runGET /api/v2/dags/{dag_id}/dagRuns/{dag_run_id}Get Dag Run
get_dag_runsGET /api/v2/dags/{dag_id}/dagRunsGet Dag Runs
get_list_dag_runs_batchPOST /api/v2/dags/{dag_id}/dagRuns/listGet List Dag Runs Batch
get_upstream_asset_eventsGET /api/v2/dags/{dag_id}/dagRuns/{dag_run_id}/upstreamAssetEventsGet Upstream Asset Events
patch_dag_runPATCH /api/v2/dags/{dag_id}/dagRuns/{dag_run_id}Patch Dag Run
trigger_dag_runPOST /api/v2/dags/{dag_id}/dagRunsTrigger Dag Run
wait_dag_run_until_finishedGET /api/v2/dags/{dag_id}/dagRuns/{dag_run_id}/waitExperimental: Wait for a dag run to complete, and return task results if requested.

clear_dag_run

ResponseClearDagRun clear_dag_run(dag_id, dag_run_id, dag_run_clear_body)

Clear Dag Run

Example

  • OAuth Authentication (OAuth2PasswordBearer):
  • Bearer Authentication (HTTPBearer):
import airflow_client.client
from airflow_client.client.models.dag_run_clear_body import DAGRunClearBody
from airflow_client.client.models.response_clear_dag_run import ResponseClearDagRun
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"]

# Configure Bearer authorization: HTTPBearer
configuration = airflow_client.client.Configuration(
    access_token = os.environ["BEARER_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.DagRunApi(api_client)
    dag_id = 'dag_id_example' # str | 
    dag_run_id = 'dag_run_id_example' # str | 
    dag_run_clear_body = airflow_client.client.DAGRunClearBody() # DAGRunClearBody | 

    try:
        # Clear Dag Run
        api_response = api_instance.clear_dag_run(dag_id, dag_run_id, dag_run_clear_body)
        print("The response of DagRunApi->clear_dag_run:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling DagRunApi->clear_dag_run: %s\n" % e)

Parameters

NameTypeDescriptionNotes
dag_idstr
dag_run_idstr
dag_run_clear_bodyDAGRunClearBody

Return type

ResponseClearDagRun

Authorization

OAuth2PasswordBearer, HTTPBearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Successful Response-
401Unauthorized-
403Forbidden-
404Not Found-
422Validation Error-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

delete_dag_run

delete_dag_run(dag_id, dag_run_id)

Delete Dag Run

Delete a DAG Run entry.

Example

  • OAuth Authentication (OAuth2PasswordBearer):
  • Bearer Authentication (HTTPBearer):
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"]

# Configure Bearer authorization: HTTPBearer
configuration = airflow_client.client.Configuration(
    access_token = os.environ["BEARER_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.DagRunApi(api_client)
    dag_id = 'dag_id_example' # str | 
    dag_run_id = 'dag_run_id_example' # str | 

    try:
        # Delete Dag Run
        api_instance.delete_dag_run(dag_id, dag_run_id)
    except Exception as e:
        print("Exception when calling DagRunApi->delete_dag_run: %s\n" % e)

Parameters

NameTypeDescriptionNotes
dag_idstr
dag_run_idstr

Return type

void (empty response body)

Authorization

OAuth2PasswordBearer, HTTPBearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
204Successful Response-
400Bad Request-
401Unauthorized-
403Forbidden-
404Not Found-
422Validation Error-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_dag_run

DAGRunResponse get_dag_run(dag_id, dag_run_id)

Get Dag Run

Example

  • OAuth Authentication (OAuth2PasswordBearer):
  • Bearer Authentication (HTTPBearer):
import airflow_client.client
from airflow_client.client.models.dag_run_response import DAGRunResponse
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"]

# Configure Bearer authorization: HTTPBearer
configuration = airflow_client.client.Configuration(
    access_token = os.environ["BEARER_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.DagRunApi(api_client)
    dag_id = 'dag_id_example' # str | 
    dag_run_id = 'dag_run_id_example' # str | 

    try:
        # Get Dag Run
        api_response = api_instance.get_dag_run(dag_id, dag_run_id)
        print("The response of DagRunApi->get_dag_run:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling DagRunApi->get_dag_run: %s\n" % e)

Parameters

NameTypeDescriptionNotes
dag_idstr
dag_run_idstr

Return type

DAGRunResponse

Authorization

OAuth2PasswordBearer, HTTPBearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Successful Response-
401Unauthorized-
403Forbidden-
404Not Found-
422Validation Error-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_dag_runs

DAGRunCollectionResponse get_dag_runs(dag_id, limit=limit, offset=offset, run_after_gte=run_after_gte, run_after_gt=run_after_gt, run_after_lte=run_after_lte, run_after_lt=run_after_lt, logical_date_gte=logical_date_gte, logical_date_gt=logical_date_gt, logical_date_lte=logical_date_lte, logical_date_lt=logical_date_lt, start_date_gte=start_date_gte, start_date_gt=start_date_gt, start_date_lte=start_date_lte, start_date_lt=start_date_lt, end_date_gte=end_date_gte, end_date_gt=end_date_gt, end_date_lte=end_date_lte, end_date_lt=end_date_lt, updated_at_gte=updated_at_gte, updated_at_gt=updated_at_gt, updated_at_lte=updated_at_lte, updated_at_lt=updated_at_lt, run_type=run_type, state=state, dag_version=dag_version, order_by=order_by, run_id_pattern=run_id_pattern, triggering_user_name_pattern=triggering_user_name_pattern)

Get Dag Runs

Get all DAG Runs.

This endpoint allows specifying ~ as the dag_id to retrieve Dag Runs for all DAGs.

Example

  • OAuth Authentication (OAuth2PasswordBearer):
  • Bearer Authentication (HTTPBearer):
import airflow_client.client
from airflow_client.client.models.dag_run_collection_response import DAGRunCollectionResponse
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"]

# Configure Bearer authorization: HTTPBearer
configuration = airflow_client.client.Configuration(
    access_token = os.environ["BEARER_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.DagRunApi(api_client)
    dag_id = 'dag_id_example' # str | 
    limit = 50 # int |  (optional) (default to 50)
    offset = 0 # int |  (optional) (default to 0)
    run_after_gte = '2013-10-20T19:20:30+01:00' # datetime |  (optional)
    run_after_gt = '2013-10-20T19:20:30+01:00' # datetime |  (optional)
    run_after_lte = '2013-10-20T19:20:30+01:00' # datetime |  (optional)
    run_after_lt = '2013-10-20T19:20:30+01:00' # datetime |  (optional)
    logical_date_gte = '2013-10-20T19:20:30+01:00' # datetime |  (optional)
    logical_date_gt = '2013-10-20T19:20:30+01:00' # datetime |  (optional)
    logical_date_lte = '2013-10-20T19:20:30+01:00' # datetime |  (optional)
    logical_date_lt = '2013-10-20T19:20:30+01:00' # datetime |  (optional)
    start_date_gte = '2013-10-20T19:20:30+01:00' # datetime |  (optional)
    start_date_gt = '2013-10-20T19:20:30+01:00' # datetime |  (optional)
    start_date_lte = '2013-10-20T19:20:30+01:00' # datetime |  (optional)
    start_date_lt = '2013-10-20T19:20:30+01:00' # datetime |  (optional)
    end_date_gte = '2013-10-20T19:20:30+01:00' # datetime |  (optional)
    end_date_gt = '2013-10-20T19:20:30+01:00' # datetime |  (optional)
    end_date_lte = '2013-10-20T19:20:30+01:00' # datetime |  (optional)
    end_date_lt = '2013-10-20T19:20:30+01:00' # datetime |  (optional)
    updated_at_gte = '2013-10-20T19:20:30+01:00' # datetime |  (optional)
    updated_at_gt = '2013-10-20T19:20:30+01:00' # datetime |  (optional)
    updated_at_lte = '2013-10-20T19:20:30+01:00' # datetime |  (optional)
    updated_at_lt = '2013-10-20T19:20:30+01:00' # datetime |  (optional)
    run_type = ['run_type_example'] # List[str] |  (optional)
    state = ['state_example'] # List[str] |  (optional)
    dag_version = [56] # List[int] |  (optional)
    order_by = [id] # List[str] |  (optional) (default to [id])
    run_id_pattern = 'run_id_pattern_example' # str | SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). Regular expressions are **not** supported. (optional)
    triggering_user_name_pattern = 'triggering_user_name_pattern_example' # str | SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). Regular expressions are **not** supported. (optional)

    try:
        # Get Dag Runs
        api_response = api_instance.get_dag_runs(dag_id, limit=limit, offset=offset, run_after_gte=run_after_gte, run_after_gt=run_after_gt, run_after_lte=run_after_lte, run_after_lt=run_after_lt, logical_date_gte=logical_date_gte, logical_date_gt=logical_date_gt, logical_date_lte=logical_date_lte, logical_date_lt=logical_date_lt, start_date_gte=start_date_gte, start_date_gt=start_date_gt, start_date_lte=start_date_lte, start_date_lt=start_date_lt, end_date_gte=end_date_gte, end_date_gt=end_date_gt, end_date_lte=end_date_lte, end_date_lt=end_date_lt, updated_at_gte=updated_at_gte, updated_at_gt=updated_at_gt, updated_at_lte=updated_at_lte, updated_at_lt=updated_at_lt, run_type=run_type, state=state, dag_version=dag_version, order_by=order_by, run_id_pattern=run_id_pattern, triggering_user_name_pattern=triggering_user_name_pattern)
        print("The response of DagRunApi->get_dag_runs:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling DagRunApi->get_dag_runs: %s\n" % e)

Parameters

NameTypeDescriptionNotes
dag_idstr
limitint[optional] [default to 50]
offsetint[optional] [default to 0]
run_after_gtedatetime[optional]
run_after_gtdatetime[optional]
run_after_ltedatetime[optional]
run_after_ltdatetime[optional]
logical_date_gtedatetime[optional]
logical_date_gtdatetime[optional]
logical_date_ltedatetime[optional]
logical_date_ltdatetime[optional]
start_date_gtedatetime[optional]
start_date_gtdatetime[optional]
start_date_ltedatetime[optional]
start_date_ltdatetime[optional]
end_date_gtedatetime[optional]
end_date_gtdatetime[optional]
end_date_ltedatetime[optional]
end_date_ltdatetime[optional]
updated_at_gtedatetime[optional]
updated_at_gtdatetime[optional]
updated_at_ltedatetime[optional]
updated_at_ltdatetime[optional]
run_typeList[str][optional]
stateList[str][optional]
dag_versionList[int][optional]
order_byList[str][optional] [default to [id]]
run_id_patternstrSQL LIKE expression — use `%` / `` wildcards (e.g. `%customer%`). Regular expressions are not supported.[optional]
triggering_user_name_patternstrSQL LIKE expression — use `%` / `` wildcards (e.g. `%customer%`). Regular expressions are not supported.[optional]

Return type

DAGRunCollectionResponse

Authorization

OAuth2PasswordBearer, HTTPBearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Successful Response-
401Unauthorized-
403Forbidden-
404Not Found-
422Validation Error-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_list_dag_runs_batch

DAGRunCollectionResponse get_list_dag_runs_batch(dag_id, dag_runs_batch_body)

Get List Dag Runs Batch

Get a list of DAG Runs.

Example

  • OAuth Authentication (OAuth2PasswordBearer):
  • Bearer Authentication (HTTPBearer):
import airflow_client.client
from airflow_client.client.models.dag_run_collection_response import DAGRunCollectionResponse
from airflow_client.client.models.dag_runs_batch_body import DAGRunsBatchBody
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"]

# Configure Bearer authorization: HTTPBearer
configuration = airflow_client.client.Configuration(
    access_token = os.environ["BEARER_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.DagRunApi(api_client)
    dag_id = 'dag_id_example' # str | 
    dag_runs_batch_body = airflow_client.client.DAGRunsBatchBody() # DAGRunsBatchBody | 

    try:
        # Get List Dag Runs Batch
        api_response = api_instance.get_list_dag_runs_batch(dag_id, dag_runs_batch_body)
        print("The response of DagRunApi->get_list_dag_runs_batch:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling DagRunApi->get_list_dag_runs_batch: %s\n" % e)

Parameters

NameTypeDescriptionNotes
dag_idstr
dag_runs_batch_bodyDAGRunsBatchBody

Return type

DAGRunCollectionResponse

Authorization

OAuth2PasswordBearer, HTTPBearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Successful Response-
401Unauthorized-
403Forbidden-
404Not Found-
422Validation Error-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_upstream_asset_events

AssetEventCollectionResponse get_upstream_asset_events(dag_id, dag_run_id)

Get Upstream Asset Events

If dag run is asset-triggered, return the asset events that triggered it.

Example

  • OAuth Authentication (OAuth2PasswordBearer):
  • Bearer Authentication (HTTPBearer):
import airflow_client.client
from airflow_client.client.models.asset_event_collection_response import AssetEventCollectionResponse
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"]

# Configure Bearer authorization: HTTPBearer
configuration = airflow_client.client.Configuration(
    access_token = os.environ["BEARER_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.DagRunApi(api_client)
    dag_id = 'dag_id_example' # str | 
    dag_run_id = 'dag_run_id_example' # str | 

    try:
        # Get Upstream Asset Events
        api_response = api_instance.get_upstream_asset_events(dag_id, dag_run_id)
        print("The response of DagRunApi->get_upstream_asset_events:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling DagRunApi->get_upstream_asset_events: %s\n" % e)

Parameters

NameTypeDescriptionNotes
dag_idstr
dag_run_idstr

Return type

AssetEventCollectionResponse

Authorization

OAuth2PasswordBearer, HTTPBearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Successful Response-
401Unauthorized-
403Forbidden-
404Not Found-
422Validation Error-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

patch_dag_run

DAGRunResponse patch_dag_run(dag_id, dag_run_id, dag_run_patch_body, update_mask=update_mask)

Patch Dag Run

Modify a DAG Run.

Example

  • OAuth Authentication (OAuth2PasswordBearer):
  • Bearer Authentication (HTTPBearer):
import airflow_client.client
from airflow_client.client.models.dag_run_patch_body import DAGRunPatchBody
from airflow_client.client.models.dag_run_response import DAGRunResponse
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"]

# Configure Bearer authorization: HTTPBearer
configuration = airflow_client.client.Configuration(
    access_token = os.environ["BEARER_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.DagRunApi(api_client)
    dag_id = 'dag_id_example' # str | 
    dag_run_id = 'dag_run_id_example' # str | 
    dag_run_patch_body = airflow_client.client.DAGRunPatchBody() # DAGRunPatchBody | 
    update_mask = ['update_mask_example'] # List[str] |  (optional)

    try:
        # Patch Dag Run
        api_response = api_instance.patch_dag_run(dag_id, dag_run_id, dag_run_patch_body, update_mask=update_mask)
        print("The response of DagRunApi->patch_dag_run:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling DagRunApi->patch_dag_run: %s\n" % e)

Parameters

NameTypeDescriptionNotes
dag_idstr
dag_run_idstr
dag_run_patch_bodyDAGRunPatchBody
update_maskList[str][optional]

Return type

DAGRunResponse

Authorization

OAuth2PasswordBearer, HTTPBearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Successful Response-
400Bad Request-
401Unauthorized-
403Forbidden-
404Not Found-
422Validation Error-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

trigger_dag_run

DAGRunResponse trigger_dag_run(dag_id, trigger_dag_run_post_body)

Trigger Dag Run

Trigger a DAG.

Example

  • OAuth Authentication (OAuth2PasswordBearer):
  • Bearer Authentication (HTTPBearer):
import airflow_client.client
from airflow_client.client.models.dag_run_response import DAGRunResponse
from airflow_client.client.models.trigger_dag_run_post_body import TriggerDAGRunPostBody
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"]

# Configure Bearer authorization: HTTPBearer
configuration = airflow_client.client.Configuration(
    access_token = os.environ["BEARER_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.DagRunApi(api_client)
    dag_id = None # object | 
    trigger_dag_run_post_body = airflow_client.client.TriggerDAGRunPostBody() # TriggerDAGRunPostBody | 

    try:
        # Trigger Dag Run
        api_response = api_instance.trigger_dag_run(dag_id, trigger_dag_run_post_body)
        print("The response of DagRunApi->trigger_dag_run:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling DagRunApi->trigger_dag_run: %s\n" % e)

Parameters

NameTypeDescriptionNotes
dag_idobject
trigger_dag_run_post_bodyTriggerDAGRunPostBody

Return type

DAGRunResponse

Authorization

OAuth2PasswordBearer, HTTPBearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Successful Response-
400Bad Request-
401Unauthorized-
403Forbidden-
404Not Found-
409Conflict-
422Validation Error-

[Back to top] [Back to API list] [Back to Model list] [Back to README]

wait_dag_run_until_finished

object wait_dag_run_until_finished(dag_id, dag_run_id, interval, result=result)

Experimental: Wait for a dag run to complete, and return task results if requested.

🚧 This is an experimental endpoint and may change or be removed without notice.Successful response are streamed as newline-delimited JSON (NDJSON). Each line is a JSON object representing the DAG run state.

Example

  • OAuth Authentication (OAuth2PasswordBearer):
  • Bearer Authentication (HTTPBearer):
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"]

# Configure Bearer authorization: HTTPBearer
configuration = airflow_client.client.Configuration(
    access_token = os.environ["BEARER_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.DagRunApi(api_client)
    dag_id = 'dag_id_example' # str | 
    dag_run_id = 'dag_run_id_example' # str | 
    interval = 3.4 # float | Seconds to wait between dag run state checks
    result = ['result_example'] # List[str] | Collect result XCom from task. Can be set multiple times. (optional)

    try:
        # Experimental: Wait for a dag run to complete, and return task results if requested.
        api_response = api_instance.wait_dag_run_until_finished(dag_id, dag_run_id, interval, result=result)
        print("The response of DagRunApi->wait_dag_run_until_finished:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling DagRunApi->wait_dag_run_until_finished: %s\n" % e)

Parameters

NameTypeDescriptionNotes
dag_idstr
dag_run_idstr
intervalfloatSeconds to wait between dag run state checks
resultList[str]Collect result XCom from task. Can be set multiple times.[optional]

Return type

object

Authorization

OAuth2PasswordBearer, HTTPBearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/x-ndjson

HTTP response details

Status codeDescriptionResponse headers
200Successful Response-
401Unauthorized-
403Forbidden-
404Not Found-
422Validation Error-

[Back to top] [Back to API list] [Back to Model list] [Back to README]