airflow.providers.google.cloud.hooks.cloud_composer
¶
Module Contents¶
Classes¶
Hook for Google Cloud Composer 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(self)[source]¶
Retrieves client library object that allow access Environments service.
- get_image_versions_client(self)[source]¶
Retrieves client library object that allow access Image Versions service.
- wait_for_operation(self, operation, timeout=None)[source]¶
Waits for long-lasting operation to complete.
- create_environment(self, 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 (Union[google.cloud.orchestration.airflow.service_v1.types.Environment, Dict]) -- The environment to create. This corresponds to the
environment
field on therequest
instance; ifrequest
is provided, this should not be set.retry (Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault]) -- Designation of what errors, if any, should be retried.
timeout (Optional[float]) -- The timeout for this request.
metadata (Sequence[Tuple[str, str]]) -- Strings which should be sent along with the request as metadata.
- delete_environment(self, 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 (Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault]) -- Designation of what errors, if any, should be retried.
timeout (Optional[float]) -- The timeout for this request.
metadata (Sequence[Tuple[str, str]]) -- Strings which should be sent along with the request as metadata.
- get_environment(self, 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(self, 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 (Optional[int]) -- The maximum number of environments to return.
page_token (Optional[str]) -- The next_page_token value returned from a previous List request, if any.
retry (Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault]) -- Designation of what errors, if any, should be retried.
timeout (Optional[float]) -- The timeout for this request.
metadata (Sequence[Tuple[str, str]]) -- Strings which should be sent along with the request as metadata.
- update_environment(self, 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 (Union[google.cloud.orchestration.airflow.service_v1.types.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 (Union[Dict, google.protobuf.field_mask_pb2.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 (Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault]) -- Designation of what errors, if any, should be retried.
timeout (Optional[float]) -- The timeout for this request.
metadata (Sequence[Tuple[str, str]]) -- Strings which should be sent along with the request as metadata.
- list_image_versions(self, 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 (Optional[int]) -- The maximum number of environments to return.
page_token (Optional[str]) -- The next_page_token value returned from a previous List request, if any.
include_past_releases (bool) -- Flag to include past releases
retry (Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault]) -- Designation of what errors, if any, should be retried.
timeout (Optional[float]) -- The timeout for this request.
metadata (Sequence[Tuple[str, str]]) -- Strings which should be sent along with the request as metadata.