airflow.providers.google.cloud.operators.bigtable

This module contains Google Cloud Bigtable operators.

Module Contents

class airflow.providers.google.cloud.operators.bigtable.BigtableValidationMixin[source]

Common class for Cloud Bigtable operators for validating required fields.

REQUIRED_ATTRIBUTES :Iterable[str] = [][source]
class airflow.providers.google.cloud.operators.bigtable.BigtableCreateInstanceOperator(*, instance_id: str, main_cluster_id: str, main_cluster_zone: str, project_id: Optional[str] = None, replica_clusters: Optional[List[Dict[str, str]]] = None, replica_cluster_id: Optional[str] = None, replica_cluster_zone: Optional[str] = None, instance_display_name: Optional[str] = None, instance_type: Optional[enums.Instance.Type] = None, instance_labels: Optional[Dict] = None, cluster_nodes: Optional[int] = None, cluster_storage_type: Optional[enums.StorageType] = None, timeout: Optional[float] = None, gcp_conn_id: str = 'google_cloud_default', impersonation_chain: Optional[Union[str, Sequence[str]]] = None, **kwargs)[source]

Bases: airflow.models.BaseOperator, airflow.providers.google.cloud.operators.bigtable.BigtableValidationMixin

Creates a new Cloud Bigtable instance. If the Cloud Bigtable instance with the given ID exists, the operator does not compare its configuration and immediately succeeds. No changes are made to the existing instance.

For more details about instance creation have a look at the reference: https://googleapis.github.io/google-cloud-python/latest/bigtable/instance.html#google.cloud.bigtable.instance.Instance.create

See also

For more information on how to use this operator, take a look at the guide: BigtableCreateInstanceOperator

Parameters
  • instance_id (str) – The ID of the Cloud Bigtable instance to create.

  • main_cluster_id (str) – The ID for main cluster for the new instance.

  • main_cluster_zone (str) – The zone for main cluster See https://cloud.google.com/bigtable/docs/locations for more details.

  • project_id (str) – Optional, the ID of the Google Cloud project. If set to None or missing, the default project_id from the Google Cloud connection is used.

  • replica_clusters (List[Dict[str, str]]) – (optional) A list of replica clusters for the new instance. Each cluster dictionary contains an id and a zone. Example: [{“id”: “replica-1”, “zone”: “us-west1-a”}]

  • replica_cluster_id (str) – (deprecated) The ID for replica cluster for the new instance.

  • replica_cluster_zone (str) – (deprecated) The zone for replica cluster.

  • instance_type (enum.IntEnum) – (optional) The type of the instance.

  • instance_display_name (str) – (optional) Human-readable name of the instance. Defaults to instance_id.

  • instance_labels (dict) – (optional) Dictionary of labels to associate with the instance.

  • cluster_nodes (int) – (optional) Number of nodes for cluster.

  • cluster_storage_type (enum.IntEnum) – (optional) The type of storage.

  • timeout (int) – (optional) timeout (in seconds) for instance creation. If None is not specified, Operator will wait indefinitely.

  • gcp_conn_id (str) – The connection ID to use to connect to Google Cloud.

  • impersonation_chain (Union[str, Sequence[str]]) – Optional service account to impersonate using short-term credentials, or chained list of accounts required to get the access_token of the last account in the list, which will be impersonated in the request. If set as a string, the account must grant the originating account the Service Account Token Creator IAM role. If set as a sequence, the identities from the list must grant Service Account Token Creator IAM role to the directly preceding identity, with first account from the list granting this role to the originating account (templated).

REQUIRED_ATTRIBUTES :Iterable[str] = ['instance_id', 'main_cluster_id', 'main_cluster_zone'][source]
template_fields :Iterable[str] = ['project_id', 'instance_id', 'main_cluster_id', 'main_cluster_zone', 'impersonation_chain'][source]
execute(self, context)[source]
class airflow.providers.google.cloud.operators.bigtable.BigtableUpdateInstanceOperator(*, instance_id: str, project_id: Optional[str] = None, instance_display_name: Optional[str] = None, instance_type: Optional[Union[enums.Instance.Type, enum.IntEnum]] = None, instance_labels: Optional[Dict] = None, timeout: Optional[float] = None, gcp_conn_id: str = 'google_cloud_default', impersonation_chain: Optional[Union[str, Sequence[str]]] = None, **kwargs)[source]

Bases: airflow.models.BaseOperator, airflow.providers.google.cloud.operators.bigtable.BigtableValidationMixin

Updates an existing Cloud Bigtable instance.

For more details about instance creation have a look at the reference: https://googleapis.dev/python/bigtable/latest/instance.html#google.cloud.bigtable.instance.Instance.update

See also

For more information on how to use this operator, take a look at the guide: BigtableUpdateInstanceOperator

Parameters
  • instance_id (str) – The ID of the Cloud Bigtable instance to update.

  • project_id (str) – Optional, the ID of the Google Cloud project. If set to None or missing, the default project_id from the Google Cloud connection is used.

  • instance_display_name (str) – (optional) Human-readable name of the instance.

  • instance_type (enums.Instance.Type or enum.IntEnum) – (optional) The type of the instance.

  • instance_labels (dict) – (optional) Dictionary of labels to associate with the instance.

  • timeout (int) – (optional) timeout (in seconds) for instance update. If None is not specified, Operator will wait indefinitely.

  • gcp_conn_id (str) – The connection ID to use to connect to Google Cloud.

  • impersonation_chain (Union[str, Sequence[str]]) – Optional service account to impersonate using short-term credentials, or chained list of accounts required to get the access_token of the last account in the list, which will be impersonated in the request. If set as a string, the account must grant the originating account the Service Account Token Creator IAM role. If set as a sequence, the identities from the list must grant Service Account Token Creator IAM role to the directly preceding identity, with first account from the list granting this role to the originating account (templated).

REQUIRED_ATTRIBUTES :Iterable[str] = ['instance_id'][source]
template_fields :Iterable[str] = ['project_id', 'instance_id', 'impersonation_chain'][source]
execute(self, context)[source]
class airflow.providers.google.cloud.operators.bigtable.BigtableDeleteInstanceOperator(*, instance_id: str, project_id: Optional[str] = None, gcp_conn_id: str = 'google_cloud_default', impersonation_chain: Optional[Union[str, Sequence[str]]] = None, **kwargs)[source]

Bases: airflow.models.BaseOperator, airflow.providers.google.cloud.operators.bigtable.BigtableValidationMixin

Deletes the Cloud Bigtable instance, including its clusters and all related tables.

For more details about deleting instance have a look at the reference: https://googleapis.github.io/google-cloud-python/latest/bigtable/instance.html#google.cloud.bigtable.instance.Instance.delete

See also

For more information on how to use this operator, take a look at the guide: BigtableDeleteInstanceOperator

Parameters
  • instance_id (str) – The ID of the Cloud Bigtable instance to delete.

  • project_id (str) – Optional, the ID of the Google Cloud project. If set to None or missing, the default project_id from the Google Cloud connection is used.

  • gcp_conn_id (str) – The connection ID to use to connect to Google Cloud.

  • impersonation_chain (Union[str, Sequence[str]]) – Optional service account to impersonate using short-term credentials, or chained list of accounts required to get the access_token of the last account in the list, which will be impersonated in the request. If set as a string, the account must grant the originating account the Service Account Token Creator IAM role. If set as a sequence, the identities from the list must grant Service Account Token Creator IAM role to the directly preceding identity, with first account from the list granting this role to the originating account (templated).

REQUIRED_ATTRIBUTES :Iterable[str] = ['instance_id'][source]
template_fields :Iterable[str] = ['project_id', 'instance_id', 'impersonation_chain'][source]
execute(self, context)[source]
class airflow.providers.google.cloud.operators.bigtable.BigtableCreateTableOperator(*, instance_id: str, table_id: str, project_id: Optional[str] = None, initial_split_keys: Optional[List] = None, column_families: Optional[Dict[str, GarbageCollectionRule]] = None, gcp_conn_id: str = 'google_cloud_default', impersonation_chain: Optional[Union[str, Sequence[str]]] = None, **kwargs)[source]

Bases: airflow.models.BaseOperator, airflow.providers.google.cloud.operators.bigtable.BigtableValidationMixin

Creates the table in the Cloud Bigtable instance.

For more details about creating table have a look at the reference: https://googleapis.github.io/google-cloud-python/latest/bigtable/table.html#google.cloud.bigtable.table.Table.create

See also

For more information on how to use this operator, take a look at the guide: BigtableCreateTableOperator

Parameters
  • instance_id (str) – The ID of the Cloud Bigtable instance that will hold the new table.

  • table_id (str) – The ID of the table to be created.

  • project_id (str) – Optional, the ID of the Google Cloud project. If set to None or missing, the default project_id from the Google Cloud connection is used.

  • initial_split_keys (list) – (Optional) list of row keys in bytes that will be used to initially split the table into several tablets.

  • column_families (dict) – (Optional) A map columns to create. The key is the column_id str and the value is a google.cloud.bigtable.column_family.GarbageCollectionRule

  • gcp_conn_id (str) – The connection ID to use to connect to Google Cloud.

  • impersonation_chain (Union[str, Sequence[str]]) – Optional service account to impersonate using short-term credentials, or chained list of accounts required to get the access_token of the last account in the list, which will be impersonated in the request. If set as a string, the account must grant the originating account the Service Account Token Creator IAM role. If set as a sequence, the identities from the list must grant Service Account Token Creator IAM role to the directly preceding identity, with first account from the list granting this role to the originating account (templated).

REQUIRED_ATTRIBUTES :Iterable[str] = ['instance_id', 'table_id'][source]
template_fields :Iterable[str] = ['project_id', 'instance_id', 'table_id', 'impersonation_chain'][source]
execute(self, context)[source]
class airflow.providers.google.cloud.operators.bigtable.BigtableDeleteTableOperator(*, instance_id: str, table_id: str, project_id: Optional[str] = None, app_profile_id: Optional[str] = None, gcp_conn_id: str = 'google_cloud_default', impersonation_chain: Optional[Union[str, Sequence[str]]] = None, **kwargs)[source]

Bases: airflow.models.BaseOperator, airflow.providers.google.cloud.operators.bigtable.BigtableValidationMixin

Deletes the Cloud Bigtable table.

For more details about deleting table have a look at the reference: https://googleapis.github.io/google-cloud-python/latest/bigtable/table.html#google.cloud.bigtable.table.Table.delete

See also

For more information on how to use this operator, take a look at the guide: BigtableDeleteTableOperator

Parameters
  • instance_id (str) – The ID of the Cloud Bigtable instance.

  • table_id (str) – The ID of the table to be deleted.

  • project_id (str) – Optional, the ID of the Google Cloud project. If set to None or missing, the default project_id from the Google Cloud connection is used.

  • app_profile_id (str) – Application profile.

  • gcp_conn_id (str) – The connection ID to use to connect to Google Cloud.

  • impersonation_chain (Union[str, Sequence[str]]) – Optional service account to impersonate using short-term credentials, or chained list of accounts required to get the access_token of the last account in the list, which will be impersonated in the request. If set as a string, the account must grant the originating account the Service Account Token Creator IAM role. If set as a sequence, the identities from the list must grant Service Account Token Creator IAM role to the directly preceding identity, with first account from the list granting this role to the originating account (templated).

REQUIRED_ATTRIBUTES :Iterable[str] = ['instance_id', 'table_id'][source]
template_fields :Iterable[str] = ['project_id', 'instance_id', 'table_id', 'impersonation_chain'][source]
execute(self, context)[source]
class airflow.providers.google.cloud.operators.bigtable.BigtableUpdateClusterOperator(*, instance_id: str, cluster_id: str, nodes: int, project_id: Optional[str] = None, gcp_conn_id: str = 'google_cloud_default', impersonation_chain: Optional[Union[str, Sequence[str]]] = None, **kwargs)[source]

Bases: airflow.models.BaseOperator, airflow.providers.google.cloud.operators.bigtable.BigtableValidationMixin

Updates a Cloud Bigtable cluster.

For more details about updating a Cloud Bigtable cluster, have a look at the reference: https://googleapis.github.io/google-cloud-python/latest/bigtable/cluster.html#google.cloud.bigtable.cluster.Cluster.update

See also

For more information on how to use this operator, take a look at the guide: BigtableUpdateClusterOperator

Parameters
  • instance_id (str) – The ID of the Cloud Bigtable instance.

  • cluster_id (str) – The ID of the Cloud Bigtable cluster to update.

  • nodes (int) – The desired number of nodes for the Cloud Bigtable cluster.

  • project_id (str) – Optional, the ID of the Google Cloud project.

  • gcp_conn_id (str) – The connection ID to use to connect to Google Cloud.

  • impersonation_chain (Union[str, Sequence[str]]) – Optional service account to impersonate using short-term credentials, or chained list of accounts required to get the access_token of the last account in the list, which will be impersonated in the request. If set as a string, the account must grant the originating account the Service Account Token Creator IAM role. If set as a sequence, the identities from the list must grant Service Account Token Creator IAM role to the directly preceding identity, with first account from the list granting this role to the originating account (templated).

REQUIRED_ATTRIBUTES :Iterable[str] = ['instance_id', 'cluster_id', 'nodes'][source]
template_fields :Iterable[str] = ['project_id', 'instance_id', 'cluster_id', 'nodes', 'impersonation_chain'][source]
execute(self, context)[source]

Was this entry helpful?