| :py:mod:`airflow.providers.google.cloud.hooks.workflows` |
| ======================================================== |
| |
| .. py:module:: airflow.providers.google.cloud.hooks.workflows |
| |
| |
| Module Contents |
| --------------- |
| |
| Classes |
| ~~~~~~~ |
| |
| .. autoapisummary:: |
| |
| airflow.providers.google.cloud.hooks.workflows.WorkflowsHook |
| |
| |
| |
| |
| .. py:class:: WorkflowsHook(gcp_conn_id = 'google_cloud_default', delegate_to = None, impersonation_chain = None) |
| |
| Bases: :py:obj:`airflow.providers.google.common.hooks.base_google.GoogleBaseHook` |
| |
| Hook for Google GCP APIs. |
| |
| All the methods in the hook where project_id is used must be called with |
| keyword arguments rather than positional. |
| |
| .. py:method:: get_workflows_client(self) |
| |
| Returns WorkflowsClient. |
| |
| |
| .. py:method:: get_executions_client(self) |
| |
| Returns ExecutionsClient. |
| |
| |
| .. py:method:: create_workflow(self, workflow, workflow_id, location, project_id = PROVIDE_PROJECT_ID, retry = DEFAULT, timeout = None, metadata = ()) |
| |
| 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. |
| |
| :param workflow: Required. Workflow to be created. |
| :param workflow_id: Required. The ID of the workflow to be created. |
| :param project_id: Required. The ID of the Google Cloud project the cluster belongs to. |
| :param location: Required. The GCP region in which to handle the request. |
| :param retry: A retry object used to retry requests. If ``None`` is specified, requests will not be |
| retried. |
| :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. |
| :param metadata: Additional metadata that is provided to the method. |
| |
| |
| .. py:method:: get_workflow(self, workflow_id, location, project_id = PROVIDE_PROJECT_ID, retry = DEFAULT, timeout = None, metadata = ()) |
| |
| Gets details of a single Workflow. |
| |
| :param workflow_id: Required. The ID of the workflow to be created. |
| :param project_id: Required. The ID of the Google Cloud project the cluster belongs to. |
| :param location: Required. The GCP region in which to handle the request. |
| :param retry: A retry object used to retry requests. If ``None`` is specified, requests will not be |
| retried. |
| :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. |
| :param metadata: Additional metadata that is provided to the method. |
| |
| |
| .. py:method:: update_workflow(self, workflow, update_mask = None, retry = DEFAULT, timeout = None, metadata = ()) |
| |
| 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. |
| |
| :param workflow: Required. Workflow to be created. |
| :param update_mask: List of fields to be updated. If not present, |
| the entire workflow will be updated. |
| :param retry: A retry object used to retry requests. If ``None`` is specified, requests will not be |
| retried. |
| :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. |
| :param metadata: Additional metadata that is provided to the method. |
| |
| |
| .. py:method:: delete_workflow(self, workflow_id, location, project_id = PROVIDE_PROJECT_ID, retry = DEFAULT, timeout = None, metadata = ()) |
| |
| Deletes a workflow with the specified name. |
| This method also cancels and deletes all running |
| executions of the workflow. |
| |
| :param workflow_id: Required. The ID of the workflow to be created. |
| :param project_id: Required. The ID of the Google Cloud project the cluster belongs to. |
| :param location: Required. The GCP region in which to handle the request. |
| :param retry: A retry object used to retry requests. If ``None`` is specified, requests will not be |
| retried. |
| :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. |
| :param metadata: Additional metadata that is provided to the method. |
| |
| |
| .. py:method:: list_workflows(self, location, project_id = PROVIDE_PROJECT_ID, filter_ = None, order_by = None, retry = DEFAULT, timeout = None, metadata = ()) |
| |
| Lists Workflows in a given project and location. |
| The default order is not specified. |
| |
| :param filter_: Filter to restrict results to specific workflows. |
| :param order_by: Comma-separated list of fields that |
| specifies 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. |
| :param project_id: Required. The ID of the Google Cloud project the cluster belongs to. |
| :param location: Required. The GCP region in which to handle the request. |
| :param retry: A retry object used to retry requests. If ``None`` is specified, requests will not be |
| retried. |
| :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. |
| :param metadata: Additional metadata that is provided to the method. |
| |
| |
| .. py:method:: create_execution(self, workflow_id, location, execution, project_id = PROVIDE_PROJECT_ID, retry = DEFAULT, timeout = None, metadata = ()) |
| |
| Creates a new execution using the latest revision of |
| the given workflow. |
| |
| :param execution: Required. Input parameters of the execution represented as a dictionary. |
| :param workflow_id: Required. The ID of the workflow. |
| :param project_id: Required. The ID of the Google Cloud project the cluster belongs to. |
| :param location: Required. The GCP region in which to handle the request. |
| :param retry: A retry object used to retry requests. If ``None`` is specified, requests will not be |
| retried. |
| :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. |
| :param metadata: Additional metadata that is provided to the method. |
| |
| |
| .. py:method:: get_execution(self, workflow_id, execution_id, location, project_id = PROVIDE_PROJECT_ID, retry = DEFAULT, timeout = None, metadata = ()) |
| |
| Returns an execution for the given ``workflow_id`` and ``execution_id``. |
| |
| :param workflow_id: Required. The ID of the workflow. |
| :param execution_id: Required. The ID of the execution. |
| :param project_id: Required. The ID of the Google Cloud project the cluster belongs to. |
| :param location: Required. The GCP region in which to handle the request. |
| :param retry: A retry object used to retry requests. If ``None`` is specified, requests will not be |
| retried. |
| :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. |
| :param metadata: Additional metadata that is provided to the method. |
| |
| |
| .. py:method:: cancel_execution(self, workflow_id, execution_id, location, project_id = PROVIDE_PROJECT_ID, retry = DEFAULT, timeout = None, metadata = ()) |
| |
| Cancels an execution using the given ``workflow_id`` and ``execution_id``. |
| |
| :param workflow_id: Required. The ID of the workflow. |
| :param execution_id: Required. The ID of the execution. |
| :param project_id: Required. The ID of the Google Cloud project the cluster belongs to. |
| :param location: Required. The GCP region in which to handle the request. |
| :param retry: A retry object used to retry requests. If ``None`` is specified, requests will not be |
| retried. |
| :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. |
| :param metadata: Additional metadata that is provided to the method. |
| |
| |
| .. py:method:: list_executions(self, workflow_id, location, project_id = PROVIDE_PROJECT_ID, retry = DEFAULT, timeout = None, metadata = ()) |
| |
| 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). |
| |
| :param workflow_id: Required. The ID of the workflow to be created. |
| :param project_id: Required. The ID of the Google Cloud project the cluster belongs to. |
| :param location: Required. The GCP region in which to handle the request. |
| :param retry: A retry object used to retry requests. If ``None`` is specified, requests will not be |
| retried. |
| :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. |
| :param metadata: Additional metadata that is provided to the method. |
| |
| |
| |