blob: 5cb2588a05db4f77d516c11d19c944a7a42ed9dc [file] [log] [blame]
:mod:`airflow.providers.google.cloud.operators.workflows`
=========================================================
.. py:module:: airflow.providers.google.cloud.operators.workflows
Module Contents
---------------
.. py:class:: WorkflowsCreateWorkflowOperator(*, workflow: Dict, workflow_id: str, location: str, project_id: Optional[str] = None, retry: Optional[Retry] = None, timeout: Optional[float] = None, metadata: Optional[Sequence[Tuple[str, str]]] = None, gcp_conn_id: str = 'google_cloud_default', force_rerun: bool = False, impersonation_chain: Optional[Union[str, Sequence[str]]] = None, **kwargs)
Bases: :class:`airflow.models.BaseOperator`
Creates a new workflow. If a workflow with the specified name
already exists in the specified project and location, the long
running operation will return
[ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error.
.. seealso::
For more information on how to use this operator, take a look at the guide:
:ref:`howto/operator:WorkflowsCreateWorkflowOperator`
:param workflow: Required. Workflow to be created.
:type workflow: Dict
:param workflow_id: Required. The ID of the workflow to be created.
:type workflow_id: str
:param project_id: Required. The ID of the Google Cloud project the cluster belongs to.
:type project_id: str
:param location: Required. The GCP region in which to handle the request.
:type location: str
:param retry: A retry object used to retry requests. If ``None`` is specified, requests will not be
retried.
:type retry: google.api_core.retry.Retry
:param timeout: The amount of time, in seconds, to wait for the request to complete. Note that if
``retry`` is specified, the timeout applies to each individual attempt.
:type timeout: float
:param metadata: Additional metadata that is provided to the method.
:type metadata: Sequence[Tuple[str, str]]
.. attribute:: template_fields
:annotation: = ['location', 'workflow', 'workflow_id']
.. attribute:: template_fields_renderers
.. method:: _workflow_id(self, context)
.. method:: execute(self, context)
.. py:class:: WorkflowsUpdateWorkflowOperator(*, workflow_id: str, location: str, project_id: Optional[str] = None, update_mask: Optional[FieldMask] = None, retry: Optional[Retry] = None, timeout: Optional[float] = None, metadata: Optional[Sequence[Tuple[str, str]]] = None, gcp_conn_id: str = 'google_cloud_default', impersonation_chain: Optional[Union[str, Sequence[str]]] = None, **kwargs)
Bases: :class:`airflow.models.BaseOperator`
Updates an existing workflow.
Running this method has no impact on already running
executions of the workflow. A new revision of the
workflow may be created as a result of a successful
update operation. In that case, such revision will be
used in new workflow executions.
.. seealso::
For more information on how to use this operator, take a look at the guide:
:ref:`howto/operator:WorkflowsUpdateWorkflowOperator`
:param workflow_id: Required. The ID of the workflow to be updated.
:type workflow_id: str
:param location: Required. The GCP region in which to handle the request.
:type location: str
:param project_id: Required. The ID of the Google Cloud project the cluster belongs to.
:type project_id: str
:param update_mask: List of fields to be updated. If not present,
the entire workflow will be updated.
:type update_mask: FieldMask
:param retry: A retry object used to retry requests. If ``None`` is specified, requests will not be
retried.
:type retry: google.api_core.retry.Retry
:param timeout: The amount of time, in seconds, to wait for the request to complete. Note that if
``retry`` is specified, the timeout applies to each individual attempt.
:type timeout: float
:param metadata: Additional metadata that is provided to the method.
:type metadata: Sequence[Tuple[str, str]]
.. attribute:: template_fields
:annotation: = ['workflow_id', 'update_mask']
.. attribute:: template_fields_renderers
.. method:: execute(self, context)
.. py:class:: WorkflowsDeleteWorkflowOperator(*, workflow_id: str, location: str, project_id: Optional[str] = None, retry: Optional[Retry] = None, timeout: Optional[float] = None, metadata: Optional[Sequence[Tuple[str, str]]] = None, gcp_conn_id: str = 'google_cloud_default', impersonation_chain: Optional[Union[str, Sequence[str]]] = None, **kwargs)
Bases: :class:`airflow.models.BaseOperator`
Deletes a workflow with the specified name.
This method also cancels and deletes all running
executions of the workflow.
.. seealso::
For more information on how to use this operator, take a look at the guide:
:ref:`howto/operator:WorkflowsDeleteWorkflowOperator`
:param workflow_id: Required. The ID of the workflow to be created.
:type workflow_id: str
:param project_id: Required. The ID of the Google Cloud project the cluster belongs to.
:type project_id: str
:param location: Required. The GCP region in which to handle the request.
:type location: str
:param retry: A retry object used to retry requests. If ``None`` is specified, requests will not be
retried.
:type retry: google.api_core.retry.Retry
:param timeout: The amount of time, in seconds, to wait for the request to complete. Note that if
``retry`` is specified, the timeout applies to each individual attempt.
:type timeout: float
:param metadata: Additional metadata that is provided to the method.
:type metadata: Sequence[Tuple[str, str]]
.. attribute:: template_fields
:annotation: = ['location', 'workflow_id']
.. method:: execute(self, context)
.. py:class:: WorkflowsListWorkflowsOperator(*, location: str, project_id: Optional[str] = None, filter_: Optional[str] = None, order_by: Optional[str] = None, retry: Optional[Retry] = None, timeout: Optional[float] = None, metadata: Optional[Sequence[Tuple[str, str]]] = None, gcp_conn_id: str = 'google_cloud_default', impersonation_chain: Optional[Union[str, Sequence[str]]] = None, **kwargs)
Bases: :class:`airflow.models.BaseOperator`
Lists Workflows in a given project and location.
The default order is not specified.
.. seealso::
For more information on how to use this operator, take a look at the guide:
:ref:`howto/operator:WorkflowsListWorkflowsOperator`
:param filter_: Filter to restrict results to specific workflows.
:type filter_: str
:param order_by: Comma-separated list of fields that that
specify the order of the results. Default sorting order for a field is ascending.
To specify descending order for a field, append a "desc" suffix.
If not specified, the results will be returned in an unspecified order.
:type order_by: str
:param project_id: Required. The ID of the Google Cloud project the cluster belongs to.
:type project_id: str
:param location: Required. The GCP region in which to handle the request.
:type location: str
:param retry: A retry object used to retry requests. If ``None`` is specified, requests will not be
retried.
:type retry: google.api_core.retry.Retry
:param timeout: The amount of time, in seconds, to wait for the request to complete. Note that if
``retry`` is specified, the timeout applies to each individual attempt.
:type timeout: float
:param metadata: Additional metadata that is provided to the method.
:type metadata: Sequence[Tuple[str, str]]
.. attribute:: template_fields
:annotation: = ['location', 'order_by', 'filter_']
.. method:: execute(self, context)
.. py:class:: WorkflowsGetWorkflowOperator(*, workflow_id: str, location: str, project_id: Optional[str] = None, retry: Optional[Retry] = None, timeout: Optional[float] = None, metadata: Optional[Sequence[Tuple[str, str]]] = None, gcp_conn_id: str = 'google_cloud_default', impersonation_chain: Optional[Union[str, Sequence[str]]] = None, **kwargs)
Bases: :class:`airflow.models.BaseOperator`
Gets details of a single Workflow.
.. seealso::
For more information on how to use this operator, take a look at the guide:
:ref:`howto/operator:WorkflowsGetWorkflowOperator`
:param workflow_id: Required. The ID of the workflow to be created.
:type workflow_id: str
:param project_id: Required. The ID of the Google Cloud project the cluster belongs to.
:type project_id: str
:param location: Required. The GCP region in which to handle the request.
:type location: str
:param retry: A retry object used to retry requests. If ``None`` is specified, requests will not be
retried.
:type retry: google.api_core.retry.Retry
:param timeout: The amount of time, in seconds, to wait for the request to complete. Note that if
``retry`` is specified, the timeout applies to each individual attempt.
:type timeout: float
:param metadata: Additional metadata that is provided to the method.
:type metadata: Sequence[Tuple[str, str]]
.. attribute:: template_fields
:annotation: = ['location', 'workflow_id']
.. method:: execute(self, context)
.. py:class:: WorkflowsCreateExecutionOperator(*, workflow_id: str, execution: Dict, location: str, project_id: Optional[str] = None, retry: Optional[Retry] = None, timeout: Optional[float] = None, metadata: Optional[Sequence[Tuple[str, str]]] = None, gcp_conn_id: str = 'google_cloud_default', impersonation_chain: Optional[Union[str, Sequence[str]]] = None, **kwargs)
Bases: :class:`airflow.models.BaseOperator`
Creates a new execution using the latest revision of
the given workflow.
.. seealso::
For more information on how to use this operator, take a look at the guide:
:ref:`howto/operator:WorkflowsCreateExecutionOperator`
:param execution: Required. Execution to be created.
:type execution: Dict
:param workflow_id: Required. The ID of the workflow.
:type workflow_id: str
:param project_id: Required. The ID of the Google Cloud project the cluster belongs to.
:type project_id: str
:param location: Required. The GCP region in which to handle the request.
:type location: str
:param retry: A retry object used to retry requests. If ``None`` is specified, requests will not be
retried.
:type retry: google.api_core.retry.Retry
:param timeout: The amount of time, in seconds, to wait for the request to complete. Note that if
``retry`` is specified, the timeout applies to each individual attempt.
:type timeout: float
:param metadata: Additional metadata that is provided to the method.
:type metadata: Sequence[Tuple[str, str]]
.. attribute:: template_fields
:annotation: = ['location', 'workflow_id', 'execution']
.. attribute:: template_fields_renderers
.. method:: execute(self, context)
.. py:class:: WorkflowsCancelExecutionOperator(*, workflow_id: str, execution_id: str, location: str, project_id: Optional[str] = None, retry: Optional[Retry] = None, timeout: Optional[float] = None, metadata: Optional[Sequence[Tuple[str, str]]] = None, gcp_conn_id: str = 'google_cloud_default', impersonation_chain: Optional[Union[str, Sequence[str]]] = None, **kwargs)
Bases: :class:`airflow.models.BaseOperator`
Cancels an execution using the given ``workflow_id`` and ``execution_id``.
.. seealso::
For more information on how to use this operator, take a look at the guide:
:ref:`howto/operator:WorkflowsCancelExecutionOperator`
:param workflow_id: Required. The ID of the workflow.
:type workflow_id: str
:param execution_id: Required. The ID of the execution.
:type execution_id: str
:param project_id: Required. The ID of the Google Cloud project the cluster belongs to.
:type project_id: str
:param location: Required. The GCP region in which to handle the request.
:type location: str
:param retry: A retry object used to retry requests. If ``None`` is specified, requests will not be
retried.
:type retry: google.api_core.retry.Retry
:param timeout: The amount of time, in seconds, to wait for the request to complete. Note that if
``retry`` is specified, the timeout applies to each individual attempt.
:type timeout: float
:param metadata: Additional metadata that is provided to the method.
:type metadata: Sequence[Tuple[str, str]]
.. attribute:: template_fields
:annotation: = ['location', 'workflow_id', 'execution_id']
.. method:: execute(self, context)
.. py:class:: WorkflowsListExecutionsOperator(*, workflow_id: str, location: str, start_date_filter: Optional[datetime] = None, project_id: Optional[str] = None, retry: Optional[Retry] = None, timeout: Optional[float] = None, metadata: Optional[Sequence[Tuple[str, str]]] = None, gcp_conn_id: str = 'google_cloud_default', impersonation_chain: Optional[Union[str, Sequence[str]]] = None, **kwargs)
Bases: :class:`airflow.models.BaseOperator`
Returns a list of executions which belong to the
workflow with the given name. The method returns
executions of all workflow revisions. Returned
executions are ordered by their start time (newest
first).
.. seealso::
For more information on how to use this operator, take a look at the guide:
:ref:`howto/operator:WorkflowsListExecutionsOperator`
:param workflow_id: Required. The ID of the workflow to be created.
:type workflow_id: str
:param start_date_filter: If passed only executions older that this date will be returned.
By default operators return executions from last 60 minutes
:type start_date_filter: datetime
:param project_id: Required. The ID of the Google Cloud project the cluster belongs to.
:type project_id: str
:param location: Required. The GCP region in which to handle the request.
:type location: str
:param retry: A retry object used to retry requests. If ``None`` is specified, requests will not be
retried.
:type retry: google.api_core.retry.Retry
:param timeout: The amount of time, in seconds, to wait for the request to complete. Note that if
``retry`` is specified, the timeout applies to each individual attempt.
:type timeout: float
:param metadata: Additional metadata that is provided to the method.
:type metadata: Sequence[Tuple[str, str]]
.. attribute:: template_fields
:annotation: = ['location', 'workflow_id']
.. method:: execute(self, context)
.. py:class:: WorkflowsGetExecutionOperator(*, workflow_id: str, execution_id: str, location: str, project_id: Optional[str] = None, retry: Optional[Retry] = None, timeout: Optional[float] = None, metadata: Optional[Sequence[Tuple[str, str]]] = None, gcp_conn_id: str = 'google_cloud_default', impersonation_chain: Optional[Union[str, Sequence[str]]] = None, **kwargs)
Bases: :class:`airflow.models.BaseOperator`
Returns an execution for the given ``workflow_id`` and ``execution_id``.
.. seealso::
For more information on how to use this operator, take a look at the guide:
:ref:`howto/operator:WorkflowsGetExecutionOperator`
:param workflow_id: Required. The ID of the workflow.
:type workflow_id: str
:param execution_id: Required. The ID of the execution.
:type execution_id: str
:param project_id: Required. The ID of the Google Cloud project the cluster belongs to.
:type project_id: str
:param location: Required. The GCP region in which to handle the request.
:type location: str
:param retry: A retry object used to retry requests. If ``None`` is specified, requests will not be
retried.
:type retry: google.api_core.retry.Retry
:param timeout: The amount of time, in seconds, to wait for the request to complete. Note that if
``retry`` is specified, the timeout applies to each individual attempt.
:type timeout: float
:param metadata: Additional metadata that is provided to the method.
:type metadata: Sequence[Tuple[str, str]]
.. attribute:: template_fields
:annotation: = ['location', 'workflow_id', 'execution_id']
.. method:: execute(self, context)