Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 57 additions & 2 deletions packages/google-cloud-bigtable/google/cloud/bigtable/backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
class Backup(object):
"""Representation of a Google Cloud Bigtable Backup.

.. deprecated:: 2.30.0
Use :class:`google.cloud.bigtable_admin_v2.BigtableTableAdminClient` instead.

A :class: `Backup` can be used to:

* :meth:`create` the backup
Expand Down Expand Up @@ -301,6 +304,11 @@ def __ne__(self, other):
def create(self, cluster_id=None):
"""Creates this backup within its instance.

.. deprecated:: 2.30.0
Use
:meth:`google.cloud.bigtable_admin_v2.BigtableTableAdminClient.create_backup`
instead.

:type cluster_id: str
:param cluster_id: (Optional) The ID of the Cluster for the newly
created Backup.
Expand Down Expand Up @@ -342,6 +350,11 @@ def create(self, cluster_id=None):
def get(self):
"""Retrieves metadata of a pending or completed Backup.

.. deprecated:: 2.30.0
Use
:meth:`google.cloud.bigtable_admin_v2.BigtableTableAdminClient.get_backup`
instead.

:returns: An instance of
:class:`~google.cloud.bigtable_admin_v2.types.Backup`

Expand All @@ -358,7 +371,13 @@ def get(self):
return None

def reload(self):
"""Refreshes the stored backup properties."""
"""Refreshes the stored backup properties.

.. deprecated:: 2.30.0
Use
:meth:`google.cloud.bigtable_admin_v2.BigtableTableAdminClient.get_backup`
instead.
"""
backup = self.get()
self._source_table = backup.source_table
self._expire_time = backup._pb.expire_time
Expand All @@ -370,6 +389,11 @@ def reload(self):
def exists(self):
"""Tests whether this Backup exists.

.. deprecated:: 2.30.0
Use
:meth:`google.cloud.bigtable_admin_v2.BigtableTableAdminClient.get_backup`
instead.

:rtype: bool
:returns: True if the Backup exists, else False.
"""
Expand All @@ -378,6 +402,11 @@ def exists(self):
def update_expire_time(self, new_expire_time):
"""Update the expire time of this Backup.

.. deprecated:: 2.30.0
Use
:meth:`google.cloud.bigtable_admin_v2.BigtableTableAdminClient.update_backup`
instead.

:type new_expire_time: :class:`datetime.datetime`
:param new_expire_time: the new expiration time timestamp
"""
Expand All @@ -391,7 +420,13 @@ def update_expire_time(self, new_expire_time):
self._expire_time = new_expire_time

def delete(self):
"""Delete this Backup."""
"""Delete this Backup.

.. deprecated:: 2.30.0
Use
:meth:`google.cloud.bigtable_admin_v2.BigtableTableAdminClient.delete_backup`
instead.
"""
self._instance._client.table_admin_client.delete_backup(
request={"name": self.name}
)
Expand All @@ -404,6 +439,11 @@ def restore(self, table_id, instance_id=None):
progress of the operation and to cancel it. The ``response`` type is
``Table``, if successful.

.. deprecated:: 2.30.0
Use
:meth:`google.cloud.bigtable_admin_v2.BigtableTableAdminClient.restore_table`
instead.

:type table_id: str
:param table_id: The ID of the Table to create and restore to.
This Table must not already exist.
Expand Down Expand Up @@ -440,6 +480,11 @@ def restore(self, table_id, instance_id=None):
def get_iam_policy(self):
"""Gets the IAM access control policy for this backup.

.. deprecated:: 2.30.0
Use
:meth:`google.cloud.bigtable_admin_v2.BigtableTableAdminClient.get_iam_policy`
instead.

:rtype: :class:`google.cloud.bigtable.policy.Policy`
:returns: The current IAM policy of this backup.
"""
Expand All @@ -451,6 +496,11 @@ def set_iam_policy(self, policy):
"""Sets the IAM access control policy for this backup. Replaces any
existing policy.

.. deprecated:: 2.30.0
Use
:meth:`google.cloud.bigtable_admin_v2.BigtableTableAdminClient.set_iam_policy`
instead.

For more information about policy, please see documentation of
class `google.cloud.bigtable.policy.Policy`

Expand All @@ -471,6 +521,11 @@ def test_iam_permissions(self, permissions):
"""Tests whether the caller has the given permissions for this backup.
Returns the permissions that the caller has.

.. deprecated:: 2.30.0
Use
:meth:`google.cloud.bigtable_admin_v2.BigtableTableAdminClient.test_iam_permissions`
instead.

:type permissions: list
:param permissions: The set of permissions to check for
the ``resource``. Permissions with wildcards (such as '*'
Expand Down
73 changes: 73 additions & 0 deletions packages/google-cloud-bigtable/google/cloud/bigtable/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,11 @@ def name(self):
def get_iam_policy(self):
"""Gets the IAM access control policy for this table.

.. deprecated:: 2.30.0
Use
:meth:`google.cloud.bigtable_admin_v2.BigtableTableAdminClient.get_iam_policy`
instead.

For example:

.. literalinclude:: snippets_table.py
Expand All @@ -199,6 +204,11 @@ def set_iam_policy(self, policy):
"""Sets the IAM access control policy for this table. Replaces any
existing policy.

.. deprecated:: 2.30.0
Use
:meth:`google.cloud.bigtable_admin_v2.BigtableTableAdminClient.set_iam_policy`
instead.

For more information about policy, please see documentation of
class `google.cloud.bigtable.policy.Policy`

Expand Down Expand Up @@ -226,6 +236,11 @@ def test_iam_permissions(self, permissions):
"""Tests whether the caller has the given permissions for this table.
Returns the permissions that the caller has.

.. deprecated:: 2.30.0
Use
:meth:`google.cloud.bigtable_admin_v2.BigtableTableAdminClient.test_iam_permissions`
instead.

For example:

.. literalinclude:: snippets_table.py
Expand Down Expand Up @@ -254,6 +269,10 @@ def test_iam_permissions(self, permissions):
def column_family(self, column_family_id, gc_rule=None):
"""Factory to create a column family associated with this table.

.. deprecated:: 2.30.0
Use :class:`google.cloud.bigtable_admin_v2.BigtableTableAdminClient`
instead.
Comment thread
mutianf marked this conversation as resolved.
Resolved

For example:

.. literalinclude:: snippets_table.py
Expand Down Expand Up @@ -390,6 +409,11 @@ def __ne__(self, other):
def create(self, initial_split_keys=[], column_families={}):
"""Creates this table.

.. deprecated:: 2.30.0
Use
:meth:`google.cloud.bigtable_admin_v2.BigtableTableAdminClient.create_table`
instead.

For example:

.. literalinclude:: snippets_table.py
Expand Down Expand Up @@ -437,6 +461,11 @@ def create(self, initial_split_keys=[], column_families={}):
def exists(self):
"""Check whether the table exists.

.. deprecated:: 2.30.0
Use
:meth:`google.cloud.bigtable_admin_v2.BigtableTableAdminClient.get_table`
instead.

For example:

.. literalinclude:: snippets_table.py
Expand All @@ -457,6 +486,11 @@ def exists(self):
def delete(self):
"""Delete this table.

.. deprecated:: 2.30.0
Use
:meth:`google.cloud.bigtable_admin_v2.BigtableTableAdminClient.delete_table`
instead.

For example:

.. literalinclude:: snippets_table.py
Expand All @@ -470,6 +504,11 @@ def delete(self):
def list_column_families(self):
"""List the column families owned by this table.

.. deprecated:: 2.30.0
Use
:meth:`google.cloud.bigtable_admin_v2.BigtableTableAdminClient.get_table`
instead.

For example:

.. literalinclude:: snippets_table.py
Expand Down Expand Up @@ -498,6 +537,11 @@ def list_column_families(self):
def get_cluster_states(self):
"""List the cluster states owned by this table.

.. deprecated:: 2.30.0
Use
:meth:`google.cloud.bigtable_admin_v2.BigtableTableAdminClient.get_table`
instead.

For example:

.. literalinclude:: snippets_table.py
Expand Down Expand Up @@ -525,6 +569,11 @@ def get_cluster_states(self):
def get_encryption_info(self):
"""List the encryption info for each cluster owned by this table.

.. deprecated:: 2.30.0
Use
:meth:`google.cloud.bigtable_admin_v2.BigtableTableAdminClient.get_table`
instead.

Gets the current encryption info for the table across all of the clusters. The
returned dict will be keyed by cluster id and contain a status for all of the
keys in use.
Expand Down Expand Up @@ -873,6 +922,11 @@ def sample_row_keys(self):
def truncate(self, timeout=None):
"""Truncate the table

.. deprecated:: 2.30.0
Use
:meth:`google.cloud.bigtable_admin_v2.BigtableTableAdminClient.drop_row_range`
instead.

For example:

.. literalinclude:: snippets_table.py
Expand Down Expand Up @@ -905,6 +959,11 @@ def truncate(self, timeout=None):
def drop_by_prefix(self, row_key_prefix, timeout=None):
"""

.. deprecated:: 2.30.0
Use
:meth:`google.cloud.bigtable_admin_v2.BigtableTableAdminClient.drop_row_range`
instead.

For example:

.. literalinclude:: snippets_table.py
Expand Down Expand Up @@ -977,6 +1036,10 @@ def mutations_batcher(
def backup(self, backup_id, cluster_id=None, expire_time=None):
"""Factory to create a Backup linked to this Table.

.. deprecated:: 2.30.0
Use :class:`google.cloud.bigtable_admin_v2.BigtableTableAdminClient`
instead.
Comment thread
mutianf marked this conversation as resolved.
Resolved

:type backup_id: str
:param backup_id: The ID of the Backup to be created.

Expand All @@ -1001,6 +1064,11 @@ def backup(self, backup_id, cluster_id=None, expire_time=None):
def list_backups(self, cluster_id=None, filter_=None, order_by=None, page_size=0):
"""List Backups for this Table.

.. deprecated:: 2.30.0
Use
:meth:`google.cloud.bigtable_admin_v2.BigtableTableAdminClient.list_backups`
instead.

:type cluster_id: str
:param cluster_id: (Optional) Specifies a single cluster to list
Backups from. If none is specified, the returned list
Expand Down Expand Up @@ -1111,6 +1179,11 @@ def restore(self, new_table_id, cluster_id=None, backup_id=None, backup_name=Non
can be used to track the progress of the operation and to cancel it.
The ``response`` type is ``Table``, if successful.

.. deprecated:: 2.30.0
Use
:meth:`google.cloud.bigtable_admin_v2.BigtableTableAdminClient.restore_table`
instead.

:type new_table_id: str
:param new_table_id: The ID of the Table to create and restore to.
This Table must not already exist.
Expand Down
Loading