airflow_client.client.DagStatsApi

All URIs are relative to http://localhost

MethodHTTP requestDescription
get_dag_statsGET /api/v2/dagStatsGet Dag Stats

get_dag_stats

DagStatsCollectionResponse get_dag_stats(dag_ids=dag_ids)

Get Dag Stats

Get Dag statistics.

Example

  • OAuth Authentication (OAuth2PasswordBearer):
  • Bearer Authentication (HTTPBearer):
import airflow_client.client
from airflow_client.client.models.dag_stats_collection_response import DagStatsCollectionResponse
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.DagStatsApi(api_client)
    dag_ids = ['dag_ids_example'] # List[str] |  (optional)

    try:
        # Get Dag Stats
        api_response = api_instance.get_dag_stats(dag_ids=dag_ids)
        print("The response of DagStatsApi->get_dag_stats:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling DagStatsApi->get_dag_stats: %s\n" % e)

Parameters

NameTypeDescriptionNotes
dag_idsList[str][optional]

Return type

DagStatsCollectionResponse

Authorization

OAuth2PasswordBearer, HTTPBearer

HTTP request headers

  • Content-Type: Not defined
  • 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]