| """ | |
| Airflow API | |
| Airflow API. All endpoints located under ``/api/v2`` can be used safely, are stable and backward compatible. Endpoints located under ``/ui`` are dedicated to the UI and are subject to breaking change depending on the need of the frontend. Users should not rely on those but use the public ones instead. **Filtering with pattern parameters.** Many list endpoints accept ``*_pattern`` and ``*_prefix_pattern`` query parameters. Unless a parameter's own description says otherwise, ``*_pattern`` is a case-insensitive substring match (SQL ``ILIKE '%term%'``) where ``%`` matches any sequence and ``_`` matches any single character (e.g. ``%customer_%``) — convenient, but it cannot use B-tree indexes, so it is slow on large tables. ``*_prefix_pattern`` matches the start of the value, is case-sensitive and index-friendly (prefer it at scale); there ``%`` and ``_`` are literal and trailing non-alphanumeric characters are stripped so the range scan stays index-compatible under locale-aware collations (e.g. ``test_`` matches values starting with ``test``, and ``s3://`` matches ``s3``). In both, ``|`` means OR (e.g. ``dag1|dag2``) and ``~`` matches everything. Regular expressions are not supported by these parameters; regex-capable endpoints expose a separate parameter. | |
| The version of the OpenAPI document: 2 | |
| Generated by OpenAPI Generator (https://openapi-generator.tech) | |
| Do not edit the class manually. | |
| """ # noqa: E501 | |
| import warnings | |
| from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt | |
| from typing import Any, Dict, List, Optional, Tuple, Union | |
| from typing_extensions import Annotated | |
| from datetime import datetime | |
| from pydantic import Field, StrictBool, StrictStr, field_validator | |
| from typing import Any, List, Optional | |
| from typing_extensions import Annotated | |
| from airflow_client.client.models.dag_collection_response import DAGCollectionResponse | |
| from airflow_client.client.models.dag_details_response import DAGDetailsResponse | |
| from airflow_client.client.models.dag_patch_body import DAGPatchBody | |
| from airflow_client.client.models.dag_response import DAGResponse | |
| from airflow_client.client.models.dag_tag_collection_response import DAGTagCollectionResponse | |
| from airflow_client.client.api_client import ApiClient, RequestSerialized | |
| from airflow_client.client.api_response import ApiResponse | |
| from airflow_client.client.rest import RESTResponseType | |
| class DAGApi: | |
| """NOTE: This class is auto generated by OpenAPI Generator | |
| Ref: https://openapi-generator.tech | |
| Do not edit the class manually. | |
| """ | |
| def __init__(self, api_client=None) -> None: | |
| if api_client is None: | |
| api_client = ApiClient.get_default() | |
| self.api_client = api_client | |
| @validate_call | |
| def delete_dag( | |
| self, | |
| dag_id: StrictStr, | |
| _request_timeout: Union[ | |
| None, | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Tuple[ | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Annotated[StrictFloat, Field(gt=0)] | |
| ] | |
| ] = None, | |
| _request_auth: Optional[Dict[StrictStr, Any]] = None, | |
| _content_type: Optional[StrictStr] = None, | |
| _headers: Optional[Dict[StrictStr, Any]] = None, | |
| _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, | |
| ) -> object: | |
| """Delete Dag | |
| Delete the specific Dag. | |
| :param dag_id: (required) | |
| :type dag_id: str | |
| :param _request_timeout: timeout setting for this request. If one | |
| number provided, it will be total request | |
| timeout. It can also be a pair (tuple) of | |
| (connection, read) timeouts. | |
| :type _request_timeout: int, tuple(int, int), optional | |
| :param _request_auth: set to override the auth_settings for an a single | |
| request; this effectively ignores the | |
| authentication in the spec for a single request. | |
| :type _request_auth: dict, optional | |
| :param _content_type: force content-type for the request. | |
| :type _content_type: str, Optional | |
| :param _headers: set to override the headers for a single | |
| request; this effectively ignores the headers | |
| in the spec for a single request. | |
| :type _headers: dict, optional | |
| :param _host_index: set to override the host_index for a single | |
| request; this effectively ignores the host_index | |
| in the spec for a single request. | |
| :type _host_index: int, optional | |
| :return: Returns the result object. | |
| """ # noqa: E501 | |
| _param = self._delete_dag_serialize( | |
| dag_id=dag_id, | |
| _request_auth=_request_auth, | |
| _content_type=_content_type, | |
| _headers=_headers, | |
| _host_index=_host_index | |
| ) | |
| _response_types_map: Dict[str, Optional[str]] = { | |
| '200': "object", | |
| '400': "HTTPExceptionResponse", | |
| '401': "HTTPExceptionResponse", | |
| '403': "HTTPExceptionResponse", | |
| '404': "HTTPExceptionResponse", | |
| '409': "HTTPExceptionResponse", | |
| '422': "HTTPExceptionResponse", | |
| } | |
| response_data = self.api_client.call_api( | |
| *_param, | |
| _request_timeout=_request_timeout | |
| ) | |
| response_data.read() | |
| return self.api_client.response_deserialize( | |
| response_data=response_data, | |
| response_types_map=_response_types_map, | |
| ).data | |
| @validate_call | |
| def delete_dag_with_http_info( | |
| self, | |
| dag_id: StrictStr, | |
| _request_timeout: Union[ | |
| None, | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Tuple[ | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Annotated[StrictFloat, Field(gt=0)] | |
| ] | |
| ] = None, | |
| _request_auth: Optional[Dict[StrictStr, Any]] = None, | |
| _content_type: Optional[StrictStr] = None, | |
| _headers: Optional[Dict[StrictStr, Any]] = None, | |
| _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, | |
| ) -> ApiResponse[object]: | |
| """Delete Dag | |
| Delete the specific Dag. | |
| :param dag_id: (required) | |
| :type dag_id: str | |
| :param _request_timeout: timeout setting for this request. If one | |
| number provided, it will be total request | |
| timeout. It can also be a pair (tuple) of | |
| (connection, read) timeouts. | |
| :type _request_timeout: int, tuple(int, int), optional | |
| :param _request_auth: set to override the auth_settings for an a single | |
| request; this effectively ignores the | |
| authentication in the spec for a single request. | |
| :type _request_auth: dict, optional | |
| :param _content_type: force content-type for the request. | |
| :type _content_type: str, Optional | |
| :param _headers: set to override the headers for a single | |
| request; this effectively ignores the headers | |
| in the spec for a single request. | |
| :type _headers: dict, optional | |
| :param _host_index: set to override the host_index for a single | |
| request; this effectively ignores the host_index | |
| in the spec for a single request. | |
| :type _host_index: int, optional | |
| :return: Returns the result object. | |
| """ # noqa: E501 | |
| _param = self._delete_dag_serialize( | |
| dag_id=dag_id, | |
| _request_auth=_request_auth, | |
| _content_type=_content_type, | |
| _headers=_headers, | |
| _host_index=_host_index | |
| ) | |
| _response_types_map: Dict[str, Optional[str]] = { | |
| '200': "object", | |
| '400': "HTTPExceptionResponse", | |
| '401': "HTTPExceptionResponse", | |
| '403': "HTTPExceptionResponse", | |
| '404': "HTTPExceptionResponse", | |
| '409': "HTTPExceptionResponse", | |
| '422': "HTTPExceptionResponse", | |
| } | |
| response_data = self.api_client.call_api( | |
| *_param, | |
| _request_timeout=_request_timeout | |
| ) | |
| response_data.read() | |
| return self.api_client.response_deserialize( | |
| response_data=response_data, | |
| response_types_map=_response_types_map, | |
| ) | |
| @validate_call | |
| def delete_dag_without_preload_content( | |
| self, | |
| dag_id: StrictStr, | |
| _request_timeout: Union[ | |
| None, | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Tuple[ | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Annotated[StrictFloat, Field(gt=0)] | |
| ] | |
| ] = None, | |
| _request_auth: Optional[Dict[StrictStr, Any]] = None, | |
| _content_type: Optional[StrictStr] = None, | |
| _headers: Optional[Dict[StrictStr, Any]] = None, | |
| _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, | |
| ) -> RESTResponseType: | |
| """Delete Dag | |
| Delete the specific Dag. | |
| :param dag_id: (required) | |
| :type dag_id: str | |
| :param _request_timeout: timeout setting for this request. If one | |
| number provided, it will be total request | |
| timeout. It can also be a pair (tuple) of | |
| (connection, read) timeouts. | |
| :type _request_timeout: int, tuple(int, int), optional | |
| :param _request_auth: set to override the auth_settings for an a single | |
| request; this effectively ignores the | |
| authentication in the spec for a single request. | |
| :type _request_auth: dict, optional | |
| :param _content_type: force content-type for the request. | |
| :type _content_type: str, Optional | |
| :param _headers: set to override the headers for a single | |
| request; this effectively ignores the headers | |
| in the spec for a single request. | |
| :type _headers: dict, optional | |
| :param _host_index: set to override the host_index for a single | |
| request; this effectively ignores the host_index | |
| in the spec for a single request. | |
| :type _host_index: int, optional | |
| :return: Returns the result object. | |
| """ # noqa: E501 | |
| _param = self._delete_dag_serialize( | |
| dag_id=dag_id, | |
| _request_auth=_request_auth, | |
| _content_type=_content_type, | |
| _headers=_headers, | |
| _host_index=_host_index | |
| ) | |
| _response_types_map: Dict[str, Optional[str]] = { | |
| '200': "object", | |
| '400': "HTTPExceptionResponse", | |
| '401': "HTTPExceptionResponse", | |
| '403': "HTTPExceptionResponse", | |
| '404': "HTTPExceptionResponse", | |
| '409': "HTTPExceptionResponse", | |
| '422': "HTTPExceptionResponse", | |
| } | |
| response_data = self.api_client.call_api( | |
| *_param, | |
| _request_timeout=_request_timeout | |
| ) | |
| return response_data.response | |
| def _delete_dag_serialize( | |
| self, | |
| dag_id, | |
| _request_auth, | |
| _content_type, | |
| _headers, | |
| _host_index, | |
| ) -> RequestSerialized: | |
| _host = None | |
| _collection_formats: Dict[str, str] = { | |
| } | |
| _path_params: Dict[str, str] = {} | |
| _query_params: List[Tuple[str, str]] = [] | |
| _header_params: Dict[str, Optional[str]] = _headers or {} | |
| _form_params: List[Tuple[str, str]] = [] | |
| _files: Dict[ | |
| str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] | |
| ] = {} | |
| _body_params: Optional[bytes] = None | |
| # process the path parameters | |
| if dag_id is not None: | |
| _path_params['dag_id'] = dag_id | |
| # process the query parameters | |
| # process the header parameters | |
| # process the form parameters | |
| # process the body parameter | |
| # set the HTTP header `Accept` | |
| if 'Accept' not in _header_params: | |
| _header_params['Accept'] = self.api_client.select_header_accept( | |
| [ | |
| 'application/json' | |
| ] | |
| ) | |
| # authentication setting | |
| _auth_settings: List[str] = [ | |
| 'OAuth2PasswordBearer', | |
| 'HTTPBearer' | |
| ] | |
| return self.api_client.param_serialize( | |
| method='DELETE', | |
| resource_path='/api/v2/dags/{dag_id}', | |
| path_params=_path_params, | |
| query_params=_query_params, | |
| header_params=_header_params, | |
| body=_body_params, | |
| post_params=_form_params, | |
| files=_files, | |
| auth_settings=_auth_settings, | |
| collection_formats=_collection_formats, | |
| _host=_host, | |
| _request_auth=_request_auth | |
| ) | |
| @validate_call | |
| def favorite_dag( | |
| self, | |
| dag_id: StrictStr, | |
| _request_timeout: Union[ | |
| None, | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Tuple[ | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Annotated[StrictFloat, Field(gt=0)] | |
| ] | |
| ] = None, | |
| _request_auth: Optional[Dict[StrictStr, Any]] = None, | |
| _content_type: Optional[StrictStr] = None, | |
| _headers: Optional[Dict[StrictStr, Any]] = None, | |
| _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, | |
| ) -> None: | |
| """Favorite Dag | |
| Mark the Dag as favorite. | |
| :param dag_id: (required) | |
| :type dag_id: str | |
| :param _request_timeout: timeout setting for this request. If one | |
| number provided, it will be total request | |
| timeout. It can also be a pair (tuple) of | |
| (connection, read) timeouts. | |
| :type _request_timeout: int, tuple(int, int), optional | |
| :param _request_auth: set to override the auth_settings for an a single | |
| request; this effectively ignores the | |
| authentication in the spec for a single request. | |
| :type _request_auth: dict, optional | |
| :param _content_type: force content-type for the request. | |
| :type _content_type: str, Optional | |
| :param _headers: set to override the headers for a single | |
| request; this effectively ignores the headers | |
| in the spec for a single request. | |
| :type _headers: dict, optional | |
| :param _host_index: set to override the host_index for a single | |
| request; this effectively ignores the host_index | |
| in the spec for a single request. | |
| :type _host_index: int, optional | |
| :return: Returns the result object. | |
| """ # noqa: E501 | |
| _param = self._favorite_dag_serialize( | |
| dag_id=dag_id, | |
| _request_auth=_request_auth, | |
| _content_type=_content_type, | |
| _headers=_headers, | |
| _host_index=_host_index | |
| ) | |
| _response_types_map: Dict[str, Optional[str]] = { | |
| '204': None, | |
| '401': "HTTPExceptionResponse", | |
| '403': "HTTPExceptionResponse", | |
| '404': "HTTPExceptionResponse", | |
| '422': "HTTPValidationError", | |
| } | |
| response_data = self.api_client.call_api( | |
| *_param, | |
| _request_timeout=_request_timeout | |
| ) | |
| response_data.read() | |
| return self.api_client.response_deserialize( | |
| response_data=response_data, | |
| response_types_map=_response_types_map, | |
| ).data | |
| @validate_call | |
| def favorite_dag_with_http_info( | |
| self, | |
| dag_id: StrictStr, | |
| _request_timeout: Union[ | |
| None, | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Tuple[ | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Annotated[StrictFloat, Field(gt=0)] | |
| ] | |
| ] = None, | |
| _request_auth: Optional[Dict[StrictStr, Any]] = None, | |
| _content_type: Optional[StrictStr] = None, | |
| _headers: Optional[Dict[StrictStr, Any]] = None, | |
| _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, | |
| ) -> ApiResponse[None]: | |
| """Favorite Dag | |
| Mark the Dag as favorite. | |
| :param dag_id: (required) | |
| :type dag_id: str | |
| :param _request_timeout: timeout setting for this request. If one | |
| number provided, it will be total request | |
| timeout. It can also be a pair (tuple) of | |
| (connection, read) timeouts. | |
| :type _request_timeout: int, tuple(int, int), optional | |
| :param _request_auth: set to override the auth_settings for an a single | |
| request; this effectively ignores the | |
| authentication in the spec for a single request. | |
| :type _request_auth: dict, optional | |
| :param _content_type: force content-type for the request. | |
| :type _content_type: str, Optional | |
| :param _headers: set to override the headers for a single | |
| request; this effectively ignores the headers | |
| in the spec for a single request. | |
| :type _headers: dict, optional | |
| :param _host_index: set to override the host_index for a single | |
| request; this effectively ignores the host_index | |
| in the spec for a single request. | |
| :type _host_index: int, optional | |
| :return: Returns the result object. | |
| """ # noqa: E501 | |
| _param = self._favorite_dag_serialize( | |
| dag_id=dag_id, | |
| _request_auth=_request_auth, | |
| _content_type=_content_type, | |
| _headers=_headers, | |
| _host_index=_host_index | |
| ) | |
| _response_types_map: Dict[str, Optional[str]] = { | |
| '204': None, | |
| '401': "HTTPExceptionResponse", | |
| '403': "HTTPExceptionResponse", | |
| '404': "HTTPExceptionResponse", | |
| '422': "HTTPValidationError", | |
| } | |
| response_data = self.api_client.call_api( | |
| *_param, | |
| _request_timeout=_request_timeout | |
| ) | |
| response_data.read() | |
| return self.api_client.response_deserialize( | |
| response_data=response_data, | |
| response_types_map=_response_types_map, | |
| ) | |
| @validate_call | |
| def favorite_dag_without_preload_content( | |
| self, | |
| dag_id: StrictStr, | |
| _request_timeout: Union[ | |
| None, | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Tuple[ | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Annotated[StrictFloat, Field(gt=0)] | |
| ] | |
| ] = None, | |
| _request_auth: Optional[Dict[StrictStr, Any]] = None, | |
| _content_type: Optional[StrictStr] = None, | |
| _headers: Optional[Dict[StrictStr, Any]] = None, | |
| _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, | |
| ) -> RESTResponseType: | |
| """Favorite Dag | |
| Mark the Dag as favorite. | |
| :param dag_id: (required) | |
| :type dag_id: str | |
| :param _request_timeout: timeout setting for this request. If one | |
| number provided, it will be total request | |
| timeout. It can also be a pair (tuple) of | |
| (connection, read) timeouts. | |
| :type _request_timeout: int, tuple(int, int), optional | |
| :param _request_auth: set to override the auth_settings for an a single | |
| request; this effectively ignores the | |
| authentication in the spec for a single request. | |
| :type _request_auth: dict, optional | |
| :param _content_type: force content-type for the request. | |
| :type _content_type: str, Optional | |
| :param _headers: set to override the headers for a single | |
| request; this effectively ignores the headers | |
| in the spec for a single request. | |
| :type _headers: dict, optional | |
| :param _host_index: set to override the host_index for a single | |
| request; this effectively ignores the host_index | |
| in the spec for a single request. | |
| :type _host_index: int, optional | |
| :return: Returns the result object. | |
| """ # noqa: E501 | |
| _param = self._favorite_dag_serialize( | |
| dag_id=dag_id, | |
| _request_auth=_request_auth, | |
| _content_type=_content_type, | |
| _headers=_headers, | |
| _host_index=_host_index | |
| ) | |
| _response_types_map: Dict[str, Optional[str]] = { | |
| '204': None, | |
| '401': "HTTPExceptionResponse", | |
| '403': "HTTPExceptionResponse", | |
| '404': "HTTPExceptionResponse", | |
| '422': "HTTPValidationError", | |
| } | |
| response_data = self.api_client.call_api( | |
| *_param, | |
| _request_timeout=_request_timeout | |
| ) | |
| return response_data.response | |
| def _favorite_dag_serialize( | |
| self, | |
| dag_id, | |
| _request_auth, | |
| _content_type, | |
| _headers, | |
| _host_index, | |
| ) -> RequestSerialized: | |
| _host = None | |
| _collection_formats: Dict[str, str] = { | |
| } | |
| _path_params: Dict[str, str] = {} | |
| _query_params: List[Tuple[str, str]] = [] | |
| _header_params: Dict[str, Optional[str]] = _headers or {} | |
| _form_params: List[Tuple[str, str]] = [] | |
| _files: Dict[ | |
| str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] | |
| ] = {} | |
| _body_params: Optional[bytes] = None | |
| # process the path parameters | |
| if dag_id is not None: | |
| _path_params['dag_id'] = dag_id | |
| # process the query parameters | |
| # process the header parameters | |
| # process the form parameters | |
| # process the body parameter | |
| # set the HTTP header `Accept` | |
| if 'Accept' not in _header_params: | |
| _header_params['Accept'] = self.api_client.select_header_accept( | |
| [ | |
| 'application/json' | |
| ] | |
| ) | |
| # authentication setting | |
| _auth_settings: List[str] = [ | |
| 'OAuth2PasswordBearer', | |
| 'HTTPBearer' | |
| ] | |
| return self.api_client.param_serialize( | |
| method='POST', | |
| resource_path='/api/v2/dags/{dag_id}/favorite', | |
| path_params=_path_params, | |
| query_params=_query_params, | |
| header_params=_header_params, | |
| body=_body_params, | |
| post_params=_form_params, | |
| files=_files, | |
| auth_settings=_auth_settings, | |
| collection_formats=_collection_formats, | |
| _host=_host, | |
| _request_auth=_request_auth | |
| ) | |
| @validate_call | |
| def get_dag( | |
| self, | |
| dag_id: StrictStr, | |
| _request_timeout: Union[ | |
| None, | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Tuple[ | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Annotated[StrictFloat, Field(gt=0)] | |
| ] | |
| ] = None, | |
| _request_auth: Optional[Dict[StrictStr, Any]] = None, | |
| _content_type: Optional[StrictStr] = None, | |
| _headers: Optional[Dict[StrictStr, Any]] = None, | |
| _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, | |
| ) -> DAGResponse: | |
| """Get Dag | |
| Get basic information about a Dag. | |
| :param dag_id: (required) | |
| :type dag_id: str | |
| :param _request_timeout: timeout setting for this request. If one | |
| number provided, it will be total request | |
| timeout. It can also be a pair (tuple) of | |
| (connection, read) timeouts. | |
| :type _request_timeout: int, tuple(int, int), optional | |
| :param _request_auth: set to override the auth_settings for an a single | |
| request; this effectively ignores the | |
| authentication in the spec for a single request. | |
| :type _request_auth: dict, optional | |
| :param _content_type: force content-type for the request. | |
| :type _content_type: str, Optional | |
| :param _headers: set to override the headers for a single | |
| request; this effectively ignores the headers | |
| in the spec for a single request. | |
| :type _headers: dict, optional | |
| :param _host_index: set to override the host_index for a single | |
| request; this effectively ignores the host_index | |
| in the spec for a single request. | |
| :type _host_index: int, optional | |
| :return: Returns the result object. | |
| """ # noqa: E501 | |
| _param = self._get_dag_serialize( | |
| dag_id=dag_id, | |
| _request_auth=_request_auth, | |
| _content_type=_content_type, | |
| _headers=_headers, | |
| _host_index=_host_index | |
| ) | |
| _response_types_map: Dict[str, Optional[str]] = { | |
| '200': "DAGResponse", | |
| '400': "HTTPExceptionResponse", | |
| '401': "HTTPExceptionResponse", | |
| '403': "HTTPExceptionResponse", | |
| '404': "HTTPExceptionResponse", | |
| '422': "HTTPExceptionResponse", | |
| } | |
| response_data = self.api_client.call_api( | |
| *_param, | |
| _request_timeout=_request_timeout | |
| ) | |
| response_data.read() | |
| return self.api_client.response_deserialize( | |
| response_data=response_data, | |
| response_types_map=_response_types_map, | |
| ).data | |
| @validate_call | |
| def get_dag_with_http_info( | |
| self, | |
| dag_id: StrictStr, | |
| _request_timeout: Union[ | |
| None, | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Tuple[ | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Annotated[StrictFloat, Field(gt=0)] | |
| ] | |
| ] = None, | |
| _request_auth: Optional[Dict[StrictStr, Any]] = None, | |
| _content_type: Optional[StrictStr] = None, | |
| _headers: Optional[Dict[StrictStr, Any]] = None, | |
| _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, | |
| ) -> ApiResponse[DAGResponse]: | |
| """Get Dag | |
| Get basic information about a Dag. | |
| :param dag_id: (required) | |
| :type dag_id: str | |
| :param _request_timeout: timeout setting for this request. If one | |
| number provided, it will be total request | |
| timeout. It can also be a pair (tuple) of | |
| (connection, read) timeouts. | |
| :type _request_timeout: int, tuple(int, int), optional | |
| :param _request_auth: set to override the auth_settings for an a single | |
| request; this effectively ignores the | |
| authentication in the spec for a single request. | |
| :type _request_auth: dict, optional | |
| :param _content_type: force content-type for the request. | |
| :type _content_type: str, Optional | |
| :param _headers: set to override the headers for a single | |
| request; this effectively ignores the headers | |
| in the spec for a single request. | |
| :type _headers: dict, optional | |
| :param _host_index: set to override the host_index for a single | |
| request; this effectively ignores the host_index | |
| in the spec for a single request. | |
| :type _host_index: int, optional | |
| :return: Returns the result object. | |
| """ # noqa: E501 | |
| _param = self._get_dag_serialize( | |
| dag_id=dag_id, | |
| _request_auth=_request_auth, | |
| _content_type=_content_type, | |
| _headers=_headers, | |
| _host_index=_host_index | |
| ) | |
| _response_types_map: Dict[str, Optional[str]] = { | |
| '200': "DAGResponse", | |
| '400': "HTTPExceptionResponse", | |
| '401': "HTTPExceptionResponse", | |
| '403': "HTTPExceptionResponse", | |
| '404': "HTTPExceptionResponse", | |
| '422': "HTTPExceptionResponse", | |
| } | |
| response_data = self.api_client.call_api( | |
| *_param, | |
| _request_timeout=_request_timeout | |
| ) | |
| response_data.read() | |
| return self.api_client.response_deserialize( | |
| response_data=response_data, | |
| response_types_map=_response_types_map, | |
| ) | |
| @validate_call | |
| def get_dag_without_preload_content( | |
| self, | |
| dag_id: StrictStr, | |
| _request_timeout: Union[ | |
| None, | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Tuple[ | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Annotated[StrictFloat, Field(gt=0)] | |
| ] | |
| ] = None, | |
| _request_auth: Optional[Dict[StrictStr, Any]] = None, | |
| _content_type: Optional[StrictStr] = None, | |
| _headers: Optional[Dict[StrictStr, Any]] = None, | |
| _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, | |
| ) -> RESTResponseType: | |
| """Get Dag | |
| Get basic information about a Dag. | |
| :param dag_id: (required) | |
| :type dag_id: str | |
| :param _request_timeout: timeout setting for this request. If one | |
| number provided, it will be total request | |
| timeout. It can also be a pair (tuple) of | |
| (connection, read) timeouts. | |
| :type _request_timeout: int, tuple(int, int), optional | |
| :param _request_auth: set to override the auth_settings for an a single | |
| request; this effectively ignores the | |
| authentication in the spec for a single request. | |
| :type _request_auth: dict, optional | |
| :param _content_type: force content-type for the request. | |
| :type _content_type: str, Optional | |
| :param _headers: set to override the headers for a single | |
| request; this effectively ignores the headers | |
| in the spec for a single request. | |
| :type _headers: dict, optional | |
| :param _host_index: set to override the host_index for a single | |
| request; this effectively ignores the host_index | |
| in the spec for a single request. | |
| :type _host_index: int, optional | |
| :return: Returns the result object. | |
| """ # noqa: E501 | |
| _param = self._get_dag_serialize( | |
| dag_id=dag_id, | |
| _request_auth=_request_auth, | |
| _content_type=_content_type, | |
| _headers=_headers, | |
| _host_index=_host_index | |
| ) | |
| _response_types_map: Dict[str, Optional[str]] = { | |
| '200': "DAGResponse", | |
| '400': "HTTPExceptionResponse", | |
| '401': "HTTPExceptionResponse", | |
| '403': "HTTPExceptionResponse", | |
| '404': "HTTPExceptionResponse", | |
| '422': "HTTPExceptionResponse", | |
| } | |
| response_data = self.api_client.call_api( | |
| *_param, | |
| _request_timeout=_request_timeout | |
| ) | |
| return response_data.response | |
| def _get_dag_serialize( | |
| self, | |
| dag_id, | |
| _request_auth, | |
| _content_type, | |
| _headers, | |
| _host_index, | |
| ) -> RequestSerialized: | |
| _host = None | |
| _collection_formats: Dict[str, str] = { | |
| } | |
| _path_params: Dict[str, str] = {} | |
| _query_params: List[Tuple[str, str]] = [] | |
| _header_params: Dict[str, Optional[str]] = _headers or {} | |
| _form_params: List[Tuple[str, str]] = [] | |
| _files: Dict[ | |
| str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] | |
| ] = {} | |
| _body_params: Optional[bytes] = None | |
| # process the path parameters | |
| if dag_id is not None: | |
| _path_params['dag_id'] = dag_id | |
| # process the query parameters | |
| # process the header parameters | |
| # process the form parameters | |
| # process the body parameter | |
| # set the HTTP header `Accept` | |
| if 'Accept' not in _header_params: | |
| _header_params['Accept'] = self.api_client.select_header_accept( | |
| [ | |
| 'application/json' | |
| ] | |
| ) | |
| # authentication setting | |
| _auth_settings: List[str] = [ | |
| 'OAuth2PasswordBearer', | |
| 'HTTPBearer' | |
| ] | |
| return self.api_client.param_serialize( | |
| method='GET', | |
| resource_path='/api/v2/dags/{dag_id}', | |
| path_params=_path_params, | |
| query_params=_query_params, | |
| header_params=_header_params, | |
| body=_body_params, | |
| post_params=_form_params, | |
| files=_files, | |
| auth_settings=_auth_settings, | |
| collection_formats=_collection_formats, | |
| _host=_host, | |
| _request_auth=_request_auth | |
| ) | |
| @validate_call | |
| def get_dag_details( | |
| self, | |
| dag_id: StrictStr, | |
| _request_timeout: Union[ | |
| None, | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Tuple[ | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Annotated[StrictFloat, Field(gt=0)] | |
| ] | |
| ] = None, | |
| _request_auth: Optional[Dict[StrictStr, Any]] = None, | |
| _content_type: Optional[StrictStr] = None, | |
| _headers: Optional[Dict[StrictStr, Any]] = None, | |
| _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, | |
| ) -> DAGDetailsResponse: | |
| """Get Dag Details | |
| Get details of Dag. | |
| :param dag_id: (required) | |
| :type dag_id: str | |
| :param _request_timeout: timeout setting for this request. If one | |
| number provided, it will be total request | |
| timeout. It can also be a pair (tuple) of | |
| (connection, read) timeouts. | |
| :type _request_timeout: int, tuple(int, int), optional | |
| :param _request_auth: set to override the auth_settings for an a single | |
| request; this effectively ignores the | |
| authentication in the spec for a single request. | |
| :type _request_auth: dict, optional | |
| :param _content_type: force content-type for the request. | |
| :type _content_type: str, Optional | |
| :param _headers: set to override the headers for a single | |
| request; this effectively ignores the headers | |
| in the spec for a single request. | |
| :type _headers: dict, optional | |
| :param _host_index: set to override the host_index for a single | |
| request; this effectively ignores the host_index | |
| in the spec for a single request. | |
| :type _host_index: int, optional | |
| :return: Returns the result object. | |
| """ # noqa: E501 | |
| _param = self._get_dag_details_serialize( | |
| dag_id=dag_id, | |
| _request_auth=_request_auth, | |
| _content_type=_content_type, | |
| _headers=_headers, | |
| _host_index=_host_index | |
| ) | |
| _response_types_map: Dict[str, Optional[str]] = { | |
| '200': "DAGDetailsResponse", | |
| '400': "HTTPExceptionResponse", | |
| '401': "HTTPExceptionResponse", | |
| '403': "HTTPExceptionResponse", | |
| '404': "HTTPExceptionResponse", | |
| '422': "HTTPValidationError", | |
| } | |
| response_data = self.api_client.call_api( | |
| *_param, | |
| _request_timeout=_request_timeout | |
| ) | |
| response_data.read() | |
| return self.api_client.response_deserialize( | |
| response_data=response_data, | |
| response_types_map=_response_types_map, | |
| ).data | |
| @validate_call | |
| def get_dag_details_with_http_info( | |
| self, | |
| dag_id: StrictStr, | |
| _request_timeout: Union[ | |
| None, | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Tuple[ | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Annotated[StrictFloat, Field(gt=0)] | |
| ] | |
| ] = None, | |
| _request_auth: Optional[Dict[StrictStr, Any]] = None, | |
| _content_type: Optional[StrictStr] = None, | |
| _headers: Optional[Dict[StrictStr, Any]] = None, | |
| _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, | |
| ) -> ApiResponse[DAGDetailsResponse]: | |
| """Get Dag Details | |
| Get details of Dag. | |
| :param dag_id: (required) | |
| :type dag_id: str | |
| :param _request_timeout: timeout setting for this request. If one | |
| number provided, it will be total request | |
| timeout. It can also be a pair (tuple) of | |
| (connection, read) timeouts. | |
| :type _request_timeout: int, tuple(int, int), optional | |
| :param _request_auth: set to override the auth_settings for an a single | |
| request; this effectively ignores the | |
| authentication in the spec for a single request. | |
| :type _request_auth: dict, optional | |
| :param _content_type: force content-type for the request. | |
| :type _content_type: str, Optional | |
| :param _headers: set to override the headers for a single | |
| request; this effectively ignores the headers | |
| in the spec for a single request. | |
| :type _headers: dict, optional | |
| :param _host_index: set to override the host_index for a single | |
| request; this effectively ignores the host_index | |
| in the spec for a single request. | |
| :type _host_index: int, optional | |
| :return: Returns the result object. | |
| """ # noqa: E501 | |
| _param = self._get_dag_details_serialize( | |
| dag_id=dag_id, | |
| _request_auth=_request_auth, | |
| _content_type=_content_type, | |
| _headers=_headers, | |
| _host_index=_host_index | |
| ) | |
| _response_types_map: Dict[str, Optional[str]] = { | |
| '200': "DAGDetailsResponse", | |
| '400': "HTTPExceptionResponse", | |
| '401': "HTTPExceptionResponse", | |
| '403': "HTTPExceptionResponse", | |
| '404': "HTTPExceptionResponse", | |
| '422': "HTTPValidationError", | |
| } | |
| response_data = self.api_client.call_api( | |
| *_param, | |
| _request_timeout=_request_timeout | |
| ) | |
| response_data.read() | |
| return self.api_client.response_deserialize( | |
| response_data=response_data, | |
| response_types_map=_response_types_map, | |
| ) | |
| @validate_call | |
| def get_dag_details_without_preload_content( | |
| self, | |
| dag_id: StrictStr, | |
| _request_timeout: Union[ | |
| None, | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Tuple[ | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Annotated[StrictFloat, Field(gt=0)] | |
| ] | |
| ] = None, | |
| _request_auth: Optional[Dict[StrictStr, Any]] = None, | |
| _content_type: Optional[StrictStr] = None, | |
| _headers: Optional[Dict[StrictStr, Any]] = None, | |
| _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, | |
| ) -> RESTResponseType: | |
| """Get Dag Details | |
| Get details of Dag. | |
| :param dag_id: (required) | |
| :type dag_id: str | |
| :param _request_timeout: timeout setting for this request. If one | |
| number provided, it will be total request | |
| timeout. It can also be a pair (tuple) of | |
| (connection, read) timeouts. | |
| :type _request_timeout: int, tuple(int, int), optional | |
| :param _request_auth: set to override the auth_settings for an a single | |
| request; this effectively ignores the | |
| authentication in the spec for a single request. | |
| :type _request_auth: dict, optional | |
| :param _content_type: force content-type for the request. | |
| :type _content_type: str, Optional | |
| :param _headers: set to override the headers for a single | |
| request; this effectively ignores the headers | |
| in the spec for a single request. | |
| :type _headers: dict, optional | |
| :param _host_index: set to override the host_index for a single | |
| request; this effectively ignores the host_index | |
| in the spec for a single request. | |
| :type _host_index: int, optional | |
| :return: Returns the result object. | |
| """ # noqa: E501 | |
| _param = self._get_dag_details_serialize( | |
| dag_id=dag_id, | |
| _request_auth=_request_auth, | |
| _content_type=_content_type, | |
| _headers=_headers, | |
| _host_index=_host_index | |
| ) | |
| _response_types_map: Dict[str, Optional[str]] = { | |
| '200': "DAGDetailsResponse", | |
| '400': "HTTPExceptionResponse", | |
| '401': "HTTPExceptionResponse", | |
| '403': "HTTPExceptionResponse", | |
| '404': "HTTPExceptionResponse", | |
| '422': "HTTPValidationError", | |
| } | |
| response_data = self.api_client.call_api( | |
| *_param, | |
| _request_timeout=_request_timeout | |
| ) | |
| return response_data.response | |
| def _get_dag_details_serialize( | |
| self, | |
| dag_id, | |
| _request_auth, | |
| _content_type, | |
| _headers, | |
| _host_index, | |
| ) -> RequestSerialized: | |
| _host = None | |
| _collection_formats: Dict[str, str] = { | |
| } | |
| _path_params: Dict[str, str] = {} | |
| _query_params: List[Tuple[str, str]] = [] | |
| _header_params: Dict[str, Optional[str]] = _headers or {} | |
| _form_params: List[Tuple[str, str]] = [] | |
| _files: Dict[ | |
| str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] | |
| ] = {} | |
| _body_params: Optional[bytes] = None | |
| # process the path parameters | |
| if dag_id is not None: | |
| _path_params['dag_id'] = dag_id | |
| # process the query parameters | |
| # process the header parameters | |
| # process the form parameters | |
| # process the body parameter | |
| # set the HTTP header `Accept` | |
| if 'Accept' not in _header_params: | |
| _header_params['Accept'] = self.api_client.select_header_accept( | |
| [ | |
| 'application/json' | |
| ] | |
| ) | |
| # authentication setting | |
| _auth_settings: List[str] = [ | |
| 'OAuth2PasswordBearer', | |
| 'HTTPBearer' | |
| ] | |
| return self.api_client.param_serialize( | |
| method='GET', | |
| resource_path='/api/v2/dags/{dag_id}/details', | |
| path_params=_path_params, | |
| query_params=_query_params, | |
| header_params=_header_params, | |
| body=_body_params, | |
| post_params=_form_params, | |
| files=_files, | |
| auth_settings=_auth_settings, | |
| collection_formats=_collection_formats, | |
| _host=_host, | |
| _request_auth=_request_auth | |
| ) | |
| @validate_call | |
| def get_dag_tags( | |
| self, | |
| limit: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, | |
| offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, | |
| order_by: Annotated[Optional[List[StrictStr]], Field(description="Attributes to order by, multi criteria sort is supported. Prefix with `-` for descending order. Supported attributes: `name`")] = None, | |
| tag_name_pattern: Annotated[Optional[StrictStr], Field(description="Case-insensitive substring match (SQL `ILIKE`). Slower than `tag_name_prefix_pattern` on large tables — see \"Filtering with pattern parameters\".")] = None, | |
| tag_name_prefix_pattern: Annotated[Optional[StrictStr], Field(description="Case-sensitive, index-friendly prefix match. See \"Filtering with pattern parameters\".")] = None, | |
| _request_timeout: Union[ | |
| None, | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Tuple[ | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Annotated[StrictFloat, Field(gt=0)] | |
| ] | |
| ] = None, | |
| _request_auth: Optional[Dict[StrictStr, Any]] = None, | |
| _content_type: Optional[StrictStr] = None, | |
| _headers: Optional[Dict[StrictStr, Any]] = None, | |
| _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, | |
| ) -> DAGTagCollectionResponse: | |
| """Get Dag Tags | |
| Get all Dag tags. | |
| :param limit: | |
| :type limit: int | |
| :param offset: | |
| :type offset: int | |
| :param order_by: Attributes to order by, multi criteria sort is supported. Prefix with `-` for descending order. Supported attributes: `name` | |
| :type order_by: List[str] | |
| :param tag_name_pattern: Case-insensitive substring match (SQL `ILIKE`). Slower than `tag_name_prefix_pattern` on large tables — see \"Filtering with pattern parameters\". | |
| :type tag_name_pattern: str | |
| :param tag_name_prefix_pattern: Case-sensitive, index-friendly prefix match. See \"Filtering with pattern parameters\". | |
| :type tag_name_prefix_pattern: str | |
| :param _request_timeout: timeout setting for this request. If one | |
| number provided, it will be total request | |
| timeout. It can also be a pair (tuple) of | |
| (connection, read) timeouts. | |
| :type _request_timeout: int, tuple(int, int), optional | |
| :param _request_auth: set to override the auth_settings for an a single | |
| request; this effectively ignores the | |
| authentication in the spec for a single request. | |
| :type _request_auth: dict, optional | |
| :param _content_type: force content-type for the request. | |
| :type _content_type: str, Optional | |
| :param _headers: set to override the headers for a single | |
| request; this effectively ignores the headers | |
| in the spec for a single request. | |
| :type _headers: dict, optional | |
| :param _host_index: set to override the host_index for a single | |
| request; this effectively ignores the host_index | |
| in the spec for a single request. | |
| :type _host_index: int, optional | |
| :return: Returns the result object. | |
| """ # noqa: E501 | |
| _param = self._get_dag_tags_serialize( | |
| limit=limit, | |
| offset=offset, | |
| order_by=order_by, | |
| tag_name_pattern=tag_name_pattern, | |
| tag_name_prefix_pattern=tag_name_prefix_pattern, | |
| _request_auth=_request_auth, | |
| _content_type=_content_type, | |
| _headers=_headers, | |
| _host_index=_host_index | |
| ) | |
| _response_types_map: Dict[str, Optional[str]] = { | |
| '200': "DAGTagCollectionResponse", | |
| '401': "HTTPExceptionResponse", | |
| '403': "HTTPExceptionResponse", | |
| '422': "HTTPValidationError", | |
| } | |
| response_data = self.api_client.call_api( | |
| *_param, | |
| _request_timeout=_request_timeout | |
| ) | |
| response_data.read() | |
| return self.api_client.response_deserialize( | |
| response_data=response_data, | |
| response_types_map=_response_types_map, | |
| ).data | |
| @validate_call | |
| def get_dag_tags_with_http_info( | |
| self, | |
| limit: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, | |
| offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, | |
| order_by: Annotated[Optional[List[StrictStr]], Field(description="Attributes to order by, multi criteria sort is supported. Prefix with `-` for descending order. Supported attributes: `name`")] = None, | |
| tag_name_pattern: Annotated[Optional[StrictStr], Field(description="Case-insensitive substring match (SQL `ILIKE`). Slower than `tag_name_prefix_pattern` on large tables — see \"Filtering with pattern parameters\".")] = None, | |
| tag_name_prefix_pattern: Annotated[Optional[StrictStr], Field(description="Case-sensitive, index-friendly prefix match. See \"Filtering with pattern parameters\".")] = None, | |
| _request_timeout: Union[ | |
| None, | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Tuple[ | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Annotated[StrictFloat, Field(gt=0)] | |
| ] | |
| ] = None, | |
| _request_auth: Optional[Dict[StrictStr, Any]] = None, | |
| _content_type: Optional[StrictStr] = None, | |
| _headers: Optional[Dict[StrictStr, Any]] = None, | |
| _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, | |
| ) -> ApiResponse[DAGTagCollectionResponse]: | |
| """Get Dag Tags | |
| Get all Dag tags. | |
| :param limit: | |
| :type limit: int | |
| :param offset: | |
| :type offset: int | |
| :param order_by: Attributes to order by, multi criteria sort is supported. Prefix with `-` for descending order. Supported attributes: `name` | |
| :type order_by: List[str] | |
| :param tag_name_pattern: Case-insensitive substring match (SQL `ILIKE`). Slower than `tag_name_prefix_pattern` on large tables — see \"Filtering with pattern parameters\". | |
| :type tag_name_pattern: str | |
| :param tag_name_prefix_pattern: Case-sensitive, index-friendly prefix match. See \"Filtering with pattern parameters\". | |
| :type tag_name_prefix_pattern: str | |
| :param _request_timeout: timeout setting for this request. If one | |
| number provided, it will be total request | |
| timeout. It can also be a pair (tuple) of | |
| (connection, read) timeouts. | |
| :type _request_timeout: int, tuple(int, int), optional | |
| :param _request_auth: set to override the auth_settings for an a single | |
| request; this effectively ignores the | |
| authentication in the spec for a single request. | |
| :type _request_auth: dict, optional | |
| :param _content_type: force content-type for the request. | |
| :type _content_type: str, Optional | |
| :param _headers: set to override the headers for a single | |
| request; this effectively ignores the headers | |
| in the spec for a single request. | |
| :type _headers: dict, optional | |
| :param _host_index: set to override the host_index for a single | |
| request; this effectively ignores the host_index | |
| in the spec for a single request. | |
| :type _host_index: int, optional | |
| :return: Returns the result object. | |
| """ # noqa: E501 | |
| _param = self._get_dag_tags_serialize( | |
| limit=limit, | |
| offset=offset, | |
| order_by=order_by, | |
| tag_name_pattern=tag_name_pattern, | |
| tag_name_prefix_pattern=tag_name_prefix_pattern, | |
| _request_auth=_request_auth, | |
| _content_type=_content_type, | |
| _headers=_headers, | |
| _host_index=_host_index | |
| ) | |
| _response_types_map: Dict[str, Optional[str]] = { | |
| '200': "DAGTagCollectionResponse", | |
| '401': "HTTPExceptionResponse", | |
| '403': "HTTPExceptionResponse", | |
| '422': "HTTPValidationError", | |
| } | |
| response_data = self.api_client.call_api( | |
| *_param, | |
| _request_timeout=_request_timeout | |
| ) | |
| response_data.read() | |
| return self.api_client.response_deserialize( | |
| response_data=response_data, | |
| response_types_map=_response_types_map, | |
| ) | |
| @validate_call | |
| def get_dag_tags_without_preload_content( | |
| self, | |
| limit: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, | |
| offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, | |
| order_by: Annotated[Optional[List[StrictStr]], Field(description="Attributes to order by, multi criteria sort is supported. Prefix with `-` for descending order. Supported attributes: `name`")] = None, | |
| tag_name_pattern: Annotated[Optional[StrictStr], Field(description="Case-insensitive substring match (SQL `ILIKE`). Slower than `tag_name_prefix_pattern` on large tables — see \"Filtering with pattern parameters\".")] = None, | |
| tag_name_prefix_pattern: Annotated[Optional[StrictStr], Field(description="Case-sensitive, index-friendly prefix match. See \"Filtering with pattern parameters\".")] = None, | |
| _request_timeout: Union[ | |
| None, | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Tuple[ | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Annotated[StrictFloat, Field(gt=0)] | |
| ] | |
| ] = None, | |
| _request_auth: Optional[Dict[StrictStr, Any]] = None, | |
| _content_type: Optional[StrictStr] = None, | |
| _headers: Optional[Dict[StrictStr, Any]] = None, | |
| _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, | |
| ) -> RESTResponseType: | |
| """Get Dag Tags | |
| Get all Dag tags. | |
| :param limit: | |
| :type limit: int | |
| :param offset: | |
| :type offset: int | |
| :param order_by: Attributes to order by, multi criteria sort is supported. Prefix with `-` for descending order. Supported attributes: `name` | |
| :type order_by: List[str] | |
| :param tag_name_pattern: Case-insensitive substring match (SQL `ILIKE`). Slower than `tag_name_prefix_pattern` on large tables — see \"Filtering with pattern parameters\". | |
| :type tag_name_pattern: str | |
| :param tag_name_prefix_pattern: Case-sensitive, index-friendly prefix match. See \"Filtering with pattern parameters\". | |
| :type tag_name_prefix_pattern: str | |
| :param _request_timeout: timeout setting for this request. If one | |
| number provided, it will be total request | |
| timeout. It can also be a pair (tuple) of | |
| (connection, read) timeouts. | |
| :type _request_timeout: int, tuple(int, int), optional | |
| :param _request_auth: set to override the auth_settings for an a single | |
| request; this effectively ignores the | |
| authentication in the spec for a single request. | |
| :type _request_auth: dict, optional | |
| :param _content_type: force content-type for the request. | |
| :type _content_type: str, Optional | |
| :param _headers: set to override the headers for a single | |
| request; this effectively ignores the headers | |
| in the spec for a single request. | |
| :type _headers: dict, optional | |
| :param _host_index: set to override the host_index for a single | |
| request; this effectively ignores the host_index | |
| in the spec for a single request. | |
| :type _host_index: int, optional | |
| :return: Returns the result object. | |
| """ # noqa: E501 | |
| _param = self._get_dag_tags_serialize( | |
| limit=limit, | |
| offset=offset, | |
| order_by=order_by, | |
| tag_name_pattern=tag_name_pattern, | |
| tag_name_prefix_pattern=tag_name_prefix_pattern, | |
| _request_auth=_request_auth, | |
| _content_type=_content_type, | |
| _headers=_headers, | |
| _host_index=_host_index | |
| ) | |
| _response_types_map: Dict[str, Optional[str]] = { | |
| '200': "DAGTagCollectionResponse", | |
| '401': "HTTPExceptionResponse", | |
| '403': "HTTPExceptionResponse", | |
| '422': "HTTPValidationError", | |
| } | |
| response_data = self.api_client.call_api( | |
| *_param, | |
| _request_timeout=_request_timeout | |
| ) | |
| return response_data.response | |
| def _get_dag_tags_serialize( | |
| self, | |
| limit, | |
| offset, | |
| order_by, | |
| tag_name_pattern, | |
| tag_name_prefix_pattern, | |
| _request_auth, | |
| _content_type, | |
| _headers, | |
| _host_index, | |
| ) -> RequestSerialized: | |
| _host = None | |
| _collection_formats: Dict[str, str] = { | |
| 'order_by': 'multi', | |
| } | |
| _path_params: Dict[str, str] = {} | |
| _query_params: List[Tuple[str, str]] = [] | |
| _header_params: Dict[str, Optional[str]] = _headers or {} | |
| _form_params: List[Tuple[str, str]] = [] | |
| _files: Dict[ | |
| str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] | |
| ] = {} | |
| _body_params: Optional[bytes] = None | |
| # process the path parameters | |
| # process the query parameters | |
| if limit is not None: | |
| _query_params.append(('limit', limit)) | |
| if offset is not None: | |
| _query_params.append(('offset', offset)) | |
| if order_by is not None: | |
| _query_params.append(('order_by', order_by)) | |
| if tag_name_pattern is not None: | |
| _query_params.append(('tag_name_pattern', tag_name_pattern)) | |
| if tag_name_prefix_pattern is not None: | |
| _query_params.append(('tag_name_prefix_pattern', tag_name_prefix_pattern)) | |
| # process the header parameters | |
| # process the form parameters | |
| # process the body parameter | |
| # set the HTTP header `Accept` | |
| if 'Accept' not in _header_params: | |
| _header_params['Accept'] = self.api_client.select_header_accept( | |
| [ | |
| 'application/json' | |
| ] | |
| ) | |
| # authentication setting | |
| _auth_settings: List[str] = [ | |
| 'OAuth2PasswordBearer', | |
| 'HTTPBearer' | |
| ] | |
| return self.api_client.param_serialize( | |
| method='GET', | |
| resource_path='/api/v2/dagTags', | |
| path_params=_path_params, | |
| query_params=_query_params, | |
| header_params=_header_params, | |
| body=_body_params, | |
| post_params=_form_params, | |
| files=_files, | |
| auth_settings=_auth_settings, | |
| collection_formats=_collection_formats, | |
| _host=_host, | |
| _request_auth=_request_auth | |
| ) | |
| @validate_call | |
| def get_dags( | |
| self, | |
| limit: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, | |
| offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, | |
| tags: Optional[List[StrictStr]] = None, | |
| tags_match_mode: Optional[StrictStr] = None, | |
| owners: Optional[List[StrictStr]] = None, | |
| dag_id_pattern: Annotated[Optional[StrictStr], Field(description="Case-insensitive substring match (SQL `ILIKE`). Slower than `dag_id_prefix_pattern` on large tables — see \"Filtering with pattern parameters\".")] = None, | |
| dag_id_prefix_pattern: Annotated[Optional[StrictStr], Field(description="Case-sensitive, index-friendly prefix match. See \"Filtering with pattern parameters\".")] = None, | |
| dag_display_name_pattern: Annotated[Optional[StrictStr], Field(description="Case-insensitive substring match (SQL `ILIKE`). Slower than `dag_display_name_prefix_pattern` on large tables — see \"Filtering with pattern parameters\".")] = None, | |
| dag_display_name_prefix_pattern: Annotated[Optional[StrictStr], Field(description="Case-sensitive, index-friendly prefix match. See \"Filtering with pattern parameters\".")] = None, | |
| exclude_stale: Optional[StrictBool] = None, | |
| paused: Optional[StrictBool] = None, | |
| has_import_errors: Annotated[Optional[StrictBool], Field(description="Filter Dags by having import errors. Only Dags that have been successfully loaded before will be returned.")] = None, | |
| last_dag_run_state: Optional[Any] = None, | |
| bundle_name: Optional[StrictStr] = None, | |
| bundle_version: Optional[StrictStr] = None, | |
| has_asset_schedule: Annotated[Optional[StrictBool], Field(description="Filter Dags with asset-based scheduling")] = None, | |
| asset_dependency: Annotated[Optional[StrictStr], Field(description="Filter Dags by asset dependency (name or URI)")] = None, | |
| dag_run_start_date_gte: Optional[datetime] = None, | |
| dag_run_start_date_gt: Optional[datetime] = None, | |
| dag_run_start_date_lte: Optional[datetime] = None, | |
| dag_run_start_date_lt: Optional[datetime] = None, | |
| dag_run_end_date_gte: Optional[datetime] = None, | |
| dag_run_end_date_gt: Optional[datetime] = None, | |
| dag_run_end_date_lte: Optional[datetime] = None, | |
| dag_run_end_date_lt: Optional[datetime] = None, | |
| dag_run_state: Optional[List[StrictStr]] = None, | |
| order_by: Annotated[Optional[List[StrictStr]], Field(description="Attributes to order by, multi criteria sort is supported. Prefix with `-` for descending order. Supported attributes: `dag_id, dag_display_name, next_dagrun, state, start_date, last_run_state, last_run_start_date`")] = None, | |
| is_favorite: Optional[StrictBool] = None, | |
| timetable_type: Optional[List[StrictStr]] = None, | |
| _request_timeout: Union[ | |
| None, | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Tuple[ | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Annotated[StrictFloat, Field(gt=0)] | |
| ] | |
| ] = None, | |
| _request_auth: Optional[Dict[StrictStr, Any]] = None, | |
| _content_type: Optional[StrictStr] = None, | |
| _headers: Optional[Dict[StrictStr, Any]] = None, | |
| _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, | |
| ) -> DAGCollectionResponse: | |
| """Get Dags | |
| Get all Dags. | |
| :param limit: | |
| :type limit: int | |
| :param offset: | |
| :type offset: int | |
| :param tags: | |
| :type tags: List[str] | |
| :param tags_match_mode: | |
| :type tags_match_mode: str | |
| :param owners: | |
| :type owners: List[str] | |
| :param dag_id_pattern: Case-insensitive substring match (SQL `ILIKE`). Slower than `dag_id_prefix_pattern` on large tables — see \"Filtering with pattern parameters\". | |
| :type dag_id_pattern: str | |
| :param dag_id_prefix_pattern: Case-sensitive, index-friendly prefix match. See \"Filtering with pattern parameters\". | |
| :type dag_id_prefix_pattern: str | |
| :param dag_display_name_pattern: Case-insensitive substring match (SQL `ILIKE`). Slower than `dag_display_name_prefix_pattern` on large tables — see \"Filtering with pattern parameters\". | |
| :type dag_display_name_pattern: str | |
| :param dag_display_name_prefix_pattern: Case-sensitive, index-friendly prefix match. See \"Filtering with pattern parameters\". | |
| :type dag_display_name_prefix_pattern: str | |
| :param exclude_stale: | |
| :type exclude_stale: bool | |
| :param paused: | |
| :type paused: bool | |
| :param has_import_errors: Filter Dags by having import errors. Only Dags that have been successfully loaded before will be returned. | |
| :type has_import_errors: bool | |
| :param last_dag_run_state: | |
| :type last_dag_run_state: DagRunState | |
| :param bundle_name: | |
| :type bundle_name: str | |
| :param bundle_version: | |
| :type bundle_version: str | |
| :param has_asset_schedule: Filter Dags with asset-based scheduling | |
| :type has_asset_schedule: bool | |
| :param asset_dependency: Filter Dags by asset dependency (name or URI) | |
| :type asset_dependency: str | |
| :param dag_run_start_date_gte: | |
| :type dag_run_start_date_gte: datetime | |
| :param dag_run_start_date_gt: | |
| :type dag_run_start_date_gt: datetime | |
| :param dag_run_start_date_lte: | |
| :type dag_run_start_date_lte: datetime | |
| :param dag_run_start_date_lt: | |
| :type dag_run_start_date_lt: datetime | |
| :param dag_run_end_date_gte: | |
| :type dag_run_end_date_gte: datetime | |
| :param dag_run_end_date_gt: | |
| :type dag_run_end_date_gt: datetime | |
| :param dag_run_end_date_lte: | |
| :type dag_run_end_date_lte: datetime | |
| :param dag_run_end_date_lt: | |
| :type dag_run_end_date_lt: datetime | |
| :param dag_run_state: | |
| :type dag_run_state: List[str] | |
| :param order_by: Attributes to order by, multi criteria sort is supported. Prefix with `-` for descending order. Supported attributes: `dag_id, dag_display_name, next_dagrun, state, start_date, last_run_state, last_run_start_date` | |
| :type order_by: List[str] | |
| :param is_favorite: | |
| :type is_favorite: bool | |
| :param timetable_type: | |
| :type timetable_type: List[str] | |
| :param _request_timeout: timeout setting for this request. If one | |
| number provided, it will be total request | |
| timeout. It can also be a pair (tuple) of | |
| (connection, read) timeouts. | |
| :type _request_timeout: int, tuple(int, int), optional | |
| :param _request_auth: set to override the auth_settings for an a single | |
| request; this effectively ignores the | |
| authentication in the spec for a single request. | |
| :type _request_auth: dict, optional | |
| :param _content_type: force content-type for the request. | |
| :type _content_type: str, Optional | |
| :param _headers: set to override the headers for a single | |
| request; this effectively ignores the headers | |
| in the spec for a single request. | |
| :type _headers: dict, optional | |
| :param _host_index: set to override the host_index for a single | |
| request; this effectively ignores the host_index | |
| in the spec for a single request. | |
| :type _host_index: int, optional | |
| :return: Returns the result object. | |
| """ # noqa: E501 | |
| _param = self._get_dags_serialize( | |
| limit=limit, | |
| offset=offset, | |
| tags=tags, | |
| tags_match_mode=tags_match_mode, | |
| owners=owners, | |
| dag_id_pattern=dag_id_pattern, | |
| dag_id_prefix_pattern=dag_id_prefix_pattern, | |
| dag_display_name_pattern=dag_display_name_pattern, | |
| dag_display_name_prefix_pattern=dag_display_name_prefix_pattern, | |
| exclude_stale=exclude_stale, | |
| paused=paused, | |
| has_import_errors=has_import_errors, | |
| last_dag_run_state=last_dag_run_state, | |
| bundle_name=bundle_name, | |
| bundle_version=bundle_version, | |
| has_asset_schedule=has_asset_schedule, | |
| asset_dependency=asset_dependency, | |
| dag_run_start_date_gte=dag_run_start_date_gte, | |
| dag_run_start_date_gt=dag_run_start_date_gt, | |
| dag_run_start_date_lte=dag_run_start_date_lte, | |
| dag_run_start_date_lt=dag_run_start_date_lt, | |
| dag_run_end_date_gte=dag_run_end_date_gte, | |
| dag_run_end_date_gt=dag_run_end_date_gt, | |
| dag_run_end_date_lte=dag_run_end_date_lte, | |
| dag_run_end_date_lt=dag_run_end_date_lt, | |
| dag_run_state=dag_run_state, | |
| order_by=order_by, | |
| is_favorite=is_favorite, | |
| timetable_type=timetable_type, | |
| _request_auth=_request_auth, | |
| _content_type=_content_type, | |
| _headers=_headers, | |
| _host_index=_host_index | |
| ) | |
| _response_types_map: Dict[str, Optional[str]] = { | |
| '200': "DAGCollectionResponse", | |
| '401': "HTTPExceptionResponse", | |
| '403': "HTTPExceptionResponse", | |
| '422': "HTTPValidationError", | |
| } | |
| response_data = self.api_client.call_api( | |
| *_param, | |
| _request_timeout=_request_timeout | |
| ) | |
| response_data.read() | |
| return self.api_client.response_deserialize( | |
| response_data=response_data, | |
| response_types_map=_response_types_map, | |
| ).data | |
| @validate_call | |
| def get_dags_with_http_info( | |
| self, | |
| limit: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, | |
| offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, | |
| tags: Optional[List[StrictStr]] = None, | |
| tags_match_mode: Optional[StrictStr] = None, | |
| owners: Optional[List[StrictStr]] = None, | |
| dag_id_pattern: Annotated[Optional[StrictStr], Field(description="Case-insensitive substring match (SQL `ILIKE`). Slower than `dag_id_prefix_pattern` on large tables — see \"Filtering with pattern parameters\".")] = None, | |
| dag_id_prefix_pattern: Annotated[Optional[StrictStr], Field(description="Case-sensitive, index-friendly prefix match. See \"Filtering with pattern parameters\".")] = None, | |
| dag_display_name_pattern: Annotated[Optional[StrictStr], Field(description="Case-insensitive substring match (SQL `ILIKE`). Slower than `dag_display_name_prefix_pattern` on large tables — see \"Filtering with pattern parameters\".")] = None, | |
| dag_display_name_prefix_pattern: Annotated[Optional[StrictStr], Field(description="Case-sensitive, index-friendly prefix match. See \"Filtering with pattern parameters\".")] = None, | |
| exclude_stale: Optional[StrictBool] = None, | |
| paused: Optional[StrictBool] = None, | |
| has_import_errors: Annotated[Optional[StrictBool], Field(description="Filter Dags by having import errors. Only Dags that have been successfully loaded before will be returned.")] = None, | |
| last_dag_run_state: Optional[Any] = None, | |
| bundle_name: Optional[StrictStr] = None, | |
| bundle_version: Optional[StrictStr] = None, | |
| has_asset_schedule: Annotated[Optional[StrictBool], Field(description="Filter Dags with asset-based scheduling")] = None, | |
| asset_dependency: Annotated[Optional[StrictStr], Field(description="Filter Dags by asset dependency (name or URI)")] = None, | |
| dag_run_start_date_gte: Optional[datetime] = None, | |
| dag_run_start_date_gt: Optional[datetime] = None, | |
| dag_run_start_date_lte: Optional[datetime] = None, | |
| dag_run_start_date_lt: Optional[datetime] = None, | |
| dag_run_end_date_gte: Optional[datetime] = None, | |
| dag_run_end_date_gt: Optional[datetime] = None, | |
| dag_run_end_date_lte: Optional[datetime] = None, | |
| dag_run_end_date_lt: Optional[datetime] = None, | |
| dag_run_state: Optional[List[StrictStr]] = None, | |
| order_by: Annotated[Optional[List[StrictStr]], Field(description="Attributes to order by, multi criteria sort is supported. Prefix with `-` for descending order. Supported attributes: `dag_id, dag_display_name, next_dagrun, state, start_date, last_run_state, last_run_start_date`")] = None, | |
| is_favorite: Optional[StrictBool] = None, | |
| timetable_type: Optional[List[StrictStr]] = None, | |
| _request_timeout: Union[ | |
| None, | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Tuple[ | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Annotated[StrictFloat, Field(gt=0)] | |
| ] | |
| ] = None, | |
| _request_auth: Optional[Dict[StrictStr, Any]] = None, | |
| _content_type: Optional[StrictStr] = None, | |
| _headers: Optional[Dict[StrictStr, Any]] = None, | |
| _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, | |
| ) -> ApiResponse[DAGCollectionResponse]: | |
| """Get Dags | |
| Get all Dags. | |
| :param limit: | |
| :type limit: int | |
| :param offset: | |
| :type offset: int | |
| :param tags: | |
| :type tags: List[str] | |
| :param tags_match_mode: | |
| :type tags_match_mode: str | |
| :param owners: | |
| :type owners: List[str] | |
| :param dag_id_pattern: Case-insensitive substring match (SQL `ILIKE`). Slower than `dag_id_prefix_pattern` on large tables — see \"Filtering with pattern parameters\". | |
| :type dag_id_pattern: str | |
| :param dag_id_prefix_pattern: Case-sensitive, index-friendly prefix match. See \"Filtering with pattern parameters\". | |
| :type dag_id_prefix_pattern: str | |
| :param dag_display_name_pattern: Case-insensitive substring match (SQL `ILIKE`). Slower than `dag_display_name_prefix_pattern` on large tables — see \"Filtering with pattern parameters\". | |
| :type dag_display_name_pattern: str | |
| :param dag_display_name_prefix_pattern: Case-sensitive, index-friendly prefix match. See \"Filtering with pattern parameters\". | |
| :type dag_display_name_prefix_pattern: str | |
| :param exclude_stale: | |
| :type exclude_stale: bool | |
| :param paused: | |
| :type paused: bool | |
| :param has_import_errors: Filter Dags by having import errors. Only Dags that have been successfully loaded before will be returned. | |
| :type has_import_errors: bool | |
| :param last_dag_run_state: | |
| :type last_dag_run_state: DagRunState | |
| :param bundle_name: | |
| :type bundle_name: str | |
| :param bundle_version: | |
| :type bundle_version: str | |
| :param has_asset_schedule: Filter Dags with asset-based scheduling | |
| :type has_asset_schedule: bool | |
| :param asset_dependency: Filter Dags by asset dependency (name or URI) | |
| :type asset_dependency: str | |
| :param dag_run_start_date_gte: | |
| :type dag_run_start_date_gte: datetime | |
| :param dag_run_start_date_gt: | |
| :type dag_run_start_date_gt: datetime | |
| :param dag_run_start_date_lte: | |
| :type dag_run_start_date_lte: datetime | |
| :param dag_run_start_date_lt: | |
| :type dag_run_start_date_lt: datetime | |
| :param dag_run_end_date_gte: | |
| :type dag_run_end_date_gte: datetime | |
| :param dag_run_end_date_gt: | |
| :type dag_run_end_date_gt: datetime | |
| :param dag_run_end_date_lte: | |
| :type dag_run_end_date_lte: datetime | |
| :param dag_run_end_date_lt: | |
| :type dag_run_end_date_lt: datetime | |
| :param dag_run_state: | |
| :type dag_run_state: List[str] | |
| :param order_by: Attributes to order by, multi criteria sort is supported. Prefix with `-` for descending order. Supported attributes: `dag_id, dag_display_name, next_dagrun, state, start_date, last_run_state, last_run_start_date` | |
| :type order_by: List[str] | |
| :param is_favorite: | |
| :type is_favorite: bool | |
| :param timetable_type: | |
| :type timetable_type: List[str] | |
| :param _request_timeout: timeout setting for this request. If one | |
| number provided, it will be total request | |
| timeout. It can also be a pair (tuple) of | |
| (connection, read) timeouts. | |
| :type _request_timeout: int, tuple(int, int), optional | |
| :param _request_auth: set to override the auth_settings for an a single | |
| request; this effectively ignores the | |
| authentication in the spec for a single request. | |
| :type _request_auth: dict, optional | |
| :param _content_type: force content-type for the request. | |
| :type _content_type: str, Optional | |
| :param _headers: set to override the headers for a single | |
| request; this effectively ignores the headers | |
| in the spec for a single request. | |
| :type _headers: dict, optional | |
| :param _host_index: set to override the host_index for a single | |
| request; this effectively ignores the host_index | |
| in the spec for a single request. | |
| :type _host_index: int, optional | |
| :return: Returns the result object. | |
| """ # noqa: E501 | |
| _param = self._get_dags_serialize( | |
| limit=limit, | |
| offset=offset, | |
| tags=tags, | |
| tags_match_mode=tags_match_mode, | |
| owners=owners, | |
| dag_id_pattern=dag_id_pattern, | |
| dag_id_prefix_pattern=dag_id_prefix_pattern, | |
| dag_display_name_pattern=dag_display_name_pattern, | |
| dag_display_name_prefix_pattern=dag_display_name_prefix_pattern, | |
| exclude_stale=exclude_stale, | |
| paused=paused, | |
| has_import_errors=has_import_errors, | |
| last_dag_run_state=last_dag_run_state, | |
| bundle_name=bundle_name, | |
| bundle_version=bundle_version, | |
| has_asset_schedule=has_asset_schedule, | |
| asset_dependency=asset_dependency, | |
| dag_run_start_date_gte=dag_run_start_date_gte, | |
| dag_run_start_date_gt=dag_run_start_date_gt, | |
| dag_run_start_date_lte=dag_run_start_date_lte, | |
| dag_run_start_date_lt=dag_run_start_date_lt, | |
| dag_run_end_date_gte=dag_run_end_date_gte, | |
| dag_run_end_date_gt=dag_run_end_date_gt, | |
| dag_run_end_date_lte=dag_run_end_date_lte, | |
| dag_run_end_date_lt=dag_run_end_date_lt, | |
| dag_run_state=dag_run_state, | |
| order_by=order_by, | |
| is_favorite=is_favorite, | |
| timetable_type=timetable_type, | |
| _request_auth=_request_auth, | |
| _content_type=_content_type, | |
| _headers=_headers, | |
| _host_index=_host_index | |
| ) | |
| _response_types_map: Dict[str, Optional[str]] = { | |
| '200': "DAGCollectionResponse", | |
| '401': "HTTPExceptionResponse", | |
| '403': "HTTPExceptionResponse", | |
| '422': "HTTPValidationError", | |
| } | |
| response_data = self.api_client.call_api( | |
| *_param, | |
| _request_timeout=_request_timeout | |
| ) | |
| response_data.read() | |
| return self.api_client.response_deserialize( | |
| response_data=response_data, | |
| response_types_map=_response_types_map, | |
| ) | |
| @validate_call | |
| def get_dags_without_preload_content( | |
| self, | |
| limit: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, | |
| offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, | |
| tags: Optional[List[StrictStr]] = None, | |
| tags_match_mode: Optional[StrictStr] = None, | |
| owners: Optional[List[StrictStr]] = None, | |
| dag_id_pattern: Annotated[Optional[StrictStr], Field(description="Case-insensitive substring match (SQL `ILIKE`). Slower than `dag_id_prefix_pattern` on large tables — see \"Filtering with pattern parameters\".")] = None, | |
| dag_id_prefix_pattern: Annotated[Optional[StrictStr], Field(description="Case-sensitive, index-friendly prefix match. See \"Filtering with pattern parameters\".")] = None, | |
| dag_display_name_pattern: Annotated[Optional[StrictStr], Field(description="Case-insensitive substring match (SQL `ILIKE`). Slower than `dag_display_name_prefix_pattern` on large tables — see \"Filtering with pattern parameters\".")] = None, | |
| dag_display_name_prefix_pattern: Annotated[Optional[StrictStr], Field(description="Case-sensitive, index-friendly prefix match. See \"Filtering with pattern parameters\".")] = None, | |
| exclude_stale: Optional[StrictBool] = None, | |
| paused: Optional[StrictBool] = None, | |
| has_import_errors: Annotated[Optional[StrictBool], Field(description="Filter Dags by having import errors. Only Dags that have been successfully loaded before will be returned.")] = None, | |
| last_dag_run_state: Optional[Any] = None, | |
| bundle_name: Optional[StrictStr] = None, | |
| bundle_version: Optional[StrictStr] = None, | |
| has_asset_schedule: Annotated[Optional[StrictBool], Field(description="Filter Dags with asset-based scheduling")] = None, | |
| asset_dependency: Annotated[Optional[StrictStr], Field(description="Filter Dags by asset dependency (name or URI)")] = None, | |
| dag_run_start_date_gte: Optional[datetime] = None, | |
| dag_run_start_date_gt: Optional[datetime] = None, | |
| dag_run_start_date_lte: Optional[datetime] = None, | |
| dag_run_start_date_lt: Optional[datetime] = None, | |
| dag_run_end_date_gte: Optional[datetime] = None, | |
| dag_run_end_date_gt: Optional[datetime] = None, | |
| dag_run_end_date_lte: Optional[datetime] = None, | |
| dag_run_end_date_lt: Optional[datetime] = None, | |
| dag_run_state: Optional[List[StrictStr]] = None, | |
| order_by: Annotated[Optional[List[StrictStr]], Field(description="Attributes to order by, multi criteria sort is supported. Prefix with `-` for descending order. Supported attributes: `dag_id, dag_display_name, next_dagrun, state, start_date, last_run_state, last_run_start_date`")] = None, | |
| is_favorite: Optional[StrictBool] = None, | |
| timetable_type: Optional[List[StrictStr]] = None, | |
| _request_timeout: Union[ | |
| None, | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Tuple[ | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Annotated[StrictFloat, Field(gt=0)] | |
| ] | |
| ] = None, | |
| _request_auth: Optional[Dict[StrictStr, Any]] = None, | |
| _content_type: Optional[StrictStr] = None, | |
| _headers: Optional[Dict[StrictStr, Any]] = None, | |
| _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, | |
| ) -> RESTResponseType: | |
| """Get Dags | |
| Get all Dags. | |
| :param limit: | |
| :type limit: int | |
| :param offset: | |
| :type offset: int | |
| :param tags: | |
| :type tags: List[str] | |
| :param tags_match_mode: | |
| :type tags_match_mode: str | |
| :param owners: | |
| :type owners: List[str] | |
| :param dag_id_pattern: Case-insensitive substring match (SQL `ILIKE`). Slower than `dag_id_prefix_pattern` on large tables — see \"Filtering with pattern parameters\". | |
| :type dag_id_pattern: str | |
| :param dag_id_prefix_pattern: Case-sensitive, index-friendly prefix match. See \"Filtering with pattern parameters\". | |
| :type dag_id_prefix_pattern: str | |
| :param dag_display_name_pattern: Case-insensitive substring match (SQL `ILIKE`). Slower than `dag_display_name_prefix_pattern` on large tables — see \"Filtering with pattern parameters\". | |
| :type dag_display_name_pattern: str | |
| :param dag_display_name_prefix_pattern: Case-sensitive, index-friendly prefix match. See \"Filtering with pattern parameters\". | |
| :type dag_display_name_prefix_pattern: str | |
| :param exclude_stale: | |
| :type exclude_stale: bool | |
| :param paused: | |
| :type paused: bool | |
| :param has_import_errors: Filter Dags by having import errors. Only Dags that have been successfully loaded before will be returned. | |
| :type has_import_errors: bool | |
| :param last_dag_run_state: | |
| :type last_dag_run_state: DagRunState | |
| :param bundle_name: | |
| :type bundle_name: str | |
| :param bundle_version: | |
| :type bundle_version: str | |
| :param has_asset_schedule: Filter Dags with asset-based scheduling | |
| :type has_asset_schedule: bool | |
| :param asset_dependency: Filter Dags by asset dependency (name or URI) | |
| :type asset_dependency: str | |
| :param dag_run_start_date_gte: | |
| :type dag_run_start_date_gte: datetime | |
| :param dag_run_start_date_gt: | |
| :type dag_run_start_date_gt: datetime | |
| :param dag_run_start_date_lte: | |
| :type dag_run_start_date_lte: datetime | |
| :param dag_run_start_date_lt: | |
| :type dag_run_start_date_lt: datetime | |
| :param dag_run_end_date_gte: | |
| :type dag_run_end_date_gte: datetime | |
| :param dag_run_end_date_gt: | |
| :type dag_run_end_date_gt: datetime | |
| :param dag_run_end_date_lte: | |
| :type dag_run_end_date_lte: datetime | |
| :param dag_run_end_date_lt: | |
| :type dag_run_end_date_lt: datetime | |
| :param dag_run_state: | |
| :type dag_run_state: List[str] | |
| :param order_by: Attributes to order by, multi criteria sort is supported. Prefix with `-` for descending order. Supported attributes: `dag_id, dag_display_name, next_dagrun, state, start_date, last_run_state, last_run_start_date` | |
| :type order_by: List[str] | |
| :param is_favorite: | |
| :type is_favorite: bool | |
| :param timetable_type: | |
| :type timetable_type: List[str] | |
| :param _request_timeout: timeout setting for this request. If one | |
| number provided, it will be total request | |
| timeout. It can also be a pair (tuple) of | |
| (connection, read) timeouts. | |
| :type _request_timeout: int, tuple(int, int), optional | |
| :param _request_auth: set to override the auth_settings for an a single | |
| request; this effectively ignores the | |
| authentication in the spec for a single request. | |
| :type _request_auth: dict, optional | |
| :param _content_type: force content-type for the request. | |
| :type _content_type: str, Optional | |
| :param _headers: set to override the headers for a single | |
| request; this effectively ignores the headers | |
| in the spec for a single request. | |
| :type _headers: dict, optional | |
| :param _host_index: set to override the host_index for a single | |
| request; this effectively ignores the host_index | |
| in the spec for a single request. | |
| :type _host_index: int, optional | |
| :return: Returns the result object. | |
| """ # noqa: E501 | |
| _param = self._get_dags_serialize( | |
| limit=limit, | |
| offset=offset, | |
| tags=tags, | |
| tags_match_mode=tags_match_mode, | |
| owners=owners, | |
| dag_id_pattern=dag_id_pattern, | |
| dag_id_prefix_pattern=dag_id_prefix_pattern, | |
| dag_display_name_pattern=dag_display_name_pattern, | |
| dag_display_name_prefix_pattern=dag_display_name_prefix_pattern, | |
| exclude_stale=exclude_stale, | |
| paused=paused, | |
| has_import_errors=has_import_errors, | |
| last_dag_run_state=last_dag_run_state, | |
| bundle_name=bundle_name, | |
| bundle_version=bundle_version, | |
| has_asset_schedule=has_asset_schedule, | |
| asset_dependency=asset_dependency, | |
| dag_run_start_date_gte=dag_run_start_date_gte, | |
| dag_run_start_date_gt=dag_run_start_date_gt, | |
| dag_run_start_date_lte=dag_run_start_date_lte, | |
| dag_run_start_date_lt=dag_run_start_date_lt, | |
| dag_run_end_date_gte=dag_run_end_date_gte, | |
| dag_run_end_date_gt=dag_run_end_date_gt, | |
| dag_run_end_date_lte=dag_run_end_date_lte, | |
| dag_run_end_date_lt=dag_run_end_date_lt, | |
| dag_run_state=dag_run_state, | |
| order_by=order_by, | |
| is_favorite=is_favorite, | |
| timetable_type=timetable_type, | |
| _request_auth=_request_auth, | |
| _content_type=_content_type, | |
| _headers=_headers, | |
| _host_index=_host_index | |
| ) | |
| _response_types_map: Dict[str, Optional[str]] = { | |
| '200': "DAGCollectionResponse", | |
| '401': "HTTPExceptionResponse", | |
| '403': "HTTPExceptionResponse", | |
| '422': "HTTPValidationError", | |
| } | |
| response_data = self.api_client.call_api( | |
| *_param, | |
| _request_timeout=_request_timeout | |
| ) | |
| return response_data.response | |
| def _get_dags_serialize( | |
| self, | |
| limit, | |
| offset, | |
| tags, | |
| tags_match_mode, | |
| owners, | |
| dag_id_pattern, | |
| dag_id_prefix_pattern, | |
| dag_display_name_pattern, | |
| dag_display_name_prefix_pattern, | |
| exclude_stale, | |
| paused, | |
| has_import_errors, | |
| last_dag_run_state, | |
| bundle_name, | |
| bundle_version, | |
| has_asset_schedule, | |
| asset_dependency, | |
| dag_run_start_date_gte, | |
| dag_run_start_date_gt, | |
| dag_run_start_date_lte, | |
| dag_run_start_date_lt, | |
| dag_run_end_date_gte, | |
| dag_run_end_date_gt, | |
| dag_run_end_date_lte, | |
| dag_run_end_date_lt, | |
| dag_run_state, | |
| order_by, | |
| is_favorite, | |
| timetable_type, | |
| _request_auth, | |
| _content_type, | |
| _headers, | |
| _host_index, | |
| ) -> RequestSerialized: | |
| _host = None | |
| _collection_formats: Dict[str, str] = { | |
| 'tags': 'multi', | |
| 'owners': 'multi', | |
| 'dag_run_state': 'multi', | |
| 'order_by': 'multi', | |
| 'timetable_type': 'multi', | |
| } | |
| _path_params: Dict[str, str] = {} | |
| _query_params: List[Tuple[str, str]] = [] | |
| _header_params: Dict[str, Optional[str]] = _headers or {} | |
| _form_params: List[Tuple[str, str]] = [] | |
| _files: Dict[ | |
| str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] | |
| ] = {} | |
| _body_params: Optional[bytes] = None | |
| # process the path parameters | |
| # process the query parameters | |
| if limit is not None: | |
| _query_params.append(('limit', limit)) | |
| if offset is not None: | |
| _query_params.append(('offset', offset)) | |
| if tags is not None: | |
| _query_params.append(('tags', tags)) | |
| if tags_match_mode is not None: | |
| _query_params.append(('tags_match_mode', tags_match_mode)) | |
| if owners is not None: | |
| _query_params.append(('owners', owners)) | |
| if dag_id_pattern is not None: | |
| _query_params.append(('dag_id_pattern', dag_id_pattern)) | |
| if dag_id_prefix_pattern is not None: | |
| _query_params.append(('dag_id_prefix_pattern', dag_id_prefix_pattern)) | |
| if dag_display_name_pattern is not None: | |
| _query_params.append(('dag_display_name_pattern', dag_display_name_pattern)) | |
| if dag_display_name_prefix_pattern is not None: | |
| _query_params.append(('dag_display_name_prefix_pattern', dag_display_name_prefix_pattern)) | |
| if exclude_stale is not None: | |
| _query_params.append(('exclude_stale', exclude_stale)) | |
| if paused is not None: | |
| _query_params.append(('paused', paused)) | |
| if has_import_errors is not None: | |
| _query_params.append(('has_import_errors', has_import_errors)) | |
| if last_dag_run_state is not None: | |
| _query_params.append(('last_dag_run_state', last_dag_run_state.value)) | |
| if bundle_name is not None: | |
| _query_params.append(('bundle_name', bundle_name)) | |
| if bundle_version is not None: | |
| _query_params.append(('bundle_version', bundle_version)) | |
| if has_asset_schedule is not None: | |
| _query_params.append(('has_asset_schedule', has_asset_schedule)) | |
| if asset_dependency is not None: | |
| _query_params.append(('asset_dependency', asset_dependency)) | |
| if dag_run_start_date_gte is not None: | |
| if isinstance(dag_run_start_date_gte, datetime): | |
| _query_params.append( | |
| ( | |
| 'dag_run_start_date_gte', | |
| dag_run_start_date_gte.strftime( | |
| self.api_client.configuration.datetime_format | |
| ) | |
| ) | |
| ) | |
| else: | |
| _query_params.append(('dag_run_start_date_gte', dag_run_start_date_gte)) | |
| if dag_run_start_date_gt is not None: | |
| if isinstance(dag_run_start_date_gt, datetime): | |
| _query_params.append( | |
| ( | |
| 'dag_run_start_date_gt', | |
| dag_run_start_date_gt.strftime( | |
| self.api_client.configuration.datetime_format | |
| ) | |
| ) | |
| ) | |
| else: | |
| _query_params.append(('dag_run_start_date_gt', dag_run_start_date_gt)) | |
| if dag_run_start_date_lte is not None: | |
| if isinstance(dag_run_start_date_lte, datetime): | |
| _query_params.append( | |
| ( | |
| 'dag_run_start_date_lte', | |
| dag_run_start_date_lte.strftime( | |
| self.api_client.configuration.datetime_format | |
| ) | |
| ) | |
| ) | |
| else: | |
| _query_params.append(('dag_run_start_date_lte', dag_run_start_date_lte)) | |
| if dag_run_start_date_lt is not None: | |
| if isinstance(dag_run_start_date_lt, datetime): | |
| _query_params.append( | |
| ( | |
| 'dag_run_start_date_lt', | |
| dag_run_start_date_lt.strftime( | |
| self.api_client.configuration.datetime_format | |
| ) | |
| ) | |
| ) | |
| else: | |
| _query_params.append(('dag_run_start_date_lt', dag_run_start_date_lt)) | |
| if dag_run_end_date_gte is not None: | |
| if isinstance(dag_run_end_date_gte, datetime): | |
| _query_params.append( | |
| ( | |
| 'dag_run_end_date_gte', | |
| dag_run_end_date_gte.strftime( | |
| self.api_client.configuration.datetime_format | |
| ) | |
| ) | |
| ) | |
| else: | |
| _query_params.append(('dag_run_end_date_gte', dag_run_end_date_gte)) | |
| if dag_run_end_date_gt is not None: | |
| if isinstance(dag_run_end_date_gt, datetime): | |
| _query_params.append( | |
| ( | |
| 'dag_run_end_date_gt', | |
| dag_run_end_date_gt.strftime( | |
| self.api_client.configuration.datetime_format | |
| ) | |
| ) | |
| ) | |
| else: | |
| _query_params.append(('dag_run_end_date_gt', dag_run_end_date_gt)) | |
| if dag_run_end_date_lte is not None: | |
| if isinstance(dag_run_end_date_lte, datetime): | |
| _query_params.append( | |
| ( | |
| 'dag_run_end_date_lte', | |
| dag_run_end_date_lte.strftime( | |
| self.api_client.configuration.datetime_format | |
| ) | |
| ) | |
| ) | |
| else: | |
| _query_params.append(('dag_run_end_date_lte', dag_run_end_date_lte)) | |
| if dag_run_end_date_lt is not None: | |
| if isinstance(dag_run_end_date_lt, datetime): | |
| _query_params.append( | |
| ( | |
| 'dag_run_end_date_lt', | |
| dag_run_end_date_lt.strftime( | |
| self.api_client.configuration.datetime_format | |
| ) | |
| ) | |
| ) | |
| else: | |
| _query_params.append(('dag_run_end_date_lt', dag_run_end_date_lt)) | |
| if dag_run_state is not None: | |
| _query_params.append(('dag_run_state', dag_run_state)) | |
| if order_by is not None: | |
| _query_params.append(('order_by', order_by)) | |
| if is_favorite is not None: | |
| _query_params.append(('is_favorite', is_favorite)) | |
| if timetable_type is not None: | |
| _query_params.append(('timetable_type', timetable_type)) | |
| # process the header parameters | |
| # process the form parameters | |
| # process the body parameter | |
| # set the HTTP header `Accept` | |
| if 'Accept' not in _header_params: | |
| _header_params['Accept'] = self.api_client.select_header_accept( | |
| [ | |
| 'application/json' | |
| ] | |
| ) | |
| # authentication setting | |
| _auth_settings: List[str] = [ | |
| 'OAuth2PasswordBearer', | |
| 'HTTPBearer' | |
| ] | |
| return self.api_client.param_serialize( | |
| method='GET', | |
| resource_path='/api/v2/dags', | |
| path_params=_path_params, | |
| query_params=_query_params, | |
| header_params=_header_params, | |
| body=_body_params, | |
| post_params=_form_params, | |
| files=_files, | |
| auth_settings=_auth_settings, | |
| collection_formats=_collection_formats, | |
| _host=_host, | |
| _request_auth=_request_auth | |
| ) | |
| @validate_call | |
| def patch_dag( | |
| self, | |
| dag_id: StrictStr, | |
| dag_patch_body: DAGPatchBody, | |
| update_mask: Optional[List[StrictStr]] = None, | |
| _request_timeout: Union[ | |
| None, | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Tuple[ | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Annotated[StrictFloat, Field(gt=0)] | |
| ] | |
| ] = None, | |
| _request_auth: Optional[Dict[StrictStr, Any]] = None, | |
| _content_type: Optional[StrictStr] = None, | |
| _headers: Optional[Dict[StrictStr, Any]] = None, | |
| _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, | |
| ) -> DAGResponse: | |
| """Patch Dag | |
| Patch the specific Dag. | |
| :param dag_id: (required) | |
| :type dag_id: str | |
| :param dag_patch_body: (required) | |
| :type dag_patch_body: DAGPatchBody | |
| :param update_mask: | |
| :type update_mask: List[str] | |
| :param _request_timeout: timeout setting for this request. If one | |
| number provided, it will be total request | |
| timeout. It can also be a pair (tuple) of | |
| (connection, read) timeouts. | |
| :type _request_timeout: int, tuple(int, int), optional | |
| :param _request_auth: set to override the auth_settings for an a single | |
| request; this effectively ignores the | |
| authentication in the spec for a single request. | |
| :type _request_auth: dict, optional | |
| :param _content_type: force content-type for the request. | |
| :type _content_type: str, Optional | |
| :param _headers: set to override the headers for a single | |
| request; this effectively ignores the headers | |
| in the spec for a single request. | |
| :type _headers: dict, optional | |
| :param _host_index: set to override the host_index for a single | |
| request; this effectively ignores the host_index | |
| in the spec for a single request. | |
| :type _host_index: int, optional | |
| :return: Returns the result object. | |
| """ # noqa: E501 | |
| _param = self._patch_dag_serialize( | |
| dag_id=dag_id, | |
| dag_patch_body=dag_patch_body, | |
| update_mask=update_mask, | |
| _request_auth=_request_auth, | |
| _content_type=_content_type, | |
| _headers=_headers, | |
| _host_index=_host_index | |
| ) | |
| _response_types_map: Dict[str, Optional[str]] = { | |
| '200': "DAGResponse", | |
| '400': "HTTPExceptionResponse", | |
| '401': "HTTPExceptionResponse", | |
| '403': "HTTPExceptionResponse", | |
| '404': "HTTPExceptionResponse", | |
| '422': "HTTPValidationError", | |
| } | |
| response_data = self.api_client.call_api( | |
| *_param, | |
| _request_timeout=_request_timeout | |
| ) | |
| response_data.read() | |
| return self.api_client.response_deserialize( | |
| response_data=response_data, | |
| response_types_map=_response_types_map, | |
| ).data | |
| @validate_call | |
| def patch_dag_with_http_info( | |
| self, | |
| dag_id: StrictStr, | |
| dag_patch_body: DAGPatchBody, | |
| update_mask: Optional[List[StrictStr]] = None, | |
| _request_timeout: Union[ | |
| None, | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Tuple[ | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Annotated[StrictFloat, Field(gt=0)] | |
| ] | |
| ] = None, | |
| _request_auth: Optional[Dict[StrictStr, Any]] = None, | |
| _content_type: Optional[StrictStr] = None, | |
| _headers: Optional[Dict[StrictStr, Any]] = None, | |
| _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, | |
| ) -> ApiResponse[DAGResponse]: | |
| """Patch Dag | |
| Patch the specific Dag. | |
| :param dag_id: (required) | |
| :type dag_id: str | |
| :param dag_patch_body: (required) | |
| :type dag_patch_body: DAGPatchBody | |
| :param update_mask: | |
| :type update_mask: List[str] | |
| :param _request_timeout: timeout setting for this request. If one | |
| number provided, it will be total request | |
| timeout. It can also be a pair (tuple) of | |
| (connection, read) timeouts. | |
| :type _request_timeout: int, tuple(int, int), optional | |
| :param _request_auth: set to override the auth_settings for an a single | |
| request; this effectively ignores the | |
| authentication in the spec for a single request. | |
| :type _request_auth: dict, optional | |
| :param _content_type: force content-type for the request. | |
| :type _content_type: str, Optional | |
| :param _headers: set to override the headers for a single | |
| request; this effectively ignores the headers | |
| in the spec for a single request. | |
| :type _headers: dict, optional | |
| :param _host_index: set to override the host_index for a single | |
| request; this effectively ignores the host_index | |
| in the spec for a single request. | |
| :type _host_index: int, optional | |
| :return: Returns the result object. | |
| """ # noqa: E501 | |
| _param = self._patch_dag_serialize( | |
| dag_id=dag_id, | |
| dag_patch_body=dag_patch_body, | |
| update_mask=update_mask, | |
| _request_auth=_request_auth, | |
| _content_type=_content_type, | |
| _headers=_headers, | |
| _host_index=_host_index | |
| ) | |
| _response_types_map: Dict[str, Optional[str]] = { | |
| '200': "DAGResponse", | |
| '400': "HTTPExceptionResponse", | |
| '401': "HTTPExceptionResponse", | |
| '403': "HTTPExceptionResponse", | |
| '404': "HTTPExceptionResponse", | |
| '422': "HTTPValidationError", | |
| } | |
| response_data = self.api_client.call_api( | |
| *_param, | |
| _request_timeout=_request_timeout | |
| ) | |
| response_data.read() | |
| return self.api_client.response_deserialize( | |
| response_data=response_data, | |
| response_types_map=_response_types_map, | |
| ) | |
| @validate_call | |
| def patch_dag_without_preload_content( | |
| self, | |
| dag_id: StrictStr, | |
| dag_patch_body: DAGPatchBody, | |
| update_mask: Optional[List[StrictStr]] = None, | |
| _request_timeout: Union[ | |
| None, | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Tuple[ | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Annotated[StrictFloat, Field(gt=0)] | |
| ] | |
| ] = None, | |
| _request_auth: Optional[Dict[StrictStr, Any]] = None, | |
| _content_type: Optional[StrictStr] = None, | |
| _headers: Optional[Dict[StrictStr, Any]] = None, | |
| _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, | |
| ) -> RESTResponseType: | |
| """Patch Dag | |
| Patch the specific Dag. | |
| :param dag_id: (required) | |
| :type dag_id: str | |
| :param dag_patch_body: (required) | |
| :type dag_patch_body: DAGPatchBody | |
| :param update_mask: | |
| :type update_mask: List[str] | |
| :param _request_timeout: timeout setting for this request. If one | |
| number provided, it will be total request | |
| timeout. It can also be a pair (tuple) of | |
| (connection, read) timeouts. | |
| :type _request_timeout: int, tuple(int, int), optional | |
| :param _request_auth: set to override the auth_settings for an a single | |
| request; this effectively ignores the | |
| authentication in the spec for a single request. | |
| :type _request_auth: dict, optional | |
| :param _content_type: force content-type for the request. | |
| :type _content_type: str, Optional | |
| :param _headers: set to override the headers for a single | |
| request; this effectively ignores the headers | |
| in the spec for a single request. | |
| :type _headers: dict, optional | |
| :param _host_index: set to override the host_index for a single | |
| request; this effectively ignores the host_index | |
| in the spec for a single request. | |
| :type _host_index: int, optional | |
| :return: Returns the result object. | |
| """ # noqa: E501 | |
| _param = self._patch_dag_serialize( | |
| dag_id=dag_id, | |
| dag_patch_body=dag_patch_body, | |
| update_mask=update_mask, | |
| _request_auth=_request_auth, | |
| _content_type=_content_type, | |
| _headers=_headers, | |
| _host_index=_host_index | |
| ) | |
| _response_types_map: Dict[str, Optional[str]] = { | |
| '200': "DAGResponse", | |
| '400': "HTTPExceptionResponse", | |
| '401': "HTTPExceptionResponse", | |
| '403': "HTTPExceptionResponse", | |
| '404': "HTTPExceptionResponse", | |
| '422': "HTTPValidationError", | |
| } | |
| response_data = self.api_client.call_api( | |
| *_param, | |
| _request_timeout=_request_timeout | |
| ) | |
| return response_data.response | |
| def _patch_dag_serialize( | |
| self, | |
| dag_id, | |
| dag_patch_body, | |
| update_mask, | |
| _request_auth, | |
| _content_type, | |
| _headers, | |
| _host_index, | |
| ) -> RequestSerialized: | |
| _host = None | |
| _collection_formats: Dict[str, str] = { | |
| 'update_mask': 'multi', | |
| } | |
| _path_params: Dict[str, str] = {} | |
| _query_params: List[Tuple[str, str]] = [] | |
| _header_params: Dict[str, Optional[str]] = _headers or {} | |
| _form_params: List[Tuple[str, str]] = [] | |
| _files: Dict[ | |
| str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] | |
| ] = {} | |
| _body_params: Optional[bytes] = None | |
| # process the path parameters | |
| if dag_id is not None: | |
| _path_params['dag_id'] = dag_id | |
| # process the query parameters | |
| if update_mask is not None: | |
| _query_params.append(('update_mask', update_mask)) | |
| # process the header parameters | |
| # process the form parameters | |
| # process the body parameter | |
| if dag_patch_body is not None: | |
| _body_params = dag_patch_body | |
| # set the HTTP header `Accept` | |
| if 'Accept' not in _header_params: | |
| _header_params['Accept'] = self.api_client.select_header_accept( | |
| [ | |
| 'application/json' | |
| ] | |
| ) | |
| # set the HTTP header `Content-Type` | |
| if _content_type: | |
| _header_params['Content-Type'] = _content_type | |
| else: | |
| _default_content_type = ( | |
| self.api_client.select_header_content_type( | |
| [ | |
| 'application/json' | |
| ] | |
| ) | |
| ) | |
| if _default_content_type is not None: | |
| _header_params['Content-Type'] = _default_content_type | |
| # authentication setting | |
| _auth_settings: List[str] = [ | |
| 'OAuth2PasswordBearer', | |
| 'HTTPBearer' | |
| ] | |
| return self.api_client.param_serialize( | |
| method='PATCH', | |
| resource_path='/api/v2/dags/{dag_id}', | |
| path_params=_path_params, | |
| query_params=_query_params, | |
| header_params=_header_params, | |
| body=_body_params, | |
| post_params=_form_params, | |
| files=_files, | |
| auth_settings=_auth_settings, | |
| collection_formats=_collection_formats, | |
| _host=_host, | |
| _request_auth=_request_auth | |
| ) | |
| @validate_call | |
| def patch_dags( | |
| self, | |
| dag_patch_body: DAGPatchBody, | |
| update_mask: Optional[List[StrictStr]] = None, | |
| limit: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, | |
| offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, | |
| tags: Optional[List[StrictStr]] = None, | |
| tags_match_mode: Optional[StrictStr] = None, | |
| owners: Optional[List[StrictStr]] = None, | |
| dag_id_pattern: Annotated[Optional[StrictStr], Field(description="Case-insensitive substring match (SQL `ILIKE`). Slower than `dag_id_prefix_pattern` on large tables — see \"Filtering with pattern parameters\".")] = None, | |
| dag_id_prefix_pattern: Annotated[Optional[StrictStr], Field(description="Case-sensitive, index-friendly prefix match. See \"Filtering with pattern parameters\".")] = None, | |
| exclude_stale: Optional[StrictBool] = None, | |
| paused: Optional[StrictBool] = None, | |
| _request_timeout: Union[ | |
| None, | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Tuple[ | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Annotated[StrictFloat, Field(gt=0)] | |
| ] | |
| ] = None, | |
| _request_auth: Optional[Dict[StrictStr, Any]] = None, | |
| _content_type: Optional[StrictStr] = None, | |
| _headers: Optional[Dict[StrictStr, Any]] = None, | |
| _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, | |
| ) -> DAGCollectionResponse: | |
| """Patch Dags | |
| Patch multiple Dags. If neither `dag_id_pattern` nor `dag_id_prefix_pattern` is provided, no Dags will be matched regardless of other filters. To match all Dags, pass a wildcard value such as `~` or `%` for `dag_id_pattern`. | |
| :param dag_patch_body: (required) | |
| :type dag_patch_body: DAGPatchBody | |
| :param update_mask: | |
| :type update_mask: List[str] | |
| :param limit: | |
| :type limit: int | |
| :param offset: | |
| :type offset: int | |
| :param tags: | |
| :type tags: List[str] | |
| :param tags_match_mode: | |
| :type tags_match_mode: str | |
| :param owners: | |
| :type owners: List[str] | |
| :param dag_id_pattern: Case-insensitive substring match (SQL `ILIKE`). Slower than `dag_id_prefix_pattern` on large tables — see \"Filtering with pattern parameters\". | |
| :type dag_id_pattern: str | |
| :param dag_id_prefix_pattern: Case-sensitive, index-friendly prefix match. See \"Filtering with pattern parameters\". | |
| :type dag_id_prefix_pattern: str | |
| :param exclude_stale: | |
| :type exclude_stale: bool | |
| :param paused: | |
| :type paused: bool | |
| :param _request_timeout: timeout setting for this request. If one | |
| number provided, it will be total request | |
| timeout. It can also be a pair (tuple) of | |
| (connection, read) timeouts. | |
| :type _request_timeout: int, tuple(int, int), optional | |
| :param _request_auth: set to override the auth_settings for an a single | |
| request; this effectively ignores the | |
| authentication in the spec for a single request. | |
| :type _request_auth: dict, optional | |
| :param _content_type: force content-type for the request. | |
| :type _content_type: str, Optional | |
| :param _headers: set to override the headers for a single | |
| request; this effectively ignores the headers | |
| in the spec for a single request. | |
| :type _headers: dict, optional | |
| :param _host_index: set to override the host_index for a single | |
| request; this effectively ignores the host_index | |
| in the spec for a single request. | |
| :type _host_index: int, optional | |
| :return: Returns the result object. | |
| """ # noqa: E501 | |
| _param = self._patch_dags_serialize( | |
| dag_patch_body=dag_patch_body, | |
| update_mask=update_mask, | |
| limit=limit, | |
| offset=offset, | |
| tags=tags, | |
| tags_match_mode=tags_match_mode, | |
| owners=owners, | |
| dag_id_pattern=dag_id_pattern, | |
| dag_id_prefix_pattern=dag_id_prefix_pattern, | |
| exclude_stale=exclude_stale, | |
| paused=paused, | |
| _request_auth=_request_auth, | |
| _content_type=_content_type, | |
| _headers=_headers, | |
| _host_index=_host_index | |
| ) | |
| _response_types_map: Dict[str, Optional[str]] = { | |
| '200': "DAGCollectionResponse", | |
| '400': "HTTPExceptionResponse", | |
| '401': "HTTPExceptionResponse", | |
| '403': "HTTPExceptionResponse", | |
| '404': "HTTPExceptionResponse", | |
| '422': "HTTPValidationError", | |
| } | |
| response_data = self.api_client.call_api( | |
| *_param, | |
| _request_timeout=_request_timeout | |
| ) | |
| response_data.read() | |
| return self.api_client.response_deserialize( | |
| response_data=response_data, | |
| response_types_map=_response_types_map, | |
| ).data | |
| @validate_call | |
| def patch_dags_with_http_info( | |
| self, | |
| dag_patch_body: DAGPatchBody, | |
| update_mask: Optional[List[StrictStr]] = None, | |
| limit: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, | |
| offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, | |
| tags: Optional[List[StrictStr]] = None, | |
| tags_match_mode: Optional[StrictStr] = None, | |
| owners: Optional[List[StrictStr]] = None, | |
| dag_id_pattern: Annotated[Optional[StrictStr], Field(description="Case-insensitive substring match (SQL `ILIKE`). Slower than `dag_id_prefix_pattern` on large tables — see \"Filtering with pattern parameters\".")] = None, | |
| dag_id_prefix_pattern: Annotated[Optional[StrictStr], Field(description="Case-sensitive, index-friendly prefix match. See \"Filtering with pattern parameters\".")] = None, | |
| exclude_stale: Optional[StrictBool] = None, | |
| paused: Optional[StrictBool] = None, | |
| _request_timeout: Union[ | |
| None, | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Tuple[ | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Annotated[StrictFloat, Field(gt=0)] | |
| ] | |
| ] = None, | |
| _request_auth: Optional[Dict[StrictStr, Any]] = None, | |
| _content_type: Optional[StrictStr] = None, | |
| _headers: Optional[Dict[StrictStr, Any]] = None, | |
| _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, | |
| ) -> ApiResponse[DAGCollectionResponse]: | |
| """Patch Dags | |
| Patch multiple Dags. If neither `dag_id_pattern` nor `dag_id_prefix_pattern` is provided, no Dags will be matched regardless of other filters. To match all Dags, pass a wildcard value such as `~` or `%` for `dag_id_pattern`. | |
| :param dag_patch_body: (required) | |
| :type dag_patch_body: DAGPatchBody | |
| :param update_mask: | |
| :type update_mask: List[str] | |
| :param limit: | |
| :type limit: int | |
| :param offset: | |
| :type offset: int | |
| :param tags: | |
| :type tags: List[str] | |
| :param tags_match_mode: | |
| :type tags_match_mode: str | |
| :param owners: | |
| :type owners: List[str] | |
| :param dag_id_pattern: Case-insensitive substring match (SQL `ILIKE`). Slower than `dag_id_prefix_pattern` on large tables — see \"Filtering with pattern parameters\". | |
| :type dag_id_pattern: str | |
| :param dag_id_prefix_pattern: Case-sensitive, index-friendly prefix match. See \"Filtering with pattern parameters\". | |
| :type dag_id_prefix_pattern: str | |
| :param exclude_stale: | |
| :type exclude_stale: bool | |
| :param paused: | |
| :type paused: bool | |
| :param _request_timeout: timeout setting for this request. If one | |
| number provided, it will be total request | |
| timeout. It can also be a pair (tuple) of | |
| (connection, read) timeouts. | |
| :type _request_timeout: int, tuple(int, int), optional | |
| :param _request_auth: set to override the auth_settings for an a single | |
| request; this effectively ignores the | |
| authentication in the spec for a single request. | |
| :type _request_auth: dict, optional | |
| :param _content_type: force content-type for the request. | |
| :type _content_type: str, Optional | |
| :param _headers: set to override the headers for a single | |
| request; this effectively ignores the headers | |
| in the spec for a single request. | |
| :type _headers: dict, optional | |
| :param _host_index: set to override the host_index for a single | |
| request; this effectively ignores the host_index | |
| in the spec for a single request. | |
| :type _host_index: int, optional | |
| :return: Returns the result object. | |
| """ # noqa: E501 | |
| _param = self._patch_dags_serialize( | |
| dag_patch_body=dag_patch_body, | |
| update_mask=update_mask, | |
| limit=limit, | |
| offset=offset, | |
| tags=tags, | |
| tags_match_mode=tags_match_mode, | |
| owners=owners, | |
| dag_id_pattern=dag_id_pattern, | |
| dag_id_prefix_pattern=dag_id_prefix_pattern, | |
| exclude_stale=exclude_stale, | |
| paused=paused, | |
| _request_auth=_request_auth, | |
| _content_type=_content_type, | |
| _headers=_headers, | |
| _host_index=_host_index | |
| ) | |
| _response_types_map: Dict[str, Optional[str]] = { | |
| '200': "DAGCollectionResponse", | |
| '400': "HTTPExceptionResponse", | |
| '401': "HTTPExceptionResponse", | |
| '403': "HTTPExceptionResponse", | |
| '404': "HTTPExceptionResponse", | |
| '422': "HTTPValidationError", | |
| } | |
| response_data = self.api_client.call_api( | |
| *_param, | |
| _request_timeout=_request_timeout | |
| ) | |
| response_data.read() | |
| return self.api_client.response_deserialize( | |
| response_data=response_data, | |
| response_types_map=_response_types_map, | |
| ) | |
| @validate_call | |
| def patch_dags_without_preload_content( | |
| self, | |
| dag_patch_body: DAGPatchBody, | |
| update_mask: Optional[List[StrictStr]] = None, | |
| limit: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, | |
| offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, | |
| tags: Optional[List[StrictStr]] = None, | |
| tags_match_mode: Optional[StrictStr] = None, | |
| owners: Optional[List[StrictStr]] = None, | |
| dag_id_pattern: Annotated[Optional[StrictStr], Field(description="Case-insensitive substring match (SQL `ILIKE`). Slower than `dag_id_prefix_pattern` on large tables — see \"Filtering with pattern parameters\".")] = None, | |
| dag_id_prefix_pattern: Annotated[Optional[StrictStr], Field(description="Case-sensitive, index-friendly prefix match. See \"Filtering with pattern parameters\".")] = None, | |
| exclude_stale: Optional[StrictBool] = None, | |
| paused: Optional[StrictBool] = None, | |
| _request_timeout: Union[ | |
| None, | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Tuple[ | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Annotated[StrictFloat, Field(gt=0)] | |
| ] | |
| ] = None, | |
| _request_auth: Optional[Dict[StrictStr, Any]] = None, | |
| _content_type: Optional[StrictStr] = None, | |
| _headers: Optional[Dict[StrictStr, Any]] = None, | |
| _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, | |
| ) -> RESTResponseType: | |
| """Patch Dags | |
| Patch multiple Dags. If neither `dag_id_pattern` nor `dag_id_prefix_pattern` is provided, no Dags will be matched regardless of other filters. To match all Dags, pass a wildcard value such as `~` or `%` for `dag_id_pattern`. | |
| :param dag_patch_body: (required) | |
| :type dag_patch_body: DAGPatchBody | |
| :param update_mask: | |
| :type update_mask: List[str] | |
| :param limit: | |
| :type limit: int | |
| :param offset: | |
| :type offset: int | |
| :param tags: | |
| :type tags: List[str] | |
| :param tags_match_mode: | |
| :type tags_match_mode: str | |
| :param owners: | |
| :type owners: List[str] | |
| :param dag_id_pattern: Case-insensitive substring match (SQL `ILIKE`). Slower than `dag_id_prefix_pattern` on large tables — see \"Filtering with pattern parameters\". | |
| :type dag_id_pattern: str | |
| :param dag_id_prefix_pattern: Case-sensitive, index-friendly prefix match. See \"Filtering with pattern parameters\". | |
| :type dag_id_prefix_pattern: str | |
| :param exclude_stale: | |
| :type exclude_stale: bool | |
| :param paused: | |
| :type paused: bool | |
| :param _request_timeout: timeout setting for this request. If one | |
| number provided, it will be total request | |
| timeout. It can also be a pair (tuple) of | |
| (connection, read) timeouts. | |
| :type _request_timeout: int, tuple(int, int), optional | |
| :param _request_auth: set to override the auth_settings for an a single | |
| request; this effectively ignores the | |
| authentication in the spec for a single request. | |
| :type _request_auth: dict, optional | |
| :param _content_type: force content-type for the request. | |
| :type _content_type: str, Optional | |
| :param _headers: set to override the headers for a single | |
| request; this effectively ignores the headers | |
| in the spec for a single request. | |
| :type _headers: dict, optional | |
| :param _host_index: set to override the host_index for a single | |
| request; this effectively ignores the host_index | |
| in the spec for a single request. | |
| :type _host_index: int, optional | |
| :return: Returns the result object. | |
| """ # noqa: E501 | |
| _param = self._patch_dags_serialize( | |
| dag_patch_body=dag_patch_body, | |
| update_mask=update_mask, | |
| limit=limit, | |
| offset=offset, | |
| tags=tags, | |
| tags_match_mode=tags_match_mode, | |
| owners=owners, | |
| dag_id_pattern=dag_id_pattern, | |
| dag_id_prefix_pattern=dag_id_prefix_pattern, | |
| exclude_stale=exclude_stale, | |
| paused=paused, | |
| _request_auth=_request_auth, | |
| _content_type=_content_type, | |
| _headers=_headers, | |
| _host_index=_host_index | |
| ) | |
| _response_types_map: Dict[str, Optional[str]] = { | |
| '200': "DAGCollectionResponse", | |
| '400': "HTTPExceptionResponse", | |
| '401': "HTTPExceptionResponse", | |
| '403': "HTTPExceptionResponse", | |
| '404': "HTTPExceptionResponse", | |
| '422': "HTTPValidationError", | |
| } | |
| response_data = self.api_client.call_api( | |
| *_param, | |
| _request_timeout=_request_timeout | |
| ) | |
| return response_data.response | |
| def _patch_dags_serialize( | |
| self, | |
| dag_patch_body, | |
| update_mask, | |
| limit, | |
| offset, | |
| tags, | |
| tags_match_mode, | |
| owners, | |
| dag_id_pattern, | |
| dag_id_prefix_pattern, | |
| exclude_stale, | |
| paused, | |
| _request_auth, | |
| _content_type, | |
| _headers, | |
| _host_index, | |
| ) -> RequestSerialized: | |
| _host = None | |
| _collection_formats: Dict[str, str] = { | |
| 'update_mask': 'multi', | |
| 'tags': 'multi', | |
| 'owners': 'multi', | |
| } | |
| _path_params: Dict[str, str] = {} | |
| _query_params: List[Tuple[str, str]] = [] | |
| _header_params: Dict[str, Optional[str]] = _headers or {} | |
| _form_params: List[Tuple[str, str]] = [] | |
| _files: Dict[ | |
| str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] | |
| ] = {} | |
| _body_params: Optional[bytes] = None | |
| # process the path parameters | |
| # process the query parameters | |
| if update_mask is not None: | |
| _query_params.append(('update_mask', update_mask)) | |
| if limit is not None: | |
| _query_params.append(('limit', limit)) | |
| if offset is not None: | |
| _query_params.append(('offset', offset)) | |
| if tags is not None: | |
| _query_params.append(('tags', tags)) | |
| if tags_match_mode is not None: | |
| _query_params.append(('tags_match_mode', tags_match_mode)) | |
| if owners is not None: | |
| _query_params.append(('owners', owners)) | |
| if dag_id_pattern is not None: | |
| _query_params.append(('dag_id_pattern', dag_id_pattern)) | |
| if dag_id_prefix_pattern is not None: | |
| _query_params.append(('dag_id_prefix_pattern', dag_id_prefix_pattern)) | |
| if exclude_stale is not None: | |
| _query_params.append(('exclude_stale', exclude_stale)) | |
| if paused is not None: | |
| _query_params.append(('paused', paused)) | |
| # process the header parameters | |
| # process the form parameters | |
| # process the body parameter | |
| if dag_patch_body is not None: | |
| _body_params = dag_patch_body | |
| # set the HTTP header `Accept` | |
| if 'Accept' not in _header_params: | |
| _header_params['Accept'] = self.api_client.select_header_accept( | |
| [ | |
| 'application/json' | |
| ] | |
| ) | |
| # set the HTTP header `Content-Type` | |
| if _content_type: | |
| _header_params['Content-Type'] = _content_type | |
| else: | |
| _default_content_type = ( | |
| self.api_client.select_header_content_type( | |
| [ | |
| 'application/json' | |
| ] | |
| ) | |
| ) | |
| if _default_content_type is not None: | |
| _header_params['Content-Type'] = _default_content_type | |
| # authentication setting | |
| _auth_settings: List[str] = [ | |
| 'OAuth2PasswordBearer', | |
| 'HTTPBearer' | |
| ] | |
| return self.api_client.param_serialize( | |
| method='PATCH', | |
| resource_path='/api/v2/dags', | |
| path_params=_path_params, | |
| query_params=_query_params, | |
| header_params=_header_params, | |
| body=_body_params, | |
| post_params=_form_params, | |
| files=_files, | |
| auth_settings=_auth_settings, | |
| collection_formats=_collection_formats, | |
| _host=_host, | |
| _request_auth=_request_auth | |
| ) | |
| @validate_call | |
| def unfavorite_dag( | |
| self, | |
| dag_id: StrictStr, | |
| _request_timeout: Union[ | |
| None, | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Tuple[ | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Annotated[StrictFloat, Field(gt=0)] | |
| ] | |
| ] = None, | |
| _request_auth: Optional[Dict[StrictStr, Any]] = None, | |
| _content_type: Optional[StrictStr] = None, | |
| _headers: Optional[Dict[StrictStr, Any]] = None, | |
| _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, | |
| ) -> None: | |
| """Unfavorite Dag | |
| Unmark the Dag as favorite. | |
| :param dag_id: (required) | |
| :type dag_id: str | |
| :param _request_timeout: timeout setting for this request. If one | |
| number provided, it will be total request | |
| timeout. It can also be a pair (tuple) of | |
| (connection, read) timeouts. | |
| :type _request_timeout: int, tuple(int, int), optional | |
| :param _request_auth: set to override the auth_settings for an a single | |
| request; this effectively ignores the | |
| authentication in the spec for a single request. | |
| :type _request_auth: dict, optional | |
| :param _content_type: force content-type for the request. | |
| :type _content_type: str, Optional | |
| :param _headers: set to override the headers for a single | |
| request; this effectively ignores the headers | |
| in the spec for a single request. | |
| :type _headers: dict, optional | |
| :param _host_index: set to override the host_index for a single | |
| request; this effectively ignores the host_index | |
| in the spec for a single request. | |
| :type _host_index: int, optional | |
| :return: Returns the result object. | |
| """ # noqa: E501 | |
| _param = self._unfavorite_dag_serialize( | |
| dag_id=dag_id, | |
| _request_auth=_request_auth, | |
| _content_type=_content_type, | |
| _headers=_headers, | |
| _host_index=_host_index | |
| ) | |
| _response_types_map: Dict[str, Optional[str]] = { | |
| '204': None, | |
| '401': "HTTPExceptionResponse", | |
| '403': "HTTPExceptionResponse", | |
| '404': "HTTPExceptionResponse", | |
| '409': "HTTPExceptionResponse", | |
| '422': "HTTPValidationError", | |
| } | |
| response_data = self.api_client.call_api( | |
| *_param, | |
| _request_timeout=_request_timeout | |
| ) | |
| response_data.read() | |
| return self.api_client.response_deserialize( | |
| response_data=response_data, | |
| response_types_map=_response_types_map, | |
| ).data | |
| @validate_call | |
| def unfavorite_dag_with_http_info( | |
| self, | |
| dag_id: StrictStr, | |
| _request_timeout: Union[ | |
| None, | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Tuple[ | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Annotated[StrictFloat, Field(gt=0)] | |
| ] | |
| ] = None, | |
| _request_auth: Optional[Dict[StrictStr, Any]] = None, | |
| _content_type: Optional[StrictStr] = None, | |
| _headers: Optional[Dict[StrictStr, Any]] = None, | |
| _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, | |
| ) -> ApiResponse[None]: | |
| """Unfavorite Dag | |
| Unmark the Dag as favorite. | |
| :param dag_id: (required) | |
| :type dag_id: str | |
| :param _request_timeout: timeout setting for this request. If one | |
| number provided, it will be total request | |
| timeout. It can also be a pair (tuple) of | |
| (connection, read) timeouts. | |
| :type _request_timeout: int, tuple(int, int), optional | |
| :param _request_auth: set to override the auth_settings for an a single | |
| request; this effectively ignores the | |
| authentication in the spec for a single request. | |
| :type _request_auth: dict, optional | |
| :param _content_type: force content-type for the request. | |
| :type _content_type: str, Optional | |
| :param _headers: set to override the headers for a single | |
| request; this effectively ignores the headers | |
| in the spec for a single request. | |
| :type _headers: dict, optional | |
| :param _host_index: set to override the host_index for a single | |
| request; this effectively ignores the host_index | |
| in the spec for a single request. | |
| :type _host_index: int, optional | |
| :return: Returns the result object. | |
| """ # noqa: E501 | |
| _param = self._unfavorite_dag_serialize( | |
| dag_id=dag_id, | |
| _request_auth=_request_auth, | |
| _content_type=_content_type, | |
| _headers=_headers, | |
| _host_index=_host_index | |
| ) | |
| _response_types_map: Dict[str, Optional[str]] = { | |
| '204': None, | |
| '401': "HTTPExceptionResponse", | |
| '403': "HTTPExceptionResponse", | |
| '404': "HTTPExceptionResponse", | |
| '409': "HTTPExceptionResponse", | |
| '422': "HTTPValidationError", | |
| } | |
| response_data = self.api_client.call_api( | |
| *_param, | |
| _request_timeout=_request_timeout | |
| ) | |
| response_data.read() | |
| return self.api_client.response_deserialize( | |
| response_data=response_data, | |
| response_types_map=_response_types_map, | |
| ) | |
| @validate_call | |
| def unfavorite_dag_without_preload_content( | |
| self, | |
| dag_id: StrictStr, | |
| _request_timeout: Union[ | |
| None, | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Tuple[ | |
| Annotated[StrictFloat, Field(gt=0)], | |
| Annotated[StrictFloat, Field(gt=0)] | |
| ] | |
| ] = None, | |
| _request_auth: Optional[Dict[StrictStr, Any]] = None, | |
| _content_type: Optional[StrictStr] = None, | |
| _headers: Optional[Dict[StrictStr, Any]] = None, | |
| _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, | |
| ) -> RESTResponseType: | |
| """Unfavorite Dag | |
| Unmark the Dag as favorite. | |
| :param dag_id: (required) | |
| :type dag_id: str | |
| :param _request_timeout: timeout setting for this request. If one | |
| number provided, it will be total request | |
| timeout. It can also be a pair (tuple) of | |
| (connection, read) timeouts. | |
| :type _request_timeout: int, tuple(int, int), optional | |
| :param _request_auth: set to override the auth_settings for an a single | |
| request; this effectively ignores the | |
| authentication in the spec for a single request. | |
| :type _request_auth: dict, optional | |
| :param _content_type: force content-type for the request. | |
| :type _content_type: str, Optional | |
| :param _headers: set to override the headers for a single | |
| request; this effectively ignores the headers | |
| in the spec for a single request. | |
| :type _headers: dict, optional | |
| :param _host_index: set to override the host_index for a single | |
| request; this effectively ignores the host_index | |
| in the spec for a single request. | |
| :type _host_index: int, optional | |
| :return: Returns the result object. | |
| """ # noqa: E501 | |
| _param = self._unfavorite_dag_serialize( | |
| dag_id=dag_id, | |
| _request_auth=_request_auth, | |
| _content_type=_content_type, | |
| _headers=_headers, | |
| _host_index=_host_index | |
| ) | |
| _response_types_map: Dict[str, Optional[str]] = { | |
| '204': None, | |
| '401': "HTTPExceptionResponse", | |
| '403': "HTTPExceptionResponse", | |
| '404': "HTTPExceptionResponse", | |
| '409': "HTTPExceptionResponse", | |
| '422': "HTTPValidationError", | |
| } | |
| response_data = self.api_client.call_api( | |
| *_param, | |
| _request_timeout=_request_timeout | |
| ) | |
| return response_data.response | |
| def _unfavorite_dag_serialize( | |
| self, | |
| dag_id, | |
| _request_auth, | |
| _content_type, | |
| _headers, | |
| _host_index, | |
| ) -> RequestSerialized: | |
| _host = None | |
| _collection_formats: Dict[str, str] = { | |
| } | |
| _path_params: Dict[str, str] = {} | |
| _query_params: List[Tuple[str, str]] = [] | |
| _header_params: Dict[str, Optional[str]] = _headers or {} | |
| _form_params: List[Tuple[str, str]] = [] | |
| _files: Dict[ | |
| str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] | |
| ] = {} | |
| _body_params: Optional[bytes] = None | |
| # process the path parameters | |
| if dag_id is not None: | |
| _path_params['dag_id'] = dag_id | |
| # process the query parameters | |
| # process the header parameters | |
| # process the form parameters | |
| # process the body parameter | |
| # set the HTTP header `Accept` | |
| if 'Accept' not in _header_params: | |
| _header_params['Accept'] = self.api_client.select_header_accept( | |
| [ | |
| 'application/json' | |
| ] | |
| ) | |
| # authentication setting | |
| _auth_settings: List[str] = [ | |
| 'OAuth2PasswordBearer', | |
| 'HTTPBearer' | |
| ] | |
| return self.api_client.param_serialize( | |
| method='POST', | |
| resource_path='/api/v2/dags/{dag_id}/unfavorite', | |
| path_params=_path_params, | |
| query_params=_query_params, | |
| header_params=_header_params, | |
| body=_body_params, | |
| post_params=_form_params, | |
| files=_files, | |
| auth_settings=_auth_settings, | |
| collection_formats=_collection_formats, | |
| _host=_host, | |
| _request_auth=_request_auth | |
| ) | |