airflow.providers.google.cloud.hooks.cloud_composer
¶
Module Contents¶
Classes¶
Hook for Google Cloud Composer APIs. |
|
Hook for Google Cloud Composer async APIs. |
- class airflow.providers.google.cloud.hooks.cloud_composer.CloudComposerHook(gcp_conn_id='google_cloud_default', delegate_to=None, impersonation_chain=None)[source]¶
Bases:
airflow.providers.google.common.hooks.base_google.GoogleBaseHook
Hook for Google Cloud Composer APIs.
- get_environment_client()[source]¶
Retrieves client library object that allow access Environments service.
- get_image_versions_client()[source]¶
Retrieves client library object that allow access Image Versions service.
- create_environment(project_id, region, environment, retry=DEFAULT, timeout=None, metadata=())[source]¶
Create a new environment.
- Parameters
project_id (str) – Required. The ID of the Google Cloud project that the service belongs to.
region (str) – Required. The ID of the Google Cloud region that the service belongs to.
environment (Environment | dict) – The environment to create. This corresponds to the
environment
field on therequest
instance; ifrequest
is provided, this should not be set.retry (Retry | _MethodDefault) – Designation of what errors, if any, should be retried.
timeout (float | None) – The timeout for this request.
metadata (Sequence[tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- delete_environment(project_id, region, environment_id, retry=DEFAULT, timeout=None, metadata=())[source]¶
Delete an environment.
- Parameters
project_id (str) – Required. The ID of the Google Cloud project that the service belongs to.
region (str) – Required. The ID of the Google Cloud region that the service belongs to.
environment_id (str) – Required. The ID of the Google Cloud environment that the service belongs to.
retry (Retry | _MethodDefault) – Designation of what errors, if any, should be retried.
timeout (float | None) – The timeout for this request.
metadata (Sequence[tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- get_environment(project_id, region, environment_id, retry=DEFAULT, timeout=None, metadata=())[source]¶
Get an existing environment. :param project_id: Required. The ID of the Google Cloud project that the service belongs to. :param region: Required. The ID of the Google Cloud region that the service belongs to. :param environment_id: Required. The ID of the Google Cloud environment that the service belongs to. :param retry: Designation of what errors, if any, should be retried. :param timeout: The timeout for this request. :param metadata: Strings which should be sent along with the request as metadata.
- list_environments(project_id, region, page_size=None, page_token=None, retry=DEFAULT, timeout=None, metadata=())[source]¶
List environments.
- Parameters
project_id (str) – Required. The ID of the Google Cloud project that the service belongs to.
region (str) – Required. The ID of the Google Cloud region that the service belongs to.
page_size (int | None) – The maximum number of environments to return.
page_token (str | None) – The next_page_token value returned from a previous List request, if any.
retry (Retry | _MethodDefault) – Designation of what errors, if any, should be retried.
timeout (float | None) – The timeout for this request.
metadata (Sequence[tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- update_environment(project_id, region, environment_id, environment, update_mask, retry=DEFAULT, timeout=None, metadata=())[source]¶
Update an environment.
- Parameters
project_id (str) – Required. The ID of the Google Cloud project that the service belongs to.
region (str) – Required. The ID of the Google Cloud region that the service belongs to.
environment_id (str) – Required. The ID of the Google Cloud environment that the service belongs to.
environment (Environment | dict) –
A patch environment. Fields specified by the
updateMask
will be copied from the patch environment into the environment under update.This corresponds to the
environment
field on therequest
instance; ifrequest
is provided, this should not be set.update_mask (dict | FieldMask) – Required. A comma-separated list of paths, relative to
Environment
, of fields to update. If a dict is provided, it must be of the same form as the protobuf messageFieldMask
retry (Retry | _MethodDefault) – Designation of what errors, if any, should be retried.
timeout (float | None) – The timeout for this request.
metadata (Sequence[tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- list_image_versions(project_id, region, page_size=None, page_token=None, include_past_releases=False, retry=DEFAULT, timeout=None, metadata=())[source]¶
List ImageVersions for provided location.
- Parameters
project_id (str) – Required. The ID of the Google Cloud project that the service belongs to.
region (str) – Required. The ID of the Google Cloud region that the service belongs to.
page_size (int | None) – The maximum number of environments to return.
page_token (str | None) – The next_page_token value returned from a previous List request, if any.
include_past_releases (bool) – Flag to include past releases
retry (Retry | _MethodDefault) – Designation of what errors, if any, should be retried.
timeout (float | None) – The timeout for this request.
metadata (Sequence[tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- class airflow.providers.google.cloud.hooks.cloud_composer.CloudComposerAsyncHook(gcp_conn_id='google_cloud_default', delegate_to=None, impersonation_chain=None)[source]¶
Bases:
airflow.providers.google.common.hooks.base_google.GoogleBaseHook
Hook for Google Cloud Composer async APIs.
- get_environment_client()[source]¶
Retrieves client library object that allow access Environments service.
- async create_environment(project_id, region, environment, retry=DEFAULT, timeout=None, metadata=())[source]¶
Create a new environment.
- Parameters
project_id (str) – Required. The ID of the Google Cloud project that the service belongs to.
region (str) – Required. The ID of the Google Cloud region that the service belongs to.
environment (Environment | dict) – The environment to create. This corresponds to the
environment
field on therequest
instance; ifrequest
is provided, this should not be set.retry (Retry | _MethodDefault) – Designation of what errors, if any, should be retried.
timeout (float | None) – The timeout for this request.
metadata (Sequence[tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- async delete_environment(project_id, region, environment_id, retry=DEFAULT, timeout=None, metadata=())[source]¶
Delete an environment.
- Parameters
project_id (str) – Required. The ID of the Google Cloud project that the service belongs to.
region (str) – Required. The ID of the Google Cloud region that the service belongs to.
environment_id (str) – Required. The ID of the Google Cloud environment that the service belongs to.
retry (Retry | _MethodDefault) – Designation of what errors, if any, should be retried.
timeout (float | None) – The timeout for this request.
metadata (Sequence[tuple[str, str]]) – Strings which should be sent along with the request as metadata.
- async update_environment(project_id, region, environment_id, environment, update_mask, retry=DEFAULT, timeout=None, metadata=())[source]¶
Update an environment.
- Parameters
project_id (str) – Required. The ID of the Google Cloud project that the service belongs to.
region (str) – Required. The ID of the Google Cloud region that the service belongs to.
environment_id (str) – Required. The ID of the Google Cloud environment that the service belongs to.
environment (Environment | dict) –
A patch environment. Fields specified by the
updateMask
will be copied from the patch environment into the environment under update.This corresponds to the
environment
field on therequest
instance; ifrequest
is provided, this should not be set.update_mask (dict | FieldMask) – Required. A comma-separated list of paths, relative to
Environment
, of fields to update. If a dict is provided, it must be of the same form as the protobuf messageFieldMask
retry (Retry | _MethodDefault) – Designation of what errors, if any, should be retried.
timeout (float | None) – The timeout for this request.
metadata (Sequence[tuple[str, str]]) – Strings which should be sent along with the request as metadata.