airflow_client.client.DagBundleApi

All URIs are relative to http://localhost

MethodHTTP requestDescription
get_dag_bundleGET /api/v2/dagBundles/{bundle_name}Get Dag Bundle
get_dag_bundle_filesGET /api/v2/dagBundles/{bundle_name}/filesGet Dag Bundle Files
get_dag_bundlesGET /api/v2/dagBundlesGet Dag Bundles

get_dag_bundle

DagBundleDetailResponse get_dag_bundle(bundle_name)

Get Dag Bundle

Get a Dag bundle.

Example

  • OAuth Authentication (OAuth2PasswordBearer):
  • Bearer Authentication (HTTPBearer):
import airflow_client.client
from airflow_client.client.models.dag_bundle_detail_response import DagBundleDetailResponse
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.DagBundleApi(api_client)
    bundle_name = 'bundle_name_example' # str | 

    try:
        # Get Dag Bundle
        api_response = api_instance.get_dag_bundle(bundle_name)
        print("The response of DagBundleApi->get_dag_bundle:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling DagBundleApi->get_dag_bundle: %s\n" % e)

Parameters

NameTypeDescriptionNotes
bundle_namestr

Return type

DagBundleDetailResponse

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_bundle_files

DagBundleFileCollectionResponse get_dag_bundle_files(bundle_name, limit=limit, offset=offset)

Get Dag Bundle Files

List the files in a Dag bundle, ordered by path.

A file is listed when the caller can read at least one Dag it defines. A file that recorded an import error without registering any Dag is listed too, on the same admin-by-default terms as GET /importErrors -- a file that fails before defining a Dag has no Dag to authorize on, and it is the case this page most needs to show.

dag_count counts live Dags only. Dag rows are never deleted: a file that fails to import has every Dag in it marked stale, and so does a file dropped from the bundle. A file therefore stays listed on the strength of a live Dag or an import error, so a file that has just broken does not vanish from the page someone opened to find out why, while a file deleted long ago drops out instead of lingering forever.

Parse times come from the Dags in the file rather than the file itself, which is the only record Airflow keeps: a file whose every Dag was removed keeps no parse time of its own.

Example

  • OAuth Authentication (OAuth2PasswordBearer):
  • Bearer Authentication (HTTPBearer):
import airflow_client.client
from airflow_client.client.models.dag_bundle_file_collection_response import DagBundleFileCollectionResponse
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.DagBundleApi(api_client)
    bundle_name = 'bundle_name_example' # str | 
    limit = 50 # int |  (optional) (default to 50)
    offset = 0 # int |  (optional) (default to 0)

    try:
        # Get Dag Bundle Files
        api_response = api_instance.get_dag_bundle_files(bundle_name, limit=limit, offset=offset)
        print("The response of DagBundleApi->get_dag_bundle_files:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling DagBundleApi->get_dag_bundle_files: %s\n" % e)

Parameters

NameTypeDescriptionNotes
bundle_namestr
limitint[optional] [default to 50]
offsetint[optional] [default to 0]

Return type

DagBundleFileCollectionResponse

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_bundles

DagBundleCollectionResponse get_dag_bundles(limit=limit, offset=offset, order_by=order_by)

Get Dag Bundles

List the Dag bundles Airflow knows about.

Reports the version of each bundle Airflow currently holds and when a Dag processor last refreshed it, so whoever deployed the code can tell whether it has been picked up yet.

A bundle is visible to a user who can read at least one Dag recorded against it. A bundle holding no registered Dag at all has nothing to authorize against, so it is listed only for a user holding the admin-by-default AccessView.IMPORT_ERRORS_ALL for that bundle's team -- the same view, scoped the same way, that governs import errors for a file that never registered a Dag.

Example

  • OAuth Authentication (OAuth2PasswordBearer):
  • Bearer Authentication (HTTPBearer):
import airflow_client.client
from airflow_client.client.models.dag_bundle_collection_response import DagBundleCollectionResponse
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.DagBundleApi(api_client)
    limit = 50 # int |  (optional) (default to 50)
    offset = 0 # int |  (optional) (default to 0)
    order_by = ["name"] # List[str] | Attributes to order by, multi criteria sort is supported. Prefix with `-` for descending order. Supported attributes: `name, version, last_refreshed, active` (optional) (default to ["name"])

    try:
        # Get Dag Bundles
        api_response = api_instance.get_dag_bundles(limit=limit, offset=offset, order_by=order_by)
        print("The response of DagBundleApi->get_dag_bundles:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling DagBundleApi->get_dag_bundles: %s\n" % e)

Parameters

NameTypeDescriptionNotes
limitint[optional] [default to 50]
offsetint[optional] [default to 0]
order_byList[str]Attributes to order by, multi criteria sort is supported. Prefix with `-` for descending order. Supported attributes: `name, version, last_refreshed, active`[optional] [default to ["name"]]

Return type

DagBundleCollectionResponse

Authorization

OAuth2PasswordBearer, HTTPBearer

HTTP request headers

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

HTTP response details

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

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