airflow.providers.google.cloud.operators.bigtable

此模块包含Google Cloud Bigtable操作符。

BigtableValidationMixin

用于验证必需字段的Cloud Bigtable操作符通用类。

BigtableCreateInstanceOperator

创建新的Cloud Bigtable实例。

BigtableUpdateInstanceOperator

更新现有的Cloud Bigtable实例。

BigtableDeleteInstanceOperator

删除Cloud Bigtable实例,包括其集群和所有相关表。

BigtableCreateTableOperator

在Cloud Bigtable实例中创建表。

BigtableDeleteTableOperator

删除Cloud Bigtable表。

BigtableUpdateClusterOperator

更新Cloud Bigtable集群。

模块内容

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

用于验证必需字段的Cloud Bigtable操作符通用类。

REQUIRED_ATTRIBUTES: collections.abc.Iterable[str] = [][source]
class airflow.providers.google.cloud.operators.bigtable.BigtableCreateInstanceOperator(*, instance_id, main_cluster_id, main_cluster_zone, project_id=PROVIDE_PROJECT_ID, replica_clusters=None, instance_display_name=None, instance_type=None, instance_labels=None, cluster_nodes=None, cluster_storage_type=None, timeout=None, gcp_conn_id='google_cloud_default', impersonation_chain=None, **kwargs)[source]

基类: airflow.providers.google.cloud.operators.cloud_base.GoogleCloudBaseOperator, BigtableValidationMixin

创建新的Cloud Bigtable实例。

如果具有给定ID的Cloud Bigtable实例已存在,操作符不会比较其配置并立即成功。不会对现有实例进行任何更改。

有关实例创建的更多详细信息,请参阅参考资料: https://googleapis.github.io/google-cloud-python/latest/bigtable/instance.html#google.cloud.bigtable.instance.Instance.create

另请参阅

有关如何使用此操作符的更多信息,请参阅指南: BigtableCreateInstanceOperator

参数:
  • instance_id (str) – 要创建的Cloud Bigtable实例的ID。

  • main_cluster_id (str) – 新实例的主集群ID。

  • main_cluster_zone (str) – 主集群的区域。有关详细信息,请参阅 https://cloud.google.com/bigtable/docs/locations

  • project_id (str) – 可选,Google Cloud项目ID。如果设置为 None 或缺失,则使用Google Cloud连接中的默认 project_id。

  • replica_clusters (list[dict[str, str]] | None) – (可选) 新实例的副本集群列表。每个集群字典包含一个id和一个zone。示例:[{“id”: “replica-1”, “zone”: “us-west1-a”}]

  • instance_type (google.cloud.bigtable.enums.Instance.Type | None) – (可选) 实例类型。

  • instance_display_name (str | None) – (可选) 实例的人类可读名称。默认为 instance_id

  • instance_labels (dict | None) – (可选) 与实例关联的标签字典。

  • cluster_nodes (int | None) – (可选) 集群节点数。

  • cluster_storage_type (google.cloud.bigtable.enums.StorageType | None) – (可选) 存储类型。

  • timeout (float | None) – (可选) 实例创建超时时间(秒)。如果未指定 None,操作符将无限期等待。

  • gcp_conn_id (str) – 用于连接到Google Cloud的连接ID。

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – 可选的服务账号,用于使用短期凭据进行模拟,或者获取列表中最后一个账号的access_token所需的账号链,该账号将在请求中被模拟。如果设置为字符串,该账号必须授予原始账号Service Account Token Creator IAM角色。如果设置为序列,列表中的身份必须将Service Account Token Creator IAM角色授予紧邻的前一个身份,列表中第一个账号将此角色授予原始账号(模板化的)。

REQUIRED_ATTRIBUTES: collections.abc.Iterable[str] = ('instance_id', 'main_cluster_id', 'main_cluster_zone')[source]
template_fields: collections.abc.Sequence[str] = ('project_id', 'instance_id', 'main_cluster_id', 'main_cluster_zone', 'impersonation_chain')[source]
project_id = None[source]
instance_id[source]
main_cluster_id[source]
main_cluster_zone[source]
replica_clusters = None[source]
instance_display_name = None[source]
instance_type = None[source]
instance_labels = None[source]
cluster_nodes = None[source]
cluster_storage_type : google.cloud.bigtable.enums.StorageType | None = None[source]
timeout : float | None = None[source]
gcp_conn_id = 'google_cloud_default'[source]
impersonation_chain : str | collections.abc.Sequence[str] | None = None[source]
execute(context)[source]

在创建操作符时派生。

上下文与渲染jinja模板时使用的字典相同。

请参阅 get_template_context 获取更多上下文。

class airflow.providers.google.cloud.operators.bigtable.BigtableUpdateInstanceOperator(*, instance_id, project_id=PROVIDE_PROJECT_ID, instance_display_name=None, instance_type=None, instance_labels=None, timeout=None, gcp_conn_id='google_cloud_default', impersonation_chain=None, **kwargs)[source]

基类: airflow.providers.google.cloud.operators.cloud_base.GoogleCloudBaseOperator, BigtableValidationMixin

更新现有的Cloud Bigtable实例。

有关实例更新的更多详细信息,请参阅参考资料: https://googleapis.dev/python/bigtable/latest/instance.html#google.cloud.bigtable.instance.Instance.update

另请参阅

有关如何使用此操作符的更多信息,请参阅指南: BigtableUpdateInstanceOperator

参数:
  • instance_id (str) – 要更新的Cloud Bigtable实例的ID。

  • project_id (str) – 可选,Google Cloud项目ID。如果设置为 None 或缺失,则使用Google Cloud连接中的默认 project_id。

  • instance_display_name (str | None) – (可选) 实例的人类可读名称。

  • instance_type (google.cloud.bigtable.enums.Instance.Type | enum.IntEnum | None) – (可选) 实例类型。

  • instance_labels (dict | None) – (可选) 与实例关联的标签字典。

  • timeout (float | None) – (可选) 实例更新超时时间(秒)。如果未指定 None,操作符将无限期等待。

  • gcp_conn_id (str) – 用于连接到Google Cloud的连接ID。

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – 可选的服务账号,用于使用短期凭据进行模拟,或者获取列表中最后一个账号的access_token所需的账号链,该账号将在请求中被模拟。如果设置为字符串,该账号必须授予原始账号Service Account Token Creator IAM角色。如果设置为序列,列表中的身份必须将Service Account Token Creator IAM角色授予紧邻的前一个身份,列表中第一个账号将此角色授予原始账号(模板化的)。

REQUIRED_ATTRIBUTES: collections.abc.Iterable[str] = ['instance_id'][source]
template_fields: collections.abc.Sequence[str] = ('project_id', 'instance_id', 'impersonation_chain')[source]
project_id = None[source]
instance_id[source]
instance_display_name = None[source]
instance_type : google.cloud.bigtable.enums.Instance.Type | enum.IntEnum | None = None[source]
instance_labels = None[source]
timeout : float | None = None[source]
gcp_conn_id = 'google_cloud_default'[source]
impersonation_chain : str | collections.abc.Sequence[str] | None = None[source]
execute(context)[source]

在创建操作符时派生。

上下文与渲染jinja模板时使用的字典相同。

请参阅 get_template_context 获取更多上下文。

class airflow.providers.google.cloud.operators.bigtable.BigtableDeleteInstanceOperator(*, instance_id, project_id=PROVIDE_PROJECT_ID, gcp_conn_id='google_cloud_default', impersonation_chain=None, **kwargs)[source]

基类: airflow.providers.google.cloud.operators.cloud_base.GoogleCloudBaseOperator, BigtableValidationMixin

删除Cloud Bigtable实例,包括其集群和所有相关表。

有关删除实例的更多详细信息,请参阅参考资料: https://googleapis.github.io/google-cloud-python/latest/bigtable/instance.html#google.cloud.bigtable.instance.Instance.delete

另请参阅

有关如何使用此操作符的更多信息,请参阅指南: BigtableDeleteInstanceOperator

参数:
  • instance_id (str) – 要删除的Cloud Bigtable实例的ID。

  • project_id (str) – 可选,Google Cloud项目ID。如果设置为 None 或缺失,则使用Google Cloud连接中的默认 project_id。

  • gcp_conn_id (str) – 用于连接到Google Cloud的连接ID。

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – 可选的服务账号,用于使用短期凭据进行模拟,或者获取列表中最后一个账号的access_token所需的账号链,该账号将在请求中被模拟。如果设置为字符串,该账号必须授予原始账号Service Account Token Creator IAM角色。如果设置为序列,列表中的身份必须将Service Account Token Creator IAM角色授予紧邻的前一个身份,列表中第一个账号将此角色授予原始账号(模板化的)。

REQUIRED_ATTRIBUTES: collections.abc.Iterable[str] = ('instance_id',)[source]
template_fields: collections.abc.Sequence[str] = ('project_id', 'instance_id', 'impersonation_chain')[source]
project_id = None[source]
instance_id[source]
gcp_conn_id = 'google_cloud_default'[source]
impersonation_chain = None[source]
execute(context)[source]

在创建操作符时派生。

上下文与渲染jinja模板时使用的字典相同。

请参阅 get_template_context 获取更多上下文。

class airflow.providers.google.cloud.operators.bigtable.BigtableCreateTableOperator(*, instance_id, table_id, project_id=PROVIDE_PROJECT_ID, initial_split_keys=None, column_families=None, gcp_conn_id='google_cloud_default', impersonation_chain=None, **kwargs)[source]

基类: airflow.providers.google.cloud.operators.cloud_base.GoogleCloudBaseOperator, BigtableValidationMixin

在Cloud Bigtable实例中创建表。

有关创建表的更多详细信息,请参阅参考资料:https://googleapis.github.io/google-cloud-python/latest/bigtable/table.html#google.cloud.bigtable.table.Table.create

另请参阅

有关如何使用此 operator 的更多信息,请参阅指南:BigtableCreateTableOperator

参数:
  • instance_id (str) – 将保存新表的 Cloud Bigtable 实例的 ID。

  • table_id (str) – 要创建的表的 ID。

  • project_id (str) – 可选,Google Cloud项目ID。如果设置为 None 或缺失,则使用Google Cloud连接中的默认 project_id。

  • initial_split_keys (list | None) – (可选)用于将表初步分割成多个 tablet 的字节行键列表。

  • column_families (dict[str, google.cloud.bigtable.column_family.GarbageCollectionRule] | None) – (可选)要创建的列映射。键是 column_id 字符串,值是一个 google.cloud.bigtable.column_family.GarbageCollectionRule

  • gcp_conn_id (str) – 用于连接到Google Cloud的连接ID。

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – 可选的服务账号,用于使用短期凭据进行模拟,或者获取列表中最后一个账号的access_token所需的账号链,该账号将在请求中被模拟。如果设置为字符串,该账号必须授予原始账号Service Account Token Creator IAM角色。如果设置为序列,列表中的身份必须将Service Account Token Creator IAM角色授予紧邻的前一个身份,列表中第一个账号将此角色授予原始账号(模板化的)。

REQUIRED_ATTRIBUTES: collections.abc.Iterable[str] = ('instance_id', 'table_id')[source]
template_fields: collections.abc.Sequence[str] = ('project_id', 'instance_id', 'table_id', 'impersonation_chain')[source]
project_id = None[source]
instance_id[source]
table_id[source]
initial_split_keys = [][source]
column_families[source]
gcp_conn_id = 'google_cloud_default'[source]
impersonation_chain = None[source]
execute(context)[source]

在创建操作符时派生。

上下文与渲染jinja模板时使用的字典相同。

请参阅 get_template_context 获取更多上下文。

class airflow.providers.google.cloud.operators.bigtable.BigtableDeleteTableOperator(*, instance_id, table_id, project_id=PROVIDE_PROJECT_ID, app_profile_id=None, gcp_conn_id='google_cloud_default', impersonation_chain=None, **kwargs)[source]

基类: airflow.providers.google.cloud.operators.cloud_base.GoogleCloudBaseOperator, BigtableValidationMixin

删除Cloud Bigtable表。

有关删除表的更多详细信息,请参阅参考资料:https://googleapis.github.io/google-cloud-python/latest/bigtable/table.html#google.cloud.bigtable.table.Table.delete

另请参阅

有关如何使用此 operator 的更多信息,请参阅指南:BigtableDeleteTableOperator

参数:
  • instance_id (str) – Cloud Bigtable 实例的 ID。

  • table_id (str) – 要删除的表的 ID。

  • project_id (str) – 可选,Google Cloud项目ID。如果设置为 None 或缺失,则使用Google Cloud连接中的默认 project_id。

  • app_profile_id (str | None) – 应用配置文件。

  • gcp_conn_id (str) – 用于连接到Google Cloud的连接ID。

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – 可选的服务账号,用于使用短期凭据进行模拟,或者获取列表中最后一个账号的access_token所需的账号链,该账号将在请求中被模拟。如果设置为字符串,该账号必须授予原始账号Service Account Token Creator IAM角色。如果设置为序列,列表中的身份必须将Service Account Token Creator IAM角色授予紧邻的前一个身份,列表中第一个账号将此角色授予原始账号(模板化的)。

REQUIRED_ATTRIBUTES: collections.abc.Iterable[str] = ('instance_id', 'table_id')[source]
template_fields: collections.abc.Sequence[str] = ('project_id', 'instance_id', 'table_id', 'impersonation_chain')[source]
project_id = None[source]
instance_id[source]
table_id[source]
app_profile_id = None[source]
gcp_conn_id = 'google_cloud_default'[source]
impersonation_chain = None[source]
execute(context)[source]

在创建操作符时派生。

上下文与渲染jinja模板时使用的字典相同。

请参阅 get_template_context 获取更多上下文。

class airflow.providers.google.cloud.operators.bigtable.BigtableUpdateClusterOperator(*, instance_id, cluster_id, nodes, project_id=PROVIDE_PROJECT_ID, gcp_conn_id='google_cloud_default', impersonation_chain=None, **kwargs)[source]

基类: airflow.providers.google.cloud.operators.cloud_base.GoogleCloudBaseOperator, BigtableValidationMixin

更新Cloud Bigtable集群。

有关更新 Cloud Bigtable 集群的更多详细信息,请参阅参考资料:https://googleapis.github.io/google-cloud-python/latest/bigtable/cluster.html#google.cloud.bigtable.cluster.Cluster.update

另请参阅

有关如何使用此 operator 的更多信息,请参阅指南:BigtableUpdateClusterOperator

参数:
  • instance_id (str) – Cloud Bigtable 实例的 ID。

  • cluster_id (str) – 要更新的 Cloud Bigtable 集群的 ID。

  • nodes (int) – Cloud Bigtable 集群所需的节点数。

  • project_id (str) – 可选,Google Cloud 项目的 ID。

  • gcp_conn_id (str) – 用于连接到Google Cloud的连接ID。

  • impersonation_chain (str | collections.abc.Sequence[str] | None) – 可选的服务账号,用于使用短期凭据进行模拟,或者获取列表中最后一个账号的access_token所需的账号链,该账号将在请求中被模拟。如果设置为字符串,该账号必须授予原始账号Service Account Token Creator IAM角色。如果设置为序列,列表中的身份必须将Service Account Token Creator IAM角色授予紧邻的前一个身份,列表中第一个账号将此角色授予原始账号(模板化的)。

REQUIRED_ATTRIBUTES: collections.abc.Iterable[str] = ('instance_id', 'cluster_id', 'nodes')[source]
template_fields: collections.abc.Sequence[str] = ('project_id', 'instance_id', 'cluster_id', 'nodes', 'impersonation_chain')[source]
project_id = None[source]
instance_id[source]
cluster_id[source]
nodes[source]
gcp_conn_id = 'google_cloud_default'[source]
impersonation_chain = None[source]
execute(context)[source]

在创建操作符时派生。

上下文与渲染jinja模板时使用的字典相同。

请参阅 get_template_context 获取更多上下文。

此条目是否有帮助?