| # coding: utf-8 |
| |
| """ |
| 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. |
| |
| 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, StrictInt, StrictStr |
| from typing import Optional |
| from typing_extensions import Annotated |
| from airflow_client.client.models.response_get_xcom_entry import ResponseGetXcomEntry |
| from airflow_client.client.models.x_com_collection_response import XComCollectionResponse |
| from airflow_client.client.models.x_com_create_body import XComCreateBody |
| from airflow_client.client.models.x_com_response_native import XComResponseNative |
| from airflow_client.client.models.x_com_update_body import XComUpdateBody |
| |
| 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 XComApi: |
| """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 create_xcom_entry( |
| self, |
| dag_id: StrictStr, |
| task_id: StrictStr, |
| dag_run_id: StrictStr, |
| x_com_create_body: XComCreateBody, |
| _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, |
| ) -> XComResponseNative: |
| """Create Xcom Entry |
| |
| Create an XCom entry. |
| |
| :param dag_id: (required) |
| :type dag_id: str |
| :param task_id: (required) |
| :type task_id: str |
| :param dag_run_id: (required) |
| :type dag_run_id: str |
| :param x_com_create_body: (required) |
| :type x_com_create_body: XComCreateBody |
| :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._create_xcom_entry_serialize( |
| dag_id=dag_id, |
| task_id=task_id, |
| dag_run_id=dag_run_id, |
| x_com_create_body=x_com_create_body, |
| _request_auth=_request_auth, |
| _content_type=_content_type, |
| _headers=_headers, |
| _host_index=_host_index |
| ) |
| |
| _response_types_map: Dict[str, Optional[str]] = { |
| '201': "XComResponseNative", |
| '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 create_xcom_entry_with_http_info( |
| self, |
| dag_id: StrictStr, |
| task_id: StrictStr, |
| dag_run_id: StrictStr, |
| x_com_create_body: XComCreateBody, |
| _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[XComResponseNative]: |
| """Create Xcom Entry |
| |
| Create an XCom entry. |
| |
| :param dag_id: (required) |
| :type dag_id: str |
| :param task_id: (required) |
| :type task_id: str |
| :param dag_run_id: (required) |
| :type dag_run_id: str |
| :param x_com_create_body: (required) |
| :type x_com_create_body: XComCreateBody |
| :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._create_xcom_entry_serialize( |
| dag_id=dag_id, |
| task_id=task_id, |
| dag_run_id=dag_run_id, |
| x_com_create_body=x_com_create_body, |
| _request_auth=_request_auth, |
| _content_type=_content_type, |
| _headers=_headers, |
| _host_index=_host_index |
| ) |
| |
| _response_types_map: Dict[str, Optional[str]] = { |
| '201': "XComResponseNative", |
| '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 create_xcom_entry_without_preload_content( |
| self, |
| dag_id: StrictStr, |
| task_id: StrictStr, |
| dag_run_id: StrictStr, |
| x_com_create_body: XComCreateBody, |
| _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: |
| """Create Xcom Entry |
| |
| Create an XCom entry. |
| |
| :param dag_id: (required) |
| :type dag_id: str |
| :param task_id: (required) |
| :type task_id: str |
| :param dag_run_id: (required) |
| :type dag_run_id: str |
| :param x_com_create_body: (required) |
| :type x_com_create_body: XComCreateBody |
| :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._create_xcom_entry_serialize( |
| dag_id=dag_id, |
| task_id=task_id, |
| dag_run_id=dag_run_id, |
| x_com_create_body=x_com_create_body, |
| _request_auth=_request_auth, |
| _content_type=_content_type, |
| _headers=_headers, |
| _host_index=_host_index |
| ) |
| |
| _response_types_map: Dict[str, Optional[str]] = { |
| '201': "XComResponseNative", |
| '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 _create_xcom_entry_serialize( |
| self, |
| dag_id, |
| task_id, |
| dag_run_id, |
| x_com_create_body, |
| _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 |
| if task_id is not None: |
| _path_params['task_id'] = task_id |
| if dag_run_id is not None: |
| _path_params['dag_run_id'] = dag_run_id |
| # process the query parameters |
| # process the header parameters |
| # process the form parameters |
| # process the body parameter |
| if x_com_create_body is not None: |
| _body_params = x_com_create_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='POST', |
| resource_path='/api/v2/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/xcomEntries', |
| 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_xcom_entries( |
| self, |
| dag_id: StrictStr, |
| dag_run_id: StrictStr, |
| task_id: StrictStr, |
| xcom_key: Optional[StrictStr] = None, |
| map_index: Optional[Annotated[int, Field(strict=True, ge=-1)]] = None, |
| limit: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, |
| offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, |
| xcom_key_pattern: Annotated[Optional[StrictStr], Field(description="SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). Regular expressions are **not** supported.")] = None, |
| dag_display_name_pattern: Annotated[Optional[StrictStr], Field(description="SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). Regular expressions are **not** supported.")] = None, |
| run_id_pattern: Annotated[Optional[StrictStr], Field(description="SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). Regular expressions are **not** supported.")] = None, |
| task_id_pattern: Annotated[Optional[StrictStr], Field(description="SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). Regular expressions are **not** supported.")] = None, |
| map_index_filter: Optional[StrictInt] = None, |
| logical_date_gte: Optional[datetime] = None, |
| logical_date_gt: Optional[datetime] = None, |
| logical_date_lte: Optional[datetime] = None, |
| logical_date_lt: Optional[datetime] = None, |
| run_after_gte: Optional[datetime] = None, |
| run_after_gt: Optional[datetime] = None, |
| run_after_lte: Optional[datetime] = None, |
| run_after_lt: Optional[datetime] = 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, |
| ) -> XComCollectionResponse: |
| """Get Xcom Entries |
| |
| Get all XCom entries. This endpoint allows specifying `~` as the dag_id, dag_run_id, task_id to retrieve XCom entries for all DAGs. |
| |
| :param dag_id: (required) |
| :type dag_id: str |
| :param dag_run_id: (required) |
| :type dag_run_id: str |
| :param task_id: (required) |
| :type task_id: str |
| :param xcom_key: |
| :type xcom_key: str |
| :param map_index: |
| :type map_index: int |
| :param limit: |
| :type limit: int |
| :param offset: |
| :type offset: int |
| :param xcom_key_pattern: SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). Regular expressions are **not** supported. |
| :type xcom_key_pattern: str |
| :param dag_display_name_pattern: SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). Regular expressions are **not** supported. |
| :type dag_display_name_pattern: str |
| :param run_id_pattern: SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). Regular expressions are **not** supported. |
| :type run_id_pattern: str |
| :param task_id_pattern: SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). Regular expressions are **not** supported. |
| :type task_id_pattern: str |
| :param map_index_filter: |
| :type map_index_filter: int |
| :param logical_date_gte: |
| :type logical_date_gte: datetime |
| :param logical_date_gt: |
| :type logical_date_gt: datetime |
| :param logical_date_lte: |
| :type logical_date_lte: datetime |
| :param logical_date_lt: |
| :type logical_date_lt: datetime |
| :param run_after_gte: |
| :type run_after_gte: datetime |
| :param run_after_gt: |
| :type run_after_gt: datetime |
| :param run_after_lte: |
| :type run_after_lte: datetime |
| :param run_after_lt: |
| :type run_after_lt: datetime |
| :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_xcom_entries_serialize( |
| dag_id=dag_id, |
| dag_run_id=dag_run_id, |
| task_id=task_id, |
| xcom_key=xcom_key, |
| map_index=map_index, |
| limit=limit, |
| offset=offset, |
| xcom_key_pattern=xcom_key_pattern, |
| dag_display_name_pattern=dag_display_name_pattern, |
| run_id_pattern=run_id_pattern, |
| task_id_pattern=task_id_pattern, |
| map_index_filter=map_index_filter, |
| logical_date_gte=logical_date_gte, |
| logical_date_gt=logical_date_gt, |
| logical_date_lte=logical_date_lte, |
| logical_date_lt=logical_date_lt, |
| run_after_gte=run_after_gte, |
| run_after_gt=run_after_gt, |
| run_after_lte=run_after_lte, |
| run_after_lt=run_after_lt, |
| _request_auth=_request_auth, |
| _content_type=_content_type, |
| _headers=_headers, |
| _host_index=_host_index |
| ) |
| |
| _response_types_map: Dict[str, Optional[str]] = { |
| '200': "XComCollectionResponse", |
| '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_xcom_entries_with_http_info( |
| self, |
| dag_id: StrictStr, |
| dag_run_id: StrictStr, |
| task_id: StrictStr, |
| xcom_key: Optional[StrictStr] = None, |
| map_index: Optional[Annotated[int, Field(strict=True, ge=-1)]] = None, |
| limit: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, |
| offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, |
| xcom_key_pattern: Annotated[Optional[StrictStr], Field(description="SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). Regular expressions are **not** supported.")] = None, |
| dag_display_name_pattern: Annotated[Optional[StrictStr], Field(description="SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). Regular expressions are **not** supported.")] = None, |
| run_id_pattern: Annotated[Optional[StrictStr], Field(description="SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). Regular expressions are **not** supported.")] = None, |
| task_id_pattern: Annotated[Optional[StrictStr], Field(description="SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). Regular expressions are **not** supported.")] = None, |
| map_index_filter: Optional[StrictInt] = None, |
| logical_date_gte: Optional[datetime] = None, |
| logical_date_gt: Optional[datetime] = None, |
| logical_date_lte: Optional[datetime] = None, |
| logical_date_lt: Optional[datetime] = None, |
| run_after_gte: Optional[datetime] = None, |
| run_after_gt: Optional[datetime] = None, |
| run_after_lte: Optional[datetime] = None, |
| run_after_lt: Optional[datetime] = 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[XComCollectionResponse]: |
| """Get Xcom Entries |
| |
| Get all XCom entries. This endpoint allows specifying `~` as the dag_id, dag_run_id, task_id to retrieve XCom entries for all DAGs. |
| |
| :param dag_id: (required) |
| :type dag_id: str |
| :param dag_run_id: (required) |
| :type dag_run_id: str |
| :param task_id: (required) |
| :type task_id: str |
| :param xcom_key: |
| :type xcom_key: str |
| :param map_index: |
| :type map_index: int |
| :param limit: |
| :type limit: int |
| :param offset: |
| :type offset: int |
| :param xcom_key_pattern: SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). Regular expressions are **not** supported. |
| :type xcom_key_pattern: str |
| :param dag_display_name_pattern: SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). Regular expressions are **not** supported. |
| :type dag_display_name_pattern: str |
| :param run_id_pattern: SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). Regular expressions are **not** supported. |
| :type run_id_pattern: str |
| :param task_id_pattern: SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). Regular expressions are **not** supported. |
| :type task_id_pattern: str |
| :param map_index_filter: |
| :type map_index_filter: int |
| :param logical_date_gte: |
| :type logical_date_gte: datetime |
| :param logical_date_gt: |
| :type logical_date_gt: datetime |
| :param logical_date_lte: |
| :type logical_date_lte: datetime |
| :param logical_date_lt: |
| :type logical_date_lt: datetime |
| :param run_after_gte: |
| :type run_after_gte: datetime |
| :param run_after_gt: |
| :type run_after_gt: datetime |
| :param run_after_lte: |
| :type run_after_lte: datetime |
| :param run_after_lt: |
| :type run_after_lt: datetime |
| :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_xcom_entries_serialize( |
| dag_id=dag_id, |
| dag_run_id=dag_run_id, |
| task_id=task_id, |
| xcom_key=xcom_key, |
| map_index=map_index, |
| limit=limit, |
| offset=offset, |
| xcom_key_pattern=xcom_key_pattern, |
| dag_display_name_pattern=dag_display_name_pattern, |
| run_id_pattern=run_id_pattern, |
| task_id_pattern=task_id_pattern, |
| map_index_filter=map_index_filter, |
| logical_date_gte=logical_date_gte, |
| logical_date_gt=logical_date_gt, |
| logical_date_lte=logical_date_lte, |
| logical_date_lt=logical_date_lt, |
| run_after_gte=run_after_gte, |
| run_after_gt=run_after_gt, |
| run_after_lte=run_after_lte, |
| run_after_lt=run_after_lt, |
| _request_auth=_request_auth, |
| _content_type=_content_type, |
| _headers=_headers, |
| _host_index=_host_index |
| ) |
| |
| _response_types_map: Dict[str, Optional[str]] = { |
| '200': "XComCollectionResponse", |
| '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_xcom_entries_without_preload_content( |
| self, |
| dag_id: StrictStr, |
| dag_run_id: StrictStr, |
| task_id: StrictStr, |
| xcom_key: Optional[StrictStr] = None, |
| map_index: Optional[Annotated[int, Field(strict=True, ge=-1)]] = None, |
| limit: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, |
| offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, |
| xcom_key_pattern: Annotated[Optional[StrictStr], Field(description="SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). Regular expressions are **not** supported.")] = None, |
| dag_display_name_pattern: Annotated[Optional[StrictStr], Field(description="SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). Regular expressions are **not** supported.")] = None, |
| run_id_pattern: Annotated[Optional[StrictStr], Field(description="SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). Regular expressions are **not** supported.")] = None, |
| task_id_pattern: Annotated[Optional[StrictStr], Field(description="SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). Regular expressions are **not** supported.")] = None, |
| map_index_filter: Optional[StrictInt] = None, |
| logical_date_gte: Optional[datetime] = None, |
| logical_date_gt: Optional[datetime] = None, |
| logical_date_lte: Optional[datetime] = None, |
| logical_date_lt: Optional[datetime] = None, |
| run_after_gte: Optional[datetime] = None, |
| run_after_gt: Optional[datetime] = None, |
| run_after_lte: Optional[datetime] = None, |
| run_after_lt: Optional[datetime] = 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 Xcom Entries |
| |
| Get all XCom entries. This endpoint allows specifying `~` as the dag_id, dag_run_id, task_id to retrieve XCom entries for all DAGs. |
| |
| :param dag_id: (required) |
| :type dag_id: str |
| :param dag_run_id: (required) |
| :type dag_run_id: str |
| :param task_id: (required) |
| :type task_id: str |
| :param xcom_key: |
| :type xcom_key: str |
| :param map_index: |
| :type map_index: int |
| :param limit: |
| :type limit: int |
| :param offset: |
| :type offset: int |
| :param xcom_key_pattern: SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). Regular expressions are **not** supported. |
| :type xcom_key_pattern: str |
| :param dag_display_name_pattern: SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). Regular expressions are **not** supported. |
| :type dag_display_name_pattern: str |
| :param run_id_pattern: SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). Regular expressions are **not** supported. |
| :type run_id_pattern: str |
| :param task_id_pattern: SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). Regular expressions are **not** supported. |
| :type task_id_pattern: str |
| :param map_index_filter: |
| :type map_index_filter: int |
| :param logical_date_gte: |
| :type logical_date_gte: datetime |
| :param logical_date_gt: |
| :type logical_date_gt: datetime |
| :param logical_date_lte: |
| :type logical_date_lte: datetime |
| :param logical_date_lt: |
| :type logical_date_lt: datetime |
| :param run_after_gte: |
| :type run_after_gte: datetime |
| :param run_after_gt: |
| :type run_after_gt: datetime |
| :param run_after_lte: |
| :type run_after_lte: datetime |
| :param run_after_lt: |
| :type run_after_lt: datetime |
| :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_xcom_entries_serialize( |
| dag_id=dag_id, |
| dag_run_id=dag_run_id, |
| task_id=task_id, |
| xcom_key=xcom_key, |
| map_index=map_index, |
| limit=limit, |
| offset=offset, |
| xcom_key_pattern=xcom_key_pattern, |
| dag_display_name_pattern=dag_display_name_pattern, |
| run_id_pattern=run_id_pattern, |
| task_id_pattern=task_id_pattern, |
| map_index_filter=map_index_filter, |
| logical_date_gte=logical_date_gte, |
| logical_date_gt=logical_date_gt, |
| logical_date_lte=logical_date_lte, |
| logical_date_lt=logical_date_lt, |
| run_after_gte=run_after_gte, |
| run_after_gt=run_after_gt, |
| run_after_lte=run_after_lte, |
| run_after_lt=run_after_lt, |
| _request_auth=_request_auth, |
| _content_type=_content_type, |
| _headers=_headers, |
| _host_index=_host_index |
| ) |
| |
| _response_types_map: Dict[str, Optional[str]] = { |
| '200': "XComCollectionResponse", |
| '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_xcom_entries_serialize( |
| self, |
| dag_id, |
| dag_run_id, |
| task_id, |
| xcom_key, |
| map_index, |
| limit, |
| offset, |
| xcom_key_pattern, |
| dag_display_name_pattern, |
| run_id_pattern, |
| task_id_pattern, |
| map_index_filter, |
| logical_date_gte, |
| logical_date_gt, |
| logical_date_lte, |
| logical_date_lt, |
| run_after_gte, |
| run_after_gt, |
| run_after_lte, |
| run_after_lt, |
| _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 |
| if dag_run_id is not None: |
| _path_params['dag_run_id'] = dag_run_id |
| if task_id is not None: |
| _path_params['task_id'] = task_id |
| # process the query parameters |
| if xcom_key is not None: |
| |
| _query_params.append(('xcom_key', xcom_key)) |
| |
| if map_index is not None: |
| |
| _query_params.append(('map_index', map_index)) |
| |
| if limit is not None: |
| |
| _query_params.append(('limit', limit)) |
| |
| if offset is not None: |
| |
| _query_params.append(('offset', offset)) |
| |
| if xcom_key_pattern is not None: |
| |
| _query_params.append(('xcom_key_pattern', xcom_key_pattern)) |
| |
| if dag_display_name_pattern is not None: |
| |
| _query_params.append(('dag_display_name_pattern', dag_display_name_pattern)) |
| |
| if run_id_pattern is not None: |
| |
| _query_params.append(('run_id_pattern', run_id_pattern)) |
| |
| if task_id_pattern is not None: |
| |
| _query_params.append(('task_id_pattern', task_id_pattern)) |
| |
| if map_index_filter is not None: |
| |
| _query_params.append(('map_index_filter', map_index_filter)) |
| |
| if logical_date_gte is not None: |
| if isinstance(logical_date_gte, datetime): |
| _query_params.append( |
| ( |
| 'logical_date_gte', |
| logical_date_gte.strftime( |
| self.api_client.configuration.datetime_format |
| ) |
| ) |
| ) |
| else: |
| _query_params.append(('logical_date_gte', logical_date_gte)) |
| |
| if logical_date_gt is not None: |
| if isinstance(logical_date_gt, datetime): |
| _query_params.append( |
| ( |
| 'logical_date_gt', |
| logical_date_gt.strftime( |
| self.api_client.configuration.datetime_format |
| ) |
| ) |
| ) |
| else: |
| _query_params.append(('logical_date_gt', logical_date_gt)) |
| |
| if logical_date_lte is not None: |
| if isinstance(logical_date_lte, datetime): |
| _query_params.append( |
| ( |
| 'logical_date_lte', |
| logical_date_lte.strftime( |
| self.api_client.configuration.datetime_format |
| ) |
| ) |
| ) |
| else: |
| _query_params.append(('logical_date_lte', logical_date_lte)) |
| |
| if logical_date_lt is not None: |
| if isinstance(logical_date_lt, datetime): |
| _query_params.append( |
| ( |
| 'logical_date_lt', |
| logical_date_lt.strftime( |
| self.api_client.configuration.datetime_format |
| ) |
| ) |
| ) |
| else: |
| _query_params.append(('logical_date_lt', logical_date_lt)) |
| |
| if run_after_gte is not None: |
| if isinstance(run_after_gte, datetime): |
| _query_params.append( |
| ( |
| 'run_after_gte', |
| run_after_gte.strftime( |
| self.api_client.configuration.datetime_format |
| ) |
| ) |
| ) |
| else: |
| _query_params.append(('run_after_gte', run_after_gte)) |
| |
| if run_after_gt is not None: |
| if isinstance(run_after_gt, datetime): |
| _query_params.append( |
| ( |
| 'run_after_gt', |
| run_after_gt.strftime( |
| self.api_client.configuration.datetime_format |
| ) |
| ) |
| ) |
| else: |
| _query_params.append(('run_after_gt', run_after_gt)) |
| |
| if run_after_lte is not None: |
| if isinstance(run_after_lte, datetime): |
| _query_params.append( |
| ( |
| 'run_after_lte', |
| run_after_lte.strftime( |
| self.api_client.configuration.datetime_format |
| ) |
| ) |
| ) |
| else: |
| _query_params.append(('run_after_lte', run_after_lte)) |
| |
| if run_after_lt is not None: |
| if isinstance(run_after_lt, datetime): |
| _query_params.append( |
| ( |
| 'run_after_lt', |
| run_after_lt.strftime( |
| self.api_client.configuration.datetime_format |
| ) |
| ) |
| ) |
| else: |
| _query_params.append(('run_after_lt', run_after_lt)) |
| |
| # 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}/dagRuns/{dag_run_id}/taskInstances/{task_id}/xcomEntries', |
| 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_xcom_entry( |
| self, |
| dag_id: StrictStr, |
| task_id: StrictStr, |
| dag_run_id: StrictStr, |
| xcom_key: StrictStr, |
| map_index: Optional[Annotated[int, Field(strict=True, ge=-1)]] = None, |
| deserialize: Optional[StrictBool] = None, |
| stringify: 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, |
| ) -> ResponseGetXcomEntry: |
| """Get Xcom Entry |
| |
| Get an XCom entry. |
| |
| :param dag_id: (required) |
| :type dag_id: str |
| :param task_id: (required) |
| :type task_id: str |
| :param dag_run_id: (required) |
| :type dag_run_id: str |
| :param xcom_key: (required) |
| :type xcom_key: str |
| :param map_index: |
| :type map_index: int |
| :param deserialize: |
| :type deserialize: bool |
| :param stringify: |
| :type stringify: 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._get_xcom_entry_serialize( |
| dag_id=dag_id, |
| task_id=task_id, |
| dag_run_id=dag_run_id, |
| xcom_key=xcom_key, |
| map_index=map_index, |
| deserialize=deserialize, |
| stringify=stringify, |
| _request_auth=_request_auth, |
| _content_type=_content_type, |
| _headers=_headers, |
| _host_index=_host_index |
| ) |
| |
| _response_types_map: Dict[str, Optional[str]] = { |
| '200': "ResponseGetXcomEntry", |
| '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_xcom_entry_with_http_info( |
| self, |
| dag_id: StrictStr, |
| task_id: StrictStr, |
| dag_run_id: StrictStr, |
| xcom_key: StrictStr, |
| map_index: Optional[Annotated[int, Field(strict=True, ge=-1)]] = None, |
| deserialize: Optional[StrictBool] = None, |
| stringify: 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[ResponseGetXcomEntry]: |
| """Get Xcom Entry |
| |
| Get an XCom entry. |
| |
| :param dag_id: (required) |
| :type dag_id: str |
| :param task_id: (required) |
| :type task_id: str |
| :param dag_run_id: (required) |
| :type dag_run_id: str |
| :param xcom_key: (required) |
| :type xcom_key: str |
| :param map_index: |
| :type map_index: int |
| :param deserialize: |
| :type deserialize: bool |
| :param stringify: |
| :type stringify: 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._get_xcom_entry_serialize( |
| dag_id=dag_id, |
| task_id=task_id, |
| dag_run_id=dag_run_id, |
| xcom_key=xcom_key, |
| map_index=map_index, |
| deserialize=deserialize, |
| stringify=stringify, |
| _request_auth=_request_auth, |
| _content_type=_content_type, |
| _headers=_headers, |
| _host_index=_host_index |
| ) |
| |
| _response_types_map: Dict[str, Optional[str]] = { |
| '200': "ResponseGetXcomEntry", |
| '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_xcom_entry_without_preload_content( |
| self, |
| dag_id: StrictStr, |
| task_id: StrictStr, |
| dag_run_id: StrictStr, |
| xcom_key: StrictStr, |
| map_index: Optional[Annotated[int, Field(strict=True, ge=-1)]] = None, |
| deserialize: Optional[StrictBool] = None, |
| stringify: 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: |
| """Get Xcom Entry |
| |
| Get an XCom entry. |
| |
| :param dag_id: (required) |
| :type dag_id: str |
| :param task_id: (required) |
| :type task_id: str |
| :param dag_run_id: (required) |
| :type dag_run_id: str |
| :param xcom_key: (required) |
| :type xcom_key: str |
| :param map_index: |
| :type map_index: int |
| :param deserialize: |
| :type deserialize: bool |
| :param stringify: |
| :type stringify: 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._get_xcom_entry_serialize( |
| dag_id=dag_id, |
| task_id=task_id, |
| dag_run_id=dag_run_id, |
| xcom_key=xcom_key, |
| map_index=map_index, |
| deserialize=deserialize, |
| stringify=stringify, |
| _request_auth=_request_auth, |
| _content_type=_content_type, |
| _headers=_headers, |
| _host_index=_host_index |
| ) |
| |
| _response_types_map: Dict[str, Optional[str]] = { |
| '200': "ResponseGetXcomEntry", |
| '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_xcom_entry_serialize( |
| self, |
| dag_id, |
| task_id, |
| dag_run_id, |
| xcom_key, |
| map_index, |
| deserialize, |
| stringify, |
| _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 |
| if task_id is not None: |
| _path_params['task_id'] = task_id |
| if dag_run_id is not None: |
| _path_params['dag_run_id'] = dag_run_id |
| if xcom_key is not None: |
| _path_params['xcom_key'] = xcom_key |
| # process the query parameters |
| if map_index is not None: |
| |
| _query_params.append(('map_index', map_index)) |
| |
| if deserialize is not None: |
| |
| _query_params.append(('deserialize', deserialize)) |
| |
| if stringify is not None: |
| |
| _query_params.append(('stringify', stringify)) |
| |
| # 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}/dagRuns/{dag_run_id}/taskInstances/{task_id}/xcomEntries/{xcom_key}', |
| 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 update_xcom_entry( |
| self, |
| dag_id: StrictStr, |
| task_id: StrictStr, |
| dag_run_id: StrictStr, |
| xcom_key: StrictStr, |
| x_com_update_body: XComUpdateBody, |
| _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, |
| ) -> XComResponseNative: |
| """Update Xcom Entry |
| |
| Update an existing XCom entry. |
| |
| :param dag_id: (required) |
| :type dag_id: str |
| :param task_id: (required) |
| :type task_id: str |
| :param dag_run_id: (required) |
| :type dag_run_id: str |
| :param xcom_key: (required) |
| :type xcom_key: str |
| :param x_com_update_body: (required) |
| :type x_com_update_body: XComUpdateBody |
| :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._update_xcom_entry_serialize( |
| dag_id=dag_id, |
| task_id=task_id, |
| dag_run_id=dag_run_id, |
| xcom_key=xcom_key, |
| x_com_update_body=x_com_update_body, |
| _request_auth=_request_auth, |
| _content_type=_content_type, |
| _headers=_headers, |
| _host_index=_host_index |
| ) |
| |
| _response_types_map: Dict[str, Optional[str]] = { |
| '200': "XComResponseNative", |
| '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 update_xcom_entry_with_http_info( |
| self, |
| dag_id: StrictStr, |
| task_id: StrictStr, |
| dag_run_id: StrictStr, |
| xcom_key: StrictStr, |
| x_com_update_body: XComUpdateBody, |
| _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[XComResponseNative]: |
| """Update Xcom Entry |
| |
| Update an existing XCom entry. |
| |
| :param dag_id: (required) |
| :type dag_id: str |
| :param task_id: (required) |
| :type task_id: str |
| :param dag_run_id: (required) |
| :type dag_run_id: str |
| :param xcom_key: (required) |
| :type xcom_key: str |
| :param x_com_update_body: (required) |
| :type x_com_update_body: XComUpdateBody |
| :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._update_xcom_entry_serialize( |
| dag_id=dag_id, |
| task_id=task_id, |
| dag_run_id=dag_run_id, |
| xcom_key=xcom_key, |
| x_com_update_body=x_com_update_body, |
| _request_auth=_request_auth, |
| _content_type=_content_type, |
| _headers=_headers, |
| _host_index=_host_index |
| ) |
| |
| _response_types_map: Dict[str, Optional[str]] = { |
| '200': "XComResponseNative", |
| '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 update_xcom_entry_without_preload_content( |
| self, |
| dag_id: StrictStr, |
| task_id: StrictStr, |
| dag_run_id: StrictStr, |
| xcom_key: StrictStr, |
| x_com_update_body: XComUpdateBody, |
| _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: |
| """Update Xcom Entry |
| |
| Update an existing XCom entry. |
| |
| :param dag_id: (required) |
| :type dag_id: str |
| :param task_id: (required) |
| :type task_id: str |
| :param dag_run_id: (required) |
| :type dag_run_id: str |
| :param xcom_key: (required) |
| :type xcom_key: str |
| :param x_com_update_body: (required) |
| :type x_com_update_body: XComUpdateBody |
| :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._update_xcom_entry_serialize( |
| dag_id=dag_id, |
| task_id=task_id, |
| dag_run_id=dag_run_id, |
| xcom_key=xcom_key, |
| x_com_update_body=x_com_update_body, |
| _request_auth=_request_auth, |
| _content_type=_content_type, |
| _headers=_headers, |
| _host_index=_host_index |
| ) |
| |
| _response_types_map: Dict[str, Optional[str]] = { |
| '200': "XComResponseNative", |
| '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 _update_xcom_entry_serialize( |
| self, |
| dag_id, |
| task_id, |
| dag_run_id, |
| xcom_key, |
| x_com_update_body, |
| _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 |
| if task_id is not None: |
| _path_params['task_id'] = task_id |
| if dag_run_id is not None: |
| _path_params['dag_run_id'] = dag_run_id |
| if xcom_key is not None: |
| _path_params['xcom_key'] = xcom_key |
| # process the query parameters |
| # process the header parameters |
| # process the form parameters |
| # process the body parameter |
| if x_com_update_body is not None: |
| _body_params = x_com_update_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}/dagRuns/{dag_run_id}/taskInstances/{task_id}/xcomEntries/{xcom_key}', |
| 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 |
| ) |
| |
| |